From e6d9ed6d67dfaa83d4a12fe0e84d550adc841659 Mon Sep 17 00:00:00 2001 From: CSRG Date: Fri, 20 Mar 1981 18:18:13 -0800 Subject: [PATCH] BSD 4_1_snap development Work on file sys/stand/conf.c.ancient Work on file sys/stand/cat.c Work on file sys/stand/mba.c Work on file sys/stand/machdep.c Work on file sys/stand/ls.c Work on file sys/stand/saio.h Work on file sys/stand/savax.h Synthesized-from: CSRG/cd1/4.1.snap --- sys/stand/cat.c | 17 ++++++++++++ sys/stand/conf.c.ancient | 59 ++++++++++++++++++++++++++++++++++++++++ sys/stand/ls.c | 41 ++++++++++++++++++++++++++++ sys/stand/machdep.c | 34 +++++++++++++++++++++++ sys/stand/mba.c | 49 +++++++++++++++++++++++++++++++++ sys/stand/saio.h | 54 ++++++++++++++++++++++++++++++++++++ sys/stand/savax.h | 35 ++++++++++++++++++++++++ 7 files changed, 289 insertions(+) create mode 100644 sys/stand/cat.c create mode 100644 sys/stand/conf.c.ancient create mode 100644 sys/stand/ls.c create mode 100644 sys/stand/machdep.c create mode 100644 sys/stand/mba.c create mode 100644 sys/stand/saio.h create mode 100644 sys/stand/savax.h diff --git a/sys/stand/cat.c b/sys/stand/cat.c new file mode 100644 index 0000000000..1c5384c4b6 --- /dev/null +++ b/sys/stand/cat.c @@ -0,0 +1,17 @@ +/* cat.c 4.2 81/03/15 */ + +main() +{ + int c, i; + char buf[50]; + + do { + printf("File: "); + gets(buf); + i = open(buf, 0); + } while (i <= 0); + + while ((c = getc(i)) > 0) + putchar(c); + exit(0); +} diff --git a/sys/stand/conf.c.ancient b/sys/stand/conf.c.ancient new file mode 100644 index 0000000000..efc9631a59 --- /dev/null +++ b/sys/stand/conf.c.ancient @@ -0,0 +1,59 @@ +/* conf.c 4.7 81/03/15 */ + +#include "../h/param.h" +#include "../h/inode.h" +#include "../h/pte.h" +#include "../h/mbareg.h" +#include "saio.h" + +devread(io) + register struct iob *io; +{ + + return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); +} + +devwrite(io) + register struct iob *io; +{ + + return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); +} + +devopen(io) + register struct iob *io; +{ + + (*devsw[io->i_ino.i_dev].dv_open)(io); +} + +devclose(io) + register struct iob *io; +{ + + (*devsw[io->i_ino.i_dev].dv_close)(io); +} + +nullsys() +{ + + ; +} + +int nullsys(); +int hpstrategy(), hpopen(); +int htstrategy(), htopen(), htclose(); +int upstrategy(), upopen(); +int tmstrategy(), tmopen(), tmclose(); +int tsstrategy(), tsopen(), tsclose(); +int rkopen(),rkstrategy(); + +struct devsw devsw[] = { + "hp", hpstrategy, hpopen, nullsys, + "ht", htstrategy, htopen, htclose, + "up", upstrategy, upopen, nullsys, + "tm", tmstrategy, tmopen, tmclose, + "hk", rkstrategy, rkopen, nullsys, + "ts", tsstrategy, tsopen, tsclose, + 0,0,0,0 +}; diff --git a/sys/stand/ls.c b/sys/stand/ls.c new file mode 100644 index 0000000000..8797aa4715 --- /dev/null +++ b/sys/stand/ls.c @@ -0,0 +1,41 @@ +/* ls.c 4.2 81/03/15 */ + +#include "../h/param.h" +#include "../h/inode.h" +#include "../h/ino.h" +#include "../h/dir.h" +#include "saio.h" + +char line[100]; + +main() +{ + int i; + + printf("ls\n"); + do { + printf(": "); gets(line); + i = open(line, 0); + } while (i < 0); + + ls(i); +} + +ls(io) +register io; +{ + struct direct d; + register i; + + while (read(io, (char *)&d, sizeof d) == sizeof d) { + if (d.d_ino == 0) + continue; + printf("%d\t", d.d_ino); + for (i=0; ii_unit); + struct mba_drv *drv = mbadrv(io->i_unit); + register struct pte *pte = mba->mba_map; + int npf; + unsigned v; + int o; + int vaddr; + + v = btop(io->i_ma); + o = (int)io->i_ma & PGOFSET; + npf = btoc(io->i_cc + o); + vaddr = o; + while (--npf >= 0) + *(int *)pte++ = v++ | PG_V; + mba->mba_sr = -1; + mba->mba_bcr = -io->i_cc; + mba->mba_var = vaddr; + if (func == WRITE) + drv->mbd_cs1 = MB_WCOM | MB_GO; + else + drv->mbd_cs1 = MB_RCOM | MB_GO; +} + +mbainit(mbanum) + int mbanum; +{ + register struct mba_regs *mba = mbaddr[mbanum]; + + /* SHOULD BADADDR IT */ + if (mbaact & (1<mba_cr = MBCR_INIT; + mbaact |= 1< */ + +#define MAXNMBA 4 +struct mba_regs **mbaddr; +int mbaact; +caddr_t *umaddr; +struct uba_regs **ubaddr; + +#define UNITTOMBA(unit) ((unit)>>3) +#define UNITTODRIVE(unit) ((unit)&07) + +#define mbamba(unit) (mbaddr[UNITTOMBA(unit)]) +#define mbadrv(unit) (&mbamba(unit)->mba_drv[UNITTODRIVE(unit)]) + +#define UNITTOUBA(unit) ((unit)>>3) +#define ubauba(unit) (ubaddr[UNITTOUBA(unit)]) +#define ubamem(unit, off) ((umaddr[UNITTOUBA(unit)]+(off&017777))) -- 2.20.1