# include "setup.h" # define DRIVE0 0 static spt = 0; # define NBIOSREC 20 # define BIOSFIRST 53 /* * Block I/O routines for the Micro Decision */ biosread () { static char *p; static s, n; spt = findspt (); p = biosbuf; s = BIOSFIRST; for (n = 0; n < NBIOSREC; n++, p += RECSIZE, s++) if (lio (READ, p, s)) fatal ("Can't read bios\n$"); } bioswrite () { static char *p; static s, n; p = biosbuf; s = BIOSFIRST; for (n = 0; n < NBIOSREC; n++, p += RECSIZE, s++) if (lio (WRITE, p, s, n == NBIOSREC - 1)) fatal ("Can't write bios\n$"); } lio (op, addr, sector, last) char *addr; { int t, s; sector--; t = sector / spt; s = sector % spt + 1; return sio (op, addr, t, s, last); } sio (op, addr, track, sector, last) { static char selected [5] = {NO}; callbios (SETDRV, DRIVE0, selected[DRIVE0]); selected[DRIVE0] = YES; callbios (SETTRK, track, 0); callbios (SETSEC, sector, 0); callbios (SETDMA, addr, 0); if (op == READ) return callbios (BIORED, 0, 0); else return callbios (BIOWRT, last, 0); } # define CSELECT 14 # define CGETPARM 31