mirror of
https://github.com/livingcomputermuseum/pdp7-unix.git
synced 2026-04-26 04:07:24 +00:00
Merge remote-tracking branch 'upstream/master'
Pulling latest from master.
This commit is contained in:
2
man/cp.1
2
man/cp.1
@@ -13,7 +13,7 @@ DESCRIPTION Files are taken in pairs; the first is opened
|
||||
.sp
|
||||
FILES --
|
||||
.sp
|
||||
SEE ALSO cat, pr
|
||||
SEE ALSO cat, pr, rn
|
||||
.sp
|
||||
DIAGNOSTICS Error returns are checked at every system call,
|
||||
and appropriate diagnostics are produced.
|
||||
|
||||
4
man/fs.5
4
man/fs.5
@@ -7,7 +7,7 @@ SYNOPSIS --
|
||||
DESCRIPTION
|
||||
.in 8
|
||||
The RB09 fixed head disk has 8,000 64-word
|
||||
blocks (100 tracks of 80 bloocks)
|
||||
blocks (100 tracks of 80 blocks)
|
||||
on each of its two surfaces. The Unix filesystem
|
||||
is stored in the first 80 tracks of
|
||||
the second surface (physical blocks 8,000 to
|
||||
@@ -129,7 +129,7 @@ all zero words.
|
||||
.sp
|
||||
FILES --
|
||||
.sp
|
||||
SEE ALSO format of directories
|
||||
SEE ALSO dir(V)
|
||||
.sp
|
||||
DIAGNOSTICS --
|
||||
.sp
|
||||
|
||||
15
man/rn.1
15
man/rn.1
@@ -1,26 +1,23 @@
|
||||
.oh '11/3/70''RN(I)'
|
||||
.ta 18 31
|
||||
NAME rn -- rename a file
|
||||
NAME rn -- rename files
|
||||
.sp
|
||||
SYNOPSIS
|
||||
.ul
|
||||
rn
|
||||
name1 name2
|
||||
from to ...
|
||||
.sp
|
||||
DESCRIPTION
|
||||
.ul
|
||||
mv
|
||||
changes the name of name with the rename
|
||||
system call.
|
||||
DESCRIPTION Files are taken in pairs; The file from
|
||||
is renamed to to, and so on...
|
||||
.sp
|
||||
FILES --
|
||||
.sp
|
||||
SEE ALSO --
|
||||
SEE ALSO cp
|
||||
.sp
|
||||
DIAGNOSTICS
|
||||
"? file" - either unable to remove or create
|
||||
a file
|
||||
.sp
|
||||
BUGS The second diagnostic is ambiguous.
|
||||
BUGS The diagnostic is ambiguous.
|
||||
.sp
|
||||
OWNER ken, dmr
|
||||
|
||||
135
src/cmd/dskio.s
135
src/cmd/dskio.s
@@ -1,78 +1,119 @@
|
||||
" dskio
|
||||
|
||||
" Reads 10 blocks from side 0 at block address AC into buffer dskbuf
|
||||
dskrd0: 0
|
||||
dzm side
|
||||
jms dskio; 02000
|
||||
jmp i dskrd0
|
||||
dzm side " set side to 0
|
||||
jms dskio; 02000 " read 10 blocks starting at block AC on side 0
|
||||
jmp i dskrd0 " return to caller
|
||||
|
||||
" Writes 10 blocks from buffer dskbuf onto side 0 at block address AC
|
||||
dskwr0: 0
|
||||
dzm side
|
||||
jms dskio; 03000
|
||||
jmp i dskwr0
|
||||
dzm side " set side to 0
|
||||
jms dskio; 03000 " write 10 blocks tarting at block AC on side 0
|
||||
jmp i dskwr0 " return to caller
|
||||
|
||||
" Reads 10 blocks from side 1 at block address AC into buffer dskbuf
|
||||
dskrd1: 0
|
||||
lmq
|
||||
lmq " set side to 1
|
||||
lac o200000
|
||||
dac side
|
||||
lacq
|
||||
jms dskio; 02000
|
||||
jmp i dskrd1
|
||||
jms dskio; 02000 " read 10 blocks starting at block AC on side 1
|
||||
jmp i dskrd1 " return to caller
|
||||
|
||||
" Writes 10 blocks from buffer dskbuf onto side 1 at block address AC
|
||||
dskwr1: 0
|
||||
lmq
|
||||
lmq " Set side to 1
|
||||
lac o200000
|
||||
dac side
|
||||
lacq
|
||||
jms dskio; 03000
|
||||
jmp i dskwr1
|
||||
|
||||
jms dskio; 03000 " write 10 blocks starting at block AC on side 1
|
||||
jmp i dskwr1 " return to caller
|
||||
|
||||
" dskio depends on the DSLS_BITS after jump to subroutine:
|
||||
" jms dskio; DSLS_BITS
|
||||
" DSLS_BITS 02000 causes a read, 03000 causes a write.
|
||||
"
|
||||
" In both cases 10 blocks worth of data is either transferred from
|
||||
" disk into dskbuf (read), or transferred from dskbuf onto the disk
|
||||
" (write). A block is the same as a segment, each comprising 64 words.
|
||||
"
|
||||
" The location on disk is controlled by the variable "side" and the
|
||||
" value in AC, representing the number of blocks from the start
|
||||
" of the side.
|
||||
"
|
||||
" dskio takes the block address passed in AC, divides it by 80
|
||||
" to get the track address, and as a remainder the segment address.
|
||||
" Both are then re-encoded as BCD, shifted to the correct bit
|
||||
" positions (explained below) and ORed together with the value of
|
||||
" the "side" variable (representing the hundreds flag in the disk
|
||||
" address). This disk address is then passed on to the disk just
|
||||
" before starting the transfer in chunks of 10 segments each.
|
||||
"
|
||||
" The disk address for RB09 disks is formatted like this:
|
||||
"
|
||||
" * Bit 0 not used
|
||||
" * Bit 1 hundreds flag for track address
|
||||
" * Bits 2-5 Tens digit for track address as BCD
|
||||
" * Bits 6-9 Units digit for track address as BCD
|
||||
" * Bits 10-13 Tens digit for segment address as BCD
|
||||
" * Bits 14-17 Units digit for segment address as BCD
|
||||
"
|
||||
" If the disk indicates an error the transfer is attempted 10 times
|
||||
" before dskio gives up and halts the program.
|
||||
dskio: 0
|
||||
cll; idiv; 80
|
||||
dac 2f
|
||||
lacq
|
||||
idiv; 10
|
||||
cll; idiv; 80 " compute binary track and segment addresses
|
||||
dac 2f " store binary segment address
|
||||
lacq " get binary track address back into AC
|
||||
idiv; 10 " compute BCD track address from binary track address
|
||||
dac 3f
|
||||
lls 22
|
||||
xor 3f
|
||||
als 8
|
||||
dac 3f
|
||||
lac 2f
|
||||
idiv; 10
|
||||
xor 3f " OR together Tens and Units digits of BCD track address
|
||||
als 8 " shift BCD track address to bit position in disk address
|
||||
dac 3f " store BCD track address
|
||||
lac 2f " load binary segment address
|
||||
idiv; 10 " compute BCD segment address from binary segment address
|
||||
dac 2f
|
||||
lls 22
|
||||
xor 2f
|
||||
xor 3f
|
||||
xor side
|
||||
dac 2f
|
||||
-10
|
||||
xor 2f " OR together Tens and Units digits of BCD segment address
|
||||
xor 3f " OR together track and segment addresses
|
||||
xor side " OR together side, track and segment addresses
|
||||
" to make the complete disk address
|
||||
dac 2f " store disk address
|
||||
-10 " do at most 10 transfer attempts
|
||||
dac 3f
|
||||
1:
|
||||
dscs
|
||||
-640
|
||||
dscs " clear disk status
|
||||
-640 " prepare transfer of 10 segments (10 blocks)
|
||||
dslw
|
||||
lac dskbufp
|
||||
lac dskbufp " load pointer to dskbuf into MAC
|
||||
dslm
|
||||
lac 2f
|
||||
lac 2f " load previously computed disk address
|
||||
dsld
|
||||
lac dskio i
|
||||
lac dskio i " load disk status register (one bit is the read/write flag)
|
||||
dsls
|
||||
dssf
|
||||
dssf " wait for ERROR/DONE
|
||||
jmp .-1
|
||||
dsrs
|
||||
sma
|
||||
jmp 1f
|
||||
isz 3f
|
||||
jmp 1b
|
||||
hlt
|
||||
dsrs " read disk status into AC, bit 0 indicates errors
|
||||
sma " if bit 0 of AC is set, AC is negative.
|
||||
" if AC is negative, continue below and do another
|
||||
" transfer attempt...
|
||||
jmp 1f " ...otherwise jump to the subroutine exit code below
|
||||
isz 3f " increment transfer attempts, and...
|
||||
jmp 1b " ...retry if more attempts remain
|
||||
hlt " when no more attempts remain, stop program due to
|
||||
" persistent disk error
|
||||
1:
|
||||
isz dskio
|
||||
jmp i dskio
|
||||
2: 0
|
||||
3: 0
|
||||
isz dskio " skip over argument passed to dskio
|
||||
jmp i dskio " return to caller
|
||||
|
||||
o200000: 0200000
|
||||
dskbufp: dskbuf
|
||||
2: 0 " local variable storing first binary segment address,
|
||||
" then disk address
|
||||
3: 0 " local variable storing first BCD track address,
|
||||
" then loop counter
|
||||
|
||||
side: .=.+1
|
||||
dskbuf: .=.+640
|
||||
o200000: 0200000 " bit corresponding to set Hundreds flag in disk address
|
||||
dskbufp: dskbuf " pointer to transfer buffer
|
||||
|
||||
side: .=.+1 " which side to access
|
||||
dskbuf: .=.+640 " transfer buffer for 10 blocks
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
" dskres
|
||||
|
||||
iof
|
||||
hlt
|
||||
dzm track
|
||||
-640
|
||||
" Copies the entire file system (except system image and
|
||||
" swap area) from side 0 of the disk onto same location
|
||||
" on side 1.
|
||||
"
|
||||
" I.e. copies the first 6400 blocks from side 0 to side 1.
|
||||
|
||||
iof " disable interrupts
|
||||
hlt " halt the computer!
|
||||
dzm track " start copying from block address 0
|
||||
-640 " transfer 640 chunks of 10 blocks each
|
||||
dac c1
|
||||
1:
|
||||
lac track
|
||||
lac track " read chunk of blocks starting at block "track" on side 0
|
||||
jms dskrd0
|
||||
|
||||
lac track
|
||||
lac track " write chunk of blocks starting at block "track" on side 1
|
||||
jms dskwr1
|
||||
|
||||
lac track
|
||||
lac track " proceed to next chunk (of 10 blocks)
|
||||
tad d10
|
||||
dac track
|
||||
isz c1
|
||||
jmp 1b
|
||||
isz c1 " increment chunks transferred, if there are chunks remaining
|
||||
jmp 1b " ...loop and transfer the next chunk
|
||||
|
||||
hlt
|
||||
sys exit
|
||||
hlt " ...otherwise halt the computer!
|
||||
sys exit " call exit system call
|
||||
|
||||
track: 0
|
||||
c1: 0
|
||||
d10: 10
|
||||
track: 0 " block address of chunk to transfer
|
||||
c1: 0 " number of chunks remaining
|
||||
d10: 10
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
" dsksav
|
||||
|
||||
iof
|
||||
hlt
|
||||
dzm track
|
||||
-640
|
||||
" Copies the entire file system (except system image and
|
||||
" swap area) from side 1 of the disk onto same location
|
||||
" on side 0.
|
||||
"
|
||||
" I.e. copies the first 6400 blocks from side 1 to side 0.
|
||||
|
||||
iof " disable interrupts
|
||||
hlt " halt the computer!
|
||||
dzm track " start copying from block address 0
|
||||
-640 " transfer 640 chunks of 10 blocks each
|
||||
dac c1
|
||||
1:
|
||||
lac track
|
||||
lac track " read chunk of blocks starting at block "track" on side 1
|
||||
jms dskrd1
|
||||
|
||||
lac track
|
||||
lac track " write chunk of blocks starting at block "track" on side 0
|
||||
jms dskwr0
|
||||
|
||||
lac track
|
||||
lac track " proceed to next chunk (of 10 blocks)
|
||||
tad d10
|
||||
dac track
|
||||
isz c1
|
||||
jmp 1b
|
||||
isz c1 " increment chunks transferred, if there chunks remaining
|
||||
jmp 1b " ...loop and transfer the next chunk
|
||||
|
||||
hlt
|
||||
sys exit
|
||||
hlt " ...otherwise halt the computer!
|
||||
sys exit " call exit system call
|
||||
|
||||
track: 0
|
||||
c1: 0
|
||||
track: 0 " block address of chunk to transfer
|
||||
c1: 0 " number of chunks remaining
|
||||
d10: 10
|
||||
|
||||
Reference in New Issue
Block a user