Partition Table

From OSDev.wiki
Revision as of 09:16, 25 March 2007 by osdev>Jhawthorn
Jump to navigation Jump to search

Template:Convert

The information about primary partitions and an extended partition is contained in the Partition Table, a 64-byte data structure located in the first sector (cylinder 0, head 0, sector 1) of the hard drive. The Partition Table conforms to a standard layout that is independent of the operating system. Each Partition Table entry is 16 bytes long, making a maximum of four entries available. Each entry starts at a predetermined offset from the beginning of the sector, as follows:

Partition number Offset
Partition 1 0x01BE (446)
Partition 2 0x01CE (462)
Partition 3 0x01DE (478)
Partition 4 0x01EE (494)


Each entry has the following structure:

Element Size Description
0 byte Boot indicator, 00 = no, 80 = bootable
1 byte Starting head
2 6 bits Starting sector (Bits 6-7 are the upper two bits for the Starting Cylinder field.)
3 10 bits Starting Cylinder
4 byte System ID
5 byte Ending Head
6 6 bits Ending Sector (Bits 6-7 are the upper two bits for the ending cylinder field)
7 10 bits Ending Cylinder
8 dword Relative Sector (to start of partition)
12 dword Total Sectors in partition