Search code examples
freebsdbootmbr

Difference between boot0.S and mbr.S in FreeBSD


I'm reading source code of FreeBSD and found that they have 2 files which may be used to create MBR - sys/boot/i386/boot0/boot0.S and sys/boot/i386/mbr/mbr.S. From current my understanding boot0.S is the code in MBR (first sector of boot disk drive which is loaded by BIOS) in FreeBSD.

Then what is the mbr.S? What is the relationship between them?

I'm reading source code from FreeBSD 8.2.0.


Solution

  • boot0.S contains the MBR for the Boot Easy boot manager, that allows selecting an OS to boot. mbr.S contains a generic MBR that just boots the active partition.

    You should take a look at the FreeBSD handbook.