Subject: Re: Booting: a bit off topic
To: Ken Hornstein <kenh@cmf.nrl.navy.mil>
From: None <rvb@sicily.odyssey.cs.cmu.edu>
List: port-i386
Date: 07/13/1998 20:07:14
Ken Hornstein <kenh@cmf.nrl.navy.mil> writes:

> >Let me clarify. The process of the MBR bootstrapping the netbsd system and
> >the kernel.
> 
> You should really get rid of "MBR", because NetBSD doesn't require an
> MBR to boot, even on the i386.
> 
> What happens in a general sort of way is that the BIOS looks at a special
> spot on the disk to find the boot block.  It loads this boot block into
> memory and executes it.

This needs a little clarification:   BIOS reads sector 0 of the disk.
It reads this block into memory and executes it.  This block is the
MBR.  Thus there really is code, old legacy code in the MBR.  What the
code does is looks for the active partition in the MBR.  It uses the 
C/H/S info in the MBR record to bring in the 0 block of the active
partition. Then it executes this "secondary" boot info.  (Which will
typically read block 0 again [the MBR] to find out where it should
be reading its os from.

> 
> The boot block is something that's a little smarter than the BIOS.  It
> knows something about the operating system that it's going to boot.  In
> the case of NetBSD, the NetBSD boot block knows how to search the root
> filesystem on the disk, open up a particular file (in this case, "netbsd"),
> load it, and execute it.  Then the kernel starts running, and normal
> Unix things start to happen.
> 
> Obviously I'm skipping a lot of things here (the kernel has to do a lot
> of bootstrapping for itself at first), but that's the general sort of
> things that happen: Hardware loads the boot block, the boot block loads
> the kernel.  If you want more specifics, you can look at the boot blocks
> (/sys/arch/i386/stand).
> 
> --Ken