mirror of
https://github.com/PDP-10/its.git
synced 2026-01-24 03:18:05 +00:00
the host table compiler (SYSHST; HOSTS3 BIN) and the host table job submission tool (SYSHST; H3MAKE BIN). No daemons or user networking programs are included in this commit. The binary host table, however, is built from the host table source (SYSHST; H3TEXT >) and installed into SYSBIN; HOSTS3 >.
277 lines
7.3 KiB
Plaintext
277 lines
7.3 KiB
Plaintext
; -*- MIDAS -*-
|
||
|
||
title H3MAKE -- Run HOSTS3 under DRAGON to make SYSBIN;HOSTS3 >
|
||
|
||
p==17 ? call==:<pushj p,> ? ret==:<popj p,>
|
||
|
||
.insrt DSK:SYSENG;T20MAC >
|
||
.insrt DSK:SRA;USEFMT >
|
||
|
||
debug: 0
|
||
|
||
tgtdev: sixbit 'DSK'
|
||
tgtfn1: sixbit 'HOSTS3'
|
||
tgtfn2: sixbit '>' ; must be ">"
|
||
tgtdir: sixbit 'SYSBIN'
|
||
|
||
srcdev: sixbit 'DSK'
|
||
srcfn1: sixbit 'H3TEXT'
|
||
srcfn2: sixbit '>' ; must be ">"
|
||
srcdir: sixbit 'SYSHST'
|
||
|
||
pgmdev: sixbit 'DSK'
|
||
pgmfn1: sixbit 'HOSTS3'
|
||
pgmfn2: sixbit 'BIN'
|
||
pgmdir: sixbit 'SYSHST'
|
||
pgmjnm=:pgmfn1
|
||
|
||
tyodev: sixbit 'DSK' ; These four must stay in order
|
||
tyofn1: sixbit 'H3TYO'
|
||
tyofn2: 0 ; Clobbered
|
||
tyodir: sixbit 'SYSHST'
|
||
|
||
tyoerr: sixbit 'H3ERR'
|
||
|
||
usri==:0
|
||
usro==:1
|
||
dski==:2
|
||
dsko==:3
|
||
|
||
define syscall name,args
|
||
.call [setz ? sixbit /name/ ? args((setz))]
|
||
termin
|
||
|
||
.scalar trudev, trudir, trufn1, trufn2
|
||
.vector jcl(jcllen==40), pdl(lpdl==200)
|
||
|
||
ifndef ubpfj,ubpfj==:10 ; why doesn't this have a name???
|
||
|
||
|
||
begin: move p,[-lpdl,,pdl-1]
|
||
.suset [.roption,,]
|
||
tlo %opint\%opopc
|
||
.suset [.soption,,]
|
||
skipe debug
|
||
ifskp.
|
||
tlne %opddt ; running under DDT?
|
||
.value [asciz ""] ; yeah, disown self
|
||
endif.
|
||
|
||
go: ;; Figure out if there's anything for us to do
|
||
syscal open,[[.uai\%donrf,,dski] ? srcdev ? srcfn1 ? srcfn2 ? srcdir]
|
||
.logout 1, ; No source, punt
|
||
syscal rfname,[movei dski ? movem trudev
|
||
movem trufn1 ? movem trufn2 ? movem trudir]
|
||
.lose %lssys
|
||
move 1,trufn2
|
||
movem 1,tyofn2
|
||
syscal open,[[.uai\%donrf,,dski] ? tgtdev ? tgtfn1 ? tgtfn2 ? tgtdir]
|
||
.lose %lsfil
|
||
syscal rfname,[movei dski ? repeat 3,[ ? movem 1]]
|
||
.lose %lssys
|
||
call sixnum ; Convert target fn2
|
||
move 2,1
|
||
move 1,trufn2 ; Convert source fn2
|
||
call sixnum
|
||
camge 2,1 ; Check them
|
||
ifskp.
|
||
skipe debug
|
||
.value [asciz ": Target newer than sources, done. CONTINUE"]
|
||
.logout 1,
|
||
endif.
|
||
|
||
;; Check for existing instance of compiler.
|
||
syscal open,[[ubpfj+.uii,,usri] ? ['usr,,0] ? movei 0 ? pgmjnm]
|
||
ifskp. ; Hmm, it exists
|
||
.uset usri,[.rustp,,1] ; Is it running?
|
||
tlne 1,100000 ; 4.7 (BUSRC) is the only bit that counts
|
||
ifskp. ; Yeah, leave it alone
|
||
skipe debug
|
||
.value [asciz ": Previous instance of inferior running. "]
|
||
.logout 1, ; Nothing left to do
|
||
endif. ; We have a dead one on our hands
|
||
skipe debug
|
||
.value [asciz ": Dead previous instance of inferior!! "]
|
||
call kvetch ; Go complain and die
|
||
format -dsko,"There is already a dead job named ~S ~S.~@
|
||
Perhaps someone should examine the corpse.~
|
||
",[myunam,pgmjnm]
|
||
ret
|
||
endif. ; No previous instance if get here
|
||
|
||
;; Check for previous attempt at compilation.
|
||
syscal open,[[.uai\%donrf,,dski] ? tyodev ? tyofn1 ? tyofn2 ? tyodir]
|
||
ifskp.
|
||
skipe debug
|
||
.value [asciz ": Previous attempt at compilation failed? "]
|
||
call kvetch ; Go complain and die
|
||
format -dsko,"It looks like a previous attempt failed.~@
|
||
The file ~S:~S;~S ~S might explain the problem.~
|
||
",[tyodev,tyodir,tyofn1,tyofn2]
|
||
ret
|
||
endif.
|
||
|
||
;; Set up program.
|
||
syscal open,[[.uio,,usro] ? ['usr,,0] ? movei 0 ? pgmjnm]
|
||
.lose
|
||
syscal open,[[.uii,,usri] ? ['usr,,0] ? movei 0 ? pgmjnm]
|
||
.lose
|
||
syscal open,[[.uii,,dski] ? pgmdev ? pgmfn1 ? pgmfn2 ? pgmdir]
|
||
.lose ; get program file
|
||
syscal load,[movei usro ? movei dski]
|
||
.lose ; load program file
|
||
.iot dski,3 ; get start address
|
||
tlz 3,-1 ; clear random bits
|
||
.close dski, ; done with disk channel
|
||
.uset usri,[.supc,,3] ; set starting address
|
||
.uset usri,[.soption,,[%opcmd,,]] ; say we have jcl
|
||
.uset usri,[.rintb,,4] ; get job's interrupt bit
|
||
.suset [.simsk2,,4] ; enable it for ourself
|
||
syscall delete,[tyodev ? tyofn1 ? [sixbit '<'] ? tyodir]
|
||
jfcl
|
||
syscal tranad,[[2,,usri] ? [-1,,[sixbit 'tty']] ? [-4,,tyodev]]
|
||
.lose ; translate TTY to output filename
|
||
move 1,[440700,,jcl] ; generate appropriate JCL
|
||
format 1,|~
|
||
GWHOSTS
|
||
ALLSERVER
|
||
OUTFMT HOSTS3
|
||
OUTFIL ~S: ~S; ~S ~S
|
||
RFC810
|
||
INSERT ~S: ~S; ~S ~S~
|
||
~% |