; ;----------------------------------------------------------------------------- ; ; Program: A C T T S K ; ; Purpose: To scan the system task directory for active tasks, not ; started from TI:. ; Those tasks will be printed to the device wanted. ; If no tasks present, this one will exit. ; ; Author: Han Lasance ; ; Date: June 1981 ; ; Version: V1.3 31-JUL-86 ; ; Description: Scans system task directory for tasks not started from own ; terminal until those tasks are not active any more. ; A number of system tasks, such as ...AT., resp. ...CA. and ; variants, LDR..., F11ACP, ...MCR, MTAACP, PMT..., ...RMD, ; QMG..., LP0, and TT4 are excluded, as well as some user tasks, ; i.e ACTTSK, ...EXB, RETTID, ...R32. ; ; Input files: None ; ; Output files: None ; ; Luns: 5 I/Error messages ; 4 messages ; ; Event flags: 1 ; ; Call: e.g.: AOT TT12:34 ; with ; TT = listdevice ; 12 = listdevice unit ; 34 = number of seconds between scans ; ; Calls to: ; ; PARAMETERS: NAME DESCRIPTION ; ; Assembling: MAC @ACTTSKASM ; ; ACTTSK,ACTTSK/-SP=[11,10]RSXMC,[7,241]ACTTSK ; ; Building: TKB @ACTTSKBLD ; ; ACTTSK/PR,ACTTSK/-SP=ACTTSK,[1,54]RSX11M.STB/SS ; / ; ACTFIL=1 ; STACK=100 ; TASK=...AOT ; // ; ; Assemble and build procedure is incorporated in ; ACTTSKCBC.CMD, which starts both above mentioned .CMD files. ; ; Modified by: Jan H. Belgraver 9-SEP-85 JB01 V1.1 ; 1. For RSX11M V4.1, i.e. rename loader task, and ; add QMG, LP0, and TT4. ; 2. Add user tasks RETTID, ...EXB, and ...R32 ; ; Jan H. Belgraver 17-SEP-85 JB02 V1.2 ; PMT... should also be excluded from test. ; ; Jan H. Belgraver 31-JUL-86 JB03 V1.3 ; Added F11ACP variants DBAACP and DMAACP to tasklist. ;----------------------------------------------------------------------------- ; .TITLE ACTTSK ; .IDENT /V1.1/ ; .GLOBL ACTTSK ; ; .MCALL QIO$S,WTSE$S,EXIT$S,MRKT$S,ALUN$S,DIR$,GMCR$,GTIM$S .MCALL GLUN$S ; ; GMCR: GMCR$ ; ; ACTTSK: DIR$ #GMCR ;Get command line MOV #GMCR+G.MCRB+6,R0 ;Point to first byte after device MOV -2(R0),R3 ;Save device specification CALL $CDTB ;Convert device unit number MOV R1,R4 ;and save it CALL $CDTB ;Convert number of seconds TST R1 ;If number of seconds <= 0.... BGT 1$ ;.... MOV #1,R1 ;Make it 1 1$: MOV R1,NSEC ;Save it ALUN$S #4,R3,R4 ;Assign LUN 4 to device wanted BCC ASSOK ;If no error, branch QIO$S #IO.WVB,#5,#1,,,,<#ASNERR,#ASNLEN,#40> WTSE$S #1 JMP EXIT ASSOK: GLUN$S #4,#LUNBUF ;If LUN 4 is assigned to... BIT #10,LUNBUF+4 ;... a file structured device.... BEQ LUNOK ;.... JMP IOER ;Exit with I/O error message LUNOK: MOV $TKTCB,R3 ;Get current TCB address MOV T.UCB(R3),R3 ;Point to UCB of pseudo device "TI:" MOV (R3),R4 ;1st word in UCB points to DCB, ;save into R4 MOVB U.UNIT(R3),R5 ;Get physical unit number, save into R5 ; CLR TSKCNT ;Active task count CLR ACTCNT ;Counter of active tasks ; not started from "TI:" ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SWSTK$ READY ;;Enter system state MOV $ACTHD,R3 ;;Get active task listhead MOV #ACT,R1 ;;Point to name-tabel (rad50) ; ; LOOP: CMP T.NAM(R3),AT+2 ;;Any indirect command file processor? BEQ NXTCB ;;If yes, take next TCB CMP T.NAM(R3),RMD+2 ;;Any RMD? BEQ NXTCB ;;If yes, take next TCB CMP T.NAM(R3),AOT+2 ;;Any AOT? BEQ NXTCB ;;If yes, take next TCB MOV #LIST,R2 ;;Point to tabel of tasks ;;we don't deal with MOV #LSTLEN,LSTCNT ;;Length of this tabel NXLST: CMP T.NAM(R3),(R2)+ ;;First word matches? BEQ NXTWRD ;;If eq yes TST (R2)+ ;;No, take next BR NXT ;; NXTWRD: CMP T.NAM+2(R3),(R2)+ ;;Second word of task name matches? BEQ NXTCB ;;If eq yes, so go to next TCB ; NXT: DEC LSTCNT ;;Try next name in list BGT NXLST ;;If eq.... ready ; ; MOV T.UCB(R3),R2 ;;Point to UCB CMP (R2),R4 ;;If DCB ne saved DCB.... BNE FOUND ;;.... "TI:" is different CMPB U.UNIT(R2),R5 ;;If same...., compare unit numbers BEQ NXTCB ;;If eq... task started from same "ti:" ;;and we go to next TCB ; ; FOUND: MOV T.NAM(R3),(R1)+ ;;Active task found not started from ;;same "ti:" MOV T.NAM+2(R3),(R1)+ ;;So SAVE NAME OF THIS ONE INC ACTCNT ;;and increment counter ; ; NXTCB: INC TSKCNT ;;Increment active task count CMP #MAXTSK,TSKCNT ;;If buffer full, exit BLE RDY ;; MOV T.ACTL(R3),R3 ;;If not, get next tcb address of ;;active task TST T.ACTL(R3) ;;Null task? BNE LOOP ;;If not, do it all over again RDY: RETURN ;;Return to user state ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; READY: MOV ACTCNT,R4 ;Get active task count (with ;different "ti:") BEQ NOFND ;If 0, branch MOV #ACT,R3 ;Get name list address GTIM$S #TIMBUF ;Get time in binary MOV #TIM,R0 MOV #TIMBUF+6,R1 MOV #3,R2 CALL $TIM ;Convert into ascii QIO$S #IO.WVB,#4,#1,,#IOST,,<#TIM0,#12.,#40> BCS IOER WTSE$S #1 TSTB IOST ;If I/O status < 0, exit with message BGT PRINT IOER: QIO$S #IO.WVB,#5,#1,,,,<#IOERR,#IOLEN,#40> WTSE$S #1 BR EXIT PRINT: MOV #NAME,R0 ;Get address of ascii name to be converted MOV (R3)+,R1 ;Get next 1st RAD50 task name word CALL $C5TA ;Convert to ascii MOV (R3)+,R1 ;Get next 2nd RAD50 task name word CALL $C5TA ;Convert it and print string QIO$S #IO.WVB,#4,#1,,#IOST,,<#MES,#LEN0,#40> WTSE$S #1 DEC R4 ;Ready? BGT PRINT ;If GT no ; ; MRKT$S #5,NSEC,#2 ;Wait .... WTSE$S #5 ;If time is up.... JMP ACTTSK ;...start scanning again ; ; NOFND: QIO$S #IO.WVB,#4,#1,,#IOST,,<#NOACT,#LEN1,#40> WTSE$S #1 ; ; EXIT: EXIT$S ;No comment ; ; ; IOERR: .BYTE 12 .ASCII %*** I/O error on LUN 4% .BYTE 12 IOLEN=.-IOERR .EVEN ASNERR: .BYTE 12 .ASCII /*** Assignment error/ .BYTE 12 ASNLEN=.-ASNERR .EVEN NSEC: .WORD 0 ACT: .BLKW 40. MAXTSK=<.-ACT>/4 IOST: .BLKW 2 MES: .BYTE 11 .ASCII /---- Task / NAME: .BLKB 6 .ASCII / still running/ LEN0=.-MES .EVEN NOACT: .BYTE 12 .ASCII /*** No active tasks/ .BYTE 12 LEN1=.-NOACT .EVEN ; ; LIST: .RAD50 /LDR.../ .RAD50 /MCR.../ .RAD50 /F11ACP/ ; Disk ACP .RAD50 /DBAACP/ ; F11ACP variant for DB: ; JB03 .RAD50 /DMAACP/ ; F11ACP variant for DM: ; JB03 .RAD50 /MTAACP/ ; Magtape ACP .RAD50 /PMT.../ ; Pool Monitor task ; JB02 .RAD50 /QMG.../ ; Queue Manager ; JB01 .RAD50 /LP0 / ; Lineprinter spooler task ; JB01 .RAD50 /TT4 / ; LA120 despooler task ; JB01 .RAD50 /RETTID/ ; Application ID task ; JB01 .RAD50 /...EXB/ ; Batch-driver reset task ; JB01 .RAD50 /...R32/ ; 32-RS Main-Menu task ; JB01 RMD: .RAD50 /...RMD/ .RAD50 /.IDLE./ AT: .RAD50 /...AT./ AOT: .RAD50 /...AOT/ LSTLEN=<.-LIST>/4 LSTCNT: .WORD 0 TSKCNT: .WORD 0 ACTCNT: .WORD 0 TIMBUF: .BLKW 8. LUNBUF: .BLKW 6 TIM0: .BYTE 15,12 TIM: .BLKB 10. ; ; .END ACTTSK