Hard Disk Partitioning The first sector (logical sector #0) on a hard disk con- tains partition information. offset +-----------------------+ | hd_siz | $1c2 | | +-----------------------+ | p0_flg | $1c6 | p0_id | $1c7 | p0_st | $1ca | | | p0_siz | $1ce | | +-----------------------+ | p1_flg | $1d2 | p1_id | $1d3 | p1_st | $1d6 | | | p1_siz | $1da | | +-----------------------+ | p2_flg | $1de | p2_id | $1df | p2_st | $1e2 | | | p2_siz | $1e6 | | +-----------------------+ | p3_flg | $1ea | p3_id | $1eb | p3_st | $1ee | | | p3_siz | $1f2 | | +-----------------------+ | bsl_st | $1f6 | | | bsl_cnt | $1fa | | +-----------------------+ | (reserved) | $200 +-----------------------+ 'hd_siz' is the total size of the disk, in logical sec- tors. 'bsl_st' specifies the starting sector# of the bad sector list. [Typically the bad sector list will be located at the end of the device.] 'bsl_cnt' specifies the /number/ of bad sectors. Each bad sector is specified by a longword containing the sector's number. The total number of sectors used up by the bad sector list is therefore 'bsl_siz' / 4. If 'bsl_cnt' is zero, there are no bad sectors. A disk may contain up to four partitions. The first sec- tor in a partition is a boot sector (which, on the ST, will contain a BPB). +-----------------------+ | root boot | +-----------------------+ +-----------------------+ | partition 0 | | | +-----------------------+ +-----------------------+ | partition 1 | | (optional) | +-----------------------+ +-----------------------+ | partition 2 | | (optional) | +-----------------------+ +-----------------------+ | partition 3 | | (optional) | +-----------------------+ +-----------------------+ | optional | | bad sector | | list | +-----------------------+ Each partition is described by a 12-byte structure: +-----------------------+ | p*_flg | (+0) +-----------------------+ | p*_id | (+1) | | | | +-----------------------+ | p*_st | (+4) | | | | | | +-----------------------+ | p*_siz | (+8) | | | | | | +-----------------------+ (+12.) 'p*_flg' should be nonzero to indicate that the partition exists. The BIOS will boot the first partition that has bit 7 set in this byte. 'p*_id' is a three-byte field that identifies the parti- tion. For GEMDOS partitions, the field contain the three ascii characters "GEM". 'p*_st' specifies the logical sector number of the begin- ning of the partition. 'p*_siz' specifies the size of the partition, in logical sectors.