           lib     environment
           lib     dtab
           lib     inttab
           lib     bfhdr
           lib     blktab
           lib     chrtab
           data
           ttl     Device Driver Tables
           pag
           name    devtab
           define

*
* System Parameters - adjust accordingly
*

SSIZE      equ     1                   initial stack size (*PAGSIZ)
MAXJOB     equ     10                  maximum simult user tasks
NBLKS      equ     16                  Accessable pages in address space
USRHIP     equ     NBLKS-1             User's highest addressable page
USRHIP_4   equ     USRHIP<<4

* terminal i/o constants

OQHI       equ     119                 outq upper limit
OQLO       equ     15                  outq lower limit
CHRLIM     equ     255                 max characters on q

*
LIGHTS     fcb     0
DSKTRM     fcb     $83
BLKHOL     fcb     $83
WHTHOL     fcb     $82

           lib     hardware

*
* Machine constants
*

HZTIM_60   equ     120/10-1            interrupt rate (60hz)
HZTIM_50   equ     100/10-1            interrupt rate (50hz)


contab     equ     *

 ifc &a,'8'
Uni_DN     equ     0                   8" Floppy Diskette
 info Root device: /dev/fd0
 endif
 ifc &a,'5W'
Uni_DN     equ     6                   5" Winchester
 info Root device:  /dev/w0
 endif

