Hi i've been reading alot about the master boot record and i'm a few days away from programing my own.
I'm a litte confussed because all the papers i find don't show anything about the partition table and how it's created .
Do i just use some sort of struct or what?
Thanks alot.
master boot record
-
- Member
- Posts: 190
- Joined: Tue Sep 26, 2006 1:40 pm
- Libera.chat IRC: Nokurn
- Location: Ontario, CA, USA
- Contact:
Partition tables are 16-bytes in size for each entry. Here is a good guide that I've used in the past, first hit on Google for "partition table":
http://ata-atapi.com/hiwtab.htm
http://ata-atapi.com/hiwtab.htm
Partition table in c language can be simply represented by 64bytes static structure:
As you wrote the offset shall be 446 bytes.
Code: Select all
__attribute__((aligned(1))) static unsigned char partTbl[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};