[lug] boot loader mystery
David L. Anselmi
anselmi at anselmi.us
Mon Jan 29 20:24:24 MST 2007
karl horlen wrote:
[...]
> So disk locations would seem to be necessary.
> I think that might be what that map file is for in
> lilo? And that's probably why you need to rerun lilo
> every time you make a change to it. But I'm wondering
> how grub knows the physical location of /boot?
The BIOS provides a service that reads the disk using block addresses.
They used to be specified as cylinder, head, sector triplets but modern
stuff may be different.
As stated, the BIOS (built in or extension from the controller) knows
enough to load the MBR at boot time. The boot loader talks to the disk
using the BIOS routines.
LILO stores the block addresses of the kernel and initrd. GRUB knows
how to read a filesystem, so it reads the superblock for the appropriate
partition, decodes the directory entries, and finds the files. I'd
guess it does all that using the BIOS routines so in some ways it
duplicates the FS driver functions. The kernel doesn't use the BIOS
routines once it has smarter drivers loaded.
Dave
More information about the LUG
mailing list