home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / SYQUEST / SQHDX / PART.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  3.7 KB  |  135 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.  *
  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. #define    PART struct _part    /* partition */
  20. PART {
  21.     BYTE p_flg;                /* flag byte */
  22.     BYTE p_id[3];            /* three bytes partition ID */
  23.     long p_st;                /* partition starting sector */
  24.     long p_siz;                /* partition size in sectors */
  25. };
  26.  
  27. /*
  28.  * Bits in p_flg:
  29.  */
  30. #define    P_BOOTBIT    0x80        /* 0x80, boot this partition */
  31. #define    P_EXISTS    0x01        /* 0x01, partition exists */
  32.  
  33.  
  34. /*
  35.  * Format information is used by the Atari
  36.  * Hard Disk Format Utility to get default
  37.  * parameters for formatting the device.
  38.  *
  39.  * This is an image of part of the "set mode"
  40.  * command.
  41.  *
  42.  */
  43. #define    HINFO struct _hinfo    /* formatting information */
  44. HINFO {
  45.     UWORD hi_cc;            /* cylinder count MSB / LSB */
  46.     BYTE hi_dhc;            /* number of heads */
  47.     UWORD hi_rwcc;            /* reduced write current cyl */
  48.     UWORD hi_wpc;            /* write precomp cyl */
  49.     BYTE hi_lz;                /* landing zone */
  50.     BYTE hi_rt;                /* step rate code */
  51.     BYTE hi_in;                /* interleave factor */
  52.     BYTE hi_spt;            /* sectors-per-track */
  53. };
  54.  
  55.  
  56. /*
  57.  * Root sector;
  58.  * This lives on physical sector zero
  59.  * of the device, and describes the device.
  60.  *
  61.  * The structure starts at 0x200 - sizeof(RSECT).
  62.  *
  63.  * longs are in 68000 format.
  64.  *
  65.  */
  66. #define    RSECT struct _rsect    /* root sector */
  67. RSECT {
  68.     HINFO hd_info;            /* formatting information */
  69.     long hd_siz;            /* size of disk, in sectors */
  70.     PART hd_p[4];            /* four partitions */
  71.     long bsl_st;            /* start of bad sector list */
  72.     long bsl_cnt;            /* end of bad sector list */
  73.     UWORD hd_reserved;            /* (reserved word) */
  74. };
  75.  
  76.  
  77. /*
  78.  * Boot sector format.
  79.  * This is identical to that on a floppy disk.
  80.  * '*'d entries are valid values in the boot sector.
  81.  *
  82.  */
  83. #define    BOOT struct _boot
  84. BOOT {
  85.     BYTE b_bra[2];        /*    usually BRA.S to code */
  86.     BYTE b_filler[6];        /*    OEM field, "Loader" or "HDLoad" */
  87.     BYTE b_serial[3];        /*    serial number */
  88.     BYTE b_bps[2];        /* *  bytes per sector */
  89.     BYTE b_spc;            /* *  sectors per cluster */
  90.     BYTE b_res[2];        /* *  number of reserved sectors */
  91.     BYTE b_nfats;        /* *  number of FATs */
  92.     BYTE b_ndirs[2];        /* *  number of root directory entries */
  93.     BYTE b_nsects[2];        /* *  number of sectors on media */
  94.     BYTE b_media;        /* *  media descriptor flag */
  95.     BYTE b_spf[2];        /* *  number of sectors/FAT */
  96.     BYTE b_spt[2];        /*    number of sectors/track */
  97.     BYTE b_nsides[2];        /*    number of sides on media */
  98.     BYTE b_nhid[2];        /*    number of hidden sectors */
  99. };
  100.  
  101.  
  102.  
  103. /*
  104.  * `set_mode' parameter format
  105.  * (22 bytes long + 10 wasted bytes)
  106.  *
  107.  */
  108. #define    SETMODE    struct __setmode
  109. SETMODE {
  110.     BYTE smd_xxxx[3];        /* three bytes of zero */
  111.     BYTE smd_8;            /* 0x08 */
  112.     BYTE smd_yyyy[5];        /* five more zero bytes */
  113.     BYTE smd_bs[3];        /* block size MSB, MIDSB, LSB (0x000200) */
  114.     BYTE smd_1;            /* 0x01 */
  115.     BYTE smd_cc[2];        /* cylinder count MSB LSB */
  116.     BYTE smd_dhc;        /* data head count */
  117.     BYTE smd_rwc[2];        /* reduced-write cylinder MSB LSB */
  118.     BYTE smd_wpc[2];        /* write-precomp cylinder MSB LSB */
  119.     BYTE smd_lz;        /* landing zone */
  120.     BYTE smd_rt;        /* stepping pulse rate code */
  121. };
  122.  
  123.  
  124. /*
  125.  * Logical to physical device mapping table.
  126.  *
  127.  */
  128. #define LOGMAP struct _logmap
  129. LOGMAP {
  130.     int lm_physdev;        /* physical dev# (or -1) */
  131.     int lm_partno;        /* partition number on dev */
  132.     SECTOR lm_start;        /* physical starting block# of partition */
  133.     int lm_siz;            /* partition size */
  134. };
  135.