;----------------------------------------------------------------------------- ; ; Driver: BADRV ; ; Purpose: Sets Batch terminal status in internal buffer ; ; Author: Han Lasance, Digital Equipment B.V. ; ; Date: V1.0 Nov-81 ; ; Version: V2.0 Nov-89 ; ; Language: MACRO-11 ; ; Building: TKB @BADRVBLD.CMD ; ; Description: BADRV is a private driver used in conjuction with ; the tasks INIBAT resp. EXB, a subroutine BATCH, and ; the Indirect Commandfile Processor. ; For each terminal on this system (8 ports) BADRV stores ; one of three possible conditions: ; ; 0 = No batch (default) ; -1 = Batch, fill answerfile ; 1 = Batch, read answerfile ; ; in it's internal table BUSYTB: ; ; word 2 word 1 ; +----------+----------+ ; | LUN 1 | status 1 | ; +----------+----------+ ; | LUN 2 | status 1 | ; +----------+----------+ ; | . | . | ; | . | . | ; +----------+----------+ ; | LUN 8 | status 8 | ; +----------+----------+ ; ; where LUN values are in octal. ; ; Following a Read Logical Block QIO BADRV returns the terminal ; number in word two of a four-byte output buffer and the status ; in word one. ; If the task is not started from within a command procedure, ; the status is always zero. ; ; The batch driver uses two maintenance tasks - INIBAT and EXB - ; to set and clear the status flags. This can only be done from ; from within a command procedure. INIBAT asks the user for the ; required mode and sets the corresponding flag using a ; IO.CON function code; the flag is set to Create (or Fill) Mode ; if the functioncode modifier is zero, and set to Use (or Read) ; Mode if set to 1. EXB clears the flag with a IO.DIS as soon as ; IND completes a Create or Use mode session on that particular ; terminal. EXB is started by INIBAT. ; ; Modified by: Name Date Ident. Version ; Jan H. Belgraver 31-Mar-89 JB01 V1.1 ; This doc-header. ;----------------------------------------------------------------------------- .TITLE BADRV .IDENT /2.0/ ; .MCALL DCBDF$, PKTDF$, UCBDF$, TCBDF$ DCBDF$ ; Define DCB offsets PKTDF$ ; Define I/O packet offsets TCBDF$ ; Define TCB offsets UCBDF$ ; Define UCB offsets ; $BATBL:: DDT$ BA,,NONE,,,NEW ; Generate Driver Dispatch Table ; without interrupt entry point. ; BUSYTB: .BLKW 9. ; Batch indicator for each terminal ;-1 = Fill batch file ; 0 = No Batch ; 1 = Read Batch file ; BAINI: CALL $GTPKT ; Get I/O packet BCS BAPWF ; No packet or controller busy MOV I.TCB(R1),R2 ; Get TCB address via I/O packet addr. MOV T.UCB(R2),R2 ; Get UCB of TI: MOV U.DCB(R2),R3 ; Get DCB address MOVB U.UNIT(R2),R2 ; Get unit number of this controller MOVB D.UNIT(R3),R3 ; Get low unit number of controller ADD R3,R2 ; Add low unit number of controller ASL R2 ; Calc. word offset in BUSYTB ; CMPB I.FCN+1(R1),#IO.CON/256. ; Was it an IO.CON?? BNE 10$ ; If NE, no TST BUSYTB(R2) ; If NE 0.... BNE IEDNR ; BATCH already running for this TT: MOV #1,BUSYTB(R2) ; Assume BATCH file read mode TSTB I.FCN(R1) ; Was functioncode modifier present? BNE IOSUC0 ; If NE, Yes MOV #177777,BUSYTB(R2) ; If EQ, No set to BATCH file fill mode BR IOSUC0 ; and return success 10$: CMPB I.FCN+1(R1),#IO.DIS/256. ; Was it an IO.DIS?? BNE 20$ ; If NE No CLR BUSYTB(R2) ; Set to Not Busy BR IOSUC0 ; and return success 20$: MOV BUSYTB(R2),-(SP) ; It was an IO.RLB CALL $PTWRD ; Return status to user ASR R2 ; Re-establish Unit Number MOV R2,-(SP) ; Unit number (0-10) CALL $PTWRD ; Return it to user MOV #4,R1 ; Byte count, to be returned in BR IOSUC ; 2nd I/O status word. IOSUC0: CLR R1 ; Byte count IOSUC: MOV #IS.SUC&377,R0 ; Set success code in 1st I/O St.Wrd BR IODON IEDNR: MOV #IE.DNR&377,R0 ; Set Device Not Ready code CLR R1 IODON: CALL $IODON ; Finish I/O BR BAINI ; Try another one ; BACAN: BAOUT: BAPWF: BAKRB: BAUCB: RETURN .END