mirror of
https://github.com/PDP-10/its.git
synced 2026-02-27 01:09:49 +00:00
GUNNER - gun down jobs.
This commit is contained in:
@@ -672,6 +672,10 @@ expect ":KILL"
|
||||
respond "*" ":link device;jobdev hs,device;jobdev hsname\r"
|
||||
respond "*" ":link device;jobdev hf,device;jobdev hsname\r"
|
||||
|
||||
# gunner
|
||||
respond "*" ":midas device; jobdev shoe_rwk; gunner\r"
|
||||
expect ":KILL"
|
||||
|
||||
# pr
|
||||
respond "*" ":midas sys1;ts pr_sysen1;pr\r"
|
||||
expect ":KILL"
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
- GO, the Go board game.
|
||||
- GOTO, go to specified terminal line.
|
||||
- GUESS, a very silly game.
|
||||
- GUNNER, gun down jobs.
|
||||
- GMSGS, copy system messages to mail file.
|
||||
- H3MAKE, a job that requests DRAGON to build host table.
|
||||
- HEXIFY, convert COM file into Intel HEX format.
|
||||
|
||||
200
src/rwk/gunner.31
Normal file
200
src/rwk/gunner.31
Normal file
@@ -0,0 +1,200 @@
|
||||
Title GUN: JOBDEV
|
||||
|
||||
x=0
|
||||
a=1
|
||||
b=2
|
||||
c=3
|
||||
t=10
|
||||
tt=11
|
||||
sp=17
|
||||
|
||||
call=pushj sp,
|
||||
ret=popj sp,
|
||||
|
||||
bojc=7 ;jobdev pipeline channel
|
||||
fooc=15 ;temporary USR device channel
|
||||
usrc=16 ;USR device channel
|
||||
|
||||
pdllen==50
|
||||
|
||||
define syscal oper,args
|
||||
.call [setz ? sixbit /OPER/ ? args ((SETZ))]
|
||||
termin
|
||||
|
||||
argi==:1000,,0
|
||||
val==:2000,,0
|
||||
cnt==:4000,,0
|
||||
cnti==:5000,,0
|
||||
|
||||
loc 40
|
||||
0
|
||||
jsr lost
|
||||
-intlen,,tsint
|
||||
|
||||
loc 100
|
||||
tsint: sp
|
||||
%piioc ? 0 ? -1 ? -1 ? iocerr
|
||||
intlen==.-tsint
|
||||
|
||||
pdl: block pdllen
|
||||
|
||||
go: .close 1, ;started by system
|
||||
.suset [.smask,,[%piioc]]
|
||||
.suset [.soption,,[%opojb\%opopc\%opint,,0]]
|
||||
move sp,[-pdllen,,pdl]
|
||||
syscal open,[cnti .uao\10 ;Don't reuse, expect him to open in OUTPUT
|
||||
argi bojc
|
||||
[sixbit /BOJ/]]
|
||||
lose ; Fie, we lost!
|
||||
move x,[-4,,namblk]
|
||||
syscal jobcal,[argi bojc ;find out why we were called!
|
||||
x ? [sixbit /GUNNER/]]
|
||||
lose
|
||||
movsi t,-loseln
|
||||
.suset [.rxuname,,x] ;Check who we are
|
||||
loschk: camn x,losers(t)
|
||||
jrst ulost
|
||||
aobjn t,loschk
|
||||
jrst winlos
|
||||
|
||||
ulost: movem x,fn1
|
||||
move x,passw
|
||||
movem x,sname
|
||||
movsi x,(sixbit /</)
|
||||
movem x,fn2
|
||||
move x,[sixbit /SELF/] ;remember what kind
|
||||
movem x,type
|
||||
|
||||
winlos: move x,sname
|
||||
.suset [.runame,,uname] ;check for login
|
||||
hlrz t,uname ;left half
|
||||
cain t,-1 ;logged in?
|
||||
setz x, ; nope, pretend bad password
|
||||
camn x,passd
|
||||
jrst pdet
|
||||
came x,passw ;win
|
||||
camn x,passl ; or lose
|
||||
caia
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%ENSDV,,0]] ;claim it doesn't exist
|
||||
lose
|
||||
jrst done]
|
||||
pdet: move t,fn1 ;check for .FILE. (DIR)
|
||||
move tt,fn2
|
||||
camn t,[sixbit /.FILE./]
|
||||
came tt,[sixbit /(DIR)/]
|
||||
caia
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%ENSDV,,0]] ;claim it doesn't exist
|
||||
lose
|
||||
jrst done]
|
||||
move x,fn2 ;check for special FN2's
|
||||
came x,[sixbit />/] ;> ?
|
||||
camn x,[sixbit /</] ; or <?
|
||||
move x,[sixbit /HACTRN/] ;use HACTRN for fn2
|
||||
|
||||
syscal open,[cnti .uii\10 ;open job as foreign
|
||||
argi usrc
|
||||
[sixbit /USR/]
|
||||
fn1
|
||||
x]
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%ensfl,,0]] ;File not found
|
||||
lose
|
||||
jrst done]
|
||||
move x,fn2 ;check the FN2 for <
|
||||
camn x,[sixbit /</] ;is it?
|
||||
call telopn ; yes, open his telser
|
||||
syscal usrvar,[argi usrc ;find out if top level
|
||||
[sixbit /suppro/]
|
||||
val x]
|
||||
lose
|
||||
came x,[-1] ;is it top level?
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%ETOP,,0]] ;Not top level
|
||||
lose
|
||||
jrst done]
|
||||
move x,sname ;check the sname
|
||||
setz t, ;default to a message
|
||||
camn x,passl ;is it LOSS?
|
||||
movei t,30 ; yes, do it silently
|
||||
syscal detach,[cnt t ;silently?, and have system kill if we die
|
||||
argi usrc]
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%erojb,,0]] ;Can't modify job
|
||||
lose
|
||||
jrst done]
|
||||
syscal mlink,[[sixbit \DSK\]
|
||||
[sixbit \LASER\]
|
||||
type
|
||||
[sixbit \CRASH\]
|
||||
fn1
|
||||
fn2
|
||||
uname]
|
||||
jfcl
|
||||
move x,sname
|
||||
camn x,passd ;Are we just detaching?
|
||||
jrst doneit ; yes, we're all done
|
||||
syscal reown,[argi usrc] ;make it ours
|
||||
jrst [syscal jobret,[argi bojc ;return the failure
|
||||
[%ENAJB,,0]] ;Job gone or going away
|
||||
lose
|
||||
jrst done]
|
||||
.uclose usrc, ;kill it off
|
||||
doneit: syscal jobret,[argi bojc ;Pretend error so don't need to do I/O
|
||||
[%ENAPP,,0]] ; Sounds right, even if inappropriate
|
||||
; (Other end of pipeline gone or going away)
|
||||
lose
|
||||
jrst done
|
||||
|
||||
iocerr: lose
|
||||
|
||||
telopn: syscal usrvar,[argi usrc ;find out the TTY #
|
||||
[sixbit /CNSL/]
|
||||
val t]
|
||||
ret ; No TTY, do it direct
|
||||
idivi t,10 ;seperate the digits
|
||||
addi t,'0 ;convert to sixbit
|
||||
addi tt,'0 ;both of them
|
||||
move x,[sixbit / TLNT/] ;basic name
|
||||
dpb t,[360600,,x] ;deposit first digit in nnTLNT name
|
||||
dpb tt,[300600,,x] ;deposit second digit
|
||||
syscal open,[cnti .uii\10 ;open the TELSER as a foreign job
|
||||
argi fooc ; open it on a temporary channel
|
||||
[sixbit /USR/]
|
||||
x
|
||||
[sixbit /TELSER/]]
|
||||
ret
|
||||
.iopush fooc, ;substitute
|
||||
.iopop usrc, ;for the tree
|
||||
ret
|
||||
|
||||
lost: 0 ;We lost!
|
||||
lose=jsr lost
|
||||
done: skipe debug ;don't go away if we're debugging
|
||||
.break 16,100000 ; stop for a bit
|
||||
.logout ;log out if in use
|
||||
.lose ;otherwise note we lost
|
||||
namblk: 0 ;Device
|
||||
fn1: 0 ;FN1/UNAME
|
||||
fn2: 0 ;FN2/JNAME
|
||||
sname: 0 ;SNAME/pass
|
||||
uname: 0
|
||||
type: sixbit /LOSER/ ;LOSER or SELF
|
||||
|
||||
debug: 0
|
||||
|
||||
passl: sixbit /LOSS/
|
||||
passw: sixbit /WIN/
|
||||
passd: sixbit /DETACH/
|
||||
|
||||
loseln==30
|
||||
loscnt==loseln
|
||||
losers:
|
||||
IRP a,,[DWS,DHD]
|
||||
sixbit /a/
|
||||
loscnt==loscnt-1
|
||||
TERMIN
|
||||
block loscnt
|
||||
end go
|
||||
|
||||
Reference in New Issue
Block a user