Boot Sequence: Difference between revisions

Jump to navigation Jump to search
m
→‎Master Boot Record: They are bytes 511 and 512 although the zero-based numbering is probably better - this makes it clearer
[unchecked revision][unchecked revision]
(Byte indexing starts from 0)
m (→‎Master Boot Record: They are bytes 511 and 512 although the zero-based numbering is probably better - this makes it clearer)
Line 5:
== Master Boot Record ==
 
The (legacy) BIOS checks bootable devices for a boot signature, a so called magic number. The boot signature is in a boot sector (sector number 0) and it contains the byte sequence 0x55, 0xAA inat bytesbyte offsets 510 and 511 respectively. When the BIOS finds such a boot sector, it is loaded into memory at <tt>0x0000:0x7c00</tt> (segment 0, address 0x7c00). (However, some BIOS' load to <tt>0x7c0:0x0000</tt> (segment 0x07c0, offset 0), which resolves to the same physical address, but can be surprising. A good practice is to enforce CS:IP at the very start of your boot sector.)
 
Execution is then transferred to the freshly loaded boot record. On a floppy disk, all 512 bytes of the boot record may contain executable code. On a hard drive, the [[MBR (x86)|Master Boot Record]] (MBR) holds executable code at offset 0x0000 - 0x01bd, followed by table entries for the four [[Partition Table|primary partitions]], using sixteen bytes per entry (0x01be - 0x01fd), and the two-byte signature (0x01fe - 0x01ff).
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu