Listing 2 (block.h) Common References for Block Device Driver
/* * status bits for the return code */ #define UNKNOWN_COMMAND 3 #define ERROR 0x8000 #define DONE 0x0100 #define BUSY 0x0200 #define BLK_NOT_FOUND 8 #define MAX_BLK 256 /* 256 blocks */ #define BLK_SIZE 256 /* 256 bytes/block */ /*------------- global variables -------------*/ /* the transfer address specified in the request header */ extern int far *transfer; /* the count specified in the request header */ extern int count; /* counter */ extern int k1; /* counter */ extern int k2; /* offset for normalization */ extern unsigned offset; /* source pointer */ extern int far *source; /* destination pointer */ extern int far *dest; /* command specified in request header */ extern char command; /* start block specified in request header */ extern int start; extern struct parm_block /* parameter block */ { unsigned bps; /* bytes per block */ char spau; /* blocks per allocation unit */ unsigned nrs; /* number of reserved blocks */ char nfat; /* number of file allocation tables */ unsigned rent; /* number of root directory entries */ unsigned tns; /* total number of blocks */ char mdb; /* media descriptor byte */ unsigned nsfat; /* number of blocks per FAT */ } bpb, bpb_tab [ ]; /* * pointer to the request header */ extern struct request_header { char rlength; char unit; char command; unsigned status; char reserved [ 8 ]; char data; union { char far *transfer; char media_change_code; } b14; union { struct parm_block far *bpb; struct { unsigned count; unsigned start; } io; } b18; } far *rh; extern int ram_disk[ ];