JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 1 V001 31-OCT-1994 12:59:53 SYS$SYSDEVICE:[EVERHART.JT]AXPDEFS.MAR;2 00000001 00000000 1 evax = 1 00000001 00000000 2 alpha=1 00000001 00000000 3 bigpage=1 00000020 00000000 4 addressbits=32 00000001 00000000 5 step2=1 00000000 6 .TITLE JTDmn ;JT driver open daemon & setup program 00000000 7 .IDENT 'V001' 00000000 8 ; Copyright (c) 1994 Glenn C. Everhart. All Rights Reserved. 00000000 9 ;x$$$dt=0 ;knl dbg 00000000 10 ; 00000000 11 ; FACILITY: 00000000 12 ; Provides servicing of security filtering, file moving, and so on 00000000 13 ; for JTdriver. 00000000 14 ; Note: This set of code only connects to JT: units and lets the actual 00000000 15 ; work be done by HOL routines of some sort. 00000000 16 ; Mods: 00000000 17 ; 6/30/94 GCE - support 2K bitmap for kernel-marked files. This will let 00000000 18 ; us mark basically EVERY file with an ACE in kernel mode as well as 00000000 19 ; in ACEs so if someone deletes an ACE it won't drop protection. 00000000 20 ; 00000000 21 ; 00000000 22 ; Note: define VMS$V5 to build for Version 5.x of VMS. 00000001 00000000 23 VMS$V5=1 00000000 24 ; 00000000 25 ; 00000000 26 ; AUTHOR: 00000000 27 ; 00000000 28 ; G. EVERHART 00000000 29 ; 00000000 30 ; 04-Aug-1989 D. HITTNER Cleaned up definitions, added messages 00000000 31 ; 29-Aug-1989 G. Everhart Added more flexible device geometry selection 00000000 32 ; 01-Dec-1993 G. Everhart Build JTdriver misc. daemon 00000000 33 ;-- JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 2 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000000 35 .SBTTL EXTERNAL AND LOCAL DEFINITIONS 00000000 36 00000000 37 .LIBRARY /SYS$SHARE:LIB/ 00000000 38 ; 00000000 39 ; EXTERNAL SYMBOLS 00000000 40 ; 00000000 41 00000000 592 $dyndef X02/002 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/008 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 724 $ADPDEF ;DEFINE ADAPTER CONTROL BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/006 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/316 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/353 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 888 $ATRDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/537 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 957 $CRBDEF ;DEFINE CHANNEL REQUEST BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/276 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/313 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 1534 $DCDEF ;DEFINE DEVICE CLASS X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/1776?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 1583 $DDBDEF ;DEFINE DEVICE DATA BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/216 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/253 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 1629 $ddtdef ;define driver dispatch tbl X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/207 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/244 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 1751 $DEVDEF ;DEFINE DEVICE CHARACTERISTICS X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/411 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 1853 $DPTDEF ;DEFINE DRIVER PROLOGUE TABLE X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/375 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/412 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2037 $DVIDEF ;Symbols for $GETDVI service. X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/597 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2322 $EMBDEF ;DEFINE ERROR MESSAGE BUFFER X03/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/384 ?01T 00000000 .IIF NDF MACRO64$, .CROSS X03/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/294 ?01T 00000000 .IIF NDF MACRO64$, .CROSS X03/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/207 ?01T 00000000 .IIF NDF MACRO64$, .CROSS X03/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/138 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2535 $FABDEF JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 3 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/703 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/740 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2587 $FATDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/220 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/257 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2843 $pcbdef X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/837 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/874 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2875 $acbdef X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/160 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/197 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 2911 $ccbdef X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/177 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/214 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 3150 $FIBDEF ;Symbols for file information block. X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/762 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 3189 $IDBDEF ;DEFINE INTERRUPT DATA BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/186 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/223 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 3681 $IODEF ;DEFINE I/O FUNCTION CODES X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/1521?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 3936 $IRPDEF ;DEFINE I/O REQUEST PACKET X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/834 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/871 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 4107 $NAMDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/577 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/614 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 4365 $PRDEF ;DEFINE PROCESSOR REGISTERS X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/819 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 4641 $RMSDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/865 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 4688 $SBDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/210 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/247 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 4767 $SCSDEF JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 4 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/306 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/343 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 5424 $SSDEF ;DEFINE SYSTEM STATUS CODES X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/2014?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 5461 $STSDEF ;Symbols for returned status. X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/156 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 5489 $TPADEF ;Symbols for LIB$TPARSE calls. X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X02/129 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 6057 $UCBDEF ;DEFINE UNIT CONTROL BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/1773?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/1810?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 6072 $VECDEF ;DEFINE INTERRUPT VECTOR BLOCK X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/114 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/151 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 6093 $XABDEF X02/003 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS X03/059 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X03/127 ?01T 00000000 .iif greater __temp_count, _mtu_validate_keyword X02/164 ?01T 00000000 .IIF NDF MACRO64$, .CROSS 00000000 6094 00000000 6095 ; 00000000 6096 ; UCB OFFSETS WHICH FOLLOW THE STANDARD UCB FIELDS 00000000 6097 ; DEFINE THESE SO WE KNOW WHERE IN THE UCB TO ACCESS. WE MUST 00000000 6098 ; SET THE ONLINE BIT OR CLEAR IT, AND ALSO SET 00000000 6099 ; UCB$HUCB (HOST UCB ADDRESS), UCB$HFSZ (HOST FILE SIZE), 00000000 6100 ; AND UCB$HLBN (HOST LOGICAL BLOCK NUMBER OF FILE START) 00000000 6101 ; 00000000 6102 00000000 6103 $DEFINI UCB ;START OF UCB DEFINITIONS X01/002 ?01T 00000000 .IIF NDF MACRO64$, .NOCROSS 00000000 6104 ;.=UCB$W_BCR+2 ;BEGIN DEFINITIONS AT END OF UCB 00000000 6105 .=UCB$K_LCL_DISK_LENGTH ;v4 def end of ucb 00000114 6106 ; USE THESE FIELDS TO HOLD OUR LOCAL DATA FOR VIRT DISK. 00000114 6107 ; Add our stuff at the end to ensure we don't mess some fields up that some 00000114 6108 ; areas of VMS may want. 00000114 6109 ; Leave thisfield first so we can know all diskswill have it at the 00000114 6110 ; same offset. 00000114 6111 ; 00000114 6112 ; 00000118 6113 $def ucb$l_hucbs .blkl 1 ;host ucb table 00000114 X01/001 ?01T 00000114 .IIF NB,ucb$l_hucbs, ucb$l_hucbs: X01/002 ?01T 00000114 .IIF NB,.blkl, .blkl 1 00000118 6114 ; 00000118 6115 ; Add other fields here if desired. 00000118 6116 ; 0000011C 6117 $def ucb$l_exdmn .blkl 1 ;extend dmn pid 00000118 X01/001 ?01T 00000118 .IIF NB,ucb$l_exdmn, ucb$l_exdmn: X01/002 ?01T 00000118 .IIF NB,.blkl, .blkl 1 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 5 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000120 6118 $def ucb$l_exmbx .blkl 1 ;extend dmn mbx ucb 0000011C X01/001 ?01T 0000011C .IIF NB,ucb$l_exmbx, ucb$l_exmbx: X01/002 ?01T 0000011C .IIF NB,.blkl, .blkl 1 00000124 6119 $def ucb$l_deldmn .blkl 1 ;delete daemon pid 00000120 X01/001 ?01T 00000120 .IIF NB,ucb$l_deldmn, ucb$l_deldmn: X01/002 ?01T 00000120 .IIF NB,.blkl, .blkl 1 00000128 6120 $def ucb$l_delmbx .blkl 1 ;delete dmn mailbox ucb 00000124 X01/001 ?01T 00000124 .IIF NB,ucb$l_delmbx, ucb$l_delmbx: X01/002 ?01T 00000124 .IIF NB,.blkl, .blkl 1 00000128 6121 ; 00000128 6122 ; 0000012C 6123 $def ucb$l_ctlflgs .blkl 1 ;flags to control modes 00000128 X01/001 ?01T 00000128 .IIF NB,ucb$l_ctlflgs, ucb$l_ctlflgs: X01/002 ?01T 00000128 .IIF NB,.blkl, .blkl 1 0000012C 6124 ; 0000012C 6125 ; 00000130 6126 $def ucb$l_prcvec .blkl 1 ;process local data tbl 0000012C X01/001 ?01T 0000012C .IIF NB,ucb$l_prcvec, ucb$l_prcvec: X01/002 ?01T 0000012C .IIF NB,.blkl, .blkl 1 00000134 6127 $def ucb$l_daemon .blkl 1 ;daemon pid for open daemon 00000130 X01/001 ?01T 00000130 .IIF NB,ucb$l_daemon, ucb$l_daemon: X01/002 ?01T 00000130 .IIF NB,.blkl, .blkl 1 00000138 6128 $def ucb$l_mbxucb .blkl 1 ;mailbox for input to daemon 00000134 X01/001 ?01T 00000134 .IIF NB,ucb$l_mbxucb, ucb$l_mbxucb: X01/002 ?01T 00000134 .IIF NB,.blkl, .blkl 1 00000140 6129 $def ucb$l_keycry .blkl 2 ;ucb resident "key" for ACEs 00000138 X01/001 ?01T 00000138 .IIF NB,ucb$l_keycry, ucb$l_keycry: X01/002 ?01T 00000138 .IIF NB,.blkl, .blkl 2 00000140 6130 ;use as part of authenticator 00000140 6131 ;for security-relevant fcns. 00000140 6132 ;auth=f(file id, key, priv-info), match ace and computed 00000140 6133 ;auth tag. 00000144 6134 $def ucb$l_cbtctr .blkl 1 ;how many extents 00000140 X01/001 ?01T 00000140 .IIF NB,ucb$l_cbtctr, ucb$l_cbtctr: X01/002 ?01T 00000140 .IIF NB,.blkl, .blkl 1 00000148 6135 $def ucb$l_cbtini .blkl 1 ;init for counter 00000144 X01/001 ?01T 00000144 .IIF NB,ucb$l_cbtini, ucb$l_cbtini: X01/002 ?01T 00000144 .IIF NB,.blkl, .blkl 1 00000148 6136 ; preceding 2 fields allow specifying of contig-best-try extents 00000148 6137 ; on every Nth extend, not every one. This should still help keep 00000148 6138 ; file extensions from preferentially picking up chaff 00000198 6139 $def ucb$JTcontfil .blkb 80 00000148 X01/001 ?01T 00000148 .IIF NB,ucb$JTcontfil, ucb$JTcontfil: X01/002 ?01T 00000148 .IIF NB,.blkb, .blkb 80 0000019C 6140 $def ucb$l_asten .blkl 1 ;ast enable mask store 00000198 X01/001 ?01T 00000198 .IIF NB,ucb$l_asten, ucb$l_asten: X01/002 ?01T 00000198 .IIF NB,.blkl, .blkl 1 0000019C 6141 ; 000001A0 6142 $DEF ucb$l_minxt .blkl 1 ;min. extent 0000019C X01/001 ?01T 0000019C .IIF NB,ucb$l_minxt, ucb$l_minxt: X01/002 ?01T 0000019C .IIF NB,.blkl, .blkl 1 000001A4 6143 $def ucb$l_maxxt .blkl 1 ;max extent 000001A0 X01/001 ?01T 000001A0 .IIF NB,ucb$l_maxxt, ucb$l_maxxt: X01/002 ?01T 000001A0 .IIF NB,.blkl, .blkl 1 000001A8 6144 $def ucb$l_frac .blkl 1 ;fraction to extend by 000001A4 X01/001 ?01T 000001A4 .IIF NB,ucb$l_frac, ucb$l_frac: X01/002 ?01T 000001A4 .IIF NB,.blkl, .blkl 1 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 6 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 000001AC 6145 $def ucb$l_slop .blkl 1 ;slop blocks to leave free 000001A8 X01/001 ?01T 000001A8 .IIF NB,ucb$l_slop, ucb$l_slop: X01/002 ?01T 000001A8 .IIF NB,.blkl, .blkl 1 000001AC 6146 ; DDT intercept fields 000001AC 6147 ; following must be contiguous. 000001AC 6148 $def ucb$s_ppdbgn ;add any more prepended stuff after this 000001AC X01/001 ?01T 000001AC .IIF NB,ucb$s_ppdbgn, ucb$s_ppdbgn: 000001B0 6149 $def ucb$l_uniqid .blkl 1 ;driver-unique ID, gets filled in 000001AC X01/001 ?01T 000001AC .IIF NB,ucb$l_uniqid, ucb$l_uniqid: X01/002 ?01T 000001AC .IIF NB,.blkl, .blkl 1 000001B0 6150 ; by DPT address for easy following 000001B0 6151 ; by SDA 000001B4 6152 $def ucb$l_intcddt .blkl 1 ; Our interceptor's DDT address if 000001B0 X01/001 ?01T 000001B0 .IIF NB,ucb$l_intcddt, ucb$l_intcddt: X01/002 ?01T 000001B0 .IIF NB,.blkl, .blkl 1 000001B4 6153 ; we are intercepted 000001B8 6154 $def ucb$l_prevddt .blkl 1 ; previous DDT address 000001B4 X01/001 ?01T 000001B4 .IIF NB,ucb$l_prevddt, ucb$l_prevddt: X01/002 ?01T 000001B4 .IIF NB,.blkl, .blkl 1 000001BC 6155 $def ucb$l_icsign .blkl 1 ; unique pattern that identifies 000001B8 X01/001 ?01T 000001B8 .IIF NB,ucb$l_icsign, ucb$l_icsign: X01/002 ?01T 000001B8 .IIF NB,.blkl, .blkl 1 000001BC 6156 ; this as a DDT intercept block 000001BC 6157 ; NOTE: Jon Pinkley suggests that the DDT size should be encoded in part of this 000001BC 6158 ; unique ID so that incompatible future versions will be guarded against. 000001BC 6159 $def ucb$s_ppdend 000001BC X01/001 ?01T 000001BC .IIF NB,ucb$s_ppdend, ucb$s_ppdend: 0000022C 6160 $def ucb$a_vicddt .blkb ddt$k_length 000001BC X01/001 ?01T 000001BC .IIF NB,ucb$a_vicddt, ucb$a_vicddt: X01/002 ?01T 000001BC .IIF NB,.blkb, .blkb ddt$k_length 0000022C 6161 ; space for victim's DDT 0000022C 6162 .blkl 4 ;safety 00000240 6163 $def ucb$l_backlk .blkl 1 ;backlink to victim ucb 0000023C X01/001 ?01T 0000023C .IIF NB,ucb$l_backlk, ucb$l_backlk: X01/002 ?01T 0000023C .IIF NB,.blkl, .blkl 1 00000240 6164 ; Make the "unique magic number" depend on the DDT length, and on the 00000240 6165 ; length of the prepended material. If anything new is added, be sure that 00000240 6166 ; this magic number value changes. F013F070 00000240 6167 magic=^xF013F000 + ddt$k_length + <256*> F013F070 00000240 6168 p.magic=^xF013F000 + ddt$k_length + <256*> 00000800 ?01T 00000240 6169 .iif ndf,f.nsiz,f.nsiz=2048 00000010 ?01T 00000240 6170 .iif ndf,f.nums,f.nums=16 ?01F 00000240 6171 .iif ndf,f.nsiz,f.nsiz=2048 00000240 00000240 6172 ucb$l_fnums: .blkw f.nums ;store for file numbers to inspect whether 00000260 6173 ;an ACE is there or not. 00000268 6174 $DEF UCB$L_JT_HOST_DESCR .BLKL 2 ;host dvc desc. 00000260 X01/001 ?01T 00000260 .IIF NB,UCB$L_JT_HOST_DESCR, UCB$L_JT_HOST_DESCR: X01/002 ?01T 00000260 .IIF NB,.BLKL, .BLKL 2 00000268 6175 ; 00000268 6176 ; Store copy of victim FDT table here for step 2 Alpha driver. 00000268 6177 ; assumes FDT table is 64+2 longs long 00000380 6178 $def ucb$l_myfdt .blkl 70 ;user FDT tbl copy + slop for safety 00000268 X01/001 ?01T 00000268 .IIF NB,ucb$l_myfdt, ucb$l_myfdt: X01/002 ?01T 00000268 .IIF NB,.blkl, .blkl 70 00000384 6179 $def ucb$l_oldfdt .blkl 1 ;fdt tbl of prior fdt chain 00000380 X01/001 ?01T 00000380 .IIF NB,ucb$l_oldfdt, ucb$l_oldfdt: X01/002 ?01T 00000380 .IIF NB,.blkl, .blkl 1 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 7 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000388 6180 $def ucb$l_vict .blkl 1 ;victim ucb, for unmung check 00000384 X01/001 ?01T 00000384 .IIF NB,ucb$l_vict, ucb$l_vict: X01/002 ?01T 00000384 .IIF NB,.blkl, .blkl 1 0000038C 6181 $def ucb$l_mungd .blkl 1 ;munged flag, 1 if numg'd 00000388 X01/001 ?01T 00000388 .IIF NB,ucb$l_mungd, ucb$l_mungd: X01/002 ?01T 00000388 .IIF NB,.blkl, .blkl 1 0000039C 6182 $def ucb$l_exempt .blkl 4 ;exempt PIDs 0000038C X01/001 ?01T 0000038C .IIF NB,ucb$l_exempt, ucb$l_exempt: X01/002 ?01T 0000038C .IIF NB,.blkl, .blkl 4 000003AC 6183 $def ucb$l_exedel .blkl 4 ;PIDs exempt from delete checks only 0000039C X01/001 ?01T 0000039C .IIF NB,ucb$l_exedel, ucb$l_exedel: X01/002 ?01T 0000039C .IIF NB,.blkl, .blkl 4 000003B0 6184 $def ucb$l_ktrln .blkl 1 000003AC X01/001 ?01T 000003AC .IIF NB,ucb$l_ktrln, ucb$l_ktrln: X01/002 ?01T 000003AC .IIF NB,.blkl, .blkl 1 000003B4 6185 $def ucb$l_k2tnm .blkl 1 000003B0 X01/001 ?01T 000003B0 .IIF NB,ucb$l_k2tnm, ucb$l_k2tnm: X01/002 ?01T 000003B0 .IIF NB,.blkl, .blkl 1 000003B6 6186 $DEF UCB$K_JT_LEN .BLKW 1 ;LENGTH OF UCB 000003B4 X01/001 ?01T 000003B4 .IIF NB,UCB$K_JT_LEN, UCB$K_JT_LEN: X01/002 ?01T 000003B4 .IIF NB,.BLKW, .BLKW 1 000003B6 6187 ;UCB$K_JT_LEN=. ;LENGTH OF UCB 00000000 6188 $DEFEND UCB ;END OF UCB DEFINITONS X01/008 ?01T 000003B6 .IIF NDF MACRO64$, .CROSS 00000000 6189 00000000 6190 ; TO SET ONLINE: 00000000 6191 ; BISW #UCB$M_ONLINE,UCB$W_STS(R5) ;SET UCB STATUS ONLINE 00000000 6192 00000000 6193 ; Macro to check return status of system calls. 00000000 6194 ; 00000000 6195 .MACRO ON_ERR THERE,?HERE 00000000 6196 BLBS R0,HERE 00000000 6197 BRW THERE 00000000 6198 HERE: .ENDM ON_ERR 00000000 6199 ; Define LDT offsets here. 00000000 6200 ; This is what encapsulates the I/O during opens (as we read ACLs etc.) 00000000 00000000 6201 ldt$l_fwd = 0 ;forward link. (LDTs are singly linked) 00000004 00000000 6202 ldt$l_ccb = 4 ;CCB address so we can check ID 00000008 00000000 6203 ldt$l_accmd = 8 ;accmd from user FIB (tells how open) 0000000C 00000000 6204 ldt$l_wprv = 12 ;working privs 00000014 00000000 6205 ldt$l_aprv = 20 ;auth privs 0000001C 00000000 6206 ldt$l_bprio = 28 ;process base priority 00000020 00000000 6207 ldt$l_prcstr = 32 ;pointer to per-process delblk count block 00000024 00000000 6208 ldt$l_synch = 36 ;address of "iosb" block used to 00000000 6209 ;end process waits & deallocated at 00000000 6210 ;end of those waits. 00000028 00000000 6211 ldt$l_iosb = 40 ;iosb for internal $qio 00000030 00000000 6212 ldt$l_jtucb = 48 ;pointer to jt: ucb 00000034 00000000 6213 ldt$l_fresiz = 52 ;length of LDT left since we will chop 00000000 6214 ;off unused parts of ACE after we read 00000000 6215 ;it to regain pool 00000000 6216 ; Keep chnucb in "permanent" part of LDT since it hangs around till close 00000000 6217 ; if we do a softlink. It will be zero unless there is a softlink so 00000000 6218 ; it acts as a flag to restore the channel, too. 00000038 00000000 6219 ldt$l_chnucb = 56 ;original channel UCB address 0000003C 00000000 6220 ldt$l_ace = 60 ;start of our ACE, up to 256 bytes long 00000000 6221 ; chop off what's below here, as we need it no more after the file is open. JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 8 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000013C 00000000 6222 ldt$l_regs = 316 ;register save, r0 to r15 00000174 00000000 6223 ldt$l_flgs = 372 ;slop storage for flags 00000178 00000000 6224 ldt$l_parm = 376 ;storage for up to 6 params (6 longs) 00000190 00000000 6225 ldt$l_fib = 400 ;FIB we use for OUR I/O 00000000 6226 ; 72 bytes max for our FIB 000001D8 00000000 6227 ldt$l_acl = 472 ;storage for ACL read-in; 512 bytes 000003D8 00000000 6228 ldt$l_itmlst = 984 ;item list to read the ACL all in if 00000000 6229 ;we can. 000003F8 00000000 6230 ldt$l_aclsiz = 1016 ;size of the ACL on the file 000003FC 00000000 6231 ldt$l_rtnsts = 1020 ;status back from daemon 00000404 00000000 6232 ldt$l_myfid = 1028 ;file id from read-acl call 0000040C 00000000 6233 ldt$l_mydid = 1036 ;dir id in user's fib 00000414 00000000 6234 ldt$l_psl = 1044 ;psl of original i/o 0000041C 00000000 6235 ldt$l_fnd = 1052 ;filename desc of orig i/o (p2 arg) 00000000 6236 ;2 longs 00000424 00000000 6237 ldt$l_fndd = 1060 ;data area for filename (256 bytes) 0000052C 00000000 6238 ldt$l_size = 1324 00000528 00000000 6239 ldt$k_clrsiz = 1320 ;allocate a little slop. 00000000 6240 00000000 6241 ; ACE format: 00000000 6242 ;ace: .byte length 00000000 6243 ; .byte type = ace$c_info ;application ACE 00000000 6244 ; .word flags ;stuff like hidden, protected... 00000000 6245 ; .long info-flags ;use 1 bit to mean call the daemon 00000000 6246 ; .ascii /GCEV/ ;my identifier 00000000 6247 ; .blkb data ;up to 244 bytes of data. 00000000 6248 00000000 6249 ; data is a variable length list of stuff. 00000000 6250 ; Codes are as follows: 00000000 6251 ; 00 - nothing. Terminates list. 00000000 6252 ; 01 - starts "inspectme" record. Nothing more. We send FID from the LDT 00000000 6253 ; in this case. This makes these real fast to forge. 00000000 6254 ; 02 - "moveme" record. Again we send FID from LDT and need nothing more. 00000000 6255 ; We use info from the daemon to find the actual file based 00000000 6256 ; on the file ID here. 00000000 6257 ; 03 - "bprio" record. Format: 00000000 6258 ; 03, prio, ;total 6 bytes 00000000 6259 ; 04 - "priv" record. Format: 00000000 6260 ; 04, ;total 17 bytes 00000000 6261 ; 05 - "ident" record, format: 00000000 6262 ; 05, ;total 17 bytes 00000000 6263 ; 06 - "softlink" record, format: 00000000 6264 ; 06, len, flgs, ;variable len 00000000 6265 ; flags for softlinks: 00000000 6266 ; 0 = normal 00000000 6267 ; 1 = softlink only on read, act like moveme record if r/w open 00000000 6268 ; 2 = directory file softlink, pass to daemon for special 00000000 6269 ; handling so we can pull the dir in. 00000000 6270 ; more flags later as I think of them. 00000000 6271 ; more types as needed too. 00000000 6272 00000000 6273 ; 00000000 6274 ; 00000000 6275 ; 00000000 6276 .PSECT ADVDD_DATA,RD,WRT,NOEXE,LONG 00000000 6277 ; 00000000 6278 sj_arg: JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 9 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000000 6279 .LONG 2 ;2 ARGS: HOST-DVC NAME, VD DVC NAME 00000004 6280 .ADDRESS DEV_BUF_DESC 00000008 6281 .ADDRESS VDV_BUF_DESC 0000000C 6282 0000000C 6283 ; KERNEL ARG LIST 0000000C 6284 ; 0000000C 6285 lla: .long 1 00000010 6286 .address gotit 00000014 6287 gotit: .long 0 00000018 6288 K_ARG: 00000018 6289 .LONG 4 ;4 ARGS: HOST-DVC NAME, VD DVC NAME 0000001C 6290 .ADDRESS DEV_BUF_DESC 00000020 6291 .ADDRESS VDV_BUF_DESC 00000024 6292 .address mbx_buf_desc 00000028 6293 .address shfnm ;shared JT device name 0000002C 6294 ; .ADDRESS DDFNM 0000002C 6295 ; .ADDRESS VDFNM 0000002C 6296 swpal: .long 2 00000030 6297 .long 0,0 00000038 6298 DEFAULT_DEVICE: 00000038 6299 .ASCID /SYS$DISK/ 00000048 6300 00000048 6301 .ALIGN LONG 00000048 6302 mbx_BUF: ; Buffer to hold mbxice name. 00000048 6303 .BLKB 40 00000028 00000070 6304 mbx_BUF_SIZ = . - mbx_BUF 00000070 6305 00000070 6306 mbx_BUF_DESC: ; Descriptor pointing to mbxice name. 00000070 6307 .LONG mbx_BUF_SIZ 00000074 6308 .ADDRESS mbx_BUF 00000078 6309 00000078 6310 mPID: ; Owner of mbxice (if any). 00000078 6311 .BLKL 1 0000007C 6312 0000007C 6313 lpct: .long 0 ;scratch 00000080 6314 00000080 6315 dvl: .long 0 00000084 6316 DESBLK: 00000084 6317 .LONG 0 00000088 6318 .ADDRESS XITHDL ;EXIT HANDLER ADDRESS 0000008C 6319 .long 0 00000090 6320 .address dvl 00000094 6321 .LONG 0,0 ;REST OF EXIT HANDLER CONTROL BLK 0000009C 6322 mbx_ITEM_LIST: ; mbxice list for $GETDVI. 0000009C 6323 .WORD mbx_BUF_SIZ ; Make sure we a have a physical device name. 0000009E 6324 .WORD DVI$_DEVNAM 000000A0 6325 .ADDRESS mbx_BUF 000000A4 6326 .ADDRESS mbx_BUF_DESC 000000A8 6327 .WORD 4 ; See if someone has this device allocated. 000000AA 6328 .WORD DVI$_PID 000000AC 6329 .ADDRESS mPID 000000B0 6330 .LONG 0 000000B4 6331 .WORD 4 000000B6 6332 .WORD DVI$_DEVCLASS ; Check for a terminal. 000000B8 6333 .ADDRESS mbx_CLASS 000000BC 6334 .LONG 0 000000C0 6335 .LONG 0 ; End if item list. JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 10 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 000000C4 6336 000000C4 6337 mbx_CLASS: 000000C4 6338 .LONG 1 000000C8 6339 ioprog: .long 0 ;i/o in progress flag 000000CC 6340 nedast: .long 0 ;need skast flg 000000D0 6341 mbchn: .long 0 ;chnl for mailbox to jtdriver 000000D4 6342 vchn: .long 0 ;chnl used to open dvc 000000D8 6343 nlchn: .long 0 000000DC 6344 nlucb: .long 0 000000E0 6345 nlccb: .long 0 000000E4 6346 iosb: .long 0,0 000000EC 6347 xxiosb: .long 0,0 000000F4 6348 IOSTATUS: .BLKQ 1 000000FC 6349 BUFG: .long 1 ;bash flag 00000100 6350 .long 1000 ; 00000104 6351 DEV_BUF: ; Buffer to hold device name. 00000104 6352 .BLKB 40 00000028 0000012C 6353 DEV_BUF_SIZ = . - DEV_BUF 00000030 0000012C 6354 busz=.-bufg 0000012C 6355 DEV_BUF_DESC: ; Descriptor pointing to device name. 0000012C 6356 .LONG DEV_BUF_SIZ 00000130 6357 .ADDRESS DEV_BUF 00000134 6358 00000134 6359 PID: ; Owner of device (if any). 00000134 6360 .BLKL 1 00000138 6361 00000138 6362 DEV_ITEM_LIST: ; Device list for $GETDVI. 00000138 6363 .WORD DEV_BUF_SIZ ; Make sure we a have a physical device name. 0000013A 6364 .WORD DVI$_DEVNAM 0000013C 6365 .ADDRESS DEV_BUF 00000140 6366 .ADDRESS DEV_BUF_DESC 00000144 6367 .WORD 4 ; See if someone has this device allocated. 00000146 6368 .WORD DVI$_PID 00000148 6369 .ADDRESS PID 0000014C 6370 .LONG 0 00000150 6371 .WORD 4 00000152 6372 .WORD DVI$_DEVCLASS ; Check for a terminal. 00000154 6373 .ADDRESS DEV_CLASS 00000158 6374 .LONG 0 0000015C 6375 .LONG 0 ; End if item list. 00000160 6376 00000160 6377 DEV_CLASS: 00000160 6378 .LONG 1 00000164 6379 ;** 00000164 6380 vbufg: .long 2 ;deassign bash flag. Deassign victim dvc, not JT: dvc. 00000168 6381 .long 1000 0000016C 6382 VDV_BUF: ; Buffer to hold VDVice name. 0000016C 6383 .BLKB 40 00000028 00000194 6384 VDV_BUF_SIZ = . - VDV_BUF 00000030 00000194 6385 vbusz=.-vbufg 00000194 6386 VDV_BUF_DESC: ; Descriptor pointing to VDVice name. 00000194 6387 .LONG VDV_BUF_SIZ 00000198 6388 .ADDRESS VDV_BUF 0000019C 6389 0000019C 6390 VPID: ; Owner of VDVice (if any). 0000019C 6391 .BLKL 1 000001A0 6392 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 11 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 000001A0 6393 VDV_ITEM_LIST: ; VDVice list for $GETDVI. 000001A0 6394 .WORD VDV_BUF_SIZ ; Make sure we a have a physical device name. 000001A2 6395 .WORD DVI$_DEVNAM 000001A4 6396 .ADDRESS VDV_BUF 000001A8 6397 .ADDRESS VDV_BUF_DESC 000001AC 6398 .WORD 4 ; See if someone has this device allocated. 000001AE 6399 .WORD DVI$_PID 000001B0 6400 .ADDRESS VPID 000001B4 6401 .LONG 0 000001B8 6402 .WORD 4 000001BA 6403 .WORD DVI$_DEVCLASS ; Check for a terminal. 000001BC 6404 .ADDRESS VDV_CLASS 000001C0 6405 .LONG 0 000001C4 6406 .LONG 0 ; End if item list. 000001C8 6407 000001C8 6408 VDV_CLASS: 000001C8 6409 .LONG 1 000001CC 6410 ;** 000001CC 6411 DEFNAM: 000001CC 6412 000001CC 6413 WRK: .BLKL 1 ;SCRATCH INTEGER 000001D0 6414 ; DESCRIPTOR FOR VDn: "FILENAME" 000001D0 6415 .ALIGN LONG 000001D0 6416 VDFNM: .WORD 255. ;LENGTH 000001D2 6417 VDFTP: .BYTE DSC$K_DTYPE_T ;TEXT TYPE 000001D3 6418 .BYTE 1 ; STATIC STRING 000001D4 6419 .ADDRESS VDFNMD 000001D8 6420 VDFNMD: .BLKB 256. ; DATA AREA 000002D8 6421 .align long 000002D8 6422 wrkstr: .word 20 ;length 000002DA 6423 .byte dsc$k_dtype_t ;text 000002DB 6424 .byte 1 ;static 000002DC 6425 .address wrkdat 000002E0 6426 wrkdat: .blkb 20 000002F4 6427 .byte 0,0,0,0 ;safety 000002F8 6428 ; 000002F8 6429 ; DESCRIPTOR FOR NODE$FWAN: DEVICE NAME 000002F8 6430 .ALIGN LONG 000002F8 6431 DDFNM: .WORD 255. ;LENGTH 000002FA 6432 DDFTP: .BYTE DSC$K_DTYPE_T ;TEXT TYPE 000002FB 6433 .BYTE 1 ; STATIC STRING 000002FC 6434 DDFNA: .ADDRESS DDFNMD 00000300 6435 DDFNMD: .BLKB 256. ; DATA AREA 00000400 6436 DDCHN: .LONG 0 00000404 6437 VDCHN: .LONG 0 ;CHANNEL HOLDERS 00000408 6438 P1DSC: .ASCID /UNIT/ 00000414 6439 P2DSC: .ASCID /FNAM/ 00000420 6440 frcdsc: .ascid /FRACTION/ ;fract. of file to extend by 00000430 6441 minds: .ascid /MINIMUM/ ;min extent 0000043F 6442 maxds: .ascid /MAXIMUM/ ;max extent 0000044E 6443 adods: .ascid /ALDEFONLY/ ;default-ext. mod only 0000045F 6444 deads: .ascid /DEASSIGN/ ;deassign JT: from disk (turn off) 0000046F 6445 cbtds: .ascid /CBT/ 0000047A 6446 fcnds: .ascid /FCNMSK/ ;function control mask 00000488 6447 modds: .ascid /MODE/ 00000494 6448 shrdsc: .ascid /SHARE/ 000004A1 6449 fnumds: .ascid /FILENUM/ ;file number to tag in knl mode JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 12 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 000004B0 6450 ;(/filenum:fil.num) reads a list of 000004B0 6451 ; file numbers off a separate file.) 000004B0 6452 efnmds: .ascid /EXEMPT/ ; files exempt from EACF controls if 000004BE 6453 ; seen as current image 000004BE 6454 ; efnmds=sw name. exfnm, exfnd, exfnl=filename 000004BE 6455 keyds: .ascid /KEY/ 000004C9 6456 mfyds: .ascid /MODIFY/ ;switch NOT to loop,just change params 000004D7 6457 nldsc: .ascid /NLA0:/ 000004E4 6458 .align long 000004E4 6459 ; DESCRIPTOR FOR exempt file-of-filenames 000004E4 6460 EXFNM: .WORD 255 000004E6 6461 .BYTE DSC$K_DTYPE_T,1 000004E8 6462 .ADDRESS EXFND 000004EC 6463 EXFND: .BLKB 256 000005EC 6464 EXFNL: .LONG 0 000005F0 6465 ; DESCRIPTOR FOR filenum file 000005F0 6466 RWFNM: .WORD 255 000005F2 6467 .BYTE DSC$K_DTYPE_T,1 000005F4 6468 .ADDRESS RWFND 000005F8 6469 RWFND: .BLKB 256 000006F8 6470 RWFNL: .LONG 0 ?01F 000006FC 6471 .iif ndf,f.nums,f.nums=16 ?01F 000006FC 6472 .iif ndf,f.nsiz,f.nsiz=2048 ;bytes of mask ?01F 000006FC 6473 .iif df,wd.lst,f.nsiz=f.nums*2 00000400 000006FC 6474 maxnums=f.nsiz/2 000006FC 6475 fnmx: .long maxnums 00000700 6476 fnums: .blkw maxnums ;storage for file numbers 00000F00 6477 fnumct: .long 0 ;no. filenums in store 00000F04 6478 fn.arg: .long 4 ;4 args 00000F08 6479 .address rwfnm ;rw filename arg 00000F0C 6480 .address fnums ;storage for file numbers 00000F10 6481 .address fnmx ;size of file number array 00000F14 6482 .address fnumct ;output count nums added 00000F18 6483 ; share dvc desc. 00000F18 6484 shfnm: .word 255 00000F1A 6485 .BYTE DSC$K_DTYPE_T,1 00000F1C 6486 .address shfnd 00000F20 6487 shfnd: .blkb 256 00001020 6488 shfnl: .long 0 00001024 6489 ; UCB data area 00001024 6490 shrflg: .long 0 ;share flag, nonzero if using another JT data 00001028 6491 shucb: .long 0 ;shared jt ucb 0000102C 6492 fcnmsk: .long 0 00001030 6493 modmsk: .long 0 ;mode selection 00001034 6494 deafg: .long 0 00001038 6495 cbtct: .long 1 ;/cbt:n contig best tries every n opens 0000103C 6496 frac: .long 3 00001040 6497 min: .long 10 00001044 6498 max: .long 2000 00001048 6499 adflg: .long 0 ;set flg if aldef only 0000104C 6500 HSTUCB: .LONG 0 ;SERVED UCB ADDRESS 00001050 6501 VDUCB: .LONG 0 ;LOCAL JT UCB ADDRESS 00001054 6502 mbxucb: .long 0 ;mailbox ucb storage 00001058 6503 mfyflg: .long 0 0000105C 6504 ; 0000105C 6505 ; 0000105C 6506 ERROR: .LONG 2 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 13 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00001060 6507 MESS: .LONG SS$_ABORT 00001064 6508 .LONG 0 00001068 6509 kyfnm: .word 255 0000106A 6510 .byte dsc$k_dtype_t,1 0000106C 6511 .address kyfnmd 00001070 6512 kyfnmd: .blkl 64 00001170 6513 binkey: .long 0,0 ;binary key val for jt ucb 00001178 6514 .macro beqlw lbl,?lbl2 00001178 6515 bneq lbl2 00001178 6516 brw lbl 00001178 6517 lbl2: 00001178 6518 .endm 00001178 6519 .macro bneqw lbl,?lbl2 00001178 6520 beql lbl2 00001178 6521 brw lbl 00001178 6522 lbl2: 00001178 6523 .endm 00001178 6524 .macro bgtrw lbl,?lbl2 00001178 6525 bleq lbl2 00001178 6526 brw lbl 00001178 6527 lbl2: 00001178 6528 .endm 00001178 6529 .macro bleqw lbl,?lbl2 00001178 6530 bgtr lbl2 00001178 6531 brw lbl 00001178 6532 lbl2: 00001178 6533 .endm 00001178 6534 .macro bgeqw lbl,?lbl2 00001178 6535 blss lbl2 00001178 6536 brw lbl 00001178 6537 lbl2: 00001178 6538 .endm 00001178 6539 ; allocate does not zero its result area. 00001178 6540 .macro zapz addr,size 00001178 6541 pushr #^m ;save regs from movc5 00001178 6542 movc5 #0,addr,#0,size,addr 00001178 6543 popr #^m ;save regs from movc5 00001178 6544 .endm ?01F 00001178 6545 .if ndf,evax ?01F 00001178 6546 .macro .jsb_entry ?01F 00001178 6547 ; entry ?01F 00001178 6548 .endm ?01F 00001178 6549 .endc 00001178 6550 BUFHDR: .LONG 0,0,0,0,0 0000118C 6551 BUF: .BLKL 8192. ; DATA AREA 0000918C 6552 gcelit: .ascii /GCEV/ ;special literal 00009190 6553 rtnst: .long 0 ;return status 00009194 6554 ainbf: .blkb 4 ;hdr here 00009198 6555 .blkl 1 ;my "call dmn" flg or 0 0000919C 6556 gcetgt: .long 0 ;will be "GCEV" for my ACEs 000091A0 6557 .blkl 224 ;data 00009520 6558 .blkl 8 ;safety 00009540 6559 fid: .long 0,0 ;file id scratch storage 00009548 6560 ; scratch FIB to read acl with an entry at a time 00009548 6561 myfib: .long 0000954C 6562 fibfid: .blkw 3 ;fid 00009552 6563 fibdid: .blkw 3 ;did JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 14 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00009558 6564 fibctx: .long 0 ;wc context 0000955C 6565 .long 0 ;nmctl/exctl 00009560 6566 .long 0,0,0,0,0,0 00009578 6567 fibacx: .long 0 ;acl context 0000957C 6568 fibast: .long 0 ;acl status 00009580 6569 fibgst: .long 0 ;status 0000003A 00009584 6570 myfibl=.-myfib-2 ;size 00009584 6571 ; descriptors for io$_access 00009584 6572 mf3tp1: .word 255 00009586 6573 .word atr$c_addaclent 00009588 6574 .globl myfdsc 00009588 6575 myfdsc: 00009588 6576 mfdsc: .long myfibl 0000958C 6577 .address myfib ;open by file id 00009590 6578 ; Itemlist to get old ace, delete it, add replacement one. 00009590 6579 myil3: .word 255 ;length of itemlist item 00009592 6580 .word atr$c_fndacetyp ;find ace 00009594 6581 .address uace ;of our type 00009598 6582 myin2: .word 255 0000959A 6583 .word atr$c_delaclent ;delete an acl entry... 0000959C 6584 .address uace ;namely the old one 000095A0 6585 ; locs to zero if the ace is empty now (0 in byte 16) 000095A0 6586 mf3b1: .word 255 000095A2 6587 .word atr$c_addaclent ;add new ace 000095A4 6588 mf3b2: .address mdace ;modified ace 000095A8 6589 .long 0,0 ;null terminate the list 000095B0 6590 .long 0 000095B4 6591 uace: .blkb 256 ;copy of our ACE 000096B4 6592 mdace: .blkb 256 000097B4 6593 fibwrk: .blkl 32 00009834 6594 fibdsc: .long 128 00009838 6595 .address fibwrk 0000983C 6596 namdsc: .long 0 00009840 6597 .address namtxt 00009844 6598 namtxt: .blkl 64 ; text of filename 00009944 6599 .PSECT ADVDD_CODE,RD,NOWRT,EXE,LONG 00000000 6600 .ENTRY ADVDD,^M 00000002 6601 clrl adflg 00000008 6602 clrl deafg ;not deassign 0000000E 6603 movl #1,cbtct ;contig best try every time 00000015 6604 movl #4,frac 0000001C 6605 movl #10,min 00000023 6606 movl #2000,max 0000002E 6607 pushab deads 00000034 6608 calls #1,g^cli$present 0000003B 6609 cmpl r0,#cli$_present ;there? 00000042 6610 bneq 100$ 00000044 6611 incl deafg 0000004A 6612 100$: 0000004A 6613 ; Only emit the licensing msg once per boot. 0000004A 6614 callg lla,g^loglatch 00000055 6615 tstl gotit 0000005B 6616 bneq 1105$ ?01T 0000005D 6617 .iif ndf,nolic, calls #0,g^licmsg ;emit the user-licensed msg 00000064 6618 1105$: clrl fnumct ;set no filenums yet 0000006A 6619 pushab fnumds ;/filenum:file seen 00000070 6620 calls #1,g^cli$present JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 15 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000077 6621 cmpl r0,#cli$_present ;was switch there? 0000007E 6622 bneq 82$ 00000080 6623 pushab rwfnl ;ret length longword 00000086 6624 pushab rwfnm ;scratch string 0000008C 6625 pushab fnumds ;get value of filename 00000092 6626 calls #3,g^cli$get_value ;get value of lbn 0000009F 6627 on_err fdhostd_Exit ;skip on error X01/001 00000099 BLBS R0,30000$ X01/002 0000009C BRW fdhostd_Exit X01/003 0000009F 30000$: 0000009F 6628 ; now rwfnm has value 0000009F 6629 movw rwfnl,rwfnm ;set string length ?01F 000000AA 6630 .if df,wd.lst ?01F 000000AA 6631 callg fn.arg,g^getfnm ;go get the number list ?01T 000000AA 6632 .iff ?01T 000000AA 6633 callg fn.arg,g^getfnb ;go get the number list ?01T 000000B5 6634 .endc 000000B5 6635 ; 000000B5 6636 82$: 000000B5 6637 ; efnmds=sw name. exfnm, exfnd, exfnl=filename 000000B5 6638 pushab efnmds ;/exempt:file seen 000000BB 6639 calls #1,g^cli$present 000000C2 6640 cmpl r0,#cli$_present ;was switch there? 000000C9 6641 bneq 182$ 000000CB 6642 pushab exfnl ;ret length longword 000000D1 6643 pushab exfnm ;scratch string 000000D7 6644 pushab efnmds ;get value of filename 000000DD 6645 calls #3,g^cli$get_value ;get value of lbn 000000EA 6646 on_err fdhostd_Exit ;skip on error X01/001 000000E4 BLBS R0,30001$ X01/002 000000E7 BRW fdhostd_Exit X01/003 000000EA 30001$: 000000EA 6647 ; now rwfnm has value 000000EA 6648 movw exfnl,exfnm ;set string length 000000F5 6649 pushab exfnm ;push filename descriptor 000000FB 6650 calls #1,g^getexf ;go load exempt filenames (if any) 00000102 6651 ; 00000102 6652 182$: 00000102 6653 clrl shrflg 00000108 6654 pushab shrdsc ;/share:jtan: given? 0000010E 6655 calls #1,g^cli$present 00000115 6656 cmpl r0,#cli$_present ;was switch there? 0000011C 6657 bneq 821$ 0000011E 6658 pushab shfnl 00000124 6659 pushab shfnm 0000012A 6660 pushab shrdsc 00000130 6661 calls #3,g^cli$get_value ;get value of lbn 0000013D 6662 on_err fdhostd_Exit ;skip on error X01/001 00000137 BLBS R0,30002$ X01/002 0000013A BRW fdhostd_Exit X01/003 0000013D 30002$: 0000013D 6663 movw shfnl,shfnm 00000148 6664 incl shrflg ;say we got switch now. 0000014E 6665 821$: 0000014E 6666 ; contig best try 0000014E 6667 pushab cbtds ;/cbt:nnn contig best try open every n tries 00000154 6668 calls #1,g^cli$present JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 16 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000015B 6669 cmpl r0,#cli$_present ;there? 00000162 6670 bneq 320$ 00000164 6671 pushab wrk ;ret len 0000016A 6672 pushab wrkstr ;string 00000170 6673 pushab cbtds 00000176 6674 calls #3,g^cli$get_value 0000017D 6675 blbc r0,320$ 00000180 6676 pushl #17 ;ign. blanks 00000182 6677 pushl #4 ;4 byte result 00000184 6678 pushab cbtct ;result in "cbtct" 0000018A 6679 pushab wrkstr ;string 00000190 6680 calls #4,g^ots$cvt_tu_l ;convert to bin 00000197 6681 blbs r0,321$ 0000019A 6682 322$: movl #1,cbtct ;default val. if err 000001A1 6683 brb 320$ 000001A3 6684 321$: 000001A3 6685 tstl cbtct ;chk lims 000001A9 6686 bleq 322$ 000001AB 6687 cmpl min,#1000 ;max 1000 too 000001B6 6688 bgtr 322$ 000001B8 6689 320$: 000001B8 6690 ; get key value if any. 000001B8 6691 clrq binkey 000001BE 6692 clrl kyfnmd ;zero key info at first 000001C4 6693 pushab keyds ;/key seen? 000001CA 6694 calls #1,g^cli$present 000001D1 6695 cmpl r0,#cli$_present ;got it? 000001D8 6696 bneq 3220$ ;br if not 000001DA 6697 pushab wrk ;key len 000001E0 6698 pushab kyfnm ;key string loc 000001E6 6699 pushab keyds ;and /key select 000001EC 6700 calls #3,g^cli$get_value 000001F3 6701 movw wrk,kyfnm ;save length in string 000001FE 6702 pushab binkey+4 00000204 6703 pushab binkey 0000020A 6704 pushab wrk 00000210 6705 pushab kyfnm 00000216 6706 calls #4,g^getpv ;compute the key 0000021D 6707 3220$: 0000021D 6708 ;/aldefonly 0000021D 6709 pushab adods ;/aldefonly? 00000223 6710 calls #1,g^cli$present 0000022A 6711 cmpl r0,#cli$_present ;there? 00000231 6712 bneq 10$ 00000233 6713 incl adflg 00000239 6714 10$: 00000239 6715 pushab frcdsc ;/frac:n (n = 1 to 1000 ok) 0000023F 6716 calls #1,g^cli$present 00000246 6717 cmpl r0,#cli$_present ;there? 0000024D 6718 bneq 20$ 0000024F 6719 pushab wrk ;ret len 00000255 6720 pushab wrkstr ;string 0000025B 6721 pushab frcdsc ;/frac: desc 00000261 6722 calls #3,g^cli$get_value 00000268 6723 blbc r0,20$ 0000026B 6724 pushl #17 ;ign. blanks 0000026D 6725 pushl #4 ;4 byte result JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 17 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000026F 6726 pushab frac ;result in "frac" 00000275 6727 pushab wrkstr ;string 0000027B 6728 calls #4,g^ots$cvt_tu_l ;convert to bin 00000282 6729 blbs r0,21$ 00000285 6730 22$: movl #4,frac ;return frac=1/4 if error 0000028C 6731 brb 20$ 0000028E 6732 21$: 0000028E 6733 tstl frac ;chk lims 00000294 6734 bleq 22$ 00000296 6735 cmpl frac,#1000 000002A1 6736 bgtr 22$ 000002A3 6737 20$: 000002A3 6738 pushab fcnds ;/fcnmsk:nnnnnn 000002A9 6739 calls #1,g^cli$present 000002B0 6740 cmpl r0,#cli$_present ;there? 000002B7 6741 bneq 721$ 000002B9 6742 pushab wrk ;ret len 000002BF 6743 pushab wrkstr ;string 000002C5 6744 pushab fcnds ;/fcnmsk:mask 000002CB 6745 calls #3,g^cli$get_value 000002D2 6746 blbc r0,721$ 000002D5 6747 pushl #17 ;ign. blanks 000002D7 6748 pushl #4 ;4 byte result 000002D9 6749 pushab fcnmsk ;result in fcnmsk 000002DF 6750 pushab wrkstr ;string 000002E5 6751 calls #4,g^ots$cvt_tu_l ;convert to bin 000002EC 6752 blbs r0,721$ 000002EF 6753 722$: clrl fcnmsk ;zero mask if none seen 000002F5 6754 721$: 000002F5 6755 clrl mfyflg 000002FB 6756 pushab mfyds ;/modify 00000301 6757 calls #1,g^cli$present 00000308 6758 cmpl r0,#cli$_present ;there? 0000030F 6759 bneq 6721$ 00000311 6760 incl mfyflg 00000317 6761 6721$: 00000317 6762 ; get mode mask as a bunch of bits. 00000317 6763 clrl modmsk 0000031D 6764 pushab modds ;/mode:nnnnnn 00000323 6765 calls #1,g^cli$present 0000032A 6766 cmpl r0,#cli$_present ;there? 00000331 6767 bneq 3721$ 00000333 6768 pushab wrk ;ret len 00000339 6769 pushab wrkstr ;string 0000033F 6770 pushab modds ;/mode:nnnnn 00000345 6771 calls #3,g^cli$get_value 0000034C 6772 blbc r0,3721$ 0000034F 6773 pushl #17 ;ign. blanks 00000351 6774 pushl #4 ;4 byte result 00000353 6775 pushab modmsk ;result in modmsk 00000359 6776 pushab wrkstr ;string 0000035F 6777 calls #4,g^ots$cvt_tu_l ;convert to bin 00000366 6778 blbs r0,3721$ 00000369 6779 3722$: clrl modmsk ;zero mask if none seen 0000036F 6780 3721$: 0000036F 6781 0000036F 6782 ; min JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 18 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000036F 6783 pushab minds ;/min:nnn min alloc to use 00000375 6784 calls #1,g^cli$present 0000037C 6785 cmpl r0,#cli$_present ;there? 00000383 6786 bneq 120$ 00000385 6787 pushab wrk ;ret len 0000038B 6788 pushab wrkstr ;string 00000391 6789 pushab minds 00000397 6790 calls #3,g^cli$get_value 0000039E 6791 blbc r0,120$ 000003A1 6792 pushl #17 ;ign. blanks 000003A3 6793 pushl #4 ;4 byte result 000003A5 6794 pushab min ;result in "min" 000003AB 6795 pushab wrkstr ;string 000003B1 6796 calls #4,g^ots$cvt_tu_l ;convert to bin 000003B8 6797 blbs r0,121$ 000003BB 6798 122$: movl #10,min ;return min=10 if err 000003C2 6799 brb 120$ 000003C4 6800 121$: 000003C4 6801 tstl min ;chk lims 000003CA 6802 bleq 122$ 000003CC 6803 cmpl min,#1000 ;max 1000 too 000003D7 6804 bgtr 122$ 000003D9 6805 120$: 000003D9 6806 ; max 000003D9 6807 clrl max 000003DF 6808 pushab maxds ;/max:nnn max alloc to use 000003E5 6809 calls #1,g^cli$present 000003EC 6810 cmpl r0,#cli$_present ;there? 000003F3 6811 bneq 220$ 000003F5 6812 pushab wrk ;ret len 000003FB 6813 pushab wrkstr ;string 00000401 6814 pushab maxds 00000407 6815 calls #3,g^cli$get_value 0000040E 6816 blbc r0,220$ 00000411 6817 pushl #17 ;ign. blanks 00000413 6818 pushl #4 ;4 byte result 00000415 6819 pushab max ;result in "max" 0000041B 6820 pushab wrkstr ;string 00000421 6821 calls #4,g^ots$cvt_tu_l ;convert to bin 00000428 6822 blbs r0,221$ 0000042B 6823 222$: clrl max ;return max=10000 if err 00000431 6824 ; max=0 means 1/32 of disk size. 00000431 6825 brb 220$ 00000433 6826 221$: 00000433 6827 tstl max ;chk lims 00000439 6828 bleq 222$ 0000043B 6829 cmpl max,#1000000 ;max 1000000 too 00000446 6830 bgtr 222$ 00000448 6831 220$: 00000448 6832 PUSHAB WRK ;PUSH LONGWORD ADDR FOR RETLENGTH 0000044E 6833 PUSHAB VDFNM ;ADDRESS OF DESCRIPTOR TO RETURN 00000454 6834 PUSHAB P1DSC ; GET P1 (FDn: UNIT) 0000045A 6835 CALLS #3,G^CLI$GET_VALUE ;GET VALUE OF NAME TO VDFNM 00000467 6836 ON_ERR ADVDD_EXIT X01/001 00000461 BLBS R0,30003$ X01/002 00000464 BRW ADVDD_EXIT X01/003 00000467 30003$: JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 19 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000467 6837 ; tstl deafg ;/deas? no need for 2nd file 00000467 6838 ; bneq 40$ 00000467 6839 PUSHAB WRK ; GET 2ND FILE (served unit) 0000046D 6840 PUSHAB DDFNM ; & ITS DESCRIPTOR 00000473 6841 PUSHAB P2DSC ; & PARAMETER NAME 'P2' 00000479 6842 CALLS #3,G^CLI$GET_VALUE ; GET FNM 00000486 6843 ON_ERR ADVDD_EXIT X01/001 00000480 BLBS R0,30004$ X01/002 00000483 BRW ADVDD_EXIT X01/003 00000486 30004$: 00000486 6844 $ASSIGN_S - ; Get a channel to the 00000486 6864 DEVNAM=DDFNM,- ; device for host file 0000049B 6911 CHAN=DDCHN X02/008 ?01T 00000486 CLRQ -(SP) X02/029 ?01T 00000488 PUSHAB DDCHN X02/061 ?01T 0000048E PUSHAB DDFNM X01/064 00000494 CALLS #$$T2,G^SYS$ASSIGN 000004A1 6912 ON_ERR ADVDD_EXIT X01/001 0000049B BLBS R0,30005$ X01/002 0000049E BRW ADVDD_EXIT X01/003 000004A1 30005$: 000004A1 6913 ; LET ERRORS BY FOR THIS SINCE WE GET OUR INFO VIA OPEN ANYWAY SO 000004A1 6914 ; CHANNEL REALLY DOESN'T HAVE TO BE THERE. 000004A1 6915 ; Get the physical device name, and see if this device has an owner. 000004A1 6916 ; (We must do this so we can get the host UCB address) 000004A1 6917 $GETDVI_S - 000004A1 6930 CHAN=ddchn,- ; Command line has device name. 000004BF 6931 ITMLST=DEV_ITEM_LIST X02/010 ?01T 000004A1 CLRQ -(SP) X02/018 ?01T 000004A3 PUSHL #0 X02/050 ?01T 000004A5 PUSHL #0 X02/109 ?01T 000004A7 PUSHAB DEV_ITEM_LIST X02/114 ?01T 000004AD PUSHL #0 X01/144 000004AF MOVZWL ddchn,-(SP) X01/145 000004B6 PUSHL #0 X01/146 000004B8 CALLS #8,G^SYS$GETDVI 000004BF 6932 BLBS R0,40$ 000004C2 6933 BRW advdd_EXIT 000004C5 6934 40$: 000004C5 6935 290$: 000004C5 6936 ; Keep a channel to nla0: around. We will bash its UCB 000004C5 6937 ; pointer to other devices when we need channels to them so we need 000004C5 6938 ; not continually assign & deassign channels. 000004C5 6939 ; We do this so we can set vchn to the current unit when we get a 000004C5 6940 ; message from some JT unit of work to do; we actually point at the 000004C5 6941 ; host device with it (ucb address is in the msg to us) 000004DA 6942 $assign_s devnam=nldsc,chan=nlchn X02/022 ?01T 000004C5 CLRQ -(SP) X02/057 ?01T 000004C7 PUSHAB nlchn X02/089 ?01T 000004CD PUSHAB nldsc X01/092 000004D3 CALLS #$$T2,G^SYS$ASSIGN 000004DA 6943 ; MUST HAVE ASSIGNMENT TO VD: UNIT IN ANY CASE. 000004DA 6944 $ASSIGN_S - 000004DA 6945 DEVNAM=VDFNM,- ; GET CHANNEL FOR VDn: 000004EF 6946 CHAN=VDCHN X02/022 ?01T 000004DA CLRQ -(SP) X02/057 ?01T 000004DC PUSHAB VDCHN JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 20 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X02/089 ?01T 000004E2 PUSHAB VDFNM X01/092 000004E8 CALLS #$$T2,G^SYS$ASSIGN 000004F5 6947 ON_ERR ADVDD_EXIT ; SKIP OUT IF ERROR X01/001 000004EF BLBS R0,30006$ X01/002 000004F2 BRW ADVDD_EXIT X01/003 000004F5 30006$: 000004F5 6948 $GETDVI_S - 000004F5 6949 CHAN=vdchn,- ; Command line has device name. 00000513 6950 ITMLST=VDV_ITEM_LIST X02/010 ?01T 000004F5 CLRQ -(SP) X02/018 ?01T 000004F7 PUSHL #0 X02/050 ?01T 000004F9 PUSHL #0 X02/109 ?01T 000004FB PUSHAB VDV_ITEM_LIST X02/114 ?01T 00000501 PUSHL #0 X01/144 00000503 MOVZWL vdchn,-(SP) X01/145 0000050A PUSHL #0 X01/146 0000050C CALLS #8,G^SYS$GETDVI 00000513 6951 BLBS R0,140$ 00000516 6952 BRW advdd_EXIT 00000519 6953 140$: 00000519 6954 ; Here do the real work in kernel mode, having now the device 00000519 6955 ; descriptions and channels to the devces even! 00000519 6956 tstl deafg ;if /deas, do $qio, then knl work 00000524 6957 bneqw 307$ X01/001 0000051F beql 30007$ X01/002 00000521 brw 307$ X01/003 00000524 30007$: 00000524 6958 ; Set up mailbox channel to get open daemon information 00000524 6981 $crembx_s prmflg=#0,chan=mbchn,maxmsg=#576,bufquo=#36864,- 00000543 6996 promsk=#0 X02/022 ?01T 00000524 CLRQ -(SP) X02/010 ?01T 00000526 PUSHL #0 X02/011 ?01T 00000528 PUSHL #36864 X01/014 0000052E PUSHL #576 X02/044 ?01T 00000534 PUSHAB mbchn X01/047 0000053A PUSHL #0 X01/048 0000053C CALLS #$$T2,G^SYS$CREMBX 00000549 6997 On_ERR advdd_exit X01/001 00000543 BLBS R0,30008$ X01/002 00000546 BRW advdd_exit X01/003 00000549 30008$: 00000549 6998 ; need to get UCB address here somehow... 00000549 6999 $GETDVI_S - 00000549 7000 CHAN=mbchn,- ; Command line has device name. 00000567 7001 ITMLST=mbx_item_list X02/010 ?01T 00000549 CLRQ -(SP) X02/018 ?01T 0000054B PUSHL #0 X02/050 ?01T 0000054D PUSHL #0 X02/109 ?01T 0000054F PUSHAB mbx_item_list X02/114 ?01T 00000555 PUSHL #0 X01/144 00000557 MOVZWL mbchn,-(SP) X01/145 0000055E PUSHL #0 X01/146 00000560 CALLS #8,G^SYS$GETDVI 00000567 7002 BLBS R0,176$ 0000056A 7003 161$: BRW advdd_EXIT 0000056D 7004 176$: 0000056D 7005 ; Got now the actual device name of the mailbox JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 21 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000056D 7006 ; Let the kernel call perform the UCB lookup for us. 0000056D 7007 ; 0000056D 7008 ; FOUND A UNIT. NOW DECLARE EXIT HANDLER TO CLEAN UP 0000056D 7009 ; IF WE GET A $FORCEX TO TERMINATE THE HOST PROCESS. 0000056D 7010 PUSHAB DESBLK ; ADDRESS OF DESBLK 00000573 7011 CALLS #1,G^SYS$DCLEXH ; DECLARE EXIT HANDLER 0000057A 7012 ; NOW GET OUR PID FOR USE LATER. Also get other info and set our pid 0000057A 7013 ; and mailbox addresses in JR: UCB as needed. 0000057A 7014 ; 0000057A 7015 blbc r0,775$ ;no delete inhibit if exit hdlr bad 0000058C 7022 $cmkrnl_s routin=inhdel X02/004 ?01T 0000057D PUSHL #0 X02/063 ?01T 0000057F PUSHAB inhdel X01/066 00000585 CALLS #2,G^SYS$CMKRNL 0000058C 7023 775$: 0000058C 7024 $CMKRNL_S - 0000059F 7025 ROUTIN=BASHUCB,ARGLST=K_ARG X02/031 ?01T 0000058C PUSHAB K_ARG X02/063 ?01T 00000592 PUSHAB BASHUCB X01/066 00000598 CALLS #2,G^SYS$CMKRNL 0000059F 7026 CMPL R0,#SS$_NORMAL ;Any errors? 000005A2 7027 BEQL 300$ ;No, skip error routine 000005A4 7028 MOVL R0,MESS ;Move error to message 000005BA 7029 $cmkrnl_s routin=alwdel X02/004 ?01T 000005AB PUSHL #0 X02/063 ?01T 000005AD PUSHAB alwdel X01/066 000005B3 CALLS #2,G^SYS$CMKRNL 000005BA 7030 ;;; BRW 300$ 000005BA 7031 301$: 000005BA 7032 ; ERROR RETURN ... CLOSE FAB & LEAVE 000005CD 7041 $PUTMSG_S MSGVEC=ERROR ;Pump out error message X01/002 000005BA PUSHL #0 X02/005 ?01T 000005BC PUSHL #0 X02/037 ?01T 000005BE PUSHL #0 X02/096 ?01T 000005C0 PUSHAB ERROR X01/099 000005C6 CALLS #4,G^SYS$PUTMSG 000005CD 7042 ; deassign logic 000005CD 7043 307$: movl #2,bufg ;unmung fcn 000005D4 7058 $qiow_s chan=vdchn,efn=#4,func=#,iosb=iosb,- 000005FD 7073 p1=bufg,p2=#busz X02/010 ?01T 000005D4 CLRQ -(SP) X02/024 ?01T 000005D6 CLRQ -(SP) X01/030 000005D8 PUSHL #busz X02/060 ?01T 000005DA PUSHAB bufg X02/008 ?01T 000005E0 CLRQ -(SP) X02/043 ?01T 000005E2 PUSHAB iosb X01/046 000005E8 MOVZWL #,-(SP) X01/047 000005ED MOVZWL vdchn,-(SP) X01/048 000005F4 PUSHL #4 X01/049 000005F6 CALLS #12,G^SYS$QIOW 000005FD 7074 ; after unbashing the current host, take the JT unit offline 000005FD 7075 ; $CMKRNL_S - 000005FD 7076 ; ROUTIN=BASHUCB,ARGLST=K_ARG 000005FD 7077 478$: 0000060C 7078 $cmkrnl_s routin=alwdel X02/004 ?01T 000005FD PUSHL #0 X02/063 ?01T 000005FF PUSHAB alwdel JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 22 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X01/066 00000605 CALLS #2,G^SYS$CMKRNL 0000061A 7084 $DASSGN_S CHAN=VDCHN X01/002 0000060C MOVZWL VDCHN,-(SP) X01/003 00000613 CALLS #1,G^SYS$DASSGN 0000061A 7085 ret 0000061B 7086 300$: 0000061B 7087 ; Since that worked OK, send the format function to the JT unit to 0000061B 7088 ; finish bashing the host disk. 0000061B 7089 movl #1,bufg ;set to bash device ?01F 00000622 7090 .if df,$useqm ?01F 00000622 7091 $qiow_s chan=vdchn,efn=#4,func=#,iosb=iosb,- ?01F 00000622 7092 p1=bufg,p2=#busz ?01T 00000622 7093 .iff ?01T 00000622 7094 clrq -(sp) ?01T 00000624 7095 clrq -(sp) ?01T 00000626 7096 pushl #busz ?01T 00000628 7097 pushab bufg ?01T 0000062E 7098 clrq -(sp) ?01T 00000630 7099 pushab iosb ?01T 00000636 7100 movl #,-(sp) ?01T 0000063D 7101 movl vdchn,-(sp) ?01T 00000644 7102 pushl #4 ?01T 00000646 7103 calls #12,g^sys$qiow ?01T 0000064D 7104 .endc 0000064D 7105 ; BE SURE WE DON'T LEAVE THE CHANNELS ASSIGNED TO THE DEVICES 0000064D 7106 ; EITHER... 0000064D 7107 303$: 0000064D 7108 clrl ioprog ;say no i/o in progress 00000653 7109 tstl shrflg ;sharing another daemon? 00000659 7110 beql 7721$ 0000065B 7111 brb 478$ 0000065D 7112 ; Begin reading mailbox and processing. 0000065D 7113 7721$: 0000065D 7114 tstl mfyflg ;/modify switch (no loop?) 00000663 7115 bneq 478$ 00000665 7116 evtloop: 00000665 7117 clrl ioprog 0000066B 7118 clrl nedast 00000671 7119 ; messages are currently 116 bytes or less, but read one even if bigger 00000671 7120 $qiow_s efn=#8,chan=mbchn,- 0000069C 7121 iosb=iosb,func=#io$_readlblk,p1=bufhdr,p2=#400 X02/010 ?01T 00000671 CLRQ -(SP) X02/024 ?01T 00000673 CLRQ -(SP) X01/030 00000675 PUSHL #400 X02/060 ?01T 0000067B PUSHAB bufhdr X02/071 ?01T 00000681 CLRQ -(SP) X02/106 ?01T 00000683 PUSHAB iosb X01/109 00000689 MOVZWL #io$_readlblk,-(SP) X01/110 0000068C MOVZWL mbchn,-(SP) X01/111 00000693 PUSHL #8 X01/112 00000695 CALLS #12,G^SYS$QIOW 0000069C 7122 ; get a msg in from driver & do what is needed. 0000069C 7123 ; Open Message format (from JTdriver): 0000069C 7124 ;0 LDT addr 0000069C 7125 ; 1 (= flag this is open call) 0000069C 7126 ; Victim device UCB address 0000069C 7127 ; ACE address JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 23 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000069C 7128 ;16 JTKAST address (where to send ast) 0000069C 7129 ; FID, 1st long 0000069C 7130 ; FID, 2nd long 0000069C 7131 ; accmd (how-open) 0000069C 7132 ; DID, 1st long 0000069C 7133 ; DID, 2nd long 0000069C 7134 ; PCB of process 0000069C 7135 ;44 IPID of process (sch$qast uses) 0000069C 7136 ; EPID of process 0000069C 7137 ; JT UCB address 0000069C 7138 ; 0000069C 7139 ; 0000069C 7140 ; Extend dmn msg format: 0000069C 7141 ; Msg blk addr in knl mode 0000069C 7142 ; 2 (= flag for extend call) 0000069C 7143 ; dvc name (count + 15 bytes ascii) 0000069C 7144 ; unit number, binary 0000069C 7145 ; IRP addr 0000069C 7146 ; PCB addr 0000069C 7147 ; victim ucb 0000069C 7148 ; ccb addr 0000069C 7149 ; r7 0000069C 7150 ; r8 0000069C 7151 ; user FIB addr 0000069C 7152 ; size user wants 0000069C 7153 ; FID, 1st part 0000069C 7154 ; FID, 2nd part 0000069C 7155 ; how-open (fib$l_acctl) 0000069C 7156 ;72 Where to send AST back 0000069C 7157 ; PCB 0000069C 7158 ; IPID 0000069C 7159 ; EPID 0000069C 7160 ; 0000069C 7161 ; del dmn msg fmt: 0000069C 7162 ;0 Msg blk addr in knl mode 0000069C 7163 ; 3 (= flag for delete call) 0000069C 7164 ; dvc name (count + 15 bytes ascii) 0000069C 7165 ; 0000069C 7166 ; 0000069C 7167 ; 0000069C 7168 ; unit number, binary 0000069C 7169 ; IRP addr 0000069C 7170 ; PCB addr 0000069C 7171 ; victim ucb 0000069C 7172 ; ccb addr 0000069C 7173 ; r7 0000069C 7174 ; r8 0000069C 7175 ; user FIB addr 0000069C 7176 ; size user wants 0000069C 7177 ; FID, 1st part 0000069C 7178 ; FID, 2nd part 0000069C 7179 ; how-open (fib$l_acctl) 0000069C 7180 ;72 Where to send AST back 0000069C 7181 ; DID, high part 0000069C 7182 ; DID, low part 0000069C 7183 ; PCB 0000069C 7184 ; IPID JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 24 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 0000069C 7185 ; EPID 0000069C 7186 ; Export the real work to our subroutines since the buffers 0000069C 7187 ; have all we need. 0000069C 7188 cmpl bufhdr+4,#1 ;open call? 000006A3 7189 blss evtloop ;go back if not 000006AA 7190 bgtrw 2$ ;if gtr check higher codes X01/001 000006A5 bleq 30009$ X01/002 000006A7 brw 2$ X01/003 000006AA 30009$: 000006AA 7191 ; If we don't have all of the ACE then gotta try to read it 000006AA 7192 ; and handle it. 000006AA 7193 movl #-1,vchn 000006C4 7194 $cmkrnl_s routin=chkace X02/004 ?01T 000006B5 PUSHL #0 X02/063 ?01T 000006B7 PUSHAB chkace X01/066 000006BD CALLS #2,G^SYS$CMKRNL 000006C4 7195 tstl vchn ;should we find ACE? 000006CA 7196 blss 10$ ;if still neg., no 000006CC 7197 ; vchn now has chnl for ACE 000006CC 7198 ; go read the ACE if we can. 000006CC 7199 pushab vchn ;chnl 000006D2 7200 pushab uace ;ACE we'll use 000006D8 7201 pushab bufhdr+20 ;file ID (8 bytes) 000006DE 7202 calls #3,redacl ;go read the acl 000006F4 7203 $cmkrnl_s routin=nlfix X02/004 ?01T 000006E5 PUSHL #0 X02/063 ?01T 000006E7 PUSHAB nlfix X01/066 000006ED CALLS #2,G^SYS$CMKRNL 000006F4 7204 pushr #^m 000006F6 7205 movzbl uace,r3 000006FD 7206 beql 15$ 000006FF 7207 movab uace,r4 00000706 7208 movab mdace,r5 0000070D 7209 movc3 r3,(r4),(r5) ;put uace we got into mdace too 00000711 7210 15$: 00000711 7211 popr #^m 00000713 7212 10$: 00000713 7213 movl #-1,vchn 0000072D 7214 $cmkrnl_s routin=nlbash X02/004 ?01T 0000071E PUSHL #0 X02/063 ?01T 00000720 PUSHAB nlbash X01/066 00000726 CALLS #2,G^SYS$CMKRNL 0000072D 7215 pushab vchn 00000733 7216 pushab uace 00000739 7217 pushab mdace ;pass the ACE buffers 0000073F 7218 pushab bufhdr ;pass buffer we got 00000745 7219 incl ioprog 0000074B 7220 movl #1,nedast ;set i/o going flags 00000752 7221 ; opnfilt(bufhdr,mdace,uace,vchn) 00000752 7222 ; Should return mdace as ACE we will send to the kernel again. 00000752 7223 ; initially uace & mdace are the same up to length of ace. 00000752 7224 ; vchn points at the device in case we need a channel there, provided 00000752 7225 ; it is positive. Do not use if negative!!! 00000752 7226 calls #4,g^opnfilt ;do open filter stuff 00000759 7227 movl r0,rtnst ;save return status 0000076F 7228 $cmkrnl_s routin=rtnast X02/004 ?01T 00000760 PUSHL #0 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 25 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X02/063 ?01T 00000762 PUSHAB rtnast X01/066 00000768 CALLS #2,G^SYS$CMKRNL 0000077E 7229 $cmkrnl_s routin=nlfix X02/004 ?01T 0000076F PUSHL #0 X02/063 ?01T 00000771 PUSHAB nlfix X01/066 00000777 CALLS #2,G^SYS$CMKRNL 0000077E 7230 brw evtloop 00000781 7231 2$: 00000781 7232 cmpl bufhdr+4,#2 ;extend operation? 00000788 7233 bneq 3$ ;if not, skip 0000078A 7234 movl #-1,vchn 000007A4 7235 $cmkrnl_s routin=nlbashd X02/004 ?01T 00000795 PUSHL #0 X02/063 ?01T 00000797 PUSHAB nlbashd X01/066 0000079D CALLS #2,G^SYS$CMKRNL 000007A4 7236 pushab vchn 000007AA 7237 pushab bufhdr ;pass buffer we got 000007B0 7238 incl ioprog 000007B6 7239 movl #2,nedast ;set i/o going flags 000007BD 7240 ; extfilt(bufhdr,vchn) 000007BD 7241 calls #2,g^extfilt ;do open filter stuff 000007C4 7242 movl r0,rtnst 000007DA 7243 $cmkrnl_s routin=endext X02/004 ?01T 000007CB PUSHL #0 X02/063 ?01T 000007CD PUSHAB endext X01/066 000007D3 CALLS #2,G^SYS$CMKRNL 000007E9 7244 $cmkrnl_s routin=nlfix X02/004 ?01T 000007DA PUSHL #0 X02/063 ?01T 000007DC PUSHAB nlfix X01/066 000007E2 CALLS #2,G^SYS$CMKRNL 000007E9 7245 brw evtloop 000007EC 7246 3$: cmpl bufhdr+4,#3 ;delete op? 000007F3 7247 bgtr 4$ ;if not go back 000007F5 7248 movl #-1,vchn 0000080F 7249 $cmkrnl_s routin=nlbashd X02/004 ?01T 00000800 PUSHL #0 X02/063 ?01T 00000802 PUSHAB nlbashd X01/066 00000808 CALLS #2,G^SYS$CMKRNL 0000080F 7250 pushab vchn 00000815 7251 pushab bufhdr ;pass buffer we got 0000081B 7252 incl ioprog 00000821 7253 movl #3,nedast ;set i/o going flags 00000828 7254 ; delfilt(bufhdr,vchn) 00000828 7255 calls #2,g^delfilt ;do open filter stuff 0000082F 7256 movzwl r0,rtnst 00000836 7257 blbs r0,244$ 00000839 7258 movl #4096,rtnst ;secret error code to inhibit delete 00000844 7259 244$: 00000853 7260 $cmkrnl_s routin=enddel X02/004 ?01T 00000844 PUSHL #0 X02/063 ?01T 00000846 PUSHAB enddel X01/066 0000084C CALLS #2,G^SYS$CMKRNL 00000862 7261 $cmkrnl_s routin=nlfix X02/004 ?01T 00000853 PUSHL #0 X02/063 ?01T 00000855 PUSHAB nlfix X01/066 0000085B CALLS #2,G^SYS$CMKRNL 00000862 7262 4$: brw evtloop JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 26 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000865 7263 ; 00000865 7264 ; $cmkrnl_s routin=alwdel 00000865 7265 ; $DASSGN_S CHAN=DDCHN ;CLEAN UP I/O CHANNELS 00000865 7266 ; RET 00000865 7267 fdhostd_exit: 00000865 7268 advdd_exit: 00000874 7269 $cmkrnl_s routin=alwdel X02/004 ?01T 00000865 PUSHL #0 X02/063 ?01T 00000867 PUSHAB alwdel X01/066 0000086D CALLS #2,G^SYS$CMKRNL 00000882 7270 $DASSGN_S CHAN=VDCHN X01/002 00000874 MOVZWL VDCHN,-(SP) X01/003 0000087B CALLS #1,G^SYS$DASSGN 00000882 7271 RET 00000883 7272 .entry chkace,^m 00000885 7273 ; check for "short" ACE ?01F 00000885 7274 .if ndf,evax ?01F 00000885 7275 movzwl nlchn,r0 ?01F 00000885 7276 mnegl r0,r8 ?01F 00000885 7277 movl g^CTL$GL_CCBBASE,R6 ;get end of CCB tbl (VAX SPECIFIC!!!) ?01F 00000885 7278 addl2 r8,r6 ;get ourt ccb ?01F 00000885 7279 ; movab (r6)[r8],r6 ;now have CCB ?01T 00000885 7280 .iff ;evax ?01T 00000885 7281 movl nlchn,r6 ;test chnl exists ?01T 0000088C 7282 bleq 999$ ?01T 0000088E 7283 ; Following sequence like that in ioc$iopost ?01T 0000088E 7284 clrl -(sp) ;get CCB address in here ?01T 00000890 7285 pushal (sp) ;point to CCB pointer ?01T 00000892 7286 pushl nlchn ;push the channel number ?01T 00000898 7287 calls #2,G^IOC$CHAN_TO_CCB ;translate chnl to CCB address ?01T 0000089F 7288 movl (sp)+,r6 ;get the CCB address to r6 ?01T 000008A2 7289 .endc 000008A2 7290 movl r6,nlccb ;store for later 000008A9 7291 movl ccb$l_ucb(r6),nlucb 000008B1 7292 movl bufhdr,r11 ;LDT pointer 000008B8 7293 bgeq 999$ 000008BA 7294 movl bufhdr+12,r10 ;ACE buffer address 000008C1 7295 bgeq 999$ 000008C3 7296 movab uace,r8 000008CA 7297 movzbl (r10),r7 ;ace length 000008CD 7298 beql 999$ 000008CF 7299 movc3 r7,(r10),(r8) ;copy ACE to our buffers 000008D3 7300 movab mdace,r8 000008DA 7301 movc3 r7,(r10),(r8) 000008DE 7302 cmpl 12(r10),gcelit ;my ACE there? 000008E6 7303 beql 999$ 000008E8 7304 movl ldt$l_aclsiz(r11),r9 ;size of acl? 000008ED 7305 cmpl r9,#512 000008F4 7306 bleq 999$ ;if small enough to fit must have it. 000008F6 7307 cmpl r9,ldt$l_ace(r11) ;size as set to look for? 000008FA 7308 bneq 999$ 000008FC 7309 cmpl #<<8*65536>+1>,ldt$l_ace+4(r11) 00000904 7310 bneq 999$ ;if no magic no lookee... 00000906 7311 ; look for the ACE 00000906 7312 ; Flag by making nlchn point to desired unity of JT 00000906 7313 movl bufhdr+8,ccb$l_ucb(r6) ;point chnl at victim 0000090E 7314 bgeq 999$ JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 27 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000910 7315 movl nlchn,vchn 0000091B 7316 999$: 0000091B 7317 movl #1,r0 0000091E 7318 ret 0000091F 7319 .entry nlbash,^m 00000921 7320 ; bash nlchn with arg ?01F 00000921 7321 .if ndf,evax ?01F 00000921 7322 movzwl nlchn,r0 ?01F 00000921 7323 mnegl r0,r8 ?01F 00000921 7324 movl g^CTL$GL_CCBBASE,R6 ;get end of CCB tbl (VAX SPECIFIC!!!) ?01F 00000921 7325 addl2 r8,r6 ;get ourt ccb ?01F 00000921 7326 ; movab (r6)[r8],r6 ;now have CCB ?01T 00000921 7327 .iff ;evax ?01T 00000921 7328 movl nlchn,r6 ;test chnl exists ?01T 00000928 7329 bleq 999$ ?01T 0000092A 7330 ; Following sequence like that in ioc$iopost ?01T 0000092A 7331 clrl -(sp) ;get CCB address in here ?01T 0000092C 7332 pushal (sp) ;point to CCB pointer ?01T 0000092E 7333 pushl nlchn ;push the channel number ?01T 00000934 7334 calls #2,G^IOC$CHAN_TO_CCB ;translate chnl to CCB address ?01T 0000093B 7335 movl (sp)+,r6 ;get the CCB address to r6 ?01T 0000093E 7336 .endc 0000093E 7337 movl r6,nlccb ;store for later 00000945 7338 movl ccb$l_ucb(r6),nlucb 0000094D 7339 tstl bufhdr+36 ;be sure chnl ucb is ok 00000953 7340 bgeq 999$ ;leave chnl alone if illegal ucb addr 00000955 7341 movl bufhdr+36,ccb$l_ucb(r6) ;point chnl at victim 0000095D 7342 bgtr 999$ 0000095F 7343 movl nlchn,vchn 0000096A 7344 999$: 0000096A 7345 movl #1,r0 0000096D 7346 ret 0000096E 7347 .entry nlbashd,^m 00000970 7348 ; bash nlchn with arg ?01F 00000970 7349 .if ndf,evax ?01F 00000970 7350 movzwl nlchn,r0 ?01F 00000970 7351 mnegl r0,r8 ?01F 00000970 7352 movl g^CTL$GL_CCBBASE,R6 ;get end of CCB tbl (VAX SPECIFIC!!!) ?01F 00000970 7353 addl2 r8,r6 ;get ourt ccb ?01F 00000970 7354 ; movab (r6)[r8],r6 ;now have CCB ?01T 00000970 7355 .iff ;evax ?01T 00000970 7356 movl nlchn,r6 ;test chnl exists ?01T 00000977 7357 bleq 999$ ?01T 00000979 7358 ; Following sequence like that in ioc$iopost ?01T 00000979 7359 clrl -(sp) ;get CCB address in here ?01T 0000097B 7360 pushal (sp) ;point to CCB pointer ?01T 0000097D 7361 pushl nlchn ;push the channel number ?01T 00000983 7362 calls #2,G^IOC$CHAN_TO_CCB ;translate chnl to CCB address ?01T 0000098A 7363 movl (sp)+,r6 ;get the CCB address to r6 ?01T 0000098D 7364 .endc 0000098D 7365 movl r6,nlccb ;store for later 00000994 7366 movl ccb$l_ucb(r6),nlucb 0000099C 7367 tstl bufhdr+36 000009A2 7368 bgeq 999$ ;leave chnl alone if illegal ucb addr 000009A4 7369 movl bufhdr+36,ccb$l_ucb(r6) ;point chnl at victim 000009AC 7370 bgtr 999$ 000009AE 7371 movl nlchn,vchn JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 28 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 000009B9 7372 999$: 000009B9 7373 movl #1,r0 000009BC 7374 ret 000009BD 7375 .entry nlfix,^m 000009BF 7376 ; reset nlchn 000009BF 7377 movl nlccb,r6 000009C6 7378 movl nlucb,ccb$l_ucb(r6) 000009CE 7379 movl #1,r0 000009D1 7380 ret 000009D2 7381 000009D2 7382 ; BASHUCB - AREA TO MESS UP UCB WITH OUR FILE DATA 000009D2 7383 ; BEWARE BEWARE BEWARE 000009D2 7384 ; runs in KERNEL mode ... HAS to be right. 000009D2 7385 ; Saves lots of registers so they're free... 000009D2 7386 .ENTRY BASHUCB,^M 000009D4 7387 ; TAKEN LOOSELY FROM ZERO.MAR ?01F 000009D4 7388 .if ndf,vms$v5 ?01F 000009D4 7389 MOVL G^SCH$GL_CURPCB,R4 ;;; NEED OUR PCB ?01T 000009D4 7390 .iff ?01T 000009D4 7391 MOVL G^CTL$GL_PCB,R4 ;;; NEED OUR PCB (VMS V5) ?01T 000009DB 7392 .endc 000009DB 7393 clrl hstucb 000009E1 7394 JSB G^SCH$IOLOCKW ;;; LOCK I/O DATABASE 000009E7 7395 tstl deafg ;/deas needs no 2nd assign 000009ED 7396 bneq 90$ 000009EF 7397 clrl shucb 000009F5 7398 tstl shrflg 000009FB 7399 beql 466$ 000009FD 7400 movl 16(ap),r1 ;look up /share:jt device 00000A01 7401 jsb g^ioc$searchdev ;find the mailbox 00000A07 7402 blbc r0,466$ 00000A0A 7403 ;see if r1 really points at a JT UCB 00000A0A 7404 cmpb ucb$b_devclass(r1),#dc$_disk 00000A0E 7405 beql 466$ ;JT devices are not disks 00000A10 7406 cmpl ucb$l_icsign(r1),#magic ;got right magic no.? 00000A19 7407 bneq 466$ ;if not eq, not a JT. Skip. 00000A1B 7408 movl r1,shucb ;save other JT UCB 00000A22 7409 466$: 00000A22 7410 ;get mailbox info 00000A22 7411 movl 12(ap),r1 00000A26 7412 jsb g^ioc$searchdev ;find the mailbox 00000A2C 7413 blbc r0,661$ ;big lose if none 00000A2F 7414 movl r1,mbxucb 00000A36 7415 MOVL 4(AP),R1 ;;; ADDRESS DVC NAME DESCRIPTORS (target) 00000A3A 7416 JSB G^IOC$SEARCHDEV ;;; GET UCB ADDRESS INTO R1 for tgt 00000A40 7417 BLBS R0,660$ 00000A43 7418 661$: BRW BSH_XIT 00000A46 7419 660$: 00000A46 7420 ; 00000A46 7421 80$: 00000A46 7422 MOVL R1,HSTUCB ;;; SAVE HOST UCB ADDRESS 00000A4D 7423 movl r1,r11 ;use r11 for target UCB 00000A50 7424 BEQL 166$ ;;; ... BUT ZERO UCB ADDRESS LOOKS BAAAAD 00000A52 7425 90$: 00000A52 7426 MOVL 8(AP),R1 ;;; ADDRESS VDn NAME DESCRIPTORS 00000A56 7427 JSB G^IOC$SEARCHDEV ;;; GET UCB ADDRESS INTO R1 00000A5C 7428 BLBS R0,160$ JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 29 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000A5F 7429 BRW BSH_XIT 00000A62 7430 160$: 00000A62 7431 movl r1,vducb ;;; store vd ucb 00000A69 7432 movl r1,r5 ;use r5 for local ucb (JT dvc) 00000A6C 7433 beql 166$ ;fail if no ucb... 00000A6E 7434 ; BUGGER THE UCB 00000A6E 7435 ; ASSUMES FILE LBN AND SIZE ALREADY RECORDED 00000A6E 7436 ; ALSO ASSUMES THAT ZERO LBN OR SIZE MEANS THIS ENTRY NEVER CALLED. 00000A6E 7437 ; (REALLY ONLY WORRY ABOUT ZERO SIZE; IF WE OVERMAP A REAL DEVICE 00000A6E 7438 ; THEN ZERO INITIAL LBN COULD BE OK.) 00000A6E 7439 ; 00000A6E 7440 ; CHECK REF COUNT FIRST... ONLY CAN GET AWAY WITH THIS ON DEVICE 00000A6E 7441 ; NOBODY'S USING... 00000A6E 7442 ; .. fake this since device may have count messed by advd somehow 00000A6E 7443 ; but will be allocated if mounted. 00000A6E 7444 ; ... for now ... 00000A6E 7445 554$: 00000A6E 7446 ; CMPW UCB$W_REFC(R1),#1 ;;; CHECK COUNT VS 1 FOR THIS 00000A6E 7447 ; blssu 164$ ;if 1 or less, go on. 00000A6E 7448 brb 164$ ;(it doersn't matter ifthe local disk is in 00000A70 7449 ; use...we don't bother it.) 00000A70 7450 166$: brw 165$ 00000A73 7451 164$: 00000A73 7452 ; check that both UCBs are disk devices at least! 00000A73 7453 ; We can't be sure all the device characteristics will be the 00000A73 7454 ; same for the local device and the MSCP served remote one (and 00000A73 7455 ; in fact they are not all alike!) but at least they had better 00000A73 7456 ; both be disks or this function is not even approximately 00000A73 7457 ; correct and will probably be quickly fatal to the system. 00000A73 7458 tstl deafg ;/deas? r11 invalid. 00000A79 7459 beql 1164$ 00000A7B 7460 ; for deassign, must set JT offline so it can be turned on again 00000A7B 7461 ; but just do all work here & scram. 00000A7B 7462 cmpl ucb$l_icsign(r5),#magic ;got right magic no.? 00000A84 7463 bneq 1176$ ;if not then not JTdriver 00000A86 7464 ; clear online & valid on JT dvc for next time ?01T 00000A86 7465 .if df,evax ?01T 00000A86 7466 bicl #ucb$m_online,ucb$l_sts(r5) ;set JT unit not online ?01T 00000A8B 7467 bicl #ucb$m_valid,ucb$l_sts(r5) ; & valid ?01F 00000A94 7468 .iff ?01F 00000A94 7469 bicw #ucb$m_online,ucb$w_sts(r5) ;set JT unit not online ?01F 00000A94 7470 bicw #ucb$m_valid,ucb$w_sts(r5) ; & valid ?01F 00000A94 7471 .endc 00000A94 7472 1166$: movl #1,r0 00000A97 7473 brw bsh_xit ;unlock & leave 00000A9A 7474 1176$: movl #ss$_drverr,r0 00000AA1 7475 brw bsh_xit 00000AA4 7476 1164$: 00000AA4 7477 cmpb ucb$b_devclass(r11),#dc$_disk 00000AA8 7478 bneq 1176$ ;if not disk exit now. 00000AAA 7479 cmpl ucb$l_icsign(r5),#magic ;got right magic no.? 00000AB3 7480 bneq 1176$ ;if not then not JTdriver 00000AB5 7481 ; Be sure the unit is not online yet. If it is, someone else will 00000AB5 7482 ; be using its UCB so we don't want to screw this up. ?01T 00000AB5 7483 .if df,evax ?01T 00000AB5 7484 bitl #ucb$m_online,ucb$l_sts(r5) ;set JT unit online ?01T 00000ABA 7485 bneq 166$ JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 30 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 ?01F 00000ABC 7486 .iff ?01F 00000ABC 7487 bitw #ucb$m_online,ucb$w_sts(r5) ;set JT unit online ?01F 00000ABC 7488 bneq 166$ ?01F 00000ABC 7489 .endc 00000ABC 7490 ; Looks like we're gonna do the assign. Store backpointer for driver to 00000ABC 7491 ; check before unmung. 00000ABC 7492 movl r11,ucb$l_vict(r5) ;store ucb of victim in JT ucb 00000AC1 7493 ;;;must make maxbcnt and fipl match!!! 00000AC1 7494 ; Fork IPL will be same but maxbcnt often will not. Fix that here. 00000AC1 7495 movl g^ctl$gl_pcb,r4 ;get our pcb, for safety 00000AC8 7496 tstl shucb ;got a shared ucb? 00000ACE 7497 bneq 476$ 00000AD0 7498 movl pcb$l_pid(r4),ucb$l_daemon(r5) ;save our identity for jtdriver 00000AD7 7499 ;since this is the delete & extend daemon set them up too. 00000AD7 7500 movl pcb$l_pid(r4),ucb$l_exdmn(r5) 00000ADE 7501 movl pcb$l_pid(r4),ucb$l_deldmn(r5) 00000AE5 7502 ; fill in mailbox stuff too 00000AE5 7503 movl mbxucb,ucb$l_mbxucb(r5) ;open daemon 00000AEE 7504 movl mbxucb,ucb$l_exmbx(r5) ;extend daemon (space monitor) 00000AF7 7505 movl mbxucb,ucb$l_delmbx(r5) ;delete daemon 00000B00 7506 brb 477$ 00000B02 7507 476$: 00000B02 7508 pushl r9 00000B04 7509 movl shucb,r9 00000B0B 7510 ; use the pointers from the other daemon for us. 00000B0B 7511 movl ucb$l_daemon(r9),ucb$l_daemon(r5) ;save our identity for jtdriver 00000B12 7512 ;since this is the delete & extend daemon set them up too. 00000B12 7513 movl ucb$l_exdmn(r9),ucb$l_exdmn(r5) 00000B19 7514 movl ucb$l_deldmn(r9),ucb$l_deldmn(r5) 00000B20 7515 ; fill in mailbox stuff too 00000B20 7516 movl ucb$l_mbxucb(r9),ucb$l_mbxucb(r5) ;open daemon 00000B27 7517 movl ucb$l_mbxucb(r9),ucb$l_exmbx(r5) ;extend daemon (space monitor) 00000B2E 7518 movl ucb$l_mbxucb(r9),ucb$l_delmbx(r5) ;delete daemon 00000B35 7519 popl r9 00000B38 7520 477$: 00000B38 7521 ; movl ucb$l_maxbcnt(r5),ucb$l_maxbcnt(r11) ;;;store max bytes as a word 00000B38 7522 movl binkey,ucb$l_keycry(r5) ;store security key 00000B41 7523 movl binkey+4,ucb$l_keycry+4(r5) 00000B4A 7524 ; 00000B4A 7525 ; Fill in kernel-tagged file numbers now, if any. 00000B4A 7526 pushr #^m ?01F 00000B4E 7527 .if df,wd.lst ?01F 00000B4E 7528 movl fnumct,r7 ;number of tags ?01T 00000B4E 7529 .iff ?01T 00000B4E 7530 movl #,r7 ;move whole bitmap ?01T 00000B55 7531 .endc 00000B55 7532 bleq 511$ ?01F 00000B57 7533 .iif df,wd.lst,addl2 r7,r7 ;make a byte count 00000B57 7534 movab fnums,r0 ;get numbers from here ?01F 00000B5E 7535 .if df,wd.lst ?01F 00000B5E 7536 movab ucb$l_fnums(r5),r1 ;copy them to here ?01T 00000B5E 7537 .iff ?01T 00000B5E 7538 movl ucb$l_fnums(r5),r1 ?01T 00000B63 7539 beql 511$ ?01T 00000B65 7540 .endc 00000B65 7541 movc3 r7,(r0),(r1) ;move the data in 00000B69 7542 511$: JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 31 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000B69 7543 popr #^m 00000B6D 7544 ; Now get on with the tricky part, replacing the DDT. Do this 00000B6D 7545 ; at device IPL so we have reasonable certainty nobody will mess with 00000B6D 7546 ; these structures until we get them all put into proper order. 00000B6D 7547 ; The DDT structure is 64 bytes long, so grab a block of pool of 64 bytes 00000B6D 7548 ; size and copy the existing DDT into it. 00000B6D 7549 ; (it is possible to save the old address if the conditional is used) ?01T 00000B6D 7550 .if df,evax ?01T 00000B6D 7551 bisl #ucb$m_online,ucb$l_sts(r5) ;set JT unit online ?01T 00000B72 7552 bisl #ucb$m_valid,ucb$l_sts(r5) ; & valid ?01F 00000B7B 7553 .iff ?01F 00000B7B 7554 bisw #ucb$m_online,ucb$w_sts(r5) ;set JT unit online ?01F 00000B7B 7555 bisw #ucb$m_valid,ucb$w_sts(r5) ; & valid ?01F 00000B7B 7556 .endc 00000B7B 7557 movl ucb$l_maxblock(r11),ucb$l_maxblock(r5) ;copy geom for luck 00000B82 7558 movw ucb$w_cylinders(r11),ucb$w_cylinders(r5) 00000B87 7559 movb ucb$b_sectors(r11),ucb$b_sectors(r5) 00000B8C 7560 movb ucb$b_tracks(r11),ucb$b_tracks(r5) 00000B91 7561 movl cbtct,ucb$l_cbtini(r5) ;set CBT opens every time 00000B9A 7562 ; movl #34,ucb$l_ctlflgs(r5) ;set to look at modify 00000B9A 7563 movl fcnmsk,ucb$l_ctlflgs(r5) ; set capture functions 00000BA3 7564 tstl adflg ;/aldefonly? 00000BA9 7565 beql 60$ 00000BAB 7566 bisl #4,ucb$l_ctlflgs(r5) ;set driver thus 00000BB0 7567 60$: 00000BB0 7568 ; note 4 bit only extends if aldef is set. Don't set that just now. 00000BB0 7569 movl min,ucb$l_minxt(r5) ;min extent = 10 00000BB9 7570 movl ucb$l_maxblock(r11),r0 00000BBE 7571 tstl max ;user set max? 00000BC4 7572 beql 65$ 00000BC6 7573 movl max,r0 ;if so use his unless 0 00000BCD 7574 brb 4$ 00000BCF 7575 65$: 00000BCF 7576 ashl #-5,r0,r0 ; default max = 1/32 of disk size 00000BD4 7577 cmpl r0,#2000 ;but 2000 at least 00000BDB 7578 bgtr 4$ 00000BDD 7579 movl #2000,r0 ;max=0 => 1/32 of disksize or 2000 00000BE4 7580 4$: 00000BE4 7581 movl r0,ucb$l_maxxt(r5) ;max extent 00000BE9 7582 movl frac,ucb$l_frac(r5) ;extend by 1/4 of file size 00000BF2 7583 movl cbtct,ucb$l_cbtctr(r5) 00000BFB 7584 1000$: 00000BFB 7585 165$: 00000BFB 7586 MOVL #SS$_NORMAL,R0 00000BFE 7587 BSH_XIT: 00000BFE 7588 PUSHL R0 00000C00 7589 JSB G^SCH$IOUNLOCK ;;; UNLOCK I/O DATABASE (DROP IPL) 00000C06 7590 POPL R0 ;;; REMEMBER R0 00000C09 7591 RET ;;; BACK TO USER MODE NOW 00000C0A 7592 ; rtnast - call from knl mode, send skast back to process. 00000C0A 7593 .entry rtnast,^m 00000C0C 7594 ; Send a skast back to where the last msg wanted one. 00000C0C 7595 movl bufhdr,r8 ;point at LDT 00000C18 7596 bgeqw 152$ ;if illegal lose X01/001 00000C13 blss 30010$ X01/002 00000C15 brw 152$ X01/003 00000C18 30010$: JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 32 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000C18 7597 tstl bufhdr+16 ;AST addr OK? 00000C23 7598 bgeqw 152$ ;if no, branch X01/001 00000C1E blss 30011$ X01/002 00000C20 brw 152$ X01/003 00000C23 30011$: 00000C23 7599 movl #acb$c_length,r1 ;size we need for an ACB 00000C26 7600 jsb g^exe$alonpagvar ;get an ACB block 00000C2C 7601 blbc r0,151$ ;throw up hands if we fail 00000C2F 7602 clrl 8(r2) ;zero size, flag etc 00000C32 7603 movw #acb$c_length,acb$w_size(r2) ;acb size 00000C36 7604 movl bufhdr+44,acb$l_pid(r2) ;target pid 00000C3E 7605 movl bufhdr+16,acb$l_kast(r2) ;set skast address 00000C46 7606 movl bufhdr,acb$l_astprm(r2) ;ldt as param 00000C4E 7607 clrl acb$l_ast(r2) ; no normal ast addr 00000C51 7608 movb #<1@acb$v_kast>,acb$b_rmod(r2) ;special knl ast 00000C56 7609 pushr #^m 00000C5A 7610 ; Fill in how-to-handle-i/o flag in ldt 00000C5A 7611 movl rtnst,ldt$l_rtnsts(r8) ;tell driver what to do with i/o 00000C63 7612 movl #1,rtnst ;set return statusd next 00000C6A 7613 ;time. 00000C6A 7614 ; Now replace the edited ACE into the LDT. ?01F 00000C6A 7615 .iif df,x$$$dt,jsb g^ini$brk 00000C6A 7616 movab ldt$l_ace(r8),r10 ;stored ACE entry 00000C6E 7617 bgeq 153$ ;ill. addr -> no action 00000C70 7618 movab mdace,r9 ;edited ace 00000C77 7619 movc3 #256,(r9),(r10) ;copy edited ACE to ldt area 00000C7D 7620 tstb mdace+12 ;is it null? 00000C83 7621 bneq 6150$ ;if not leave it that way 00000C85 7622 153$: clrq (r10) ;else zero the flags 1 %AMAC-I-QUADMEMREF, (1) quadword memory references may be unaligned in routine RTNAST 00000C87 7623 clrq 8(r10) ;that tell us anything's there 1....... %AMAC-I-QUADMEMREF, (1) quadword memory references may be unaligned in routine RTNAST 00000C8A 7624 clrq 16(r10) ;(i.e. clear 1st part of ACE) 1....... %AMAC-I-QUADMEMREF, (1) quadword memory references may be unaligned in routine RTNAST 00000C8D 7625 6150$: 00000C8D 7626 popr #^m 00000C91 7627 movl r2,r5 ;need r5 pointing at aqb 00000C94 7628 movl #2,r2 ;boost prio by 2 00000C97 7629 jsb g^sch$qast ;queue the AST to JRdriver stuff 00000C9D 7630 ;back in desired target proc. context 00000C9D 7631 150$: 00000C9D 7632 movl #ss$_normal,r0 ;return "all well" indicator 00000CA0 7633 151$: 00000CA0 7634 ret 00000CA1 7635 152$: movl #8,r0 ;error return if we're messed up... 00000CA4 7636 ret 00000CA5 7637 .entry endext,^m 00000CA7 7638 ; Send a skast back to where the last msg wanted one. 00000CA7 7639 movl bufhdr,r8 ;point at knl buffer (starts with its addr) 00000CB3 7640 bgeqw 152$ ;if illegal lose X01/001 00000CAE blss 30012$ JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 33 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X01/002 00000CB0 brw 152$ X01/003 00000CB3 30012$: 00000CB3 7641 tstl bufhdr+72 ;AST addr OK? 00000CBE 7642 bgeqw 152$ ;if no, branch X01/001 00000CB9 blss 30013$ X01/002 00000CBB brw 152$ X01/003 00000CBE 30013$: 00000CBE 7643 movl #acb$c_length,r1 ;size we need for an ACB 00000CC1 7644 jsb g^exe$alonpagvar ;get an ACB block 00000CC7 7645 blbc r0,151$ ;throw up hands if we fail 00000CCA 7646 clrl 8(r2) ;zero size, flag etc 00000CCD 7647 movw #acb$c_length,acb$w_size(r2) ;acb size 00000CD1 7648 movl bufhdr+80,acb$l_pid(r2) ;target pid 00000CD9 7649 movl bufhdr+72,acb$l_kast(r2) ;set skast address 00000CE1 7650 movl bufhdr,acb$l_astprm(r2) ;ldt as param 00000CE9 7651 clrl acb$l_ast(r2) ; no normal ast addr 00000CEC 7652 movb #<1@acb$v_kast>,acb$b_rmod(r2) ;special knl ast 00000CF1 7653 pushr #^m 00000CF5 7654 ; Fill in how-to-handle-i/o flag in ldt 00000CF5 7655 movl rtnst,4(r8) ;tell driver what to do with i/o 00000CFD 7656 bneq 677$ 00000CFF 7657 movl #1,4(r8) 00000D03 7658 677$: 00000D03 7659 movl #1,rtnst ;set return statusd next 00000D0A 7660 ;time. 00000D0A 7661 popr #^m 00000D0E 7662 movl r2,r5 ;need r5 pointing at aqb 00000D11 7663 movl #2,r2 ;boost prio by 2 00000D14 7664 jsb g^sch$qast ;queue the AST to JRdriver stuff 00000D1A 7665 ;back in desired target proc. context 00000D1A 7666 150$: 00000D1A 7667 movl #ss$_normal,r0 ;return "all well" indicator 00000D1D 7668 151$: 00000D1D 7669 ret 00000D1E 7670 152$: movl #8,r0 ;error return if we're messed up... 00000D21 7671 ret 00000D22 7672 .entry enddel,^m 00000D24 7673 ; Send a skast back to where the last msg wanted one. 00000D24 7674 movl bufhdr,r8 ;point at knl buffer (starts with its addr) 00000D30 7675 bgeqw 152$ ;if illegal lose X01/001 00000D2B blss 30014$ X01/002 00000D2D brw 152$ X01/003 00000D30 30014$: 00000D30 7676 tstl bufhdr+72 ;AST addr OK? 00000D3B 7677 bgeqw 152$ ;if no, branch X01/001 00000D36 blss 30015$ X01/002 00000D38 brw 152$ X01/003 00000D3B 30015$: 00000D3B 7678 movl #acb$c_length,r1 ;size we need for an ACB 00000D3E 7679 jsb g^exe$alonpagvar ;get an ACB block 00000D44 7680 blbc r0,151$ ;throw up hands if we fail 00000D47 7681 clrl 8(r2) ;zero size, flag etc 00000D4A 7682 movw #acb$c_length,acb$w_size(r2) ;acb size 00000D4E 7683 movl bufhdr+88,acb$l_pid(r2) ;target pid 00000D56 7684 movl bufhdr+72,acb$l_kast(r2) ;set skast address 00000D5E 7685 movl bufhdr,acb$l_astprm(r2) ;ldt as param 00000D66 7686 clrl acb$l_ast(r2) ; no normal ast addr JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 34 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000D69 7687 movb #<1@acb$v_kast>,acb$b_rmod(r2) ;special knl ast 00000D6E 7688 ; Fill in how-to-handle-i/o flag in ldt 00000D6E 7689 movl rtnst,4(r8) ;tell driver what to do with i/o 00000D76 7690 movl #1,rtnst ;set return statusd next 00000D7D 7691 ;time. 00000D7D 7692 movl r2,r5 ;need r5 pointing at aqb 00000D80 7693 movl #2,r2 ;boost prio by 2 00000D83 7694 jsb g^sch$qast ;queue the AST to JRdriver stuff 00000D89 7695 ;back in desired target proc. context 00000D89 7696 150$: 00000D89 7697 movl #ss$_normal,r0 ;return "all well" indicator 00000D8C 7698 151$: 00000D8C 7699 ret 00000D8D 7700 152$: movl #8,r0 ;error return if we're messed up... 00000D90 7701 ret 00000D91 7702 .ENTRY XITHDL,^M 00000D93 7703 TSTL IOPROG 00000D99 7704 BEQL x1$ 00000D9B 7705 iokil: 00000D9B 7706 x1$: 00000D9B 7707 ; when we exit, allow process deletion 00000DAA 7708 $cmkrnl_s routin=alwdel X02/004 ?01T 00000D9B PUSHL #0 X02/063 ?01T 00000D9D PUSHAB alwdel X01/066 00000DA3 CALLS #2,G^SYS$CMKRNL 00000DAA 7709 clrl ioprog 00000DB0 7710 tstl nedast 00000DB6 7711 beql 22$ 00000DB8 7712 ; send back a special knl AST to sender to continue the I/O 00000DB8 7713 ;;; 00000DB8 7714 cmpl #1,nedast ;check kind of AST needed 00000DBF 7715 bneq 860$ 00000DCE 7716 $cmkrnl_s routin=rtnast X02/004 ?01T 00000DC1 PUSHL #0 X02/063 ?01T 00000DC3 PUSHAB rtnast X01/066 00000DC7 CALLS #2,G^SYS$CMKRNL 00000DDB 7717 $cmkrnl_s routin=nlfix X02/004 ?01T 00000DCE PUSHL #0 X02/063 ?01T 00000DD0 PUSHAB nlfix X01/066 00000DD4 CALLS #2,G^SYS$CMKRNL 00000DDB 7718 860$: cmpl #2,nedast 00000DE2 7719 bneq 861$ 00000DF1 7720 $cmkrnl_s routin=endext X02/004 ?01T 00000DE4 PUSHL #0 X02/063 ?01T 00000DE6 PUSHAB endext X01/066 00000DEA CALLS #2,G^SYS$CMKRNL 00000DFE 7721 $cmkrnl_s routin=nlfix X02/004 ?01T 00000DF1 PUSHL #0 X02/063 ?01T 00000DF3 PUSHAB nlfix X01/066 00000DF7 CALLS #2,G^SYS$CMKRNL 00000DFE 7722 861$: cmpl #3,nedast 00000E05 7723 bneq 862$ 00000E14 7724 $cmkrnl_s routin=enddel X02/004 ?01T 00000E07 PUSHL #0 X02/063 ?01T 00000E09 PUSHAB enddel X01/066 00000E0D CALLS #2,G^SYS$CMKRNL 00000E21 7725 $cmkrnl_s routin=nlfix JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 35 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 X02/004 ?01T 00000E14 PUSHL #0 X02/063 ?01T 00000E16 PUSHAB nlfix X01/066 00000E1A CALLS #2,G^SYS$CMKRNL 00000E21 7726 862$: 00000E21 7727 ;;; 00000E21 7728 clrl nedast 00000E27 7729 22$: 00000E27 7730 ; set the driver into single-journal mode 00000E27 7731 PUSHAB DESBLK ; ADDRESS OF DESBLK 00000E2D 7732 CALLS #1,G^SYS$CANEXH ; CANCEL EXIT HANDLER 00000E34 7733 $CMKRNL_S - 00000E47 7734 ROUTIN=SJUCB,ARGLST=SJ_ARG ;reset our ref count to 1 X02/031 ?01T 00000E34 PUSHAB SJ_ARG X02/063 ?01T 00000E3A PUSHAB SJUCB X01/066 00000E40 CALLS #2,G^SYS$CMKRNL 00000E47 7735 ; so deassign will decrement it to zero. 00000E55 7736 $DASSGN_S CHAN=VDCHN ;ensure the JR: channel is clear X01/002 00000E47 MOVZWL VDCHN,-(SP) X01/003 00000E4E CALLS #1,G^SYS$DASSGN 00000E63 7737 $DASSGN_S CHAN=DDCHN ;CLEAN UP I/O CHANNELS X01/002 00000E55 MOVZWL DDCHN,-(SP) X01/003 00000E5C CALLS #1,G^SYS$DASSGN 00000E63 7738 ; 00000E63 7739 ; declare host no longer is home. 00000E63 7740 ret 00000E64 7741 ; redacl(fid,myacebuf,vchn) 00000E64 7742 ; fid = 8 bytes 00000E64 7743 ; myacebuf = 256 byte buffer 00000004 00000E64 7744 p1=4 00000008 00000E64 7745 p2=8 00000E64 7746 .entry redacl,^m 00000E66 7747 movzwl @12(ap),vchn ;get channel 00000E6E 7748 bleq 999$ ;skip if illegal 00000E70 7749 movq @p1(ap),fibfid ;get the file id 1....... %AMAC-I-MEMREFNOT, (1) memory reference not naturally aligned in routine REDACL 00000E78 7750 bsbw getace 00000E7B 7751 ;if r0=1 on return, we got an ACE, copy to caller, else he zeroes it 00000E7B 7752 blbc r0,999$ ;on error just return to caller 00000E7E 7753 pushl r0 ;preserve success status 00000E80 7754 movc3 #255,ainbf,@p2(ap) ;copy ace to user buffer 00000E8B 7755 popl r0 00000E8E 7756 999$: 00000E8E 7757 ret 00000E8F 7758 ; getace - Entry to read an ACL for our ACE (if any) (used where 00000E8F 7759 ; the ACL is too long so we can't tell if our ACE is there or not.) 00000E8F 7780 getace: .jsb_entry 00000E8F 7781 clrl lpct 00000E95 7782 clrl fibacx ;init acl context 00000E9B 7783 clrl fibast 00000EA1 7784 clrl fibctx ;init fib context 00000EA7 7785 clrl fibdid ;clear the DID... 00000EAD 7786 clrw fibdid+4 ;...fid all out 00000EB3 7787 pushr #^m 00000EB7 7788 movc5 #0,fibctx,#0,#48,fibctx ;clr fib generally past fid 00000EC5 7789 100$: JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 36 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000EC5 7790 movab myil3,r7 ;address of itemlist 00000ECC 7791 incl lpct 00000ED2 7792 cmpl lpct,#250 ;max tries (got to terminate somewhere) 00000EDD 7793 bgeq 200$ ;if over this then exit 00000EDF 7794 ; processed here again, though it may be processed in other entries. ?01F 00000EDF 7795 .if df,onechn ?01F 00000EDF 7796 movl vdchn,vchn ;use global channel if using one only ?01F 00000EDF 7797 .endc 00000F08 7798 $qiow_s efn=#0,chan=vchn,iosb=iosb,func=#io$_access,p1=mfdsc,p5=r7 X02/012 ?01T 00000EDF PUSHL #0 X02/013 ?01T 00000EE1 PUSHL r7 X02/024 ?01T 00000EE3 CLRQ -(SP) X01/030 00000EE5 PUSHL #0 X02/060 ?01T 00000EE7 PUSHAB mfdsc X02/071 ?01T 00000EED CLRQ -(SP) X02/106 ?01T 00000EEF PUSHAB iosb X01/109 00000EF5 MOVZWL #io$_access,-(SP) X01/110 00000EF8 MOVZWL vchn,-(SP) X01/111 00000EFF PUSHL #0 X01/112 00000F01 CALLS #12,G^SYS$QIOW 00000F08 7799 movl iosb,r6 ;get result for debug 00000F0F 7800 blbc r6,200$ ;exit on error/end 00000F12 7801 blbc fibast,200$ ;exit on ast status err 00000F19 7802 blbc r0,200$ ;on qio call or i/o status 00000F1C 7803 cmpl gcelit,gcetgt ;our entry? 00000F27 7804 beql 300$ ;if eql yes... 00000F29 7805 brb 100$ ;else no, look some more 00000F2B 7806 200$: 00000F2B 7807 popr #^m 00000F2F 7808 movl #2,r0 ;flag error to caller 00000F32 7809 rsb 00000F33 7810 300$: 00000F33 7811 popr #^m 00000F37 7812 movl #1,r0 ;flag NO error to caller 00000F3A 7813 rsb 00000F3B 7814 ; .entry gtprv,^m ?01T 00000F3D 7842 gtprv:: .call_entry home_args=true,max_args=6 00000001 X01/034 ?01T 00000F3B .iif identical true, , _MTU_DIR_ARG_3 = 1 00000F3D 7843 ;call gtprv(ldt,prv) 00000F4C 7844 $cmkrnl_s routin=gtkprv,arglst=(ap) X02/031 ?01T 00000F3D PUSHAB (ap) X02/063 ?01T 00000F3F PUSHAB gtkprv X01/066 00000F45 CALLS #2,G^SYS$CMKRNL 00000F4C 7845 ret 00000F4D 7846 .entry gtkprv,^m 00000F4F 7847 movl @4(ap),r2 ;ldt address 00000F53 7848 bgeq 99$ ;skip if bad 00000F55 7849 movl 8(ap),r3 ;addr for privs 00000F59 7850 beql 99$ 00000F5B 7851 movl ldt$l_wprv(r2),(r3) ;copy working privs 00000F5F 7852 movl ldt$l_wprv+4(r2),4(r3) ;to user buffer 00000F64 7853 99$: movl #1,r0 00000F67 7854 ret 00000F68 7855 ; call swpuic(new,old) 00000F68 7856 .entry swpuic,^m 00000F6A 7857 movl 4(ap),swpal+4 ;new uic addr 00000F72 7858 movl 8(ap),swpal+8 ;old uic addr JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 37 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000F8D 7859 $cmkrnl_s routin=kswpu,arglst=swpal X02/031 ?01T 00000F7A PUSHAB swpal X02/063 ?01T 00000F80 PUSHAB kswpu X01/066 00000F86 CALLS #2,G^SYS$CMKRNL 00000F8D 7860 ret 00000F8E 7861 .entry kswpu,^m 00000F90 7862 MOVL G^CTL$GL_PCB,R2 ;get PCB 00000F97 7863 movl pcb$l_uic(r2),r3 00000F9C 7864 movl r3,@8(ap) ;save old uic for caller 00000FA0 7865 movl @4(ap),pcb$l_uic(r2) ;replace with new one 00000FA6 7866 movl #1,r0 00000FA9 7867 ret 00000FAA 7868 ; sjucb - close ucb out 00000FAA 7869 .ENTRY SJUCB,^M 00000FAC 7870 pushl r1 ?01F 00000FAE 7871 .if ndf,vms$v5 ?01F 00000FAE 7872 MOVL G^SCH$GL_CURPCB,R4 ;;; NEED OUR PCB ?01T 00000FAE 7873 .iff ?01T 00000FAE 7874 MOVL G^CTL$GL_PCB,R4 ;;; NEED OUR PCB (VMS V5) ?01T 00000FB5 7875 .endc 00000FB5 7876 ;;; NEED IPID FOR DRIVER'S CALL TO SCH$POSTEF TO THIS HOST!! 00000FB5 7877 JSB G^SCH$IOLOCKW ;;; LOCK I/O DATABASE 00000FBB 7878 MOVL 8(AP),R1 ;;; ADDRESS VDn NAME DESCRIPTORS 00000FBF 7879 JSB G^IOC$SEARCHDEV ;;; GET UCB ADDRESS INTO R1 00000FC5 7880 BLBS R0,160$ 00000FC8 7881 BRB JSH_XIT 00000FCA 7882 160$: ?01F 00000FCA 7883 .if ndf,evax ?01F 00000FCA 7884 movw #1,ucb$w_refc(r1) ;;;ensure ref cnt bashes to 1 ?01F 00000FCA 7885 ;so deassign will work ?01T 00000FCA 7886 .iff ?01T 00000FCA 7887 movl #1,ucb$l_refc(r1) ;;;ensure ref cnt bashes to 1 ?01T 00000FCE 7888 ;so deassign will work ?01T 00000FCE 7889 .endc 00000FCE 7890 MOVL #SS$_NORMAL,R0 00000FD1 7891 JSH_XIT: 00000FD1 7892 PUSHL R0 00000FD3 7893 JSB G^SCH$IOUNLOCK ;;; UNLOCK I/O DATABASE (DROP IPL) 00000FD9 7894 POPL R0 ;;; REMEMBER R0 00000FDC 7895 popl r1 00000FDF 7896 RET ;;; BACK TO USER MODE NOW 00000FE0 7897 ; Quick function here to return operating mode mask. 00000FE0 7898 ; 00000FE0 7899 ; Mode meanings (used for delete etc...) 00000FE0 7900 ; Bit Meaning 00000FE0 7901 ; 0-1 0 = use .COM file 00000FE0 7902 ; 1 = use rename mode 00000FE0 7903 ; 2 = use copy (callable cvt) mode 00000FE0 7904 ; 3 = copy and add softlink. No database file genn'd 00000FE0 7905 ; 2 If set don't delete ANYthing immediately 00000FE0 7906 ; 3 If set don't include only included names 00000FE0 7907 ; 4 If set, delete file if no room for rename/copy 00000FE0 7908 ; If clear, leave file alone if copy area is full (return error though) 00000FE0 7909 ; 5 If set, no timetag on deleted files (use if using softlink...) 00000FE0 7910 ; 00000FE0 7911 .entry mymode,^m<> 00000FE2 7912 movl modmsk,r0 ;get mode mask JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 38 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00000FE9 7913 ret 00000FEA 7914 .entry jgtprvs,^m 00000FEC 7915 subl2 #12,sp 00000FEF 7916 movl sp,r11 00000FF2 7917 movl #2,(r11) 00000FF5 7918 movl 4(ap),4(r11) 00000FFA 7919 movl 8(ap),8(r11) 0000100E 7920 $cmkrnl_s routin=kgtprvs,arglst=(r11) X02/031 ?01T 00000FFF PUSHAB (r11) X02/063 ?01T 00001001 PUSHAB kgtprvs X01/066 00001007 CALLS #2,G^SYS$CMKRNL 0000100E 7921 addl2 #12,sp 00001011 7922 ret 00001012 7923 .entry kgtprvs,^m 00001014 7924 ; expect 2 args, in knl mode 00001014 7925 ; this should be pcb address and address of priv vector 00001014 7926 movl @4(ap),r2 ;get pcb address 00001018 7927 bgeq 99$ 0000101A 7928 movq pcb$q_priv(r2), r3 ;r3,r4 are privs now 0000101F 7929 movl 8(ap),r6 ;output 00001023 7930 bleq 99$ 00001025 7931 movl r3,(r6)+ 00001028 7932 movl r4,(r6) 0000102B 7933 99$: 0000102B 7934 ret 0000102C 7935 ; set a bit in the array like jbdriver_bmap tests... 0000102C 7936 ; Assumes array is 2KB long!!! 0000102C 7937 .entry vbset,^m 0000102E 7938 ; call vbset(bytearray,filnum) 0000102E 7939 movl 4(ap),r2 ;array base 00001032 7940 movl @8(ap),r3 ;file number 00001036 7941 ; f.nuyms & f.mask must vary together FFFFC000 ?01T 00001036 7942 .iif ndf,f.mask,f.mask=-16384 ; 2k buffer 00001036 7943 bicl #f.mask,r3 ;mask extra file num bits off 0000103D 7944 ashl #-3,r3,r4 ;get byte in array to r4 00001042 7945 addl3 r2,r4,r6 ;address correct byte 00001046 7946 bicl #-8,r3 ;get bit in byte 0000104D 7947 bbss r3,(r6),10$ ;set the bit 00001051 7948 10$: 00001051 7949 ret 00001052 7950 .entry inhdel,^m 00001054 7951 MOVL G^CTL$GL_PCB,R4 ;get PCB 0000105B 7952 bisl #pcb$m_nodelet,pcb$l_sts(r4) ;prevent process deletion 00001064 7953 movl #ss$_normal,r0 00001067 7954 ret 00001068 7955 .entry alwdel,^m 0000106A 7956 MOVL G^CTL$GL_PCB,R4 ;get PCB 00001071 7957 bicl #pcb$m_nodelet,pcb$l_sts(r4) ;allow process deletion 0000107A 7958 movl #ss$_normal,r0 0000107D 7959 ret 0000107E 7960 .entry fixfid,^m 00001080 7961 movl 4(ap),r11 ;where to set file id 00001084 7962 movab fibwrk,r0 00001097 7963 zapz (r0),#128 ;zero the FIB X01/001 0000108B pushr #^m ;save regs from movc5 X01/002 0000108D movc5 #0,(r0),#0,#128,(r0) X01/003 00001095 popr #^m ;save regs from movc5 JTDMN ;JT driver open daemon & setup 5-JAN-1995 09:24:31 AMAC V2.1-13-2671 Page 39 V001 EXTERNAL AND LOCAL DEFINITIONS 3-JAN-1995 17:38:28 SYS$SYSDEVICE:[EVERHART.JT]JTDMN.MAR;81 00001097 7964 movw 6(r11),fibwrk+fib$w_did ;set up DID 0000109F 7965 bneq 199$ 000010A1 7966 299$: brw 99$ 000010A4 7967 199$: 000010A4 7968 movl @8(ap),fibwrk+fib$w_did+2 ;all 6 bytes 000010AC 7969 movl @12(ap),namdsc ;copy the length 000010B4 7970 bleq 299$ 000010B6 7971 movl namdsc,r9 000010BD 7972 movl 16(ap),r8 000010C1 7973 addl2 #128,r8 ;get address of text 000010C8 7974 movab namtxt,r7 ;and where to store it 000010CF 7975 movc3 r9,(r8),(r7) ;copy text to our space now 000010D3 7976 movl 20(ap),r2 ;get channel 000010D7 7977 bleq 299$ ;must be + 000010D9 7978 movab fibdsc,r5 000010E0 7979 movab namdsc,r6 000010E7 7980 ; use an io$_access function to cause the directory lookup 00001106 7981 $qiow_s chan=r2,efn=#2,func=#io$_access,iosb=xxiosb,p1=(r5),p2=r6 X02/010 ?01T 000010E7 CLRQ -(SP) X02/024 ?01T 000010E9 CLRQ -(SP) X01/030 000010EB PUSHL r6 X02/060 ?01T 000010ED PUSHAB (r5) X02/071 ?01T 000010EF CLRQ -(SP) X02/106 ?01T 000010F1 PUSHAB xxiosb X01/109 000010F7 MOVZWL #io$_access,-(SP) X01/110 000010FA MOVZWL r2,-(SP) X01/111 000010FD PUSHL #2 X01/112 000010FF CALLS #12,G^SYS$QIOW 00001106 7982 blbc r0,99$ 00001109 7983 blbc xxiosb,99$ 00001110 7984 movl fibwrk+fib$w_fid,(r11) 00001117 7985 movzwl fibwrk+fib$w_fid+4,4(r11) ;return file id 0000111F 7986 99$: 0000111F 7987 ret 00001120 7988 .END ADVDD