Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!mcrware!ric From: ric@mcrware.UUCP (Ric Yeates) Newsgroups: comp.sys.atari.st.tech Subject: Hard Disk Sector 0 Questions Summary: Need help with partitioning software Keywords: partition sector 0 hard disk Message-ID: <5208@mcrware.UUCP> Date: 6 Mar 91 16:40:09 GMT Reply-To: ric@mcrware.UUCP (Ric Yeates) Organization: Microware Systems Corp., Des Moines, Iowa Lines: 57 Netlanders: I need to write some software to add partitions to the partition table stored on sector 0 of a hard disk. I will be adding partitions for the areas that are not yet used on the disk. For instance, Joe User has a 80Meg drive and sets up two 30Meg partitions with HDX.PRG. My program wants to then go in there (at the request of the user) and add a partition or two in the unused 20Meg of space. These are not to be GEM partitions, but they should conform as far as the partition table information is concerned. What I've been able to figure out so far is: * the partition table starts at 0x1c7 * the table entries are in the following form: struct part_entry { char name[3]; long start; /* 32-bit sector number */ long length; /* 32-bit length in sectors */ char flag; /* 1 byte flag where 0x01 means bootable */ }; * offset 0x1c2 is the start of a 32-bit value for the total number of sectors on the device My questions are: 1. Is any of the above information inaccurate? Incomplete? 2. What is the significance of the byte at 0x1c6 (sandwiched between the total sectors and the partition table)? On my drive it has the value 0x81 (%10000001). 3. Is there other information in this sector that I will need to write a partitioner? 4. Is there a checksum/parity value kept for sector 0? How does HDX3.01 know it was used to format the hard disk? 5. How might an application read sector 0? All the GEMDOS calls I found dealt with files only, not the whole device. 6. Are there any decent/recent books on this sort of thing? I suppose that's enough for now. Thanks in advance for any help that you may be able to provide. Ric Yeates -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Ric Yeates Microware Systems Corp. "I found these opinions on the floor, so I don't think they belong to Microware." 1. Grease Generously 2. Wax Philosophically -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=