home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / HDX_BACK / HDXPCH / PART.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  4.1 KB  |  151 lines

  1. /* part.h */
  2.  
  3. /*
  4.  *
  5.  * Atari Hard Disk
  6.  * Boot sector and partitioning structures.
  7.  *
  8.  *----
  9.  * 24-Feb-1986 lmd   Structures from documentation.
  10.  * 15-Aug-1988 jye     Add the dynamic partition structure.
  11.  */
  12.  
  13.  
  14. /*
  15.  * Partition entry;
  16.  * There are four of these on the root sector;
  17.  * longs are in 68000 format.
  18.  */
  19.  
  20. #define    DEVSET struct _devset    /* identify each device  */
  21. DEVSET    {
  22.     BYTE flg;
  23.     int dev;
  24.     char *id;
  25. };
  26.  
  27. #define    PART struct _part    /* partition */
  28. PART {
  29.     BYTE p_flg;                /* flag byte */
  30.     BYTE p_id[3];            /* three bytes partition ID */
  31.     long p_st;                /* partition starting sector */
  32.     long p_siz;                /* partition size in sectors */
  33. };
  34.  
  35. #define    DPART struct _dpart    /* the dynamic partition block*/
  36. DPART {
  37.     BYTE flg;                /* flag byte */
  38.     long siz;                /* partition size in sectors */
  39.     DPART *next;            /* the pointer point to next block */
  40. };
  41.  
  42. /*
  43.  * Bits in p_flg:
  44.  */
  45. #define    P_BOOTBIT    0x80        /* 0x80, boot this partition */
  46. #define    P_EXISTS    0x01        /* 0x01, partition exists */
  47. #define    P_NEXISTS    0x00        /* 0x00, partition does not exists */
  48.  
  49.  
  50. /*
  51.  * Format information is used by the Atari
  52.  * Hard Disk Format Utility to get default
  53.  * parameters for formatting the device.
  54.  *
  55.  * This is an image of part of the "set mode"
  56.  * command.
  57.  *
  58.  */
  59. #define    HINFO struct _hinfo    /* formatting information */
  60. HINFO {
  61.     UWORD hi_cc;            /* cylinder count MSB / LSB */
  62.     BYTE hi_dhc;            /* number of heads */
  63.     UWORD hi_rwcc;            /* reduced write current cyl */
  64.     UWORD hi_wpc;            /* write precomp cyl */
  65.     BYTE hi_lz;                /* landing zone */
  66.     BYTE hi_rt;                /* step rate code */
  67.     BYTE hi_in;                /* interleave factor */
  68.     BYTE hi_spt;            /* sectors-per-track */
  69. };
  70.  
  71.  
  72. /*
  73.  * Root sector;
  74.  * This lives on physical sector zero
  75.  * of the device, and describes the device.
  76.  *
  77.  * The structure starts at 0x200 - sizeof(RSECT).
  78.  *
  79.  * longs are in 68000 format.
  80.  *
  81.  */
  82. #define    RSECT struct _rsect    /* root sector */
  83. RSECT {
  84.     HINFO hd_info;            /* formatting information */
  85.     long hd_siz;            /* size of disk, in sectors */
  86.     PART hd_p[4];            /* four partitions */
  87.     long bsl_st;            /* start of bad sector list */
  88.     long bsl_cnt;            /* end of bad sector list */
  89.     UWORD hd_reserved;            /* (reserved word) */
  90. };
  91.  
  92.  
  93. /*
  94.  * Boot sector format.
  95.  * This is identical to that on a floppy disk.
  96.  * '*'d entries are valid values in the boot sector.
  97.  *
  98.  */
  99. #define    BOOT struct _boot
  100. BOOT {
  101.     BYTE b_bra[2];        /*    usually BRA.S to code */
  102.     BYTE b_filler[6];        /*    OEM field, "Loader" or "HDLoad" */
  103.     BYTE b_serial[3];        /*    serial number */
  104.     BYTE b_bps[2];        /* *  bytes per sector */
  105.     BYTE b_spc;            /* *  sectors per cluster */
  106.     BYTE b_res[2];        /* *  number of reserved sectors */
  107.     BYTE b_nfats;        /* *  number of FATs */
  108.     BYTE b_ndirs[2];        /* *  number of root directory entries */
  109.     BYTE b_nsects[2];        /* *  number of sectors on media */
  110.     BYTE b_media;        /* *  media descriptor flag */
  111.     BYTE b_spf[2];        /* *  number of sectors/FAT */
  112.     BYTE b_spt[2];        /*    number of sectors/track */
  113.     BYTE b_nsides[2];        /*    number of sides on media */
  114.     BYTE b_nhid[2];        /*    number of hidden sectors */
  115. };
  116.  
  117.  
  118.  
  119. /*
  120.  * `set_mode' parameter format
  121.  * (22 bytes long + 10 wasted bytes)
  122.  *
  123.  */
  124. #define    SETMODE    struct __setmode
  125. SETMODE {
  126.     BYTE smd_xxxx[3];        /* three bytes of zero */
  127.     BYTE smd_8;            /* 0x08 */
  128.     BYTE smd_yyyy[5];        /* five more zero bytes */
  129.     BYTE smd_bs[3];        /* block size MSB, MIDSB, LSB (0x000200) */
  130.     BYTE smd_1;            /* 0x01 */
  131.     BYTE smd_cc[2];        /* cylinder count MSB LSB */
  132.     BYTE smd_dhc;        /* data head count */
  133.     BYTE smd_rwc[2];        /* reduced-write cylinder MSB LSB */
  134.     BYTE smd_wpc[2];        /* write-precomp cylinder MSB LSB */
  135.     BYTE smd_lz;        /* landing zone */
  136.     BYTE smd_rt;        /* stepping pulse rate code */
  137. };
  138.  
  139.  
  140. /*
  141.  * Logical to physical device mapping table.
  142.  *
  143.  */
  144. #define LOGMAP struct _logmap
  145. LOGMAP {
  146.     int lm_physdev;        /* physical dev# (or -1) */
  147.     int lm_partno;        /* partition number on dev */
  148.     SECTOR lm_start;        /* physical starting block# of partition */
  149.     SECTOR lm_siz;            /* partition size */
  150. };
  151.