Master boot record
|
In the IBM PC architecture the master boot record (MBR), or partition sector, is the 512-byte (½ kilobyte) boot sector, i.e. the sector on the logical beginning of a hard disk that contains the sequence of commands necessary for booting the operating system(s) (OSes).
The bootstrapping firmware contained within the ROM BIOS loads and executes the master boot record. The MBR of a drive usually includes the drive's partition table, which the PC uses to load and run the boot record of the partition that is marked with the active flag. This design allows the BIOS to load any OS without knowing exactly where to start inside its partition. Because the MBR is read almost immediately when the computer is started, many computer viruses made in the era before virus scanner software became widespread operated by changing the code within the MBR.
The sequence of assembly language commands in the master boot record operates in real mode, even when the operating system to be loaded works (most of the time) in protected mode.
In the boot process, it differs whether from partitioned media or not. In both cases the BIOS init transfers control to the first sector of the disk after reading it into memory. If the disk is partitioned, the sector contains partition selection code which reads *the first sector of the selected partition* into its place and transfers control to it, while if the disk does not have partitions then this sector is the one which loads the OS.
Sample master boot record
|=============================| | ~First 446 bytes~ | |=============================| |16 byte partition table entry| |=============================| |16 byte partition table entry| |=============================| |16 byte partition table entry| |=============================| |16 byte partition table entry| |=============================| |2 byte MBR signature (0x55AA)| |=============================|
See also
External links
- How it Works: Master Boot Record (http://www.ata-atapi.com/hiwmbr.htm)de:Master Boot Record
es:Master Boot Record fr:Master boot record it:MBR ja:MBR pl:Master Boot Record pt:Master Boot Record zh:MBR