Active slice, only for a next boot

John Baldwin jhb at freebsd.org
Tue May 31 15:01:28 UTC 2011


On Monday, May 30, 2011 1:42:39 pm Dieter BSD wrote:
> And it works great.  Except that one of the 27 stages of boot
> code that FreeBSD uses INSISTS on booting the active slice,
> so you can tell the MBR to boot slice 3 and slice 3's boot
> code sees that slice 4 is active and boots slice 4.

There are only 3 stages, and boot1.S is what looks at the active slice.  
Unfortunately it doesn't have a better way to do this as the only input it 
gets from boot0 or any other MBR boot loader is the BIOS drive number in %dl.
I'm not sure how else you would detect that a non-active slice was booted from 
when that is your only input.

One could define some extended structure to pass that information and send it
in a register, but you'd still have to cope with MBR boot loaders that don't 
pass it (e.g. the Windows ones if you are dual-booting with Windows) and you'd 
need to have some sanity checks to make sure one doesn't treat garbage input 
as valid.

-- 
John Baldwin


More information about the freebsd-hackers mailing list