Master boot record

From Free net encyclopedia

(Redirected from MBR)

In the IBM PC architecture the Master Boot Record (MBR), or partition sector, is the 512-byte 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 MBR in the boot process

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.

Because the i386 family of processors boot up in real mode, the sequence of machine language commands in the master boot record will be executed in real mode, even when the operating system to be loaded will spend most of its time in protected mode.

Technically, only partitioned media contains a master boot record; while unpartitioned media only has a boot sector as the first sector. In both cases the BIOS init transfers control to the first sector of the disk after reading it into memory. A legacy MBR contains partition selection code which loads and runs the boot (first) sector of the selected primary partition. That partition boot sector would contain another boot loader. Newer MBRs, however, can directly load the next stage from an arbitrary location on the hard drive. This can pose some problems with dual-booting, as the boot loader whose location is coded into the MBR must be configured to load each operating system. If one operating system must be reinstalled, it may overwrite the MBR such that it will load a different boot loader.

Layout of Master Boot Record

 address function
|=====================================|
| 0x0000 Code Area (440 Bytes max.)   |
|=====================================|
| 0x01B8  4 byte disk serial number   | (Used by Windows 2000 
|         2 bytes null (0)            | and newer.) 
|=====================================|
| 0x01BE 16 byte partition table entry|
|=====================================|
| 0x01CE 16 byte partition table entry|
|=====================================|
| 0x01DE 16 byte partition table entry|
|=====================================|
| 0x01EE 16 byte partition table entry|
|=====================================|
| 0x01FE 2 byte MBR signature (0xAA55)|
|=====================================|

See also

External links

es:Master Boot Record fr:Master boot record it:Master boot record he:Master boot record nl:Master boot record ja:MBR pl:Master Boot Record pt:Master Boot Record ru:Загрузочный сектор sv:Master Boot Record vi:Boot record zh:MBR