.MCALL .MODULE .MODULE RESORC,VERSION=21,COMMENT=,AUDIT=YES ; 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 Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 06-APR-90 Added support for the ROI board: ; PDP 11/93 and PDP 11/94. ; 002 WLD 13-NOV-90 Eliminate references to C1.SJFB ; (FBMON$). ; 003 WLD 20-NOV-90 Add support for ; RUN is set [NO]VBGEXE ; in RESCNF. ; 004 WLD 29-NOV-90 Added support for ; MODE is set [NO]SJ ; in RESCNF. ;-- ; Edit History: ; 001 George Stevens Overlaid version of RESORC. Created from RESORC ; Version 97 ; 002 George Stevens Added code to RESPFX and RESDEV for SHOW DEVICE:MU ; 003 George Stevens Added code to RESPFX and RESDEV for installable ; status in SHOW DEVICE ; 004 George Stevens Added code to RESMEM to print cache bypass status ; 005 George Stevens Modified GETNAM routine to indicate the default device ; 006 George Stevens Fix bug in SHOW UMR when a device is present which ; does not support UMR. ; 011 George Stevens Bump version for change to RESDEV ; Handler version check ; 012 Linda Banche Fix version check ; 014 Megan Gentry Added speed codes and text for DH support ; ; (016) 16-Jul-90 Added definition for word in fixed offset area ; MBG which points to the multi-terminal handler hooks ; data structure ; RESPFX (008) ; ; Added support for reporting presence of ; multi-terminal handler hooks support. ; RESOPT (002) ; ; (017) 10-Sep-90 MBG Added support for reporting terminal lines owned ; by handlers. .SBTTL General comments ;+ ; RESROT was created from RESORC Version 97. ; ; RESORC is written in three major divisions; Command interpretation, ; Command execution, and Support routines. ; ; Program interfaces ; ------------------ ; Throughout the program, R5 is assumed to point to the base of the ; Resident Monitor. R5 must be saved and restored by any routine which ; alters it. ; ; Program dependancies ; -------------------- ; RESORC will only run on RT-11 V5.0 or later. ; ; The system disk must be mounted for RESORC to run. ; ; The following items must be in the root segment for RESORC to assemble ; and link properly: ; ; o The switch declarations ; o All contributions to psect CLEAR$ ; o All error messages ; ; The USR must not swap over program section .IMPURE. ; ; If the format of a device driver is changed, the routine LSTVEC may ; have to be modified. The most likely modification which may be needed ; is the method of tracing the interrupt vectors of multi-vectored ; devices. ; ; Building instructions: ; ---------------------- ; .MACRO RESORC ; .LINK RESORC,ULBLIB ; ; Optional patches: ; ----------------- ; If the system has graphics display hardware, the following patches ; may be necessary. ; ; If the CSR of the graphics display processor is not 172000, locations ; PAT3$ and PAT4$ must be patched. PAT3$ should be the address of the ; CSR, and PAT4$ should be the CSR address plus 32(8). ;- .AUDIT .RESCNF,.RESHRD,.RESOPT,.RESDEV,.RESASN,.RESJOB,.RESTRM .AUDIT .RESMEM,.RESSUB,.RESUMR,.RESCAC,.RESQUE,.RESUSR,.RESAUD .NLIST .INCLUDE /SRC:RESPFX.MAC/ .LIST .SBTTL Setup reference labels .PSECT ACTS,D,GBL ;Psect for switch macro ACTS$:: ;Reference label .PSECT PURE,D,GBL ;Psect for pure data PURE$:: ;Reference label (USR may swap from here) .PSECT CHARS,D,GBL ;Psect for switch macro CHARS$:: ; Reference label .PSECT CLEAR$,D,GBL ;Psect to contain address of items ; to be cleared on start-up CLRLST:: ; Reference label .PSECT ERRORS,D,GBL ;Error message pointer table psect ERRMSG:: ; Reference label .SBTTL COMMAND LINE INTERPRETATION ROUTINES .SBTTL Command line processing ;+ ; This routine is the main loop of RESORC. It does the initial set-up and ; then gets and parses the command line. It then calls EXECUT to execute ; the command. ;- .ASECT . = $JSW .WORD J.RNTR ;Set the reenter bit ORIGIN RESORC ;CG01 .ENABL LSB BPT ;**debug** BR RESTRT ;Reentry point START:: MOV SP,SAVESP ; Save the start of the stack RESTRT:: MOV #PURE$,@#$USRLD ;Let the USR swap here, if needful 1$: .RCTRLO ; Reset CTRL/O MOV SAVESP,SP ; Make sure the stack is set up .CSISPC #DEVSPC,#DEFEXT,,#BUFFER ;Get the command line BCS 1$ ; Try again on error ...CMZ TSTB BUFFER ;Was anything typed? BNE 2$ ;Branch if so. .PRINT #VERSON ;Else print the version number BR 1$ ; and go get another command line 2$: CALL INIT ;Initialize our state MOV (SP)+,R1 ;Get the number of switches given BEQ 7$ ;If there are no switches, do the default 3$: DEC R1 ;Count down the switches BLT 8$ ;Branch if done... go do what asked MOV (SP)+,R4 ;Get the switch. MOV #CHARS$,R2 ;Point to the list of valid switches MOV #ACTS$,R3 ;Point to the names of the routines to execute 4$: CMPB R4,(R2)+ ;Is this the switch? BEQ 5$ ;Branch if so ADD #ACTSIZ,R3 ;Go to the next flag/routine block TSTB @R2 ;Any other possible switches? BNE 4$ ;Branch if so. $ERROR IOP,LEVEL=FATAL,RETURN=NO ;Else give an error message 5$: TST R4 ;Was a value given? BPL 6$ ;Branch if not TST (SP)+ ;Else throw it away 6$: MOV SP,@R3 ;Mark the switch BR 3$ ; and go check for more options 7$: MOV SP,$DEFLT ;Set the default option 8$: CALL EXECUT ;Go execute the command BR RESTRT ;Go get another command .DSABL LSB .SBTTL EXECUT - Execute a command line ;+ ; This routine executes the input command line. ;- EXECUT:: MOV #ACTS$,R4 ;Point to the option/routine list 1$: TST ACTWRD(R4) ;At end of list? BEQ 4$ ;Branch if so. TST @R4 ;Should we do this option BNE 3$ ;Branch if yes 2$: ADD #ACTSIZ,R4 ;Bump to the next action BR 1$ ; and try this one. 3$: MOV R4,-(SP) ;Save R4 CALL @ACTWRD(R4) ;Call the routine MOV (SP)+,R4 ;Restore R4 BR 2$ ; and then try for another option 4$: .PRINT #CRLF ;Print a blank line RETURN .SBTTL Switch declarations ;+ ; The following are the switch declarations for RESORC. They must be ordered ; in the order that the routines are to be executed. Switch "Z" must be ; first, and "A" must be second. One switch must be declared the default. ; All switches must be valid RAD50 characters, unless the switch macro is ; changed (the switch character is used to generate a label of the form ; "char$$"). The switch declared to be the default does not generate the ; "char$$" label, but does generate the label $DEFLT. ;- .GLOBL A$$ SWITCH Z DCLS ;DCLS calls us with this (=> /M/C/H/O) SWITCH A ALL ;Show everything SWITCH M MONITR ;Show monitor version SWITCH C CONFIG DEFAULT ;Show configuration SWITCH H HRDWAR ;Show hardware configuration SWITCH O OPTGEN ;Show SYSGEN options SWITCH D DEVICE ;Show device vector, CSR, and version info SWITCH L ASSIGN ;Show device assignments SWITCH J JOBS ;Show jobs SWITCH T TTSHOW ;Show terminal setting SWITCH X MEMORY ;Show memory layout SWITCH S LDSHOW ;Show LD status SWITCH R SHWUMR ;Show UB (UMR) status ;SWITCH B CACHE ;Show CA (Cache) status SWITCH Q QUEUE ;Show system queues SWITCH U USERS ;Show system users SWITCH V AUDIT ;Show program version information SWITCH , 0 ;End of switch tables .SBTTL List of items to be cleared on startup ;+ ; The following list contains the addresses of items to be cleared on start- ; up. It has no particular ordering, but must contain at least one item, and ; must end in a 0 word. The switch macro adds one word for each switch. ; This list must be physically located after the switch declarations. ;- .PSECT CLEAR$,D .WORD $DEFLT ;Flag word for the default operation .WORD RBLK ;Read block for directory search .WORD HISEG ;Highest segment open .WORD LDFLAG ;indicates LD unit active .WORD DIRTY ;indicates LD unit dirty .WORD NOLOAD ;indicates an unloaded handler .WORD 0 ;End of list .PSECT RESORC .SBTTL COMMAND EXECUTION ROUTINES .SBTTL ALL - Do all options ;+ ; This routine causes all options to be executed. It does this by setting ; the flag word for each option non-zero and returning to the execution ; routine. ;- ALL:: MOV #ACTS$,R0 ;Point to the flag/action blocks 1$: TST ACTWRD(R0) ;At the end of the table? BEQ 2$ ;Branch if so MOV SP,@R0 ;Turn the option on ADD #ACTSIZ,R0 ;Point to the next entry BR 1$ ; and do another one 2$: RETURN .SBTTL MONITR - List the monitor version number ;+ ; This routine list the monitor boot string of the currently running monitor. ; It does this by reading the ASECT of the monitor file. ;- .ENABL LSB MONITR::.LOOKUP #AREA,#0,#MONDEV ;REOPEN the monitor file on channel 0 BCC 10$ ;Branch if no error SEVER:: $ERROR SER,LEVEL=FATAL,RETURN=NO ;Else we goofed. ;Give "System error" and quit 10$: .READW #AREA,#0,INBUFF,#INBFSZ/2,#$VERBL ;Read block with BSTRING BCC 20$ ;Branch if no error TSTB @#$EMTER ;What kind of error? BEQ SEVER ;Shouldn't happen $ERROR INE,LEVEL=FATAL,RETURN=NO,FILE=MONDEV ;Hard I/O error 20$: .PURGE #0 ;Purge the channel MOV INBUFF,R0 ;Point to the input buffer ADD #$VEROF,R0 ;Point to the boot string .PRINT ;Print the boot string RETURN .DSABL LSB .SBTTL CONFIG - Cause /Z (/M/C/H/O) to be executed ;+ ; DCLS passes a /Z when it gets the CONFIGURATION option. We convert that ; into the /M/C/H/O options. This saves the monitor much, and costs us ; little. ;- DCLS:: MOV SP,M$$ ;Turn on /M MOV SP,C$$ ;Turn on /C MOV SP,H$$ ;Turn on /H MOV SP,O$$ ;Turn on /O RETURN .SBTTL SUPPORT ROUTINES .SBTTL INIT - Set up code ;+ ; This routine does all the initialization for RESORC. It clears ; a list of locations, purges all channels, releases all non-resident ; handlers, determines which monitor is running, points R5 at the base of ; the RMON, stores the time and date locations TIME. and DATE., and then ; calls GETMON to build the name of the currently running monitor. ; It also sets up the pointers the the beginning and end of the input buffer. ;- .ENABL LSB INIT:: MOV @#$SYPTR,R5 ;Get the pointer to the base of the RMON CMP $SYVER(R5),RTVERS ;Is this RT-11 version 5.7? BEQ 1$ ;Yes, then ok to do it. $ERROR WVR,LEVEL=FATAL,RETURN=NO ;We can't do much, so give up 1$: MOV #,R1 ;R1 -> First input file specification. MOV #P.AUDIT,R0 ;R0 -> Audit File specification. .REPT 4 MOV (R1)+,(R0)+ ;Move all 4 words. .ENDR MOV ,DDEV ;Is it the XX/D format? BNE 2$ ;No, then is it... MOV ,DDEV ;Save the device if it is a XX:/D 2$: MOV HILMIT,R1 ;Get our hi limit TST (R1)+ ;Make sure we're above it MOV R1,INBUFF ;This will be the start of our input buffer ADD #,R1 ; and this will be the end MOV R1,SRTBUF ;And its also the start of the sort buffer ADD #,R1 ; and this is the end. ;+ ; Calculate memory required for LDSHOW routine ;- .DSTAT #DSAREA+1,#R50LD;Get LD handler status BCS 4$ ;If error, LD not installed CLR R0 ;Assume handler loaded TST DSAREA+4 ;Is it loaded? BNE 3$ ;Branch if yes MOV DSAREA+2,R0 ;Get handler size 3$: ADD #<<64.*4>+<64.*3>+2>*2,R0 ;Add space for LD translation table ADD HILMIT,R0 ;Add our high limit ;+ ; Are buffers sufficient to hold LD translation table and possibly handler ;- CMP R0,R1 ;Are buffers big enuf for LDSHOW routine? BLOS 4$ ;Branch if YES MOV R0,R1 ;Create new .SETTOP goal 4$: .SETTOP #-2 ;Ask the monitor for all we can get CMP R0,R1 ;Did we get it? BHIS 5$ ;Branch if so. $ERROR MOF,LEVEL=FATAL,RETURN=NO ;We can't do much, so give up 5$: MOV R0,(PC)+ ;Save our BG size for later. BG.SIZ:: .WORD 0 .SETTOP R1 ;Now come back down to what we need. MOV R1,IBFEND ;Save the end of the buffer MOV #CLRLST,R0 ;Point to the list of locations to be cleared 6$: CLR @(R0)+ ;Clear the location TST @R0 ;Anything left to clear? BNE 6$ ;Branch if so MOV #DEVSPC,R1 ;Point to the CSI file spec area 7$: TST @R1 ;Anything there? BEQ 8$ ;Nope .RELEAS R1 ;Release the handler 8$: ADD #OSPSIZ,R1 ;Point the next file spec CMP #+DEVSPC,R1 ;Into the input specs yet BHI 7$ ;No TST -(R1) ;Yes. Input specs are one word shorter CMP #,R1 ;Done? BHI 7$ ;Nope. Go do another one MOV #HICHAN,R1 ;Point to the hi channel number 9$: .PURGE R1 ; and purge the channel ; PURGE does not error if channel is not open DEC R1 ;Go down a channel BGE 9$ ; and do another one if not done MOV $CNFG3(R5),MONOWN ;Isolate ownership support bit so that BIC #^C,MONOWN ; MONOWN = 0 => No ownership table .GTIM #AREA,#TIME ;Get the time of day .DATE ; and the date MOV R0,DATE ;Save the date MOV #1,NXTDSE ;Next directory segment is 1 MOV R5,R0 ;R0 -> base of RMON ;CG02+ ADD #S.MNAM,R0 ;R0 -> booted monitor filename MOV (R0)+,MONAME ;Save the filename MOV (R0)+,MONTYP ;Both words MOV S.PNAM(R5),R0 ;R0 = offset to $PNAME ADD R5,R0 ;R0 -> $PNAME TST (R0)+ ;System device is always 2nd MOV @R0,MONDEV ;Copy the system device name CLR R0 ;Set up for MOVB BISB $SYUNT(R5),R0 ;R0 = system unit number ADD #<^R 0>,R0 ;Make it RAD50 ADD R0,MONDEV ;Fix the system device name ;CG02- ...CMY RETURN .SBTTL TRP1 - Handle traps to 4 and 10 ;+ ; This routine sets the carry bit on traps to 4 and 10 generated ; by HRDWAR while determining the hardware configuration.It must ; be in the PAR 0 address range or memory size determination may ; crash the system. ;- TRP1:: BIS #1,2(SP) ; Set the carry bit MOV R0,-(SP) ; Save R0 from the trap .TRPSET #AREA,#TRP1 ; Reset the trap vector MOV (SP)+,R0 ; Restore R0 RTI ; And return .SBTTL TRP3 and TRP4 - Handle traps to 4 and 10 ;+ ; These routines handle traps to 4 and 10 generated by $PDP11 ; while determining the processor type. ;- TRP3:: BCC TRP4 ;Branch if trap to 10 BIS R3,R4 ;Set the bits we were passed TRP4:: MOV R5,@SP ;Return to the address in R5 .TRPSET #AREA,CODE=NOSET ;Reset the trap vectors RTI ; and return .SBTTL TRPEAE - Handle traps to 4 and 10 ;+ ; This routine is used to determine if the system has EAE ; hardware. Set the carry to indicate that a trap to here ; occured. ;- TRPEAE::BIS #1,2(SP) ;Set carry .TRPSET #AREA,#TRPEAE ;Reset for memory checks RTI .SBTTL GENPHY - SUBROUTINE TO GET PHYSICAL DEVICE NAME ; Subroutine to get physical device name ; ; Input variables: ; ; UNIT = Device unit number ; PNAMPT -> 2 Letter RAD50 device name in $PNAME ; PNM2PT -> 1/2 Letter RAD50 device name in $PNAM2 ; ; Calling sequence: ; ; CALL GENPHY ; ; Output variables: ; ; PHYNAM = 2 Letter RAD50 device name if UNIT < 8. ; 1 Letter RAD50 device name if UNIT >= 8. ; PHYNM1 = 1 Letter RAD50 device name if device has extended ; unit support. Otherwise, 2 Letter RAD50 device name. ; ; Registers destroyed: ; ; R0 ; GENPHY::MOV R1,-(SP) MOV R2,-(SP) MOV UNIT,R1 ; $DEVTR needs unit in R1 MOV @PNAMPT,R0 ; Get 2-letter physical device name CMP R1,#8. ; Is unit less than 8? BLO 10$ ; Branch if yes, 2-letter is ok MOV @PNM2PT,R0 ; Else, get 1-letter device name 10$: CALL $DEVTR ; Combine device name and unit (RAD50) MOV R0,PHYNAM ; Get device name/unit in PHYNAM MOV @PNM2PT,R0 ; Get 1-letter/2-letter device name MOV UNIT,R1 ; $DEVTR needs unit in R1 CALL $DEVTR ; Combine device name and unit (RAD50) MOV R0,PHYNM1 ; Get $UNAM1 compatible dev name MOV (SP)+,R2 MOV (SP)+,R1 RETURN .SBTTL GETNAM - SUBROUTINE TO GET LOGICAL DEVICE NAME FOR PHYSICAL DEVICE ; Subroutine to get logical device name for physical device ; ; Input variables: ; ; $UNAM1 -> PHYSICAL DEVICE NAME TABLE $UNAM1 ; $UNAM2 -> LOGICAL DEVICE NAME TABLE $UNAM2 ; R1 = RAD50 DEVICE NAME OF THE $PNAM2 FORM ; R0 -> OUTPUT BUFFER (BUFFER) ; ; Calling sequence: ; ; MOV PHYNM1,R1 ; CALL GETNAM ; ; Output variables: ; ; ASCII logical device names outputted to output buffer ; R0 -> OUTPUT BUFFER UPDATED FOR CHARACTERS OUTPUTTED ; ; Registers destroyed: ; ; R2, R3 ; .ENABL LSB ; Needed due to .PSECTS in format macro. GETNAM::MOV $UNAM1,R3 ;Point to $UNAM1 (physical) MOV $UNAM2,R2 ;Point to $UNAM2 (logical) 10$: CMP R1,@R3 ;Does the physical name match the perm name? BNE 50$ ;Branch if not TST @R2 ;Is there anything there? BEQ 50$ ;Branch if not. ;+ ; DK and SY can be in $UNAM2 (logical) table twice, display only once. ;- CMP @R2,#<^RDK > ;Is this DK? BNE 20$ ;No, then it doesn't matter. CMP R2,$DKDEV ;Is this the real entry. BEQ 30$ ;Yes, then print it. BR 50$ ;No, then don't. 20$: CMP @R2,#<^RSY > ;Is this the system disk. BNE 30$ ;No, then go display it. CMP R2,$SYDEV ;Is this the real entry? BNE 50$ ;No, then don't display it. 30$: CMP #BUFFND,R0 ;Is the buffer full? BHI 40$ ;Branch if not .PRINT #BUFFER ;Print it MOV #BUFFER,R0 ;Point to start of buffer 40$: FORMAT ,<[R], >, ;Print the logical name 50$: CMP (R3)+,(R2)+ ;Go to next physical and logical CMP R3,$UNAM2 ;Finished the table? BLO 10$ ;Branch if not MOV @#$SYPTR,R3 ;R3 -> RMON. BIT #CF3.64,$CNFG3(R3) ;Does monitor support extended units BEQ 60$ ;Branch if not CLR R2 ;Get $SLOT*2 without sign extend BISB $SLOT2(R3),R2 ADD $PNAM2,R2 ;R2 -> default device CMP R1,@R2 ;Is it this device? BNE 60$ ;Branch if not FORMAT ,<*, > ;Output the asterisk 60$: RETURN .DSABL LSB .SBTTL INIPTR - INITIALIZE POINTERS TO MONITOR DEVICE TABLES ; Initialize pointers to monitor device tables ; ; Input variables: ; ; NONE ; ; Calling sequence: ; ; CALL INIPTR ; ; Output variables: ; ; $PMAN -> Monitor $PNAME device table ; $PNAM2 -> Monitor $PNAM2 device table if monitor sysgened for 64 units ; otherwise, $PNAM2 = $PNAM. ; $ENTRY -> Monitor $ENTRY device table ; $UNAM1 -> Monitor $UNAM1 device table ; $UNAM2 -> Monitor $UNAM2 device table ; ; Registers destroyed: ; ; R0, R2, R3, R4, R5 ; ;+ ; Determine the address and size of the device tables. ;- INIPTR::MOV @#$SYPTR,R5 ; R5 -> RMON. MOV S.PNAM(R5),R4 ; R4 = offset from RMON to $PNAME. ADD R5,R4 ; R4 -> $PNAME. MOV R4,R3 ; R3 -> $PNAME. MOV R4,$PNAM ; Save it. MOV R4,$PNAM2 ; Assume no $PNAM2, so point to $PNAME ; - so INI64U routine can work. 10$: CMP (R3)+,#-1 ; Search for end of $ENTRY table. BNE 10$ ; Keep going. MOV R3,R2 ; R2 -> $STAT table TST -(R3) ; R3 -> first word above $ENTRY. SUB R4,R3 ; R3 = bytes in combined tables. MOV R3,-(SP) ; Save, it is also owner table size. BIT #CF3.64,$CNFG3(R5) ; Does monitor support extended units? BEQ 20$ ; Branch if not ADD R3,R2 ; R2 -> $PNAM2 ADD R3,R2 ; table if it exists MOV R2,$PNAM2 ; Save the pointer 20$: ASR R3 ; Make it bytes per $UNAM(1,2) table. MOV R3,R0 ; Copy it. (DK/SY slot NOT included). ADD R4,R3 ; R3 -> $ENTRY+2. TST -(R3) ; Back it off. MOV R3,$ENTRY ; Save the pointer. MOV R4,R2 ; R2 -> $PNAME. SUB R0,R2 ; R2 -> $UNAM2+4. CMP -(R2),-(R2) ; R2 -> $UNAM2. MOV R2,$UNAM2 ; Save the pointer. SUB R0,R2 ; R2 -> $UNAM1+4. CMP -(R2),-(R2) ; R2 -> $UNAM1. MOV R2,$UNAM1 ; Save the pointer. SUB (SP)+,R2 ; R2 = Start of owner. MOV R2,$OWNER ; Save it. ;+ ; Determine the proper entries for DK and SY since they can appear ; twice in $UNAM2 ;- JSR R1,DVFIND ; Find the entry for SY. .RAD50 \SY \ ; Logical device to find. .WORD $SYDEV ; Location to get its address. JSR R1,DVFIND ; Find the entry for DK. .RAD50 \DK \ ; Logical device to find. .WORD $DKDEV ; Word to get its address. RETURN ;+ ; Subroutine to find the address of an entry in $UNAM2. ;- DVFIND: MOV R2,-(SP) ; Save R2. MOV $UNAM2,R2 ; R2 -> Logical name table. 10$: CMP (R1)+,@R2 ; Is this the one we want? BEQ 20$ ; Yes, then go return its address. CMP -(R1),(R2)+ ; Move to the next entry. CMP R2,$PNAM ; Have we reached $PNAM yet? BLO 10$ ; No, keep searching. CLR R2 ; Awk, we didn't find it! 20$: MOV R2,@(R1)+ ; Store the address of the entry. MOV (SP)+,R2 ; Restore R2. RTS R1 ; Return to the caller. .SBTTL INI64U - SUBROUTINE TO GET MAXIMUM UNIT NUMBER ; Subroutine to get maximum unit number ; ; Input variables: ; ; $PNAM -> Monitor $PNAME device table ; $PNAM2 -> Monitor $PNAM2 device table ; R0 = 2 letter RA50 device name to locate in $PNAM ; ; Calling sequence: ; ; MOV #^R,R0 ; Put 2 letter RAD50 device name into R0 ; CALL INI64U ; ; Output variables: ; ; PNAMPT -> Device entry in $PNAM for device in R0 ; PNM2PT -> Device entry in $PNAM2 for device in R0 ; UNITMX = Maximum unit number for device. If device ; name in R0 is identical to the device name ; pointed to by PNM2PT, then UNITMX = 8. ; Otherwise, UNITMX = 64. ; ; Registers destroyed: ; ; R4 ; INI64U::MOV $PNAM,R4 ; R4 -> $PNAME table 10$: CMP R0,(R4)+ ; Found device? BNE 10$ ; Loop till found - it's in there TST -(R4) ; Point to dev entry in $PNAME table MOV R4,PNAMPT ; and save the pointer SUB $PNAM,R4 ; Get byte index into $PNAME table ADD $PNAM2,R4 ; Point to dev entry in $PNAM2 table MOV R4,PNM2PT ; and save the pointer MOV #8.,UNITMX ; Assume non-extended-unit handler CMP R0,@R4 ; Does $PNAM2 match $PNAME entry? BEQ 20$ ; Branch if so - not extended unit MOV #64.,UNITMX ; Extended unit handler 20$: RETURN .SBTTL ERROR - Error processor ;+ ; This routine handles errors generated by RESORC. The call is: ; JSR R5,ERROR ; .BYTE error number ; .BYTE error level ; [.WORD -> RAD50 filename block] ; ; If bit 0 of the flag word is set, the next word is a pointer to a RAD50 ; filename, which is to be printed after the error message. ; If bit 15 is set, the routine returns to the caller. Otherwise, it jumps ; to the restart address. ;- ERROR:: .RCTRLO ;Turn off CTRL/O for the error message MOV R2,-(SP) ;Save R2 and R3 MOV R3,-(SP) ; MOV R5,R2 ;Copy pointer to flag word CLR R1 ; BISB (R2)+,R1 ;Get the error number BIC #1,R1 ;Clear the filename flag, if there ADD #ERRMSG,R1 ;Point to the error message MOVB @R2,ELEVEL ;Get the error level BICB #200,ELEVEL ;In case of return .PRINT #ERRSTR ;"?RESORC-l-" .PRINT @R1 ;Print the message BIT #1,(R5)+ ;Is there a filename to print? BEQ 1$ ;Branch if not MOV (R5)+,R3 ;Copy pointer to filename TST (R3)+ ;Skip device word. MOV #BUFFER,R1 ;Point to line buffer MOV (R3)+,R0 ;Get 1st RAD50 word CALL $R50AS ;Convert it to ASCII MOV (R3)+,R0 ;Get 2nd word CALL $R50AS ;Convert it MOVB #'.,(R1)+ ;Put in the dot MOV (R3)+,R0 ;Get filetype CALL $R50AS ;Convert it CLRB @R1 ;Make the string ASCIZ .PRINT #BUFFER ;Print the filename 1$: MOV R2,R1 ;Save the flag word pointer MOV (SP)+,R3 ;Restore registers MOV (SP)+,R2 ; TSTB @R1 ;Should we return to caller? BMI 2$ ;Branch if so CALLR RESTRT ;Else restart 2$: RTS R5 ;Return to caller .SBTTL IMPURE DATA AREA .PSECT IMPURE,D .NLIST BEX BASCSR::.WORD 0 ;Device CSR BASVEC::.WORD 0 ;Base vector for PRO floating vector devices FPAFG:: .WORD 0 ;Switch for FP Accelerator on J11 PMIFG:: .WORD 0 ;PMI memory flag PAT3$:: .WORD GTDSPL ;Hardware graphics display CSR PAT4$:: .WORD VS60SP ;VT48 graphics display processor SP DATE:: .WORD 0 ;Date save area HISEG:: .WORD 0 ;Highest directory segment open INBUFF::.WORD 0 ;Pointer to the input buffer IBFEND::.WORD 0 ;Pointer to the end of the input buffer (free mem) BUFEND::.WORD 0 ;Pointer to end of buffer for multiple vector test SRTBUF::.WORD 0 ;Pointer to the start of the sort buffer PDTFL:: .WORD 0 ;FLAG WORD FOR PDT'S INCNT:: .WORD 0 ;Input block count for handlers MONOWN::.WORD 0 ;Ownership support flag word NXTDSE::.WORD 0 ;Next directory segment (used by SRCH) NXTFIL::.WORD 0 ; -> next file in the directory RBLK:: .WORD 0 ;Read block number for directory search SAVESP::.WORD 0 ;Stack pointer save word XTRABY::.WORD 0 ;Number of extra bytes in directory entry TIME:: .BLKW 2 ;Time save area ERRSTR::.ASCII \?RESORC-\ ;Start of error messages ELEVEL::.ASCII \l-\<200> ;Level of error .EVEN HSTR:: .ASCII \%%\ ;Match string for handlers HSTR1:: .ASCIZ \X \ ;This byte will be cleared if not XM .EVEN HSR:: .WORD 0 ;Storage for RAD50 handler suffix XMFLAG::.WORD 0 ;1=>We're using XM DEFEXT::.BLKW 4 ;Default extensions for CSI DSAREA::.BLKW 4 ;.DSTATUS information return block DEVID:: .WORD 0 ;Device ID of current device for SHOW DEV:dd MTSTAT::.BLKW 4 ;Multi-terminal status block MONDEV::.WORD 0 ;Device name of system device MONAME::.WORD 0 ;Name of monitor MONTYP::.WORD 0 .RAD50 \SYS\ ;Monitor filetype ASCVRT::.BLKB 14 ;Storage area for ASCII from $R50AS MONSST::.BLKW 5 ;Monitor file savestatus block SYSNFS::.BLKW 5 ;System device savestatus block AREA:: .BLKW 12 ;EMT area block PHYSLP::.BYTE 0,1 ;Physical lookup data block .WORD WORK+1 .WORD 0 .BLKW 1 .WORD RTSPC+1 RTSPC: RETURN WORK:: .WORD 0 .WORD 0 HNDLST::.BLKW 40 ;Area to store device names for DEVICE DEVSPC::.BLKB SPCSIZ ;CSI device specification block BUFF:: .BLKW 15 ;GTJB BLOCK TCBMAX::.WORD 0 ;MAX # TCB TCBHFG::.BLKW ;TCB Hooked by handler flag DDEV:: .WORD 0 ;Device for show of individual device. P.AUDIT::.WORD 0,0,0,0 ;File to have version audit done. R50LD:: .RAD50 /LD / ;Non file structured lookup name for LD: LDFLAG::.BLKW 1 ;0 = no unit mounted, 0<>unit(s) mounted DIRTY:: .BLKW 1 ;0 = no dirty units, 0<>dirty units NOLOAD::.BLKW 1 ;0 = reqd handlers loaded, 0<>some unloaded LDBUFE::.BLKW 1 ;Pointer to last full entry in LD ; translation table LDTBSB::.BLKW 1 ;Size of LD translation table in bytes ;- LDTBSB * 4 is size of LD.NAM table ;+ ; Data area for assign function. ;- OWNPT:: .WORD 0 ; Pointer to device entry in $OWNER OWNFLG::.WORD 0 ; -1 if device is not owned or no ownership table FRECNT::.WORD 0 ; Number of free device slots UNIT:: .WORD 0 ; Device unit number being worked on ;+ ; Locations setup by GENPHY subroutine ;- PHYNAM::.WORD 0 ; 2 Letter RAD50 device name if UNIT < 8. ; 1 Letter RAD50 device name if UNIT >= 8. PHYNM1::.WORD 0 ; 1 Letter RAD50 device name if device has extended ; unit support. ; Otherwise, 2 Letter RAD50 device name. ;+ ; Locations setup by INI64U subroutine ;- PNAMPT::.WORD 0 ;Pointer to device entry in $PNAME PNM2PT::.WORD 0 ;Pointer to device entry in $PNAM2 UNITMX::.WORD 0 ;Maximum number of units ;If entry pointed to by PNAMPT = ; entry pointed to by PNM2PT then ; UNITMX = 8. ;Else UNITMX = 64. ;+ ; Pointers setup by INIPTR subroutine ;- $OWNER::.WORD 0 ;Pointer to monitor $OWNER device table $UNAM1: .WORD 0 ;Pointer to monitor $UNAM1 device table $UNAM2: .WORD 0 ;Pointer to monitor $UMAN2 device table $PNAM:: .WORD 0 ;Pointer to monitor $PMANE device table $PNAM2::.WORD 0 ;Pointer to monitor $PNAM2 device table ;if monitor sysgened for 64 unit support. ;Otherwise, pointer to monitor $PNAME ;device table. $ENTRY::.WORD 0 ;Pointer to monitor $ENTRY device table $SYDEV: .WORD 0 ;Pointer to $UNAM2 entry for SY: $DKDEV: .WORD 0 ;Pointer to $UNAM2 entry for DK: ;THE NEXT 2 LINES MUST STAY TOGETHER BUFFER::.BLKW 38. ;Line buffer (input and output) BUFFND: .BLKW 3 ;Rest of line buffer (for GETNAM) ;NOTE: JUBF must be an even number of words JBUF:: .BLKW <64.+1>*2 ;DU translation table buffer JBUFE:: ;Address immediately past DU table buffer ; translation table ;END OF AREA TO KEEP TOGETHER .LIST BEX .SBTTL PURE DATA AREA .SBTTL ASCII Data .PSECT PURE,D .NLIST BEX RTVERS: .BYTE 5 ;RT-11 version 5.7 .BYTE 7 VERSON: .NLCSI ;CSI response for no input CRLF:: .ASCIZ \\ SJ:: .ASCIZ \SJ\ SWAP:: .ASCIZ \SWAP\ VBG:: .ASCIZ \VBGEXE\ NO:: .ASCII \NO\<200> VT11:: .ASCIZ \VT11 Graphics Display Hardware\ VT48:: .ASCIZ \VT48 Graphics Display Hardware\ PCCLK:: .ASCII \(PC300 emulation)\<200> PCBLNK::.ASCII \ \<200> AUDMEM::.ASCIZ "?RESORC-F-Insufficent memory to fetch handler" AUDNSD::.ASCIZ "?RESORC-F-Device or file not found" AUDNIN::.ASCIZ "?RESORC-F-No audit information available" JBHD:: .ASCII \Job Name Console Level State Low High Impure\ .ASCIZ \--- ---- ------- ----- ----- --- ---- ------\ DONE:: .ASCII \Done \<200> SSPD:: .ASCII \Suspend\<200> RUN:: .ASCII \Run \<200> .EVEN FORE:: .ASCII \F \<200> .EVEN BLNK:: .ASCII \ \<200> .EVEN RESRC:: .ASCII \RESORC\<200> .EVEN HNDHED::.ASCII \Device Status CSR Vector(s)\ .ASCIZ \------ ------ --- ---------\ TTHED:: .ASCII \Unit Owner Type WIDTH TAB CRLF FORM SCOPE SPEED\ .ASCIZ \--------------------------------------------------------\ MTYHK:: .ASCIZ / * Handler hooks in use/ MEMHTX::.ASCII /Address Module Words/<200> MEMHLI::.ASCII /------- ------ -----/<200> MEMHTZ::.ASCIZ / Type/ MEMHLZ::.ASCIZ / ----/ B50: .ASCIZ \ 50\ B75: .ASCIZ \ 75\ B110: .ASCIZ \ 110\ B134: .ASCIZ \134.5\ B150: .ASCIZ \ 150\ B300: .ASCIZ \ 300\ B600: .ASCIZ \ 600\ B1200: .ASCIZ \1200\ B1800: .ASCIZ \1800\ B2000: .ASCIZ \2000\ B2400: .ASCIZ \2400\ B3600: .ASCIZ \3600\ B4800: .ASCIZ \4800\ B7200: .ASCIZ \7200\ B9600:: .ASCIZ \9600\ B1920: .ASCIZ \19200\ B3840: .ASCIZ \38400\ WAR: .ASCIZ \WARNING\ ERR: .ASCIZ \ERROR\ FTL: .ASCIZ \FATAL\ UNC: .ASCIZ \SEVERE\ NON: .ASCIZ \NONE\ UNKNOW: .ASCIZ \Unknown\ OFF:: .ASCIZ \OFF\ ON:: .ASCIZ \ON\ SLKMON::.ASCIZ \KMON\ F77:: .ASCIZ \F77XM\ F4: .ASCIZ \FORTRA\ EDIT: .ASCIZ \EDIT\ TECO: .ASCIZ \TECO\ KED: .ASCIZ \KED\ K52: .ASCIZ \K52\ KEX: .ASCIZ \KEX\ PUNK:: .ASCII \Unknown\<200> PLSI: .ASCII \LSI 11 or PDP 11/03\<200> P04: .ASCII \PDP 11/04\<200> P05: .ASCII \PDP 11/05,10\<200> P20: .ASCII \PDP 11/15,20\<200> P34: .ASCII \PDP 11/34\<200> P40: .ASCII \PDP 11/35,40\<200> P45: .ASCII \PDP 11/45,50,55\<200> P60: .ASCII \PDP 11/60\<200> P70: .ASCII \PDP 11/70\<200> P44: .ASCII \PDP 11/44\<200> P24: .ASCII \PDP 11/24\<200> P23: .ASCII \PDP 11/23\<200> PT3: .ASCII \PDT 11/130\<200> PT5: .ASCII \PDT 11/150\<200> P23P: .ASCII \PDP 11/23 PLUS\<200> P21: .ASCII \SBC 11/21 (T11)\<200> P73A: .ASCII \PDP 11/73A\<200> P73B: .ASCII \PDP 11/73B\<200> P83: .ASCII \PDP 11/83\<200> P84: .ASCII \PDP 11/84\<200> PC380: .ASCII \PC380\<200> PC350: .ASCII \PC325,PC350\<200> P53: .ASCII \PDP 11/53\<200> PKXJ: .ASCII \KXJ11-CA\<200> P93: .ASCII \PDP 11/93\<200> P94: .ASCII \PDP 11/94\<200> .EVEN .GLOBL INE...,ERD...,ITB... MSG MOF, MSG INE,^%Input error \<200>\% MSG IOP, MSG ERD, MSG SER, MSG WVR, MSG ITB, .EVEN QUEFLG::.WORD 0 ;=0 There is no queue, =1 there is a queue QUEMAN::.RAD50 \SY \ .RAD50 \QUE\ .RAD50 \MAN\ .RAD50 \SAV\ .WORD 1 .ASCIZ \/L\ .EVEN CADEV: .RAD50 \CA \ CACMD: .ASCIZ \RUN SY:CA.SYS /Z\ CASIZ =.-CACMD .EVEN UBXSYS::.RAD50 \SY \ .RAD50 \UBX \ .RAD50 \SYS\ UBDEV:: .RAD50 \UB \ .WORD 0,0,0 JOTCMD::.ASCIZ \RUN SY:JOAT /L\ NULL ==.-1 JOTSIZ ==.-JOTCMD .NLIST BEX .SBTTL Tables .EVEN .NLIST BEX ;+ ;Table containing bit masks for error levels and pointers to error level ;text. If the bit is set in check the pointer is adjusted for second word ;to point to text to print. Zero bit mask flags end of table and UNKNOWN ;is the text display. ;- ABSLEV:: .WORD NONE$,NON .WORD WARN$,WAR .WORD ERROR$,ERR .WORD FATAL$,FTL .WORD UNCON$,UNC .WORD 0,UNKNOW BAUD:: .WORD B50, B75, B110, B134, B150 ;Pointers to the ASCIZ .WORD B300, B600, B1200, B1800, B2000 ;strings for DZ11 baud .WORD B2400, B3600, B4800, B7200, B9600 ;rates .WORD B1920, B3840 PDPS:: .Assume PDP.UNK EQ .-PDPS/2 .WORD PUNK .Assume PDP.20 EQ .-PDPS/2 .WORD P20 .Assume PDP.40 EQ .-PDPS/2 .WORD P40 .Assume PDP.05 EQ .-PDPS/2 .WORD P05 .Assume PDP.45 EQ .-PDPS/2 .WORD P45 .Assume PDP.04 EQ .-PDPS/2 .WORD P04 .Assume PDP.34 EQ .-PDPS/2 .WORD P34 ;PDP.05 = 7 ;PDP11/05/10 .WORD P05 .Assume PDP.70 EQ .-PDPS/2 .WORD P70 .Assume PDP.60 EQ .-PDPS/2 .WORD P60 .Assume PDP.LSI EQ .-PDPS/2 .WORD PLSI .Assume PDP.44 EQ .-PDPS/2 .WORD P44 .Assume PDP.24 EQ .-PDPS/2 .WORD P24 .Assume PDP.23 EQ .-PDPS/2 .WORD P23 .Assume PDT.130 EQ .-PDPS/2 .WORD PT3 .Assume PDT.150 EQ .-PDPS/2 .WORD PT5 .Assume PLUS.23 EQ .-PDPS/2 .WORD P23P .Assume SBC.21 EQ .-PDPS/2 .WORD P21 .Assume PDP73A EQ .-PDPS/2 .WORD P73A .Assume PDP73B EQ .-PDPS/2 .WORD P73B .Assume PDP.83 EQ .-PDPS/2 .WORD P83 .Assume PDP.84 EQ .-PDPS/2 .WORD P84 ;reserve= 26 ;reserved??? .WORD 0 .Assume PRO.380 EQ .-PDPS/2 .WORD PC380 .Assume PRO.3XX EQ .-PDPS/2 .WORD PC350 .Assume PDP.53 EQ .-PDPS/2 .WORD P53 .Assume PDP.KX EQ .-PDPS/2 .WORD PKXJ .Assume PDP.93 EQ .-PDPS/2 .WORD P93 .Assume PDP.94 EQ .-PDPS/2 .WORD P94 PDPEND:: .WORD 0, 1, 50, 3100 ;Divisor table for RAD50 to $.DIVT: ;ASCII conversion routine ;+ ; These edit codes are subject to change. For the current values, see ; SETMOF in KMOVLY. ;- EDIVAL::.BYTE $$EDIT ;EDIT .BYTE $$TECO ;TECO .BYTE $$KED ;KED .BYTE $$K52 ;K52 KEXVAL::.BYTE $$KEX ;KEX (XM only) ;Must be last in table .BYTE 0 ;Table end .EVEN EDIPRT::.WORD EDIT .WORD TECO .WORD KED .WORD K52 .WORD KEX FORVAL::.BYTE $$F77 ;FORTRAN77 (XM OR NON) ;Must be last in table .BYTE $$FORT ;FORTRAN IV .BYTE 0 ;TABLE END .EVEN FORPRT::.WORD F77 .WORD F4 .SBTTL Other pure data SYSDEV::.RAD50 \SY \ ;System device name for non-file structured .WORD 0 ; lookups LOLMIT::.LIMIT ;Program low HILMIT == .-2 ; and high limits .END START