home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1035 / romtable.h < prev    next >
C/C++ Source or Header  |  1990-12-28  |  2KB  |  64 lines

  1. /*
  2. **    romtable.h
  3. **        What a drive type table entry looks like in ROM
  4. **        (The disk geometry table)
  5. **
  6. **    $Header: romtable.h,v 1.1 88/04/07 23:12:17 root Alpha $
  7. **
  8. **    The ROM type diskinfo is:
  9. **
  10. **        0                2        3        4       5                  7
  11. **    +--------+-------+--------+--------+--------+--------+--------+--------+
  12. **    | Number of cyls | heads  |   0    |   0    |    precomp cyl  |   0    |
  13. **    +--------+-------+--------+--------+--------+--------+--------+--------+
  14. **    | hdflag |       |        |        |   Landing Zone  | sec/trk|        |
  15. **    +--------+-------+--------+--------+--------+--------+--------+--------+
  16. **        8       9        10       11       12                14
  17. */
  18.  
  19. #ifndef ROMTABLE_H
  20. #define ROMTABLE_H
  21.  
  22. #define MORETHAN8HEADS    0x08
  23. #define LESSTHAN8HEADS    0x00
  24.  
  25. #ifdef COMPILER_PACKS_STRUCTURES    /* V/AT does NOT */
  26. typedef struct {
  27.     short      r_cyls;    /* number of cyls               */
  28.     unsigned char r_heads;    /*           heads              */
  29.     char          r_dummy1[2];    /* unknown/unused               */
  30.     short         r_precomp;    /* cyl # to start precomp on    */
  31.     char          r_dummy2;     /* unknown/unused               */
  32.     char          r_hdflag;     /* iff more than 8 heads        */
  33.     char          r_dummy3[3];    /* unknown/unused               */
  34.     short         r_lz;         /* cyl where head lands         */
  35.     unsigned char r_spt;        /* Sectors per track (17,26,34) */
  36.     char          r_dummy4;     /* unknown/unused            */
  37. } romtable;
  38.  
  39. /* given a pointer to a rom table entry (rtp) we need the value */
  40.  
  41. #define R_CYLS( rtp )        ((rtp)->r_cyls)
  42. #define R_HEADS( rtp )        ((rtp)->r_heads)
  43. #define R_PRECOMP( rtp )    ((rtp)->r_precomp)
  44. #define R_HDFLAG( rtp )        ((rtp)->r_hdflag)
  45. #define R_LZ( rtp )        ((rtp)->r_lz)
  46. #define R_SPT( rtp )        ((rtp)->r_spt)
  47.  
  48. #else    /* V/AT needs to use an uglier method... */
  49.  
  50. typedef char romtable[16];
  51.  
  52. /* rtp is a pointer to a romtable (which is an array of chars) */
  53.  
  54. #define R_CYLS( rtp )        (*(short         *)(&(rtp)[0]))
  55. #define R_HEADS( rtp )        (*(unsigned char *)(&(rtp)[2]))
  56. #define R_PRECOMP( rtp )    (*(short         *)(&(rtp)[5]))
  57. #define R_HDFLAG( rtp )        (*(unsigned char *)(&(rtp)[8]))
  58. #define R_LZ( rtp )        (*(short         *)(&(rtp)[12]))
  59. #define R_SPT( rtp )        (*(unsigned char *)(&(rtp)[14]))
  60.  
  61. #endif
  62.  
  63. #endif /* ROMTABLE_H */
  64.