.mcall .module .module CI release=V03 version=07 comment= audit=yes .rem | ------------------------------------------------------------------------------ Another handleroid brought to you by: William K. Walker Internet: rdbalpha@mcimail.com RDB/Alpha Systems CompuServe: 71066,24 740 Alpha Rd., Box 149 MCI Mail: rdbalpha Alpha, OH 45301-0149 Telex: 6503331675 (6503331675 MCI UW) (513) 426-0344/7094 This handleroid allows you to turn the various RT-11 Command Line Interpreters (CLIs) on or off using SET commands. It will also show which CLIs are enabled. There are four CLIs: UCF (User Commands First), DCL (Digital Command Language), CCL (Concise Command Language), and UCL (User Command Linkage). Refer to the RT-11 documentation for an explanation of each. The possible SET commands for the CI (Command Interpreter) handleroid are: SET CI [NO]UCF -- turn UCF on/off SET CI [NO]DCL -- turn DCL on/off SET CI [NO]CCL -- turn CCL on/off SET CI [NO]UCL -- turn UCL on/off SET CI HELP -- display SET commands and version/release of CI SET CI RESET -- same as SET CI NOUCF,DCL,CCL,UCL SET CI SHOW -- display the active CLIs By default, RT-11 has all CLIs enabled except UCF. In other words, the normal situation is equivalent to SET CI NOUCF,DCL,CCL,UCL Thus, if you issued a SET CI SHOW command under an unaltered monitor, CI would report ?CI-I-CLIs enabled: DCL CCL UCL Note that SET CI RESET restores/insures the above default condition. Also note that CI, when running under RTEM, will default to having all CLIs turned on (SET CI RESET equivalent to SET CI UCF,DCL,CCL,UCL). The text displayed by SET CI HELP will also change to reflect this condition. It is not possible to INSTALL CI. This is because CI contains only SET code. As there is no executable handler code, there is no reason why CI should be installable -- it would just waste a device slot in the monitor tables that could be used for something else. The monitor will execute the SET options as long as CI has the right name and resides on SY:. Thus, for the RT-11 SJ and FB monitors, the file should be SY:CI.SYS. If you are going to use it under XM, make a copy named SY:CIX.SYS. If you are running under the RTEM monitor, it should be named SY:CIM.SYS. ***************************************************************************** * WARNING: Turning off both DCL and CCL effectively turns off the monitor. * ***************************************************************************** NOTE ~~~~ CI will not run under versions of RT-11 prior to V5.2 (RTEM V2.1). It will not work under TSX-Plus either. Beginning with V5.6, RT-11 implemented a SET CLI command and the necessary modifications to RESORC and HELP which essentially duplicate the functionality of CI. However, CI still works properly under these more recent RT-11 monitors. -----------------------------------------------------------------------------| ; Various handy constants... jsw = 44 ;Address of job status word edit$ = 000020 ;Disable SL editor bit sysgen = 372 ;Offset to monitor sysgen features word rtem$ = 000010 ;RTEM monitor bit sysver = 276 ;Offset to RT-11 version/release data $inddv = 426 ;RMON fixed offset pointer to IND device name, unit ucf$ = 1 ;CLI enable bits in CLIFLG byte... dcl$ = 2 ccl$ = 4 ucl$ = 10 lf = 012 ;Linefeed cr = 015 ;Carriage return ; Necessary macros... .mcall .addr, .assume, .drdef, .gtlin, .print ; The RTV5.3 conditional enables support for the new handler macros introduced ; with RT-11 V5.3. It is enabled by default. If you are assembling this ; handler on an RT-11 V5.2 system, set rtv5.3 = 0. .iif ndf rtv5.3 rtv5.3 = 1 .iif ne rtv5.3 rtv5.3 = 1 ; Driver definitions... ; ; Since we only do SET code, we are both read-only and write-only. .drdef ci, 377, ronly$!wonly$, 0, 0, 0 .iif ne rtv5.3 .drest class=dvc.ps ; "Installation" code... ; ; This is really "uninstallation" code. Since CI only does SET code, there is ; no reason for it to be installed in the monitor tables. .drins ci nop sec ;Always fail to install... return ; Routine to make "context" adjustments to CI SET code... ; ; The RTEM monitor uses the UCF facility to implement some RTEM-specific ; monitor commands. Thus, UCF is turned on by default under RTEM. UCF is off ; by default under RT-11. C.NTXT checks to see if we are running under RTEM, ; and, if necessary, dynamically modifies the effect of SET CI HELP and SET CI ; RESET. c.ntxt: mov r0,-(sp) ;Save R0 call g.sysg ;Get value of Sysgen Features Word bitb #rtem$,r0 ;Running under RTEM? beq 10$ ;Branch if not inc r3 ;Sets UCF$ if called by RESET routine movb #40,mhelpm ;Change "NOUCF" to " UCF" in help text... movb #40,mhelpm+1 10$: mov (sp)+,r0 ;Restore R0 return ;Quit g.sysg: mov pc,r0 ;Get value of monitor SYSGEN word... add #c.area-.,r0 emt 375 return ;...and return c.area: .byte 0, 34 ;EMT arguments for getting SYSGEN value... .word sysgen ; Routine to test for valid monitor version. ; ; In case some fool tries to run us under TSX-Plus, we try to check for ; this condition and return with the carry bit set and a garbage (zero) ; release/version value. Otherwise, we do an honest check and set carry ; appropriately. This is not a sure thing because some some versions of V5.1 ; have a bug that screwed up the SYSVER value. g.sysv: .addr #o.area,r1 ;R1 => data tables call g.sysg ;Get Sysgen Features Word tst r0 ;Is it TSX-Plus? bpl 10$ ;Branch if not clr r0 ;Return with garbage value if so... br 20$ 10$: mov r1,r0 ;Get release/version (PIC-style)... emt 375 swab r0 ;Are we running V5.2 or later?... cmp r0,#<5*400!2> blt 20$ ;Branch if not tst (pc)+ ;Return with carry clear if so... 20$: sec return ; Note that we have stuck the context checking routines into the unused area ; belonging to the installation code. Next, we'd better make sure that we ; don't overflow into the area reserved for the handler SET code. .assume . le 400 message=<;*** OVERFLOW INTO SET OPTION TABLES ***> ; SET option tables... .drset UCF, ucf$, o.ucf, no .drset DCL, dcl$, o.dcl, no .drset CCL, ccl$, o.ccl, no .drset UCL, ucl$, o.ucl, no .drset HELP, 1, o.help .drset RESET, , o.rset .drset SHOW, 5, o.show ; SET CI [NO]UCF, [NO]DCL, [NO]CCL, [NO]UCL o.ucf: o.dcl: o.ccl: o.ucl: br o.set ;Branch to code to turn a CLI on nop o.clr: call o.ciwd ;R0 => 1 word past CLIFLG/CLITYP word mov -(r0),r1 ;Save CLIFLG/CLITYP value mov r0,-(sp) ;Save CLIFLG/CLITYP address on stack bic #^C<6>,r1 ;Mask for DCL, CCL bits bic r3,r1 ;See if we would have neither bne 10$ ;Branch if at least one left active bis #edit$,@#jsw ;Disable SL editor .addr #mwarn,r2 ;R2 => warning message mov #512,r1 ;R1 => input buffer .gtlin r1,r2 ;Issue warning, get response bicb #^C<137>,(r1) ;Did the idiot answer "yes"?... cmpb (r1),#'Y bne 20$ ;Just go quit if not mov pc,r0 ;Issue Pontius Pilate message... add #mstupd-.,r0 .print 10$: bic r3,@(sp) ;Clear requested bit 20$: tst (sp)+ ;Clean up the stack br o.good ; and quit o.set: call o.ciwd ;R0 => 1 word past CLIFLG/CLITYP word bis r3,-(r0) ;Turn on the selected CLI return ; SET CI RESET o.rset: call o.ciwd ;R0 => 1 word past CLIFLG/CLITYP word bic #1,-(r0) ;Assume UCF is to be turned off call c.ntxt ;Do any context adjustments bis r3,(r0) ;Restore default CLIs return ; SET CI HELP o.help: call c.ntxt ;Do possible context adjustment mov pc,r0 ;Calculate address of help test... add #mhelp-.,r0 .print ;Print it br o.good ;Quit with carry clear ; SET CI SHOW o.show: call o.ciwd ;Make R0 point at INDDEV (1 word past CLIFLG) mov -(r0),r2 ;Put CLIFLG/CLITYP word in R2 .addr #m,r1 ;"...CLIs enabled:"... .print r1 add #m1-m,r1 ;Point at first one to check... br 20$ 10$: add #m2-m1-1,r1 ;Point at next 20$: bitb (r1)+,r2 ;This CLI active? beq 30$ ;Branch if not .print r1 ;Otherwise, print following text 30$: sob r3,10$ ;Go look at next one until done br o.good ;Quit with no error ; Routine to check for RT-11 version and return with address of INDDEV in R0. ; ; O.CIWD attempts to prevent the user from inadvertantly zapping the monitor ; by checking the RT-11 release/version word to make sure that we are running ; under a V5.2 or later monitor. This is not a sure thing because some ; versions of V5.1 had a bug that screwed up this information. ; ; If the release/version is OK, the address of INDDEV is returned in R0, and ; the carry bit is clear. o.ciwd: call g.sysv ;Get release/version bcc 10$ ;Branch if so add #10,r1 ;If not, point R1 at error message tst r0 ;If TSX-Plus, "expand" error message... bne 5$ movb #40,34(r1) 5$: .print r1 ;"...Wrong version of RT-11" tst (sp)+ ;Pop stack to force a return to monitor br o.bad ;Go quit 10$: add #4,r1 ;Get pointer to INDDEV word mov r1,r0 ; (1 word past CLIFLG)... emt 375 o.good: tst (pc)+ ;Return with carry clear... o.bad: sec return .assume . le 1000 message=<;*** SET CODE IS TOO LARGE ***> ; This is the dummy handler code which is included for hand-holding purposes. .drbeg ci ciint:: .drfin ci .drend ci ; Data area...don't mess with the order of this stuff!!! o.area: .byte 0, 34 ;Argument area for EMTs used by O.CIWD... .word sysver .byte 0, 34 .word $inddv .nlist bex .nlcsi type=i, part=prefix ;ASCII stuff... .ascii "F-Wrong version of RT-11" .byte 0 .asciz "(It's TSX-Plus, you dope!)" m: .nlcsi type=i,part=prefix .ascii "I-CLIs enabled:"<200> m1: .ascii < 1>" UCF"<200> m2: .ascii < 2>" DCL"<200> .ascii < 4>" CCL"<200> .ascii <10>" UCL"<200><17><0> mhelp: .byte cr, lf .nlcsi type=i .byte cr, lf, lf .ascii "SET CI [NO]UCF -- turn UCF on/off" .ascii "SET CI [NO]DCL -- turn DCL on/off" .ascii "SET CI [NO]CCL -- turn CCL on/off" .ascii "SET CI [NO]UCL -- turn UCL on/off" .ascii "SET CI HELP -- display this text" .ascii "SET CI RESET -- same as SET CI " mhelpm: .ascii "NOUCF,DCL,CCL,UCL" .asciz "SET CI SHOW -- display active CLIs" mwarn: .ascii "Disable access to monitor commands/utilities; " .ascii "Are you sure? "<200> mstupd: .ascii "OK...it's your funeral!" .even .list bex ; Here we must ensure that we are entirely within the first two blocks of the ; handler. Only blocks 0 and 1 are loaded in memory when SET code is ; executed. .assume <.-cistrt> le 1000 message=<;*** EXCEEDED HANDLER BLOCK 1 ***> .end