The MBR
The MBR(Master Boot Record) is the very first sector
of a physical disk(not a floppy). If this disk is the disk of which the system will boot,
this sector is also the very first sector that is being loaded to memory, and executed.
This is done by the bios at startup. Because of this, this sector has to start with valid
80x86 code. This can be a few things, it can be the Linux Bootloader, Lilo, the windows
bootloader -OR- the V2_OS Bootloader, or something completely different. Note that a
sector is just 512 bytes, so it's first task is too study the disk, and see if it can load
more sectors and pass control to them. This is done through the partition table.
When the MBR code has scanned the partition table and found a partition marked as
active, it positions the HD-heads, loads the first sector of that partition into memory,
and executes it. This first sector of a partition is called a 'BootSector'. The MBR is
free to choose a location for this BootSector.
The MBR of the V2_FS does not necessarily have to be the V2_OS MBR as long as this
MBR performs all task described above, and has a valid partitiontable, and does not rely
on extra sectors.
The MBR Format:
Offset | Description | |
0000h | 1BEh | 80X86 code to locate a bootable partition from the partitiontables(possibly on other disks too), load it, and execute it. |
01BEh | 10h | Partition Table Entry #1 |
01CEh | 10h | Partition Table Entry #2 |
01DEh | 10h | Partition Table Entry #3 |
01EEh | 10h | Partition Table Entry #4 |
01FEh | 2 | MBR Signature AA55h |
Partition Table Entry:
Offset | Description | |
0000h | 1h | 80h means this partition has a valid BootSector. 0h means it has not.(This field corresponds to the 'active' option in fdisk under dos/windows) |
0001h | 1h | First Head of this sector |
0002h | 1h | First Sector of this partition |
0003h | 1h | First Cylinder of this sector |
0004h | 1h | FileSystem Indicator. 33h for V2_FS, for other ID's, click here |
0005h | 1h | Last Head of this sector |
0006h | 1h | Last Sector of this partition |
0007h | 1h | Last Cylinder of this partition |
0008h | 4h | DWord relative(Absolute) starting sector |
000Ch | 4h | DWord relative(Absolute) starting sector |
Extended partitions:
Some filesystems support 'Extended partitions'. This means that on the
bootsector of this partition, there is no 80x86 code, but another MBR Structure, including
another partition table ! Extended partitions can therefore never be Bootable or Active.
NOTE: The V2_OS
MBR is not available yet, but you can use any other MBR just the same...