.TITLE AUXINI DPACP auxiliary task init routine .PSECT AUXINI .IDENT /M002/ ;+ ; ; AUXINI ; Initialization routine for DPACP auxiliary task ; ; PURPOSE ; Initializes this task as a network task; ; gets information from the network concerning why this ; task was requested; if request is valid, accepts the ; connection request; if the request is not valid, rejects any ; connection request, and exits. ; Prints a mount message on the master console. ; ; INPUTS From network ; ; OUTPUTS ; Network connection opened ; Mount message printed to console ; R0-R5 destroyed ; ; EXTERNAL REFERENCES ; ERRMSG, BADMSG Error message output routines ; ; AUTHOR ; Daniel S. McCoy Informatics Inc. Palo Alto, Ca. ; ; REVISIONS LAST CHANGE ; DATE PERSON STATEMENT OF CHANGES ; 5 mar 80 DSM Added multi device support ; 25 sep 78 DSM Version two ; 12/18/78 DSM First coding ; ; NOTES ; Requires DECNET-11M version 2 ;- ; .MCALL DIR$,OPNW$E,GNDW$E,ACCW$E,REJW$E,CLSW$E,EXIT$S ; AUXINI:: OPNW$E OPN ; Let the network know we're here BCS OBAD ; Test for directive error CMPB #IS.SUC,NTSTAT ; Test status BLT OERR ; Error opening net ; GNDW$E GND ; Get info about who called us BCS GBAD ; Test for directive error CMPB #IS.SUC,NTSTAT ; Test status BLT GERR ; Error opening network ; ; CALL DVINI ; Initialize the devices ; ; Ok, accept the connection ACCW$E ACC ; Accept connection BCS ABAD ; Test for directive error CMPB #IS.SUC,NTSTAT ; Test status BLT AERR ; Open error ; RETURN ; Successful, so return .PAGE ; ; Network error handling ; ; On bad directive, point to proper message ; and jump to bad directive routine OBAD: MOV #BADO,R0 JMP BADMSG GBAD: MOV #BADG,R0 JMP BADMSG ABAD: MOV #BADA,R0 JMP BADMSG ; ; On I/O error, point to proper message, ; call error message routine and reject the connection OERR: MOV #BADO,R0 ; Open network problem BR ERR GERR: MOV #BADG,R0 ; Get network data problem BR ERR AERR: MOV #BADA,R0 ; Accept problem ERR: CALL ERRMSG REJT: ; Initialization problem REJW$E REJ ; Reject connection ; And just quit CLSW$E CLS ; Close network EXIT$S .PAGE .MCALL ALUN$S ; ; Local routine to initialize the devices DVINI: ; ; Put node name into messages MOV #NBUF+N.SND,R0 ; Point to node name of slave MOV #MOUNOD,R1 ; Place to put it in mount message MOV #NMONOD,R2 ; "" not mounted message MOV #DMONOD,R3 ; "" dismount message MOV #6,R4 ; Six characters in the node name 10$: MOVB (R0),(R1)+ ; Move the characters MOVB (R0),(R2)+ MOVB (R0)+,(R3)+ SOB R4,10$ ; ; Hope the next section doesn't take too long. ; If it does, the connection request may time out. ; If this happens, may have to move the accept to here. ; Would rather not, so that the index files are accessed before ; the slave ACP gets to work. ; ; Initialize logical unit table MOV #LUNLST,R0 ; Point to list of luns MOV #NACLNS,R1 ; Number of luns in list 20$: CLR (R0)+ ; Show lun as available SOB R1,20$ ; Loop through all luns ; CLR FFLUN ; Point first free lun to beginning ; ; Assign devices and access the index file of each device MOV #DEVLST,R3 ; Point to list of devices MOV FFLUN,R4 ; Get a free lun entry MOV R4,R5 ; Copy it and ... ASR R5 ; ... Change it to lun ADD #ACLUN1,R5 ; Add base lun 30$: ALUN$S R5,(R3),2(R3) ; Assign the lun to this device BCS 40$ ; Check for assign problem MOV R5,QACC+Q.IOLU ; Point access QIO lun DIR$ #QACC ; Access the index file BCS 80$ ; Check error TSTB NTSTAT ; Check error BPL 50$ ; " " 40$: ; This device didn't initialize properly MOV #BADI,R0 ; Device initialization problem CALL ERRMSG ; Print message ; MOV #NMODV,R0 ; Convert device unit number MOVB (R3),(R0)+ ; Move device name to message MOVB 1(R3),(R0)+ MOV 2(R3),R1 ; Get binary unit number CLR R2 ; suppress zeros CALL $CBOMG ; Convert to ascii MOV #NMOMSG,TIBUF ; Do the message MOV #NMOLEN,TILEN DIR$ #TIQIO ; MOV #-1,(R3) ; Invalidate this device MOV #-1,2(R3) ; so we won't use it BR 60$ ; Skip to next device 50$: ; Device is OK MOV #1,LUNLST(R4) ; Mark lun in use, and go to next ADD #2,R4 ; INC R5 ; Bump lun MOV R4,FFLUN ; Bump first free lun entry ; ; Print out the mount message MOV #MOUDV,R0 ; Convert device unit number MOVB (R3),(R0)+ ; Move device name to message MOVB 1(R3),(R0)+ MOV 2(R3),R1 CLR R2 CALL $CBOMG MOV #MOUMSG,TIBUF ; Point the TI DPB to the message MOV #MOULEN,TILEN ; Set the length DIR$ #TIQIO ; Write it out 60$: ADD #4,R3 ; Bump to next device (2 wds/entry) CMP R3,#DEVEND ; End of devices? BLO 30$ ; Loop for next device if not RETURN ; ; Fatal directive errors 80$: MOV #BADI,R0 90$: JMP BADMSG ; .END