.TITLE priority_booster "Control-B for Boost" ;+ ; Facility: ; PRIO.MAR - Priority booster ; ; Abstract: ; This program is designed to set up an executive-mode out-of-band AST ; to make ^B cause the process priority to be boosted to 14. ; ; Author: ; Ehud Gavron ; Sunquest Information Systems ; 930 North Finance Center Drive ; Tucson, AZ 85710 ; Phone: 602/885-7700 ext 2546 ; Email: gavron@sunquest.com ; ; Date: ; 27-Mar-1991 ; ; Modified: ; 28-Mar-1991 Ehud Gavron Make the AST operate in executive mode so ; that it can call $setprv to give ALTPRI and ; thus not require it in the main process. ; Modify the control character to be ^B and ; not ^P so we can run this on the console :-) ; ; Functional Description: ; ; This program will load in the service routine into the ; P1 process permanent allocation region, and aim an out-of ; band asynchronous system trap (OOB AST) at it. This code ; will be activated by the user pressing the control-b (^B) ; key on the terminal. It will then raise the priority of ; this process to 14. ; ; Caveats: ; This program will only affect the current process, and ; not any subprocess or parent process. ; One needs to *manually* lower one's priority after the ; problems causing one to run this have been resolved. Failure ; to do so could cause irritation to one's users. ;- .link "sys$system:sys.stb"/SELECTIVE_SEARCH .library "sys$Library:lib.mlb" $iodef $prvdef $psldef $ssdef channel: .blkw 1 ; Store number of channel used (one word used) sys_command: .ascid 'TT' ; Device to set the out of band ast on .entry control_b,^m<> $cmexec_s routin = load_control_b ; Load the code blbc r0,10$ $cmexec_s routin = activate_control_b ; Set OOB AST blbc r0,10$ movl #ss$_Normal,r0 10$: ret .entry load_control_b,^m movl #astlen,r1 ; Length of code piece jsb g^exe$alop1proc ; Attempt allocation blbc r0,10$ ; If failed exit error movl r2,r7 ; Save pointer to it movc3 #astlen,aststart,(r7) ; Put code in allocated region movl r7,p1 ; Save address movl #ss$_normal,r0 10$: ret ; Return to main code aststart: .entry astcode,^m<> movab data,r0 ; Use MOVAB cause it uses relative addressing ; movl #prv$v_altpri,(r0) mnegl #1,(r0) ; Forget altpri, give us all privs :-) mnegl #1,4(r0) $setprv_s enbflg=#1,prvadr=(r0) $setpri_s pri=#14 ret data: .blkl 2 astlen = . - aststart qiolist: .long 12 ; 12 arguments in arglist efn: .long 0 ; efn (not used) chan: .blkl 1 ; channel number func: .blkl 1 ; function code iosb: .long 0 ; address of iosb (not used) astadr: .long 0 ; address of ast routine (not used) astprm: .long 0 ; value of ast param (not used) p1: .blkl 1 ; address of ast routine p2: .address oob ; address of oob mask p3: .blkl 1 ; p3 p4: .blkl 3 ; p4-p6 (not used) oob: .long 0 ; Short form terminator .long 4 ; Control-B (set bit n+1 since 0=^@) .entry activate_control_b,^m ;+ ; Here we set the out of band ast. ;- $assign_s devnam=sys_command,chan=channel blbc r0, 10$ movzwl channel,chan ; put channel number into arglist movzwl #,func ; and function code movl #psl$c_exec,p3 ; use exec mode so for priv/no rundwn callg qiolist,g^sys$qiow ; set ast blbc r0, 10$ ; Do NOT deassign the channel... movl #ss$_normal,r0 10$: ret .end control_b