Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!pdxgate!eecs!berggren From: berggren@eecs.cs.pdx.edu (Eric Berggren) Newsgroups: comp.sys.ibm.pc.hardware Subject: Re: Partition table Message-ID: <2218@pdxgate.UUCP> Date: 4 Apr 91 09:17:14 GMT References: Sender: news@pdxgate.UUCP Distribution: comp Lines: 50 achilles@unixland.uucp (David Holland) writes: >Owing to some recent computer trouble I've been poking somewhat deeper into >my system than usual, and I noticed the following interesting oddity about >the partition table: there are only two partitions listed, The partition table allows up to four physical partitions on a fixed disk. >>one of which is >twice as large as the other, and only one of them is marked DOS. The disk >contains three equal-sized partitions, all of which are DOS; where is this >information stored? Or does Norton's partition-table editor mislead me? > This could be a result of several versions of DOS used, or a less than 32-meg partition (viewable) and a greater than 32-meg partition (which is of a different type and may not be readable by older utilities) This, of course, depends on your setup. (I never really cared for Norton. I'm currently working on a disk partition-table editor myself, which recongnizes all of the currently known partition types and allows the users to add, modify, and delete partitions of any type. If you want a copy of it when I finish it, lemme know and I'll swing you a copy.) Anyway, the partition table is stored in the first sector in the first track of the harddrive starting at offset 0x1be. Reading in 4 entries from that offset will be the partition table. Here's the structure I'm using: #define MAXPARTITIONS 4 typedef struct { unsigned char active; /* 80h is active; 00h if not */ unsigned char start_head; /* head of first sector */ unsigned char start_sec; /* first sector + 2 MSB's of cyl */ unsigned char start_cyl; /* cylinder of first sector */ unsigned char type; /* partition type (OS who owns it) */ unsigned char end_head; /* head of last sector */ unsigned char end_sec; /* last sector + 2 MSB'd of cyl */ unsigned char end_cyl; /* cylinder of last sector */ unsigned long abs_sec; /* absolute starting sector */ unsigned long num_sec; /* total sectors in partition */ } Part_Entry; Part_Entry PartTable[ MAXPARTITIONS ]; /* partition table for current drive*/ Hope this helps... -e.b. ============================================================================== Eric Berggren | "The force of the 'Dark Side' eminates from Computer Science/Eng. | the ominous DeathStar looming overhead." berggren@eecs.cs.pdx.edu | - Down with AT&T! -