1
0
mirror of https://github.com/PDP-10/its.git synced 2026-03-24 01:27:33 +00:00

Files for MINSYS.

This commit is contained in:
Lars Brinkhoff
2018-02-28 16:01:51 +01:00
parent 15f4c90806
commit 63f846d8f7
4 changed files with 780 additions and 0 deletions

1
src/alan/tape.bits Symbolic link
View File

@@ -0,0 +1 @@
syseng/tape.bits

345
src/kshack/minsys.20 Executable file
View File

@@ -0,0 +1,345 @@
; -*- Midas -*-
title MINSYS - Write minimum system files to tape.
a=:1
b=:2
c=:3
d=:4
e=:5
t=:6
tt=:7
x=:10
y=:11
z=:12
p=:17
ch==:0,,-1
chttyi==:1
chttyo==:2
chdski==:3
chtape==:4
%fr==:0,,525252
%fl==:1,,525252
call=:pushj p,
return=:popj p,
save==:push p,
rest==:pop p,
flose=:.lose %lsfil
slose=:.lose %lssys
pause=:.break 16,100000
quit=:.logout 1,
tyi=:.iot chttyi,
tyo=:.iot chttyo,
mtopen==:.open chtape,[.bao,,'mt0 ? setz ? setz]
define syscall name,args
.call [setz ? sixbit /name/ ? args(400000)]
termin
popj1: aos (p)
cpopj: return
format"$$pcode==:1
format"$$errs==:0
.insrt dsk:syseng;format >
outstr: syscall siot,[movei chttyo ? a ? b]
slose
return
define format &string&,args
call [
call $format
.zzz.==-1
irp arg,,[args]
save arg
.zzz.==.irpcnt
termin
hrroi a,[ascii string]
movei b,.length string
movni c,.zzz.+1
jrst format"format]
termin
$forma: save a
save b
save c
save [.+2]
jrst @-4(p)
rest c
rest b
rest a
rest (p)
return
.insrt dsk:alan;tape bits
define mtcmd arg
move tt,[chtape,,[arg]]
.mtape tt,
.lose
termin
lpdl==:100.
.vector pdl(lpdl)
.scalar qdate ; Current date in disk format
go: move p,[-lpdl,,pdl-1]
.open chttyi,[.uai,,'tty ? setz ? setz]
slose
.open chttyo,[.uao\%tjdis,,'tty ? setz ? setz]
slose
.open chtape,[.bai,,'mt0 ? setz ? setz]
slose
mtcmd %mcbot
mtopen
slose
syscall rqdate,[movem qdate]
slose
.rdate t,
movem t,thdate
move t,[-lthblk,,thblk]
.iot chtape,t
movsi a,-lfiles
jrst loop0
lbuffer==:4000
.vector buffer(lbuffer)
loop: mtopen
slose
loop0: move b,files(a)
format "~&DSK:~S;~S ~S",[dir(b),fn1(b),fn2(b)]
move t,fn1(b)
movem t,mhfn1
move t,fn2(b)
movem t,mhfn2
move t,dir(b)
movem t,mhdir
move t,lnpk(b)
movem t,mhlnpk
jumpn t,dolink
dofile: format " <- ~S:~S;~S ~S",[xdev(b),xdir(b),xfn1(b),xfn2(b)]
syscall open,[[.bai,,chdski]
xdev(b) ? xfn1(b) ? xfn2(b) ? xdir(b)]
flose
syscall rfdate,[movei chdski ? movem t]
move t,qdate
movem t,mhdate
movsi t,(sixbit />/)
came t,fn2(b)
jrst dofil1
syscall rfname,[movei chdski
repeat 3,[ ? movem mhfn2]]
slose
format " (~S)",mhfn2
dofil1: move t,[-lmhblk,,mhblk]
.iot chtape,t
copylp: move t,[-lbuffer,,buffer]
.iot chdski,t
hrloi tt,-1-buffer(t)
eqvi tt,buffer
.iot chtape,tt
jumpge t,copylp
aobjn a,loop
jrst done
dolink: format " => ~S;~S ~S",[xdir(b),xfn1(b),xfn2(b)]
move t,xfn1(b)
movem t,lnkfn1
move t,xfn2(b)
movem t,lnkfn2
move t,xdir(b)
movem t,lnkdir
move t,qdate
movem t,mhdate
move t,[-lmhlnk,,mhblk]
.iot chtape,t
aobjn a,loop
done: .close chtape,
pause
quit
define def name
name==:.loc.
.loc.==.loc.+1
termin
.loc.==0
def fn1
def fn2
def dir
def lnpk
def xdev
def xfn1
def xfn2
def xdir
define defile dr,n1,n2,xdv=DSK,xdr,xn1,xn2
.dir.==sixbit /dr/
.fn1.==sixbit /n1/
.fn2.==sixbit /n2/
.xdev.==sixbit /xdv/
.xfn1.==sixbit /xn1/
.xfn2.==sixbit /xn2/
.xdir.==sixbit /xdr/
[ .fn1. ? .fn2. ? .dir. ? 0 ? .xdev.
ife .xfn1., .fn1.
ifn .xfn1., .xfn1.
ife .xfn2., .fn2.
ifn .xfn2., .xfn2.
ife .xdir., .dir.
ifn .xdir., .xdir.
]
termin
define delink dr,n1,n2,xdv=DSK,xdr,xn1,xn2
.dir.==sixbit /dr/
.fn1.==sixbit /n1/
.fn2.==sixbit /n2/
ifsn [xdv]DSK, .err Ignoring device xdv
.xfn1.==sixbit /xn1/
.xfn2.==sixbit /xn2/
.xdir.==sixbit /xdr/
[ .fn1. ? .fn2. ? .dir. ? 1,,0 ? 0
ife .xfn1., .fn1.
ifn .xfn1., .xfn1.
ife .xfn2., .fn2.
ifn .xfn2., .xfn2.
ife .xdir., .dir.
ifn .xdir., .xdir.
]
termin
files:
; Get system up, and running DUMP under DDT
defile .,@,ddt
defile .,its,bin,,kshack,minsys,its
defile .,salv,bin,,kshack,minsys,salv
defile .,dskdmp,bin,,kshack,minsys,dskdmp
defile sys,atsign,ddt
delink sys,atsign,hactrn,,,atsign,ddt
defile sysbin,dump,bin,,kshack,minsys,dump
delink sys,ts,dump,,sysbin,dump,bin
; Time setter
defile sys,ts,pdset
; FE filesystem
defile .,bt,bin,,kshack,minsys,bt
defile .,ram,ram,,kshack,minsys,ram
defile sys,ts,ksfedr
; Backup copies of the really vital stuff
defile backup,@,ddt
defile backup,its,bin,,kshack,minsys,its
defile backup,salv,bin,,kshack,minsys,salv
defile backup,dskdmp,bin,,kshack,minsys,dskdmp
defile backup,bt,bin,,kshack,minsys,bt
defile backup,ram,ram,,kshack,minsys,ram
; if atsign hactrn is busted, what can you do?
defile backup,ts,dump,,kshack,minsys,dump
defile backup,ts,pdset,,sys
defile backup,ts,ksfedr,,sys
; System demons
defile channa,atsign,taraka
delink sys,atsign,dragon,,channa,atsign,taraka
defile channa,rakash,dmpcpy
defile dragon,rakash,pfthmg
delink channa,rakash,pfthmg,,dragon,rakash,pfthmg
defile dragon,dragon,hoard,,kshack,minsys,hoard
defile channa,logout,times,,kshack,minsys,empty
; Some well-known databases
defile sysbin,hosts3,>
defile inquir,lsr1,>
defile syseng,ttytyp,>
; Highly handy system programs
defile sys,ts,peek
delink sys,ts,p,,sys,ts,peek
defile sysbin,peek,bin
defile sys,ts,lock
defile sys,ts,name
delink sys,ts,f,,sys,ts,name
defile sysbin,name,bin
; Job Devices and Networks
defile sys,atsign,device
defile sys,atsign,chaos
defile sys,atsign,tcp
defile device,atsign,mldev
defile device,atsign,mlslv
delink device,chaos,mldev,,,atsign,mlslv
; Chaosnet file transfer
defile device,chaos,file
defile sys1,ts,cftp
; Telnet and supdup
defile sysbin,telser,bin
delink device,chaos,telnet,,sysbin,telser,bin
delink device,chaos,supdup,,sysbin,telser,bin
delink device,tcp,syn027,,sysbin,telser,bin
delink device,tcp,syn137,,sysbin,telser,bin
defile sysbin,supdup,bin
defile sysbin,chtn,bin
defile sysbin,telnet,bin
delink sys1,ts,supdup,,sysbin,supdup,bin
delink sys2,ts,chtn,,sysbin,chtn,bin
delink sys,ts,telnet,,sysbin,telnet,bin
; Internet file transfer
defile sysbin,ftpu,bin
defile sysbin,ftps,bin
delink sys2,ts,ftp,,sysbin,ftpu,bin
delink device,tcp,syn025,,sysbin,ftps,bin
lfiles==:.-files
cnstnts:
constants
variables
; Tape info
thblk: -lthblk,,0
thtpn: 1,,0 ; tape,,reel
thdate: 0 ; creation date in SIXBIT
thtype: 0 ; type: 0 => random
lthblk==:.-thblk
; File info
mhblk: -lmhblk,,0
mhdir: 0 ; dir
mhfn1: 0 ; fn1
mhfn2: 0 ; fn2
mhlnpk: 0 ; linkp,,pack
mhdate: 0 ; creation date in disk format
lmhblk==:.-mhblk
; Link info
lnkfn1: 0 ; fn1
lnkfn2: 0 ; fn2
lnkdir: 0 ; dir
lmhlnk==:.-mhblk
patch::
pat: block 100.
epatch: -1 ; Make memory exist, end of patch area
ffaddr:
ffpage==:<ffaddr+1777>_-12
end go

376
src/minsys/minsys.9 Executable file
View File

@@ -0,0 +1,376 @@
; -*- Midas -*-
title MINSYS - Write minimum system files to tape.
a=:1
b=:2
c=:3
d=:4
e=:5
t=:6
tt=:7
x=:10
y=:11
z=:12
p=:17
ch==:0,,-1
chttyi==:1
chttyo==:2
chdski==:3
chtape==:4
%fr==:0,,525252
%fl==:1,,525252
call=:pushj p,
return=:popj p,
save==:push p,
rest==:pop p,
flose=:.lose %lsfil
slose=:.lose %lssys
pause=:.break 16,100000
quit=:.logout 1,
tyi=:.iot chttyi,
tyo=:.iot chttyo,
mtopen==:.open chtape,[.bao,,'mt0 ? setz ? setz]
define syscall name,args
.call [setz ? sixbit /name/ ? args(400000)]
termin
popj1: aos (p)
cpopj: return
format"$$pcode==:1
format"$$errs==:0
.insrt dsk:syseng;format >
outstr: syscall siot,[movei chttyo ? a ? b]
slose
return
define format &string&,args
call [
call $format
.zzz.==-1
irp arg,,[args]
save arg
.zzz.==.irpcnt
termin
hrroi a,[ascii string]
movei b,.length string
movni c,.zzz.+1
jrst format"format]
termin
$forma: save a
save b
save c
save [.+2]
jrst @-4(p)
rest c
rest b
rest a
rest (p)
return
.insrt dsk:syseng;tape bits
define mtcmd arg
move tt,[chtape,,[arg]]
.mtape tt,
.lose
termin
lpdl==:100.
.vector pdl(lpdl)
.scalar qdate ; Current date in disk format
go: move p,[-lpdl,,pdl-1]
.open chttyi,[.uai,,'tty ? setz ? setz]
slose
.open chttyo,[.uao\%tjdis,,'tty ? setz ? setz]
slose
.open chtape,[.bai,,'mt0 ? setz ? setz]
slose
mtcmd %mcbot
mtopen
slose
syscall rqdate,[movem qdate]
slose
.rdate t,
movem t,thdate
move t,[-lthblk,,thblk]
.iot chtape,t
movsi a,-lfiles
jrst loop0
lbuffer==:4000
.vector buffer(lbuffer)
loop: mtopen
slose
loop0: move b,files(a)
format "~&DSK:~S;~S ~S",[dir(b),fn1(b),fn2(b)]
move t,fn1(b)
movem t,mhfn1
move t,fn2(b)
movem t,mhfn2
move t,dir(b)
movem t,mhdir
move t,lnpk(b)
movem t,mhlnpk
jumpn t,dolink
dofile: format " <- ~S:~S;~S ~S",[xdev(b),xdir(b),xfn1(b),xfn2(b)]
syscall open,[[.bai,,chdski]
xdev(b) ? xfn1(b) ? xfn2(b) ? xdir(b)]
flose
syscall rfdate,[movei chdski ? movem t]
move t,qdate
movem t,mhdate
movsi t,(sixbit />/)
came t,fn2(b)
jrst dofil1
syscall rfname,[movei chdski
repeat 3,[ ? movem mhfn2]]
slose
format " (~S)",mhfn2
dofil1: move t,[-lmhblk,,mhblk]
.iot chtape,t
copylp: move t,[-lbuffer,,buffer]
.iot chdski,t
hrloi tt,-1-buffer(t)
eqvi tt,buffer
.iot chtape,tt
jumpge t,copylp
aobjn a,loop
jrst done
dolink: format " => ~S;~S ~S",[xdir(b),xfn1(b),xfn2(b)]
move t,xfn1(b)
movem t,lnkfn1
move t,xfn2(b)
movem t,lnkfn2
move t,xdir(b)
movem t,lnkdir
move t,qdate
movem t,mhdate
move t,[-lmhlnk,,mhblk]
.iot chtape,t
aobjn a,loop
done: .close chtape,
pause
quit
define def name
name==:.loc.
.loc.==.loc.+1
termin
.loc.==0
def fn1
def fn2
def dir
def lnpk
def xdev
def xfn1
def xfn2
def xdir
define defile dr,n1,n2,xdv=DSK,xdr,xn1,xn2
.dir.==sixbit /dr/
.fn1.==sixbit /n1/
.fn2.==sixbit /n2/
.xdev.==sixbit /xdv/
.xfn1.==sixbit /xn1/
.xfn2.==sixbit /xn2/
.xdir.==sixbit /xdr/
[ .fn1. ? .fn2. ? .dir. ? 0 ? .xdev.
ife .xfn1., .fn1.
ifn .xfn1., .xfn1.
ife .xfn2., .fn2.
ifn .xfn2., .xfn2.
ife .xdir., .dir.
ifn .xdir., .xdir.
]
termin
define delink dr,n1,n2,xdv=DSK,xdr,xn1,xn2
.dir.==sixbit /dr/
.fn1.==sixbit /n1/
.fn2.==sixbit /n2/
ifsn [xdv]DSK, .err Ignoring device xdv
.xfn1.==sixbit /xn1/
.xfn2.==sixbit /xn2/
.xdir.==sixbit /xdr/
[ .fn1. ? .fn2. ? .dir. ? 1,,0 ? 0
ife .xfn1., .fn1.
ifn .xfn1., .xfn1.
ife .xfn2., .fn2.
ifn .xfn2., .xfn2.
ife .xdir., .dir.
ifn .xdir., .xdir.
]
termin
files:
; Get system up, and running DUMP under DDT
defile .,@,ddt
defile .,its,rm03,,minsys
defile .,its,rm80,,minsys
defile .,its,rp06,,minsys
defile .,its,rp07,,minsys
defile .,salv,rm03,,minsys
defile .,salv,rm80,,minsys
defile .,salv,rp06,,minsys
defile .,salv,rp07,,minsys
defile .,dskdmp,rm03,,minsys
defile .,dskdmp,rm80,,minsys
defile .,dskdmp,rp06,,minsys
defile .,dskdmp,rp07,,minsys
defile sys,atsign,ddt
delink sys,atsign,hactrn,,,atsign,ddt
defile sysbin,dump,bin,,minsys
delink sys,ts,dump,,sysbin,dump,bin
; Time setter
defile sys,ts,pdset
; FE filesystem
defile .,bt,rm03,,minsys
defile .,bt,rm80,,minsys
defile .,bt,rp06,,minsys
defile .,bt,rp07,,minsys
defile .,ram,ram,,minsys
defile sys,ts,ksfedr
; Backup copies of the really vital stuff
defile backup,@,ddt
defile backup,its,rm03,,minsys
defile backup,its,rm80,,minsys
defile backup,its,rp06,,minsys
defile backup,its,rp07,,minsys
defile backup,salv,rm03,,minsys
defile backup,salv,rm80,,minsys
defile backup,salv,rp06,,minsys
defile backup,salv,rp07,,minsys
defile backup,dskdmp,rm03,,minsys
defile backup,dskdmp,rm80,,minsys
defile backup,dskdmp,rp06,,minsys
defile backup,dskdmp,rp07,,minsys
defile backup,bt,rm03,,minsys
defile backup,bt,rm80,,minsys
defile backup,bt,rp06,,minsys
defile backup,bt,rp07,,minsys
defile backup,ram,ram,,minsys
; if atsign hactrn is busted, what can you do?
defile backup,atsign,ddt,,sys
defile backup,ts,dump,,minsys,dump,bin
defile backup,ts,pdset,,sys
defile backup,ts,ksfedr,,sys
; System demons
defile channa,atsign,taraka
delink sys,atsign,dragon,,channa,atsign,taraka
defile channa,rakash,dmpcpy
defile dragon,rakash,pfthmg
delink channa,rakash,pfthmg,,dragon,rakash,pfthmg
defile dragon,dragon,hoard,,minsys
defile channa,logout,times,,minsys
; Some well-known databases
defile sysbin,hosts3,>
defile inquir,lsr1,>
defile syseng,ttytyp,>
; Highly handy system programs
defile sys,ts,peek
delink sys,ts,p,,sys,ts,peek
defile sysbin,peek,bin
defile sys,ts,lock
defile sys,ts,name
delink sys,ts,f,,sys,ts,name
defile sysbin,name,bin
; Job Devices and Networks
defile sys,atsign,device
defile sys,atsign,chaos
defile sys,atsign,tcp
defile device,atsign,mldev
defile device,atsign,mlslv
delink device,chaos,mldev,,,atsign,mlslv
; Chaosnet file transfer
defile device,chaos,file
defile sys1,ts,cftp
; Telnet and supdup
defile sysbin,telser,bin
delink device,chaos,telnet,,sysbin,telser,bin
delink device,chaos,supdup,,sysbin,telser,bin
delink device,tcp,syn027,,sysbin,telser,bin
delink device,tcp,syn137,,sysbin,telser,bin
defile sysbin,supdup,bin
defile sysbin,chtn,bin
defile sysbin,telnet,bin
delink sys1,ts,supdup,,sysbin,supdup,bin
delink sys2,ts,chtn,,sysbin,chtn,bin
delink sys,ts,telnet,,sysbin,telnet,bin
; Internet file transfer
defile sysbin,ftpu,bin
defile sysbin,ftps,bin
delink sys2,ts,ftp,,sysbin,ftpu,bin
delink device,tcp,syn025,,sysbin,ftps,bin
lfiles==:.-files
cnstnts:
constants
variables
; Tape info
thblk: -lthblk,,0
thtpn: 1,,0 ; tape,,reel
thdate: 0 ; creation date in SIXBIT
thtype: 0 ; type: 0 => random
lthblk==:.-thblk
; File info
mhblk: -lmhblk,,0
mhdir: 0 ; dir
mhfn1: 0 ; fn1
mhfn2: 0 ; fn2
mhlnpk: 0 ; linkp,,pack
mhdate: 0 ; creation date in disk format
lmhblk==:.-mhblk
; Dump tapes written after 7/15/89 include the following two words, but we
; continue to write the old format so that old salvagers can read the tapes
; we write.
; MHRDAT: 0 ; Reference Date, Author Index, Byte Size, Byte Count
; MHLEN: 0 ; Length in words
; Link info
lnkfn1: 0 ; fn1
lnkfn2: 0 ; fn2
lnkdir: 0 ; dir
lmhlnk==:.-mhblk
patch::
pat: block 100.
epatch: -1 ; Make memory exist, end of patch area
ffaddr:
ffpage==:<ffaddr+1777>_-12
end go

58
src/syseng/tape.bits Executable file
View File

@@ -0,0 +1,58 @@
; -*- Midas -*-
; Tape open mode bits
%mt==:1,,770452 ; In LH of .OPEN arg
%mtout==:000001 ; Out, not In
%mtblk==:000002 ; Block, not Unit
%mtimg==:000004 ; Image, not ASCII
%mtchk==:000010 ; Chunk mode, unimplemented on KS
%mtnsk==:000020 ; Don't skip to EOF on last close on read
%mtpar==:000040 ; Even parity, not Odd
%mtbpi==:000100 ; 0 => default (non-KS: 800)
; 1 => 800 (non-KS: 200)
; 2 => 1600 (non-KS: 556)
; 3 => 6250 (non-KS: 800)
%mtibm==:000400 ; IBM mode on 9 track drives and > 800 BPI
%mtwpr==:001000 ; 0 => 2000 Words Per Record
; 1 => 1000
; 2 => 400
; 3 => 200
; 4 => 100
; 5 => 40
; 6 => 20
; 7 => 10
; Tape status bits
%ms==:0,,525277 ; In RH of .STATUS word
%mscod==:000001 ; 15
%msout==:000100 ; Out, not In
%msblk==:000200 ; Block, not Unit
%msimg==:000400 ; Image, not ASCII
%msemt==:001000 ; System buffers empty
%msful==:002000 ; System buffers full
%msbot==:004000 ; Beginning of tape
%mseot==:010000 ; End of tape
%ms9tk==:020000 ; 9 track, not 7 track
%msibm==:040000 ; IBM mode (KS only)
%msidl==:100000 ; Transport idle (KS only)
%mseof==:200000 ; EOF (last thing seen was a tape mark)
; (KS only?)
; Tape commands
; MOVE AC,[CHTAPE,,[<count>,,<comand>]]
; .MTAPE AC,
; If <count> is 0, it is taken to be 1 instead.
%mc==:0,,-1 ; In RH of some literal
%mchng==:0 ; Wait for operation to finish
%mcbot==:1 ; (R) Start rewind
%mcunl==:2 ; (R) Start unload
%mceor==:3 ; (W) Write EOR
%mc3in==:4 ; (W) Write 3 inches of blank tape
%mceof==:5 ; (W) Write EOF
%mcrsk==:6 ; (R) Skip over <count> records
%mcskp==:7 ; (R) Skip over <count> files
; %MCRSK & %MCSKP stop at EOT or BOT.
%mceot==:10 ; Position at EOT (between the two EOFs)
%mcrst==:11 ; Reset the tape system
%mcset==:12 ; (W) Set record size to <count> words
%mcget==:13 ; Get record size into AC