master boot record

Programming, for all ages and all languages.
Post Reply
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

master boot record

Post by Gavin »

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.
jzgriffin
Member
Member
Posts: 190
Joined: Tue Sep 26, 2006 1:40 pm
Libera.chat IRC: Nokurn
Location: Ontario, CA, USA
Contact:

Post by jzgriffin »

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
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

Post by Gavin »

Hi Jeremiah.

I've read that a few weeks ago but what i'm trying to say is how do i incorporate that into my actual code.
Do i just put it at a certain offset say in my nasm code say 446 ?
User avatar
devel
Member
Member
Posts: 62
Joined: Wed Nov 28, 2007 4:15 am
Contact:

Post by devel »

Partition table in c language can be simply represented by 64bytes static structure:

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,
};
As you wrote the offset shall be 446 bytes.
Post Reply