[3ae31e9] | 1 | /*
|
---|
| 2 | ============================================================================
|
---|
| 3 | biosdefs.h -- Buchla 700 BIOS and XBIOS definitions
|
---|
| 4 | Version 22 -- 1988-04-11 -- D.N. Lynx Crowe
|
---|
| 5 | ============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | extern long trap13(); /* BIOS linkage */
|
---|
| 9 | extern long trap14(); /* XBIOS linkage */
|
---|
| 10 |
|
---|
| 11 | #define BIOS trap13
|
---|
| 12 | #define XBIOS trap14
|
---|
| 13 |
|
---|
| 14 | /* BIOS functions */
|
---|
| 15 |
|
---|
| 16 | /* function 0 unused (getmpb) */
|
---|
| 17 |
|
---|
| 18 | #define B_RDAV 1
|
---|
| 19 | #define B_GETC 2
|
---|
| 20 | #define B_PUTC 3
|
---|
| 21 | #define B_RDWR 4
|
---|
| 22 | #define B_SETV 5
|
---|
| 23 |
|
---|
| 24 | /* function 6 unused (tickcal) */
|
---|
| 25 |
|
---|
| 26 | #define B_GBPB 7
|
---|
| 27 | #define B_THRE 8
|
---|
| 28 | #define B_MCHG 9
|
---|
| 29 | #define B_DMAP 10
|
---|
| 30 |
|
---|
| 31 | /* function 11 unused (shift) */
|
---|
| 32 |
|
---|
| 33 | /* XBIOS functions */
|
---|
| 34 |
|
---|
| 35 | #define X_PIOREC 0
|
---|
| 36 | #define X_SETPRT 1
|
---|
| 37 | #define X_FLOPRD 2
|
---|
| 38 | #define X_FLOPWR 3
|
---|
| 39 | #define X_FORMAT 4
|
---|
| 40 | #define X_VERIFY 5
|
---|
| 41 | #define X_PRBOOT 6
|
---|
| 42 | #define X_RANDOM 7
|
---|
| 43 | #define X_ANALOG 8
|
---|
| 44 | #define X_CLRAFI 9
|
---|
| 45 | #define X_APICHK 10
|
---|
| 46 | #define X_MTDEFS 11
|
---|
| 47 |
|
---|
| 48 | /* device unit numbers */
|
---|
| 49 |
|
---|
| 50 | #define PRT_DEV 0
|
---|
| 51 | #define AUX_DEV 1
|
---|
| 52 | #define CON_DEV 2
|
---|
| 53 | #define MC1_DEV 3
|
---|
| 54 | #define MC2_DEV 4
|
---|
| 55 |
|
---|
| 56 | /* |
---|
| 57 | */
|
---|
| 58 | /*
|
---|
| 59 | ============================================================================
|
---|
| 60 | bpb -- BIOS parameter block
|
---|
| 61 | ============================================================================
|
---|
| 62 | */
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | struct bpb { /* BIOS parameter block returned by B_GBPB */
|
---|
| 66 |
|
---|
| 67 | unsigned short recsiz; /* physical sector size in bytes */
|
---|
| 68 | unsigned short clsiz; /* cluster size in sectors */
|
---|
| 69 | unsigned short clsizb; /* cluster size in bytes */
|
---|
| 70 | unsigned short rdlen; /* root directory length in sectors */
|
---|
| 71 | unsigned short fsiz; /* FAT size in sectors */
|
---|
| 72 | unsigned short fatrec; /* sector number of 1st sector of 2nd FAT */
|
---|
| 73 | unsigned short datrec; /* sector number of 1st data sector */
|
---|
| 74 | unsigned short numcl; /* number of data clusters on disk */
|
---|
| 75 | unsigned short bflags; /* flags */
|
---|
| 76 | unsigned short ntracks; /* number of tracks */
|
---|
| 77 | unsigned short nsides; /* number of sides (heads) */
|
---|
| 78 | unsigned short dspc; /* sectors per cylinder */
|
---|
| 79 | unsigned short dspt; /* sectors per track */
|
---|
| 80 | unsigned short hidden; /* number of hidden files */
|
---|
| 81 | char serno[3]; /* disk serial number */
|
---|
| 82 | char nada; /* --- filler - nothing here --- */
|
---|
| 83 | };
|
---|
| 84 |
|
---|
| 85 | #define BPBSIZE 32 /* length of a BPB */
|
---|
| 86 |
|
---|
| 87 | #define B_FAT16 0x0001 /* flag for using 16 bit FAT entries */
|
---|
| 88 |
|
---|
| 89 | /* |
---|
| 90 |
|
---|
| 91 | */
|
---|
| 92 |
|
---|
| 93 | /*
|
---|
| 94 | ============================================================================
|
---|
| 95 | dirent -- Directory entry
|
---|
| 96 | ============================================================================
|
---|
| 97 | */
|
---|
| 98 |
|
---|
| 99 | struct dirent { /* Directory entry */
|
---|
| 100 |
|
---|
| 101 | char fname[8]; /* file name */
|
---|
| 102 | char fext[3]; /* file extension */
|
---|
| 103 | char atrib; /* attribute byte */
|
---|
| 104 | char unused[10]; /* unused space */
|
---|
| 105 | unsigned short crtime; /* 'LLHH' creation time */
|
---|
| 106 | unsigned short crdate; /* 'LLHH' creation date */
|
---|
| 107 | unsigned short bclust; /* 'LLHH' starting cluster number */
|
---|
| 108 | long flen; /* 'LLHH' file length */
|
---|
| 109 | };
|
---|
| 110 |
|
---|
| 111 | #define DENTSIZE (sizeof (struct dirent))
|
---|
| 112 |
|
---|
| 113 | #define F_RDONLY 0x01 /* Read only file */
|
---|
| 114 | #define F_HIDDEN 0x02 /* Hidden file */
|
---|
| 115 | #define F_SYSTEM 0x04 /* System file */
|
---|
| 116 | #define F_VOLUME 0x08 /* Volume label */
|
---|
| 117 | #define F_SUBDIR 0x10 /* Sub-directory */
|
---|
| 118 | #define F_ARCHIV 0x20 /* Archived */
|
---|
| 119 |
|
---|
| 120 | /* |
---|
| 121 |
|
---|
| 122 | */
|
---|
| 123 |
|
---|
| 124 | /*
|
---|
| 125 | ============================================================================
|
---|
| 126 | fcb -- File Control Block
|
---|
| 127 | ============================================================================
|
---|
| 128 | */
|
---|
| 129 |
|
---|
| 130 | struct fcb { /* file control block */
|
---|
| 131 |
|
---|
| 132 | struct dirent de; /* directory entry image for file */
|
---|
| 133 | unsigned short modefl; /* fcb flags */
|
---|
| 134 | unsigned short clsec; /* current sector in cluster */
|
---|
| 135 | unsigned short curcls; /* current cluster */
|
---|
| 136 | unsigned short offset; /* current offset into sector */
|
---|
| 137 | long curlsn; /* current logical sector number in file */
|
---|
| 138 | long curdsn; /* current logical sector number on disk */
|
---|
| 139 | long curlen; /* current file length in bytes */
|
---|
| 140 | long asects; /* allocated file length in sectors */
|
---|
| 141 | };
|
---|
| 142 |
|
---|
| 143 | #define FC_EOF 0x8000 /* end of file */
|
---|
| 144 | #define FC_BAD 0x4000 /* bad FAT entry encountered */
|
---|
| 145 | #define FC_ERR 0x2000 /* error encountered */
|
---|
| 146 | #define FC_OPN 0x1000 /* file open */
|
---|
| 147 |
|
---|
| 148 | #define FC_CR 0x0800 /* create mode */
|
---|
| 149 | #define FC_AP 0x0400 /* append mode */
|
---|
| 150 | #define FC_WR 0x0200 /* write mode */
|
---|
| 151 | #define FC_RD 0x0100 /* read mode */
|
---|
| 152 |
|
---|
| 153 | #define FC_EX 0x0080 /* exclusive mode */
|
---|
| 154 | #define FC_TR 0x0040 /* truncate mode */
|
---|
| 155 | #define FC_NB 0x0020 /* non-blocking mode */
|
---|
| 156 | #define FC_BF 0x0010 /* binary file mode */
|
---|
| 157 |
|
---|
| 158 | #define FC_RW (FC_RD | FC_WR) /* read-write mode */
|
---|
| 159 |
|
---|
| 160 | /* |
---|
| 161 | */
|
---|
| 162 |
|
---|
| 163 | /*
|
---|
| 164 | ============================================================================
|
---|
| 165 | BIOS and XBIOS function call formats
|
---|
| 166 | ------------------------------------
|
---|
| 167 |
|
---|
| 168 | In the list below, .W and .L refer to the size of the parameter
|
---|
| 169 | passed to the BIOS/XBIOS routine.
|
---|
| 170 |
|
---|
| 171 | The first parameter is always the function code, "code.W".
|
---|
| 172 |
|
---|
| 173 | BIOS calls are:
|
---|
| 174 | ---------------
|
---|
| 175 |
|
---|
| 176 | BIOS(B_RDAV, unit.W);
|
---|
| 177 | BIOS(B_GETC, unit.W);
|
---|
| 178 | BIOS(B_PUTC, unit.W, c.W);
|
---|
| 179 | BIOS(B_RDWR, rwflag.W, buf.L, count.W, recno.W, dev.W);
|
---|
| 180 | BIOS(B_SETV, vecnum.W, vecadr.L);
|
---|
| 181 | BIOS(B_GBPB, dev.W);
|
---|
| 182 | BIOS(B_THRE, unit.W);
|
---|
| 183 | BIOS(B_MCHG, unit.W);
|
---|
| 184 | BIOS(B_DMAP);
|
---|
| 185 |
|
---|
| 186 | XBIOS calls are:
|
---|
| 187 | ----------------
|
---|
| 188 |
|
---|
| 189 | XBIOS(X_PIOREC, unit.W)
|
---|
| 190 | XBIOS(X_SETPRT, unit.W, mode.W, baud.W, cfr0.W, cr1.W)
|
---|
| 191 | XBIOS(X_FLOPRD, buf.L, filler.L, dev.W, sector.W, track.W,
|
---|
| 192 | side.W, count.W)
|
---|
| 193 | XBIOS(X_FLOPWR, buf.L, filler.L, dev.W, sector.W, track.W,
|
---|
| 194 | side.W, count.W)
|
---|
| 195 | XBIOS(X_FORMAT, buf.L, filler.L, dev.W, spt.W, track.W, side.W,
|
---|
| 196 | intrlv.W, magic.L, virgin.W)
|
---|
| 197 | XBIOS(X_VERIFY, buf.L, filler.L, dev.W, sector.W, track.W,
|
---|
| 198 | side.W, count.W)
|
---|
| 199 | XBIOS(X_PRBOOT, buf.L, serial.L, type.W, execflag.W)
|
---|
| 200 | XBIOS(X_RANDOM)
|
---|
| 201 | XBIOS(X_ANALOG)
|
---|
| 202 | XBIOS(X_CLRAFI)
|
---|
| 203 | ============================================================================
|
---|
| 204 | */
|
---|