1
0
mirror of https://github.com/DoctorWkt/unix-jun72.git synced 2026-04-14 07:50:43 +00:00

Much cleanup of text errors, driven by v7 assembler errors

This commit is contained in:
brad@heeltoe.com
2008-04-30 20:37:22 +00:00
parent dfafd5e39a
commit a293418bb9
22 changed files with 63 additions and 63 deletions

View File

@@ -25,11 +25,11 @@
mov $41.,r0 / rootdir set to 41 and never changed
mov r0,rootdir / rootdir is i-number of root directory
mov r0,u.cd1r / u.cd1r 1s i-number of process current directory
mov r0,u.cdir / u.cdir is i-number of process current directory
mov $1,r0
movb r0,u.uno / set process table index for this process to 1
mov r0,mpid / initialize mpid to 1
mov r0,p.p1d / p.pid identifies process
mov r0,p.pid / p.pid identifies process
movb r0,p.stat / process status = 1 i.e., active
/ = 0 free
.if cold / = 2 waiting for a child to die

View File

@@ -43,7 +43,7 @@ rtssyms:
rts r0
rts r1
rts r2
tts r3
rts r3
rts r4
rts r5
rts sp

View File

@@ -3,7 +3,7 @@
tswap:
movb u.uno,r1 / move users process number to r1
mov $runq+4,r2 / move lowest priority queue address to r2
jsr rO,putlu / create link from last user on Q to u.uno's user
jsr r0,putlu / create link from last user on Q to u.uno's user
swap:
mov $300,*$ps / processor priority = 6
mov $runq,r2 / r2 points to runq table
@@ -12,7 +12,7 @@ swap:
bne 1f / yes, process 1f
cmp r2,$runq+6 / if zero compare address to end of table
bne 1b / lf not at end, go back
jsr rO,idle; s.idlet+2 / waif for interrupt; all queues
jsr r0,idle; s.idlet+2 / waif for interrupt; all queues
/ are empty
br swap
1:
@@ -32,24 +32,24 @@ swap:
clr *$ps / clear processor status
cmpb r1,u.uno / is this process the same as the process in core?
beq 2f / yes, don't have to swap
mov rO,-(sp) / no, write out core; save rO (address in rout? v
mov r0,-(sp) / no, write out core; save r0 (address in rout? v
/ that called swap)
mov sp,u.usp / save stack pointer
mov $sstack,sp / move swap stack pointer to the stack pointer
mov r1,-(sp) / put r1 (new process #) on the stack
tstb u.uno / is the process # = O
beq 1f / yes, kill process by overwriting
jsr rO,wswap / write out core to disk
jsr r0,wswap / write out core to disk
1:
mov (sp)+,r1 / restore r1 to new process number
jsr rO,rswap / read new process 1nto core
jsr rO,unpack / unpack the users stack from next to his program
jsr r0,rswap / read new process 1nto core
jsr r0,unpack / unpack the users stack from next to his program
/ to its normal
mov u.usp,sp / location; restore stack pointer to new process
/ stack
mov (sp)+,rO / put address of where the process that just got
mov (sp)+,r0 / put address of where the process that just got
/ swapped in, left off., i.e., transfer control
/ to new process
2:
movb $30.,uquant / initialize process time quantum
rts rO / return
rts r0 / return

View File

@@ -50,7 +50,7 @@ rswap:
bne 1b / no, wait for bit 15 to clear (inhibit blt)
mov u.emt,*$3O / yes move these
mov u.ilgins,*$10 / back
rts rO / return
rts r0 / return
unpack: / move stack back to its normal place
mov u.break,r2 / r2 points to end of user program

View File

@@ -6,6 +6,6 @@
bgt 1b / branch u til all data words in buffer are zero
jsr r0,dskwr / write zeroed buffer area out onto physical
/ block specified
rts rO / in r1
rts r0 / in r1

View File

@@ -1,15 +1,15 @@
/ u4 -- unix
setisp:
mov r1,(sp)
mov r2,(sp)
mov r1,-(sp)
mov r2,-(sp)
mov r3,-(sp)
mov clockp,-(sp)
mov $s.syst+2,clockp
jmp (r0)
clock: / interrupt from 60 cycle clock
mov r0,(sp) / save r0
mov r0,-(sp) / save r0
tst *$lks / restart clock?
mov $s.time+2,r0 / increment the time of day
inc (r0)
@@ -30,7 +30,7 @@ clock: / interrupt from 60 cycle clock
bge 2f / yes, check time outs
tstb (r0) / no, user timed out?
bne 1f / no
cmpb sysflg,$1 / yes, are we outside the system?
cmpb sysflg,$-1 / yes, are we outside the system?
bne 1f / no, 1f
mov (sp)+,r0 / yes, put users r0 in r0
sys 0 / sysrele

View File

@@ -1,4 +1,4 @@
mov $toutstoutt1,r0 / set up r0 as index to decrement thru
mov $touts-toutt-1,r0 / set up r0 as index to decrement thru
/ the table
1:
tstb toutt(r0) / is the time out for this entry —
@@ -12,7 +12,7 @@
dec r0 / set up r0 for next entry
bge 1b / finished? , no, go back `
br retisp / yes, restore registers and do a rtl
ttyl: / console tty input interrupt routine
ttyi: / console tty input interrupt routine
jsr r0,setisp / save reg r1, r2, r3
mov *$tkb,r1 / r1 = char in tty reader buffer
inc *$tks / set the reader enable bit
@@ -21,7 +21,7 @@ ttyl: / console tty input interrupt routine
cmp r1,$'a-40 / is character upper case A,..., upper case Z.
/ note that
blt 1f / lower case a ls represented by 141, upper case by
cmp r1,$'z40 / 101; and lower case z by 172, upper
cmp r1,$'z-40 / 101; and lower case z by 172, upper
/ case Z by 132.
bgt 1f / if not upper case, branch
add $40,r1 / if upper case, calculate the representation of its

View File

@@ -46,11 +46,11 @@ wakeup: / wakeup processes waiting for an event by linking them to the
sleep: / wait for event
jsr r0,isintr / check to see if interrupt or quit from user
br 2f / something happened / yes, his interrupt so return
/ to user
br 2f / something happened / yes, his interrupt so return
/ to user
mov (r0)+,r1 / put number of wait channel in r1
movb wlist(r1),(sp) / put old process number in there, on
movb wlist(r1),-(sp) / put old process number in there, on
/ the stack
movb u.uno,wlist(r1) / put process number of process to put
movb u.uno,wlist(r1) / put process number of process to put
/ to sleep in there
mov cdev,-(sp) / nothing happened in isintr so
mov cdev,-(sp) / nothing happened in isintr so

View File

@@ -16,7 +16,7 @@
isintr:
mov r1,-(sp) / put number of wait channel on the stack
mov r2,(sp) / save r2
mov r2,-(sp) / save r2
mov u.ttyp,r1 / r1 = pointer to buffer of process control
/ typewriter
beq 1f / if 0, do nothing except skip return
@@ -24,7 +24,7 @@ isintr:
beg 1f / if its 0 do nothing except skip return
cmp r1,$177 / is interrupt char e delete?
bne 3f / no, so lt must be a quit (fs)
tst u.1ntr / yes, value of u.intr determines handling
tst u.intr / yes, value of u.intr determines handling
/ of interrupts
bne 2f / if not 0, 2f. If zero do nothing.
1:

View File

@@ -35,7 +35,7 @@ read:
rcvt / tty4
rcvt / tty5
rcvt / tty6
zcvt / ety7
rcvt / tty7
rcrd/ crd
rtty: / read from console tty
mov tty+[8*ntty]-8+6,r5 / r5 is the address of the 4th word of

View File

@@ -3,8 +3,8 @@
br 1b / get next character
ret1:
jmp ret / return to caller via 'ret'
rppt: / read paper tape`
jsr r0,ppt1c / gets next character in clist for ppt input and
rppt: / read paper tape
jsr r0,pptic / gets next character in clist for ppt input and
/ places
br ret / it 1n r1; 1f there 1s no problem with reader, it
/ also enables read bit Ln prs

View File

@@ -23,10 +23,10 @@ writei:
jmp *1f-2(r1) / jump table and jump to the appropriate routine
1:
wtty / tty
wnpk / ppt
wppt / ppt
wmem / mem
wrf0 / rf0
wzk0 / rk0
wrk0 / rk0
wtap / tap0
wtap / tap1
wtap / tap2
@@ -48,7 +48,7 @@ writei:
wtty:
jsr r0,cpass / get next character from user buffer area; if
/ none go to return address in syswrite
tsl r1 / is character = null
tst r1 / is character = null
beq wtty / yes, get next character
1 :
mov $240,*$ps / no, set processor priority to five

View File

@@ -51,6 +51,6 @@ sioreg:
mov *u.fofp,r2 / file offset (in bytes) is moved to r2
mov r2,r3 / and also to r3
bis $177000,r3 / set bits 9,...,15. of file offset in r3
bic $l777,r2 / calculate file offset mod 512.
bic $!777,r2 / calculate file offset mod 512.
add r5,r2 / r2 now points to 1st byte in system buffer where
/ data is to be placed

View File

@@ -1,11 +1,11 @@
2: / check open write access
neg r1 / make inode number positive
jsr r0,access; 1 / get inode in 0 core
bit $40000,i.figs / is it a directory?
bit $40000,i.flgs / is it a directory?
bne 2f / yes, transfer (error)
cmp r1,$40. / no, is it a special file?
bgt 3f / no, return
mov n,-(sp) / yes
mov r1,-(sp) / yes
asl r1
jmp *1f-2(r1) / figure out which special file it is
/ and transfer

View File

@@ -1,9 +1,9 @@
cmp r1,(r0)+ / block # greater than or equal to maximum
/ block number allowed
bhis error1O / yes, error
bhis error10 / yes, error
inc *u.fofp / no, *u.fofp has next block number
jsr r0,preread / read in the block whose number is in r1
bis $4000O,(r5) / set bit 14 of the 1st word of the I/O
bis $40000,(r5) / set bit 14 of the 1st word of the I/O
/ buffer
1:
bit $22000,(r5) / are 10th and 13th bits set (read bits)
@@ -17,7 +17,7 @@
mov (sp)+,r5 / restore r5
br 1b / go back
2: / drum or disk
jsr r0,idle; s.wa1t+2 / wait
jsr r0,idle; s.wait+2 / wait
br 1b
1: / 10th and 13th bits not set
bic $40000,(r5) / clear bit 14
@@ -40,13 +40,13 @@ bwrite: / write on block structured device »
jsr r0,tstdeve / test the device for an error
mov *u.fofp,r1 / put the block number in r1
cmp r1,(r0)+ / does block number exceed maximum allowable #
bhis error1O / yes, error
bhis error10 / yes, error
inc *u.fofp / no, increment block number
jsr r0,wslot / get an I/O buffer to write into
jsr r0,dioreg / do the necessary bookkeeping
1: / r2 points to the users data; r5-points to the I/O buffers data area
movb (r2)+,(r5)+ / ; r3, has the byte count
dcc r3 / area to the I/O buffer
dec r3 / area to the I/O buffer
bne 1b
jsr r0,dskwr / write it out on the device
tst u.count / done

View File

@@ -43,7 +43,7 @@ dskrd:
clr *$ps
bit $22000,(r5) / if either bits 10, or 13 are 1; jump to idle
beq 1f
jsr r0,1d1e; s.wa1t+2
jsr r0,idle; s.wait+2
br 1b
1:
add $8,r5 / r5 points to first word of data in block just read

View File

@@ -24,8 +24,8 @@ ppoke:
clr *$ps
rts r0
poke:
mov r1,(sp)
mov r2,(sp)
mov r1,-(sp)
mov r2,-(sp)
mov r3,-(sp)
mov $bufp+nbuf+nbuf+6,r2 / r2 points to highest priority I/O
/ queue pointer
@@ -36,9 +36,9 @@ poke:
beq 2f / branch to 2f if both are clear
bit $130000,(r1) / test bits 12, 13, and 15
bne 2f / branch if any are set
movb (r1),r3 / get device 1d
movb (r1),r3 / get device id
tstb deverr(r3) / test for errors on this device
beg 3f / branch if no errors
beq 3f / branch if no errors
mov $-1,2(r1) / destroy associativity
clrb 1(r1) / do not do I/O
br 2f

View File

@@ -8,7 +8,7 @@
prf: / drum
bit $1,active / test drum busy blt
bne 2f / branch if bit is set
bis $1,act1ve / set drum busy bit
bis $1,active / set drum busy bit
mov r1,rfap / rfap points to current I/O queue entry for drum
mov $dae+2,r3
clr -(sp)
@@ -21,7 +21,7 @@ prf: / drum
/ number
3:
mov (sp)+,-(r3) / load rkda register; load dar register
mov 6(r1),(r3) / load bus address register
mov 6(r1),-(r3) / load bus address register
mov 4(r1),-(r3) / load word count register
mov $103,-(sp) / 103 indicates write operation when loaded
/ in csr
@@ -30,7 +30,7 @@ prf: / drum
beq 3f / then read operation is indicated
mov $105,(sp) / 105 indicates read operation
3:
mov (sp)+,(r3) / load csr with interrupt enabled, command, go
mov (sp)+,-(r3) / load csr with interrupt enabled, command, go
br seta
ptc: / tape I/O
bit $4,active
@@ -46,7 +46,7 @@ ptc: / tape I/O
bis $4,active
mov r1,tcap
mov $20.,tcerrc
mov sta e1,tcstate
mov $tape1,tcstate
movb (r1),r3 / device
sub $2,r3 / now unit
swab r3

View File

@@ -33,7 +33,7 @@ taper: / dec tape error
bis $4000,(r2) / set tape to reverse direction
mov $tape2,tcstate / put tape 2 as the state
0:
bis $4,act1ve / check active bit of tape
bis $4,active / check active bit of tape
movb $103,(r2) / set read function and interrupt enable
br 4f / go to retisp
tape1: / read bn forward
@@ -41,15 +41,15 @@ tape1: / read bn forward
cmp (r0),2(r1) / compare block addresses
blt 0b / if lt, keep moving
bgt taper / if gt, reverse
mov 6(r1),(r0) / put bus address in tcba
mov 6(r1),-(r0) / put bus address in tcba
mov 4(r1),-(r0) / put word count in tcwc
mov $115,(sp) / put end interrupt enable
mov $115,-(sp) / put end interrupt enable
bit $20000,(r1) / is "waiting to read bit" of I/O queue set?
beq 1f / no 1f
mov $105,(sp) / yes, put and lnterrupt enable
1:
movb (sp)+,(r2) / move function into command register (tccm)
bis $4,actlve / set active bit
bis $4,active / set active bit
mov $tape3,tcstate / get ready for I/O transfer
br 4f / go to retisp (rtl)

View File

@@ -1,5 +1,5 @@
mov tcdt,rO / rO has contents of data register
add $3,rO / overshoot
mov tcdt,r0 / r0 has contents of data register
add $3,r0 / overshoot
cmp r0,2(r1)
bgt 0b / if gt keep reading
br taper / else reverse
@@ -7,11 +7,11 @@
tape3: / I/O transfer ·
bic $30000,(r1) / clear bits 12 and 13 of I/0 queue entry
jsr r0,poke / do the I/O
bit $4,act1ve / still k sy see if pick up r-ahead, w-behind
bit $4,active / still k sy see if pick up r-ahead, w-behind
bne 1f / yes I
movb $1,(r2) / no, indicate too bad
1:
jsr rO,wakeup; runq; 31. / wait up
jsr r0,wakeup; runq; 31. / wait up
br 4f / retisp
drum: / interrupt handler
@@ -46,10 +46,10 @@ disk:
asr (r1) / reissue request
dec r1
3:
bic $3000O,(r1) / clear bits 12 and 13 in 1st word of buffer
bic $30000,(r1) / clear bits 12 and 13 in 1st word of buffer
mov ac,-(sp)
mov mq,(sp) / put these on the stack
mov sc,(sp)
mov mq,-(sp) / put these on the stack
mov sc,-(sp)
jsr r0,poke
mov (sp)+,sc
mov (sp)+,mq / pop them off stack

View File

@@ -7,7 +7,7 @@ trapt: / r2 points to the
tst (sp)+
tstb (r2) / is ready bit of dcs set?
bge 4b / device still active so branch
bit (r0),act1ve / was device busy?
bit (r0),active / was device busy?
beq 4b / no, stray interrupt -
bic (r0)+,active / yes, set active to zero
tst (r2) / test the err(bit is) of dcs

View File

@@ -25,7 +25,7 @@ mount: .=.+1024.
proc:
p.pid: .=.+[2*nproc]
p.dska: .=.+[2*nproc]
p.ppid; .=.+[2*nproc]
p.ppid: .=.+[2*nproc]
p.break:.=.+[2*nproc]
p.link: .=.+nproc
p.stat: .=.+nproc