tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch: MFSv3 support (libsa) for boot2 (i386)

On Thu, Dec 29, 2011 at 07:55:18PM +0100, Antoine LECA wrote:
> David Laight wrote:
> > The actual 'pc' boot sequence is:
> > Stages 1-3 (and maybe 4) are common to all OS.
> <...>
> > 3) The pbr code has to determine where it was loaded from, it could:
> >    a) reread sector zero and look for a partition of the relevant type
> >    b) have the sector number previously written into the sector data.
>      c)
> >    The netbsd bootselect mbr passes the sector number in a register
> >    (non-standard) and the pbr code scans the partitions looking for
> >    one that starts in the correct place.
> I am not sure whether NetBSD currently uses a or c (or a combination of
> both); ...

Last time I rewrote it, it reread the mbr and located the partition
(following the extended/logical partition chain) looking for the
one that starts in the sector passed in (IIRC) %esi. If not found
it rescans looking for thr first netbsd partition.

I used %esi because it reduced the number of instructions in the mbr!
The mbr is a work of art!


David Laight:

Home | Main Index | Thread Index | Old Index