strm       fcb     2                   number of terminals
stsk       fcb     48                  number of tasks
siob       fcb     16                  number of io buffers
schl       fcb     96                  number of character lists
sfdn       fcb     64                  number of fdn entries
stxt       fcb     20                  number of text entries
smnt       fcb     5                   number of mounts
stim       fcb     24                  number of timeouts allowed
slok       fcb     32                  number of lock table entries
srtd       fdb     Uni_DN              root device number
sppd       fdb     Uni_DN              pipe device number
sswd       fdb     Uni_DN              swap device number
stlm       fcb     0                   time limit in 25.6 X seconds (0 disables
sfil       fdb     500                 max file size for reg user
scon       fdb     BASACI              console terminal address (acia)
sconbr     fcb     0                   console baud rate value
smxj       fcb     MAXJOB              max user task count
stmz       fdb     300                 time zone (minutes west of gmt)
sdlt       fcb     0                   daylight savings here (0 if not)
sphz       fcb     0                   non-zero if power line is 50HZ
stup       fcb     0                   auto update time (0 disables) - value*4
smxm       fcb     NBLKS               maximum mem segments per task
FD_SRT fcb 0 Floppy Disk Seek Rate
SWTPCvii   fcb     $00                 SWTPC vii system
DATsense   fcb     $00                 SWTPC non inverted DAT form
ROMmap     fdb     $FFFF               Map registers for ROM space ($E000-$F000
NMIhan     fdb     nmihan              UniFLEX NMI handler
SWI2han    fdb     swi2han             SWI2 handler
MAXMAP fcb 0 Number of hardware maps

*
* Interrupt Handler Table
*    Used to decide which device generated an interrupt
* and how to process it.
*

inttab
           fcb     N_intdev            number of interrupt devices
* Parallel i/o via device
           fcb     6,0                 type 6- via output
           fcb     (CB1+CA1+i_t1cnt)
           fdb     IFR08               status flag register
           fdb     0,0                 no baud gens
           fdb     viaintr
           fdb     0                   device number

* tty 1
           fcb     5,0                8274
           fcb     %00000010           int mask
           fdb     BASACI              status register
           fdb     BAUDRG,BAUDRG       baud rate generators
           fdb     tintr               tty interrupt routine
           fdb     1                   device number
* tty 2
           fcb     5,0                8274
           fcb     %00000010           int mask
           fdb     BASACI+$01          status register
           fdb     BAUDRG,BAUDRG       baud rate generators
           fdb     tintr               tty interrupt routine
           fdb     2                   device number

* Parallel i/o via device TTY03 (Modem Port)
           fcb     6,0                 type 6- via output
           fcb     0
           fdb     IFRCOM              status flag register
           fdb     0,0                 no baud gens
           fdb     viaintr
           fdb     3                   device number

* Parallel i/o via device PPR
           fcb     6,0                 type 6- via output
           fcb     0
           fdb     IFRPPR              status flag register
           fdb     0,0                 no baud gens
           fdb     viaintr
           fdb     8                   device number

* Parallel i/o via device SPR
           fcb     6,0                 type 6- via output
           fcb     0
           fdb     IFRSPR              status flag register
           fdb     0,0                 no baud gens
           fdb     viaintr
           fdb     9                   device number

*
N_intdev   equ     (*-inttab-1)/INTSIZ
intend     equ     *


*
* fnttab
*
* Interrupt table for firq type interrupts.  It is
* the same as inttab above.
*

fnttab
fntend     equ     *


           pag

*
* Major device tables
*

*   NOTE: Certain devices are kept around, but are just re-assigned to other
*         devices for testing. (CDS AT ppr spr etc.)

* Character table

chrtab
* tty device
           fdb     ttopn               tty open routine
           fdb     ttcls               tty close routine
           fdb     ttrd                tty read routine
           fdb     ttwr                tty write routine
           fdb     ttspc               special routine
* mem device
           fdb     nuldev              mem open
           fdb     nuldev              mem close
           fdb     mdrd                mem read
           fdb     mdwr                mem write
           fdb     nuldev              mem special
* null device
           fdb     nuldev              null dev open
           fdb     nuldev              null dev close
           fdb     nuldrd              null device read
           fdb     nuldwr              null device write
           fdb     nuldev              null special
* floppy disk (character)
           fdb     fchop               fd open
           fdb     fchcl               fd close
           fdb     fchrd               fd read
           fdb     fchwr               fd write
           fdb     fchsp               fd special
* faked cds character drivers
           fdb     w5cop               cds open
           fdb     w5ccl               cds close
           fdb     w5crd               cds read
           fdb     w5cwr               cds write
           fdb     w5csp               special
* faked serial printer drivers
           fdb     nuldev              null dev open
           fdb     nuldev              null dev close
           fdb     nuldrd              null device read
           fdb     nuldwr              null device write
           fdb     nuldev              null special
* faked parallel printer driver
           fdb     nuldev              null dev open
           fdb     nuldev              null dev close
           fdb     nuldrd              null device read
           fdb     nuldwr              null device write
           fdb     nuldev              null special
* faked nec drivers
           fdb     nuldev              null dev open
           fdb     nuldev              null dev close
           fdb     nuldrd              null device read
           fdb     nuldwr              null device write
           fdb     nuldev              null special
* SWTPC 5" Winchester
           fdb     w5cop               cds open
           fdb     w5ccl               cds close
           fdb     w5crd               cds read
           fdb     w5cwr               cds write
           fdb     w5csp               special
* faked Archive Tape
           fdb     w5cop               cds open
           fdb     w5ccl               cds close
           fdb     w5crd               cds read
           fdb     w5cwr               cds write
           fdb     w5csp               special
CHRDEV     equ     (*-chrtab)/DEVSIZ

* Block device table

blktab
           fdb     BDopen,BD0open      open routine
           fdb     BDclose,BD0close    close routine
           fdb     BDio,BD0io          main io routine
           fdb     flopdt              device table pointer
           fcb     BD0max              max minor device number (+1)
BLKDEV     equ     (*-blktab)/BLKSIZ

* Block Device 0 Open Handlers
BD0open
FLOPminor  equ     (*-BD0open)/2
FLOPmajor  equ     0
           fdb     flopopn             fd0
           fdb     flopopn             fd1
           fdb     flopopn             fd2
           fdb     flopopn             fd3
*   The CDS stuff is faked to be wdxx
CDSminor   equ     (*-BD0open)/2
CDSmajor   equ     0
           fdb     w5open              hd0
           fdb     w5open              hd1
W5minor    equ     (*-BD0open)/2
W5major    equ     0
           fdb     w5open              w0
           fdb     w5open              w1
           fdb     w5open              w2
           fdb     w5open              w3
*   The AT device is faked
ATminor    equ     (*-BD0open)/2
ATmajor    equ     0
AT_DVN     equ     (ATmajor<<8)+ATminor
           fdb     w5open              at0
BD0max     equ     (*-BD0open)/2

* Block Device 0 Close Handlers
BD0close   fdb     flopcls             fd0
           fdb     flopcls             fd1
           fdb     flopcls             fd2
           fdb     flopcls             fd3
           fdb     w5close             hd0
           fdb     w5close             hd1
           fdb     w5close             w0
           fdb     w5close             w1
           fdb     w5close             w2
           fdb     w5close             w3
           fdb     w5close

* Block Device 0 I/O Handlers
BD0io      fdb     flopio              fd0
           fdb     flopio              fd1
           fdb     flopio              fd2
           fdb     flopio              fd3
           fdb     w5sto               hd0
           fdb     w5sto               hd1
           fdb     w5sto               w0
           fdb     w5sto               w1
           fdb     w5sto               w2
           fdb     w5sto               w3
           fdb     w5sto

*
* Device Tables
*

flopdt     rzb     DVTSIZ              device table
cdsdt      equ     flopdt
w5dt       equ     flopdt
at_dt      equ     flopdt

* buffer header for character device

fchbuf     rzb     HDRSIZ              buffer header

