.MCALL .MODULE .MODULE RESSUB,VERSION=1,COMMENT=,IDENT=NO ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ; Edit History: ; 001 George Stevens Overlaid version of RESORC. Created from RESORC ; Version 97 .NLIST .INCLUDE /SRC:RESPFX.MAC/ .LIST .SBTTL LDSHOW - List LD: Info ;+ ; This routine displays information about the LD handler ; status. ;- ORIGIN RESSUB .ENABL LSB LDSHOW:: CALL INIPTR ; Get address & size of device tables CLR DIRTY ; no problems found (yet) .PRINT #CRLF ; start down a line .DSTAT #DSAREA+1,#R50LD ; find the LD handler ; real devices/not logical names BCS 10$ ; not installed CMPB #LDDVCD,DSAREA+0 ; is it the LD device? BNE 10$ ; then LD is a logical name MOV HILMIT,R0 ; Address for translation table if ; handler is loaded. TST DSAREA+4 ; is it loaded? BNE 20$ ; yes BIS #1,HILMIT ; Make it odd for physical fetch .FETCH HILMIT,#R50LD ; else load it BIC #1,HILMIT ; Clear it (doesn't change c bit) BCC 20$ ; can't load 10$: FORMAT #BUFFER, .PRINT #BUFFER ; print final message CALLR 150$ ; and exit 20$: MOV R0,R1 ; address for LD translation table MOV R50LD,WORK ; Move in the rad50 name CLRB PHYSLP ; Move in the channel number (0) .LOOKUP #PHYSLP,CODE=NOSET ; physical lookup LD: on chan 0 BCS 10$ ; can't lookup .SPFUN #AREA,#0,#UPD$FN,R1,#LDBFSZ ;get data from handler (spfun 372) BCS 10$ ; .SpFun failed .PURGE #0 ; and finished with channel MOV R1,LDBUFE ; Setup LD buffer end address ADD #LDBFSZ*2,LDBUFE ; first word past end of table CMP R50LD,(R1)+ ; is it really LD's table? BNE 10$ ; no MOV R50LD,R0 ; R0 = device name (LD) CALL INI64U ; Get dev index and init 64-unit info ;+ ; The translation table +2 pointed to by R1 is formatted as follows: ; ; +-----------------+ ; | LD.ID | <-- .RAD50 /LD / ; +--------+--------+ ; | LD.NUM | <-- Number of entries in the table ; +--------+--------+ ; |RESERVED| ; +-----------------+ 15 8|7 0 ; LD.ID + 4 . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | LD.FLG | <-- | | | | | | | | | | | | | | | | | ; . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; . (LD.NUM WORDS) . ^ ^ \ / ^ ^ \ / ; . . | | --------- | | --------- ; +-----------------+ | | ^ LD.UNT | | ^ LD.NDX ; LD.FLG + . . | +--- LD.RDO | +--- LD.UNX ; (LD.NUM * 2) | LD.OFS | +----- LD.ACT +----- LD.UOF ; . . ; . (LD.NUM WORDS) . <-- Offset in blocks from the beginning of ; . . the assigned physical disk to the area ; +-----------------+ on that physical disk assigned to that ; LD.FLG + . . LD unit number ; (LD.NUM * 4) | LD.SIZ | ; . . <-- Size in blocks of the area on the ; . (LD.NUM WORDS) . physical disk assigned to that logical ; . . disk unit. ; +-----------------+ ; LD.FLG + . . ; (LD.NUM * 6) | LD.NAM | <-- Radix-50 filespec. First word contains ; . . the physical device name without any ; . (LD.NUM*4 WORDS). unit number (The unit number is in ; . . LD.UNT). The second, third, and ; +-----------------+ fourth contain the Radix-50 file name ; and file type assigned as the logical ; disk. ;- CLR R4 ; Get LD.NUM BISB (R1)+,R4 ; without sign extend TSTB (R1)+ ; Skip reserved byte ;+ ; R1 is now pointing to LD.FLG ;- MOV R4,R2 ; Calculate displacement to LD.NAM ASL R2 ; - LD.NUM * 2 MOV R2,LDTBSB ; - Save LD table size in bytes ADD R4,R2 ; - LD.NUM * 3 ASL R2 ; - LD.NUM * 6 ;+ ; R2 is now displacement from LD.FLG to LD.NAM ;- ADD R1,R2 ; Point to LD.NAM ;+ ; Display LD translation table loop ; ; R1 -> LD.FLG translation table entry ; R2 -> LD.NAM translation table entry ; R3 = scratch ; R4 = number of entries in LD translation table ; R5 -> RMON ;- CLR UNIT ; Start at unit 0 30$: TST @R1 ; is it active? BPL 100$ ; no .DSTAT #DSAREA+1,R2 ; is the device available? ; real devices/not logical names BCS 40$ ; no TST DSAREA+4 ; is it loaded? BEQ 40$ ; no .Assume LD.ACT EQ 100000 BIC #LD.ACT,@R1 ; indicate device handler loaded 40$: MOV SP,LDFLAG ; indicate a unit mounted CALL GENPHY ; Setup 1-char and 2-char dev names FORMAT #BUFFER,<[R] is >,<#PHYNAM,#1> ; print unit name MOV R1,-(SP) ; Save pointer to LD.FLG table MOV R0,-(SP) ; Save output text buffer pointer MOV R2,-(SP) ; Save pointer to LD.NAM table MOVB 1(R1),R1 ; get unit number BIC #^C77,R1 ; clear junk MOV @R2,R0 ; Get device spec (without unit #) CALL $DEVTR ; Make device spec with unit # MOV (SP)+,R2 ; Restore pointer to LD.NAM table MOV R0,@R2 ; Save device spec with unit # ;NOTE: NEVER, NEVER .SPFUN THE LD TRANSLATION TABLE BACK, we just corrupted it MOV (SP)+,R1 ; point to output text buffer MOV R2,R0 ; point to name CALL $FNASC ; convert to ascii MOV R1,R0 ; put buffer pointer back MOV (SP)+,R1 ; and restore register BIT #LD.UOF,@R1 ; is it available? BNE 50$ ; Branch if not MOV R1,R3 ; Calculate address of entry in LD.SIZ ADD LDTBSB,R3 ; - Add LD.NUM * 2 ADD LDTBSB,R3 ; - Add LD.NUM * 2 FORMAT ,<[A133][U].[A135] >,<(R3)> ; print size of "disk 50$: BIT #LD.RDO,@R1 ; is it read only? BEQ 60$ ; no FORMAT , ; indicate read only .Assume LD.ACT EQ 100000 60$: BIT #LD.ACT,@R1 ; is the handler available? BEQ 70$ ; yes FORMAT ,<# > ; indicate no handler loaded MOV SP,NOLOAD ; and ask for foot note BR 80$ ; and away 70$: BIT #LD.UOF,@R1 ; is it "dirty" BEQ 80$ ; no MOV SP,DIRTY ; indicate footnote needed FORMAT ,<* > ; append "*" 80$: MOV R1,-(SP) MOV R2,-(SP) FORMAT ,< = > ;Ready for list of logical names TST UNIT ;Is this the first unit BNE 90$ ;Branch if not MOV @PNM2PT,R1 ;If so, we need to search for CALL GETNAM ; assignments without unit numbers 90$: MOV PHYNM1,R1 ;R1 = $UNAM1 compatible physical name CALL GETNAM ;Find LD(unit) logical assignments ;and put them in the buffer CLRB -2(R0) ;Drop trailing "," or "=" MOV (SP)+,R2 MOV (SP)+,R1 .PRINT #BUFFER ; print it 100$: INC UNIT ;Go to next unit TST (R1)+ ;Point to next handler word ADD #8.,R2 ; and to next dblock DEC R4 ;Decrement unit count BEQ 120$ ;Exit if done with all units ;+ ; Exit loop after displaying first 8 units if monitor only supports 8 units. ;- CMP UNIT,UNITMX ;More units possible? BHIS 120$ ;Branch if not 110$: CMP R2,LDBUFE ;At end of buffer? BHIS 120$ ;Branch if so, done JMP 30$ ;Loop till done 120$: TST LDFLAG ; any units found? BEQ 140$ ; no TST NOLOAD ; any unloaded handlers? BEQ 130$ ; no FORMAT #BUFFER+10,<# Handler not loaded> .PRINT #BUFFER+10 ; print final message 130$: TST DIRTY ; any dirty units? BEQ 150$ ; no, done FORMAT #BUFFER+10,<* File unavailable> .PRINT #BUFFER+10 ; print final message BR 150$ ; Return. 140$: FORMAT #BUFFER, .PRINT #BUFFER ; print final message 150$: .RELEAS #R50LD ; Release the LD handler ; If under RTEM-11, chain to JOAT to display the host foreign ; and virtual device assignments. MOV @#$SYPTR,R5 ; Get the pointer to the base of the RMON BIT #SY.RTE,$SYSGN(R5) ; Running under RTEM-11? BEQ 170$ ; Branch if not TST A$$ ; Is this the all option. BNE 170$ ; Yes, then don't chain to joat! MOV #SPCCMD,R1 ; Get start of chain area MOV #JOTCMD,R2 ; Get start of RAD50 device name and cmd MOV #JOTSIZ,(R1)+ ; Stuff size 160$: MOVB (R2)+,(R1)+ ; Move the data into the chain area BNE 160$ ; Loop BIS #,@#$JSW ; Set special chain exit .PRINT #NULL ; CLR R0 ; Do a HARD exit .EXIT 170$: RETURN .DSABL LSB .END