This commit is contained in:
Warren Toomey
2016-03-04 08:31:45 +10:00
8 changed files with 311 additions and 243 deletions
+39 -26
View File
@@ -64,9 +64,9 @@ sysexit: " common system call exit code
jms dskio; 07000 " save to disk? jms dskio; 07000 " save to disk?
1: 1:
dzm .insys " clear "in system call" flag dzm .insys " clear "in system call" flag
jms chkint jms chkint " pending interrupt?
skp skp " no
jmp .save " dump core?? jmp .save " yes: dump core
jms copy; u.rq+2; 10; 6 " restore auto-index locations 10-15 jms copy; u.rq+2; 10; 6 " restore auto-index locations 10-15
lac u.rq+1 " restore auto-index location 9 lac u.rq+1 " restore auto-index location 9
dac 9 dac 9
@@ -139,12 +139,18 @@ swp: " system call dispatch table
swn: swn:
.-swp-1 i " count of system calls, plus indirect! .-swp-1 i " count of system calls, plus indirect!
" AC/ new value for intflg
" sys intrp
.intrp: .intrp:
lac u.ac lac u.ac
dac u.intflg dac u.intflg
jmp okexit jmp okexit
.sysloc: " "sysloc": syscall to return system addresses " syscall to retrieve system addresses (data & routines!!)
" AC/ index (1..17)
" sys sysloc
" AC/ address (or -1 on bad index)
.sysloc:
lac u.ac lac u.ac
and o17777 and o17777
jms betwen; d1; locn jms betwen; d1; locn
@@ -155,7 +161,7 @@ swn:
dac u.ac dac u.ac
jmp sysexit jmp sysexit
locsw: " table of system data structures for "sysloc" call locsw: " table of system addresses for sysloc
lac . lac .
iget; inode; userdata; sysdata; copy; copyz; betwen; dskrd iget; inode; userdata; sysdata; copy; copyz; betwen; dskrd
dskwr; dskbuf; dpdata; namei; pbsflgs; alloc; free; dspdata dskwr; dskbuf; dpdata; namei; pbsflgs; alloc; free; dspdata
@@ -163,34 +169,41 @@ locsw: " table of system data structures for "sysloc" call
locn: locn:
.-locsw-1 .-locsw-1
" check if interrupt for user
" checks .int1 and .int2 (contain i-number of interrupt source)
" call:
" .insys/ 0
" jms chkint
" no: no interrupt, or intflg set (discards interupt)
" yes: PI off, .insys set
chkint: 0 chkint: 0
lac .insys lac .insys
sza sza " in system?
jmp chkint i jmp chkint i " yes: return
lac .int1 lac .int1 " get inumber of interrupt1 source?
sna sna " zero?
jmp 1f jmp 1f " yes: skip stdin check
sad u.ofiles+2 sad u.ofiles+2 " non-zero: compare to stdin inumber
jmp 2f jmp 2f " same
1: 1:
lac .int2 lac .int2 " get inum of interrupt 2 source?
sna sna " zero?
jmp chkint i jmp chkint i " yes: return
sad u.ofiles+2 sad u.ofiles+2 " non-zero: compare to stdin inumber
skp skp " match!
jmp chkint i jmp chkint i " no match: return
dzm .int2 dzm .int2 " clear int2 source
jmp 1f jmp 1f
2: 2:
dzm .int1 dzm .int1 " clear int1 source
1: 1:
"** 01-s1.pdf page 5 "** 01-s1.pdf page 5
lac u.intflg lac u.intflg " get user intflg
sza sza " zero?
jmp chkint i jmp chkint i " no: ignore
-1 -1
dac .insys dac .insys " set "in system" flag
ion ion " enable interrupts
isz chkint isz chkint " give skip return
jmp chkint i jmp chkint i
+77 -70
View File
@@ -190,31 +190,34 @@
"** 01-s1.pdf page 10 "** 01-s1.pdf page 10
jmp okexit jmp okexit
" open system call
" sys open; filename_ptr; flags (0 for read, 1 for write)
" returns w/ "fd" in AC (or -1 if not found)
.open: .open:
jms arg jms arg " get filename
dac 0f dac 0f " save for namei
jms arg jms arg " get flags
sza sza " zero (read)
lac d1 lac d1 " no: get write mode bit
sna sna " non-zero (write)?
lac d2 " mode bit 2 (read?) lac d2 " no: get read mode bot
dac mode " save for access call dac mode " save for access call
lac u.cdir lac u.cdir " get current working directory
jms namei; 0:0 jms namei; 0:0 " search for file
jms error jms error " error: return -1
jms iget jms iget
jms access jms access " check access (may return w/ error to user)
lac i.flags lac i.flags " get file flags
and o20 and o20 " get directory bit
sna sna " is directory?
jmp open1 jmp open1 " no
lac mode lac mode " get access mode
and d1 and d1 " get write bit
sna sna " write access?
jmp open1 jmp open1 " no, continue
lac u.uid lac u.uid " yes: get uid?
sma sma " negative (-1 is superuser)
jms error jms error " no: return error
jmp open1 jmp open1
.creat: .creat:
@@ -275,63 +278,67 @@ open1:
and d1 and d1
sza sza
jms error jms error
lac i.flags lac i.flags " get inode flags
and o40 and o40 " get special file bit
sna sna " special?
jmp 1f jmp 1f " no
iof iof " yes: disable interrupts
lac ii lac ii " get i number
tad swr tad swr " get read routine table addr
dac .+1 dac .+1
jmp .. i jmp .. i " dispatch to read routine
1: 1:
lac u.base lac u.base " get user base
dac 1f+1 dac 1f+1 " save as iread base
lac u.count lac u.count " get user count
dac 1f+2 dac 1f+2 " save as iread count
lac f.badd lac f.badd " get file offset
1: 1:
jms iread; ..; .. jms iread; ..; ..
jmp exitrw jmp exitrw
" write system call:
" AC/ fd
" sys write; buffer; count
" AC/ count or -1 on error
.write: .write:
jms arg jms arg " pick up buffer
and o17777 and o17777 " mask to addr
dac u.base dac u.base " save as I/O base
jms arg jms arg " pick up count
dac u.count dac u.count " save as count
tad u.base tad u.base " add base (get limit)
jms betwen; u.base; o17777 jms betwen; u.base; o17777 " check between base and end of memory
jms error jms error " no: error
dac u.limit dac u.limit " yes: save as limit
jms finac jms finac " get fnode with fd from user AC
lac f.flags lac f.flags " get file table flags
and d1 and d1 " open for write?
sna sna " yes, skip
jms error jms error " no: error
lac i.flags lac i.flags " get inode flags
and o40 and o40 " get special bit?
"** 01-s1.pdf page 12 "** 01-s1.pdf page 12
sna sna " special?
jmp 1f jmp 1f " no
iof iof " special file (device node)
lac ii lac ii " get i number
tad sww tad sww " get write routine
dac .+1 dac .+1
jmp .. i jmp .. i " dispatch to write routine
1: " here with regular file
lac u.base " get base
dac 1f+1 " save as iwrite arg 1
lac u.count " get count
dac 1f+2 " save as iwrite 2
lac f.badd " get fd offset
1: 1:
lac u.base jms iwrite; ..; .. " write to file
dac 1f+1
lac u.count
dac 1f+2
lac f.badd
1:
jms iwrite; ..; ..
exitrw: exitrw: " common exit for read/write system calls
dac u.ac dac u.ac " save return in user AC
tad f.badd tad f.badd
dac f.badd dac f.badd " update file offset
jms iput jms iput " release inode
jms fput jms fput " release fnode
jmp sysexit jmp sysexit " return to user
+67 -48
View File
@@ -1,9 +1,12 @@
"** 01-s1.pdf page 14 "** 01-s1.pdf page 14
" s3 " s3
" search for user (process)
" call: " call:
" jms searchu; addr " jms searchu; worker_routine_addr
" worker called with copy of a process table entry in "lu"
" can return directly (from caller of searchu)
" index location 8 points to next process table entry
searchu: 0 searchu: 0
lac searchu i " fetch argument lac searchu i " fetch argument
dac 9f+t+1 " in t1 dac 9f+t+1 " in t1
@@ -27,7 +30,7 @@ searchu: 0
jmp searchu i jmp searchu i
t = t+2 t = t+2
" look for process: " look for a process with matching status
" jms lookfor; status " jms lookfor; status
" found: ulist ptr in AC " found: ulist ptr in AC
" not found " not found
@@ -45,9 +48,13 @@ lookfor: 0
-3 -3
tad 8 " roll index 8 back to this entry tad 8 " roll index 8 back to this entry
and o17777 and o17777
isz lookfor " skip argument isz lookfor " skip lookfor argument
jmp lookfor i " non-skip return jmp lookfor i " non-skip return
" fork system call:
" sys fork
" return at +1 in parent, child pid in AC
" return at +2 in child, parent pid in AC
.fork: .fork:
jms lookfor; 0 " not-used " find an unused process slot jms lookfor; 0 " not-used " find an unused process slot
skp skp
@@ -55,26 +62,26 @@ lookfor: 0
dac 9f+t " save ulist ptr in t0 dac 9f+t " save ulist ptr in t0
isz uniqpid " generate new pid isz uniqpid " generate new pid
lac uniqpid lac uniqpid
dac u.ac " return in AC dac u.ac " return in child pid in AC
law sysexit law sysexit
dac u.swapret " return from system call when swapped back in dac u.swapret " return from system call when swapped back in
lac o200000 " change process status to out/ready lac o200000 " change process status to out/ready (1->3)
tad u.ulistp i tad u.ulistp i
dac u.ulistp i dac u.ulistp i
jms dskswap; 07000 " swap parent out jms dskswap; 07000 " swap parent out
lac 9f+t " get unused ulist slot back lac 9f+t " get unused ulist slot back
dac u.ulistp " set ulist pointer dac u.ulistp " set ulist pointer
lac o100000 " mark child in/ready lac o100000 " mark child in/notready? (3->2)
xor u.ulistp i xor u.ulistp i
dac u.ulistp i dac u.ulistp i
lac u.pid lac u.pid " get old (parent) pid
"** 01-s1.pdf page 15 "** 01-s1.pdf page 15
dac u.ac " return parent pid in AC? dac u.ac " return parent pid in AC
lac uniqpid lac uniqpid
dac u.pid " set child pid dac u.pid " set child pid
isz 9f+t isz 9f+t " advance to second word in process table
dac 9f+t i " set pid in process table dac 9f+t i " set pid in process table
isz u.rq+8 " increment return address from sys call isz u.rq+8 " give skip return
dzm u.intflg " clear int flag dzm u.intflg " clear int flag
jmp sysexit " return in child process jmp sysexit " return in child process
t= t+1 t= t+1
@@ -82,28 +89,30 @@ t= t+1
badcal: " bad (unimplemented) system call badcal: " bad (unimplemented) system call
clon " clear any pending clock interrupt? clon " clear any pending clock interrupt?
-1 -1
dac 7 " set location 7 to -1 dac 7 " set location 7 to -1?!
.save: " fall into "save" system call
lac d1 " Ken says save files could be resumed, and used for checkpointing!
.save: " "sys save" system call
lac d1 " get inode 1 (core file?)
jms iget jms iget
cla cla
jms iwrite; 4096; 4096 jms iwrite; 4096; 4096 " dump core
jms iwrite; userdata; 64 jms iwrite; userdata; 64 " and user area
jms iput jms iput
.exit: .exit:
lac u.dspbuf lac u.dspbuf
sna " process using display? sna " process using display?
jmp .+3 " no jmp .+3 " no
law dspbuf " yes law dspbuf " yes
jms movdsp jms movdsp " move display
jms awake jms awake
lac u.ulistp i lac u.ulistp i
and o77777 " mark process table entry free and o77777 " mark process table entry free
dac u.ulistp i dac u.ulistp i
isz u.ulistp isz u.ulistp
dzm u.ulistp i " clear pid in process table dzm u.ulistp i " clear pid in process table
jms swap jms swap " find a new process to run
.rmes: .rmes:
jms awake jms awake
@@ -131,25 +140,28 @@ badcal: " bad (unimplemented) system call
t = t+1 t = t+1
"** 01-s1.pdf page 16 "** 01-s1.pdf page 16
" smes system call
" AC/ pid
" sys smes
.smes: .smes:
lac u.ac lac u.ac " get pid from user AC
sna spa sna spa " >0?
jms error jms error " no: error
jms searchu; 1f jms searchu; 1f " search for process
law 2 law 2
tad u.ulistp tad u.ulistp
dac 9f+t dac 9f+t
dzm 9f+t i dzm 9f+t i
jms error jms error
1: 0 1: 0 " worker for searchu
lac lu+1 lac lu+1 " get pid
sad u.ac sad u.ac " match?
skp skp " yes
jmp 1b i jmp 1b i " no
lac lu+2 lac lu+2 " get mailbox
sad dm1 sad dm1 " -1?
jmp 1f jmp 1f " yes
lac o100000 lac o100000 " no: increment process status
tad u.ulistp i tad u.ulistp i
dac u.ulistp i dac u.ulistp i
law 2 law 2
@@ -184,19 +196,19 @@ t = t+1
awake: 0 awake: 0
jms searchu; 1f jms searchu; 1f
jmp awake i jmp awake i
1: 0 1: 0 " searchu worker
lac u.pid lac u.pid " get caller pid
sad lu+2 sad lu+2 " match process table entry?
skp skp " yes
jmp 1b i jmp 1b i " no, return
-3 -3
tad 8 tad 8 " get pointer to pid in process table??
dac 9f+t dac 9f+t " save in t0
"** 01-s1.pdf page 17 "** 01-s1.pdf page 17
lac o700000 lac o700000 " set high bits
tad 9f+t i tad 9f+t i
dac 9f+t i dac 9f+t i
jmp 1b i jmp 1b i " return from worker
t = t+1 t = t+1
swr: swr:
@@ -207,15 +219,16 @@ sww:
.halt: jms halt .halt: jms halt
" read routine for ttyin special file
rttyi: rttyi:
jms chkint1 jms chkint1
lac d1 lac d1
jms getchar jms getchar
jmp 1f jmp 1f
and o177 and o177
jms betwen; o101; o132 jms betwen; o101; o132 " upper case?
skp skp " no
tad o40 tad o40 " yes: convert to lower
alss 9 alss 9
jmp passone jmp passone
1: 1:
@@ -223,6 +236,7 @@ rttyi:
jms swap jms swap
jmp rttyi jmp rttyi
" write routine for ttyout special file
wttyo: wttyo:
jms chkint1 jms chkint1
jms forall jms forall
@@ -250,6 +264,7 @@ wttyo:
jms swap jms swap
jmp wttyo jmp wttyo
" read routine for (display) "keyboard" special file
rkbdi: rkbdi:
jms chkint1 jms chkint1
lac d3 lac d3
@@ -289,6 +304,7 @@ rkbdi:
jms swap jms swap
jmp rkbdi jmp rkbdi
" write routine for (graphic) "display" special file
wdspo: wdspo:
jms chkint1 jms chkint1
jms forall jms forall
@@ -299,6 +315,7 @@ wdspo:
jmp wdspo jmp wdspo
" read routine for paper tape reader special file
rppti: rppti:
lac d4 lac d4
jms getchar jms getchar
@@ -314,6 +331,7 @@ rppti:
jmp rppti jmp rppti
"** 01-s1.pdf page 19 "** 01-s1.pdf page 19
" write routine for paper tape punch special file
wppto: wppto:
jms forall jms forall
sna sna
@@ -338,6 +356,7 @@ wppto:
jms swap jms swap
jmp wppto jmp wppto
" common exit for special file
passone: passone:
sad o4000 sad o4000
jmp okexit jmp okexit
+23 -17
View File
@@ -92,11 +92,14 @@ betwen: 0
cma " complement (AC-high) cma " complement (AC-high)
spa sna " AC-high <= 0? spa sna " AC-high <= 0?
1: 1:
isz betwen " no: give happy return isz betwen " no: give happy (skip) return
lacq " restore ~AC lacq " restore ~AC
cma " restore AC cma " restore AC
jmp betwen i " return w/o skip jmp betwen i " return w/o skip
" copy memory
" call:
" jms copy; src; dest; count
copy: 0 copy: 0
-1 -1
tad copy i tad copy i
@@ -118,21 +121,24 @@ copy: 0
jmp 1b jmp 1b
jmp copy i jmp copy i
" copy zeroes (clear memory)
" call:
" jms copyz; pointer; count
copyz: 0 copyz: 0
-1 -1
tad copyz i tad copyz i " get call PC
dac 8 dac 8 " save in index (pre-increments)
isz copyz isz copyz " skip pointer
-1 -1
tad copyz i tad copyz i " get count-1
cma cma " get negative count
dac 9f+t dac 9f+t " save in t0
isz copyz isz copyz " skip count
1: 1:
dzm 8 i dzm 8 i " zero word
isz 9f+t isz 9f+t " done?
jmp 1b jmp 1b " no: loop
jmp copyz i jmp copyz i " return
t = t+1 t = t+1
putchar: 0 putchar: 0
@@ -354,11 +360,11 @@ dsktrans: 0
t = t+1 t = t+1
halt: 0 halt: 0
isz 9f+t isz 9f+t " spin for a while (process interrupts)
jmp .-1 jmp .-1
iof iof " disable interrupts
hlt hlt " halt
jms copy; law; 4096; 4096 jms copy; law; 4096; 4096 " continued: copy system up to user memory?
hlt; jmp .-1 hlt; jmp .-1 " halt for good
t = t+1 t = t+1
+16 -8
View File
@@ -59,20 +59,28 @@ fassign: 0
jmp fassign i jmp fassign i
t = t+1 t = t+1
" get inode fpr an open file
" AC/ user fd
" jms fget
" bad fd
" return with fnode set
fget: 0 fget: 0
jms betwen; d0; d9 jms betwen; d0; d9 " fd 0..9?
jmp fget i jmp fget i " no, return
cll; mul; 3 cll; mul; 3 " multiply by three
lacq lacq
"** 01-s1.pdf page 29 "** 01-s1.pdf page 29
tad ofilesp tad ofilesp " get pointer into u.ofiles
dac 9f+t dac 9f+t " save in t0
dac .+2 dac .+2 " save as copy source
jms copy; ..; fnode; 3 jms copy; ..; fnode; 3 " copy to "fnode"
isz fget isz fget " give skip return
jmp fget i jmp fget i
" copy fnode back to u.ofiles
" uses temp value set by "fget"
" (fget and fput calls must be paired)
fput: 0 fput: 0
lac 9f+t lac 9f+t
dac .+3 dac .+3
+19 -10
View File
@@ -261,28 +261,31 @@ iwrite: 0
"** 01-s1.pdf page 38 "** 01-s1.pdf page 38
dac iread " save as iread return addr dac iread " save as iread return addr
lac cskp lac cskp " load skip instruction
dac iwrite " set our return addr to "cskp" dac iwrite " save as iwrite instruction
jmp 1f jmp 1f
" iread from file referenced by loaded inode
" AC/ file offset
" jms iread; addr; count
iread: 0 iread: 0
dac 9f+t dac 9f+t " save offset in t0
lac cnop " set iwrite return to "cnop" lac cnop " get nop
dac iwrite dac iwrite " save as iwrite instruction
1: 1:
-1 -1
tad iread i " get word before return addr tad iread i " get word before return addr
dac 10 " store in index 8 & 9 dac 10 " store in index 10 & 11
dac 11 dac 11
isz iread " increment return addr isz iread " increment return addr
lac iread i " load word lac iread i " load addr
dac 9f+t+1 " save in t1 dac 9f+t+1 " save in t1
isz iread " increment return addr isz iread " increment return addr
lac o70000 lac o70000
xct iwrite xct iwrite " skip if write
lac i.size lac i.size " read: get file size
cma cma
tad 9f+t tad 9f+t " add offset
cma cma
jms betwen; d0; 9f+t+1 jms betwen; d0; 9f+t+1
lac 9f+t+1 lac 9f+t+1
@@ -336,6 +339,11 @@ cskp:
jmp 1b jmp 1b
t = t+4 t = t+4
" system call helper
" AC/ fd
" jms finac
" return with: fnode and inode loaded
" or makes error return to user
finac: 0 finac: 0
lac u.ac lac u.ac
jms fget jms fget
@@ -347,6 +355,7 @@ finac: 0
jms iget jms iget
jmp finac i jmp finac i
" update inode file size with value in AC
dacisize: 0 dacisize: 0
dac i.size dac i.size
jms iput jms iput
+30 -27
View File
@@ -1,8 +1,9 @@
"** 01-s1.pdf page 41 "** 01-s1.pdf page 41
" s7 " s7
pibreak: " priority interrupt processing "chain" pibreak: " priority interrupt break processing "chain"
dac .ac "** CROSSED OUT.... dac .ac " save interrupt AC
"** CROSSED OUT....
dpsf dpsf
jmp 1f jmp 1f
@@ -174,14 +175,15 @@ ttyrestart: 0
dac sfiles+1 dac sfiles+1
jmp ttyrestart i "** written arrow up 2 copies jmp ttyrestart i "** written arrow up 2 copies
1: sck "** BEGIN CROSSED OUT "** BEGIN CROSSED OUT
jmp 1f 1: sck " Graphic-2 keyboard flag set?
jmp 1f " no.
cck cck " yes: clear flag
lck lck " read character
dac char dac char
sad o33 sad o33 " code 33 (ESCAPE?)
jmp intrp2 jmp intrp2 " yes: mark interrupt
lac d3 lac d3
jms putchar jms putchar
nop nop
@@ -190,8 +192,8 @@ ttyrestart: 0
dac sfiles+2 dac sfiles+2
jmp piret jmp piret
1: rsf 1: rsf " paper tape ready?
jmp 1f jmp 1f " no
"** 01-s1.pdf page 44 "** 01-s1.pdf page 44
@@ -237,12 +239,12 @@ ttyrestart: 0
dac sfiles+3 dac sfiles+3
jmp piret jmp piret
1: psf 1: psf " paper tape ready?
jmp 1f jmp 1f " no
pcf pcf " clear ptp flag
lac d5 lac d5
jms getchar jms getchar " get next char
jmp .+3 jmp .+3
psa psa
jmp piret jmp piret
@@ -251,11 +253,12 @@ ttyrestart: 0
dac sfiles+4 dac sfiles+4
jmp piret jmp piret
1: spb "** BEGIN CROSSED OUT "** BEGIN CROSSED OUT
jmp 1f 1: spb " graphic 2 push button flag set?
jmp 1f " no
cpb cpb " clear push button flag
lpb lpb " load push button value
dac pbsflgs+1 dac pbsflgs+1
"** 01-s1.pdf page 45 "** 01-s1.pdf page 45
@@ -271,8 +274,8 @@ ttyrestart: 0
wbl wbl
jmp piret "** END CROSSED OUT jmp piret "** END CROSSED OUT
1: crsf 1: crsf " card reader flag set?
jmp 1f jmp 1f " no
crrb crrb
dac crchar dac crchar
@@ -280,14 +283,14 @@ ttyrestart: 0
dac crread dac crread
jmp piret jmp piret
1: crrb 1: crrb " read card reader buffer??
piret: piret: " return from priority interrupt
lac 0 lac 0 " get LINK/PC
ral ral " restore LINK
lac .ac lac .ac " restore AC
ion ion " reenable interrupts
jmp 0 i jmp 0 i " return from interrupt
wakeup: 0 wakeup: 0
dac 9f+t dac 9f+t
+40 -37
View File
@@ -8,14 +8,15 @@ dspbsz = 270
ndskbs = 4 ndskbs = 4
" flags " flags
.insys: 0 " interupt flags
.int1: 0 .insys: 0 " "in system"
.int2: 0 .int1: 0 " inode for interrupt 1
.ac: 0 .int2: 0 " inode for interrupt 2
.savblk: 0 .ac: 0 " saved AC from interrupt
.dsptm: 0 .savblk: 0 " set by system call, cleared by disk i/o
.dskb: 0 .dsptm: 0 " display restart countdown (10 ticks)
.dske: 0 .dskb: 0 " set on disk interrupt
.dske: 0 " status from disk interrupt
" pointers " pointers
tadu: tad ulist tadu: tad ulist
@@ -110,25 +111,25 @@ dspbuf:
.=.+30 .=.+30
coldentry: coldentry:
dzm 0100 " not re-entrant dzm 0100 " not re-entrant
caf caf " clear all flags
ion ion " enable interrupts
clon clon " clear clock flag
law 3072 law 3072 " initialize display....
wcga wcga
jms dspinit jms dspinit
law dspbuf law dspbuf
jms movdsp jms movdsp
cla cla " read system block from disk
jms dskio; 06000 jms dskio; 06000
jms copy; dskbuf; sysdata; ulist-sysdata jms copy; dskbuf; sysdata; ulist-sysdata " copy to system data
lac d3 lac d3 " look for "init" in default directory
jms namei; initf jms namei; initf
jms halt jms halt
"** 01-s1.pdf page 50 "** 01-s1.pdf page 50
jms iget jms iget
cla cla
jms iread; 4096; 4096 jms iread; 4096; 4096 " read in "init"
jmp 4096 jmp 4096 " start process 1
. = dspbuf+dspbsz+3 . = dspbuf+dspbsz+3
dskbuf = 07700 dskbuf = 07700
dskbs: .=.+65+65+65+65 dskbs: .=.+65+65+65+65
@@ -144,9 +145,9 @@ name: .=.+4
lnkaddr: .=.+1 lnkaddr: .=.+1
char: .=.+1 char: .=.+1
dskaddr: .=.+1 dskaddr: .=.+1
uniqpid: 1 uniqpid: 1 " pid generator
lu: .=.+4 lu: .=.+4 " user (process) table entry copy
sfiles: .=.+10 sfiles: .=.+10 " wait addresses for special files
dpdata: dpdata:
dpstat: .=.+1 dpstat: .=.+1
dpread: .=.+1 dpread: .=.+1
@@ -158,12 +159,12 @@ dspdata:
crdata: crdata:
crread: .=.+1 crread: .=.+1
crchar: .=.+1 crchar: .=.+1
sysdata: sysdata: " system data 64 words saved to disk
s.nxfblk: .=.+1 s.nxfblk: .=.+1 " pointer to next free block??
s.nfblks: .=.+1 " number of free blocks s.nfblks: .=.+1 " number of free blocks (in fblks?)
s.fblks: .=.+10 " free block numbers s.fblks: .=.+10 " cached free block numbers
s.uniq: .=.+1 " next unique value s.uniq: .=.+1 " next unique value
s.tim: .=.+2 " (up)time(?) in 60Hz ticks (low, high) s.tim: .=.+2 " (up?)time in 60Hz ticks (low, high)
" process table " process table
" first word " first word
" bits 0:2 -- status " bits 0:2 -- status
@@ -173,7 +174,9 @@ sysdata:
" 3: out/ready " 3: out/ready
" 4: out/notready?? " 4: out/notready??
" bits 3:17 -- disk swap address/8 " bits 3:17 -- disk swap address/8
" second word: pid " second word: process pid
" third word: used for smes/rmes
" fourth word: ??
ulist: ulist:
0131000;1;0;0 0131000;1;0;0
0031040;0;0;0 0031040;0;0;0
@@ -185,25 +188,25 @@ ulist:
0031340;0;0;0 0031340;0;0;0
0031400;0;0;0 0031400;0;0;0
0031440;0;0;0 0031440;0;0;0
userdata: userdata: " "ustruct" (swappable)
u.ac: 0 " user AC u.ac: 0 " user AC
u.mq: 0 " user MQ u.mq: 0 " user MQ
u.rq: .=.+9 " user 010-017 u.rq: .=.+9 " user 010-017, user PC
u.uid: -1 " user id u.uid: -1 " user id
u.pid: 1 " process id u.pid: 1 " process id
u.cdir: 3 " connected directory (inode number?) u.cdir: 3 " connected directory (inode number?)
u.ulistp: ulist " pointer to process table entry u.ulistp: ulist " pointer to process table entry
u.swapret: 0 u.swapret: 0 " kernel routine to resume at after swap in
u.base: 0 u.base: 0 " start of user buffer
u.count: 0 u.count: 0 " size of user buffer
"** 01-s1.pdf page 51 "** 01-s1.pdf page 51
u.limit: 0 u.limit: 0 " end of user buffer
u.ofiles: .=.+30 u.ofiles: .=.+30 " open files (10 "fnode" entries)
u.dspbuf: 0 u.dspbuf: 0
u.intflg: 1 u.intflg: 1
.=userdata+64 .=userdata+64
ii: .=.+1 ii: .=.+1 " number of i-node in inode:
inode: inode: " disk inode in memory:
i.flags: .=.+1 " inode flags i.flags: .=.+1 " inode flags
" 400000 free?? (checked/toggled by icreat) " 400000 free?? (checked/toggled by icreat)
" 200000 large file " 200000 large file
@@ -225,7 +228,7 @@ dnode: " directory entry:
d.name: .=.+4 " name (space padded) d.name: .=.+4 " name (space padded)
d.uniq: .=.+1 " unique number from directory inode d.uniq: .=.+1 " unique number from directory inode
. = dnode+8 . = dnode+8
fnode: fnode: " open file entry
f.flags: .=.+1 f.flags: .=.+1
f.badd: .=.+1 f.badd: .=.+1
f.i: 0 f.i: 0