Merge pull request #36 from philbudne/master

sys comments for rmes/smes calls, process table (user list) words
This commit is contained in:
philbudne
2016-03-08 11:52:03 -05:00
5 changed files with 48 additions and 36 deletions
+5 -5
View File
@@ -86,7 +86,7 @@ swap: 0
jms lookfor; 1 " in/ready jms lookfor; 1 " in/ready
skp skp
jmp 1b " loop until a process becomes ready jmp 1b " loop until a process becomes ready
dzm maxquant " here with in/ready (self?) dzm maxquant " in/ready (self?): come back next tick!
jmp 3f jmp 3f
1: " here with out/ready process 1: " here with out/ready process
dac 9f+t " save process pointer (swapped out) in t0 dac 9f+t " save process pointer (swapped out) in t0
@@ -97,7 +97,7 @@ swap: 0
jmp 2f jmp 2f
1: 1:
lac swap lac swap
dac u.swapret " return to scheduler when swapped back dac u.swapret " return to caller when swapped back
iof iof
lac o200000 " change status to swapped out lac o200000 " change status to swapped out
tad u.ulistp i tad u.ulistp i
@@ -105,13 +105,13 @@ swap: 0
ion ion
jms dskswap; 07000 " swap process out jms dskswap; 07000 " swap process out
lac u.dspbuf lac u.dspbuf
sna sna " process using display??
jmp 2f jmp 2f " no
law dspbuf law dspbuf
jms movdsp jms movdsp
2: 2:
iof " disable interrupts iof " disable interrupts
lac o600000 " change status (1->7?) lac o600000 " change status (1->7?????)
tad 9f+t i tad 9f+t i
dac 9f+t i dac 9f+t i
ion " enable interrupts ion " enable interrupts
+1 -1
View File
@@ -284,7 +284,7 @@ open1: " common exit for open/creat
jmp 1f " no jmp 1f " no
iof " yes: disable interrupts iof " yes: disable interrupts
lac ii " get i number lac ii " get i number
tad swr " get read routine table addr tad swr " add to base instruction
dac .+1 dac .+1
jmp .. i " dispatch to read routine jmp .. i " dispatch to read routine
1: 1:
+36 -27
View File
@@ -1,7 +1,7 @@
"** 01-s1.pdf page 14 "** 01-s1.pdf page 14
" s3 " s3
" search for user (process) " search for user (process) table entry
" call: " call:
" jms searchu; worker_routine_addr " jms searchu; worker_routine_addr
" worker called with copy of a process table entry in "lu" " worker called with copy of a process table entry in "lu"
@@ -113,36 +113,44 @@ badcal: " bad (unimplemented) system call
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 " find a new process to run jms swap " find a new process to run
" exit falls into "rmes" !!!
" rmes system call
" sys smes
" returns with message delivered, or error if process does not exit
" AC/ sending pid
" MQ/ message
.rmes: .rmes:
jms awake jms awake
lac o100000 lac o100000 " mark this process to "not ready"
tad u.ulistp i tad u.ulistp i
dac u.ulistp i dac u.ulistp i
law 2 law 2
tad u.ulistp tad u.ulistp
dac 9f+t dac 9f+t " pointer to msg status in proc table
-1 -1
dac 9f+t i dac 9f+t i " set to -1 (waiting for message)
jms swap jms swap " switch processes
law 2 law 2
tad u.ulistp tad u.ulistp
dac 9f+t dac 9f+t
lac 9f+t i lac 9f+t i " get msg status word
cma cma " complement (get sender pid)
dac u.ac dac u.ac " return in user AC
dzm 9f+t i dzm 9f+t i " clear status word
isz 9f+t isz 9f+t
lac 9f+t i lac 9f+t i " get message
dac u.mq dac u.mq " return in user MQ
dzm 9f+t i dzm 9f+t i " clear message
jmp sysexit jmp sysexit
t = t+1 t = t+1
"** 01-s1.pdf page 16 "** 01-s1.pdf page 16
" smes system call " smes system call
" AC/ pid " AC/ pid
" MQ/ message
" sys smes " sys smes
" returns with message delivered, or error if process does not exit
.smes: .smes:
lac u.ac " get pid from user AC lac u.ac " get pid from user AC
sna spa " >0? sna spa " >0?
@@ -158,10 +166,10 @@ t = t+1
sad u.ac " match? sad u.ac " match?
skp " yes skp " yes
jmp 1b i " no jmp 1b i " no
lac lu+2 " get mailbox lac lu+2 " get mailbox status
sad dm1 " -1? sad dm1 " -1?
jmp 1f " yes jmp 1f " yes
lac o100000 " no: increment process status lac o100000 " no: bump our process status (to notready?)
tad u.ulistp i tad u.ulistp i
dac u.ulistp i dac u.ulistp i
law 2 law 2
@@ -178,35 +186,36 @@ t = t+1
1: 1:
-3 -3
tad 8 tad 8
dac 9f+t dac 9f+t " pointer to dest process ulist entry
lac o700000 lac o700000 " complement process status? marks ready??
tad 9f+t i tad 9f+t i
dac 9f+t i dac 9f+t i
isz 9f+t isz 9f+t
isz 9f+t isz 9f+t " point to mailbox word?
lac u.pid lac u.pid " get our pid
cma cma " complement
dac 9f+t i dac 9f+t i " store in mailbox??
isz 9f+t isz 9f+t " advance to next word
lac u.mq lac u.mq " get user MQ
dac 9f+t i dac 9f+t i " save as message
jmp okexit jmp okexit
t = t+1 t = t+1
" wake up process hanging on rmes for current process??
awake: 0 awake: 0
jms searchu; 1f jms searchu; 1f
jmp awake i jmp awake i
1: 0 " searchu worker 1: 0 " searchu worker
lac u.pid " get caller pid lac u.pid " get caller pid
sad lu+2 " match process table entry? sad lu+2 " match mailbox status?
skp " yes skp " yes
jmp 1b i " no, return jmp 1b i " no, return
-3 -3
tad 8 " get pointer to pid in process table?? tad 8 " get pointer to process table entry
dac 9f+t " save in t0 dac 9f+t " save in t0
"** 01-s1.pdf page 17 "** 01-s1.pdf page 17
lac o700000 " set high bits lac o700000
tad 9f+t i tad 9f+t i " complement process status (mark ready)??
dac 9f+t i dac 9f+t i
jmp 1b i " return from worker jmp 1b i " return from worker
t = t+1 t = t+1
+1 -1
View File
@@ -330,7 +330,7 @@ putcr: 0
cla cla
jmp putcr i jmp putcr i
intrp1: " here with keyboard interrupt intrp1: " here with TTY interrupt character
lac d6 " get keyboard special device number lac d6 " get keyboard special device number
dac .int1 " save as interrupt source dac .int1 " save as interrupt source
lac d1 lac d1
+5 -2
View File
@@ -175,8 +175,11 @@ sysdata: " system data 64 words saved to disk
" 4: out/notready?? " 4: out/notready??
" bits 3:17 -- disk swap address/8 " bits 3:17 -- disk swap address/8
" second word: process pid " second word: process pid
" third word: used for smes/rmes " third word: smes/rmes status:
" fourth word: ?? " 0: not waiting
" -1: this process waiting (rmes)
" other: complement of sender pid
" fourth word: smes message
ulist: ulist:
0131000;1;0;0 0131000;1;0;0
0031040;0;0;0 0031040;0;0;0