home *** CD-ROM | disk | FTP | other *** search
- /*
- ** romtable.h
- ** What a drive type table entry looks like in ROM
- ** (The disk geometry table)
- **
- ** $Header: romtable.h,v 1.1 88/04/07 23:12:17 root Alpha $
- **
- ** The ROM type diskinfo is:
- **
- ** 0 2 3 4 5 7
- ** +--------+-------+--------+--------+--------+--------+--------+--------+
- ** | Number of cyls | heads | 0 | 0 | precomp cyl | 0 |
- ** +--------+-------+--------+--------+--------+--------+--------+--------+
- ** | hdflag | | | | Landing Zone | sec/trk| |
- ** +--------+-------+--------+--------+--------+--------+--------+--------+
- ** 8 9 10 11 12 14
- */
-
- #ifndef ROMTABLE_H
- #define ROMTABLE_H
-
- #define MORETHAN8HEADS 0x08
- #define LESSTHAN8HEADS 0x00
-
- #ifdef COMPILER_PACKS_STRUCTURES /* V/AT does NOT */
- typedef struct {
- short r_cyls; /* number of cyls */
- unsigned char r_heads; /* heads */
- char r_dummy1[2]; /* unknown/unused */
- short r_precomp; /* cyl # to start precomp on */
- char r_dummy2; /* unknown/unused */
- char r_hdflag; /* iff more than 8 heads */
- char r_dummy3[3]; /* unknown/unused */
- short r_lz; /* cyl where head lands */
- unsigned char r_spt; /* Sectors per track (17,26,34) */
- char r_dummy4; /* unknown/unused */
- } romtable;
-
- /* given a pointer to a rom table entry (rtp) we need the value */
-
- #define R_CYLS( rtp ) ((rtp)->r_cyls)
- #define R_HEADS( rtp ) ((rtp)->r_heads)
- #define R_PRECOMP( rtp ) ((rtp)->r_precomp)
- #define R_HDFLAG( rtp ) ((rtp)->r_hdflag)
- #define R_LZ( rtp ) ((rtp)->r_lz)
- #define R_SPT( rtp ) ((rtp)->r_spt)
-
- #else /* V/AT needs to use an uglier method... */
-
- typedef char romtable[16];
-
- /* rtp is a pointer to a romtable (which is an array of chars) */
-
- #define R_CYLS( rtp ) (*(short *)(&(rtp)[0]))
- #define R_HEADS( rtp ) (*(unsigned char *)(&(rtp)[2]))
- #define R_PRECOMP( rtp ) (*(short *)(&(rtp)[5]))
- #define R_HDFLAG( rtp ) (*(unsigned char *)(&(rtp)[8]))
- #define R_LZ( rtp ) (*(short *)(&(rtp)[12]))
- #define R_SPT( rtp ) (*(unsigned char *)(&(rtp)[14]))
-
- #endif
-
- #endif /* ROMTABLE_H */
-