1 Assembler C9208 12-May-93 12:30 PAGE 1 F 0 1 GLOBAL BLOCK Global Block 2 EXT 3 INPUT PROP put proprietary notice in listing! 1 2 3 4 5 6 7 8 9 10 * ......... BBBBBBBBBBBBBBBBBB TTTTTTTTTTTTTTTTTTTTTTTT IIIIIIIIIIII 11 * ................. BBBBBBBBBBBBBBBBBBBBB TTTTTTTTTTTTTTTTTTTTTTTT IIIIIIIIIIII 12 * ..........##......... BBBBBBBBBBBBBBBBBBBBBB TTTTTTTTTTTTTTTTTTTTTTTT IIIIIIIIIIII 13 * ............##........... BBBBBB BBBBBB TTTTTT TTTTTT TTTTTT IIIIII 14 * .............##............ BBBBBB BBBBBB TTTTT TTTTTT TTTTT IIIIII 15 * .............##............ BBBBBB BBBBBBB TTTT TTTTTT TTTT IIIIII 16 * ..............##............. BBBBBBBBBBBBBBBBBBB TTTTTT IIIIII 17 * ..............##............. BBBBBBBBBBBBBBBBB TTTTTT IIIIII 18 * ..............##............. BBBBBBBBBBBBBBBBBBB TTTTTT IIIIII 19 * .............##.............. BBBBBB BBBBBB TTTTTT IIIIII 20 * ...........##.............. BBBBBB BBBBBB TTTTTT IIIIII 21 * ..........##............... BBBBBB BBBBBB TTTTTT IIIIII 22 * ........##............... BBBBBB BBBBBBB TTTTTT IIIIII 23 * .....##.............. BBBBBBBBBBBBBBBBBBBBBBBB TTTTTTTTTTTT IIIIIIIIIIII 24 * ................. BBBBBBBBBBBBBBBBBBBBBBB TTTTTTTTTTTT IIIIIIIIIIII 25 * ......... BBBBBBBBBBBBBBBBBBBB TTTTTTTTTTTT IIIIIIIIIIII 26 * 27 * 28 * ****** Copyright 1982, 1983, 1984, 1985, 1986, 1987, 1988, 29 * 1989, 1990, 1991, 1992 BTI Computer Systems ****** 30 * 31 * This document and the program it describes are the exclusive property 32 * of and proprietary to BTI Computer Systems. No use, reproduction or 33 * disclosure of this document or its contents, either in full or in part, 34 * by any means whatsoever regardless of purpose may be made without the 35 * prior written consent of BTI Computer Systems. 36 * 37 * BTI Computer Systems 38 * Sunnyvale, California 94086 4 INPUT REVISIONS revision data 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 2 (REVISIONS) F 3 3 4 ********************************************************************************** 5 * * 6 * Rev. Date * 7 * ---- --------- * 8 * 3.10 24 Jun 85 ( A20, 9C release was reassembled as 3.10-1 ) * 9 * Error return from DISKIT in share/unshare freq * 10 * processor changed to unmap WNDO1. * 11 * C8506h 29 Jun 85 * 12 * Cancel disk space low operator message when disk * 13 * is dismounted. * 14 * Minor changes to maintenance dismount code, VOLNAWAY * 15 * now indicates volume in process of being dismounted. * 16 * C8507 02 Jul 85 * 17 * Created FILLTCQ subroutine from terminal write FREQ so * 18 * that ECHOLINE can use the same chunk of code. Changed * 19 * the way stack space is allocated in INITWRITE. Rewrite * 20 * ECHOLINE to use FILLTCQ, and handle line kill processing * 21 * correctly. This also fixes the problem of having * 22 * delays set for delayable characters in echo mode 3. * 23 * C8507a 11 Jul 85 * 24 * Restored check for power fail at beginning of dispatcher, * 25 * this guarantees that all CPUs will execute the power fail * 26 * restart code. * 27 * Moved SETMEMTRAP call from INITWRITE to the beginning of * 28 * each write FREQ. This allows the write routines to set * 29 * different error addresses. Added PASSERRW1 which does * 30 * a GRUBWNDO1 before executing the PASSERRUP code. * 31 * 3.10-1 12 Jul 85 (9C patched to 3.10-10, CM 2.5) * 32 * Changed OUTTSET to not flush input and output buffers. * 33 * Fix to the recover SAF block code so that if a current * 34 * block (FCMABLK) is not specified, the load point block * 35 * is used instead. * 36 * C8507b 17 Jul 85 * 37 * Changed CIA driver to only put as many characters into * 38 * a port's output buffer as can be output in 4 CIA cycles * 39 * (200 ms). Added port option to XOFF the port when the * 40 * input buffer gets more than half full. XON gets sent * 41 * when the input buffer reaches less than 1/8 full, or * 42 * the input buffer gets flushed, or on a port reset. * 43 * C8507c 22 Jul 85 * 44 * New FREQs FRTSETXOIQ and FRTGETXOIQ to set and get the * 45 * XOFF port on input buffer full option. * 46 * Reread Modem/Hardwire jumper in CIA_RESET. * 47 * C8507d 25 Jul 85 * 48 * Added GRUBWNDO1 for file page in RAFREAD/CODEREAD at * 49 * USRMEMBAD (patched into 3.10-2). * 50 * Prevent S0007 by preserving R3 (FDE address) around * 51 * call to GRUBWNDO2 in RAFEXPAND (patched into 3.10-2). * 52 * Changes to the PRIV2MOD routine to protect spooled files * 53 * from changes by non .!!!, .SYS users. This prevents * 54 * unsaving devices from hardware.sys by unprivileged users. * 55 * C8507e 31 Jul 85 * 56 * Changed SPLRTIME from 30 seconds to 600 seconds. * 57 * Forestalls 'spooler currently unavailable' on loaded * 58 * systems (patched into 3.10-2). Fix to the path WFM * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 3 (REVISIONS) F 3 59 * code. It didn't recognize EOR, consequently it * 60 * did stores with an uninitialized register (R7). * 61 * Added 2 new trace calls to the CIA driver. * 62 * Added code to SSU_RESET to have the SSU keep FDATE * 63 * current using a new microcode feature. This * 64 * requires a jump instruction to be changed to a NOP. * 65 * C8508 07 Aug 85 * 66 * Changed CIATPS to 10 and CIATICKTIME to 45. Also changed * 67 * WAIT30SEC to WAIT60SEC and WAIT60SEC to WAIT120SEC in the * 68 * CIA driver. These changes reflect the discovery that a * 69 * CIA tick equals 2.2 ms and not the documented 1 ms. * 70 * Changed subroutines that modify FDATE to check SSUVER * 71 * first and if using a new SSU to not update FDATE. * 72 * Replaced the unconditional jump around the code to set * 73 * up the SSU updating FDATE in SSU_RESET to check SSUVER. * 74 * Added FSNDATE to keep track of the last dispensed serial * 75 * number for systems using SSU updated FDATE to assure * 76 * unique serial numbers. * 77 * Added SMULIST to keep track of SMUs on the system. * 78 * This list is built in HAVEMEMORY in INITIAL. * 79 * Added SMUCHECK (called from DEADMAN) which reads * 80 * SMU error logs once a minute. Changed CIA driver * 81 * to look for the PORTCINIT parameter instead of the * 82 * PORTCRALL parameter after the PORTCRESET command. * 83 * Removed old code that allowed for CPUs not recognizing * 84 * power fail while executing WAIT instructions. This * 85 * code was causing errors due to the new code that * 86 * enables interrupts in DISPATCH. * 87 * C8508a 08 Aug 85 * 88 * Added new fields to COMM block to hold a pointer to the * 89 * first TCB in the TCB list belonging to this comm, and a * 90 * count of the terminals timing belonging to this comm. * 91 * Changed terminal timing values to negative counts so that * 92 * timing TCBs can be LSRCHed for the sign bit on in the * 93 * timing count field. Changed timing routine to use these. * 94 * Created new file CONSTANTS and moved memory management * 95 * constants, BITTAB, etc. into it. Also moved many * 96 * constants from COREDEFS into routines that use them. * 97 * Split COREDEFS into CPUPAGE, COREDEFS, VIRTCOREDEFS, * 98 * and USERCOREDEFS. * 99 * C8508b 12 Aug 85 * 100 * Fixed S0005 in OPENERRBZY portion of FROPEN requests by * 101 * having FREETEMPS and SELFFWAIT save R2. Before, a load * 102 * from the FCB was being made after FREETEMPS dumped the * 103 * FCB. * 104 * C8509 20 Sep 85 * 105 * Fix in initial to properly calculate the free storage * 106 * equilibrium value (FSXCOUNT). * 107 * C8510 01 Oct 85 * 108 * Changes to MS driver. READ does no error recovery during * 109 * headchecks (added MDVLOWTOL). Removed READ1TRACK, * 110 * incorporated this function into READTRACKS, which only * 111 * reads one sector off each track. Also, checker quits * 112 * as soon as error limit is exceeded. * 113 * Change to sleep code in dispatcher so that the error log * 114 * list and accounting list are empty before system allowed * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 4 (REVISIONS) F 3 115 * to sleep. Change in dispatcher to check to see if a * 116 * process wants to run on a specified CPU. * 117 * OPREQ ORSETCPU to select a CPU for a process to run on. * 118 * C8510a 01 Oct 85 * 119 * Fix to open .VOL so that special privileges over alias * 120 * dir are not required to execute open successfully. * 121 * Addition of pseudo-command for the comm driver to * 122 * indicate reset the port's interface state. * 123 * C8510b 07 Oct 85 * 124 * Fix to open, close, destroy, and unsave code so log * 125 * entries will go in the proper accounting files. * 126 * Fix to abort, terminate, and evict, to set the proper * 127 * port number when a batch job is involved. * 128 * Addition of CPUINIT to keep track of number of CPUs * 129 * on INITIAL page. When goes to zero INITIAL page is * 130 * made available for free storage. * 131 * Changes to ORVANISH when system is sleeping so that * 132 * the system volume will not be dismounted until all * 133 * accounting and error log entries have been made. * 134 * C8510c 14 Oct 85 * 135 * Addition of logon account names to alias and unalias * 136 * logging. New OPREQs OPRCPUSTOP and OPRCPUSTRT to remove * 137 * and restore CPUs from active work in the system. * 138 * C8510d 16 Oct 85 * 139 * The volume mount and dismount code now writes to the * 140 * Manager.Sys accounting log file, informing who loaded * 141 * or unloaded a specific volume. * 142 * C8510e 17 Oct 85 * 143 * Added GRUBWNDO1 after FORCEWRW1 in RAFEXPAND. * 144 * Cleaned up the code that generates accounting records * 145 * for file opens, basically used existing subroutine. * 146 * Added additional information returned by the session * 147 * information request, being a bit indicating whether * 148 * the session was created by the system or a user. * 149 * C8510f 24 Oct 85 * 150 * Added OPREQ to remove memory pages from service * 151 * for system load testing. Modified FSXPAND to * 152 * actually do the removal and restoration. * 153 * Added 0 case to PROCPOWER session finder. Allows 0 * 154 * for session number in ORPABORT, ORPEVICT, ORPTERMIN. * 155 * Fix to OPRSTRTBAT request in that standard input * 156 * unit is tagged as a CM unit. This disallows rewinds * 157 * by anyone other than Control Mode. * 158 * Changes to INITIAL and INITPROC to generate PPLs * 159 * for their pages but put them on PPLINIT list. * 160 * INITPROC then moves these to the idle list when * 161 * finished and makes its pages available for free storage. * 162 * Reordering of some system files (INTPROC, SPROCSTART, * 163 * CONVERSION, AFTMANGLE, HOURPROC). * 164 * Moved FETCHDIR and FREEDIR into ULBTWIDDLE. * 165 * C8510g 25 Oct 85 * 166 * ALL mount and dismount requests and support routines * 167 * moved into MOUNTUTIL and OPRQMOUNT. * 168 * Various volume and system information requests moved * 169 * from XRQOPREQ2 to OPREQCVOL. * 170 * OPREQ files reordered. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 5 (REVISIONS) F 3 171 * C8510h 31 Oct 85 * 172 * Renamed CAIMSABORT to CAIMABORT. * 173 * Removed unused symbol ALIAGVER, and unused pointer * 174 * LONGERSP and word LONGERS. * 175 * Set bit in PCB indicating special project for CPU patch * 176 * process and CPU stop process. * 177 * Set FLAGS bit in POWERUP to reload CPU microcode patches. * 178 * Removed TERMTIMING word (now kept track of in COMBLOCK). * 179 * Boxed out ascii parity table, TTYPARTAB (unused). * 180 * Changed FCFBC to FCFBD (file being destroyed not closed). * 181 * C8511a 04 Nov 85 * 182 * Changed FILLTCQ to not do CMOVE into TCQ. Changed * 183 * terminal write code to catch user memory errors. * 184 * Changed ORDESACCT OPREQ to call XREQs to return disk * 185 * and CPU limits to manager account. * 186 * Removed halt S0201 from comm driver. * 187 * C8511b 04 Nov 85 * 188 * Minor bug fixes to the backup/recover requests. All * 189 * recover requests should trap user memory errors * 190 * correctly. Initialize volume request should copy * 191 * the system configuration information and store it * 192 * into both security blocks. * 193 * C8511c 06 Nov 85 * 194 * Implementation of the account foreign flag. This * 195 * prevents managers on a volume from a different system * 196 * from having access to accounts not on his volume. * 197 * Boot, PowerUp, PowerDown, Sleep accounting records * 198 * are now written to the manager.!!! account if an * 199 * accounting file exists. * 200 * C8511d 11 Nov 85 * 201 * Register usage change in FRQNOPEN to ensure that * 202 * initial privileges are set properly. * 203 * The account names in file accounting records have been * 204 * switched, this allows the entries to be written to the * 205 * correct manager/user accounts. File actions are not * 206 * logged if the file accessor is also the file owner. * 207 * Checks for alias or unalias account being same as logon * 208 * account when creating accounting record moved to central * 209 * routine. * 210 * Failed alias accounting record now contains logon * 211 * account name. * 212 * Reorganization of the INITDEVACS and LINKPHYDEV routines. * 213 * C8511e 13 Nov 85 * 214 * Changes to OPEN and CLOSE code to keep terminal busy * 215 * count in the TCB so that any port may be opened * 216 * both RO and RW. * 217 * C8511f 14 Nov 85 * 218 * Combined FREQECHO, FREQUNIT, and FREQMKPATH into * 219 * FREQUNIT file. * 220 * Added FREQ to switch resources associated with 2 units. * 221 * Moved code to make accounting entries for evicts, * 222 * aborts, etc. into a subroutine. Rearranged code in * 223 * OPR process control section. * 224 * Fix to the logoff code so that an unalias record gets * 225 * the correct logon account name. * 226 * C8511g 18 Nov 85 * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 6 (REVISIONS) F 3 227 * Added OPREQs to put a process in the STOPWAIT queue, * 228 * and to remove it from same. Made changes to DISPATCH * 229 * to actually put the process in STOPWAIT. Added 2 new * 230 * accounting types for these activities. * 231 * C8511h 27 Nov 85 * 232 * Bug fix to lock PCNTLLOCK in PROCPOWER 0 case. * 233 * Changed PROCPOWER to allow nonzero self-spec even * 234 * if the requester is a system session. * 235 * Changed powerfail code to live through multiple * 236 * powerfails. Involved POWERUP, POWERUP2, OWNCOPY, * 237 * ZEROPAGE, CIADRIVER, and new CPU var POWERRTNPC. * 238 * Enhancements to the foreign account restriction. * 239 * Basically, we disallow access by foreign accounts and * 240 * inhibit access to foreign accounts. Foreign accounts * 241 * may only receive information on similar foreign * 242 * accounts (same system serial number), while * 243 * non-foreign accounts will not receive privileges * 244 * over foreign accounts. * 245 * C8512a 04 Dec 85 * 246 * Changes to the open service routine to initialize * 247 * the SAF end pointers when files are opened /RO. * 248 * This allows faster SEODs even when the file is * 249 * not open for writing. * 250 * Removed jump around check for CM unit in LUNSEARCH. * 251 * Fix exchange save request to set the SAF end pointers. * 252 * Added UNITWAIT queue for processes waiting to give or * 253 * receive units from other processes. Added UREQs to * 254 * give and receive units between sessions. * 255 * C8512b 04 Dec 85 * 256 * Added check in create FCB routine to ensure enough * 257 * user free storage before we hand out a new FCB. * 258 * This prevents system crashes by arbitarily * 259 * opening a whole slough of units. * 260 * C8512c 05 Dec 85 * 261 * Fixed TAPENOTRDY in MTDRIVER to not loop trying to * 262 * rewind a drive that has errors but is still "ready" * 263 * and the controller is not dead (reported by UK). * 264 * Changed message send UREQ to pass bit indicating it is * 265 * ok to interrupt receiver if his interrupts are enabled. * 266 * Added to OUTTSET creating and linking in a command * 267 * element to reset the port's primary status word. * 268 * Added check in CHECKUINT for unit being given interrupt. * 269 * C8512d 09 Dec 85 * 270 * New OPREQ for CM to use when attaching to a session. * 271 * UINTDISC returns unit number of disconnected terminal as * 272 * parameter (high bit set if absolute i/o unit). Changed * 273 * UNMOUNTVOL in MSPROC to use MDVVOLFLD symbol, instead of * 274 * VOLFIELD, for clarity. Changed CHECKSTATE to not * 275 * UNMOUNTVOL in NODRIVE case if the drive was not thought * 276 * to be ready. Changed UNMOUNTVOL to log 'not ready' * 277 * even if there was no volume mounted. * 278 * C8512e 10 Dec 85 * 279 * Increased stack size for the error log process to 7 to * 280 * give a little more margin for changes in stack usage. * 281 * Added new error code for attaching to session so that * 282 * we can pass the session number of the attacher to the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 7 (REVISIONS) F 3 283 * attachee. * 284 * Added another entry into LUNSEARCH (LUNSEARCHX) that * 285 * checks for units 201 and up being in control mode. * 286 * Changed FRRESSWTCH and URGIVEUNIT to use LUNSEARCHX. * 287 * C8512f 11 Dec 85 * 288 * Added code to check for new PPUs on an all SMU system * 289 * and if found to enable triple word transfers for the PPU. * 290 * Modified slot loop in initial to loop once looking for * 291 * memory and then loop looking for other devices. This * 292 * removes the OS requirement that memory must reside in * 293 * slots lower than other devices. Modified DEADMAN to * 294 * reset the bit in the PPU to enable triple word transfers * 295 * whenever a device attached to the PPU must be reset. * 296 * C8512g 18 Dec 85 * 297 * Bug fix in ORATTACH request. * 298 * Changed register usage in INTPROC so R1 will contain * 299 * error code at STOPC1200 even if the error went through * 300 * PASS2CM on the way. * 301 * Changed URGIVEUNIT to allow giving a control mode unit * 302 * even if privilege is not modify. * 303 * Fix to catalog read request, so that if one has no * 304 * privilege to a DIR than the header information for the * 305 * system volume is returned. * 306 * Rewrite of the recover file request to recover hardware * 307 * file types properly. Also additional fixes to make * 308 * ready on full implementation of selective backup. * 309 * Fixes to the unit give and receiving requests to * 310 * properly update the related hardware control elements. * 311 * Fix to disallow access to device from file other than * 312 * one in hardware.sys on system disk, A/U error returned. * 313 * C8512h 27 Dec 85 * 314 * The ORATTACH request no longer allows the requesting * 315 * session and the destination session to be one * 316 * and the same! * 317 * C8601a 05 Jan 86 * 318 * Addition of SETMEMTRAP for a text with forms write, this * 319 * traps correctly when fetching the control character. * 320 * Also change to the memory protect recover code to pass * 321 * error directly to overprocess (PASSERRUP) and not to * 322 * process as an XREQ error (FERROR). * 323 * Reorganization of the backup recovery request to check * 324 * for exceeding limits. * 325 * Addition of the ULLIMLOCK to setup critical region when * 326 * changing limits in the ULB. This was necessary because * 327 * most of the fields in the ULB are ZBMs. Proper locking * 328 * will be implemented initially for ULDSKUSD, others to * 329 * follow. * 330 * C8601b 06 Jan 86 * 331 * Bug fix in UREQRCVU to properly set FCB pointer in TCB. * 332 * C8601c 08 Jan 86 * 333 * Better checking for CM units in FRRESSWTCH and * 334 * URGIVEUNIT requests. * 335 * Minor fixes for foreign account checking. Also fix * 336 * to DIR read to return proper system number. * 337 * C8601d 14 Jan 86 * 338 * Added a NOP in memory parity error routine so that it * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 8 (REVISIONS) F 3 339 * can be easily patched to not send a WRU(0) to MCUs. * 340 * Added backup privilege to INITPROC. * 341 * Rewrite the code file write protect code to not * 342 * use RSEEK. Change to RSEEK to unmap WNDO1. Changed * 343 * all callers of RSEEK accordingly. * 344 * C8601e 16 Jan 86 * 345 * Change to FROPEN code to properly free a file if the * 346 * file being destroyed bit is set. * 347 * Fixes to ensure proper list locking during updates to * 348 * word 0 of the ULB. This was a possible cause for ULB * 349 * list screwups, if others occur, then we need to look * 350 * elsewhere. * 351 * Implemented the new ULB limit lock, ULLIMLOCK, to * 352 * protect following fields: ULDSKUSD, ULDSKLIM, * 353 * ULSCRDSK. Others to follow as necessary. * 354 * Reworked the create account request into two * 355 * separate requests, one for managers the other for * 356 * backup. * 357 * Fix so that the correct account serial number gets * 358 * placed into FBI on share and authlist blocks. * 359 * Fixes to GETPUTADT to avoid PUNLOCK on a lock not * 360 * held. Added a GRUB for block about to be freed. * 361 * Added MAPOUTFBI and GRUB in disk error processing * 362 * to dump bad block before continuing. * 363 * C8601f 21 Jan 86 * 364 * Tiny RAFs added. Change to terminal delay so * 365 * rounding errors will not generate a POB error. * 366 * PFNOREFVAL added to MACHDEFS and used in PFPUTIL. * 367 * Change in Timer at SSU_INT to save one instruction. * 368 * Fix to open of .DIR, so that account serial number * 369 * is put into the FCB. * 370 * C8601g 21 Jan 86 * 371 * Fix to file size updating when expanding a RAF. * 372 * Change create account to use logon ULB and not * 373 * privilege ULB if program has backup privilege. * 374 * C8601h 23 Jan 86 * 375 * Minor bug fixes to create account code. * 376 * Minor bug fix to recover RAF file pages. * 377 * Bug fix in GETFSEQN associated with new SSU ucode * 378 * for clock update to memory. * 379 * C8601i 24 Jan 86 * 380 * Addition of an Executive Request to cycle the * 381 * cartridge tape, FRCYCLE FREQ (1E). * 382 * C8601j 28 Jan 86 * 383 * Bug fix in Monitor parameter out of bounds error * 384 * return (clears IHBUSY). * 385 * Fix to error recovery for SAF write. File lengths * 386 * and account limits should all be restored properly. * 387 * C8601k 30 Jan 86 * 388 * Addition of an Executive Request to recover an * 389 * account and deallocate the needed resources from an * 390 * appropriate manager. * 391 * C8602 03 Feb 86 * 392 * Mask character before checking if line kill. * 393 * Change to SCAN4DLY to also look for the character * 394 * with the high bit turned on. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 9 (REVISIONS) F 3 395 * Change in SMUCHECK due to the high bit no longer * 396 * being set on error responses. * 397 * Added CHECK4CM subroutine to ensure that if a unit is * 398 * CM's then CM is the one diddling with it. Added calls * 399 * to this in rewind, backspace, and skip to filemark * 400 * backwards requests. * 401 * Changed FCSAFEPP, FDSAFEPP, FCSAFEND, FDSAFEND to FCEPP, * 402 * FDEPP, FCEND, FDEND to reflect their usage by non-SAFs. * 403 * Changes to keep track of the RAF end position. * 404 * C8602a 04 Feb 86 * 405 * Removed unused symbols from create and destroy account * 406 * XREQs and stack allocation from destroy account XREQ. * 407 * Added new halt code to replace the second usage of * 408 * HALTS1280. Changed error exit in recover FP to unmap * 409 * FBIs. Removed label GIVEDSEUM. * 410 * Removed VIQDIDLE from volume information request record, * 411 * UPCOMSGSER from UPC, UERRORDSE error return from * 412 * XREQPROC, and DORELSSDE error return from release FREQ. * 413 * Bug fix to WHOLOOK routine to check only a limited class * 414 * of privileges, rather than the whole UPCPRIV field. * 415 * Fix to exchange save to propagate the file log bit, not * 416 * log the unsave of the orignal file, and log the * 417 * exchange save. Change CPR to UCPR in RSEEK and WSEEK * 418 * so very large RAFs will work. * 419 * C8602b 05 Feb 86 * 420 * Bug fix to create account so that manager ULB is freed * 421 * when no longer needed. Change to RAF position code so * 422 * that it checks to see if back at load point. Fix to * 423 * the backup file page request to not loop indefinitely * 424 * if the very last block in a large RAF is non-hole. * 425 * C8602c 07 Feb 86 * 426 * Fix to file log event subroutine to ignore those events * 427 * caused by the system. This prevents system crash by * 428 * setting FLOG flag on accounting.logfil file. * 429 * Headchecker now suppresses potentially confusing Perm * 430 * Read log entry (only one error is needed to perm a * 431 * block during head check). * 432 * Addition of sequential RAF read and write routines * 433 * (FRSREAD, FRSREADB, FRSWRITE). * 434 * C8602d 10 Feb 86 * 435 * Modify FRSEOD request to work for RAFs. Addition of * 436 * FWSP and BKSP routines for RAFs. New FREQ FREPP added * 437 * to return the end position pointer of a RAF or SAF. * 438 * Echo unit now allowed to deal with RAFs. * 439 * C8602e 11 Feb 86 * 440 * Programs running with backup privilege no longer do * 441 * any file logging, regardless of the FLOG flag value. * 442 * Added trace calls to substitution process. * 443 * C8602f 26 Feb 86 * 444 * Bug fix in unsubstitute process. Set NOSUB flag in FBI * 445 * of substitution block during volume recover request. * 446 * Fix to the session information request so that CPU time * 447 * limit is returned in seconds and not milliseconds to * 448 * agree with documentation. * 449 * Fix to create account so that error returned if trying * 450 * to create account on a foreign volume. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 10 (REVISIONS) F 3 451 * Added entry in LFWEIGHTTAB for UNITWAIT queue. * 452 * Change to volume mount code to set the new volume * 453 * revision level in the volume label. This prevents * 454 * an old OS from mounting a volume with tiny RAFs. * 455 * Changed INITTERM default for TCLASTCOM2 to include * 456 * 1*PCFBRKOUT (terminal should delay output during break). * 457 * C8602g 27 Feb 86 * 458 * Converted the backup RAF/CODE page lookup into a * 459 * subroutine and added an Executive Request to find * 460 * the next non-hole page in a RAF/CODE (FRRAFNEXT FREQ). * 461 * C8602h 28 Feb 86 * 462 * Removed PABLOCK and replaced it with PAPPLPTR. This * 463 * also involves calling TESTTRUBL before the WSX check. * 464 * Minor bug fixes to the find next non-hole in RAF/CODE * 465 * request. * 466 * C8603a 13 Mar 86 * 467 * Fixed READ in MSPROC to ensure block with segment * 468 * correction is actually rewritten. Took out * 469 * 'unloaded vol' check prior to SUBSTITUTE call * 470 * (redundant because SUBSTITUTE checks). * 471 * Backup privilege now sufficient to execute manager * 472 * requests. However the privileges come from the * 473 * logon account and not the privilege account (OWNDIR * 474 * is ignored). * 475 * Added global file control block for all files opened MW. * 476 * Change FDE to use a 2 bit field to keep track of RAF * 477 * type. Added this field to the FCB (used only for RAFs * 478 * and CODEs). Removed RAFPTRLOCK (now lock is on a * 479 * per file basis in GFC). * 480 * C8603b 25 Mar 86 * 481 * New user interrupt scheme. Trapping goes up the * 482 * underprocess tree. Errors not lost in process * 483 * switching. Errors can be local to underprocess. * 484 * Trapper's TCG, TCA, and TCINTE are used even if * 485 * trapper is not CPCUPC. * 486 * Fix in OUTTSET so second element created will not * 487 * be lost if the port must be XONed. * 488 * Moved a call to DELINKUERR outside of the critical * 489 * region locked by PSLOCK. This was because DELINKUERR * 490 * itself attempted a lock on PSLOCK. * 491 * Bug fix in OPEN code when file being destroyed bit * 492 * is set. Fix to FREEFILER to properly free a RAF. * 493 * Fix to DISMTDMY to properly cancel disk low message. * 494 * C8604a 04 Apr 86 * 495 * Changes made to the logon and logoff request to adjust * 496 * scratch block limits so that the current logon account * 497 * (system account also) reflects what is in use. This * 498 * also involved changes to Control Mode, for additional * 499 * details consult the begining of the Control Mode * 500 * listing. * 501 * C8604b 15 Apr 86 * 502 * Change to initial so that when each TCB is built a * 503 * default baud rate of 300 is set for both the input * 504 * and output bauds. * 505 * Change to CHECKDCH routine to store its return address * 506 * on a preallocated stack location. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 11 (REVISIONS) F 3 507 * Added FRTAPESTAT to return PPU and controller status * 508 * for a tape device. * 509 * Added new error code for read errors. Changed mag tape * 510 * driver to return read error. * 511 * C8604c 17 Apr 86 * 512 * Fix to the substitution process so that grub of a * 513 * swapping page does not allow page to go to ADT. * 514 * Unsubstitution will occur when user is finished with * 515 * page. See comments in the Disk Substitution Process. * 516 * Changes to CIA driver to link an error element into * 517 * the chain of input TCQs when a framing or parity error * 518 * occurs or the input buffer overflows. Terminal read * 519 * now will return the error. * 520 * C8604d 25 Apr 86 * 521 * Fix exchange save to preserve the user defined field. * 522 * Reworked the URLUNITS UREQ to compact space and return * 523 * proper buffer remaining counts if users buffer is * 524 * initially too small. * 525 * C8605a 01 May 86 * 526 * Fix to FRXSAVE FREQ to get the file name from the * 527 * original files directory. This prevents bogus * 528 * filenames from appearing if the file got renamed * 529 * after it was opened. * 530 * C8605b 15 May 86 * 531 * Changed parity error routine to not perform a WRU but * 532 * instead do a data read of location zero, then pick out * 533 * the slot type from the SLOTTABLE. Added ADJUSTCYL * 534 * before checking second set of tracks in CHECK1HEAD * 535 * (first read of second set was repeating the last read * 536 * of the first set). * 537 * Added minor fix to cancel account so that bogus * 538 * error code would not be returned incorrectly * 539 * (undefined opcode). * 540 * C8605c 19 May 86 * 541 * Bug fix to TIME2DISK routine. If VOLN contains zero * 542 * for the security block (maintenance mounted) then * 543 * hour stuff is ignored. * 544 * Addition of two Executive Requests: one adds an * 545 * account name to the system AFT (ORADDAFT OPREQ) ... * 546 * the other removes an account from the system AFT * 547 * (ORDELAFT OPREQ). * 548 * C8605d 21 May 86 * 549 * Fix in COMM driver to unsuspend a user from TERMOWAIT * 550 * when TERMWBUSY goes to zero. Set TCBAUDROOM when * 551 * output baud rate is changed by FREQ. * 552 * C8605e 22 May 86 * 553 * Changes made to the internal structure of the system * 554 * NVM. The time values NVMCLOCK1 and NVMCLOCK2 are no * 555 * longer used. Instead the lower 16 bytes of the * 556 * DEATHFLAGS are used to hold four separate 32 bit time * 557 * values. Each hour the oldest time is over written. * 558 * The times are deemed to be good if two of the latest * 559 * times are within one hour and one minute of another. * 560 * C8605f 23 May 86 * 561 * Added new field in the PSA to keep session number that * 562 * receives message when session logs off. New XREQ * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 12 (REVISIONS) F 3 563 * to set field and changed URSESSINFO request to return * 564 * current value. Message to be sent by Control Mode. * 565 * C8605g 27 May 86 * 566 * Fix to the set PAC/FAC fields with respect to BACKUP. * 567 * It turns out that backup needs to unconditionally set * 568 * or clear the PAC/FAC fields. Also some minor code * 569 * cleanups were done in the file ACCTDIDDLE. * 570 * C8606a xx Jun 86 * 571 * Fix to write filemark (SAF), to not jump to nullwrite * 572 * label at conclusion of request, the problem was stack * 573 * size incompatabilities. * 574 * Minor fix to the NVM clock check, clock time could be * 575 * as great as 1 hour and 5 minutes difference. Did not * 576 * have enough of a fudge factor here. Also necessary to * 577 * rearrange the NVM definition for the new clock values, * 578 * error due to misunderstanding of the death flags. * 579 * These flags begin at the end of the NVM and work their * 580 * way towards the begining. * 581 * C8606b 11 Jun 86 * 582 * Fix to TIMER to modify rollover test to work if system * 583 * stopped at rollover. Added "idle" state to MS driver, * 584 * which is entered for 800 ms a) when the drive comes * 585 * ready, b) after reading the kludge board, and c) upon * 586 * entering REZERO, if a previous REZERO call failed. * 587 * Reinstalled delayed head check in CHECKSTATE, because * 588 * idling drive now takes up the slack time coming ready. * 589 * Heads are retracted upon final REZERO failure. Fixed * 590 * logging of "not ready" on drive without volume mounted. * 591 * Moved HAVESSU call into first bus device initialization * 592 * loop in INITIAL. * 593 * C8606c 18 Jun 86 * 594 * Fix to the terminator scan code in the comm driver. * 595 * Because it is now possible to have error elements as * 596 * well as blocks of characters, the terminator scanner * 597 * needs to ignore the error elements. * 598 * C8606d 23 Jun 86 * 599 * Added fix to the local unit information request to * 600 * clear the temporary buffer as each unit is processed. * 601 * Added code to the initproc to make sure locations on * 602 * virtual page zero are initialized. PROMBOOT does not * 603 * store into all location hence some will have parity * 604 * errors when they are read (this gives the crashdump * 605 * code problems). This problem appeared due to the * 606 * release of the SMU, the fix needs to made in PROMBOOT. * 607 * C8607a 08 Jul 86 * 608 * Changed STMW R1,FBIDA to STMW R1,FBIWORDB in disk * 609 * driver at READOVER(2) to match that at READ(9). The * 610 * earlier change was made sometime between July 85 and * 611 * Oct 85 to prevent getting parity errors caused by * 612 * uninitialized memory. * 613 * C8608a 01 Aug 86 * 614 * Small bug fix to the system free memory overlap check * 615 * routine. The check for index out of range was incorrect. * 616 * Change to the ADDSWAP and LIMITCHECK routines to * 617 * differentiate between account limit and session limit * 618 * errors. Change error code C5 from account limits * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 13 (REVISIONS) F 3 619 * exceeded to session limits exceeded. * 620 * Fix to create account request to allow manager.!!! to * 621 * create proprietary account. * 622 * Fix to the temporary code that initializes words on * 623 * page zero, was not storing enough words. * 624 * C8608b 05 Aug 86 * 625 * URPGO no longer zeroes the requester's R0 before letting * 626 * the underprocess run. Was causing screwups with * 627 * new user interrupt scheme because URINTRTN to UREQ * 628 * instruction would be with R0 = 0 (i.e. interrupt * 629 * occurred while underprogram was running). * 630 * C8608c 10 Aug 86 * 631 * New OPREQ ORSTRTSPLR to start up the spooler without a * 632 * password in the batch file. Changed INITPROC to use the * 633 * same subroutine, STARTSPLR (moved MAKEBATCH to OPREQ). * 634 * C8608d 15 Aug 86 * 635 * New subroutine UNMAPPAGE (merged with UNMAPFILE), and * 636 * calls to it from the FRDELPAGE FREQ. No unmap of * 637 * deleted file page was causing FBI mismatches on * 638 * subsequent page faults (3.12-5). * 639 * C8608e 18 Aug 86 * 640 * Fixed XREQ monitor to set up BREAKTAB entry in XHTABTAB. * 641 * Was leaving it 0, causing S0007 when user singlesteps. * 642 * C8608f 19 Aug 86 * 643 * Fixed FRSETCCB to correctly set the OWNDIR bit (reported * 644 * by 80101, no SPRs). * 645 * C8608g 29 Aug 86 * 646 * Fixed ORDEVINFO to correctly set the DIDRVNUM field. * 647 * C8609 03 Sept 86 * 648 * Made death bias for system 3 years * 649 * C8609a 04 Sept 86 * 650 * Foreign accounts are now defined to be accounts that * 651 * reside on a volume in which the volume customer number * 652 * does NOT match the customer number of the system. * 653 * C8609b 04 Sept 86 * 654 * Modified check to see if a PPU can do triple word * 655 * transfers to use a bit array on PPU microcode revision. * 656 * C8609c 07 Sept 86 * 657 * Change to ORDESACCT OPREQ to allow manager.sys to * 658 * cancel proprietary accounts (.& only). * 659 * C8609d 09 Sept 86 * 660 * Fix to PPU triple word transfer check. * 661 * C8609e 22 Sept 86 (3.11, Alpha 22) * 662 * Fix to open code so that RAF type gets set into the FCB, * 663 * this was causing serious problems (all RAFs assumed * 664 * empty on first open). * 665 * C8609f 30 Sept 86 * 666 * Fix to CIA interrupt processor to remap user free * 667 * storage after giving terminal disconnect error. * 668 * Changes to disk driver to allow online disk formatting, * 669 * this includes new XREQ (ORFORMAT OPREQ). * 670 * C8610a 03 Oct 86 * 671 * Fix maintenance dismount code to proceed with dismount * 672 * even if disk is offline. Also changed REMOUNT in the * 673 * disk driver so if MDV can not be associated with * 674 * volume then MDVVOLFLD is cleared. Minor changes to * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 14 (REVISIONS) F 3 675 * DOWRITEREQ in regards to format operation. * 676 * C8610b 10 Oct 86 * 677 * Fix to the ORSECTRK OPREQ, it was eating R5 (FCB) before * 678 * jumping to FERROR. Fix to the format routine within * 679 * the disk driver, illegal store to begin operation * 680 * caused seek error. * 681 * C8610c 14 Oct 86 * 682 * Fixed FRSAVE FREQ to return XREQERISYR (instead of * 683 * XREQERDSKL) on directory overflow. * 684 * Fix to cancel account so that manager.sys may cancel * 685 * normal system accounts. * 686 * Revision of the format operation from a write request to * 687 * a read request. This was necessary because locking the * 688 * output queue lock might cause deadlock in certain cases. * 689 * C8610d 15 Oct 86 * 690 * Fixed CHKBZYACS to allow PATH MW -> RO in 0,X,X instead * 691 * of 0,1,X. * 692 * Erased write check operations from windows and included * 693 * a new maintenance write request to perform the * 694 * write/write-check operation. * 695 * Fixed PATHREAD and CHKPTHREC to return XREQERREOD only * 696 * if path is actually empty on the second attempt. Before * 697 * it would give REOD if FCLASTREAD said EOD, regardless of * 698 * current state of the PATH. * 699 * C8610e 23 Oct 86 * 700 * Change to create account so that only customer numbers * 701 * are checked to see if new account is foreign. * 702 * Special maintenance bits have been added to the VP and * 703 * PAL elements to allow greater flexibility within the * 704 * disk driver. These bits control substitutions, error * 705 * handling and write-checks. * 706 * C8610f 28 Oct 86 * 707 * Fixed INITPROC and LIQUIDINIT to unload the INITPROC * 708 * PF locations for all CPUs, not just the executioner. * 709 * C8610g 29 Oct 86 * 710 * Change disk driver so the CLEARFAULTs and REZEROs are * 711 * done prior to the requested operation rather than after * 712 * the operation. Preserves more accurate disk status. * 713 * C8611a 03 Nov 86 * 714 * Changed disk driver to not fiddle with the FBI on a disk * 715 * read error if special error handling in force. Changed * 716 * maintenance write to shutdown awaiting forcewrite. * 717 * C8611b 13 Nov 86 * 718 * Bug fixes to the head checker: zero PPL holder of bad * 719 * trax block so when head checker inhibited, same PPL does * 720 * not get repeatedly freed, zero error counters prior to * 721 * performing a head check. * 722 * C8612a 02 Dec 86 * 723 * Changed STATCHANGE routine of CIADRIVER to not mask the * 724 * port status prior to tracing the state change. This * 725 * lets us look at everything (line parity/framing error). * 726 * Fixed FINDPATH to ensure read type access exists on * 727 * particular FCB (before, if a session had both an RO and * 728 * an RW unit open to the same path, it was possible to * 729 * say that the RW was "non-empty"). * 730 * Fixed CHECKUINT/CHECKEVENT to not cream R3 in NE term * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 15 (REVISIONS) F 3 731 * and NE path checks. Was causing hangs for all but NE * 732 * term (GRW). Small cleanup in DISPATCH (NONEVB code was * 733 * duplicated in DPRUER). Fixed OVPUPONE and OVPDOWNONE * 734 * to CHECKUINT with the new process' CAINTMASK instead * 735 * of using -1. Was causing extra errors to be generated * 736 * (C1200 at GRW, to boot!). Proper interlock in * 737 * CHECKNOINT. Rearranged fields in tape MTU element * 738 * to prevent CPU interlock problems. * 739 * C8612b 05 Dec 86 * 740 * Fixed problem in open code where a disk or parity error * 741 * rips us out of the SHLCHKALL routine and the VAR (R7) * 742 * pointer does not get reset. * 743 * C8612c 06 Dec 86 * 744 * Changed so FCB of .TERM with NA access has FCDCBPTR * 745 * pointing to TCB(was nil). This allows unit to get * 746 * information about the terminal (no I/O or ints, tho), * 747 * esp. if terminal is busy. * 748 * C8612d 18 Dec 86 * 749 * Bug fix so that files can be created during the open, * 750 * bug introduced in version C8612b. Fixed URRCVUNIT and * 751 * ORSTRTTERM to check for fake .TERM condition (make sure * 752 * FCDCBPTR is not nil before using it). * 753 * Change to OPEN code so that the RAF conversion code is * 754 * not duplicated. * 755 * C8701a xx Jan 87 * 756 * Rearranged STATPI routine (URSESSINFO and ORSESSINFO) * 757 * to decrease possibility of 'bad ULB' (S10E1) halt when * 758 * calling USEULB on PSDFLTDIR of other session. * 759 * Fix to the CIA interrupt routine when unit disconnect * 760 * occurs. Sign bit is supposed to be set if the unit * 761 * number (error subcode) is an absolute IO unit. * 762 * Fixed FRSHARE FREQ to disallow empty acct name/proj * 763 * combination. Fix to access changes on /MW RAFs so that * 764 * the file length does not get reset to zero. * 765 * Fixes to RAF control requests to call RAFCURCHEK if * 766 * file opened /MW. * 767 * C8701b 16 Jan 87 * 768 * Changed URPSETREG and URSSINTARM/URSCINTARM to correctly * 769 * calculate masks for CHECKNOINT and CHECKUINT. Removes * 770 * SETCHKMASK subroutine from existence. * 771 * Added code to check if the SSU has the new 2K NVM and * 772 * adjust the number of clock values it stores from 4 to * 773 * 64. * 774 * C8701c 17 Jan 87 * 775 * Fixed GETTRAPPER to check UPCNETINTE correctly (changed * 776 * JNE to JEQ). Fixed GETTRAPPER to check whether unit * 777 * int is for unit available to the prospective trapper. * 778 * UPC is disqualified if not. Was allowing overprocesses * 779 * to get interrupts from units strictly local to an * 780 * underprocess. * 781 * C8701d xx Jan 87 * 782 * Mods to the NVM updater in INITPROC. * 783 * C8702a 09 Feb 87 * 784 * Moved RAFCURCHEK call from DSTRAF (DESTRYDEV) to RRAFUM * 785 * (INITDEVACS). Ensures that RAFCURCHEK caller has a * 786 * GFC (FCDCBPTR) that has not been freed (RAFCURCHEK is * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 16 (REVISIONS) F 3 787 * now called before the use count is decremented). Moved * 788 * zero address check for RAFCURCHEK and UPDATEGFC into * 789 * the subroutines themselves (before, it was done by every * 790 * caller). Fixed ORSTRTBAT to set PCSPECPROC iff caller * 791 * is in monitor. This makes Manager.!!!:Boot.Batch, * 792 * Manager.Sys:Boot.Batch, and the Spooler special (also, * 793 * any concurrent sessions they might start). Fixed * 794 * OPRSTRTSPR to end by jumping to UERROR w/error code, * 795 * instead of jumping to NOERROR. * 796 * C8702b 15 Feb 87 * 797 * Removed redundant error code checks at PASS2CMO in * 798 * DISPATCH (now can jump directly to GIVEINT from within * 799 * PASS2CM). Added CMERRB and CMERR to UERPROT (user error * 800 * elements). CMERRB flag indicates error is to go straight * 801 * to CM. Saves code in dispatcher at PASSUP. Fixed up * 802 * UERRSET calls for the related errors (UINTVAR, UINTTDISC, * 803 * UINTOPRQ, and UINTATTACH). Fixed URSENDERR to mask off * 804 * CODEPART of code being sent. Before was just clearing * 805 * VERYBADB. * 806 * C8702c 16 Feb 87 * 807 * Reworked PUTINCHAR in CIAINUTIL. Input buffer overflow * 808 * now does not cause "break", because we queue a read * 809 * error element. Rearranged code because less needs to * 810 * be shared. Moved code in OCSTOREIN (still PUTINCHAR) * 811 * to save an instruction. * 812 * C8702d 18 Feb 87 * 813 * Merged in the NASSEMs for online disk formatting. * 814 * C8702e 19 Feb 87 * 815 * Change user virtual storage scheme so that we can * 816 * generate a user interrupt when free storage is getting * 817 * scarce. This required changes in the USERMEM page * 818 * definitions, the PSA/UPC error list root (RTUERRORZ), * 819 * DISPATCH, BLDPROCESS, and the user GETMEMs. It added * 820 * HALTS0072 and the OPREQ ORRESETVM. * 821 * C8702f 21 Feb 87 * 822 * Fix to OPEN share list checking. Was using wrong * 823 * window after SRCHDIR to get info for SHLCHKALL, when * 824 * DIR is RAF-type. Problem introduced in C8612b. * 825 * Fixed change in OPRSTARTBAT to use correct console area * 826 * pointer in determining PCSPECPROC. * 827 * C8702g 23 Feb 87 * 828 * Fixed UERRSET/UERRSETY to correctly mask error code * 829 * before duplicate-error LSRCH. Mask instruction used * 830 * 0FFFFFFFF for an operand (made it a NOP!). Allowed * 831 * duplicate errors causing various problems. Fixed * 832 * FRUNITID/FRUNITIE FREQs to use CPCUPCs CAINTMASK for * 833 * call to CHECKUINT. Was blanketly using CAIMNETERM and * 834 * CAIMNEPATH bits, now these are ANDed with user's mask. * 835 * C8702h 24 Feb 87 * 836 * Fixed up DISPATCH to dispense user interrupts more * 837 * smoothly. Removed UERHELD bit from UER element. Now, * 838 * CAINTENABL is turned off prior to moving to process * 839 * getting interrupt. Change sense of mask to CHECKNOINT. * 840 * Changed SOME (!) callers appropriately ... others * 841 * already had it backwards. Fixes problem of some user * 842 * interrupts not going away. Fixed URPSETREG UREQ to * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 17 (REVISIONS) F 3 843 * handle IAR/IMR changes correctly. * 844 * C8702i 25 Feb 87 * 845 * Changed FRSETCCB FREQ and URPSETREG UREQ to just change * 846 * the FLDADRS part of CAINTADR. This ensures UPR15 is * 847 * zero for other checks. * 848 * Replaced CMENTRY (initial CM PC) with CMODECA. CMODECA * 849 * is set from CCBPREGS in INITPROC. UERRCMMK uses it to * 850 * initialize R0:R7, IMR, IAR, and PC upon UINTLOGIN * 851 * interrupt. Allows CM to specify many initial registers. * 852 * C8702j 26 Feb 87 * 853 * Fixed ORDESAUTHE OPREQ to not do an extra FREEULB. * 854 * Was causing S00E0 halts if FERRORNSE was given (halts * 855 * in +MGRs FRCLOSE FREQ of .VOL, because FCLIMITPTR * 856 * was freed). Cleaned up exit code in PRESETAUTH. * 857 * Changed DISPATCH to hold off interrupts to CM if the * 858 * CAINTENABL flag is off and the error element has the * 859 * CMERRB flag set. This prevents overwriting CM's * 860 * register buffer with a second interrupt while it is * 861 * processing the first. * 862 * C8703a 02 Mar 87 * 863 * Added code in LIQUIDATE to remove unused UER elements * 864 * from the UPC. Renamed MAPVALUES to PSMAPVALS. Minor * 865 * cleanup to MAPINMEM. Moved USERMEM to the first of the * 866 * "user virtual" pages. These pages now allocated in * 867 * ascending, rather than descending, order (changes in * 868 * MAPINMEM and GETVPAGE). Minor cleanup in BLKLIMCHK. * 869 * C8703b 03 Mar 87 * 870 * Cleaned up the USERMEM definitions. Renamed PSAOWNER to * 871 * UMEMPSA, XTRAMEM to UMEMXTRA, and ULOCK to UMEMLOCK. * 872 * These locations are now BSSs in themselves, and are not * 873 * referenced as an offset from USERMEM. Minor cleanup to * 874 * BLDPROCESS. * 875 * C8703c 05 Mar 87 * 876 * Fixed ORCREACCT OPREQ to get the customer number right * 877 * when checking for foreign manager. Problem introduced * 878 * in C8610e. * 879 * Fixed LEVELBIT to: perform "foreign" check after assuring * 880 * requester is a MANAGER, not give foreign MANAGER.SYS * 881 * special power, not give "self" power to foreign account * 882 * accessing native account with same name, and correctly * 883 * check just the customer number to decide whether two * 884 * foreign accounts are from same place. * 885 * Added VOLN element symbol VOLNCUST to replace instances * 886 * of VOLNSSN/CUSTNUM. * 887 * Changed UERRSET and UERRSETY to put new element at end * 888 * of list. Ensures that normal errors are processed in * 889 * the order they were received. * 890 * C8703d 06 Mar 87 * 891 * File open modified to NOT increment the total read * 892 * count on backup open. * 893 * C8703e 18 Mar 87 * 894 * Fixed FRUNITIGET FREQ to store answer in user's R1, * 895 * instead of in TCCIAPORT (!). * 896 * Changes in MSPROC to avoid reading head retract * 897 * board if pack label info indicates no board present. * 898 * C8703f 19 Mar 87 * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 18 (REVISIONS) F 3 899 * Fix to BACKOUTRAF. Showed up when trying to expand * 900 * a RAF and received a disk full error. * 901 * C8703g 25 Mar 87 * 902 * Added XREQ error code XREQERUKP (0BC) -- * 903 * "Unknown parameter" * 904 * C8703h 26 Mar 87 * 905 * Fixed various AUTH list handling OPREQs to give * 906 * XREQERPOB if the specified volume name was all 0's. * 907 * Name=0 makes PRESETAUTH and GETAUTHN work differently, * 908 * so this keeps us from screwing up the AUTH list. * 909 * Fixed error recovery in OPRCAUT (ORCAUTHxx OPREQs) to * 910 * use correct register in GETAUTHN call. * 911 * Replaced store loop with CFILL in FREQSAVE. * 912 * Fix in BLKREADIN to get the right hash value for IDLE * 913 * pages. * 914 * 3.12 30 Mar 87 * 915 * Reassembled for Beta 22 release. * 916 * Fix to BLKREADIN to not destroy R1 when picking up * 917 * proper hash value. * 918 * Fixed ORMAINTW OPREQ to allow for new DA on block * 919 * (means changed check in MSPROCs WRITE DA error proc). * 920 * Added 8 bit filler in TCB (word w/TCBKSPC & TCPCADRS). * 921 * Fixed acceptable version of working 2K NVM SSU. * 922 * C8704a 07 Apr 87 * 923 * Fixed FRCATALOG FREQ window error recovery to actually * 924 * do the GRUBs (instructions were misplaced before the * 925 * label) (patched in 3.12-3). TCIQXOFFED moved to proper * 926 * section of TCB (patched in 3.12-1). * 927 * Minor cleanups to user interrupt processing in DISPATCH. * 928 * C8704b 30 Apr 87 * 929 * Cleaned up the loop in GPADTADDIT that moves MS addresses * 930 * from an ADT block to resident free list in VOLN. * 931 * Cleaned up ERRORLOG calling sequence in STATCHECK. * 932 * Cleaned up DISCARDPAL, DONEPPL, and FORCEWRWx. * 933 * Cleaned up ELPRESTART. * 934 * Fixed ORSTRTTERM OPREQ to use good PSA pointer for * 935 * in LOGONPROC calling sequence (patched in 3.12-1). * 936 * Removed left over jump table entry for ORFORMAT * 937 * in OPRQMAINTR (maintenance read OPREQs). XREQ * 938 * code had been changed from 0142 to 0152. * 939 * C8705a 18 May 87 * 940 * Changed SETWNDOx to STZ2 into VPWORDC (was STZ). * 941 * Fixed CANCELTMR calling sequence in MS_RESET to * 942 * include the PARL (patched in 3.12-2). * 943 * Remove unimplemented OPREQ code ORGCONFIG (0100, * 944 * get system configuration info) from VIRTDEFS. * 945 * Cleaned up exit code in FNDNONHOLE. * 946 * Cleaned up URDELAYx UREQs. * 947 * Fixed SAFREAD memory error handler to use PASSERRW1 to * 948 * prevent STOP0064 in later XREQ call (patched in 3.12-2). * 949 * Cleaned up PUTRECHEAD in SAF write code. * 950 * Changed SPLRTALK to include volume name in alias account * 951 * sent with OPEN requests. Will allow batch job initial * 952 * alias to go to shadow account (patched in 3.12-3). * 953 * C8705b xx May 87 * 954 * Cleaned up STRTMON routine (ORSTRTMON OPREQ). * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 19 (REVISIONS) F 3 955 * Changed CANCELTMR in MSPROC to save R4. Fixes * 956 * register eating in MS_RESET (patched in 3.12-2). * 957 * C8706a 11 Jun 87 * 958 * URSTATPI routine (URSESSINFO and ORSESSINFO XREQs) now * 959 * uses absolute INPUT for determining online/dialup/etc. * 960 * Also, session is dialup if this unit is a .NULL (i.e. * 961 * session is disconnected waiting for ATTACH). * 962 * C8706b xx Jun 87 * 963 * Removed unneeded LD instruction from OPRQINITVL routine. * 964 * Cleaned up SETUPDIR in XRQOPRRCVR. * 965 * Fixed OPRQINITND (ORINITEND OPREQ) to not FERRORDSE if * 966 * a disk error occurs on a block being freed after volume * 967 * is recovered (block stays out of ADT, tho). * 968 * Fixed OPRRCVRFL (ORRCVRFIL OPREQ) to ensure that unit is * 969 * .NULL (errors result if FDE/FCB have real MS addresses) * 970 * (patched in 3.12-3). * 971 * Misc minor cleanups in CIA routines. * 972 * Fix in echo of line kill character (3.12-4). * 973 * Fix in MAPOUTMEM to do the correct 4 locations (3.12-4). * 974 * Fixed ORMAINTR OPREQ to ensure free and swapping pages * 975 * don't stay in PPAGELIST or PPUSDIDLE (3.12-4). * 976 * Fixed RECOVERFDE (file recovery) to copy FDCUSE from * 977 * .NULL to recovered file's FDE. Prevents HALT S109B * 978 * if another user grabs file as .NULL, then second user * 979 * closes the file (3.12-4). * 980 * C8708 26 Aug 87 * 981 * Changed calling sequence to GETNXTBLK (used in * 982 * sequential RAF read code). Was leaving the stack * 983 * messed up if a disk error occurred when the mapped in * 984 * page was referenced outside the subroutine (3.12-4). * 985 * Removed conversion code in Mount and fixed system * 986 * serial number check (3.12-4). * 987 * Fixed INITDEVACS to free the GFC on RAF going from MW * 988 * to RW or RO access (3.12-4). * 989 * Fixed DOTIMING in CIADRIVER to pass FCB as subcode to * 990 * UINTTDISC interrupt. Subcode no longer has flag for * 991 * 'absolute I/O'. Moved FCABSIO to FCSTATSTAT area * 992 * so that static status will reflect this attribute. * 993 * (CM altered to use FRSTATUS FREQ instead of disconnect * 994 * subcode flag). Functionality patched in 3.12-4. * 995 * Added VOLNFOREN bit. Modified FINDULB to use same, * 996 * MOUNTNAME to set it, and changevol to re-set it. * 997 * Modified FINDULB to save a word on the stack. * 998 * Modified SRCHAFTIDX, DELAFTIDX, and callers to pass * 999 * the account name triple by a single address parameter. * 1000 * Modified ADDIDXAFT and callers to pass the account * 1001 * name triple by a single address parameter. * 1002 * Misc minor changes in XRQOPRAFTIDX. Moved IOFF in * 1003 * GRUBVPEL to enclose entire critical region (3.12-4). * 1004 * C8708a xx Aug 87 * 1005 * Created common exit for some FRASxxx FREQs. Space * 1006 * and speed mods to process name table manager, pak6 * 1007 * and character conversion routines, ORBUSYVOL request, * 1008 * ZAPAFT, GETIDXACS, and CHARTOP6. * 1009 * Eliminated DISMTDMY1 as a separate routine because it was * 1010 * only called from DISMTDUMMY. Modified calling sequence * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 20 (REVISIONS) F 3 1011 * to FBICKCKSUM and changed caller accordingly. Saves one * 1012 * MAPINMEM and MAPOUTMEM for each disk transfer. Fix to * 1013 * HOURINT to more accurately hit the hour in an unusual * 1014 * case. TSCAN macro and TSCANR routine eliminated. * 1015 * C8709 01 Sep 87 * 1016 * Fixed and cleaned up DIRINFOHD subroutine. Was not * 1017 * checking foreign flag on fake .DIRs, and was giving * 1018 * alias acct name and volume on .TERMs. * 1019 * Fixed ORCVOLNAME OPREQ to ensure new name is not null. * 1020 * C8709a 02 Sep 87 * 1021 * Fixed STRTSPLR to use URFREELUN to get unit number for * 1022 * SPLRBATCH file open. * 1023 * Changed OPRCVOLNAME OPREQ to use full blown CHECKSYM. * 1024 * C8709b 10 Sep 87 * 1025 * Changed MAKTRMSTAT to return the operand of the XREQ * 1026 * as the unit number rather than calling FINDUCE. * 1027 * Fixed OPEN to use file password for file share check. * 1028 * Was using acct pwd by mistake (3.12-5). * 1029 * Minor fixes to URLUNITS UREQ and DIRINFOHD. Info was * 1030 * not always consistent. * 1031 * C8709c xx Sep 87 * 1032 * Cleaned up STTERMTGRP to eliminate CALCTERMC call if * 1033 * absolute unit is not controlled by CPCUPC anyway. * 1034 * Minor mod to ?FREEMEM to only calculate buddy address * 1035 * in the path that uses it. Minor mods in clock driver * 1036 * regarding location of PFRC in TIMEADJUST and TIMEDRFT. * 1037 * Fix in LOOKUPBTRX in the disk driver to not clear a * 1038 * random page file location if BTRX list gave a disk * 1039 * error or FBI mismatch (3.12-5). Save and Rename * 1040 * changed to use FERRORISYR if they could not split a * 1041 * UDIR2 block because the UDIR1 was full. Fixed FRCATALOG * 1042 * to GRUB wndos 1 & 2 on a memory error, and FRREADSHL to * 1043 * return correct code for memory errors (3.12-5). * 1044 * FRCATALOG and FRREADSHL now share mem error handler. * 1045 * Minor cleanups to RAF WSEEK. * 1046 * C8711 03 Nov 87 * 1047 * Added STZ TCFCB and STZ PTHREADFCB to GULOCKHW (reader). * 1048 * Fixed URRCVUNIT UREQ to set PTHREADFCB and STW PTHINTE * 1049 * when FCACCESS=RO. Minor mods to subs process... removed * 1050 * unused instruction, re-organized logging code, and fixed * 1051 * unsubs for case where entry being removed is at extreme * 1052 * end of subs block. MAXPRIV shortened. Interlocked the * 1053 * RTSWITCHB bit in PSUERROR with PSLOCK (3.12-5). * 1054 * C8711a 23 Nov 87 * 1055 * Register usage changed in OPEN error code. Added S00E2 * 1056 * halt, freedir on already free directory (3.12-5). * 1057 * Changed MAPOUTFBI to consume no registers. * 1058 * Fixed GETFREEWx to return error code in R0 on error * 1059 * jump return. * 1060 * Minor fixes and changes to FROPEN code. * 1061 * Fixed DIR read and fetch catalog info to not attempt * 1062 * to free directory if memory protect during header * 1063 * return (3.12-5). * 1064 * Fixes to DIRSHRINK routine (3.12-5). Also reorganized * 1065 * the catalog/share list information request. * 1066 * Fix to OPRSTRTBAT so that error/not found returns from * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 21 (REVISIONS) F 3 1067 * SRCHDIR unlock directory. Also moved error code off * 1068 * the stack and into R7. * 1069 * Fix to recover file page to release directory on * 1070 * disk error, error return from call to TRAFDSE. * 1071 * Altered SRCHDIR to skip SETERRWx on a disk error * 1072 * where it had just grubbed the windows. Now returns * 1073 * error code in R0. Minor other reorganization and * 1074 * comment fixes. Minor moves in NAMEPACK to save * 1075 * space. Fixed GETFREEWx to not touch R4 at all. * 1076 * Trace calls added in MSPROC for calls to SUBSTITUTE. * 1077 * Removed temporary code in ULBTWIDDLE that ensured that * 1078 * a UDIR and its FBI had proper account serial numbers. * 1079 * Modified SHLCHECK and callers to eliminate the unused * 1080 * PWW (password wrong) return. OPEN modified to GRUB * 1081 * window 2 as soon as possible, removes code from error * 1082 * routines. Changes to share/unshare code to make * 1083 * better use of registers. * 1084 * Copious modifications to SRCHDIR, USVREM, BLKSPLIT, * 1085 * DIRXPAND,and DIRSHRINK to make all error returns with * 1086 * the directory freed and both windows grubbed. Mods * 1087 * to callers: FRQNOPEN, FRQWRRAF, FRQRDDIR, FRQCNTL, * 1088 * FRQRAFCNTL, FRQACSCHNG, FREQSAVE, FREQUSAVE, * 1089 * FREQUEQUIP, FREQRENAME, FREQCATINF, OPRSESSSTRT, * 1090 * XRQOPRBKUP, XRQOPRRCVR, and INITPROC. * 1091 * C8712 02 Dec 87 * 1092 * Moved UERRBMEM memory error handler in user interrupt * 1093 * part of DISPATCH (GETVIRTUAL) adjacent to the code it * 1094 * protects. * 1095 * Modified OPRQBKUPFL to give XREQERLNS when SRCHDIRSN * 1096 * no-finds (was XREQERDSE after being XREQERNSE). * 1097 * C8712a 05 Dec 87 * 1098 * Removed URGIVEUNIT's irrelevant check that the * 1099 * destination session is delaying for or trapping * 1100 * UINTGUNIT (3.12-6). Fixed URGIVEUNIT and GUUNLOCKHW * 1101 * to ensure that the correct FCB address is placed in * 1102 * the DCB. This also fixes the session starting requests * 1103 * that use GIVEUNIT, the PTHREADFCB wasn't being set at * 1104 * all (3.12-6). Fixed URRCVUNIT and PURGEGIFTU to * 1105 * DQUEONE all the sessions waiting to send more units * 1106 * (3.12-6). Fixed register eat in PURGEGIFTU, and * 1107 * fixed URGIVEUNIT to release PCNTLLOCK even when * 1108 * request suspends (3.12-5). * 1109 * C8712b 17 Dec 87 * 1110 * Made single LEAVE for RAF WSEEK. Fixed RAF WSEEK to * 1111 * not ULKWNDO2 after GETFREEW2ing a RAF minor, because * 1112 * the block is touched later and we can't afford a disk * 1113 * error. Tidied CKPVMU and FIXUPVAL. * 1114 * Combined duplicated code in INITDEVACS for PATHs. * 1115 * Fixed REALDEVICE so it actually uses the ULB (3.12-6). * 1116 * Fixed MODACS error recovery to use correct FDE * 1117 * and ULB pointers. Fixed MODACS to not clobber CKxxx * 1118 * codes through INITDEVACS call. Would cause use file * 1119 * use counts to be off (3.12-6). * 1120 * Modified the backup recover requests to keep the account * 1121 * and file entries more consistent (3.12-6) and fixed the * 1122 * error recovery specifically related to memory protect. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 22 (REVISIONS) F 3 1123 * C8712c 21 Dec 87 * 1124 * Revamped TIMESET code to use RLSLE2 instruction to save * 1125 * time. TMRLINK made into a full word so that list * 1126 * manipulations more often use base mode instead of ZBM. * 1127 * Added SHACCT call in LIQUIDATE to remove timer quantum. * 1128 * Allow .NULLs to be MW. Zeroed .LOCK entry in VERIFYTAB. * 1129 * Fixed MSPROC (CHECKSTATE) and MOUNT to give error if * 1130 * mount candidate drive is writeprotected (added MDVWPROT). * 1131 * Fixed PRESETAUTH to check ULB account names instead of * 1132 * ULB addresses to determine caller/victim equality. * 1133 * C8801a 11 Jan 88 * 1134 * Fixed OPEN to unsave a "file being destroyed" only if * 1135 * the FDSUN doesn't match the FILESUN. Also, this check * 1136 * is now made AFTER the WWC and use count checks (3.12-6). * 1137 * Fixed LOGXREQ and STOPXMON to interlock use of XHTABTAB * 1138 * (with new lock XHTABLCK). LOGXREQ was able to get pntr * 1139 * to free space, or a nil pointer from XHTABTAB. Minor * 1140 * cleanup to URSTATPI (URSESSINFO and ORSESSINFO XREQs). * 1141 * Changed CREATEDEV to DMOTEWNDO1 after GETFREEW1 for * 1142 * SAF and CODE (more straightforward than ULKWNDO1 and * 1143 * allowing subsequent subroutines to map over the window). * 1144 * Fixed FRTGETTCS to return the users currently active * 1145 * TCS for the console terminal (was always getting his * 1146 * user defined set). * 1147 * C8801b 12 Jan 88 * 1148 * Changed URDELAY ending code in ONCEASEC so that timed * 1149 * out session will not be put on the end of SQRUNNABLE * 1150 * (was having user reexecute URDELAY with delay=0 unless * 1151 * original wait mask included CAIMNETERM). * 1152 * Changed to URSTATPI: minor cleanups, fixed "disconnected * 1153 * terminal" check to exclude concurrent sessions. * 1154 * C8802a 19 Feb 88 * 1155 * Changed ORATTACH OPREQ to disallow attach to requester's * 1156 * concurrent session (wouldn't work because requester's * 1157 * logoff would force new session to logoff). Fix to * 1158 * recover account, ULB use count of managers account * 1159 * where authorization was coming from during selective * 1160 * backup was not getting decremented properly (3.12-6). * 1161 * Changed MINBLKLIM from 40 to 100 in BLKLIMCHK as an * 1162 * added margin of safety (were seeing C1200s because CM * 1163 * couldn't get logged on even though BLKLIMCHK passed). * 1164 * Reorganized code in OPEN that checks the SUN and FBD. * 1165 * This allowed the file being destroyed code to work * 1166 * because the windows contained the UDIR blocks and not * 1167 * leftovers from SHLCHKALL routine (3.12-6). * 1168 * Fixed the CIADRIVER SETUPWRIT code to ensure powerfail * 1169 * ints are disabled on exit (actually, moved PFAILEN to * 1170 * after terminal timing checks, so no PFAILDS needed by * 1171 * earlier exit, such as to SETNORM when TERMWBUSY=0). * 1172 * Saw S0007 halt at 80103 where a pfail int occurred * 1173 * while looking at UERs in DISPATCH (3.12-6). * 1174 * Modified code in recover file page to ensure that * 1175 * RAF index blocks had proper relative block numbers. * 1176 * Fixed URSESWCLK request to properly compute figures * 1177 * using single register instructions, double register * 1178 * instruction with BASE mode did not work properly. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 23 (REVISIONS) F 3 1179 * Changed Set Wall Clock Limit/Used to give error if * 1180 * new value to be set is negative. Changed OPRSTRTBAT * 1181 * and FREQCONCP to use symbols for unit numbers. * 1182 * Changed the disk driver to CLEARFAULT and REZERO after * 1183 * operation. New status added to MDV, MDVLOPSTATUS is * 1184 * the status after the last operation and not the * 1185 * status after any error recovery. * 1186 * C8802b xx Feb 88 * 1187 * The code in the disk driver that attributes some * 1188 * header errors to seek errors (i.e. being on the * 1189 * wrong cylinder) was modified so that the first * 1190 * header error was not treated as a seek error. * 1191 * Bug fix in BootUpdate to give back the free memory * 1192 * fetched for holding the FBI. * 1193 * C8803 09 Mar 88 * 1194 * Changed SWAPPMVS in INITIAL to clear the PFREFBIT * 1195 * before storing PMV into PFMAP (cleaner map). * 1196 * Changed ORATTACH to pass lower half of requester's * 1197 * R1 in the upper half of the subcode. * 1198 * C8803a xx Mar 88 * 1199 * Removed FRMODACSLK (00D1) because it was unimplemented. * 1200 * Changed ORBKCACCT to hand back XREQERILR if the user * 1201 * hasn't backup privilege (was giving XREQERPNS). * 1202 * In MSPROC, moved trace calls to after action initiation * 1203 * to save time. Minor change in calls to errorlogger. * 1204 * C8803b 24 Mar 88 * 1205 * Modified TSELECT to work with the BTI SMD to ESDI * 1206 * adaptor board (patched into 3.12-8 #5). * 1207 * Moved INC FFPROCS from SPROCSTART into DISPATCH to * 1208 * eliminate the timing window that allowed the count * 1209 * of active free filers to become incorrect (3.12-8). * 1210 * Eliminated FFBUSY word usages, because it is not kept * 1211 * in a way that was useful. The location remains as * 1212 * a space filler to make freefile match the template. * 1213 * Changed URRCVUNIT UREQ to return XREQERLAE instead * 1214 * of XREQERPOB when non-CM user uses 201 or 202. * 1215 * Removed def and code for URPSTOP UREQ. Was intended * 1216 * to become "stop another process", but this was done * 1217 * by ORPSTOP. Def had been commented out, code was * 1218 * just a jump to UERRORILR (now in table). * 1219 * C8804 29 Apr 88 * 1220 * Changed OPEN request to give XREQERBFN rather than * 1221 * XREQERFNF if the device type was needed, but was * 1222 * either not specified or not a defined type. * 1223 * C8805 09 May 88 * 1224 * Added the drive name to several ERRORFILE entries. * 1225 * C8805a 11 May 88 * 1226 * Fixed MS_RESET to really use the skip return when * 1227 * a drive timed out. Fixed CHECKBFD to use this. * 1228 * Before, no ERLCDSKTO errors could ever be recorded. * 1229 * Fixed DEADMAN to SETPPU3WRD only when PPU has recovered * 1230 * from illness (was doing iff a controller needed reset). * 1231 * Fixed POWERUP to force this SETPPU3WRD. * 1232 * C8805b 26 May 88 * 1233 * Made new ERRORFILE code ERLCRDGCS (reading check * 1234 * segment), and changed FIXSEGMENT to use it rather * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 24 (REVISIONS) F 3 1235 * than ERLCDE (because the entry is a notification). * 1236 * This replaces OPFIXSEG as a code to ERRORLOG, so the * 1237 * OPFIXSEG definition was removed. * 1238 * C8805c 30 May 88 * 1239 * Restored FRTGETTCS to return the users defined TCS for * 1240 * console TCS (see C8801a), because it is more useful. * 1241 * C8806 02 Jun 88 * 1242 * Added HALTS0102 to MS REMOUNT (matching VOLN HCB not 0). * 1243 * Fix in INITDEVACS when RAF changing access from /MW, * 1244 * if GFC block gets freed then the FCDCBPTR must get set * 1245 * to zero. * 1246 * C8806a xx Jun 88 * 1247 * Removed stack loc from INTREAD by using regs instead. * 1248 * Fixed MS READ to not rewrite or sub a block with a * 1249 * permanent read error. * 1250 * Fixed MS driver to not REMOUNT a pack that was mounted * 1251 * or otherwise altered somewhere else. Also prevents * 1252 * remount of wrong pack with same PLINITDATE. This added * 1253 * the SECMNTDAT to the security block, and changed * 1254 * VOLNFMTDAT to VOLNMNTDAT. * 1255 * C8807 xx Jul 88 * 1256 * Fixed URRCVUNIT to use correct register when setting * 1257 * TCFCB and TCINTE (recent bug : after CM ATTACH, the * 1258 * TCFCB was wrong, with bad results such as unrestored * 1259 * (0) TCTERMA). * 1260 * C8808 31 Aug 88 * 1261 * Fixed change in C8802a that disallowed negative values * 1262 * for wallclock and disk warn limits, to allow -1 (*Huge*). * 1263 * Added similar checks for super privileged sets of CPUU, * 1264 * CPUL, DISKL, and DISKS. Changed DELAFTIDX and SRCHAFTIDX * 1265 * to use CMSTR instead of CMS instruction. Also modified * 1266 * to GRUB window 1 on disk error. Fixed callers as * 1267 * appropriate, and fixed comments regarding window mapping. * 1268 * Added MAPOUTFBI to error path at GPADTSECE. * 1269 * Removed the forcewrite from the disk error path at * 1270 * FREEULB01. Changed DMOTE to GRUB in error path for * 1271 * REWRITE at FILEISAU. Modified LOCKDIR exit. * 1272 * Changed FREQs FRMODLBKU, FRMODLWD, FRMODLRD to share * 1273 * code. Also changes to body of the FRMOD*** requests * 1274 * to use an execute table rather than a jump table. * 1275 * Fixed ORINITVOL OPREQ to copy the MDVFMTDAT into the * 1276 * VOLNMNTDAT for the time the security blocks are being * 1277 * written (ensures volume can always remount). * 1278 * Fixed ORINITVOL to place dates into security block. * 1279 * (was using wrong window and placing them into the * 1280 * volume label). Other mods to ORINITVOL to not read * 1281 * the packs volume label (which we overlay anyway), * 1282 * removed an UNLKWNDO for a page that was subsequently * 1283 * forcewritten, and altered a few minor items for * 1284 * efficiency. * 1285 * C8809 12 Sep 88 * 1286 * Changed INPUTERR in CIAINUTIL to prevent multiple * 1287 * contiguous error elements in the input queue. Was * 1288 * allowing a bad port to eat up free memory with * 1289 * error elements (patched in 3.12-9 #6). * 1290 * Added ORRESETDRV OPREQ, with corresponding code in * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 25 (REVISIONS) F 3 1291 * DOREADREQ (request to reinitialize MDV after format). * 1292 * C8809a 20 Sep 88 * 1293 * Fixed error in TSELECT count of table entries. * 1294 * Added CANOPMSG to DISMNTDUMMY (mainly for maint vols * 1295 * that dropped offline and were closed). * 1296 * Added MDVNOLOG flag (using MDVNOERRS for this was * 1297 * preventing head checker error logging). * 1298 * Fixed CHECKHEADS to clear entire MDVERRWORD initially * 1299 * (was using leftover flags). * 1300 * C8809b 27 Sep 88 * 1301 * Changed FIXSEGMENT to do no retries, and READ to reread * 1302 * instead (STATCHECK now accumulates single seg errors in * 1303 * MDVDKERRS, limited by MDVDKERLIM). * 1304 * C8810 26 Oct 88 * 1305 * Moved process switch check closer to DOPSAERR in * 1306 * DISPATCH. Fixed WRITE subroutine in MSPROC to prevent a * 1307 * bad block from being put into the ADT. Fixed SUBSPROC * 1308 * to not do a substitution on a block being freed. * 1309 * C8811 16 Nov 88 * 1310 * Removed virtual monitor page checking from parity error * 1311 * routine, because all pages are now resident. * 1312 * Modifications to add new hardware type, VT. * 1313 * C8812 13 Dec 88 * 1314 * Fixed CHKBZYACS to disallow going from NA to RW on a * 1315 * PATH if someone has the PATH for MW. Moved SECMNTDAT * 1316 * to a more static area of the security block. * 1317 * C8812a 16 Dec 88 * 1318 * Changed resource locking to allow a full 32 bit resource * 1319 * number, however the maximum number of resource locks * 1320 * allowed per file has been reduced to 128. Note that the * 1321 * RCE element increased from 2 words to 4 words. * 1322 * C8901a 4 Jan 89 * 1323 * Allow no-data open of hardware device file that does * 1324 * not reside in system volume HARDWARE.SYS account. This * 1325 * is to grant backup (and others?) access to HARDWARE.SYS * 1326 * shadows. Fixed the URDELAY request to lock PSA * 1327 * EVENTLOCK during CHECKEVENT and shutdown into * 1328 * SQTIMEWAIT. Also used EVENTLOCK in GIVEUINT to * 1329 * coordinate when events are given to URDELAY requesters, * 1330 * should eliminate missing events. * 1331 * C8901b 14 Jan 89 * 1332 * Changed FRCONCP and ORSTARTBAT XREQs to return the * 1333 * process serial number of the new session's Control Mode * 1334 * in R1. This is so the spooler can have truly unique * 1335 * session ID for servers. * 1336 * Warning!! These requests previously did not eat R1. * 1337 * C8901c 18 Jan 89 * 1338 * Fixed the change SSN code to reset foreign volume flag * 1339 * only if the customer numbers do not match. * 1340 * Wrong register used in cancel operator message during * 1341 * volume dismount (DISMTDUMMY). * 1342 * C8901d 20 Jan 89 * 1343 * Fixes to LINKTERM, allow open of backup copies of .TERMS * 1344 * and also give no-data-access TCB linkup so we may fetch * 1345 * information on busy terminals. * 1346 * C8901e 30 Jan 89 * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 26 (REVISIONS) F 3 1347 * Fixed recover file to know about VTs. Fixed bug in out * 1348 * of bounds check. RC * 1349 * C8902a 01 Feb 89 * 1350 * Fixed the URFORCEP xreq to not set the FWIP bit, also * 1351 * not to suspend if page not dirty or write not pending. * 1352 * Removed UPDATEPAGE and FORCEPAGE routines. * 1353 * C8902b 02 Feb 89 * 1354 * Fix to prevent system halt if memory protect violation * 1355 * during register saving interrupt processing for user * 1356 * process. Need halt only if memory protect for Control * 1357 * Mode. Fix to STATCHECK in MS driver at label SEGERROR * 1358 * to not munch the segment number in R0, caused halt S0105. * 1359 * C8903a 09 Mar 89 * 1360 * Fix to CHECKCIA in DEADMAN, set R0 to one after ERRORLOG * 1361 * to indicate PPU was alive. CIA_RESET looked at R0 to * 1362 * determine if reset should happen. This instruction was * 1363 * inadvertantly removed in C8805a. * 1364 * C8903b 10 Mar 89 * 1365 * Added code to DONEPPL to decrement the volume busy * 1366 * counter if the block was to go into the ADT, but * 1367 * abandoned due to disk error. Removed the VPERRGIVEN * 1368 * bit (RC). Fixed vanish request to not dismount * 1369 * maintanence mounted volumes, these volumes should get * 1370 * dismounted when the units opened to the .VOLs get * 1371 * closed. * 1372 * C8903c 21 Mar 89 * 1373 * Mods to tape driver MT_RESET to give a little * 1374 * more time after a PPURESET. * 1375 * C8903d 28 Mar 89 * 1376 * Changed tape driver to perform NO retries for type * 1377 * VT. Made retry count for each tape operation more * 1378 * consistent. * 1379 * C8904 01 Apr 89 * 1380 * Added PPUITOUT (time out) bit to PPU status. Added * 1381 * checks in I/O drivers. * 1382 * C8904a 05 Apr 89 * 1383 * Removed 'any error' check from TapeFunc in the * 1384 * tape driver. This was added in December, but * 1385 * should not have been. * 1386 * Fixed GIVEUNIT to have the correct users memory * 1387 * mapped in when looking at FCB just given away. * 1388 * C8904b xx Apr 89 * 1389 * Request To Logoff error now returns underprocess * 1390 * serial number as subcode. * 1391 * C8904c 20 Apr 89 * 1392 * Fix in SRCHDIR to restore ULB pointer before call to * 1393 * FREEULB in disk error recovery. * 1394 * C8905 02 May 89 * 1395 * Added interrupt enable bit (BFDINTBIT) to the read check * 1396 * segment operation. The system was not receiving an end * 1397 * of operation interrupt, the funny thing is that 3.12 * 1398 * system appears to work fine. Increased timeout value * 1399 * for VT WFM. * 1400 * C8905a 30 May 89 * 1401 * Fixed Remote Port Startup code to pass acceptable * 1402 * initial entry code to Control Mode. Modified PPUREV3MSK * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 27 (REVISIONS) F 3 1403 * to indicate that even revs are capable of triple word * 1404 * store, odd revs not. * 1405 * C8906a 15 Jun 89 * 1406 * Fix to tape driver to fetch the MTUTYPE during the call * 1407 * of TAPEFUNC. Any retry was screwing up the type in R1 * 1408 * and causing S0000 system halt. * 1409 * C8906b 16 Jun 89 * 1410 * Fix to OPEN code to restore EQT pointer following * 1411 * destroying a file marked FBD. * 1412 * C8907 25 Jul 89 * 1413 * Fix in DIOSETUP to properly return memory protect error * 1414 * codes. Fix in GIVEUNIT to ensure that MAPINMEM is called * 1415 * while interrupts are still off. GU*LOCKHW routines * 1416 * fixed to include table entry for VT. MT read code * 1417 * altered to send read buffer length to controller. RC * 1418 * C8907a 25 Jul 89 * 1419 * Fix to the disk head checker to ignore substituted * 1420 * blocks, this caused DA mismatch errors. * 1421 * C8908 02 Aug 89 * 1422 * Removed the WSXCLNALL for all pages if the file type was * 1423 * a .VOL, this was moved into DESTROYDEV. Added WSXCLNALL * 1424 * to FREEULB iff the ULB is being dissolved. Should prevent* 1425 * halts where pages still exists for dismounted volumes. * 1426 * C8909 26 Sep 89 * 1427 * Fix in OPRQRCVACL to correctly leave a partially * 1428 * recovered authlist during any kind of manager * 1429 * insufficient authorization. * 1430 * C8910 xx Oct 89 * 1431 * Changed the S001A, C1200, and C1215 STOPs to HALTs. * 1432 * C8910a 25 Oct 89 * 1433 * Invoked FILESTAT macro and removed separate definitions. * 1434 * C8911 xx Nov 89 * 1435 * Added call to FREECHECK in HAVEPPU to fix possibility * 1436 * of not enought memory to finish configuring the system. * 1437 * C8911a 02 Nov 89 * 1438 * Changed FREQUSHARE to allow requesting complete * 1439 * elimination of share list. CG * 1440 * C8911b 03 Nov 89 * 1441 * Fix in HAVEPPU to save and restore PPU element pointer * 1442 * between calls to FREECHECK. * 1443 * C8911c 30 Nov 89 * 1444 * Fix to the ORRCVRACTL request to not hang in DIRWAIT if * 1445 * recovering a managers account that does not currently * 1446 * exist. * 1447 * C8912 04 Dec 89 * 1448 * Added a bound to the loop in TSELECT. CG * 1449 * C8912a 12 Dec 89 * 1450 * Added a new entry into the Xreq error processing block * 1451 * (FERROR3FCB) for use when FCB is defined but the unit * 1452 * number is not the Xreq operand. * 1453 * Added a bit to FBIFLAGS saying that this block has * 1454 * been rewritten by the disk driver. Modified the driver * 1455 * to substitute a block if this bit is already set when * 1456 * a rewrite request is made the bit is cleared in the * 1457 * FBI of the new block. * 1458 * Added ORMAINTRSUB to do a maintenance read and * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 28 (REVISIONS) F 3 1459 * substitute the block. CG * 1460 * C8912b 19 Dec 89 * 1461 * Fixed WSEEK to put correct relative block number in * 1462 * RAF minor access blocks. RC * 1463 * C8912c 20 Dec 89 * 1464 * 8912c was a version with changes to disk driver * 1465 * scheduling, which was completely removed shortly after * 1466 * being added. CG * 1467 * C8912d 31 Dec 89 * 1468 * Changed PACKITEM to stop packing after encountering * 1469 * an initial number (123.abc stops, pointing at the * 1470 * period). Changed PACKFS to give an error if the item * 1471 * following a colon is a number. CG * 1472 * C9001 02 Jan 90 * 1473 * Changed PUTINCHAR to reset a current XON state on a * 1474 * port upon receipt of a break. Changed INITDEVACS to * 1475 * position a cartridge tape to track 0. (Note: this * 1476 * added a call to MTCHKWFM which seems proper, although * 1477 * file marks were somehow getting there before.) * 1478 * Allowed FRRAFCPOS to inquire as to currently selected * 1479 * track on a CT. CG * 1480 * C9001a xx Jan 90 * 1481 * Fixed set output baud rate executive request to * 1482 * correctly return the old rate upon a successful * 1483 * completion. * 1484 * C9002 01 Feb 90 * 1485 * Removed the change (C8912d) to symbol packing, was * 1486 * causing backward compatibility problems. CG * 1487 * C9002a 09 Feb 90 * 1488 * Changed the zero meaning 'current time' to a minus * 1489 * one in FRMODLRD,FRMODLWD,FRMODLBKUP. CG * 1490 * C9002b 27 Feb 90 * 1491 * Discovered that the FBINOREWRIT bit was defined * 1492 * incorrectly. Fortunately it landed on FBIERRD which * 1493 * is not used. Revised FBIFLAGS to get it right. * 1494 * Defined a subfield FBIDEFFLAGS which consists of the * 1495 * flag bits that DISKCOPY can legitimately check the * 1496 * value of. CG * 1497 * C9003 01 Mar 90 * 1498 * Changed SAFENDFIX (fixes up some garbage when a file * 1499 * recovery does not finish) to set the backward link * 1500 * on the last file block. Changed DSTRYDEV to check * 1501 * for empty CODE as well as empty RAF. CODE can be * 1502 * empty if a file recovery did not complete. CG * 1503 * C9003a 25 Mar 90 * 1504 * Changed definition of DiskToTape group of halt codes * 1505 * to Offline Utility halts. CG * 1506 * C9003b 29 Mar 90 * 1507 * In CLOSEUNIT, if SAFENDFIX is called, the directory * 1508 * window(s) need to be reestablished. In SAFENDFIX, * 1509 * zero FCB,FCMABLK so the file no longer looks like it * 1510 * is in the middle of a recovery. CG * 1511 * C9004 09 Apr 90 ( Release 12C ) * 1512 * Fixed MT_RESET to ensure the MTSTDSC was set to * 1513 * force PROC_INT to recognize current status on boot. * 1514 * C9005 24 May 90 * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 29 (REVISIONS) F 3 1515 * Added a check in STATCHECK for a weird case of a write * 1516 * setting the time code error bit but no others. Nobody * 1517 * knows how this happens, but when it did it was falling * 1518 * through to the rewrite code and the problem was * 1519 * persisting. Now causes a substitution. CG * 1520 * C9006 24 Jun 90 * 1521 * Fixed code in RECOVERFDE to correctly set the end * 1522 * position pointers for both SAFs and RAFs, was just * 1523 * setting them to zero. * 1524 * C9007 09 Jul 90 * 1525 * Expanded top boundary of user limits block to include the * 1526 * restriction word in the UDIR. Changed directory reading * 1527 * to see if the target directory has catalog reading * 1528 * restricted and if so, then check whether the requester * 1529 * has an override. Added URPROCLVL and URDROPPRIV. * 1530 * Implemented restriction group 3 (account attribute * 1531 * changing). CG * 1532 * C9008 09 Aug 90 * 1533 * Removed DIRACSLOCK and DIRLRAF from the DIRINFORD * 1534 * structure. CG * 1535 * C9010 19 Oct 90 * 1536 * Added jump instruction to take care of memory parity * 1537 * error return for call to DISKWRITE in the routine * 1538 * DOREWRITE. Fix in PRESETAUTH routine to zero ULB * 1539 * register (R4) if division project manager did not have * 1540 * proper authorization. Prevented ULB from being freed * 1541 * twice (patched C9004-1). * 1542 * C9011 12 Nov 90 * 1543 * Fix to DIOSETUP to turn off interrupts during page * 1544 * searching and locking operation. Suspect that S1300 * 1545 * halt resulted from being interrupted from this routine * 1546 * (patched C9004-2). * 1547 * C9103 27 Mar 91 * 1548 * Fixes in Re-Mount code in MSPROC (included in patch * 1549 * C9004-3). * 1550 * C9105 17 May 91 * 1551 * Fix in READ at DOREWRITE where test to see if block had * 1552 * already been rewritten was backwards. Changed instruction* 1553 * JNEZ R2 DOTHESUB -> JEQZ R2 DOTHESUB. * 1554 * (included in patch C9004-3). * 1555 * Changed timeout value for a MT rewind from 0 to 48 ticks, * 1556 * this was done for the SCSI 9-track. Made some additional * 1557 * changes to DOREWIND in the MT driver to fix a bug * 1558 * introduced by changing the timeout value from 0 to 48. * 1559 * C9105a 23 May 91 * 1560 * Mods to TRACE routines to include time. RC * 1561 * C9107 25 Jul 91 * 1562 * PATCHPROC modified by moving PLOCK to where destroying R0 * 1563 * will not cause a problem (bus error, seen in house). RC * 1564 * (included in patch C9004-3). * 1565 * Changes made to integrate the SCSI files to reduce the * 1566 * number of different files for each OS version. * 1567 * C9203 04 Mar 92 * 1568 * Changed some of the BFD symbols names to the more * 1569 * generic MSC (mass storage controller) names. * 1570 * C9203a 30 Mar 92 * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 30 (REVISIONS) F 3 1571 * Shortened the patch area to ensure enough free storage to * 1572 * do the SSU configuration (HAVESSU) in INITIAL if all of * 1573 * the memory is in higher slots, such as for a manufacturing* 1574 * test (included in patch C9004-3 and S9202-1). RC * 1575 * C9207 23 Jul 92 * 1576 * Changes in MAKETRAF to prevent freeing a random block * 1577 * (actually 3F8F) on out of disk space error. Mods in * 1578 * PFPROC to restore disk space totals after getting an * 1579 * out of disk space error on a swapping page. * 1580 * (included in patch C9004-4 and S9202-1). RC * 1581 * PSXTRACA eliminated in favor of having a single CA/STACK * 1582 * per CPU (new variable on base page CPXTRACA). * 1583 * (patch in C9004-5 for this effect). RC * 1584 * C9209 30 Sep 92 * 1585 * Bug fixed in LOGOFF for case where ULSCRDSK goes negative.* 1586 * (patched in C9004-5) RC * 1587 * C9303 18 Mar 93 * 1588 * Bug fixed in UNDOPATH to properly restore interrupt * 1589 * level counter. (patch C9004-6) RC * 1590 * * 1591 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 31 (REVISIONS) F 3 1593 3DB03E00 ABS 1594 ASSYTIME EQU 03DB03E00 time of the system assembly 1595 * . 1 count here = 4 seconds 1596 * . 10 count here = 1 minute + 5 1597 * . 100 count here = 17 minutes + 28 1598 * .1000 count here = 4 hours + 39 min + 37 1599 * 10000 count here = 3 days + 1 hour + 14 min 43393330 ABS 1600 REVNAMEH EQU "C930" revision number of this assembly 33202020 ABS 1601 REVNAMEL EQU "3 " second part of revision number 5 6 START INITIAL starting point for first CPU 7 START2 SUCKERS starting point for everyone else 8 INPUT ASCIITABLE table of ascii character definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 32 (ASCIITABLE) F 4 ASCII character table 3 4 ********************************************************************************** 5 * * 6 * OCT HEX DEC CHR OCT HEX DEC CHR OCT HEX DEC CHR OCT HEX DEC CHR * 7 * * 8 * 000 00 0 NUL 040 20 32 SP 100 40 64 @ 140 60 96 ` * 9 * 001 01 1 SOH 041 21 33 ! 101 41 65 A 141 61 97 a * 10 * 002 02 2 STX 042 22 34 " 102 42 66 B 142 62 98 b * 11 * 003 03 3 ETX 043 23 35 # 103 43 67 C 143 63 99 c * 12 * 004 04 4 EOT 044 24 36 $ 104 44 68 D 144 64 100 d * 13 * 005 05 5 ENQ 045 25 37 % 105 45 69 E 145 65 101 e * 14 * 006 06 6 ACK 046 26 38 & 106 46 70 F 146 66 102 f * 15 * 007 07 7 BEL 047 27 39 ' 107 47 71 G 147 67 103 g * 16 * 010 08 8 BS 050 28 40 ( 110 48 72 H 150 68 104 h * 17 * 011 09 9 HT 051 29 41 ) 111 49 73 I 151 69 105 i * 18 * 012 0A 10 LF 052 2A 42 * 112 4A 74 J 152 6A 106 j * 19 * 013 0B 11 VT 053 2B 43 + 113 4B 75 K 153 6B 107 k * 20 * 014 0C 12 FF 054 2C 44 , 114 4C 76 L 154 6C 108 l * 21 * 015 0D 13 CR 055 2D 45 - 115 4D 77 M 155 6D 109 m * 22 * 016 0E 14 SO 056 2E 46 . 116 4E 78 N 156 6E 110 n * 23 * 017 0F 15 SI 057 2F 47 / 117 4F 79 O 157 6F 111 o * 24 * 020 10 16 DLE 060 30 48 0 120 50 80 P 160 70 112 p * 25 * 021 11 17 DC1 061 31 49 1 121 51 81 Q 161 71 113 q * 26 * 022 12 18 DC2 062 32 50 2 122 52 82 R 162 72 114 r * 27 * 023 13 19 DC3 063 33 51 3 123 53 83 S 163 73 115 s * 28 * 024 14 20 DC4 064 34 52 4 124 54 84 T 164 74 116 t * 29 * 025 15 21 NAK 065 35 53 5 125 55 85 U 165 75 117 u * 30 * 026 16 22 SYN 066 36 54 6 126 56 86 V 166 76 118 v * 31 * 027 17 23 ETB 067 37 55 7 127 57 87 W 167 77 119 w * 32 * 030 18 24 CAN 070 38 56 8 130 58 88 X 170 78 120 x * 33 * 031 19 25 EM 071 39 57 9 131 59 89 Y 171 79 121 y * 34 * 032 1A 26 SUB 072 3A 58 : 132 5A 90 Z 172 7A 122 z * 35 * 033 1B 27 ESC 073 3B 59 SEMI 133 5B 91 [ 173 7B 123 { * 36 * 034 1C 28 FS 074 3C 60 < 134 5C 92 \ 174 7C 124 | * 37 * 035 1D 29 GS 075 3D 61 = 135 5D 93 ] 175 7D 125 } * 38 * 036 1E 30 RS 076 3E 62 > 136 5E 94 ^ 176 7E 126 ~ * 39 * 037 1F 31 US 077 3F 63 ? 137 5F 95 _ 177 7F 127 DEL * 40 * * 41 ********************************************************************************** 42 00000008 ABS 43 BS EQU 008 backspace 00000009 ABS 44 HT EQU 009 horizontal tab 0000000A ABS 45 LF EQU 00A line feed 0000000C ABS 46 FF EQU 00C form feed 0000000D ABS 47 CR EQU 00D carriage return 00000011 ABS 48 XON EQU 011 XON 00000013 ABS 49 XOFF EQU 013 XOFF 00000017 ABS 50 ETB EQU 017 control-W 00000018 ABS 51 CAN EQU 018 line cancel 0000007F ABS 52 DEL EQU 07F delete 10 INPUT MACRODEFS definitions of system macros 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 33 (MACRODEFS) F 5 Macro Definitions 4 5 ********************************************************************************** 6 * * 7 * List locking and unlocking macros. Note that the * 8 * LOCKWAIT routine is carefully constructed to be used with * 9 * the PLOCK macro, so excercise caution. Call: * 10 * * 11 * PLOCK lockword (gets R0, condition bits, * 12 ** and turns off interrupts) * 13 * PUNLOCK lockword (turns on ints) * 14 * * 15 ********************************************************************************** 16 17 PLOCK MACRO 18 $L IOFF 19 SETT $P 20 JNE MA(2+DISPW MA 0) 21 CALLNP LOCKWAIT 22 EMAC 23 24 PUNLOCK MACRO 25 $L STZ $P 26 ION 27 EMAC 28 29 ********************************************************************************** 30 * * 31 * The following macro will get the stack pointer to the * 32 * top of the stack associated with the current console area. * 33 * * 34 ********************************************************************************** 35 36 SETSP MACRO 37 $L STCAR SP 38 LD SP SP,CASTACKPTR 39 LD SP SP+(2 POWER STAKLOG) 40 EMAC 41 42 43 44 ********************************************************************************** 45 * * 46 * The following macro will do an interlocked SETT on a * 47 * 1-bit ZBM field. It destroys R0. * 48 * Usage: " SETTBIT reg,field " (the register is required). * 49 * * 50 ********************************************************************************** 51 52 SETTBIT MACRO 53 $L LD R0 1*BIT((($(1),$(2)) DISP ($(1),0))/BITS 0:4) 54 IORM R0 $(1),((($(1),$(2)) DISP ($(1),0))/BITS 15:31) 55 EMAC 56 57 58 ********************************************************************************** 59 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 34 (MACRODEFS) F 5 Macro Definitions 60 * The following macro will do an interlocked clear on a * 61 * 1-bit ZBM field. It destroys R0. * 62 * Usage: " CLRTBIT reg,field " (the register is required). * 63 * * 64 ********************************************************************************** 65 66 CLRTBIT MACRO 67 $L LD R0 1*BIT((($(1),$(2)) DISP ($(1),0))/BITS 0:4) 68 BRSBM R0 $(1),((($(1),$(2)) DISP ($(1),0))/BITS 15:31) 69 EMAC 70 71 * If you believe this, wait 'till you see what I come up 72 * with next month! 73 74 75 ********************************************************************************** 76 * * 77 * The following macro will cause an event to be entered * 78 * into the system trace table, if tracing is active. There * 79 * are 32 different classes of trace events (numbered 0-31), * 80 * and you can specify a unique 5 bit event id. When a user * 81 * activates tracing, he can specify which of the different * 82 * event classes he wants traced. * 83 * Usage: " TRACE , " * 84 * * 85 ********************************************************************************** 86 87 TRACE MACRO 88 $L XCT TRACECALL($(1)) 89 NOP ($(1)*BITS 22:26)+($(2)*BITS 27:31) 90 EMAC 91 92 93 ********************************************************************************** 94 * * 95 * The following macro will define the beginning of a * 96 * stack frame. It is intended for use with ENDFRAME. We will * 97 * automatically generate a BSS 1 for the return link word. * 98 * * 99 ********************************************************************************** 100 101 NOLIST CREF 102 BEGFRAME MACRO 103 NOLIST 104 NOLIST CREF 105 NOSYMS 106 ZZ!FRAME BASE SP beginning of stack frame 107 SYMS 108 BSS 1 space for return link 109 LIST CREF 110 LIST 111 EMAC 112 LIST CREF 113 114 115 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 35 (MACRODEFS) F 5 Macro Definitions 116 * * 117 * The following macro is just like BEGFRAME except that * 118 * it does NOT generate a BSS 1 for the return link word. * 119 * * 120 ********************************************************************************** 121 122 BEGFRAME2 MACRO 123 NOLIST 124 NOLIST CREF 125 NOSYMS 126 ZZ!FRAME BASE SP beginning of stack frame 127 SYMS 128 LIST CREF 129 LIST 130 EMAC 131 132 133 ********************************************************************************** 134 * * 135 * The following macro will define the end of a stack * 136 * frame. It is intended for use with BEGFRAME. We will * 137 * define labels called PUSH and POP for use as operands of * 138 * ENTER and LEAVE instructions. This pair of macros can only * 139 * be used once per block. Note that this precludes their use * 140 * in an inner block! * 141 * * 142 ********************************************************************************** 143 144 NOLIST CREF 145 ENDFRAME MACRO 146 NOLIST 147 NOLIST CREF 148 DRCT 149 ZZ!LEN EQU DISPW ZZ!FRAME 150 PUSH EQU STAK SP,ZZ!LEN 151 POP EQU PUSH 152 ORG ZZ!FRAME 153 LIST CREF 154 LIST 155 EMAC 156 LIST CREF 157 158 159 ********************************************************************************** 160 * * 161 * PFAILEN - Enable Power-Fail Interrupt * 162 * This macro will set the power-fail restart address and * 163 * enable power-fail interrupts. Usage: * 164 * * 165 * PFAILEN location * 166 * * 167 ********************************************************************************** 168 169 170 PFAILEN MACRO 171 $L LD R0 ADR $(1) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 36 (MACRODEFS) F 5 Macro Definitions 172 ST R0 POWERUPLOC 173 IORMSR MSRPFINTE 174 EMAC 175 176 177 ********************************************************************************** 178 * * 179 * PFAILDS - Disable Power-Fail Interrupt * 180 * This macro will disable power-fail interrupts and * 181 * clear the power-fail restart address. * 182 * * 183 ********************************************************************************** 184 185 PFAILDS MACRO 186 $L CLBMSR MSRPFINTE 187 STZ POWERUPLOC 188 EMAC 189 190 191 ********************************************************************************** 192 * * 193 * PFAILCHK - Check for power failure * 194 * This macro will allow a power-fail interrupt to occur * 195 * if one is pending, control returns to the specified address * 196 * if a power-fail interrupt just occurred or if a power-fail * 197 * restart is in progress. Usage: * 198 * * 199 * PFAILCHK location * 200 * * 201 ********************************************************************************** 202 203 PFAILCHK MACRO 204 $L CMZ POWERFLAG power-fail restart in progress? 205 JNE $(1) jump if so 206 PFAILEN $(1) else allow interrupt 207 PFAILDS then disallow interrupt 208 EMAC 209 210 211 ********************************************************************************** 212 * * 213 * ASSERTEQ - Make sure two labels are equal * 214 * This macro will generate an assembly-time error if the * 215 * given expressions are not equal. Usage: * 216 * * 217 * ASSERTEQ expr1,expr2 * 218 * * 219 ********************************************************************************** 220 221 ASSERTEQ MACRO 222 BSS $(1)-$(2) error if $(1) < $(2) 223 BSS $(2)-$(1) error if $(2) < $(1) 224 EMAC 11 INPUT MACHDEFS machine parameter definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 37 (MACHDEFS) F 6 Machine Definitions 4 5 ********************************************************************************** 6 * * 7 * MACHINE DEFINITIONS * 8 * * 9 ********************************************************************************** 10 00000000 11 ZERO EQU MA 0 BEGINNING OF MONITOR MAIN MEMORY 00000000 12 PWRUPADDR EQU ZERO address for Power Fail Restart Code 13 00000000 ABS 14 STORE EQU 0 marker for pre-initialized variables FFFFFFFF ABS 15 ONEBITS EQU 0FFFFFFFF 00000010 BYTE 16 LOCKBITB EQU BIT 0 this bit indicates a list is locked 80000000 ABS 17 LOCKBIT EQU 1*LOCKBITB 18 19 ********************************************************************************** 20 * * 21 * Size information for various entities. * 22 * * 23 ********************************************************************************** 24 00000020 ABS 25 WORDLNTH EQU 32 BITS PER MACHINE WORD 00000011 ABS 26 ADDRESS EQU 17 BITS IN AN ADDRESS 00000810 BYTE 27 STPNLAST EQU BIT 4 bit in R7 for NOT last PAR/STP 00000A10 BYTE 28 STPVALUE EQU BIT 5 bit in R7 for value PAR/STP 00000C10 BYTE 29 STPDUBL EQU BIT 6 bit in R7 for double word PAR/STP 00000018 ABS 30 MSBLKLOG EQU 24 length of mass storage relative address 00000004 ABS 31 CPW EQU 4 number of characters in a word 00000400 ABS 32 WPP EQU 1024 number of words on a page 0000000A ABS 33 LWPP EQU WPP LOG 2 log of page size 00001000 ABS 34 CPP EQU WPP*CPW number of characters on a page 00001C10 BYTE 35 FLDRELOCB BIT (WORDLNTH-ADDRESS-1) xtra addr bit to flip reloc sense 00001F10 BYTE 36 FLDADRS BITS (WORDLNTH-ADDRESS):(WORDLNTH-1) address field 00001E70 BYTE 37 FLDPAGE BITS (WORDLNTH-ADDRESS):(WORDLNTH-LWPP-1) virt. page # field 000000F0 BYTE 38 UPR15 EQU BITS 0:(WORDLNTH-ADDRESS-1) non-address part of word 00001450 BYTE 39 FLDMODE EQU BITS 10:14 pointer mode field 00001560 BYTE 40 FLDMODEADR EQU FLDMODE+FLDADRS mode and address part of opcode 00001F30 BYTE 41 FLDCHARS EQU BITS 15:1 character address field 00001F60 BYTE 42 FLDBITS EQU BITS 15:4 bit address field 00000080 BYTE 43 CH0 EQU BITS 0:7 character zero 00001080 BYTE 44 CH1 EQU BITS 8:15 character one 00002080 BYTE 45 CH2 EQU BITS 16:23 character two 00003080 BYTE 46 CH3 EQU BITS 24:31 character three 00000010 ABS 47 NUMSLOTS EQU 16 number of bus slots 00000004 ABS 48 LOGSLOTS EQU NUMSLOTS LOG 2 size of a slot number field 49 50 * Monitor status register bit definitions 51 00000080 BYTE 52 MSRRSTRT EQU BITS 0:7 instruction restart code 53 00001E10 BYTE 54 MSRMPEPRCB EQU BIT 15 indicates processing memory parity error 55 00002040 BYTE 56 MSRINTCNT EQU BITS 16:19 interrupt level counter 57 00002810 BYTE 58 MSRPFINTEB EQU BIT 20 power fail interrupt enable 59 * if 1, PF interrupts allowed, 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 38 (MACHDEFS) F 6 Machine Definitions 60 * if 0, PF ints controlled by MSRINTCNT. 00002A10 BYTE 61 MSRIAPRB EQU BIT 21 associated processor interrupt pending 00002C10 BYTE 62 MSRTRACEIB EQU BIT 22 interrupt after instruction step 00002E10 BYTE 63 MSRMONB EQU BIT 23 on if monitor instructions okay 64 * relocation bits: 65 * 1 sez use monitor half of page file 66 * 0 sez use user half of page file 00003010 BYTE 67 MSRSRELOCB EQU BIT 24 operand store 00003210 BYTE 68 MSRFRELOCB EQU BIT 25 operand fetch 00003410 BYTE 69 MSRPRELOCB EQU BIT 26 pointer relocation 00003610 BYTE 70 MSRIRELOCB EQU BIT 27 instruction fetch 71 00003840 BYTE 72 MSRSLOT EQU BITS 28:31 bus slot of processor 73 * values used in changing MSR 00000100 ABS 74 MSRMON EQU 1*MSRMONB 00000800 ABS 75 MSRPFINTE EQU 1*MSRPFINTEB 00000080 ABS 76 MSRSRELOC EQU 1*MSRSRELOCB 00000040 ABS 77 MSRFRELOC EQU 1*MSRFRELOCB 00000020 ABS 78 MSRPRELOC EQU 1*MSRPRELOCB 00000010 ABS 79 MSRIRELOC EQU 1*MSRIRELOCB 80 0000F000 ABS 81 INTSON EQU ONEBITS/MSRINTCNT*MSRINTCNT 0000E000 ABS 82 INTSOFF EQU ((ONEBITS/MSRINTCNT)-1)*MSRINTCNT 0000F000 ABS 83 USERMSR EQU INTSON 000001F0 ABS 84 MSRFORMON EQU MSRMON+MSRSRELOC+MSRFRELOC+MSRPRELOC+MSRIRELOC 0000F1F0 ABS 85 MONMSR EQU INTSON+MSRFORMON 0000E1F0 ABS 86 MONMSRIOFF EQU INTSOFF+MSRFORMON Used by offline stuff 87 88 * Process Status Register bit definitions 89 00002C10 BYTE 90 PSRBCDOTRP EQU BIT 22 BCD overflow trap enable 00003010 BYTE 91 PSRFIXATRP EQU BIT 24 fixed point arith error trapbit 00003210 BYTE 92 PSRFLTATRP EQU BIT 25 floating point arith error trapbit 00003410 BYTE 93 PSRUNDETRP EQU BIT 26 undefined number arith error trapbit 00003610 BYTE 94 PSRMODIFB EQU BIT 27 modify arithmetic 00003810 BYTE 95 PSROVERFB EQU BIT 28 arithmetic overflow 00003A10 BYTE 96 PSRCARRYB EQU BIT 29 arithmetic carry 00003C20 BYTE 97 PSRCONDB EQU BITS 30:31 condition bits (30-EQ, 31-LT) 98 * values used in changing PSR 00000010 ABS 99 PSRMODIF EQU 1*PSRMODIFB 00000004 ABS 100 PSRCARRY EQU 1*PSRCARRYB 00000008 ABS 101 PSROVERFLOW EQU 1*PSROVERFB 102 103 * The WAIT instruction waits ten microseconds for each count 104 * in the operand. 105 00040000 ABS 106 WAITCOUNT EQU 2 POWER 18 about 2.5 seconds 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 39 (MACHDEFS) F 6 Machine Definitions 108 109 ********************************************************************************** 110 * * 111 * PAGE FILE DEFINITIONS * 112 * The page file contains all information required to * 113 * convert a virtual page number and the monitor/user * 114 * information into a slot number/physical page number/ * 115 * allowed access. A word formatted for the page file is * 116 * referred to as a 'page map value'. * 117 * After reading the indicated page file location, the * 118 * PFRC instruction sets it to illegal to reference. However, * 119 * this may also be accomplished by loading both the 'read * 120 * only' and 'altered' bits. * 121 * * 122 ********************************************************************************** 123 0012C000 3 REG 124 PFPTR EQU R3 register used to address PF 125 00000840 BYTE 126 PFSLOT EQU BITS 4:7 slot where page is hiding 00001A30 BYTE 127 PFCNTL EQU BITS 13:15 bits for controlling page 00001A10 BYTE 128 PFROBIT EQU BIT 13 on if page read only 00001C10 BYTE 129 PFALTBIT EQU BIT 14 on if page altered 00001E10 BYTE 130 PFREFBIT EQU BIT 15 on if page referenced 00060000 ABS 131 PFNOREFVAL EQU 1*PFROBIT+1*PFALTBIT page map value that indicates 132 * illegal to reference 000028C0 BYTE 133 PFPAGENUM EQU BITS 20:31 page number in slot ( or I/O device ) 00000080 ABS 134 NPS EQU 2 POWER (ADDRESS-LWPP) number of pages per state 00000100 ABS 135 PFSIZE EQU 2*NPS size of the page file 00000080 ABS 136 MONPF EQU NPS first location in monitor page file 137 138 ********************************************************************************** 139 * * 140 * Other miscellaneous address field definitions * 141 * * 142 ********************************************************************************** 143 144 * for I/O channel use, large hardware address field 00001560 BYTE 145 PAGEANDISP BITS 10:31 full physical address 146 * within an 18 bit virtual address, the following fields apply 00001C80 BYTE 147 PAGEFIELD BITS 14:21 page number 00003010 BYTE 148 MONBIT BIT (31-(NPS LOG 2)) bit within pagefield which 149 * indicates page is monitor 00002CA0 BYTE 150 DISPFIELD BITS 22:31 displacement within page 000014C0 BYTE 151 FLDABSPG EQU BITS 10:21 page # in absolute address 152 00000080 ABS 153 PNPAGEZERO EQU MONPF+0 page number for monitor zero page 00001000 154 BOOTLOC EQU MA 01000 location for system bootstrap 00000084 ABS 155 PNBOOTLOC EQU MONPF+(BOOTLOC DISPW ZERO)/WPP page number for bootstrap 156 157 ********************************************************************************** 158 * * 159 * MAXMAPVALS determines the number of virtual pages that * 160 * is specifically reserved for the free storage required to * 161 * maintain each user active. Note that these pages are NOT * 162 * available to the system and are never reclaimed. * 163 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 40 (MACHDEFS) F 6 Machine Definitions 164 ********************************************************************************** 165 00000004 ABS 166 MAXMAPVALS EQU 4 maximum pages for user free memory 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 41 (MACHDEFS) F 6 Machine Definitions 168 169 ********************************************************************************** 170 * * 171 * Treatise on list locking * 172 * This is in here because, even though we know better, * 173 * this keeps getting screwed up. * 174 * The only instructions that ever do an interlocked * 175 * memory operation (read-modify-write) are: * 176 * * 177 * ADDB ADDM ANDM BRSBM CLRT DEC EXCH INC INCL * 178 * IORM RSBM SETT SUBM XORM * 179 * * 180 * Even these instructions do non-interlocked * 181 * read-restore operations if the operand is not a whole word. * 182 * For the purposes of this discussion, a ZBM starting at bit * 183 * 0, 32 long is NOT a whole word. * 184 * The normal kind of lock word is a whole word, directly * 185 * addressed and set with a SETT instruction and cleared with * 186 * a STZ. * 187 * * 188 * Protecting data structures * 189 * A word may be modified in a protected manner in one of * 190 * two ways: * 191 * 1) Every operation on the word is an interlocked * 192 * memory operation. * 193 * 2) The word is modified only when an associated lock * 194 * is held. * 195 * Please, please note that these two methods may not, * 196 * nay, MUST not ever be mixed. Note especially that if ANY * 197 * operation inside a critical region is non-interlocked, then * 198 * it does NOT work to try to modify the word outside of the * 199 * critical region with an RMW. * 200 * * 201 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 42 (MACHDEFS) F 6 Machine Definitions 203 204 ********************************************************************************** 205 * * 206 * Console Area * 207 * The console area register of a CPU points to a block * 208 * of memory where the machine state will be saved on an * 209 * interrupt. The machine state is saved in the first 10 * 210 * words of the console area as defined below. The remainder * 211 * of the block is used by the operating system to hold the * 212 * virtual machine state and temporary storage. The entire * 213 * block is defined here for convenience. * 214 * The operating system maintains a stack of CAs for each * 215 * process so that when a user traps to the monitor, the * 216 * monitor has its own registers and stack area to use. * 217 * Furthermore, the monitor can issue further XREQs, in * 218 * effect, calling itself. This works as follows: Each * 219 * interrupt vector specifies a NEW CA ( the registers for the * 220 * interrupted process are always stored into its own console * 221 * area ) which will be used to save the registers of the * 222 * interrupt routine being started ( if it, in turn, is * 223 * interrupted ). If the interrupt routine being started * 224 * branches to the virtual monitor, the CA that it acquired * 225 * from the IVT will be replaced in the IVT by a fresh one ( * 226 * acquired from free storage ) and the CA in use will be * 227 * linked to the PSA of the process. * 228 * * 229 ********************************************************************************** 230 00000000 231 CONAREA BASE R0 CPU CONSOLE AREA 000800F0 0 ZBM 232 CAPSR BSSB WORDLNTH-ADDRESS process status word 00081F10 0 ZBM 233 CAPC BSSB ADDRESS the program counter 00160801 0 BASE 234 CAMSR BSS 1 monitor status word 00160802 0 BASE 235 CAR0 BSS 1 R0 00160803 0 BASE 236 CAR1 BSS 1 R1 00160804 0 BASE 237 CAR2 BSS 1 R2 00160805 0 BASE 238 CAR3 BSS 1 R3 00160806 0 BASE 239 CAR4 BSS 1 R4 00160807 0 BASE 240 CAR5 BSS 1 R5 00160808 0 BASE 241 CAR6 BSS 1 R6 00160809 0 BASE 242 CAR7 BSS 1 R7 243 * end of the machine dependant part 0016080A 0 BASE 244 CAINTADR BSS 1 user interrupt address 0016080B 0 BASE 245 CAINTMASK BSS 1 bits controlling interrupt ability 246 * bit assignments in mask word 0008001B 0 ZBM 247 CAINTENABL EQU CAINTMASK/BIT 0 indicates user accepting interrupts 248 * EQU 0 interrupt enable 00000001 ABS 249 CAIMINST EQU 1 instruction failure 00000002 ABS 250 CAIMCALL EQU 2 call/enter mismatch 00000003 ABS 251 CAIMARITH EQU 3 arithmetic failure 00000004 ABS 252 CAIMCKBDS EQU 4 check bounds trap 00000005 ABS 253 CAIMMPV EQU 5 memory protect violation 00000006 ABS 254 CAIMBREAK EQU 6 terminal break 00000007 ABS 255 CAIMALLXR EQU 7 if off, return all XREQ error codes 00000008 ABS 256 CAIMNETERM EQU 8 non-empty terminal 00000009 ABS 257 CAIMNEPATH EQU 9 non-empty path 0000000A ABS 258 CAIMTIME EQU 10 time interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 43 (MACHDEFS) F 6 Machine Definitions 0000000B ABS 259 CAIMMSG EQU 11 message receipt 0000000C ABS 260 CAIMVMF EQU 12 virtual memory failure 0000000D ABS 261 CAIMABORT EQU 13 operator abort 0000000E ABS 262 CAIMGUNIT EQU 14 unit receipt 263 0000000A ABS 264 CANUMUREGS EQU DISPW CAR0 number of scratch regs + IMR/IAR 0000000C ABS 265 CANUMREGS EQU DISPW CAPC number of registers in console area 0016080C 0 BASE 266 CALINK BSS 1 link to next console area 267 0016080D 0 BASE 268 CASTACKPTR BSS 1 address of stack associated with this CA 269 NOLIST CREF 00138000 6 REG 270 SP EQU R6 register used for stack pointer 271 LIST CREF 0016080E 0 BASE 272 CAXOPERAND BSS 1 holds XREQ operand 273 DRCT 0000000F DISP 274 CALNTH EQU DISP CONAREA LENGTH OF A CONSOLE AREA 00000004 ABS 275 CALOG EQU CALNTH LOG 2 276 ORG CONAREA 277 12 INPUT IODEFS definitions for I/O devices 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 44 (IODEFS) F 7 I/O definitions 4 5 ********************************************************************************** 6 * * 7 * Bus commands. * 8 * * 9 * These are the basic command words that appear on the * 10 * bus. The left 4 bits are interpreted as the bus command. * 11 * The right 22 bits are the address. The remaining 6 bits * 12 * are reserved for information used in support of debugging. * 13 * * 14 * When these commands go to a memory, the address (for * 15 * read, read2, write, rmw) is interpreted as a normal memory * 16 * data address. When these commands go to other devices, the * 17 * interpretation is dependent on the device. In general, the * 18 * 'page number' part of the address is decoded as a 'class' * 19 * of request. In the PPU only four classes are allowed, one * 20 * for each channel. This classification on the part of the * 21 * devices is useful to the operating system, because in order * 22 * to alter this part of the address the page file location * 23 * must be reloaded with the new page number field. * 24 * * 25 * The 'displacement' part of the address is used to * 26 * break down the requests to their final form. These bits * 27 * may be altered by the operating system by merely index * 28 * modifying an instruction or assembling a different address * 29 * (while using the same page file location). * 30 * * 31 ********************************************************************************** 32 00000000 ABS 33 BUSCWRITE EQU 000000000 write data to the device 10000000 ABS 34 BUSCRMW EQU 010000000 read/modify write 20000000 ABS 35 BUSCREAD EQU 020000000 request read of data 30000000 ABS 36 BUSCREAD2 EQU 030000000 read double 40000000 ABS 37 BUSCWRU EQU 040000000 request WRU info 50000000 ABS 38 BUSCST EQU 050000000 request self test 60000000 ABS 39 BUSCIP EQU 060000000 interrupt poll 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 45 (IODEFS) F 7 I/O definitions 41 42 ********************************************************************************** 43 * * 44 * Format of the interrupt poll response * 45 * This is the data word that a VRA bus board will return * 46 * in response to an interrupt poll request. If the polled * 47 * device does not have an interrupt asserted the data word * 48 * returned will be all zero. * 49 * The PPU and the SSU are the only boards that recognize * 50 * this command. Each has its own meaning assigned to bits * 51 * 1:31 while bit zero is reserved to indicate that an * 52 * interrupt is being requested. * 53 * * 54 ********************************************************************************** 55 00001080 BYTE 56 IPRPPUCHAN EQU BITS 8:15 PPU channel requesting interrupt 00002100 BYTE 57 IPRPPUSTAT EQU BITS 16:31 PPU status causing interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 46 (IODEFS) F 7 I/O definitions 59 60 ********************************************************************************** 61 * Format of the Who-aRe-yoU zero response. * 62 * This is the data word that all VRA bus boards return * 63 * in response to a WRU with a zero address. * 64 ********************************************************************************** 65 00000040 BYTE 66 WRU0TYPE EQU BITS 0:3 type of device 00000000 ABS 67 SLTTUNK EQU 0 indicates nothing here 00000001 ABS 68 SLTTMEM EQU 1 indicates memory here 00000002 ABS 69 SLTTCPU EQU 2 indicates CPU here 00000003 ABS 70 SLTTPPU EQU 3 indicates PPU here 00000004 ABS 71 SLTTSSU EQU 4 indicates SSU here 00000A10 BYTE 72 WRU0INT EQU BIT 5 on if interrupting 00000D20 BYTE 73 WRU0DD EQU BITS 6:23 device dependent status 00001040 BYTE 74 WRU0CPUSUB EQU BITS 8:11 sub code in CPU indicating CPU type 00000001 ABS 75 CPU4 EQU 1 indicates we are a CPU4 00003080 BYTE 76 WRU0MREV EQU BITS 24:31 micro code revision 77 78 ********************************************************************************** 79 * Format of the WRU 0 response from a Memory Control * 80 * Unit and a Semi-conductor Memory Unit. * 81 ********************************************************************************** 82 00001040 BYTE 83 WRUMEMDEVT EQU BITS 8:11 indicates type of memory device 84 * EQU 0 indicates regular MCU 00000001 ABS 85 WRU0SMUDEV EQU 1 indicates this is a SMU board 00002040 BYTE 86 WRUMEMINC EQU BITS 16:19 says the number of words of memory 87 * described by each bit of the WRU4 response: 88 * 0 => 32K words, 1 => 64K words, 89 * 2 => 128K words, 3 => 256K words, etc. 00002E10 BYTE 90 WRUMEMNO0 EQU BIT 23 1 if memory address zero not installed 91 * on this memory controller. 92 93 ********************************************************************************** 94 * Format of the WRU 4 response from a MCU. In the * 95 * following description, "n" means 2 POWER (15+WRUMEMINC). * 96 ********************************************************************************** 97 00002C10 BYTE 98 WRUMEMNONE EQU BIT 22 no memory is attached to this MCU 00002E10 BYTE 99 WRUMEMBAD EQU BIT 23 memory is improperly attached 00003080 BYTE 100 WRUMEMHERE EQU BITS 24:31 bits describing what memory is attached: 101 * bit 31 => words 0.. n-1 are useable 102 * bit 30 => words n..2*n-1 are useable 103 * bit 29 => words 2*n..3*n-1 are useable 104 * ... 105 * bit 24 => words 7*n..8*n-1 are useable 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 47 (IODEFS) F 7 I/O definitions 107 108 ********************************************************************************** 109 * * 110 * SMU command codes. These command codes are used for * 111 * manipulation of the SMU error logs. * 112 * The SMU is limited in the number of pseudo-commands it * 113 * can process so requires that they come in no faster than * 114 * one command every 20 ms. If the SMU receives a * 115 * pseudo-command while it is processing a previous one the * 116 * first pseudo-command will be lost. * 117 * * 118 ********************************************************************************** 119 120 * EQU BITS 0:3 bits containing SMU command code 121 * These are the standard bus read and write command formats 122 * EQU 0 write 123 * EQU 1 illegal 124 * EQU 2 read 125 00000C10 BYTE 126 SMUPCMND EQU BIT 6 indicates this is a pseudo-command 00001840 BYTE 127 SMUPCC EQU BITS 12:15 psuedo-command code 128 * Write pseudo-command pseudo-command codes 129 * EQU 0 unused 130 * EQU 1 clear error log and error log buffer 131 * EQU 2 clear individual error entry 132 * Read pseudo-command pseudo-command codes 133 * EQU 0 read random error log entry 134 * EQU 1 read sequential error log entry 00000002 ABS 135 SMUPCRCEL EQU 2 read current error log status 136 137 * EQU BITS 20:31 address field 138 * EQU BITS 21:23 rank field 139 * EQU BITS 24:31 IC field 140 141 * Format of the error status word 142 * EQU BIT 0 unused 143 * EQU BITS 1:7 correction check bits 144 * EQU BITS 9:10 error type 145 * EQU 0 soft error 146 * EQU 1 hard error 147 * EQU 2 uncorrectable error 148 * EQU BITS 11:13 rank address 149 * EQU BITS 14:15 upper address bits 150 * EQU BITS 16:23 Ras address 151 * EQU BITS 24:31 Cas address 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 48 (IODEFS) F 7 I/O definitions 153 154 ********************************************************************************** 155 * * 156 * CPU ERROR CODES (Rev 12 and greater microcode) * 157 * * 158 * The CPU has two types of fatal errors: Bus errors * 159 * and CPU errors. When the CPU gets a Bus error, it asserts * 160 * BSE. When a CPU error occurs, a CPU error message is sent * 161 * to the SSU. In both cases, certain state information has * 162 * been saved by the CPU, and is accessable from the RFP. * 163 * * 164 * The state information is saved as follows: * 165 * * 166 * R11 (SP17) = Microstatus register 1 * 167 * R12 (SP18) = Microstatus register 2 ([28:31]=From register) * 168 * R13 (SP19) = Microstatus register 3 * 169 * R14 (SP20) = Input register 1 * 170 * R15 (SP21) = Input register 2 * 171 * R16 (SP22) = Output register 1 * 172 * R17 (SP23) = Output register 2 * 173 * R19 (SP24) [0:3] = Error code * 174 * [4:7] = Error parameter * 175 * [20:31] = ucode address where error was detected * 176 * * 177 * The error codes are listed below. Error codes 1 * 178 * through 7 are Bus error codes and codes 8 through A are * 179 * CPU error codes. * 180 * * 181 * 1 --> Parity error on the Bus. * 182 * 2 --> Bad flags on the Bus. * 183 * 3 --> Bad command code on the Bus. * 184 * 4 --> Bad command address on the Bus. * 185 * 5 --> RTO timeout on the Bus. * 186 * 6 --> IBF timeout on the Bus. * 187 * 7 --> Parity and flag error on the Bus (same as codes * 188 * 1 and 2) * 189 * 8 --> Page fault during trap setup * 190 * 9 --> Page fault when trying to store console area * 191 * A --> Hardware error * 192 * * 193 * The second digit of the error message is the error * 194 * parameter. These are used to indicate the type of word * 195 * which caused a flag or parity error. * 196 * * 197 * 0 --> No information * 198 * 1 --> Error in command word of received command * 199 * 2 --> Error in data word of received command * 200 * 3 --> Error in instruction fetch data * 201 * 4 --> Error in operand fetch data * 202 * 5 --> Error in pointer fetch data * 203 * 6 --> Error in interrupt poll data * 204 * 7 --> Error in trap fetch data * 205 * * 206 * CPU command codes. The command codes given here * 207 * require something in the page file which is given as the * 208 * offset. Command values given are within that offset. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 49 (IODEFS) F 7 I/O definitions 209 * * 210 ********************************************************************************** 211 00000000 ABS 212 CPUREGOFST EQU 000000 offset for registers in RAM 00000000 ABS 213 CPUREG EQU 000 R/W registers indexed by number (R0:R7) 00000008 ABS 214 CPUPC EQU 008 R/W program counter 00000009 ABS 215 CPUMSR EQU 009 R/W monitor status register 0000000A ABS 216 CPUCCA EQU 00A R/W current console area register 217 * EQU 00B R/W interrupt mask 218 * 00010000 ABS 219 CPUPFOFSET EQU 010000 R/W offset for PF indexed by number 220 * 00020000 ABS 221 CPUOOFFSET EQU 020000 R/W offset for other registers 00000000 ABS 222 CPUPSR EQU 000 R/W processor status register 00000001 ABS 223 CPUI EQU 001 R/W processor instruction register 00000002 ABS 224 CPUA EQU 002 R/W processor A accumulator 00000003 ABS 225 CPUQ EQU 003 R/W processor Q accumulator 00000004 ABS 226 CPUPMS EQU 004 R/W processor "outboard" MSR 00000005 ABS 227 CPUUS EQU 005 R/W processor uproc status register 228 * 00030000 ABS 229 CPUCOFFSET EQU 030000 command offset 230 * (the data word is ignored for these commands) 00000000 ABS 231 CPURUN EQU 000 W begin running 00000001 ABS 232 CPUSTOP EQU 001 W stop execution 00000002 ABS 233 CPUSCYCLE EQU 002 W single cycle 00000003 ABS 234 CPUSSTEP EQU 003 W single step 00000004 ABS 235 CPUIAPR EQU 004 W interrupt associated processor 236 00000700 ABS 237 CPUUCODELD EQU 0700 W tells CPU to reload its microcode 00000703 ABS 238 CPUPTCHCMD EQU 0703 W load microcode patches 239 * data word contains physical address of 240 * start of patch 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 50 (IODEFS) F 7 I/O definitions 242 243 ********************************************************************************** 244 * * 245 * SSU * 246 * The SSU (System Services Unit) provides all manner of * 247 * miscellaneous services to the system. * 248 * * 249 * CLOCK * 250 * The system clock is a 44 bit CMOS counter that ticks * 251 * every millisecond. It has a battery backup to keep it * 252 * operating during power outages of up to a week. The clock * 253 * is factory loaded with the correct time, and it should only * 254 * need occasional corrections for drift. The epoch (time * 255 * when clock would have been 0000) is 0000 17 November, 1858. * 256 * The 44 bit counter will overflow sometime in the 25th * 257 * century. * 258 * Functions are provided to read the clock, write the * 259 * clock, and to increment or decrement it. The latter are * 260 * used for all minor corrections to prevent slippage * 261 * problems. Starting with Rev 14, the SSU can also be * 262 * initialized to store the current clock into memory * 263 * every millisecond. * 264 * * 265 * CONTROL PANEL DISPLAY * 266 * The 10 character display on the control panel is * 267 * shared by several functions. The SSU contains two message * 268 * buffers for driving the display. One is used for SSU * 269 * generated displays, while the other is reserved for * 270 * displays generated by the CPUs (operating system). This * 271 * allows the most recent display of each type to be available * 272 * to the RDU. * 273 * First, the SSU will display bus errors and self test * 274 * errors in it. * 275 * Second, if any CPU executes a halt or stop * 276 * instruction, that CPU sends a message to the SSU who * 277 * displays a halt code (see HALTDEFS) then stops the entire * 278 * system by asserting PAUSE. * 279 * Third, the system may display anything that it chooses * 280 * while it is running. * 281 * The character set is 6-bit ASCII, as follows: * 282 * 0 1 2 3 4 5 6 7 * 283 * +-------------------------- * 284 * 00 | @ A B C D E F G * 285 * 08 | H I J K L M N O * 286 * 10 | P Q R S T U V W * 287 * 18 | X Y Z [ ~ ] { } * 288 * 20 | ! " # $ % & ' * 289 * 28 | ( ) * + , - . / * 290 * 30 | 0 1 2 3 4 5 6 7 * 291 * 38 | 8 9 : s < = > ? (s = semicolon) * 292 * In each character, the 80 bit turns on a decimal point * 293 * after the character. In the word containing the last two * 294 * characters, two low-order bits control the ALARM light and * 295 * the horn. * 296 * * 297 * REMOTE FRONT PANEL * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 51 (IODEFS) F 7 I/O definitions 298 * The SSU has an RS232 port on it for connection to a * 299 * dedicated modem. This is provided for use by the remote * 300 * front panel maintenance facility. There is also a 50 pin * 301 * ribbon connector provided for connection to a portable * 302 * field service maintenance unit. * 303 * * 304 * INTERVAL TIMER * 305 * A 'fence' register is provided to indicate the time at * 306 * which the system desires an interrupt. A down counter is * 307 * not used because of the problem of slippage. That is, a * 308 * given interrupt time, if composed of many smaller * 309 * intervals, is subject to an error for each interval used. * 310 * This error would be one millisecond for each tick that * 311 * occurs between the interrupt posting and the reloading of * 312 * the down counter. Instead, when the lower 16 bits of the * 313 * clock become equal to the fence register due to a tick, or * 314 * an increment, the SSU posts an interrupt. This allows the * 315 * system to store the actual times at which interrupts are * 316 * desired. The interrupts are kept ordered and the next one * 317 * is used to load the fence. * 318 * * 319 * CONTROL PANEL SWITCHES * 320 * These switches are provided primarily so that the * 321 * operator can indicate a few options at the time of a system * 322 * boot. They also allow the operator to select what will be * 323 * displayed on the ten character display during system * 324 * operation. * 325 * * 326 * NON-VOLATILE MEMORY * 327 * A buried charge read-mostly memory is provided so that * 328 * the system may store up to 128 bytes of vital information. * 329 * In SSU rev 14, the NVM is of a different type and contains * 330 * 2048 bytes of information, although the full 2048 bytes are * 331 * not usable until rev 15 due to microcode bugs. Each byte is * 332 * individually addressed. Bytes are read or written by reading * 333 * or writing through SSUNVM+nn. For read, only bits 24:31 are * 334 * valid, for write, the data is taken from bits 24:31. * 335 * * 336 * Error Block * 337 * The SSU's error block is a 16 word buffer. Each word * 338 * corresponds to a slot in the VRA bus. If a word is zero, * 339 * then either there is not a CPU in that slot, or that CPU * 340 * has not sent a Halt, Stop, or Error message to the SSU. * 341 * Prior to microcode 15, the special case of a CPU executing * 342 * a word of all zeros created the irritating phenomenon of * 343 * storing a zero into the error file which appeared as no * 344 * error. Rev 15 converts the all zero word, when received, * 345 * into 0FF000000 before storing it into the error file. * 346 * * 347 * If a word in the block is nonzero, it is displayed as follows: * 348 * * 349 * If (Bits[0:7] = 0) and (Bit[8] = 0), then the display is * 350 * "HLTn axxxx", where n is the slot number, a is a 6-bit ASCII * 351 * char in Bits[10-15], and xxxx is the 4 hex nibbles in Bits[16-31]. * 352 * Note that, prior to SSU microcode Rev 15, a HALT 0 * 353 * placed all 0s (the instruction word) into the error * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 52 (IODEFS) F 7 I/O definitions 354 * file. This looks as if no error has been posted. * 355 * * 356 * If (Bits[0:7] = 0) and (Bit[8] = 1), then the display is * 357 * "STPn axxxx", where n is the slot number, a is a 6-bit ASCII * 358 * char in Bits[10-15], and xxxx is the 4 hex nibbles in Bits[16-31]. * 359 * * 360 * If (Bits[0:7] = 0FF) then the entry is for a HALT 0. * 361 * * 362 * If (Bits[0:7] <> 0) then the display is "CPU n Err wwwwwwww", * 363 * where n is the slot number, and wwwwwwww is the word in the * 364 * error block. * 365 * * 366 * BOOTSTRAP * 367 * The sequence of events during a bootstrap is as * 368 * follows: * 369 * 1) Assert PAUSE, PFW, and MCLR. This clears out the * 370 * bus interface logic and such like and sets up the * 371 * microprocessors to run when released. * 372 * 2) Release PFW and MCLR. * 373 * 3) Poll all slots and build a table of filled slots. * 374 * 4) For each active slot, do WRU 0 through WRU 0E * 375 * and store the results into 0200+*16 * 376 * in the first available page of memory. * 377 * 5) Command each bus device to run its self test. * 378 * 6) Allow enough time for the self test to complete. * 379 * 7) Retrieve the self test response (WRU OF) from all slots * 380 * and store it with the other WRU data (see item 4, above). * 381 * 8) Initialize each CPU to execute the monitor code * 382 * starting at location 0. * 383 * 9) Copy the 16K EPROM into locations 0-01FF of the * 384 * first page of available memory. Note: This EPROM * 385 * may also be read by reading through SSUROFFSET+nn. * 386 * 10) Release PAUSE to let the CPUs go. * 387 * * 388 * POWER UP * 389 * The sequence of events at power up is as * 390 * follows: * 391 * 1) Run self test on itself. * 392 * 2) Assert MCLR, PFW, and PAUSE. Wait for 1 second. * 393 * 3) Clear MCLR. Wait for 250 Msecs. * 394 * 4) Clear PFW. Wait for 5 seconds. * 395 * 5) * 396 * * 397 * SSU command codes. The command codes given here require * 398 * an offset to be loaded in the page file (as a page number). * 399 * The command values are relative to that offset. * 400 * * 401 ********************************************************************************** 402 00003080 BYTE 403 IPRSSUSTAT EQU BITS 24:31 Interrupt status bits in interrupt poll 404 405 * EQU 0C00 R/W SSU scratchpad Ram (byte at a time in bits 24:31) 406 00001000 ABS 407 SSUROFFSET EQU 01000 R offset to address PROM bootstrap 408 00001400 ABS 409 SSUCOFFSET EQU 01400 offset to following commands 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 53 (IODEFS) F 7 I/O definitions 410 * The SSU clock is a 44 bit counter 411 * that counts every millisecond. 412 * It has a battery to keep it 413 * operating during power failures. 00000001 ABS 414 SSUCLOCKU EQU 00001 R/W most significant 12 bits of clock 00000002 ABS 415 SSUCLOCKL EQU 00002 R/W least significant 32 bits of clock 00000003 ABS 416 SSUINCCLK EQU 00003 W increment clock 00000004 ABS 417 SSUDECCLK EQU 00004 W decrement clock 418 * These 3 codes are sent by the 419 * CPU microcode only. 00000005 ABS 420 SSUCPUHALT EQU 00005 W CPU halt/stop message 00000006 ABS 421 SSUCPUERR EQU 00006 W user error in monitor 00000007 ABS 422 SSUCPUBUSE EQU 00007 W CPU got abnormal data 423 * To/From remote or local front 424 * panel port. 00000008 ABS 425 SSUCHAROUT EQU 00008 R/W send char out to UART, sign sez ready 00002E10 BYTE 426 SSUBREAKB EQU BIT 23 bit indicating break command 00002C10 BYTE 427 SSUDWELLB EQU BIT 22 bit indicating dwell command 000000FF ABS 428 SSUMAXCC EQU 0FF maximum number of break or dwell chars 429 that can be sent at once 430 431 * The fence is matched against the 432 * right 16 bits of CLOCKL. 00000009 ABS 433 SSUFENCE EQU 00009 R/W 16 bit time to interrupt 434 435 * The operating system has control of the 436 * control panel display as long as the machine 437 * is running. These three locations are used 438 * for communications with the display. 439 * The SSU takes control of the display for 440 * many conditions. The system may read what 441 * the SSU last put up in the display through 442 * a different set of addresses, see below. 0000000A ABS 443 SSUDISP03 EQU 0000A R/W characters 0, 1, 2, 3 of system display 0000000B ABS 444 SSUDISP47 EQU 0000B R/W characters 4, 5, 6, 7 of system display 0000000C ABS 445 SSUDISP89 EQU 0000C R/W characters 8, 9 of system display, alarm, horn 00003410 BYTE 446 SSUHORN EQU BIT 26 W on to sound horn (continuously) 00003610 BYTE 447 SSUALARM EQU BIT 27 W on to light ALARM box 448 * EQU BIT 1 R horn is on 449 * EQU BIT 9 R Alarm light is on 450 0000000D ABS 451 SSUCHARIN EQU 0000D R char in from UART, sign sez new 452 * EQU BIT 23 on if Break rather than character 0000000E ABS 453 SSUMISCST EQU 0000E R misc. statuses 00003E10 BYTE 454 SSUMSLFP EQU BIT 31 local front panel connected 00003C10 BYTE 455 SSUMSBC EQU BIT 30 SSU providing bus clock 00003A10 BYTE 456 SSUMSNVM EQU BIT 29 NVM not busy 457 0000000F ABS 458 SSUINTMASK EQU 0000F R/W interrupt mask 459 * Bits in interrupt mask and WRU response 00003010 BYTE 460 SSUIMCI EQU BIT 24 character in from UART 00003210 BYTE 461 SSUIMCO EQU BIT 25 ready for character out 462 * EQU BIT 26 unused 00003610 BYTE 463 SSUIMCLKSTR EQU BIT 27 allow SSU to update clock in memory 00003810 BYTE 464 SSUIMERR EQU BIT 28 error log information available 00003A10 BYTE 465 SSUIMNVM EQU BIT 29 NVM ready 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 54 (IODEFS) F 7 I/O definitions 00003C10 BYTE 466 SSUIMFPS EQU BIT 30 control panel switch change 00003E10 BYTE 467 SSUIMTICK EQU BIT 31 clock interrupt 468 00000010 ABS 469 SSUBOOTFP EQU 00010 R control panel switches at boot time 470 * EQU 00010 W cause boot to happen 471 * bits 24:31 are boot number 00000011 ABS 472 SSUFPSWCH EQU 00011 R current control panel switches 473 * Bits in SSU control panel switch read 00000010 BYTE 474 SSURFP EQU BIT 0 on if RFP doing boot 475 * EQU BIT 24 RUN - when we can look, its on 476 * EQU BIT 25 BOOT - when we can look, its off 00003410 BYTE 477 SSUSWMAINT EQU BIT 26 MAINT - remote maintenance enable 478 * EQU BIT 27 POWER - on 00003810 BYTE 479 SSUSW1 EQU BIT 28 switch numbered 1 00003A10 BYTE 480 SSUSW2 EQU BIT 29 switch numbered 2 00003C10 BYTE 481 SSUSW3 EQU BIT 30 switch numbered 3 00003E10 BYTE 482 SSUSW4 EQU BIT 31 switch numbered 4 00003840 BYTE 483 SSUSWITCH EQU SSUSW1+SSUSW2+SSUSW3+SSUSW4 484 00000012 ABS 485 SSUERRLOG EQU 00012 R read and clear error log information 486 * EQU BIT 29 write to port zero when no room 487 * EQU BIT 30 write to NVM when busy 488 * EQU BIT 31 read to NVM when busy 489 490 * The SSU itself generates control panel 491 * displays (self test, bus error, etc) 492 * The system can read the last such display. 493 * EQU 00013 R characters 0, 1, 2, 3 of SSU display 494 * EQU 00014 R characters 4, 5, 6, 7 of SSU display 495 * EQU 00015 R characters 8, 9 of SSU display 496 497 * EQU 00016 R/W 32 bit version of the clock 498 499 * The SSU will automatically store the 500 * clock every millisecond if the appropriate 501 * control bit (in interrupt mask) is set. 502 * This word contains the physical address 503 * of the double word that is to be kept 504 * up to date. 00000017 ABS 505 SSUCLOKAD EQU 00017 R/W physical address for clock update 506 * bits 4:7 = slot number of memory 507 * bits 8:31 = physical address of first word of two 508 00001800 ABS 509 SSUNVM EQU 01800 R/W offset to get at NVM 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 55 (IODEFS) F 7 I/O definitions 511 512 ********************************************************************************** 513 * * 514 * PPU command codes * 515 * The PPU provides the link between the VRA bus and the * 516 * peripheral controllers. * 517 * The PPU is capable of operating 4 completely * 518 * independant channels. They are addressed by making the * 519 * PPUCHAN bits in the store and load commands equal to the * 520 * channel desired. Normally, this is done by loading a base * 521 * address into the page file. * 522 * channel 0 = MA 000000 or page number 000 * 523 * channel 1 = MA 010000 or page number 040 * 524 * channel 2 = MA 020000 or page number 080 * 525 * channel 3 = MA 030000 or page number 0C0 * 526 * Two basic functions are provided. The first of these * 527 * is the DMA or data channel capability. Also included is * 528 * interrupt control and such like capabilities. * 529 * These capabilities are controlled by stores and loads * 530 * from the addresses between 0 and 01FF. * 531 * The other basic function provided by the PPU is to * 532 * send control information directly to and receive status * 533 * information directly from the controller. This is * 534 * accomplished by loads and stores with the DEVBIT bit set * 535 * in the address (that is, addresses from 0200 to 03FF). * 536 * * 537 ********************************************************************************** 538 00003020 BYTE 539 PPUCHAN EQU BITS 24:25 PPU channel number as put in PF 00000004 ABS 540 PPUCHANS EQU 4 number of channels on a PPU 541 00000000 ABS 542 PPUCABLED EQU 000 R gets non-zero if channel cabled to responding 543 * (non-zero return is controller WRU info) 00000001 ABS 544 PPUINTSTAT EQU 001 R gets ports internal PPU status, format below 00003E10 BYTE 545 PPUIDMAD EQU BIT 31 *DMA direction, 1 sez memory -> PPU device 00003C10 BYTE 546 PPUIINTP EQU BIT 30 +PPU requests interrupt 00003A10 BYTE 547 PPUIDMAE EQU BIT 29 DMA output enabled 00003810 BYTE 548 PPUIINTC EQU BIT 28 +controller requests interrupt 549 00003610 BYTE 550 PPUIROLL EQU BIT 27 +byte count rollover 00003410 BYTE 551 PPUILAST EQU BIT 26 last byte count processed 00003210 BYTE 552 PPUIBCNR EQU BIT 25 next byte count not ready on rollover 00003010 BYTE 553 PPUIDMANB EQU BIT 24 DMA not busy 554 00002E10 BYTE 555 PPUIMPE EQU BIT 23 memory parity error 00002C10 BYTE 556 PPUIINTR EQU BIT 22 *cause PPU interrupt request 557 * on byte count rollover 00002A10 BYTE 558 PPUICONF EQU BIT 21 PPU is confused 00002810 BYTE 559 PPUICIA EQU BIT 20 #*controller allowed to interrupt CPU 560 00002610 BYTE 561 PPUIPIA EQU BIT 19 #*PPU allowed to interrupt CPU 00002410 BYTE 562 PPUIDPPE EQU BIT 18 data path parity error 00002210 BYTE 563 PPUIXTRA EQU BIT 17 extra characters after rollover 00002010 BYTE 564 PPUIBTR EQU BIT 16 between records (EOR from controller) 565 * The CPU may change the bits marked with a "*", 566 * the bits marked with a "+" are cleared on a status read, 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 56 (IODEFS) F 7 I/O definitions 567 * the bits marked with a "#" are cleared when the CPU 568 * accepts an interrupt. 00001E10 BYTE 569 PPUITOUT EQU BIT 15 software timeout, ORed in on deadman 570 00000000 ABS 571 PPURESET EQU 000 W give power reset to controller 00000001 ABS 572 PPUABORT EQU 001 W abort operation and reset error state on channel 00000002 ABS 573 PPUCHANS1 EQU 002 R fetch controller status word 1 00000003 ABS 574 PPUCHANS2 EQU 003 R fetch controller status word 2 00000002 ABS 575 PPUSSSTAT EQU 002 W selectively set bits in internal status 00000003 ABS 576 PPUSCSTAT EQU 003 W selectively clear bits in internal status 577 00000004 ABS 578 PPUCNT1 EQU 004 R/W primary byte count - below format 00002010 BYTE 579 PPUCLAST EQU BIT 16 sez last byte count 000022F0 BYTE 580 PPUCCOUNT EQU BITS 17:31 character count 581 00000005 ABS 582 PPUADDR1 EQU 005 R/W primary transfer address 00000840 BYTE 583 PPUASLOT EQU BITS 4:7 slot that address is in 00001560 BYTE 584 PPUAMEMA EQU BITS 10:31 physical memory address 585 00000006 ABS 586 PPUCNT2 EQU 006 R/W secondary byte count 00000007 ABS 587 PPUADDR2 EQU 007 R/W secondary memory address 588 00000008 ABS 589 PPU3WRD EQU 008 R/W 1 sez enable PPU to do triple word transfers 590 * Note that PPU3 (the double board model) cannot 591 * do double word transfers. The initial release 592 * of PPU4 was on microcode rev 014, however, a 593 * release of PPU3 microcode has since been issued 594 * that is for rev 015. See the bit array in 595 * initial for the current information. Note that 596 * a store to this location in a PPU3 will cause 597 * a bus error. 598 00000200 ABS 599 DEVBIT EQU 0200 bit indicates that communications 600 * to the PPU are passed through 601 * to the device 602 603 ********************************************************************************** 604 * The WRU responses from the devices have the following * 605 * format. These responses are acquired either by doing a * 606 * load from PPUCABLED or by doing a load from location 0 of * 607 * the device (proper channel and DEVBIT set in the physical * 608 * address). * 609 ********************************************************************************** 610 00000080 BYTE 611 DWRUTYPE EQU BITS 0:7 type of device 612 * 0 sez nothing cabled 00000001 ABS 613 DVCTBFD EQU 01 disk 00000002 ABS 614 DVCTLPC EQU 02 line printer controller 00000008 ABS 615 DVCTCOMM EQU 08 async. communications 00000009 ABS 616 DVCTMTC EQU 09 9 track mag tape 0000000A ABS 617 DVCTCTC EQU 0A cartridge tape controller 0000000B ABS 618 DVCTVTC EQU 0B video tape (exabyte) 0000000C ABS 619 DVCTSDC EQU 0C SCSI disk controller 620 00001080 BYTE 621 DWRUMREV EQU BITS 8:15 micro-code revision 622 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 57 (IODEFS) F 7 I/O definitions 00002080 BYTE 623 DWRUDD EQU BITS 16:23 device dependent status 624 625 * EQU BITS 24:31 undefined 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 58 (IODEFS) F 7 I/O definitions 627 628 ********************************************************************************** 629 * * 630 * Definitions for the BFD * 631 * Command codes and statuses for the Binary Formatted * 632 * Disk controller (BFD). * 633 * The disk controller can handle up to four units, * 634 * however, it allows unit number plugs to be zero through * 635 * seven. * 636 * The disk controller only handles transfers in terms of * 637 * whole blocks which are 1035 words long. The system * 638 * software treats the first 1024 words as data and the * 639 * remaining 11 words as a File Block Identifier (FBI). * 640 * However, the hardware does not see this distinction except * 641 * at the PPU who handles the double buffers used by the * 642 * operating system. * 643 * The disk controller partitions each block into 9 * 644 * sectors of 115 words and writes sync fields and CRCs for * 645 * each sector. In addition, the exclusive or of all of the * 646 * sectors is written to a tenth sector which is available to * 647 * the software for error correction. * 648 * The offset to the first word of each segment is: * 649 * segment first word * 650 * ------- ----- ---- * 651 * 1 0000 * 652 * 2 0073 * 653 * 3 00E6 * 654 * 4 0159 * 655 * 5 01CC * 656 * 6 023F * 657 * 7 02B2 * 658 * 8 0325 * 659 * 9 0398 * 660 * * 661 ********************************************************************************** 662 00000073 ABS 663 BFDSEGSIZE EQU 115 size of segments for error correction 0000000A ABS 664 BFDNUMSEGS EQU 0A number of segments incl. check seg 0000000A ABS 665 BFDCHKSEG EQU 0A check segment's number 00000008 ABS 666 BFDUNITS EQU 8 number of units on a BFD 667 668 * In the device WRU: 00002080 BYTE 669 BFDIDSTEST EQU BITS 16:23 self test status 670 * BIT 16 unknown nano-program counter 671 * BIT 17 timeout waiting for nano-processor 672 * BIT 18 soft pattern error 673 * BIT 19 buffer A error 674 * BIT 20 CRC generator error 675 * BIT 21 buffer B error 676 * BIT 22 error file error 677 * BIT 23 switchyard or data path flag error 678 00000210 ABS 679 BFDSEEK EQU 0210 R/W seek 680 * data word is seek address 00000100 BYTE 681 BFDSACYL EQU BITS 0:15 cylinder number 00002080 BYTE 682 BFDSAHEAD EQU BITS 16:23 head number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 59 (IODEFS) F 7 I/O definitions 00003080 BYTE 683 BFDSASEC EQU BITS 24:31 sector number 684 00000220 ABS 685 BFDSS EQU 0220 R standard status 00000010 BYTE 686 BFDSSOLINT EQU BIT 0 device went off line interrupt request 687 * BIT 1 off line interrupt enabled 00000410 BYTE 688 BFDSSNSAFE EQU BIT 2 volume not safe (has been offline) 00000610 BYTE 689 BFDSSWPROT EQU BIT 3 write protect 00000810 BYTE 690 BFDSSRDY EQU BIT 4 ready 00000A10 BYTE 691 BFDSSONCYL EQU BIT 5 on cylinder 00000C10 BYTE 692 BFDSSSKERR EQU BIT 6 seek error 00000E10 BYTE 693 BFDSSFAULT EQU BIT 7 read/write unsafe (fault) 00001080 BYTE 694 BFDSSEBITS EQU BITS 8:15 seek end bits 695 * bit 8 = drive H 696 * bit 9 = drive G 697 * ... 698 * bit 15= drive A 00002030 BYTE 699 BFDSSDNUM EQU BITS 16:18 drive number responding 700 * 0=A, 1=B, etc. 701 * BIT 19 interrupt on seek end enabled 00002810 BYTE 702 BFDSSWCERR EQU BIT 20 word count error (FIFO not empty) 00002A10 BYTE 703 BFDSSLOSTD EQU BIT 21 lost data (PPU didn't keep up) 00002C10 BYTE 704 BFDSSIFPE EQU BIT 22 interface parity error 00002E10 BYTE 705 BFDSSRSPER EQU BIT 23 response error 706 * (multiple or no drive responding) 00003030 BYTE 707 BFDSSHDECD EQU BITS 24:26 error code for sector header 708 * EQU 0 no error 709 * EQU 1 header gap field non zero 710 * ( after any sector mark ) 711 * EQU 2 no header found 712 * ( after any sector mark ) 713 * EQU 3 bad header CRC 714 * ( only if header otherwise matches ) 715 * EQU 4 matching header not found 716 * ( no header on this track matches ) 00003610 BYTE 717 BFDSSCEOV EQU BIT 27 (read, write check): time code error 718 * (write check): compare error 719 * (write): overrun 00003840 BYTE 720 BFDSSERRCD EQU BITS 28:31 error code 721 * 0 = no error 722 * 1-0A error in single segment corresponding 723 * (0A is the check segment) 724 * 0B = bad command 725 * 0C = drive not ready/on cylinder, response error, 726 * no data found, gap non-zero 727 * 0D = hardware error 728 * 0E = time out 729 * 0F = (read, write check): multiple CRC 730 * errors or sector overrun, 731 * (write, format): drive write protected 732 00000230 ABS 733 BFDEF18 EQU 0230 R error file locations 1 - 8 734 * each segment has 4 bits (WOCT) 735 * where: W => write check error 736 * O => sector over-run 737 * C => segment CRC error 738 * T => segment time code error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 60 (IODEFS) F 7 I/O definitions 00000240 ABS 739 BFDEF9A EQU 0240 R error file locations 9 - 0A, and other stuff 00001080 BYTE 740 BFDREADY EQU BITS 8:15 ready bits for units 7..0 00002080 BYTE 741 BFDPRESENT EQU BITS 16:23 present bits for units 7..0 00000250 ABS 742 BFDINTERNS EQU 0250 R internal status 743 00000200 ABS 744 BFDSELECT EQU 0200 W select 745 * data word contains unit number 00000220 ABS 746 BFDFUNC EQU 0220 W function 747 * data words 00000011 ABS 748 BFDFNCLFLT EQU 011 reset ( clear fault ) 00000012 ABS 749 BFDFNZERO EQU 012 restore ( rezero heads ) 00000014 ABS 750 BFDFNSOLNT EQU 014 enable off line interrupts 00000018 ABS 751 BFDFNUOLNT EQU 018 disable off line interrupts 00000020 ABS 752 BFDFNSAFE EQU 020 clear volume not safe status 00000021 ABS 753 BFDFNSISE EQU 021 select int on seek end 00000022 ABS 754 BFDFNUISE EQU 022 unselect int on seek end 00000024 ABS 755 BFDFNENINT EQU 024 enable interrupts 00000028 ABS 756 BFDFNDSINT EQU 028 disable interrupts 00000041 ABS 757 BFDFNOFSF EQU 041 select offset forward 00000042 ABS 758 BFDFNOFSB EQU 042 select offset reverse 00000044 ABS 759 BFDFNCLOFS EQU 044 clear offset 00000048 ABS 760 BFDFNRESET EQU 048 reset controller 00000081 ABS 761 BFDFNDSE EQU 081 select data strobe early 00000082 ABS 762 BFDFNDSL EQU 082 select data strobe late 00000084 ABS 763 BFDFNRDS EQU 084 reset data strobe 764 00000230 ABS 765 BFDREAD EQU 0230 W read 766 * reads data (1035 words) if 0 stored 767 * reads check (115 words+time code) if 1 stored 768 * read header if 2 stored 769 * read data with hard sectoring if 3 stored 00000240 ABS 770 BFDWRITE EQU 0240 W write data 771 * data word = time code word to be written 00000250 ABS 772 BFDWRCH EQU 0250 W write check 773 * data word = time code expected 00000260 ABS 774 BFDFORMAT EQU 0260 W write format F0783C1E ABS 775 BFDFORMATW EQU 0F0783C1E data word for format operation 776 00000008 ABS 777 BFDSELECTB EQU 0008 select enable 778 * If this bit is set, the right 779 * three bits of this commands 780 * address are used to select a 781 * drive. This is the unit number 782 * which is not the same as drive number. 783 * unit number is the plug on the front 784 * of each drive, drive number is the 785 * cable position on the controller. 786 00003010 BYTE 787 BFDINTBIT EQU BIT 24 bit in store address indicates 788 * interrupt on completion 789 790 ********************************************************************************** 791 * * 792 * Definitions for the BTI Kludge Board * 793 * * 794 * Each disk drive has a BTI-installed kludge board in it * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 61 (IODEFS) F 7 I/O definitions 795 * that has two features: it contains a 1K prom containing * 796 * the drive's serial number, and the kludge board can * 797 * retract the heads from the disk under software control. * 798 * * 799 * The board is activated by doing a SEEK specifying * 800 * BFDMAGICHD as the head number. After this seek, the * 801 * Write-Protect status bit does not reflect the actual * 802 * Write-Protectedness of the disk, but is set to a bit * 803 * out of the on-board PROM corresponding to the selected * 804 * cylinder number. Additionally if the cylinder number * 805 * is BFDUNLDCYL, the heads are retracted from the disk. * 806 * * 807 ********************************************************************************** 808 000000FF ABS 809 BFDMAGICHD EQU 255 activates kludge board 000003FF ABS 810 BFDUNLDCYL EQU 1023 along with BFDMAGICHD, retracts disk heads 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 62 (IODEFS) F 7 I/O definitions 812 813 ********************************************************************************** 814 * * 815 * CIA (communications interface adapter) command codes * 816 * * 817 * The CIA interrupts the system about 9 times a second * 818 * (or whatever is set in TICKTIME) and each of those times * 819 * the system reads from the CIA to get any characters that * 820 * came in during that period. The system then writes any * 821 * characters for terminals that are outputting. * 822 * Reads from the CIA consist of an entry for each * 823 * terminal that either has had its status change, a change in * 824 * the number of characters in the output buffer, or has * 825 * characters in its input buffer. If a port is idle then * 826 * nothing is read for that port. If all of the ports on a * 827 * CIA are idle, the reads are only two characters long -- the * 828 * two terminating FF's. If the read buffer that the system * 829 * gave to the CIA is too small to hold all of the characters * 830 * that have been received then the terminating characters are * 831 * FE's and the system must do another read to get the rest of * 832 * the data. * 833 * The writes to the CIA consist of characters and * 834 * commands for any port that is outputting. The CIA has a * 835 * limited output buffer for each port (256 chars) so the * 836 * amount of output is tempered by the space left in the CIA * 837 * output buffer for that port (remaining output buffer count * 838 * is returned in the read). * 839 * Commands that go to a port can be mixed into the * 840 * character output stream and the commands will be done when * 841 * their turn to output occurs. Commands take up space in the * 842 * port's output buffer so their size must be accounted for. * 843 * There is a special type of read, called the Delayed * 844 * Read, that reads data from the CIA and terminates the read * 845 * when the memory buffer is full or the TICKTIME has passed. * 846 * The advantage of this is that one interrupt is saved for * 847 * each read. That is, using the regular read, the sequence * 848 * is: * 849 * 1) TICK interrupt * 850 * 2) Set up read * 851 * 3) Read end of operation interrupt * 852 * 4) Process read information * 853 * 5) Generate write information * 854 * 6) Set up write * 855 * 7) Write end of operation interrupt * 856 * 8) Return from interrupt to wait for next TICK * 857 * Using the delayed read, the sequence is: * 858 * 1) Delayed read end of operation interrupt * 859 * 2) Process read information * 860 * 3) Generate write information * 861 * 4) Set up write * 862 * 5) Write end of operation interrupt * 863 * 6) Set up delayed read * 864 * As you can see, the delayed read saves one interrupt * 865 * per TICK time and at about 9 tick interrupts a second that * 866 * is a big saving. * 867 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 63 (IODEFS) F 7 I/O definitions 868 * Notes on parity checking. The normal mode of the CIA * 869 * is to receive and transmit all 8 data bits. However, * 870 * parity generation may be selected via the secondary port * 871 * status selections in microcode revisions 7 and up. The * 872 * generation options are: set eighth bit to 1, odd parity, * 873 * and even parity. The generated bit replaces the data bit * 874 * supplied from the buffer. * 875 * If parity is being generated, it may optionally be * 876 * checked. If the received parity matches the proper parity * 877 * (as determined by the transmit options) then the eighth bit * 878 * is set to zero in the receive buffer. An error causes the * 879 * bit to be set to one and the 'framing error' bit in the * 880 * status is set. * 881 * * 882 ********************************************************************************** 883 00000008 ABS 884 CIABOARDS EQU 8 number of boards in CIA 00000008 ABS 885 CIAPPBRD EQU 8 number of ports on a board 00003430 BYTE 886 CIABRDF EQU BITS 26:28 board field 00000100 ABS 887 CIATRMBUFL EQU 256 number of characters in CIA's port buffer 888 00000201 ABS 889 CIAWHYINT EQU 0201 gets reason for interrupt and 890 * other info (status word 1) 00003E10 BYTE 891 CIATICK EQU BIT 31 on if timer tick 00003C10 BYTE 892 CIAFULL EQU BIT 30 on if some buffer more than half full 00003A10 BYTE 893 CIAEOP EQU BIT 29 on if end of operation 00003810 BYTE 894 CIAAEOP EQU BIT 28 on if abnormal EOP 00003610 BYTE 895 CIAERR EQU BIT 27 on if error - info given by CIAERROR 00000100 BYTE 896 CIACHARS EQU BITS 0:15 count of characters in input buffer 897 00000201 ABS 898 CIAINTACK EQU 0201 acknowledge interrupt processing 899 00000202 ABS 900 CIAINTMASK EQU 0202 get/set interrupt mask 901 * same bits as in CIAWHYINT 902 00000203 ABS 903 CIAERROR EQU 0203 get error log information 904 * format - ccnnnnpp 905 * cc = code for first error 906 * 011 - PPU handshake time out 907 * 012 - PPU data parity error 908 * 013 - PPU "head butt" 909 * 021 - receive fifo overflow 910 * 022 - transmit fifo overflow 911 * 031 - bad command 912 * 032 - CS path confused 913 * 033 - bad status request 914 * 041 - char in from non-existant port 915 * 081 - input buffer overflow 916 * 082 - output buffer overflow 917 * 083 - input buffer parity error 918 * 084 - output buffer parity error 919 * nnnn = count of errors 920 * pp = port number of first error 921 00000204 ABS 922 CIASREAD EQU 0204 store buffer size, starts transfer to memory 923 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 64 (IODEFS) F 7 I/O definitions 00000205 ABS 924 CIASWRITE EQU 0205 store buffer size, starts transfer from memory 925 00000206 ABS 926 CIASETTICK EQU 0206 get/set number of CIA ticks between interrupts 927 * CIA tick = 2.2 ms 0000000A ABS 928 CIATPS EQU 10 ticks per second 000001C6 ABS 929 CIATICKPSEC EQU 454 CIA ticks per second (1000/2.2) 0000002D ABS 930 CIATICKTIME EQU CIATICKPSEC/CIATPS number of CIA ticks between interrupts 931 00000207 ABS 932 CIASDREAD EQU 0207 store buffer size, starts delayed transfer to memory 933 00000080 BYTE 934 CIASRWACK EQU BITS 0:7 interrupt acknowledge 00001080 BYTE 935 CIASRWMSK EQU BITS 8:15 new Int mask 00002100 BYTE 936 CIASRWCNT EQU BITS 16:31 number of bytes in transfer 937 00000208 ABS 938 CIAVERSION EQU 0208 get version code "VVYYMMLL" 939 00000209 ABS 940 CIAMODE EQU 0209 set CIA operation mode 00000000 ABS 941 CIAMODEN EQU 0 normal operation mode 00000001 ABS 942 CIAMODET EQU 1 CIA test mode (cntl-B,etc) 00000002 ABS 943 CIAMODEM EQU 2 message "echo" mode 944 00000280 ABS 945 CIAPORT EQU 0280 get/set port info, indexed by port 946 00000080 BYTE 947 CIAPSTAT EQU BITS 0:7 on read, status of port, format is PORTxxxx 00001080 BYTE 948 CIAPOCH EQU BITS 8:15 on read, output space available (chars) 00002080 BYTE 949 CIAPICH EQU BITS 16:23 on read, number of input chars waiting 00003C10 BYTE 950 CIAPWAIT EQU BIT 30 on read, bit on if waiting for XON 00003E10 BYTE 951 CIAPMODM EQU BIT 31 on read, bit on if modem configuration 952 * , bit off if hardwire configuration 953 954 * EQU BITS 0:7 on write, port control or secondary port control 955 * (see CIAPSTS and *) 956 * PORT CONTROL 957 * for modem configuration 958 * EQU 008 set RTS 959 * EQU 010 set receive enable 960 * EQU 020 set DTR 961 * for hardwire configuration 962 * EQU 008 set CTS 963 * EQU 010 set receive enable 964 * EQU 020 set DSR 965 * EQU 040 set CD 966 * EQU 080 set RI 967 * for both 968 * EQU 001 two stop bits 969 * EQU 002 data 970 * EQU 004 break 971 * EQU 006 dwell 972 * SECONDARY PORT CONTROL 973 * EQU 001 two stop bits 974 * EQU 000 no parity 975 * EQU 002 set parity bit 976 * EQU 004 generate even parity 977 * EQU 006 generate odd parity 978 * EQU 008 check received parity (only if parity selected) 979 * EQU 010 set receive enable 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 65 (IODEFS) F 7 I/O definitions 980 * EQU 020 set break output holdoff processing 981 * EQU 040 set X-OFF processing 982 * EQU 080 set CTS processing 983 * EQU BIT 9 on write, do secondary port control 00001410 BYTE 984 CIAPECHO EQU BIT 10 on write, 1=echo on, 0=echo off 00001610 BYTE 985 CIAPSTS EQU BIT 11 on write, do port control 00001810 BYTE 986 CIAPFI EQU BIT 12 on write, flush input queue 00001A10 BYTE 987 CIAPFO EQU BIT 13 on write, flush output queue 00001C10 BYTE 988 CIAPSIB EQU BIT 14 on write, set input baud rate 00001E10 BYTE 989 CIAPSOB EQU BIT 15 on write, set output baud rate 00002100 BYTE 990 CIAPBAUD EQU BITS 16:31 on write, rate parameter 991 992 ********************************************************************************** 993 * The rough format of the input buffer elements is... * 994 * For ports with no status change. * 995 * Char 0 = 000 + port number * 996 * Char 1 = amount of space in output buffer * 997 * Char 2 = count of input characters transmitted with this read * 998 * Char 3... = the characters counted by Char 2. * 999 * For ports with a status change. * 1000 * Char 0 = 040 + port number * 1001 * Char 1 = amount of space in output buffer * 1002 * Char 2 = current status * 1003 * Char 3 = count of input characters transmitted with this read * 1004 * Char 4... = the characters counted by Char 3. * 1005 * For the end of the input buffer. * 1006 * Char 0 = 0FF (iff all terminals got a chance) * 1007 * = 0FE (iff buffer filled up first) * 1008 * Char 1 = * 1009 * * 1010 ********************************************************************************** 1011 1012 * In the port number the following bits appear 00003010 BYTE 1013 PORTLAST EQU BIT 24 the is the end of input flag 00003210 BYTE 1014 PORTSTAT EQU BIT 25 port status present 1015 * 1016 * the bits in the status character are: 00003010 BYTE 1017 PORTBOF EQU BIT 24 not input buffer overflow 00003210 BYTE 1018 PORTFFE EQU BIT 25 first framing error - cleared by read 00003410 BYTE 1019 PORTFBRK EQU BIT 26 first break - cleared by read 00003610 BYTE 1020 PORTBRK EQU BIT 27 break or framing error in progress 00003810 BYTE 1021 PORTRI EQU BIT 28 ring indicator on 00003A10 BYTE 1022 PORTCD EQU BIT 29 carrier detect on 00003C10 BYTE 1023 PORTDSR EQU BIT 30 data set ready on/data terminal ready 00003E10 BYTE 1024 PORTCS EQU BIT 31 clear to send on/request to send 1025 1026 ********************************************************************************** 1027 * * 1028 * The format for the output buffer is: * 1029 * For character output. * 1030 * Char 0 = 000 + port number * 1031 * Char 1 = count of output characters transmitted with this * 1032 * write (must be less than 128) * 1033 * Char 2... = the characters counted by Char 1. * 1034 * For command output. * 1035 * Char 0 = 000 + port number * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 66 (IODEFS) F 7 I/O definitions 1036 * Char 1 = Command code (always >= 080) * 1037 * Char 2.. = (optional parameters for the command) * 1038 * Note that we cleverly avoid putting out more than 128 * 1039 * characters in one element. Each TCQ that we copy into the * 1040 * CIA output buffer gets its own port number and output * 1041 * count. We limit the maximum size of the TCQs to a size * 1042 * that will hold less than 128 characters. * 1043 * * 1044 * Both characters and commands may be sent to the same * 1045 * port in one write as long as the output buffer has room. * 1046 * Commands are queued in the output buffer except for those * 1047 * marked 'done when received'. * 1048 * * 1049 ********************************************************************************** 1050 1051 * Command codes are: 00000081 ABS 1052 PORTCIRATE EQU 081 set input baud rate (done in stream) 00000082 ABS 1053 PORTCORATE EQU 082 set output baud rate (done in stream) 1054 * the above are followed by 2 characters holding the 1055 * rate constant = -(19200*3)/baud 00000083 ABS 1056 PORTCSTAT EQU 083 set port status (done in stream) 00003010 BYTE 1057 PORTSRI EQU BIT 24 ring indicator 00003210 BYTE 1058 PORTSCD EQU BIT 25 carrier detect 00003410 BYTE 1059 PORTSDTR EQU BIT 26 turn on data terminal ready/data set ready 00003810 BYTE 1060 PORTSRTS EQU BIT 28 turn on request to send/clear to send 1061 00000084 ABS 1062 PORTFLUSHO EQU 084 flush output queue (done when received) 1063 00000085 ABS 1064 PORTFLUSHI EQU 085 flush input queue (done when received) 1065 00000086 ABS 1066 PORTDWELL EQU 086 followed by 1 char giving count (done in stream) 1067 * of dwell times ( in character times ) 00000087 ABS 1068 PORTBREAK EQU 087 followed by 1 char giving count (done in stream) 1069 * of break times ( in character times ) 00000088 ABS 1070 PORTECHOON EQU 088 CIA echo on (done when received) 1071 00000089 ABS 1072 PORTECHOOF EQU 089 CIA port echo off (done when received) 1073 0000008A ABS 1074 PORTWRITIN EQU 08A write into port's input buffer (done when received) 1075 0000008B ABS 1076 PORTALWRIT EQU 08B write into all port's input buffers (done when received) 1077 0000008C ABS 1078 PORTCLRAIN EQU 08C clear all port's input buffers (done when received) 1079 0000008D ABS 1080 PORTCSTAT2 EQU 08D set port secondary status (done in stream) 00003010 BYTE 1081 PORTSCTS EQU BIT 24 enable clear to send processing 00003210 BYTE 1082 PORTSXOF EQU BIT 25 enable XON/XOFF processing (output) 00003410 BYTE 1083 PORTSBRK EQU BIT 26 enable no transmit when break (output) 00003610 BYTE 1084 PORTSRDE EQU BIT 27 enable (input) receive data enable (input) 00003810 BYTE 1085 PORTCHKPAR EQU BIT 28 check port's incoming character's parity 1086 * Currently parity checking is not supported by the OS. 00003A20 BYTE 1087 PORTPARITY EQU BITS 29:30 parity type for this port 1088 * If a parity type is specified that parity will be generated by 1089 * the comm. If parity checking is enabled PORTPARITY is what is 1090 * checked for. 00000000 ABS 1091 PORTNOPAR EQU 0 no parity generated (or checked) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 67 (IODEFS) F 7 I/O definitions 00000001 ABS 1092 PORTHIBIT EQU 1 generate high bit on parity 00000002 ABS 1093 PORTEVENP EQU 2 generate even parity 00000003 ABS 1094 PORTODDP EQU 3 generate odd parity 00003E10 BYTE 1095 PORTSSTOP2 EQU BIT 31 enable two stop bits (output) 1096 0000008E ABS 1097 PORTCRESET EQU 08E do a port reset (done in stream) 00003610 BYTE 1098 PORTCRFBR EQU BIT 27 force buffer remaining return 00003810 BYTE 1099 PORTCRFS EQU BIT 28 force status return 00003A10 BYTE 1100 PORTCRCXON EQU BIT 29 clear XON wait 00003C10 BYTE 1101 PORTCRFO EQU BIT 30 flush output buffer 00003E10 BYTE 1102 PORTCRFI EQU BIT 31 flush input buffer 0000001F ABS 1103 PORTCRALL EQU 1*PORTCRFI+1*PORTCRFO+1*PORTCRCXON+1*PORTCRFS+1*PORTCRFBR 00000018 ABS 1104 PORTCRINIT EQU 1*PORTCRFBR+1*PORTCRFS port initializing parameters 1105 0000008F ABS 1106 PORTCZAP EQU 08F port reset (done when received) 1107 * Format identical to PORTCRESET 1108 1109 * The following are pseudo-commands. We process these in the 1110 * comm driver, but they do not get sent to the hardware. 00000090 ABS 1111 PORTPCINIT EQU 090 initialize port's interface state 1112 * If an input error occurs we link an element into the input TCQ chain 1113 * with this command code and the parameter is the error code. 00000091 ABS 1114 PORTIERR EQU 091 input error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 68 (IODEFS) F 7 I/O definitions 1116 1117 ********************************************************************************** 1118 * * 1119 * 9 track magnetic tape * 1120 * The tape controller may have up to 4 units. Each * 1121 * unit may be an 800 NRZI unit or a 1600 PE unit or switch * 1122 * selectable between these two standards. Normal * 1123 * inter-record gap is .6 inches. * 1124 * * 1125 * Cartridge Tape * 1126 * The cartridge tape controller may have up to 4 units. * 1127 * They behave very much like conventional magnetic tape, * 1128 * except that any one of 4 tracks may be selected for bit * 1129 * serial recording. Density is 6400 BPI at 30 IPS and the * 1130 * normal tape cartridge has 300 ft. of tape in it. Normal * 1131 * inter-record gap is 1.3 inches. The tape always writes * 1132 * forward, so it must be rewound after every track. * 1133 * 450 ft. and 555 ft. tape cartridges are also * 1134 * available. A possible future change is a 7 track drive, * 1135 * where the extra three tracks run backward between the * 1136 * normal four. * 1137 * * 1138 * Video Tape * 1139 * The video tape controller may have up to 4 units. * 1140 * They behave in most respects like 9 track tape. A notable * 1141 * exception is in speed. While the data transfer rates are * 1142 * quite respectable, the rewind and wfm operations can be * 1143 * exceedingly tedious. * 1144 * * 1145 * Where differences occur between the various tape devices * 1146 * the CT status meaning is enclosed in [], the VT status * 1147 * differences are inclosed in {} and the SCSI MT differences * 1148 * are enclosed in <>. * 1149 * * 1150 ********************************************************************************** 1151 00000004 ABS 1152 NMTPUNITS EQU 4 number of units that can go on a controller 1153 0000C000 ABS 1154 MTDIOSIZE EQU 12*CPP maximum size for records on tape. 1155 * We don't allow any longer records since 1156 * the MT is too slow to allow a user to 1157 * lock up more memory than this. 1158 000047F8 ABS 1159 CTDIOSIZE EQU ((9*CPP)/2)-(2*CPW) maximum size for records on cartridge tape. 1160 * (Four-and-a-half pages minus two words.) 1161 * This number may not be any larger without 1162 * compromising the security of 4000/5000/6000 1163 * tape backups since they are not encrypted. 1164 * For public consumption, say that the CT is 1165 * too slow to allow a user to lock up more 1166 * memory than this. 1167 0000C000 ABS 1168 VTDIOSIZE EQU 12*CPP maximum size for records on tape. 1169 * We don't allow any longer records since 1170 * the VT is too slow to allow a user to 1171 * lock up more memory than this. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 69 (IODEFS) F 7 I/O definitions 1172 1173 * In the device WRU: 00002080 BYTE 1174 MTIDSTEST EQU BITS 16:23 self-test results, 0 = ok 1175 * BITS 24:31 undefined 1176 * In the device WRU for VT 1177 * BITS 16:19 self test error code 1178 * 1 PPU bus error. Byte sent by Z80 does not equal byte 1179 * found on PPU bus. Bad bit(s) on PPU bus or SCSI HA. 1180 * 2 PPU timeout. PPU did not acknowledge byte sent by 1181 * SCSI HA or PPU failed to send an expected byte. 1182 * 3 PPU collision. PPU over-rides SCSI HA trying to send 1183 * a byte and sends a byte of its own. 1184 * 4 PPU BCC error. Block check character wrong for PPU 1185 * string received. 1186 * 5 PPU NACK. PPU nacked string received from SCSI HA. 1187 * Bad first byte or parity error. 1188 * 6 PPU command error. Unrecognized PPU command received. 1189 * 7 SCSI bus error. Byte sent by Z80 to SCSI target did 1190 * not match byte found on SCSI bus. 1191 * 8 SCSI bus empty. No targets found on SCSI bus. Note: 1192 * a target does not have to be ready to be found. 1193 * 9 SCSI timeout. SCSI target did not accept byte sent. 1194 * A SCSI bus parity error. Parity error in byte received 1195 * from SCSI target. 1196 * B Lost Arbitration. SCSI HA lost arbitration trying to 1197 * select a SCSI target. Another SCSI ID bit was on bus. 1198 * C No select. SCSI target did not select. 1199 * D SCSI bus not free. While trying to select a SCSI target 1200 * the SCSI bus was found not free. 1201 * E SCSI phase error. SCSI target did not change phases 1202 * properly during communications with SCSI HA. 1203 00000210 ABS 1204 MTLDSTAT EQU 0210 fetch primary status 00000010 BYTE 1205 MTSTDSC EQU BIT 0 drive state change 00000210 BYTE 1206 MTSTSCIEN EQU BIT 1 interrupt on state change enabled 00000410 BYTE 1207 MTSTANER EQU BIT 2 any error 1208 * BIT 3 unused [unused] 1209 * BIT 3 {buffer parity error} 1210 * BIT 3 <1 indicates a SCSI 9-track> 1211 1212 * BITS 4:5 unused 1213 * BITS 4:5 [track number] 1214 * BIT 4 {media error} 1215 * BIT 5 {tape motion error} 1216 * BITS 6:7 unit number returned 1217 00001010 BYTE 1218 MTSTEOF EQU BIT 8 EOF read 00001220 BYTE 1219 MTSTTMD EQU BITS 9:10 direction of last tape motion 1220 * EQU 0 not moved 00000001 ABS 1221 MTSTTMFW EQU 1 forward 00000002 ABS 1222 MTSTTMBK EQU 2 backward 00000003 ABS 1223 MTSTTMLOST EQU 3 lost 00001210 BYTE 1224 MTSTTMBKB EQU BIT 9 on if backward (or lost) 00001410 BYTE 1225 MTSTTMFWB EQU BIT 10 on if forward (or lost) 00001650 BYTE 1226 MTSTERSTAT EQU BITS 11:15 fatal error statuses 1227 * 00 no error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 70 (IODEFS) F 7 I/O definitions 1228 * Error codes returned by MT (Rev 5 u-code) 1229 * 01 multi-track (hard) error reading pe data 1230 * 02 vertical parity error reading pe data 1231 * 03 vertical parity error reading nrzi data 1232 * 04 crc error reading nrzi data 1233 * 05 lrc error reading nrzi data 1234 * 06 no rdr while attempting to read data 1235 * 07 rate error while reading data 1236 * 08 rate error while writing data 1237 * 09 multi-track (hard) error writing pe data 1238 * 0A vertical parity error writing pe data 1239 * 0B vertical parity error writing nrzi data 1240 * 0C crc error writing nrzi data 1241 * 0D lrc error writing nrzi data 1242 * 0E bad check sum in string from PPU 1243 * 0F drive not ready for requested command 1244 * 010 bad (unrecognized) command 1245 * 011 illegal command with tape at bot/eot 1246 * 012 got more data after word count exhausted 1247 * 013 bad filemark read or written 1248 * 014 bad phase encoded id zone 1249 * 015 timeout: 80" of blank tape read 1250 * 016 got spurious NAK from PPU 1251 * 017 got bad first byte (not 96 or 62) 1252 * 018 data path parity error 1253 * 019 timed out PPU data path 1254 * Error codes returned by CT 1255 * 01 illegal drive 1256 * 02 illegal store 1257 * 03 illegal track 1258 * 04 illegal tape motion 1259 * 05 no go byte 1260 * 06 timeout during FF or rewind 1261 * 07 offline during FF or rewind or write gap 1262 * 08 load point hole late 1263 * 09 sync zone late 1264 * 0A IRG found when not expected 1265 * 0B dropout during write 1266 * 0C ID zone late 1267 * 0D leading ID zone bad 1268 * 0E word count CRC bad 1269 * 0F data CRC bad (MFM mode only) 1270 * 10 reverse word count check bad (GCR mode only) 1271 * 11 trailing ID zone bad 1272 * 12 trailing sync zone bad 1273 * 13 GCR byte count not match blockette number 1274 * 14 GCR record not recoverable / write error 1275 * 15 GCR read not all right but recoverable 1276 * 16 GCR record not recoverable 1277 * 17 EOT caused some other error to be detected 1278 * 18 BOT caused some other error to be detected 1279 * Error codes returned by VT (* = unit goes not ready) 1280 * 01 not used (hardware error) 1281 * 02 * unit not ready. 1282 * 03 non-recovered error due to flaw in tape or: 1283 * with EOT set, reached EOT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 71 (IODEFS) F 7 I/O definitions 1284 * with BOT set, reached BOT 1285 * 04 tape unit detected non-recoverable hardware 1286 * error during command or self test. 1287 * 05 tape received illegal request 1288 * 06 * unit attention. unit received a RESET or 1289 * cartridge was changed. 1290 * 07 cartridge has write protect set. 1291 * 08 blank check. blank tape encountered while reading 1292 * 09 tape mark detect error 1293 * 0A * copy aborted (not used) 1294 * 0B command aborted 1295 * 0C * not used 1296 * 0D volume overflow. Physical EOT reached on a write. 1297 * 0E * not used 1298 * 0F * reserved 1299 * 10 communications error 1300 * 11 * tape not present 1301 * 12 * power failure 1302 * 13 unused 1303 * 14 bad data received from tape unit after issuing 1304 * a request sense command. 1305 * Error codes returned by SCSI 9 track (* = unit goes not ready) 1306 * 01 recovered error 1307 * 02 * unit not ready. 1308 * 03 non-recovered error due to flaw in tape or: 1309 * with EOT set, reached EOT 1310 * with BOT set, reached BOT 1311 * 04 tape unit detected non-recoverable hardware 1312 * error during command or self test. 1313 * 05 tape received illegal request 1314 * 06 * unit attention. unit received a RESET or 1315 * cartridge was changed. 1316 * 07 cartridge has write protect set. 1317 * 08 blank check. blank tape encountered while reading 1318 * 09 vendor unique 1319 * 0A * copy aborted (not used) 1320 * 0B command aborted 1321 * 0C * not used 1322 * 0D volume overflow. Physical EOT reached on a write. 1323 * 0E * miscompare (not used) 1324 * 0F * reserved 1325 * 10 communications error 1326 * 11 * tape not present 1327 * 12 * power failure 1328 * 13 unused 1329 * 14 bad data received from tape unit after issuing 1330 * a request sense command. 1331 * 1332 * EQU BIT 16 unused 1333 * EQU BIT 17 WC < 0 1334 * EQU BIT 18 4 naks from PPU 1335 * EQU BIT 19 passed EOT on last command 1336 * EQU BIT 20 word count register = zero 1337 * EQU BIT 21 unused 1338 * EQU BIT 22 PPU interrupted our send 1339 * EQU BIT 23 0 sez completion interrupt, 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 72 (IODEFS) F 7 I/O definitions 1340 * 1 sez drive state change 1341 * 00002010 BYTE 1342 MTSTDPPE EQU BIT 16 [parity error on data from PPU in write] 1343 * EQU BIT 17 [overflow error] 1344 * EQU BIT 18 [underflow error] 1345 * EQU BIT 19 [WDL error] 1346 * EQU BIT 20 [RDL error] 1347 * EQU BIT 21 [unused] 1348 * EQU BIT 22 [good byte count in secondary status] 1349 * EQU BIT 23 [high for GCR, low for MFM] 1350 * 1351 * EQU BIT 16 {filemark error} 1352 * EQU BIT 17 {underrun} 1353 * EQU BIT 18 {write error 1} 1354 * EQU BIT 19 {servo system error} 1355 * EQU BITS 16:19 {if error code = #10 Z80 error code placed 1356 * here. (see selftest error codes above)} 1357 * EQU BIT 20 {word count reg = 0} 1358 * EQU BIT 21 {unused} 1359 * EQU BIT 22 {unused} 1360 * EQU BIT 23 {0 sez completion interrupt} 1361 * {1 sez drive changed state} 1362 * 1363 * EQU BITS 16:19 1365 * EQU BITS 16:23 00003080 BYTE 1366 MTSTDRVST EQU BITS 24:31 drive status 1367 * These bits are the drive status and are available both 1368 * here and for all four drives at once (each in its byte). 00003010 BYTE 1369 MTDST9 EQU BIT 24 9 track tape 1370 * EQU BIT 24 {unused} [hard EOT] 00003210 BYTE 1371 MTDSTEOT EQU BIT 25 end of tape 00003410 BYTE 1372 MTDSTRDY EQU BIT 26 drive ready [not rewinding] 00003610 BYTE 1373 MTDSTBOT EQU BIT 27 beginning of tape 1374 00003810 BYTE 1375 MTDSTWPRT EQU BIT 28 write protect 00003A10 BYTE 1376 MTDSTBREW EQU BIT 29 busy rewinding 00003A10 BYTE 1377 MTDSTTPK EQU BIT 29 [tape position known] 00003C10 BYTE 1378 MTDSTPRS EQU BIT 30 drive is present 00003E10 BYTE 1379 MTDSTDEN EQU BIT 31 density high [hard BOT] 1380 00000220 ABS 1381 MTLD2STAT EQU 0220 loads secondary status 1382 * BIT 0 parity type {unused} 1383 * BIT 1 density {unused} 1384 * BITS 16:31 word count 1385 00000240 ABS 1386 MTLDDRVST EQU 0240 load drive statuses 1387 * ww xx yy zz 1388 * ww drive status of unit 0 1389 * xx drive status of unit 1 1390 * yy drive status of unit 2 1391 * zz drive status of unit 3 1392 1393 * BIT 28 contains 1 if to select new drive 1394 * during a store. 1395 * BITS 30:31 contains new drive number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 73 (IODEFS) F 7 I/O definitions 1396 00000008 ABS 1397 MTSELECT EQU 008 add to any of the following stores for 1398 * unit select 00000080 ABS 1399 MTINTREQ EQU 080 add to any of the following for 1400 * interrupt on completion 00000200 ABS 1401 MTCMRESET EQU 0200 reset 1402 00000230 ABS 1403 MTCMFUNC EQU 0230 issue function 00000001 ABS 1404 MTFNCYCLE EQU 0001 cycle 00000002 ABS 1405 MTFNREWIND EQU 0002 rewind 00000004 ABS 1406 MTFNSEFB EQU 0004 search end file backward 00000005 ABS 1407 MTFNSEFF EQU 0005 search end file forward 00000006 ABS 1408 MTFNBKSP EQU 0006 backspace 00000007 ABS 1409 MTFNFWSP EQU 0007 forward space 00000008 ABS 1410 MTFNDSCIOF EQU 0008 drive state change interrupt disable 00000009 ABS 1411 MTFNDSCION EQU 0009 drive state change interrupt enable 0000000A ABS 1412 MTFNOFFL EQU 000A rewind and set off line 0000000C ABS 1413 MTFNDENSEL EQU 000C density select, this code + density 00000010 ABS 1414 MTFNTRSEL EQU 0010 [track select, this code + track number] 00000018 ABS 1415 MTFNWFM EQU 0018 write file mark 1416 00000240 ABS 1417 MTCMREAD EQU 0240 read 1418 00000250 ABS 1419 MTCMWRITE EQU 0250 write 1420 00000260 ABS 1421 MTCMERASE EQU 0260 erase 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 74 (IODEFS) F 7 I/O definitions 1423 1424 ********************************************************************************** 1425 * * 1426 * LINE PRINTER. * 1427 * The line printer controller will drive one of several * 1428 * different types of line printers. It supports a virtual * 1429 * forms control unit and does all forms control character * 1430 * processing. It accepts one line at a time and handles the * 1431 * print of it -- it's not very difficult. * 1432 * * 1433 ********************************************************************************** 1434 00000080 ABS 1435 LPINT EQU 1*BIT 24 if on in address, enables interrupts 1436 1437 * In the device WRU: 00002080 BYTE 1438 LPWRUOPT EQU BITS 16:23 printer options selected 00003010 BYTE 1439 LPWRUPPUE EQU BIT 24 on if error on last PPU status 00003460 BYTE 1440 LPWRUITYP EQU BITS 26:31 printer interface type 1441 00000200 ABS 1442 LPNOP EQU 0200 W no operation 1443 00000201 ABS 1444 LPCLRCTL EQU 0201 W Clear control bits 00000202 ABS 1445 LPSETCTL EQU 0202 W Set control bits 1446 0000020C ABS 1447 LPLOADVFU EQU 020C W load vertical forms unit 1448 * (data = number of lines per page) 1449 00000210 ABS 1450 LPSKIP EQU 0210 W skip lines (data = number of lines) 1451 00000220 ABS 1452 LPSTATUS EQU 0220 R fetch current status 00000010 BYTE 1453 LPSTFAULT EQU BIT 0 line printer fault 00000210 BYTE 1454 LPSTOOP EQU BIT 1 out of paper 00000610 BYTE 1455 LPSTBUFE EQU BIT 3 on if buffer empty 00000840 BYTE 1456 LPSTERROR EQU BITS 4:7 error code 1457 * EQU 00 no error 1458 * BC EQU 01 bad command (unknown loc) 1459 * OF EQU 02 input overflow (write when buf full) 1460 * VOF EQU 03 too many lines for VFU 1461 * VFU0 EQU 04 zero lines in VVFU 1462 * DPOF EQU 05 data path overflow (too many bytes) 1463 * WRT0 EQU 06 zero-length write command 1464 * WRBAD EQU 07 write command while previous one in progress 1465 * DPUF EQU 08 data path underflow (too few bytes from PPU) 1466 * VFU1 EQU 09 first line of VVFU is not channel 1 1467 * DPPE EQU 0A data path parity error 1468 * MANY EQU 0F multiple errors have occurred 00001410 BYTE 1469 LPSTVFU EQU BIT 10 VFU enabled 00001610 BYTE 1470 LPSTPSKP EQU BIT 11 perforation skip enabled 00001840 BYTE 1471 LPSTUNIT EQU BITS 12:15 controller unit number (from dip switches) 00002410 BYTE 1472 LPSTREADY EQU BIT 18 line printer is ready 00002E10 BYTE 1473 LPSTBUFRDY EQU BIT 23 controller buffer ready for another line 00003010 BYTE 1474 LPSTIPRE EQU BIT 24 interrupt because of protocol error (see LPSTERROR) 00003410 BYTE 1475 LPSTILINE EQU BIT 26 interrupt because on/off line 00003610 BYTE 1476 LPSTBADWRT EQU BIT 27 interrupt because last write not successful 00003C10 BYTE 1477 LPSTIVFU EQU BIT 30 interrupt because load VVFU completed 00003E10 BYTE 1478 LPSTIRDY EQU BIT 31 interrupt because input buffer ready 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 75 (IODEFS) F 7 I/O definitions 1479 00000240 ABS 1480 LPWRITE EQU 0240 W write line (data described below) 00001E10 BYTE 1481 LPWRFORM EQU BIT 15 first character of line is forms control 00002C20 BYTE 1482 LPWRHDR EQU BITS 22:23 number of characters to ignore at beginning of line 00003080 BYTE 1483 LPWRLNTH EQU BITS 24:31 length of line (including header and forms chars) 13 INPUT DISKDEFS disk structure definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 76 (DISKDEFS) F 8 Disk Data Structures 4 00000000 5 CRANDALL LABEL to recapture all of this space 00000400 ABS 6 BLOCKSIZE EQU WPP size of the data areas on mass storage 0000000B ABS 7 FBILNTH EQU 11 file block identifier length 8 08000000 ABS 9 REVVOLUME EQU 008000000 volume format revision herein described 18000000 ABS 10 REVMNTVOL EQU 018000000 volume format revisions we can mount 10000000 ABS 11 REVVOLLRAF EQU 010000000 this bit indicates that the volume format 12 uses FDLRAF instead of FDRAFTYPE 00000000 ABS 13 REVBACKUP EQU 0 revision of backup format 14 15 ********************************************************************************** 16 * * 17 * MASS STORAGE ADDRESSES * 18 * * 19 * Each volume on a system is identified by a volume * 20 * number. This volume number is assigned when a pack is * 21 * mounted. * 22 * Data stored on volumes is organized into blocks * 23 * consisting of a page of data and a file block identifier * 24 * (qv). Volumes may only be accessed by reads and writes of * 25 * entire blocks. * 26 * Within a volume, each file block has a unique address. * 27 * These addresses always start at zero and increment by one * 28 * for each block. These addresses are used by the MS driver * 29 * to calculate the physical location of the block, so some * 30 * addresses may represent bad tracks. These blocks do not * 31 * have spares assigned, rather, they are identified in a list * 32 * called BADTRAX and are never assigned. * 33 * The volume number and the block number are often * 34 * combined into a single word according to these definitions. * 35 * * 36 ********************************************************************************** 37 00001180 BYTE 38 MSBLKFIELD BITS (32-MSBLKLOG):31 block number field right justified 00000080 BYTE 39 VOLFIELD BITS 0:(31-MSBLKLOG) volume number field 40 41 ********************************************************************************** 42 * * 43 * Certain types of files, .CODEs, .RAFs, .SAFs all use * 44 * the same addressing convention to specify a certain * 45 * location. This convention is a block number followed by a * 46 * byte offset. In the case of .RAFs the block number is * 47 * split into a major and minor block index. The following * 48 * definitions describe the above. * 49 * * 50 ********************************************************************************** 51 00000140 BYTE 52 PGNUMFLD EQU BITS 0:19 page number field 000000A0 BYTE 53 PGNUMFLDMAJ EQU BITS 0:9 major index within the page field 000014A0 BYTE 54 PGNUMFLDMIN EQU BITS 10:19 minor index within the page field 000028C0 BYTE 55 BYTEDISP EQU BITS 20:31 byte displacement field 56 57 ********************************************************************************** 58 * * 59 * RAD40 PACK * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 77 (DISKDEFS) F 8 Disk Data Structures 60 * Six characters may be packed into 32 bits by using a * 61 * multiply-add technique with a radix of 40 decimal. * 62 * Identifiers (file names, account names, volume names, and * 63 * passwords) consist of two such words (12 characters). * 64 * Extensions (file name extensions, division/project * 65 * specifiers, and system names) consist of one such word. * 66 * Division/project are packed and a divide is required * 67 * to separate them. Since these numbers are unsigned, MODIF * 68 * must be used for the divide. In some code, the extra * 69 * register is not available (and the extra instructions are * 70 * undesirable) so we do the divide in two parts. First, the * 71 * power of 2 part is accomplished by a CBM or ZBM. Then the * 72 * remaining factors are gotten by a real divide that always * 73 * has positive operands. * 74 * The characters to be code converted for packing are: * 75 * char code (decimal) * 76 * ---- ---- * 77 * space 0 * 78 * 0-9 1-10 * 79 * A-Z 11-36 * 80 * a-z 11-36 * 81 * cntl A-Z 11-36 (allowed only in passwords) * 82 * ! 37 * 83 * & 38 * 84 * underscore 39 * 85 * Identifiers less than 'A ' are not allowed. * 86 * Identifiers greater than or equal to '!' are not allowed. * 87 * Embedded blanks are not allowed. A null file name followed * 88 * by an extension indicates a hardware type (e.g. .LP for a * 89 * line printer). * 90 * * 91 ********************************************************************************** 92 0000FA00 ABS 93 DVSNDISP EQU 40 POWER 3 to extract division field 00000170 BYTE 94 DVSNPART1 EQU BITS 0:(31-9) power of two part of DVSNDISP 0000007D ABS 95 DVSNPART2 EQU DVSNDISP/(2 POWER 9) the remaining factors 96 97 ********************************************************************************** 98 * * 99 * ACCOUNT NAME FORMAT * 100 * ACCOUNT STRUCTURE * 101 * The format of account names is: * 102 * . . * 103 * Each element is RAD packed and consists of characters * 104 * from the 40 character rad pack set. may not * 105 * begin with a digit. * 106 * is from 0 to twelve characters. * 107 * is 0 to 3 characters. (It must be 3 non- * 108 * blank characters if projects are to be specified). * 109 * is 0 to 3 characters. * 110 * * 111 * Certain accounts (many of these have null account * 112 * names) are assigned control functions. * 113 * * 114 * 1.) .!!! - BTI supplied library * 115 * 2.) SYSTEM.!!! - System software account * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 78 (DISKDEFS) F 8 Disk Data Structures 116 * 3.) OFFLINE.!!! - Maintenance account * 117 * 4.) MANAGER.!!! - Maintenance manager * 118 * 5.) .SYS - Owner supplied public library * 119 * 6.) xxx.SYS - Operator accounts * 120 * 7.) .&xxxxx - Proprietary account * 121 * 8.) .fff - Division library * 122 * 9.) .fffppp - Project library * 123 * 10.) MANAGER.SYS - System manager * 124 * 11.) MANAGER.fff - Division manager * 125 * 12.) MANAGER.fffppp - Project manager * 126 * * 127 ********************************************************************************** 128 129 ********************************************************************************** 130 * * 131 * DATE-TIME FORMAT * 132 * A system time value is a 44 bit integer representing * 133 * millisecond intervals from 0000 17 Nov, 1858. This choice * 134 * has been made to match the Julian day count commonly used * 135 * by astronomers. * 136 * The stored time is the time as provided by the system * 137 * clock. Any known clock errors are corrected in the system * 138 * clock by the delete/increment count commands. The clock * 139 * count is treated as if all days from the epoch were of * 140 * equal length. This means that leap seconds and the varying * 141 * second is ignored. The time as stored by the system will * 142 * always be universal time. Users may request the time with * 143 * time zone corrections applied and/or already unpacked into * 144 * year/month/day/time. * 145 * Many of the uses of the date do not require the * 146 * millisecond resolution provided by the entire 44 bit * 147 * quantity. The upper 32 bits of the date word (DATEHORD) * 148 * are used in these cases. The resolution of DATEHORD is * 149 * about 4 seconds. * 150 * Since the system date-time is used for file serial * 151 * numbers, backup and purge control, and the like, it is very * 152 * important that it be irreversable, and nearly correct. * 153 * When the operator specifies a correction, the software * 154 * applies it at a rate no faster than 1000 ppm. * 155 * Additionally, the software attempts to calculate the rate * 156 * error in the clock and will apply corrections for it up to * 157 * 35 ppm. * 158 * * 159 ********************************************************************************** 160 161 * For the use of the 64 bit date format 162 BASE R0 163 BSSB 20 unused 00082800 0 ZBM 164 DATEHORD BSSB 32 high order (4 second resolution) 165 BSSB 12 low order 166 DRCT 167 168 ********************************************************************************** 169 * * 170 * Definitions of various labels for quantities of time * 171 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 79 (DISKDEFS) F 8 Disk Data Structures 172 ********************************************************************************** 173 000003E8 ABS 174 MSECSS EQU 1000 milliseconds per second 0000EA60 ABS 175 MSECSM EQU 60*MSECSS milliseconds per minute 0036EE80 ABS 176 MSECSH EQU 60*MSECSM milliseconds per hour 05265C00 ABS 177 MSECSD EQU 24*MSECSH milliseconds per day 178 179 * Intervals for 32 bit time words (DATEHORD) 180 * Several users depend on truncation rather than rounding. 181 0000000E ABS 182 FOURSECSM EQU MSECSM/(2 POWER 12) 4.096 seconds per minute 0000036E ABS 183 FOURSECSH EQU MSECSH/(2 POWER 12) 4.096 seconds per hour 00005265 ABS 184 FOURSECSD EQU MSECSD/(2 POWER 12) 4.096 seconds per day 185 186 ********************************************************************************** 187 * * 188 * Definitions for the Non-Volatile Memory * 189 * The SSU has a non-volatile memory. The memory is * 190 * electronicly alterable by byte but retains information even * 191 * with no power. The original SSUs stored only 128 bytes. The * 192 * revised SSUs (rev 14 and later) store 2048 bytes. The memory * 193 * is read and written by byte. Since the write operation is * 194 * quite slow and a power fail during a write leaves the * 195 * location with random data, we must allow for such errors in * 196 * our processing of the data. We do this by storing some data * 197 * twice and having a flag that tells which to use. * 198 * Note that we define each of the 128 bytes in the NVM * 199 * by a BASE offset. This is because the SSU returns the byte * 200 * right justified in a whole word and stores the byte out of * 201 * the right character on a store. The definitions, * 202 * therefore, correspond to the word offsets that the system * 203 * must use. * 204 * * 205 ********************************************************************************** 206 00000080 ABS 207 NVMSIZE EQU 128 number of bytes in original (small) NVM 00000002 208 NVMBASE BASE 209 00000000 DISP 210 NVMRFPPW BSS 1 flag for remote front panel password 00000001 DISP 211 NVMRFPPW1 BSS 8 00000009 DISP 212 NVMRFPPW2 BSS 8 213 00000011 DISP 214 NVMLFPPW BSS 1 local front panel password 00000012 DISP 215 NVMLFPPW1 BSS 8 0000001A DISP 216 NVMLFPPW2 BSS 8 217 218 * The preceeding definitions are used by the SSU microcode 219 * as well as others. 220 221 * The PROMBOOT code uses the following password. For systems 222 * without removable mass storage, the system installation or 223 * recovery from serious problems involves loading the system 224 * software from mag tape (9 track or Cartridge). In order to 225 * protect our proprietary interests, these bootstrap tapes 226 * must be encrypted. This is the only location suitable for 227 * the storage of the password for this encryption. It is also 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 80 (DISKDEFS) F 8 Disk Data Structures 228 * entirely appropriate for such storage (my, what luck). 229 * Note that BTI must maintain lists of this password for all 230 * sites, since if a major disaster befalls a site, its backup 231 * tapes cannot be recovered without this password. 232 00000022 DISP 233 NVMTAPEPW BSS 8 password for mag tape boot 234 235 BSS 9 filler (very old location for clock values) 236 00000033 DISP 237 NVMDATDRFT BSS 1 clock drift 238 BSS 4 filler 239 00000038 DISP 240 NVMSSUSN BSS 4 SSU serial number 241 0000003C DISP 242 NVMSSN BSS 4 system serial number 243 00000040 DISP 244 NVMMAXMCU BSS 1 max number of MCU's paid for 00000001 ABS 245 NVMFACMCU EQU 1 in units of one 246 00000041 DISP 247 NVMMAXPAGE BSS 1 max pages of memory paid for 00000020 ABS 248 NVMFACPAGE EQU 32 in units of 32 pages 249 00000042 DISP 250 NVMMAXCPU BSS 1 max number of CPUs paid for 00000001 ABS 251 NVMFACCPU EQU 1 in units of one 252 00000043 DISP 253 NVMMAXPPU BSS 1 max number of PPU's paid for 00000001 ABS 254 NVMFACPPU EQU 1 in units of one 255 00000044 DISP 256 NVMMAXACC BSS 1 max number of comm controllers paid for 00000001 ABS 257 NVMFACACC EQU 1 in units of one 258 00000045 DISP 259 NVMMAXPORT BSS 1 max number of ports paid for 00000008 ABS 260 NVMFACPORT EQU 8 in units of 8 261 00000046 DISP 262 NVMMAXMSC BSS 1 max number of disk controllers paid for 00000001 ABS 263 NVMFACMSC EQU 1 in units of 1 264 00000047 DISP 265 NVMMAXDISK BSS 1 max number of disk drives paid for 00000001 ABS 266 NVMFACDISK EQU 1 in units of 1 267 00000048 DISP 268 NVMMAXLPC BSS 1 max number of LP controllers paid for 00000001 ABS 269 NVMFACLPC EQU 1 in units of 1 270 00000049 DISP 271 NVMMAXCTC BSS 1 max number of CT controllers paid for 00000001 ABS 272 NVMFACCTC EQU 1 in units of 1 273 0000004A DISP 274 NVMMAXCTU BSS 1 max number of CT drives paid for 00000001 ABS 275 NVMFACCTU EQU 1 in units of 1 276 0000004B DISP 277 NVMMAXMTC BSS 1 max number of MT controllers paid for 00000001 ABS 278 NVMFACMTC EQU 1 in units of 1 279 0000004C DISP 280 NVMMAXMTU BSS 1 max number of MT drives paid for 00000001 ABS 281 NVMFACMTU EQU 1 in units of 1 282 0000004D DISP 283 NVMMAXVTC BSS 1 max number of VT controllers paid for 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 81 (DISKDEFS) F 8 Disk Data Structures 00000001 ABS 284 NVMFACVTC EQU 1 in units of 1 285 0000004E DISP 286 NVMMAXVTU BSS 1 max number of VT drives paid for 00000001 ABS 287 NVMFACVTU EQU 1 in units of 1 288 289 BSS 1 filler of 1 bytes available for use 290 291 * These are the NVM clock values. There are 4 4 byte clock 292 * values taken collectively to keep the last known date. 293 * Each time the date is to be updated we write to the oldest 294 * 4 byte value in the group. Note that locations 2A:32 are 295 * no longer used for this purpose. Note also that the newest 296 * revision of the SSU has vastly expanded NVM and that the 297 * clock values for those SSUs are stored in the newly added 298 * NVM space. 299 00000004 ABS 300 NVMCLKBYTS EQU 4 number of bytes per clock value 00000050 DISP 301 ONVMCLOCKS BSS NVMCLKBYTS*4 NVM clock dates 302 00000010 ABS 303 NVMDEADCNT EQU 010 number of death flags (16) 00000060 DISP 304 NVMDEATHE BSS 0 end of death table 305 BSS NVMDEADCNT*2 allocate NVM death flags 306 00000080 DISP 307 NVMDEATH BSS 0 start of death flag table 308 * each is two bytes long and is the 309 * upper 16 bits of the target time 310 * for the indicated subsystem. 311 * These flags start at NVMDEATH and work backwards 312 * to NVMDEATHE. Flag 0 (VRM) is currently positioned 313 * at locations 7E:7F. 314 315 * The codes that are assigned for the "program number" are: 316 * 0 (7E) - Operating system (VRM) 317 * 1 (7C) - "InHouse" diagnostics. This exists to turn off any 318 * inhouse programs that BTI does not wish to go out 319 * into the field. This code is true when the machine 320 * is at BTI and false when the machine goes into the field. 321 * 2 (7A) - Assembler 322 * 3 (78) - Edit 323 * 4 (76) - Basic 324 * 5 (74) - Cobol 325 * 6 (72) - DBMS 326 * 7 (70) - FMS 327 * 8 (6E) - Pascal 328 * 9 (6C) - Fortran 329 * 10(6A) - PCLINK 330 * 11(68) - Basicx 331 * 12-15 are unused 332 * 333 * 334 * As of version 14 of the SSU the NVM has been increased to 335 * 2K, so there is ample room to store a variety of clock 336 * values. There will be 64 new clock values starting at 337 * byte address #300 and extending through #3FF. 338 * 339 BSS 640 push clock values to end of first 1K. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 82 (DISKDEFS) F 8 Disk Data Structures 00000300 DISP 340 NNVMCLOCKS BSS NVMCLKBYTS*64 new clock values 341 342 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 83 (DISKDEFS) F 8 Disk Data Structures 344 345 ********************************************************************************** 346 * * 347 * MASS STORAGE ORGANIZATION * 348 * This file describes all data structures that are * 349 * present on a volume. Most of these data structures are * 350 * present on every volume that the system recognizes. The * 351 * definitions are not necessarily in the most desirable order * 352 * because the element lengths must be defined before the * 353 * definitions for the block that holds them. * 354 * * 355 * These data structures and the transactions used to * 356 * update them have been designed to prevent the loss of data * 357 * during system crashes, operator errors, etc. Consequently, * 358 * they may be sub-optimal in terms of execution time or * 359 * space. See the section on crash resistance. * 360 * * 361 * These structures are divided into several groups: * 362 * 1.) those that control the recording media * 363 * 2.) those that control the data structure * 364 * 3.) those that control space allocation and use * 365 * * 366 * When a disk pack is placed on-line, or when it is * 367 * certified, certain information is placed on it that is * 368 * unique to the physical medium. * 369 * * 370 * This information should remain separate from that * 371 * associated with the volume. That is, when a volume is * 372 * copied, the hardware unique items are not copied at all, * 373 * but are taken from the new medium. * 374 * * 375 * The tables associated with the physical medium are: * 376 * 1.) pack label * 377 * 2.) bad trax list * 378 * 3.) bootstrap routine * 379 * * 380 * The pack label, volume label (discussed later), and * 381 * the bootstrap occupy fixed addresses. The two labels * 382 * contain pointers to the other tables. * 383 * * 384 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 84 (DISKDEFS) F 8 Disk Data Structures 386 387 ********************************************************************************** 388 * * 389 * CRASH RESISTANCE * 390 * In order to enhance maintainability, reliability, and * 391 * security, all mass storage structures and transactions are * 392 * designed around a set of goals collectively called * 393 * crashproofing. These goals are: * 394 * 1.) The mass storage structures must be 'safe' and * 395 * accurately represent the actual state of the volume * 396 * at the completion of every write. This is so that * 397 * any system crash, at any time, for any reason, will * 398 * leave the MS structures in a reasonable state for * 399 * restart. (This saves unbelievable amounts of * 400 * skilled field service labor to put systems back * 401 * together, which also helps customer relations). * 402 * 2.) The loss of one block on mass storage must never * 403 * cause the loss of more than one block of user * 404 * data. Note that this implies that the information * 405 * in essentially all system tables be duplicated. * 406 * In most cases this duplicated information is * 407 * distributed in various FBIs and a disk scan is * 408 * needed to recover it. * 409 * * 410 * Note that goal (1) can not protect against these * 411 * problems: * 412 * 1.) software or hardware errors corrupt the data * 413 * being written. * 414 * 2.) A block is read incorrectly with no indication of * 415 * an error. If the system does not determine that * 416 * the block is bad (inconsistent, internal checksum * 417 * failure, etc.) the results are unpredictable. * 418 * * 419 * Note also that goal (1) presumes that each mass * 420 * storage write completes successfully. If the system stops * 421 * because of a crash, the PPU will continue to transfer data * 422 * to the mass storage controller, so the block write should * 423 * complete successfully. If the system stops because of a * 424 * power failure, the controller will abort the operation if * 425 * the write has not actually started, otherwise, it will * 426 * attempt to finish the write. In any event, the system * 427 * power fail recovery routine will re-do the transfer when * 428 * power is restored. The most vulnerable areas are as * 429 * follows: * 430 * 1) The system stops because of a bus error during * 431 * a mass storage write. The PPU is no longer able * 432 * to transfer data over the bus, and the write will * 433 * die in the middle. This is awkward, because there * 434 * is really no practical recovery mechanism which * 435 * would allow the system to retry the transfer. * 436 * 2) The operator turns off a mass storage device and * 437 * removes the media (or removes the media during a * 438 * power failure). A write may have been aborted when * 439 * the device went off line, which it will do with * 440 * no warning (at least, in the currently available * 441 * devices). * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 85 (DISKDEFS) F 8 Disk Data Structures 442 * 3) A power failure occurs during a write, and the * 443 * recovery never occurs (due to loss of volatile * 444 * memory, disassembly of the system, etc.). * 445 * * 446 * Goal (2) is established to ensure that the loss of * 447 * mass storage blocks for any reason has a limited effect on * 448 * the system users. When a mass storage error is detected, * 449 * the system will usually be able to continue operation and * 450 * inform the affected user and the system operator of the * 451 * problem. However, certain errors will cause a situation in * 452 * which no safe continuation is possible and the system will * 453 * display an error code and stop. * 454 * * 455 * A permanent read error in a user file will cause that * 456 * data to be lost. In user directories, read errors may * 457 * cause the unavailability of all or part of that users data. * 458 * In system tables, such as the IDX, they may make the entire * 459 * volume unusable. Due to the severity of this problem, some * 460 * critical tables are duplicated. During table writes, both * 461 * versions are written. During table reads, the first error * 462 * free read from either table is accepted. * 463 * * 464 * It is, however, possible to scan the volume and * 465 * reconstruct tables on the basis of the FBI information. * 466 * This requires a small amount of heuristics, but is not * 467 * impractical (heuristic because blocks not yet freed contain * 468 * obsolete FBI information and must be recognized. The space * 469 * freer attempts to destroy some of the worst offenders * 470 * first.). * 471 * * 472 * By keeping these guidelines in mind, the intent of * 473 * each updating scheme should be clear: * 474 * 1.) multiple assignment of blocks is strictly forbidden!! * 475 * 2.) loss of unused file blocks in a crash is of * 476 * little concern since they may be recovered by * 477 * recreate or backup. * 478 * 3.) a crash at any time should leave either the old * 479 * structure or the completed new structure, never an * 480 * intermediate structure that is ambiguous or confusing. * 481 * This generally means that the more junior table * 482 * must be created first and removed last. * 483 * * 484 * Even relatively complex structures can be handled in a * 485 * crash resistant manner by using the worst case technique of * 486 * creating an entirely new data structure (containing the new * 487 * information and a copy of any previous information being * 488 * retained), updating the block that points to it, then * 489 * freeing the old structure. * 490 * * 491 * Note that the internal structure of the block must be * 492 * complete at the time that it is written to its permanent * 493 * location on the volume. That is, if a user program is * 494 * swapped, the partially updated tables that it controls must * 495 * not be written (back) to their permanent locations. They * 496 * must be retained strictly in resident memory. A cursory * 497 * analysis of table updating indicates that swapping during * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 86 (DISKDEFS) F 8 Disk Data Structures 498 * updates would usually result in garbage if a crash * 499 * occurred. The system avoids the problem by locking the * 500 * affected pages into main memory where necessary. Another * 501 * technique not used by this system is to allocate a scratch * 502 * block for the swapping of such pages during their * 503 * modification. * 504 * * 505 * At the time of a crash, there may be several users * 506 * updating tables. As long as the crashproofing rules are * 507 * followed for each transaction individually, and the * 508 * transactions do not interfere with one another (normal * 509 * multiprocessing rules apply), there will be no defects as a * 510 * result of having multiple occurrences of acceptable funnys * 511 * (unfreed blocks, sections of files being unwritten, new * 512 * data structures not linked in, etc.). * 513 * * 514 * Under the description of each table are listed the * 515 * rules governing its updating. Tables that stand alone * 516 * might not have any special updating procedure. Table * 517 * updates involving several different tables are included or * 518 * referenced under each table description. * 519 * * 520 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 87 (DISKDEFS) F 8 Disk Data Structures 522 523 ********************************************************************************** 524 * * 525 * MASS STORAGE ERRORS * 526 * The mass storage drivers will normally retry failing * 527 * transfers according to generally accepted recovery * 528 * procedures. * 529 * * 530 * For mass storage hardware that has error correction * 531 * capability, most rereads will not be necessary, though it * 532 * may be desirable to classify transfers as follows: * 533 * 1.) no errors * 534 * 2.) correctable data error, retry gave no error * 535 * 3.) correctable data error, retry gave another * 536 * correctable error (correction is not attempted until * 537 * the simpler retry operation is tried) * 538 * 4.) data error not corrected on first read, but * 539 * ultimately recovered * 540 * 5.) permanent data error * 541 * 6.) permanent data error, the disk drive appears * 542 * to be faulty (as verified by test reads of * 543 * other blocks [such as bad trax list]) * 544 * 7.) permanent data error, the disk controller * 545 * appears to be faulty (as verified by test * 546 * reads of other units) * 547 * 8.) no error status, but FBI checksum or block * 548 * number wrong * 549 * * 550 * Condition 8 could indicate a problem with the * 551 * controller, the channel, or a problem at the time of the * 552 * previous write. It should promptly cause a system halt * 553 * except in the case of a maintenance read. If a controller * 554 * problem causing write errors is discovered, the faulty * 555 * blocks must all be rectified to prevent their reappearence * 556 * as a later case of the plague. * 557 * * 558 * Condition 7 on any volume or condition 6 on the system * 559 * volume are grounds for an immediate halt. Any attempt to * 560 * terminate system operation more normally runs the risk of * 561 * irretrievably damaging the data structures. * 562 * * 563 * Condition 2 should be treated as no error since it is * 564 * probably caused by transient conditions unrelated to the * 565 * media, although a history of these is indicative of a bad * 566 * track or a hardware problem. * 567 * * 568 * Conditions 2 through 5 should cause an entry into the * 569 * disk error log (or possibly just the normal system log * 570 * file). * 571 * * 572 * Conditions 3 through 5 and possibly also 2 should * 573 * cause an entry in the bad trax list of this medium, * 574 * indicating the type of error for analysis when the medium * 575 * is reformatted and to prevent a recreate from using these * 576 * potentially bad blocks. * 577 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 88 (DISKDEFS) F 8 Disk Data Structures 578 * Conditions 3 and 4 should cause the block to be * 579 * rewritten in a new location, and an entry made in the * 580 * substitution list. * 581 * * 582 * When the system is idle or has excess disk transfer * 583 * capacity, it may be desirable to investigate each head of * 584 * each disk periodicly. These reads could provide early * 585 * detection of head crashes. To be useful, of course, the * 586 * system must be able to unload the heads. A list of test * 587 * blocks may be maintained (one for each head) so that the * 588 * mass storage driver can write as well as read to test for * 589 * malfunctions. Alternatively, the innermost cylinder of * 590 * each drive could be reserved for diagnostic purposes. Such * 591 * a reserved area could be used both for diagnostics and for * 592 * a crashdump area. * 593 * * 594 * Test reads could also comprise a disk certification * 595 * based on the bad trax information concerning the * 596 * completeness of pattern testing, etc. * 597 * * 598 * The first few blocks on each volume are occupied by * 599 * tables that must occupy those fixed block addresses. If * 600 * one of these blocks becomes unreadable, the pack must be * 601 * refurbished. However, all user data may be recovered. A * 602 * feature that may be added to the system later is that of a * 603 * search over the first N blocks of the volume in order to * 604 * find the required tables. This would provide even more * 605 * tolerance to packs with imperfections. * 606 * * 607 * All other tables occupy variable block numbers and may * 608 * be substituted. Substitutions may take place on either a * 609 * write that did not write check or on a read with a * 610 * recoverable error. The system will do substitutions * 611 * without affecting the use of the system. Most * 612 * substitutions may be done simply by copying the data to a * 613 * new block and making an appropriate entry in the * 614 * substitution list. However, certain of the system control * 615 * blocks must be available even when the substitution list is * 616 * not available. These blocks may not be substituted. * 617 * However, they may be moved to another location if the new * 618 * block address is entered into the appropriate root block. * 619 * DISKBOOT goes to a lot of trouble to load the substitution * 620 * list so that it can boot from a file containing * 621 * substitutions. However, the operating system reads in the * 622 * substitution list in a piece of virtual code, and that code * 623 * must be free of substitutions. * 624 * * 625 * If an unrecoverable read error occurs, the data on * 626 * that block must be presumed lost. In some cases, a * 627 * heuristic scan of the questionable data may reveal the * 628 * error, but this is expensive and hazardous. Such scans are * 629 * primarily applicable in the case of a table occupying a * 630 * very small part of a block. Additionally, if read errors * 631 * have been caused by a defective drive or controller, * 632 * replacing or repairing the offending hardware may restore * 633 * the readability of the data. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 89 (DISKDEFS) F 8 Disk Data Structures 634 * * 635 * If the lost data is user data, he must look to a * 636 * backup or transaction log to recover it. * 637 * * 638 * If the lost data is system control or management data, * 639 * it may be possible to recover it automaticly by means of a * 640 * recovery program. Such a program would build a copy of the * 641 * defective volume and repair the damage. * 642 * * 643 * After the data has been recovered from a pack, it is * 644 * intended that the pack may be reused. The blocks that were * 645 * discovered bad should be entered into the bad trax list to * 646 * prevent further read errors on the same block. The volume * 647 * may then be zeroed or recovered onto and is as good as new! * 648 * However, the label area is required to be good for a pack * 649 * to be usable. * 650 * * 651 * Each of the tables on the volume has certain rules to * 652 * be followed when mass storage errors occur on it. These * 653 * rules are listed in the description of each table. * 654 * However, a read of a table may be for an informative * 655 * purpose, such as a maintenance program investigating the * 656 * volume. These reads occur through a mechanism similar to * 657 * file reads and the recovery actions are the same as for a * 658 * file. * 659 * * 660 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 90 (DISKDEFS) F 8 Disk Data Structures 662 663 ********************************************************************************** 664 * * 665 * FILE BLOCK IDENTIFIER (FBI) * 666 * remember J. Edgar * 667 * Each transfer to or from mass storage consists of two * 668 * data areas chained together. The first of these is exactly * 669 * one page in length. This page of data is always loaded on * 670 * a page boundary by the system. It consists primarily of * 671 * the actual data of interest and may be entirely user data. * 672 * * 673 * The other data area consists of FBILNTH words which * 674 * contain the information described in this section. * 675 * * 676 * When a volume is initialized and when space is freed, * 677 * each file block identifier is set up to indicate that it is * 678 * a free block. Every file block in use, however, is * 679 * uniquely labeled as to owner, data structure, and position * 680 * in that data structure by the data in the FBI. * 681 * * 682 * This enables the detection of many error conditions * 683 * such as: * 684 * crashes during writes extending a file. * 685 * various hardware errors. * 686 * various software errors. * 687 * This information also aids in the recovery of user * 688 * data when the volume structure has been damaged. * 689 * * 690 * If this block is a substitute, the block number in the * 691 * FBI is the block number of the original (defective) block. * 692 * If the substitution list is destroyed, this allows a scan * 693 * to find all substitutions. Furthermore, the program that * 694 * calls the mass storage driver may do its FBI checking * 695 * without knowing that the block was a substitute. * 696 * * 697 * If a block is read and its FBI is garbage (not the * 698 * correct block, a correct substitute, or a free block), it * 699 * must be assumed that an otherwise undetected mass storage * 700 * error has occured. See the section on mass storage errors. * 701 * * 702 * The forward link and backward link fields are used * 703 * only in sequential data structures (e.g. .SAFs). They are * 704 * zero if not used in such a structure. * 705 * * 706 * The relative block number indicates the location of the * 707 * block in the structure holding the block. The OS only sets * 708 * it, but it is available for consistency checks in the * 709 * REBUILD utility, and for OS debuggers to try to reconstruct * 710 * exploded structures. Only some block types have a meaningful * 711 * number, all others receive FBIRELBLK=0 (although 0 can be a * 712 * value in the "meaningful" blocks as well). * 713 * * 714 * Block type FBIRELBLK * 715 * ---------- -------------------------------------- * 716 * FBITIDX index into SECIDXENTS * 717 * FBITAFT index into SECAFTENTS * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 91 (DISKDEFS) F 8 Disk Data Structures 718 * FBITSAF position in SAF chain (0:size-1) * 719 * FBITSRAF index into RAF major block (0:03FF) * 720 * FBITRAFD page number in file (0:0FFFFF) * 721 * FBITCODED page number in file (CCB index, 0:CCBMAXPAGE-1) * 722 * (others) 0 * 723 * * 724 * CRASH RESISTANCE * 725 * The FBI must be present with every block when it is * 726 * written to the volume. * 727 * * 728 ********************************************************************************** 729 730 BASE R2 00168800 2 BASE 731 FBIWORDA BSS 1 00168801 2 BASE 732 FBIWORDB BSS 1 00168802 2 BASE 733 FBIWORDC BSS 1 00088080 2 ZBM 734 FBITYPE EQU FBIWORDA/BITS 0:7 type of data block 735 * although this is assembled as an 8 bit 736 * field, the maximum value is 07F, i.e. 737 * only 7 bits 00089180 2 ZBM 738 FBIFLINK EQU FBIWORDA/MSBLKFIELD forward link 739 * (next block in a sequential structure) 00088041 2 ZBM 740 FBIFLAGS EQU FBIWORDB/BITS 0:3 misc flag bits 00088011 2 ZBM 741 FBINOREWRIT EQU FBIFLAGS/BIT 28 this block has been rewritten 00088211 2 ZBM 742 FBIWCHK EQU FBIFLAGS/BIT 29 set if this block is important 743 * enough to write check 00088411 2 ZBM 744 FBINOSUB EQU FBIFLAGS/BIT 30 set if not substitutable 00088611 2 ZBM 745 FBIMEMERR EQU FBIFLAGS/BIT 31 block written from page with memory error 00088221 2 ZBM 746 FBIDEFFLAGS EQU FBIFLAGS/BITS 29:30 flag bits which should have a known value 00089181 2 ZBM 747 FBIDA EQU FBIWORDB/MSBLKFIELD this block's disk block number 748 * (original MS address if this is a substitute) 00089182 2 ZBM 749 FBIBLINK EQU FBIWORDC/MSBLKFIELD backward link 750 * (preceeding block in a sequential structure) 751 * code entry type in FBITYPE field 752 * 0 should not appear 00000001 ABS 753 FBITPL EQU 001 pack label 00000002 ABS 754 FBITBTRX EQU 002 bad trax list 00000003 ABS 755 FBITBOOT EQU 003 bootstrap 00000004 ABS 756 FBITVL EQU 004 volume label 00000005 ABS 757 FBITSUBS EQU 005 substitution list 00000006 ABS 758 FBITSEC EQU 006 security block 00000007 ABS 759 FBITADT EQU 007 ADT block 00000008 ABS 760 FBITIDX EQU 008 IDX block 00000009 ABS 761 FBITUDIR1 EQU 009 UDIR primary block 0000000A ABS 762 FBITUDIR2 EQU 00A UDIR secondary block 0000000B ABS 763 FBITSYS EQU 00B misc system use (swapping) 0000000C ABS 764 FBITSAF EQU 00C SAF 0000000D ABS 765 FBITLRAF EQU 00D root of large RAF (major access block) 0000000E ABS 766 FBITSRAF EQU 00E root of small RAF (minor access block) 0000000F ABS 767 FBITRAFD EQU 00F RAF data block 00000010 ABS 768 FBITAFT EQU 010 account finder table block 00000011 ABS 769 FBITASLB EQU 011 account shared list block 00000012 ABS 770 FBITFSLB EQU 012 file shared list block 00000013 ABS 771 FBITCCB EQU 013 code file control block 00000014 ABS 772 FBITCODED EQU 014 code file data block 00000015 ABS 773 FBITAUTLB EQU 015 authorization list block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 92 (DISKDEFS) F 8 Disk Data Structures 0000007E ABS 774 FBITESTB EQU 07E test block 0000007F ABS 775 FBITFREE EQU 07F code for a free block 776 00168803 2 BASE 777 FBILCD BSS 1 last changed date 00168804 2 BASE 778 FBIWORDE BSS 1 00089184 2 ZBM 779 FBIRELBLK EQU FBIWORDE/MSBLKFIELD relative block number 00168805 2 BASE 780 FBIACCT BSS2 1 account name of this blocks owner 00168807 2 BASE 781 FBIPROJ BSS 1 division-project 00168808 2 BASE 782 FBISERNO BSS2 1 serial number (creation date) of this structure 783 BSS FBILNTH-(DISPW FBIWORDA)-1 make checksum the last word 0016880A 2 BASE 784 FBICKSUM BSS 1 FBI checksum 785 DRCT 00000004 ABS 786 FBILOG EQU FBILNTH LOG 2 log size of FBI FFC00000 ABS 787 FBIGMASK EQU NOT(2 POWER (33-FBILNTH)-1) mask for PRMUT checksum gen. FFE00000 ABS 788 FBICSMASK EQU NOT(2 POWER (32-FBILNTH)-1) mask for PRMUT checksumming 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 93 (DISKDEFS) F 8 Disk Data Structures 790 791 ********************************************************************************** 792 * * 793 * PACK LABEL * 794 * This label block should never be written by the * 795 * system. Its creation is the task of a pack initialization * 796 * routine that need not be available to the system owner. * 797 * * 798 * CRASH RESISTANCE * 799 * Not applicable * 800 * * 801 * MASS STORAGE ERRORS * 802 * The pack label occupies a fixed MS block number. It * 803 * may not be substituted in any way. If this block goes bad, * 804 * the volume (and pack) may not be used. However, any data * 805 * already on the pack may be easily recovered. This is * 806 * because the data that is lost with this block is not * 807 * essential to the recovery operation. We require that the * 808 * pack be removed from service and refurbished because we * 809 * cannot guarantee the continued well being of a volume on a * 810 * pack where we cannot find the bad trax list. * 811 * * 812 ********************************************************************************** 813 00000000 ABS 814 PLDA EQU 0 MS address for pack label 815 816 BASE 00000000 DISP 817 PLSERIAL LABEL disk pack identifier 00000000 DISP 818 PLMAKER BSS 1 disk pack manufacturer code (pak6) 00000001 DISP 819 PLSERNO BSS 1 disk pack serial number (unsigned integer) 820 BSS 2 reserved for expansion 821 00000004 DISP 822 PLFLAGS BSS 1 misc pack information 00003010 BYTE 823 PLNODRVID EQU BIT 24 indicates no drive ID board 00002E10 BYTE 824 PLFORMNEW EQU BIT 23 indicates a new pack 00002C10 BYTE 825 PLFORMRFRB EQU BIT 22 indicates a refurbished pack 826 00000005 DISP 827 PLFRMTRID BSS 2 identification of who formatted this pack 00000007 DISP 828 PLINIDATE BSS2 1 date of initialization 00000009 DISP 829 PLINITSCANS BSS 1 number of certification passes at initialization 830 BSS 6 room to expand 831 * information used by the mass storage driver to 832 * calculate the hardware addresses of blocks. 00000010 DISP 833 PLSECPTRK BSS 1 blocks per track 00000011 DISP 834 PLTRKPCYL BSS 1 heads per cylinder 00000012 DISP 835 PLCYLPPCK BSS 1 cylinders per pack 00000013 DISP 836 PLSIZE BSS 1 size of pack in blocks 837 BSS 4 room to expand 00000018 DISP 838 PLBDTRXDA BSS 1 block number of bad trax list 839 * added for use by SCSI type disk drives 00000019 DISP 840 PLSDVID BSS 2 SCSI vendor identification 0000001B DISP 841 PLSDPID BSS 4 SCSI product identification 0000001F DISP 842 PLSDFREV BSS 1 SCSI firmware revision level 843 BSS 1 so string is null terminated 00000021 DISP 844 PLMODESN BSS 19 mode sense data (pages 1 to 4) 0000004C ABS 845 PLMODESNL EQU DISPC PLMODESN mode sense length 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 94 (DISKDEFS) F 8 Disk Data Structures 846 DRCT 847 ********************************************************************************** 848 * * 849 * MIRROR SECTOR * 850 * The mirror sector is used by the SCSI MIRROR host adaptor to * 851 * identify if two drives are mirrors of one another. A mirror set * 852 * exists if a pair of drives sharing an ID have equal RUN NUMBER, * 853 * equal VOL SIZE, and cross matching DATE STAMPS. The mirror sector * 854 * resides in the pack label, beginning in the last 512 bytes of the * 855 * block. The name SECTOR comes from the fact that a SCSI drive is * 856 * divided into sectors of 512 bytes each. The label MIRRORSECT is * 857 * used to generate a pointer to the start of the mirror sector. * 858 * * 859 ********************************************************************************** 860 00000380 ABS 861 MIRRORSECT EQU 1024-128 put in last 512 bytes of page 862 863 BASE mirror sector definition 04000000 DISP 864 SELFRUNNUM BSSB 16 our run number 80000000 DISP 865 SELFVOLSIZ BSSB 32 our volume size 80000001 DISP 866 SELFDATE1 BSSB 32 upper 16 bits of date 80000002 DISP 867 SELFDATE2 BSSB 32 lower 32 bits of date 868 BSSB 16 04000004 DISP 869 MATERUNNUM BSSB 16 mate run number 80000004 DISP 870 MATEVOLSIZ BSSB 32 mate volume size 80000005 DISP 871 MATEDATE1 BSSB 32 upper 16 bits of date 80000006 DISP 872 MATEDATE2 BSSB 32 lower 32 bits of date 873 BSSB 16 874 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 95 (DISKDEFS) F 8 Disk Data Structures 876 877 ********************************************************************************** 878 * * 879 * BAD TRAX LIST * 880 * This is a list of file blocks that have been found to * 881 * be defective. This table stores the reason for each entry. * 882 * The pack certification or initialization routines makes the * 883 * original table. This block must be assigned even if there * 884 * are no bad trax found on the pack, since the MS driver * 885 * cannot allocate a file block during error recovery * 886 * operations. The bad trax list is amended by the system as * 887 * it discovers additional errors. There is currently no * 888 * provision for more than one block (512 entries). * 889 * * 890 * Elements are packed into the bad tracks block from the * 891 * beginning. The end of the list is indicated by an entry * 892 * with word 0 all zeros. * 893 * * 894 * When the pack is to be refurbished, the bad trax list * 895 * will indicate those areas requiring additional checking. * 896 * * 897 * CRASH RESISTANCE * 898 * Generally not applicable. However, when a mass storage * 899 * error is encountered, this table should have the offending * 900 * block number entered. If this update takes place * 901 * before any substitution, it affords an opportunity * 902 * to discover that the drive or controller have failed * 903 * before upsetting the actual volume data structure by * 904 * attempting a substitution. * 905 * * 906 * MASS STORAGE ERRORS * 907 * Pointer in pack label. May be moved, but the * 908 * correct pointer must be placed in the pack label (may * 909 * not use the substitution list). If this block cannot * 910 * be read, the volume may not be used, but recovery will * 911 * be complete. This pack must have a new bad trax * 912 * constructed. This offending block must be added to * 913 * the new bad trax list. * 914 * Note, however, that reads of this block are * 915 * initiated by other mass storage errors. The occurrence * 916 * of another mass storage error here should cause a high * 917 * degree of concern for the well being of the hardware. * 918 * * 919 ********************************************************************************** 920 921 BASE definition of elements 00000000 DISP 922 BTRXEL BSS 1 reason for entry/block number 00000080 BYTE 923 BTRXREASON EQU BITS 0:7 reason for entry 924 * MSBLKFIELD block number 925 * codes reason 00000010 ABS 926 BTRXLCDE EQU 010 MS error during certification 00000020 ABS 927 BTRXRTDE EQU 020 MS error at run time 00000030 ABS 928 BTRXACDE EQU 030 accident destroyed format 00000040 ABS 929 BTRXFSDE EQU 040 BTI field service designated block bad 00000001 DISP 930 BTRXDATE BSS 1 date when entry was made 00000002 ABS 931 BTRXLNTH EQU DISPW BTRXEL element size 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 96 (DISKDEFS) F 8 Disk Data Structures 932 DRCT 00000200 ABS 933 BTRXECNT EQU BLOCKSIZE/BTRXLNTH number of entries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 97 (DISKDEFS) F 8 Disk Data Structures 935 936 ********************************************************************************** 937 * * 938 * BOOTSTRAP * 939 * This routine is emplaced during pack initialization or * 940 * software update. It is also placed on a pack when a copy * 941 * to it is being made and a newer version of the bootstrap is * 942 * present on the source pack. The bootstrap is loaded and * 943 * run by the initial bootstrap operation, which is partially * 944 * a microcode and hardware function. * 945 * * 946 * The primary purpose of this code is to load and start * 947 * the system software. For this, it must search the hardware * 948 * for a system volume, then search that volume for the * 949 * appropriate account and program. The normal program is the * 950 * system software code although special purpose programs such * 951 * as diagnostics may be available. * 952 * * 953 * In conjunction with the microcode and hardware, a * 954 * crashdump mode is provided that saves the machine states * 955 * for a later analysis. * 956 * * 957 * A secondary purpose of the bootstrap is as a * 958 * maintenance tool. Since it is loaded primarily by * 959 * microcode and hardware operations, it can be loaded despite * 960 * many kinds of malfunctions and it should be useful in * 961 * corrective maintenance. * 962 * * 963 * The bootstrap block has the revision level of the code * 964 * assembled into it. The software that looks at the * 965 * bootstrap blocks makes use of this revision level. It is * 966 * in the form: * 967 * * 968 * TEXT "Bx.y" * 969 * * 970 * Where x is the major revision code and y is the * 971 * minor revision. * 972 * * 973 * CRASH RESISTANCE * 974 * Not applicable * 975 * * 976 * MASS STORAGE ERRORS * 977 * See the notes under pack label. * 978 * * 979 ********************************************************************************** 980 00000002 ABS 981 BOOTDA EQU 2 MS address of bootstrap 982 983 BASE 984 BSS 1 the jump around 00000001 DISP 985 BOOTREV BSS 1 the revision code 986 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 98 (DISKDEFS) F 8 Disk Data Structures 988 989 ********************************************************************************** 990 * * 991 * LOGICAL STRUCTURE * 992 * The remaining tables are associated with volumes * 993 * rather than physical recording media. * 994 * The volume label contains pointers to secondary * 995 * tables. * 996 * * 997 ********************************************************************************** 998 999 ********************************************************************************** 1000 * * 1001 * VOLUME LABEL * 1002 * This label is maintained by the system using this pack. * 1003 * It contains pointers to the secondary tables that control the * 1004 * data structure of the volume. * 1005 * * 1006 * Each volume label has a word which is a bit array of * 1007 * volume format revision numbers that can mount this volume and * 1008 * each system has such a bit array giving the revisions that it * 1009 * can mount. Thus a higher revision system knows which lower * 1010 * revisions it can not use and a lower revision system can not * 1011 * get at unacceptable higher revision formatted volumes. * 1012 * * 1013 * This works as follows: When a new system revision is * 1014 * being prepared, we know which old revision packs it can mount, * 1015 * so its bit mask will include those. When a pack is updated to * 1016 * a new revision, we similarly know which old systems are * 1017 * capable of handling whatever changes were made in the format * 1018 * so its bit mask will include those systems. Tricky, huh? * 1019 * * 1020 * A system serial number consists of two parts: * 1021 * 1.) the customer (owner) number * 1022 * 2.) the system number for that owner * 1023 * The system number follows our manufacturing sequence and * 1024 * is on our records as the system serial number. Normally, the * 1025 * customer number and the system number for a system are the * 1026 * same. However, in a few cases a multiple system customer will * 1027 * have a different customer number. A system distribution or * 1028 * backup volume may be encoded either for a specific system (by * 1029 * specifying the customer number and system number exactly) OR * 1030 * for a specific customer number (by specifying the customer * 1031 * number and 0 in place of the system number). * 1032 * * 1033 * The volume passwords work as follows: * 1034 * * 1035 * 1) Each volume has stored on it the SSN of the machine that * 1036 * 'owns' it. * 1037 * 2) On a OPR LOAD operation, if the SSN of the volume and the * 1038 * machine matches, no further checking is done. A volume * 1039 * SSN with a 0 system number will match on any system with * 1040 * the same customer number. * 1041 * 3) If not, the password supplied with the OPR LOAD command * 1042 * must match the volume password. There are several * 1043 * possibilities here.. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 99 (DISKDEFS) F 8 Disk Data Structures 1044 * A) The operator supplies the correct password, including * 1045 * the case where both are . The volume is loaded. * 1046 * B) The volume password is . No possible password * 1047 * matches, and the volume cannot be loaded. * 1048 * C) The operator specifies the wrong password. Of course, * 1049 * the volume is not loaded. * 1050 * 4) If the SSN did not match, the password did match, and the * 1051 * 'newowner' flag is on, the SSN of the 'owning' system (on * 1052 * the volume) is changed to that of the current system * 1053 * and the 'newowner' flag is cleared. * 1054 * 5) When the volume is loaded, the OPR program allows several * 1055 * items to be changed. The volume name and title may be * 1056 * changed arbitrarily (except cannot create a duplicate * 1057 * name). The volume password and 'newowner' flag may be * 1058 * changed iff the SSN matches. If the SSN currently * 1059 * matches, it may be changed to anything. * 1060 * * 1061 * * 1062 * Implied states of the volume * 1063 * * 1064 * 1) PWD is . This is a 'portable' volume, and may be * 1065 * mounted on any system. The SSN, however, will not change, * 1066 * so the volume still 'belongs' to the original system. * 1067 * 2) PWD is . The volume is 'transportable'. The * 1068 * original system can OPR LOAD the volume without the password. * 1069 * Any other system can OPR LOAD the volume iff they specify * 1070 * the correct password. * 1071 * 3) In either case (1) or (2), the 'newowner' flag may be set. The * 1072 * first system (other than the original system) to successfully * 1073 * OPR LOAD this volume becomes the new owner (the SSN is set to * 1074 * that of the new system and the 'newowner' flag is cleared). * 1075 * This is the state left by DISKINIT. It allows the system doing * 1076 * the pack formatting to load the pack for tests. When the pack * 1077 * is loaded onto its ultimate destination, it becomes the property * 1078 * of that system. (A customer formatting a pack for himself must * 1079 * explicitly clear the 'newowner' flag to get this same * 1080 * protection). * 1081 * 4) PWD is . The volume is 'private'. Only the original * 1082 * system can OPR LOAD the volume. * 1083 * * 1084 * 'How To' section * 1085 * * 1086 * 1) Prepare a pack to be sent to a specific site and no other. * 1087 * Set the password to something that you know, then set the * 1088 * SSN to be that of the destination system. * 1089 * Alternatively, set the password to something that you give * 1090 * the intended recipient, and set the 'newowner' flag. * 1091 * 2) Prepare a pack to go anywhere (such as a newly formatted pack). * 1092 * Set the password to and set the 'newowner' flag. * 1093 * 3) Prepare a pack to be used to transfer software to another site, * 1094 * where the return of the pack to the original site is expected. * 1095 * Set the password to something that you give the intended recipient. * 1096 * 4) Prepare a pack to be used to transfer software to anyone. * 1097 * Set the password to . * 1098 * 5) Prepare a pack that can not be used by any other site. * 1099 * Set the password to and clear the 'newowner' flag. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 100 (DISKDEFS) F 8 Disk Data Structures 1100 * * 1101 * CRASH RESISTANCE * 1102 * This block is normally a permanent part of the structure * 1103 * and is infrequently updated. During operations that destroy a * 1104 * volume (DISKCOPY, TAPERECOVER, Backup) a volume label * 1105 * indicating 'invalid' should be written before anything else. * 1106 * The last operation of a process that leaves a valid volume * 1107 * should be the write of a volume label indicating 'valid'. As * 1108 * it turns out, the invalidating write is usually about the * 1109 * third disk write because we need to determine the disk * 1110 * addresses of the subs and security blocks before we write out * 1111 * the volume label. The only consequence of a crash during this * 1112 * is that a pack that we were planning on overwriting (by doing * 1113 * the copy) has an old volume label (indicating a valid volume * 1114 * with the old name) with an empty subs list or security blocks. * 1115 * If the subs list is overwritten, the old volume is mostly * 1116 * still there except for blocks that were substituted. If the * 1117 * security block(s) are written, we essentially have an empty * 1118 * volume with the old name. It is also possible that the new * 1119 * subs block and/or security blocks do not have the same disk * 1120 * addresses as their previous counterparts. This will lead to * 1121 * various forms of disk structure error iff a load is attempted * 1122 * on the pack. * 1123 * Since the data on the pack is forfeit anyway, we are * 1124 * not concerned over the slight possibility of confusion. Note * 1125 * that no security violation is possible, since the old data is * 1126 * never accessible under a new volume label, and vice-versa. * 1127 * * 1128 * MASS STORAGE ERRORS * 1129 * Fixed block number. No substitutions. If this block * 1130 * cannot be read, the volume may not be used. Recovery must be * 1131 * instigated by manufacturers maintenance due to the security * 1132 * problem. Dependent blocks must be found by scanning. The * 1133 * recovery should be complete. The pack must be refurbished. * 1134 * * 1135 ********************************************************************************** 1136 00000001 ABS 1137 VOLLABELDA EQU 1 mass storage address of volume label 1138 1139 BASE 00000000 DISP 1140 VLSSN BSS 1 system serial number 1141 * if this volume is being mounted on 1142 * a system with a different system 1143 * serial number, the correct volume 1144 * password must be supplied. 00000100 BYTE 1145 CUSTNUM EQU BITS 0:15 customer number field 00002100 BYTE 1146 SYSTNUM EQU BITS 16:31 system number field 1147 BSS 1 1148 BSS2 1 00000004 DISP 1149 VLVNAME BSS2 1 volume name 1150 * each volume name at a site 1151 * should be unique. 00000006 DISP 1152 VLVPASSW BSS2 1 volume password 1153 * the default value cannot be matched. 1154 * This is so that a user who neglects 1155 * to set the volume password is 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 101 (DISKDEFS) F 8 Disk Data Structures 1156 * protected against another system 1157 * owner who might acquire that pack. 00000008 DISP 1158 VLCDATE BSS2 1 creation date for this volume 1159 BSS 1 filler (was creation date) 0000000B DISP 1160 VLFLAGS BSS 1 flag bits 00000210 BYTE 1161 VLFLAGINV EQU BIT 1 sez not a valid volume 00000410 BYTE 1162 VLFLAGNEWO EQU BIT 2 sez change volume to new owner 0000000C DISP 1163 VLAVREV BSS 1 bit array of revisions allowed to 1164 * mount this pack 0000000D DISP 1165 VLVREV BSS 1 volume revision of this pack 1166 BSS 1 1167 BSS 1 filler (was copy of VLSIZE) 00000010 DISP 1168 VLSUBSDA BSS 1 substitution list MS address 1169 BSS 1 00000012 DISP 1170 VLSECBDA BSS 1 primary security block MS address 00000013 DISP 1171 VLSECB2DA BSS 1 secondary security block MS address 1172 BSS 12 00000080 ABS 1173 VLTITLELEN EQU 128 length (characters) of volume title 00000020 DISP 1174 VLTITLE BSS VLTITLELEN/CPW ascii volume title 00000040 DISP 1175 VLBKUPE LABEL end of area written for backup 1176 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 102 (DISKDEFS) F 8 Disk Data Structures 1178 1179 ********************************************************************************** 1180 * * 1181 * SUBSTITUTION LIST * 1182 * A list of file block substitutions that have been made * 1183 * as a result of the inability to write on an already committed * 1184 * file block or as a result of a soft read error. This block * 1185 * must be assigned even if there are no substitutions on this * 1186 * volume, since the MS driver cannot allocate a file block for * 1187 * this during error recovery operations. * 1188 * * 1189 * This list is copied into main memory when a volume is * 1190 * mounted and is written back each time a change is made. * 1191 * * 1192 * New entries are made when a write can not be successfully * 1193 * completed or when a read indicates a soft error and it seems * 1194 * prudent to remove the data to a fresh spot. Each entry in the * 1195 * subs list is a pair of block numbers: * 1196 * 1.) the failing address * 1197 * 2.) a substitute for it * 1198 * Entries are deleted when the failing address is freed. The * 1199 * substitute is freed instead and the failing block is discarded * 1200 * (it should already have been entered into the bad trax list). * 1201 * Each mass storage transfer on any volume involves a check to * 1202 * see if the requested block has a substitute. There is * 1203 * currently no provision for more than one block (512 entries). * 1204 * * 1205 * Other possible entries in this table (or bad trax) are * 1206 * flags requesting that all writes above a certain block number * 1207 * be write checked. This floor would grow as the medium was * 1208 * proven good. * 1209 * * 1210 * CRASH RESISTANCE * 1211 * This table may not be updated until after the substituted * 1212 * write has taken place. Additionally, the failing address * 1213 * should be entered into the bad trax list before any attempt at * 1214 * substitution is made. * 1215 * * 1216 * MASS STORAGE ERRORS * 1217 * The pointer to the substitution list is found in the * 1218 * volume label. If the MS block occupied by the substitution * 1219 * list goes bad, the subs list may be moved, but the correct * 1220 * pointer to it must be placed in the volume label (may not use * 1221 * the substitution list). If the subs block cannot be read, the * 1222 * volume may not be used. All blocks acting as substitutes must * 1223 * be found by the recover routine (by finding all blocks whose * 1224 * actual MS address does not match their FBIDA). * 1225 * * 1226 ********************************************************************************** 1227 1228 BASE 00000000 DISP 1229 SUBSBADDY BSS 1 first word contains bad block 1230 * address, zero if list end. 00000001 DISP 1231 SUBSSUB BSS 1 second word contains the substitute. 00000002 ABS 1232 SUBSLNTH EQU DISPW SUBSBADDY element length 00000200 ABS 1233 SUBSECNT EQU BLOCKSIZE/SUBSLNTH number of entries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 103 (DISKDEFS) F 8 Disk Data Structures 1234 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 104 (DISKDEFS) F 8 Disk Data Structures 1236 1237 ********************************************************************************** 1238 * * 1239 * SECURITY BLOCK * 1240 * This block contains the pointers to the ADT chains * 1241 * and other variables local to this volume or system. * 1242 * * 1243 * There exist multiple ADT chain heads in the security * 1244 * block. The purpose of this is to minimize the loss of free * 1245 * blocks when mass storage errors are encountered in the ADT * 1246 * chain linkages. * 1247 * * 1248 * The IDX and AFT tables are made up of multiple blocks, * 1249 * with each entry being hashed into one of the blocks. The * 1250 * security block contains the index to both of these tables. * 1251 * The IDX and AFT contain only as many blocks as are really * 1252 * needed to hold the entries, so there is also a word that * 1253 * indicates how big the index is (how many blocks are in the * 1254 * corresponding table). * 1255 * * 1256 * This block contains the current start up number (SUN). * 1257 * The SUN is used to validate file use counts. It is an eight * 1258 * bit counter that is incremented every time that the system * 1259 * is started, with counts of zero mod 256 being skipped. * 1260 * * 1261 * The SECMNTDAT field is the date of the most recent event * 1262 * that allowed the above ADT lists to be altered. Specifically, * 1263 * it is set when the pack is initialized, rebuilt, mounted, * 1264 * or recovered full volume style. It is used by the online MS * 1265 * driver to ensure that a pack being remounted has not had its * 1266 * ADTs corrupted while the drive was down (for example, by * 1267 * moving the pack to another system). This provides a finer * 1268 * granularity than the pack format date alone. It also works * 1269 * (prevents remount) if two or more packs have the same format * 1270 * date (i.e. some dick copied the pack label and didn't change * 1271 * PLINITDATE). This field was added 17 June 1988. Older packs * 1272 * have this field 0, and we fall back on the PLINITDATE until * 1273 * one of the above operations is performed. This also works * 1274 * for packs whose security blocks can't be read when the drive * 1275 * is spun up, but get initialized online (initializer should * 1276 * request the ORINITFMT OPREQ before starting). * 1277 * * 1278 * Note: System routines that update SECMNTDAT must take care * 1279 * to ensure that the volume will always be remountable, because * 1280 * VOLNMNTDAT can't possibly match both the old and the new * 1281 * values. These routines should copy the MDVFMTDAT to the * 1282 * VOLNMNTDAT just before the security blocks are written. * 1283 * After the writes complete, the new SECMNTDAT is valid and * 1284 * should be copied into the VOLNMNTDAT. * 1285 * * 1286 * The security block may also contain the most recent * 1287 * startup dates, backup date information, and information * 1288 * regarding the useability of this volume (tables destroyed * 1289 * by mass storage errors, etc.). * 1290 * * 1291 * The security block also contains a backup key unique * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 105 (DISKDEFS) F 8 Disk Data Structures 1292 * to this system. This key is used by both backup and recovery * 1293 * routines. Since it is not available from a backup tape, * 1294 * the key must be provided by the security block of the system * 1295 * that it is being loaded on, or by the operator/manager. * 1296 * * 1297 * The security block is written into two blocks. * 1298 * The first error free read is used as the new manager * 1299 * block. In the event of a system crash between writes, * 1300 * either copy should be usable with the potential loss * 1301 * of only the last transaction. * 1302 * * 1303 * CRASH RESISTANCE * 1304 * Any entry being made in this block should relate to * 1305 * an already completed data structure. Any entry being * 1306 * removed from this block should be removed before any * 1307 * alteration of the entries data structure. * 1308 * * 1309 * MASS STORAGE ERRORS * 1310 * Pointers in volume label. May be moved, but * 1311 * the correct pointer must be placed into the volume * 1312 * label (may not use the substitution list). * 1313 * If neither security block can be read, the volume may * 1314 * not be used. Recovery must find all of the dependent * 1315 * blocks to be complete, although the entire user file * 1316 * structure will be completely recovered. * 1317 * * 1318 ********************************************************************************** 1319 000000FD ABS 1320 MAXIDXSIZE EQU 253 maximum number of blocks allowed in IDX 000000FD ABS 1321 MAXAFTSIZE EQU MAXIDXSIZE maximum number of blocks allowed in AFT 00000008 ABS 1322 SECADTNUM EQU 8 number of ADT chains 1323 1324 ********************************************************************************** 1325 * * 1326 * Hashing function for the IDX and AFT tables. * 1327 * $(1) = an available register * 1328 * $(2) = the next register, the result is left here * 1329 * $(3) = location of account name (double word) * 1330 * $(4) = location of project name * 1331 * $(5) = location of number of buckets * 1332 * * 1333 ********************************************************************************** 1334 1335 IDXHASH MACRO 1336 $L LD2 $(1) $(3) get the account name into $(1) and $(2) 1337 XOR $(2) $(1)/BITS 8:7 mix up the account number 1338 LD $(1) $(4) fetch up the project 1339 XOR $(2) $(1)/BITS 16:15 mix in the project shifted 1340 LD $(1) 0 initialize register for marth 1341 IORPSR PSRMODIF say that we want the remainder 1342 DIV $(1) $(5) divide by number of buckets 1343 CLBPSR PSRMODIF restore normalcy 1344 EMAC 1345 1346 BASE 00000000 DISP 1347 SECSUN BSS 1 bits 24:31 start up number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 106 (DISKDEFS) F 8 Disk Data Structures 00000001 DISP 1348 SECBUDATE BSS 1 date of last backup 1349 00000002 DISP 1350 SECMNTDAT BSS2 1 date of last mount 1351 BSS 4 filler 1352 00000008 DISP 1353 SECADTTOP BSS SECADTNUM pointer to beginning of ADT chains 00000010 DISP 1354 SECADTBTM BSS SECADTNUM pointer to end of ADT chains 00000018 DISP 1355 SECADTCNT BSS SECADTNUM number of free blocks in each chain 1356 BSS 8 00000028 DISP 1357 SECIDXSIZ BSS 1 number of blocks in IDX 00000029 DISP 1358 SECAFTSIZ BSS 1 number of blocks in AFT 0000002A DISP 1359 SECIDXENTS BSS 1 number of entries in IDX 0000002B DISP 1360 SECAFTENTS BSS 1 number of entries in AFT 0000002C DISP 1361 SECIDXPTR BSS MAXIDXSIZE IDX table head 00000129 DISP 1362 SECAFTPTR BSS MAXAFTSIZE AFT table head (system volume only) 1363 00000226 DISP 1364 SECTZONE BSS 1 time zone and GMT displacement if system vol. 1365 * (PDT = -7, PST = -8, etc.) 1366 BSS2 1 filler 00000229 DISP 1367 SECLASTDT BSS2 1 last known date 0000022B DISP 1368 SECLASTSL BSS2 1 date when last slept or dismounted 0000022D DISP 1369 SECDATERR BSS 1 date correction in progress (correction in MS) 0000022E DISP 1370 SECDATDRFT BSS 1 date drift of SSU clock in ppb 1371 * + indicates clock slow, - sez fast 0000022F DISP 1372 SECDATCOR BSS2 1 date of last clock correction 1373 1374 ********************************************************************************** 1375 * The following locations contain the amount of hardware * 1376 * that was on the last time that the system was booted. This * 1377 * exists so that we can notify someone when the system is * 1378 * booted with less hardware than was expected. * 1379 ********************************************************************************** 1380 00000231 DISP 1381 SECNUMMCU BSS 1 number of MCUs 00000232 DISP 1382 SECNUMPAGE BSS 1 number of pages of memory 00000233 DISP 1383 SECNUMCPU BSS 1 number of CPUs 00000234 DISP 1384 SECNUMPPU BSS 1 number of PPUs 00000235 DISP 1385 SECNUMACC BSS 1 number of comm controllers 00000236 DISP 1386 SECNUMPORT BSS 1 number of ports 00000237 DISP 1387 SECNUMMSC BSS 1 number of disk controllers 00000238 DISP 1388 SECNUMDISK BSS 1 number of disk drives 00000239 DISP 1389 SECNUMLPC BSS 1 number of LP controllers 0000023A DISP 1390 SECNUMCTC BSS 1 number of CT controllers 0000023B DISP 1391 SECNUMCTU BSS 1 number of CT drives 0000023C DISP 1392 SECNUMMTC BSS 1 number of MT controllers 0000023D DISP 1393 SECNUMMTU BSS 1 number of MT drives 0000023E DISP 1394 SECNUMVTC BSS 1 number of VT controllers 0000023F DISP 1395 SECNUMVTU BSS 1 number of VT drives 00000240 DISP 1396 SECBKUPE LABEL end of backup information 1397 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 107 (DISKDEFS) F 8 Disk Data Structures 1399 1400 ********************************************************************************** 1401 * * 1402 * AVAILABLE DISK TABLE (ADT) * 1403 * * 1404 * The ADT consists of multiple chains of ADT blocks linked * 1405 * together with both forward and backward pointers. The * 1406 * security block has pointers to the head and tail of each ADT * 1407 * chain and the total number of free blocks in each chain. The * 1408 * reason that multiple chains are provided is so that fewer * 1409 * blocks must be searched over on crash recovery and so that a * 1410 * mass storage error can not cause more than one eighth of the * 1411 * available blocks to be lost. Another possible structure that * 1412 * could have been used is that of a RAF. However, in that type * 1413 * of structure, the loss of an access block causes far too many * 1414 * blocks to be lost. In the SAF type structure used here, the * 1415 * loss of a single block means that you must search the list * 1416 * from the known beginning and can recover all space except that * 1417 * contained in the bad block. * 1418 * * 1419 * Each ADT block is a single file block with entries that * 1420 * are the MS addresses of blocks that are available. Each ADT * 1421 * block could have from 0 to about BLOCKSIZE entries in it. A * 1422 * smaller maximum (ADTECNT) is set up so that fewer blocks are * 1423 * lost if a mass storage error occurs while reading an ADT * 1424 * block. The ADT block itself is available when empty. * 1425 * Therefore, the ADT requires, in effect, no MS space. If an * 1426 * ADT block is filled, a free block is acquired and it becomes * 1427 * the new tail of the current ADT chain. In the event that the * 1428 * current chain is full, the new block becomes the first block * 1429 * in a new chain. * 1430 * * 1431 * The system maintains a table in monitor memory containing * 1432 * a VOLN ("volume name element") for each mounted volume. This * 1433 * element contains a short list of available blocks. When the * 1434 * resident list gets nearly full or nearly empty, the current * 1435 * ADT block is read in and entries (block numbers) are * 1436 * transferred as appropriate to leave the resident list near * 1437 * half-full. The ADT block must be forced out before using any * 1438 * free blocks acquired from it. * 1439 * * 1440 * When file blocks are freed, they could be inserted into * 1441 * the resident ADT list in order. This feature was removed * 1442 * because of its overhead and insignificant performance * 1443 * improvement. Blocks are inserted into the current ADT block * 1444 * in order. This keeps available space assignment more * 1445 * localized. It also provides an opportunity to check for a * 1446 * block being freed twice (in which case the system halts and * 1447 * you either fix the bug in the system or you rebuild the disk * 1448 * structure). No effort is made to sort the entire ADT, * 1449 * although it should be created in order. * 1450 * * 1451 * CRASH RESISTANCE * 1452 * During system initialization, the security block is read * 1453 * in and the head and tail pointers and free block count for the * 1454 * first non-empty ADT chain are copied. The tail pointer in the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 108 (DISKDEFS) F 8 Disk Data Structures 1455 * security block is then set to null. If the system was not * 1456 * properly terminated, the security block will contain a null * 1457 * tail pointer. In this case, the initialization routines * 1458 * search from the head down the forward links to rediscover the * 1459 * current tail of the chain and count the total number of free * 1460 * blocks available. The last legitimate ADT block in the chain * 1461 * will have either a null forward pointer or it will point to a * 1462 * block that was formerly an ADT block. In this case, the FBI * 1463 * type of the block will no longer be 'ADT' since such blocks * 1464 * are freed when emptied. * 1465 * * 1466 * It is possible that all existing ADT blocks are full when * 1467 * a block is freed. This results in an empty ADT block at the * 1468 * end of a chain. A later fetch will get that block as follows: * 1469 * The ADT block described by the tail pointer is read, its back * 1470 * pointer becomes the new tail pointer, and the block is * 1471 * overwritten. If the current chain is empty (the back pointer * 1472 * was null), then the security block is read in and the pointers * 1473 * and free block count for the next ADT chain are copied. * 1474 * * 1475 * When an ADT block fills up (has ADTECNT or more entries * 1476 * in it), a new block is added to the current ADT chain (or a * 1477 * new chain is begun if the current one is more than one eighth * 1478 * of the total volume size). To add an ADT block to the end of * 1479 * the current chain, a new block is selected (from amongst the * 1480 * free blocks in the current ADT block). The new block is given * 1481 * a null forward pointer and a backward pointer to the current * 1482 * tail block and is written to mass storage. The old tail is * 1483 * read in, given a new forward pointer to the new block, and * 1484 * rewritten. * 1485 * * 1486 * When the system is shut down, any free blocks residing * 1487 * in the resident tables must be placed onto the volume as * 1488 * described above. The security block is then read in and * 1489 * has the tail pointer and new free block count copied into it. * 1490 * * 1491 * MASS STORAGE ERRORS * 1492 * Pointers in the security block. May be substituted. If * 1493 * an error occurs while traversing the chain backwards (during * 1494 * normal use), the tail pointer is discarded and regenerated by * 1495 * a search from the chain head. If an error occurs while * 1496 * searching for the tail of an ADT chain (such as after a mass * 1497 * storage error or during initialization after a system crash), * 1498 * the bad block is treated as if it were a block beyond the end * 1499 * of the chain. If no ADT block is available, the volume has no * 1500 * remaining space and out-of-storage errors will occur. All * 1501 * data may be recovered from the volume. * 1502 * * 1503 ********************************************************************************** 1504 000000C8 ABS 1505 ADTECNT EQU 200 number of entries in each ADT block 1506 * note that ADTECNT must be less than 1507 * BLOCKSIZE to allow some work space 1508 * for the manager. 1509 1510 BASE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 109 (DISKDEFS) F 8 Disk Data Structures 00000000 DISP 1511 ADTLIST BSS ADTECNT bits 8:31 - available block number 1512 * all zero indicates list end 1513 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 110 (DISKDEFS) F 8 Disk Data Structures 1515 1516 ********************************************************************************** 1517 * * 1518 * USER INDEX (IDX) * 1519 * A table which points to each user directory on this * 1520 * volume. The table is searched by account number, and yields * 1521 * the block number of that account's user directory. * 1522 * * 1523 * This table consists of enough blocks to hold all of the * 1524 * required entries with a little space left over. The index of * 1525 * these blocks is found in the security block. A hashing * 1526 * function is applied to the account/project in order to find * 1527 * the proper first block to search. The table may not grow * 1528 * larger than 'MAXIDXSIZE'. * 1529 * * 1530 * The IDX entry contains only the account name and * 1531 * directory address, and since things are arranged so that the * 1532 * root block of a directory (UDIR1) does not move, this table * 1533 * is updated infrequently. * 1534 * * 1535 * Entries consist of the name of the account followed by * 1536 * the mass storage address (on this volume) of the directory * 1537 * (UDIR1) for that account. When searching the IDX block from * 1538 * the beginning to the end, encountering an "empty entry" * 1539 * (account name and project all zeros) sez that the rest of the * 1540 * IDX block is empty also. Since entries may overflow a block * 1541 * into the next block, and since overflow is sensed by reaching * 1542 * the end of the block without finding an empty entry, if an * 1543 * account is deleted we cannot just remove it and repack the * 1544 * IDX. Entries are deleted by writing all ones (-1) over the * 1545 * account and project. These "place holders" may be used up * 1546 * when a new account is created, but must be searched over when * 1547 * looking for an account. * 1548 * * 1549 * CRASH RESISTANCE * 1550 * When a new account is created, the user directory must * 1551 * be initialized on the volume before the IDX may point to it. * 1552 * When an account is destroyed, the account number must be * 1553 * removed from the IDX before the directory may be freed. * 1554 * * 1555 * MASS STORAGE ERRORS * 1556 * Pointers in the security block. May be moved, but the * 1557 * correct pointer must be placed in the security block (may not * 1558 * use the substitution list). If the IDX can not be read, the * 1559 * volume may not be used. Recovery must find all user * 1560 * directories and discard the freed but not desecrated * 1561 * directories in order to be complete. * 1562 * * 1563 ********************************************************************************** 1564 1565 BASE R6 00178800 6 BASE 1566 IDXACNO BSS2 1 account name 00178802 6 BASE 1567 IDXACNOP BSS 1 division-project 1568 * following word zero sez list end 00178803 6 BASE 1569 IDXDIRDA BSS 1 user directory address 00178804 6 BASE 1570 IDXDIRDA2 BSS 1 secondary directory address 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 111 (DISKDEFS) F 8 Disk Data Structures 00000005 ABS 1571 IDXLNTH EQU DISPW IDXACNO entry length 000000CC ABS 1572 IDXECNT EQU BLOCKSIZE/IDXLNTH number of entries 1573 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 112 (DISKDEFS) F 8 Disk Data Structures 1575 1576 ********************************************************************************** 1577 * * 1578 * USER LIMIT FIELD * 1579 * Here we define a small block that contains * 1580 * all information concerning an accounts limits and * 1581 * privileges. Space is reserved for this block in * 1582 * both the user directory and the resident user limit * 1583 * block (ULB). When a ULB is created, the user limit * 1584 * information is copied into the resident block and * 1585 * the ULB is the current authority. In the event of * 1586 * a system crash, the UDIR user limits are the backup. * 1587 * When a ULB is destroyed, the user limits are copied * 1588 * back to the directory. * 1589 * * 1590 ********************************************************************************** 1591 0000079C 1592 LIMITS BASE R4 00170800 4 BASE 1593 RESTRWORD BSS 1 acct restrictions (catrd, etc) 00000050 BYTE 1594 XREQRSTR EQU BITS 0:4 indicates requests that are restricted 00170801 4 BASE 1595 PRIVWORD BSS 1 privilege word (manager access) 00000040 BYTE 1596 LIMFACCESS EQU BITS 0:3 file access control 00000840 BYTE 1597 LIMPACCESS EQU BITS 4:7 password access control 1598 * EQU BITS 8:12 unused 00001A50 BYTE 1599 LIMLOGSPOT EQU BITS 13:17 where to write accounting files 1600 see FDE format note on privileges 1601 bit definitions for these fields 00003E10 BYTE 1602 LIMACSALW EQU BIT 31 always (maintenance) 00003C10 BYTE 1603 LIMACSSYS EQU BIT 30 access to system manager 00003A10 BYTE 1604 LIMACSDIV EQU BIT 29 access to division manager 00003810 BYTE 1605 LIMACSPROJ EQU BIT 28 access to project manager 00003610 BYTE 1606 LIMACSUSR EQU BIT 27 access of user (implied on) 1607 00170802 4 BASE 1608 TIMLIM BSS 1 time limit (in seconds) 00170803 4 BASE 1609 TIMUSD BSS 1 time used (in seconds) 00170804 4 BASE 1610 WLCKLIM BSS 1 wall clock limit (in minutes) 00170805 4 BASE 1611 WLCKUSD BSS 1 wall clock time used (in minutes) 00090186 4 ZBM 1612 DSKSAVL BSSB MSBLKLOG saved disk blocks limit 00093186 4 ZBM 1613 DSKWARN BSSB MSBLKLOG disk block warning limit 00092187 4 ZBM 1614 DSKLIM BSSB MSBLKLOG disk block hard limit 00091188 4 ZBM 1615 DSKUSD BSSB MSBLKLOG disk blocks used 1616 BSS 0 force a word boundary 1617 DRCT 00000009 ABS 1618 LIMITSIZE EQU DISPW LIMITS size of the limits block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 113 (DISKDEFS) F 8 Disk Data Structures 1620 1621 ********************************************************************************** 1622 * * 1623 * SHARED LISTS * 1624 * Shared lists are provided to give a list of other * 1625 * accounts which are allowed access and to indicate the * 1626 * type of access allowed. There may also be a password * 1627 * associated with the allowed access. * 1628 * Each user directory and each file directory entry * 1629 * contain a shared list. Since the most likely 'shares' * 1630 * are with no one and with only one other account, the * 1631 * share lists in directories and file directory entries * 1632 * are just long enough to hold one simple share list * 1633 * element. If the shared list is larger, either for * 1634 * a more complex element or for more than one element, * 1635 * the short shared list in the directory or FDE will be * 1636 * a pointer to a complete MS block containing the shared * 1637 * list (see its format under SHARED LIST BLOCK). * 1638 * * 1639 ********************************************************************************** 1640 1641 ********************************************************************************** 1642 * * 1643 * SHARED LIST BLOCK (SLB) * 1644 * A block containing shared list entries for a user * 1645 * directory or individual file if the list is too large * 1646 * to be kept in the short area allocated in the UDIR1 * 1647 * block or the FDE. * 1648 * * 1649 * The user directory block and the file directory entry * 1650 * have an area large enough to hold one short shared list * 1651 * entry but if more sharing than that is done, the shared list * 1652 * is put into a disk block that is pointed to by the first * 1653 * word of the entry in the UD or FDE. * 1654 * * 1655 * Shared list entries give the account shared with and the * 1656 * privileges afforded to him. They may also give a password if * 1657 * required. The privileges given by the shared list entry are: * 1658 * 1) read/write - whatever the access code is on the * 1659 * file entry itself. * 1660 * 2) read only - cannot write there upon. * 1661 * 3) modify - file access privileges and ability to change * 1662 * the access attributes. * 1663 * * 1664 * CRASH RESISTANCE * 1665 * This block may be changed in place but remember to write * 1666 * the initial block to the disk before pointing anything * 1667 * to it. * 1668 * * 1669 * MASS STORAGE ERRORS * 1670 * May be substituted. A mass storage error * 1671 * returns a "Disk Structure Error" to the * 1672 * requesting process. * 1673 * * 1674 ********************************************************************************** 1675 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 114 (DISKDEFS) F 8 Disk Data Structures 1676 1677 ********************************************************************************** 1678 * * 1679 * SHARED LIST ENTRY * 1680 * This format applies to all shared list entries. * 1681 * Note that a shared list entry in a shared list block * 1682 * (that is, in a separate block on mass storage) may * 1683 * not point to yet another shared list block. * 1684 * * 1685 ********************************************************************************** 1686 1687 BASE R3 shared list entry 0016C800 3 BASE 1688 SHLFLAGW BSS 1 this first word of a shared list entry 1689 * may either contain a block number (if the flag bit 1690 * is on) or indicate that an account number follows. 00000010 BYTE 1691 SHLDSKFLGB EQU BIT 0 one sez this SHLFLAGW contains 1692 * the MS address of the actual share list 0008C010 3 ZBM 1693 SHLDSKFLG EQU SHLFLAGW/SHLDSKFLGB 0008D180 3 ZBM 1694 SHLDISK EQU SHLFLAGW/MSBLKFIELD block number if above flag is on 0008C210 3 ZBM 1695 SHLACTPW EQU SHLFLAGW/BIT 1 if on, a password follows 0008C410 3 ZBM 1696 SHLACTSYS EQU SHLFLAGW/BIT 2 on if system specified 0008C220 3 ZBM 1697 SHLACTOPT EQU SHLFLAGW/BITS 1:2 flags for optional stuff 0008C630 3 ZBM 1698 SHLACTPRIV EQU SHLFLAGW/BITS 3:5 privilege given this acct 00000000 ABS 1699 SHLACTPRVW EQU 0 allowed file access code of FDE (FDACCESS) 00000001 ABS 1700 SHLACTPRVR EQU 1 read only access 00000002 ABS 1701 SHLACTPRVM EQU 2 file access and modify priv 00000003 ABS 1702 SHLACTPRVX EQU 3 execute only access 0008CC10 3 ZBM 1703 SHLENTRYF EQU SHLFLAGW/BIT 6 on if an entry present 0016C801 3 BASE 1704 SHLACCT BSS2 1 account that is allowed access 0016C803 3 BASE 1705 SHLACCTP BSS 1 division-project 00000004 ABS 1706 SHLENTLEN EQU DISPW SHLFLAGW length of entry 0016C804 3 BASE 1707 SHLPWORD BSS2 1 password for the privilege 00000006 ABS 1708 SHLENTPLEN EQU DISPW SHLFLAGW length if PW included 0016C806 3 BASE 1709 SHLACCTSYS BSS 1 system that account is on (-1 => this system) 00000007 ABS 1710 SHLENTSLEN EQU DISPW SHLFLAGW length if system specified 1711 DRCT 1712 00000004 ABS 1713 UDSHLSIZE EQU 4 size of share lists in directory 1714 * This is adequate for a single entry 1715 * with no password or else a pointer 1716 * to a shared list mass storage block. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 115 (DISKDEFS) F 8 Disk Data Structures 1718 1719 ********************************************************************************** 1720 * * 1721 * AUTHORIZATION LIST * 1722 * The authorization list consists of a header followed * 1723 * by a variable number of entries. * 1724 * The system manager does not need auth list entries, * 1725 * he is presumed to have authority over all system resources. * 1726 * He, however, must explicitly delegate authority to each * 1727 * manager to 1) allocate time and 2) allocate space on a * 1728 * given volume. The time allocatable and allocated is kept * 1729 * in the auth list header and the MS space allocatable and * 1730 * allocated is kept in the individual auth list entries for * 1731 * each separate volume. * 1732 * * 1733 * CRASH RESISTANCE * 1734 * This block may be changed in place but remember to write * 1735 * the initial block to the disk before pointing anything * 1736 * to it. * 1737 * * 1738 * MASS STORAGE ERRORS * 1739 * May be substituted. A mass storage error * 1740 * returns a "Disk Structure Error" to the * 1741 * requesting process. * 1742 * * 1743 ********************************************************************************** 1744 1745 BASE auth list header 00000000 DISP 1746 AUTHTIME BSS 1 seconds allocatable by account 00000001 DISP 1747 AUTHTIMEA BSS 1 allocated auth time 1748 BSS 2 room for expansion 00000004 DISP 1749 AUTHENTBG LABEL beginning of volume auth list 1750 DRCT 1751 000007B0 1752 AUTHLENTRY BASE R3 auth list entry 0016C800 3 BASE 1753 AUTHVNAME BSS2 1 room for a volume name 1754 BSS 1 unused 1755 BSS 1 unused 0016C804 3 BASE 1756 AUTHDSK BSS 1 amount of disk space allocatable 0016C805 3 BASE 1757 AUTHDSKA BSS 1 amount of disk space allocated 0016C806 3 BASE 1758 AUTHSDSK BSS 1 amount of saved disk space allocatable 0016C807 3 BASE 1759 AUTHSDSKA BSS 1 amount of saved disk space allocated 1760 BSS 4 room for expansion 1761 DRCT 0000000C ABS 1762 AUTHLELEN EQU DISPW AUTHLENTRY 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 116 (DISKDEFS) F 8 Disk Data Structures 1764 1765 ********************************************************************************** 1766 * * 1767 * FILE DIRECTORY ENTRY (FDE) * 1768 * Each FDE represents one file. These entries may * 1769 * appear only in user directories. They appear in the * 1770 * index area of a UDIR1 for a small directory, and they * 1771 * appear in UDIR2 blocks for large directories. * 1772 * * 1773 ********************************************************************************** 1774 000007BC 1775 FDEPROT BASE R3 0016C800 3 BASE 1776 FDSTART BSS 0 account number (implicit!) 1777 * The following thing is here to make the first word of 1778 * a used file directory entry non-zero. 0016C000 3 CACH 1779 FDSUN BSSB 8 SUN to validate use counts 0008D040 3 ZBM 1780 FDACSLK BSSB 4 access lock bits - unused 1781 * controls who may change acct privileges 1782 * EQU BIT 31 access locked by maintenance 1783 * EQU BIT 30 access locked by owner (MANAGER.SYS) 1784 * EQU BIT 29 access locked by division (MANAGER.ddd) 1785 * EQU BIT 28 access locked by project (MANAGER.dddppp) 0008D830 3 ZBM 1786 FDPRIV BSSB 3 privilege allowed to this file 00000000 ABS 1787 FDACSRW EQU 0 read/write 00000001 ABS 1788 FDACSRO EQU 1 read only 00000002 ABS 1789 FDACSAO EQU 2 append only 00000003 ABS 1790 FDACSXO EQU 3 execute only 00000004 ABS 1791 FDACSMW EQU 4 multiple write allowed 00003E10 BYTE 1792 FDACSNWB EQU BIT 31 if one, no write allowed 0008DE10 3 ZBM 1793 FDFBD BSSB 1 file being destroyed bit 0008E010 3 ZBM 1794 FDNBU BSSB 1 no backup flag 0008E210 3 ZBM 1795 FDRFB BSSB 1 indicates recovered from backup 0008E410 3 ZBM 1796 FDPURG BSSB 1 indicates this file purged 1797 * if purged, other fields indicate 1798 * where to find the actual file. 0008E610 3 ZBM 1799 FDFWWSC BSSB 1 1 sez file equipped for write when system crashed 0008E810 3 ZBM 1800 FDLRAF BSSB 1 a one sez a large .RAF (see note) 0008EA60 3 ZBM 1801 FDET BSSB 6 entry type and access control 1802 * entry types for all equipable units are defined here. 1803 * code entry type (* sez may be directory entry) 00000001 ABS 1804 HTYPESAF EQU 1 SAF * 00000002 ABS 1805 HTYPERAF EQU 2 RAF * 00000003 ABS 1806 HTYPECODE EQU 3 code file * 00000004 ABS 1807 HTYPEPATH EQU 4 communication path * 00000005 ABS 1808 HTYPEDIR EQU 5 directory 00000006 ABS 1809 HTYPENULL EQU 6 output eater 00000007 ABS 1810 HTYPETERM EQU 7 interactive terminal * 1811 * EQU 8 unused (was lock) * 00000009 ABS 1812 HTYPETASK EQU 9 a 'batch' job submission unit 0000000A ABS 1813 HTYPECDR EQU 10 a card reader 0000000B ABS 1814 HTYPELP EQU 11 a line printer 0000000C ABS 1815 HTYPEMT EQU 12 magnetic tape * 0000000D ABS 1816 HTYPECT EQU 13 cartridge magnetic tape * 0000000E ABS 1817 HTYPEVOL EQU 14 a volume 0000000F ABS 1818 HTYPEVT EQU 15 video tape * 00000010 ABS 1819 HTYPELAST EQU 16 after last HTYPE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 117 (DISKDEFS) F 8 Disk Data Structures 1820 0008F610 3 ZBM 1821 FDGHOST BSSB 1 file is a ghost (not yet recovered from backup) 0008F810 3 ZBM 1822 FDTRANS BSSB 1 file opened when user program crashed 0008FA10 3 ZBM 1823 FDFLOG BSSB 1 log file access when set 0008FC20 3 ZBM 1824 FDRAFTYPE BSSB 2 type of RAF file we have (see note) 00000000 ABS 1825 RAFTEMPTY EQU 0 00000001 ABS 1826 RAFTTINY EQU 1 00000002 ABS 1827 RAFTSMALL EQU 2 00000003 ABS 1828 RAFTLARGE EQU 3 1829 0008C101 3 ZBM 1830 FDCUSE BSSB 16 current use count 1831 BSSB 16 filler 0016C802 3 BASE 1832 FDNAME BSS2 1 file name - RAD40 0016C804 3 BASE 1833 FDEXTEN BSS 1 filename extension 1834 BSSB 32-MSBLKLOG filler to right justify MS address 0008D185 3 ZBM 1835 FDDA BSSB MSBLKLOG block number of the file head 0016C018 3 CACH 1836 FDPURGE BSSB 8 purge interval 0000005A ABS 1837 PURGESDV EQU 90 system default value - purge interval 0008D186 3 ZBM 1838 FDLEN BSSB MSBLKLOG file length 1839 * file lengths are only for accounting. 1840 * actual length determined by the structure 0016C807 3 BASE 1841 FDLCD BSS 1 last changed date 0016C808 3 BASE 1842 FDLACC BSS 1 last accessed date 0016C809 3 BASE 1843 FDLBU BSS 1 last backup date 0016C80A 3 BASE 1844 FDSERNO BSS2 1 file serial number 1845 * FDSERNO(0) device type code for hardware devices 1846 * FDSERNO(1) unit # for hardware devices 0016C80C 3 BASE 1847 FDACCESSES BSS 0 label for following 3 fields taken collectively 0008C10C 3 ZBM 1848 FDRACS BSSB 16 read current access count 0008E01C 3 ZBM 1849 FDWACS BSSB 1 write current access count 0008E2FC 3 ZBM 1850 FDMWACS BSSB 15 multiple write current access count 0008C10D 3 ZBM 1851 FDRUSE BSSB 16 total read use count 0008E10D 3 ZBM 1852 FDWUSE BSSB 16 total write use count 0016C80E 3 BASE 1853 FDUSRFLD BSS 1 user defined field 0016C80F 3 BASE 1854 FDCREDAT BSS 1 creation date 0016C810 3 BASE 1855 FDEPP BSS 1 file end byte position pointer 0016C811 3 BASE 1856 FDEND BSS 1 disk block for end of file 1857 BSS 24-UDSHLSIZE-(DISPW FDSTART) push shared list to end 0016C814 3 BASE 1858 FDSHL BSS UDSHLSIZE file directory entry share list 1859 DRCT 00000018 ABS 1860 FDLNTH EQU DISPW FDEPROT length of a directory entry 1861 1862 ********************************************************************************** 1863 * * 1864 * FILE DIRECTORY ENTRY * 1865 * * 1866 * CURRENT USE COUNTS * 1867 * File current use counts are stored in the directory * 1868 * entry for a file. These use counts are valid only if the * 1869 * SUN stored in the file directory entry is the same as the * 1870 * current SUN. A difference here indicates that the use * 1871 * counts are left over from a previous access during which * 1872 * the system crashed. * 1873 * * 1874 * When a user equips a file with a non-current SUN * 1875 * and a non-zero current write access count, the FWWSC * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 118 (DISKDEFS) F 8 Disk Data Structures 1876 * bit is set indicating that the file was equipped for * 1877 * writing at the time of a system crash. This is to give * 1878 * the user an opportunity to recover as he sees fit. * 1879 * When a user equips a file with a non-current SUN, the * 1880 * use counts are set to zero plus this new access and * 1881 * the SUN is set current. * 1882 * * 1883 * False file use counts are possible only if the * 1884 * system was restarted 255 times without a reference to * 1885 * a given file. These false use counts are inconvenient * 1886 * but fail-safe. * 1887 * * 1888 * FILE BEING DESTROYED * 1889 * A file busy for read or write may not be deleted * 1890 * directly. However, a process with modify privilege may * 1891 * discard a file at any time by setting the 'file being * 1892 * destroyed' bit. The file will then be deleted when the * 1893 * last user unequips it and its use count becomes zero. * 1894 * * 1895 * A exchange save creates the same condition if the * 1896 * saved file is busy: the old entry may be left to control * 1897 * the file being destroyed and a new entry (with the same * 1898 * name) is created for the new file. * 1899 * * 1900 * RAF type (FDLRAF and FDRAFTYPE fields) * 1901 * The original system implemented only two types of * 1902 * RAFs... 'small', including a single minor index block which * 1903 * points directly to data blocks, and 'large', having a major * 1904 * access block which points to WPP minor index blocks. * 1905 * A disk type revision implemented two new RAF types... * 1906 * 'tiny', with only one data block, and 'empty', with no data * 1907 * blocks. Rather than force a major conversion effort, the * 1908 * entries may be of either type on the more recent format * 1909 * disk. (The format is updated to prevent old systems from * 1910 * getting and attempting to use new format entries). * 1911 * The conversion of a directory entry is as follows: * 1912 * Check the new type field (FDRAFTYPE) for zero ('empty'). * 1913 * If it is not, the conversion is already done. If the * 1914 * FDRAFTYPE field is zero, verify that the file is indeed * 1915 * empty by checking FDDA. If it is non-zero, then a * 1916 * conversion is needed. Check (and clear) the old FDLRAF * 1917 * field. If it was a zero, set FDRAFTYPE to 'small', else * 1918 * 'large'. * 1919 * * 1920 * MULTIPLE ACCESS * 1921 * Whenever a file is equipped to, FDCACS (current access * 1922 * count) is incremented for each access to the file. If the * 1923 * equip is for read-only (ie, the accessor is requesting only * 1924 * read access to the data), then FDRACS is incremented. If * 1925 * the equip is for read/write, FDWACS is incremented. If the * 1926 * access is for multiple write, FDMWACS is incremented. If * 1927 * the equip is for "no data access" (ie, the accessor requests * 1928 * no access to the data), then neither RACS, WACS or MWACS is * 1929 * incremented, thus busying the file but not disallowing access * 1930 * to the data in the file. * 1931 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 119 (DISKDEFS) F 8 Disk Data Structures 1932 * Sequential files may not be open for write and any * 1933 * other data access simultaneously. * 1934 * * 1935 * RAFs may be open for general write access by no more than * 1936 * one user at a time. RAFs may be open for write by many users * 1937 * with 'multiple write' privilege. At one time, only large RAFs * 1938 * could be open multiple write. However, the implementation of * 1939 * global file control blocks in the system allows any RAF to be * 1940 * open multiple write. * 1941 * * 1942 * Pages cannot be deleted from a RAF that is open multiple * 1943 * write. * 1944 * * 1945 * Code files follow the same rules as for RAFs except * 1946 * that multiple write access is not allowed. Therefore, if * 1947 * users are executing a code file, the pages that they are * 1948 * executing from may not be altered by the owner. * 1949 * * 1950 * FILE SERIAL NUMBERS * 1951 * Every file created by the system is given a unique number * 1952 * to identify the file even if it is renamed by the user. The * 1953 * number, although given 64 bits, is actually the system's 44 bit * 1954 * millisecond clock when the file was first created. The * 1955 * millisecond clock in memory (not the actual system clock) is * 1956 * incremented after each fetch of a file serial number so that * 1957 * duplicate numbers are not given out. * 1958 * Serial numbers are specially coded if the file corresponds * 1959 * to a real hardware device. In this case, the upper 32 bits of * 1960 * the file serial number denote the hardware type of the device, * 1961 * and the lower 32 bits denote the particular device unit number. * 1962 * In particular, saved terminals use the port number as the lower * 1963 * 32 bits. This is so that a device controller may search for an * 1964 * entry without knowing its name and so that devices that are not * 1965 * assigned via the saved files may interface with same. * 1966 * * 1967 * PURGE * 1968 * Purge intervals are set to the system default value * 1969 * (90 days) when a file is created. They may be altered by * 1970 * command. Files with longer purge intervals might be more * 1971 * expensive. * 1972 * * 1973 * The file becomes subject to purge if the time since * 1974 * last access exceeds the purge interval. A purge interval of * 1975 * zero indicates never purge. * 1976 * * 1977 * The system manager is provided with a variation of * 1978 * the backup routine called PURGE which backs up all files * 1979 * subject to purge and deletes them from the volume. The * 1980 * file directory entry might remain to indicate the disposition * 1981 * of the file. * 1982 * * 1983 * The alternative of automatically doing PURGE with every * 1984 * backup was rejected because: * 1985 * 1.) it may be totally unnecessary (more than adequate * 1986 * space remains on mass storage) * 1987 * 2.) all backup tapes must be saved indefinitely * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 120 (DISKDEFS) F 8 Disk Data Structures 1988 * * 1989 * Regardless of whether or not the operator uses purge, if * 1990 * the user desires, he should be notified of files that are * 1991 * subject to purge. This may be done by the hello program or * 1992 * by a periodic billing program. Also, catalogs should have * 1993 * files which are subject to purge marked in some manner. * 1994 * * 1995 * Files already purged are marked in catalogs. They * 1996 * are billable against the user at a flat fee each to prevent * 1997 * their proliferation. They may be killed at any time * 1998 * without reference to the backup tape. * 1999 * * 2000 * Purge intervals shorter than a week could be treated * 2001 * as if they were temporary files. When they exceed their * 2002 * purge interval, the next backup deletes them. This * 2003 * feature is not implemented in the current backup system. * 2004 * * 2005 * SHARED LIST * 2006 * The shared account list pointer is originally null, * 2007 * indicating shared with no one. It may point to a file block * 2008 * containing a list of authorized users and the access * 2009 * privileges that they are allowed. * 2010 * * 2011 * In addition, the file block may contain a password * 2012 * that must be matched by a process before it is granted * 2013 * access. * 2014 * * 2015 * MISC. * 2016 * The UDPRIORITY field is provided for use by the * 2017 * scheduler in setting user priorities. There is currently * 2018 * no function to set this field, but the value found in it * 2019 * (it may be set with PEEK&POKE) is actually used by the * 2020 * scheduler to modify its treatment of a user process. * 2021 * * 2022 * MANAGER PRIVILEGES * 2023 * Two fields are provided in the UD to control access * 2024 * by manager accounts. These fields are "manager file * 2025 * access" and "manager password access". When an account is * 2026 * created, these bits are set according to the MGR program * 2027 * defaults. These bits may only be set by the user and may * 2028 * only be cleared by the appropriate manager account. * 2029 * * 2030 * The manager file access bit when set allows the * 2031 * manager account modify privilege over the user's * 2032 * directory and files. This bit is normally set by a user * 2033 * when he has gotten himself into a hole (forgetting a file * 2034 * password, etc) and requires someone to set things right. * 2035 * With this bit on, a manager account may equip and modify * 2036 * any file on the user's account without supplying * 2037 * passwords. * 2038 * * 2039 * The manager password access bit allows the manager * 2040 * account to alter the logon password of the account, the * 2041 * FAC bit, the default restrictions, and the accounting * 2042 * control field. * 2043 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 121 (DISKDEFS) F 8 Disk Data Structures 2044 * On some systems, the managers may wish to have the * 2045 * privilege of free access to their underlings directorys * 2046 * and passwords in which case the account creation default * 2047 * may be changed to create the accounts with these manager * 2048 * access bits set. * 2049 * * 2050 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 122 (DISKDEFS) F 8 Disk Data Structures 2052 2053 ********************************************************************************** 2054 * * 2055 * USER DIRECTORY (UDIR) * 2056 * * 2057 * This table is the repository for all system * 2058 * knowledge of an account and its privileges. The first * 2059 * 96 words of the primary directory block are reserved * 2060 * for all information other than the file directory. * 2061 * * 2062 * The first block of the UDIR has 928 words available * 2063 * for file directory use. If the entire file directory can * 2064 * fit into this space, it is so stored. The capacity of * 2065 * this type of directory is 38 entries (928/24). * 2066 * * 2067 * When the file directory overflows this space, a new * 2068 * block is acquired, and the current file directory * 2069 * written to it. The 928 words in the primary block is used * 2070 * as an index to this block (and other blocks added later) * 2071 * similar to a RAF minor access block. Each pointer requires * 2072 * 5 words, one for a block number and count of the number of * 2073 * entries in that block, one for a secondary UDIR mass * 2074 * storage address, and three to hold the name and extension * 2075 * of the first entry in that block. The directory may have * 2076 * up to 185 (928/5) pointers to secondary blocks. * 2077 * * 2078 * When deletions occur, the deleting routine checks the * 2079 * size of the adjacent blocks to see if two can be combined. * 2080 * The test for recombination must have sufficient hysteresis * 2081 * to prevent thrashing with alternating deletions and * 2082 * insertions. Currently, the combined block must be no more * 2083 * than 2/3 full (a total of 28 entries prevents combining). * 2084 * * 2085 * Each secondary UDIR block is capable of holding * 2086 * 42 entries (1024/24). * 2087 * * 2088 * The ultimate capacity of this directory structure is * 2089 * 7770 entries (185*42). However, this directory structure * 2090 * can not be reliably filled to capacity. This is because * 2091 * after all secondary blocks are assigned, the next addition * 2092 * may need to go in a block that is completely full, even * 2093 * though many other blocks are only partially filled. The * 2094 * usable directory capacity depends upon the amount of * 2095 * hysteresis in the recombining algorithm, but in any event * 2096 * is under one half of the filled capacity. We will assume * 2097 * that 2500 entries are possible, based on the current * 2098 * recombining algorithm (best calculations seem to indicate * 2099 * that 2592 will always fit). * 2100 * * 2101 * This structure requires that the file directory be * 2102 * ordered by filename (a hashing function could have been * 2103 * used, but this was an effective and more useful method). * 2104 * A full catalog may print the directory as is (in name * 2105 * order). Catalog options are provided for partial catalogs * 2106 * such as only items saved since , only items * 2107 * accessed since , or the most recently saved * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 123 (DISKDEFS) F 8 Disk Data Structures 2108 * (accessed) items. The catalog may also be sorted so * 2109 * as to print in other than name order. * 2110 * * 2111 * The primary directory blocks never move. This allows * 2112 * the account finder table to contain the volume number and * 2113 * directory address of each account. * 2114 * * 2115 * CRASH RESISTANCE * 2116 * See IDX. When this table is set up to point to * 2117 * other blocks (such as a shared account list), those * 2118 * blocks must be written to the volume first and freed * 2119 * last. * 2120 * * 2121 * When the UDIR initially expands to two * 2122 * blocks (primary block and one secondary block), the new * 2123 * secondary block is created and written out, then the * 2124 * new format directory (now containing pointers to the * 2125 * secondary blocks) is written into the old position. * 2126 * * 2127 * If a secondary directory block overflows, it should * 2128 * be evenly divided between two new blocks, the updated * 2129 * primary directory block written out, and the original * 2130 * (overflowing) secondary directory block then freed. * 2131 * * 2132 * When two secondary blocks are to be combined, a third * 2133 * block is acquired and receives the information from the * 2134 * blocks being combined. The primary directory block is then * 2135 * updated and the two original blocks are freed. * 2136 * * 2137 * FILE DIRECTORY ENTRIES * 2138 * .SAF .RAF .CODE * 2139 * The original directory entry may be made with null * 2140 * pointers. When an initial block is assigned, its address * 2141 * may be entered into the file directory immediately because * 2142 * its FBI indicates that it is a free block until * 2143 * the initializing write has occurred. * 2144 * * 2145 * Any other blocks referenced by a file directory * 2146 * entry (share list for example) should be in place on the * 2147 * volume before the file directory entry or update is made. * 2148 * * 2149 * MASS STORAGE ERRORS * 2150 * Pointers to the primary UDIR block are in the IDX * 2151 * and AFT. Pointers to secondary UDIR blocks are in the * 2152 * primary UDIR. May be substituted. This user will get * 2153 * DSE status on any request referencing an unavailable * 2154 * block. Recovery must find all of the dependent items * 2155 * (files, share lists, etc.) in order to rebuild the * 2156 * defective block. The appropriate manager may be required * 2157 * to re-establish limits, authorities, and passwords. * 2158 * * 2159 ********************************************************************************** 2160 2161 BASE 00000000 DISP 2162 UD LABEL 00000000 DISP 2163 UDACCT BSS2 1 account name 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 124 (DISKDEFS) F 8 Disk Data Structures 00000002 DISP 2164 UDPROJ BSS 1 division-project 00000003 DISP 2165 UDPASS BSS2 1 logon password 2166 BSS 5 filler 2167 0000000A DISP 2168 UDWORDB BSS 1 0008001A 0 ZBM 2169 UDTYPE EQU R0,UDWORDB/BIT 0 0 => complete file directory 2170 * 1 => index to file directory 0000000B DISP 2171 UDHPRAC BSS2 1 hello program account name 0000000D DISP 2172 UDHPRACP BSS 1 hello program account division-project 0000000E DISP 2173 UDHPRACPW BSS2 1 hello program account password 00000010 DISP 2174 UDHPR BSS2 1 hello program name 00000012 DISP 2175 UDHPREXT BSS 1 hello program extension 00000013 DISP 2176 UDHPRPW BSS2 1 hello program password 00000015 DISP 2177 UDBYEAC BSS2 1 bye program account name 00000017 DISP 2178 UDBYEACP BSS 1 bye program account division-project 00000018 DISP 2179 UDBYEACPW BSS2 1 bye program account password 0000001A DISP 2180 UDBYE BSS2 1 bye program name 0000001C DISP 2181 UDBYEEXT BSS 1 bye program extension 0000001D DISP 2182 UDBYEPW BSS2 1 bye program password 0000001F DISP 2183 UDSFLAGS BSS 1 subsystem control flags 2184 * e.g. system is BASIC only. subsystems 2185 * may test these to control prompts, etc. 00000010 BYTE 2186 UDENCRFLG EQU BIT 0 flag sez to encrypt account info on backup 00000020 DISP 2187 UDSERNO BSS2 1 account serial number 2188 BSS 7 filler 00000029 DISP 2189 UDPRIORITY BSS 1 priority for this account 0000002A DISP 2190 UDPRIVS BSS 1 privileges 2191 2192 * The limit block for an account is kept in 2193 * main memory as long as a user is logged onto that 2194 * account or a file on that account is equipped. 2195 * Only one limit block for each account is kept 2196 * at any time: all users will point to the same block. 2197 0000002B DISP 2198 UDLIMITS LABEL beginning of the limit block 2199 BSS LIMITSIZE user limit info - see previous definitions 2200 BSS 011-LIMITSIZE room to expand user limit information 2201 0000003C DISP 2202 UDSHLLIST BSS UDSHLSIZE directory share list 00000040 DISP 2203 UDAUTHLIST BSS 1 ptr to auth list, 0 if none 00000048 ABS 2204 UDTITLEL EQU 72 length of account title in chars 2205 BSS 96-UDTITLEL/CPW-DISPW UD allow fixed size for UD 0000004E DISP 2206 UDTITLE BSS UDTITLEL/CPW 72 chars for account title (trailing nulls) 00000060 DISP 2207 UDFDLIST LABEL beginning of file directory 2208 DRCT 2209 000003A0 ABS 2210 UDFDSIZE EQU BLOCKSIZE-(UDFDLIST DISPW UD) size of FD 00000026 ABS 2211 UDFDECNT EQU UDFDSIZE/FDLNTH number of FD entries 0000002A ABS 2212 UD2FDECNT EQU WPP/FDLNTH number of entries in UDIR2 2213 2214 ********************************************************************************** 2215 * This symbol is used by the directory searching * 2216 * routines to detect when they have reached the end of * 2217 * the valid information area in a block. It points to * 2218 * the last possible place where a file directory entry * 2219 * may start (an entry starting later would not be * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 125 (DISKDEFS) F 8 Disk Data Structures 2220 * entirely within the block). * 2221 ********************************************************************************** 2222 000003E8 ABS 2223 UDLFDE EQU BLOCKSIZE-FDLNTH last possible entry location 2224 2225 ********************************************************************************** 2226 * These symbols are used by the directory modifying * 2227 * routines for the ends of the valid areas in a block. * 2228 * They point to the first word of the last possible entry * 2229 * in a block of the type indicated. * 2230 ********************************************************************************** 2231 2232 * This symbol points to the first word of the last possible 2233 * file directory element in a small directory UDIR1 000003D8 ABS 2234 UD1LFDE EQU UDFDLIST+(UDFDECNT-1)*FDLNTH 2235 2236 * This symbol points to the first word of the last possible 2237 * file directory element in a large directory UDIR2 000003D8 ABS 2238 UD2LFDE EQU UD+(UD2FDECNT-1)*FDLNTH 2239 2240 * Entries in UDIR1 for an indexed directory 2241 00000834 2242 UDINDXPROT BASE R3 0016C800 3 BASE 2243 UDINDXNAM BSS2 1 name of first entry in pointed block 0016C802 3 BASE 2244 UDINDXEXT BSS 1 extension of first entry 0016C803 3 BASE 2245 UDINDXDAW BSS 0 whole word for count and MS address 0016C00C 3 CACH 2246 UDINDXNUM BSSB 8 number of entries in pointed block 0008D183 3 ZBM 2247 UDINDXADR BSSB MSBLKLOG MS address of directory block 0016C804 3 BASE 2248 UDINDXDA2 BSS 1 MS address of secondary UDIR block 2249 DRCT 2250 00000005 ABS 2251 UDINDXLEN EQU DISPW UDINDXPROT length of entry in index 000000B9 ABS 2252 UDINDCNT EQU UDFDSIZE/UDINDXLEN number of pointers in UDIR1 2253 2254 * This symbol points to the first word of the last possible 2255 * index entry in a large directory UDIR1 block 000003F8 ABS 2256 UD1LINDX EQU UDFDLIST+(UDINDCNT-1)*UDINDXLEN 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 126 (DISKDEFS) F 8 Disk Data Structures 2258 2259 ********************************************************************************** 2260 * * 2261 * SEQUENTIAL ACCESS FILE STRUCTURE (.SAF) * 2262 * Each file block contains the FBI information * 2263 * with the forward pointer pointing to the following file * 2264 * block, and the backward pointer pointing to the * 2265 * preceding file block. The forward pointer of the last * 2266 * file block and the backward pointer of the first file * 2267 * block are null (zeros). * 2268 * * 2269 * The data bytes in the file blocks may be considered * 2270 * as a continuous space. Within this space are stored * 2271 * records, file marks, and an end of data indicator. * 2272 * * 2273 * A record consists of a 3 byte type and length indicator * 2274 * (forward length), the N bytes of data, and a repeat of the * 2275 * type and length indicator (backward length). The type bits * 2276 * contain information about the recording mode of the record * 2277 * and mark it as a record. * 2278 * * 2279 * A file mark consists of a 3 byte type indicator * 2280 * reserved for this purpose. (it is 3 bytes long so that * 2281 * backspace works) * 2282 * * 2283 * Each file contains one end of data indicator (EOD). * 2284 * A 1 byte type indicator is reserved for the normal EOD. * 2285 * Any unrecognizable type indicator is treated as an abnormal * 2286 * EOD. * 2287 * * 2288 * Also treated as abnormal EOD are the following conditions: * 2289 * 1.) back pointer in subsequent file block incorrect * 2290 * 2.) other FBI information obviously wrong (although * 2291 * this may not be exhaustively examined) * 2292 * 3.) a records forward length and backward length are * 2293 * different * 2294 * * 2295 * Some or all of a garbage record may be transmitted * 2296 * to the users buffer on a read request but he is given * 2297 * the abnormal EOD status (the user can not retrieve data * 2298 * belonging to other users because all such data is * 2299 * overwritten before the space is returned to the ADT). * 2300 * * 2301 * When a user is updating an entire file, such as an * 2302 * edit file, the preferred method is to write the new file * 2303 * onto a scratch file and switch the data pointers into * 2304 * the directory using the XREQ supplied for this purpose. * 2305 * (the critical updating of the directory is done in one * 2306 * mass storage transfer and is crashproof with respect to * 2307 * the user's data) * 2308 * * 2309 * Writes onto the end of a file are accomplished as follows: * 2310 * 1.) bring the last file block into a buffer * 2311 * 2.) serially place the new record and EOD into the * 2312 * buffer * 2313 * 3.) if the block is filled, request a new file block, * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 127 (DISKDEFS) F 8 Disk Data Structures 2314 * place the new forward pointer into the current * 2315 * block and write it out. Generate the FBI * 2316 * for the new block and continue filling. * 2317 * * 2318 * When a user writes onto a file at other than the end, the * 2319 * block containing the current position pointer is retained, * 2320 * but subsequent file blocks are freed. The write then * 2321 * takes place from the current position pointer into new * 2322 * file blocks if required. (the freeing may not take place * 2323 * until the current block is written with its new forward * 2324 * pointer) * 2325 * * 2326 * CRASH RESISTANCE * 2327 * Because unused space contains EOD's in the data and * 2328 * FBI areas, new blocks may be linked into a file before * 2329 * they have been written to the volume. * 2330 * * 2331 * MASS STORAGE ERRORS * 2332 * May be substituted. User requests will get * 2333 * abnormal/unavailable (A/U) status. Recovery may * 2334 * be able to retrieve the part of the file that occupies * 2335 * readable blocks. Blocks that have been unlinked from * 2336 * this file but not yet freed will create a problem * 2337 * during recovery. * 2338 * * 2339 ********************************************************************************** 2340 2341 * format of the type and length indicators 2342 00001040 BYTE 2343 FILTYPE BITS 8:11 type field 00000000 ABS 2344 RTYPETEXT EQU 0 text record 00000001 ABS 2345 RTYPETEXTF EQU 1 text with forms control 00000002 ABS 2346 RTYPEBIN EQU 2 binary 00000003 ABS 2347 RTYPEFORM EQU 3 forms record 00000004 ABS 2348 RTYPELABEL EQU 4 label record 00000005 ABS 2349 RTYPECOMM EQU 5 comment record 00001B30 BYTE 2350 FILRLEN BITS 13:31 character count of record 2351 * if FILSFLAGB = 1 then the type indicator is a file 2352 * mark or an end-of-data. File marks are three bytes 2353 * long and end-of-data marks are a single byte. 2354 * the bits in the type field are then defined as: 00003E10 BYTE 2355 FILEODB EQU BIT 31 end of data (file mark if zero) 00003C10 BYTE 2356 FILAEODB EQU BIT 30 abnormal EOD 00003A10 BYTE 2357 FILREODB EQU BIT 29 EOD read (not part of file, status to 2358 * user, indicates EOD read already) 00003810 BYTE 2359 FILSFLAGB EQU BIT 28 bit sez system record type 00000008 ABS 2360 FILEOF EQU 1*FILSFLAGB a file mark byte 00000009 ABS 2361 FILNEOD EQU 1*FILSFLAGB+1*FILEODB 0000000B ABS 2362 FILAEOD EQU 1*FILSFLAGB+1*FILEODB+1*FILAEODB 2363 00000140 BYTE 2364 SAFBLKNUM EQU PGNUMFLD contains current block number 000028C0 BYTE 2365 SAFCHARNUM EQU BYTEDISP current byte in current block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 128 (DISKDEFS) F 8 Disk Data Structures 2367 2368 ********************************************************************************** 2369 * * 2370 * RANDOM ACCESS FILE STRUCTURE (.RAF) * 2371 * * 2372 * A RAF is an indexed file that provides a user with * 2373 * an addressable string of bytes. They are accessed by a * 2374 * seek to a specified byte location and a read or write of * 2375 * N bytes from there. * 2376 * * 2377 * Blocks not initialized by a user process are not * 2378 * allocated any MS space. Any minor access block may have * 2379 * a null (zeros) pointer indicating a non-existent data * 2380 * block. Reads from uninitialized space return all zero * 2381 * bits. Consequently, a write into a new block initializes * 2382 * that block to zeros to assure that all accesses to * 2383 * uninitialized space return zeros. * 2384 * * 2385 * When a RAF is initially created no blocks are allocated * 2386 * for it. If the first write to the RAF is within the address * 2387 * range of the first data block then only a data block is allocated * 2388 * for the RAF. When a write occurs outside of this block a * 2389 * minor access block is created and if necessary a major access * 2390 * block. * 2391 * * 2392 * The FDE for a RAF will point to either the data block * 2393 * (tiny RAF), the minor access block (small RAF), or the major * 2394 * access block (large RAF). It can also be zero indicating * 2395 * that there are no blocks yet associated with the RAF. There * 2396 * are 2 bits in the FDE to indicate what type of block the * 2397 * root block is. If FDLRAF is set then the root block of * 2398 * the RAF is a major access block. If FDTRAF is set then the * 2399 * first block of the RAF is a data block. Otherwise the root * 2400 * block is a minor access block. * 2401 * * 2402 * A RAF major access block contains the FBI and a list of * 2403 * pointers to minor access blocks. A zero pointer indicates an * 2404 * uninitialized region of the file. The forward and backward * 2405 * links and the relative block number in the FBI are always zero. * 2406 * * 2407 * Each minor access block contains the FBI and a list * 2408 * of pointers to the RAF data area blocks. A zero pointer * 2409 * indicates an uninitialized region of the file. The data * 2410 * area in the data block is all reserved for user data. The * 2411 * forward and backward pointers of the data blocks FBI are * 2412 * null. This is to avoid any inconsistent conditions due to * 2413 * crashes during the addition or deletion of a new data * 2414 * block. * 2415 * * 2416 * A RAF may be opened with multiple-write access. This * 2417 * means that the file may be opened by several processes * 2418 * intending to alter the file. These processes must assume * 2419 * responsibility for the proper interlocking of their * 2420 * transactions to assure data integrity. However, the * 2421 * system does not abdicate its responsibility for the file * 2422 * structure. In order to control the integrity of the file * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 129 (DISKDEFS) F 8 Disk Data Structures 2423 * structure, several restrictions are necessary. The RAF * 2424 * must be a large RAF (small RAFs are made into large RAFs * 2425 * if they are opened multiple-write). Data blocks may not * 2426 * be removed from a RAF while it is opened multiple-write. * 2427 * * 2428 * In order to protect the users, when a RAF is currently * 2429 * opened for multiple-write by any user, each and every * 2430 * other user of the file must also open it for multiple-write. * 2431 * It is expected that each 'record' in a RAF will be interlocked * 2432 * by a small field in that record. * 2433 * * 2434 * In order to allow record oriented data to be stored in a * 2435 * RAF, a set of XREQs are provided for a special form of access * 2436 * called 'sequential'. When an SWRITE is performed, the write * 2437 * starts at the current position in the file and continues for * 2438 * the specified number of characters, then a LF is added onto the * 2439 * end of the record. The current position is set to the next * 2440 * character position beyond where the LF was written. The end * 2441 * position pointer is set to the maximum of the end position * 2442 * pointer and the current position. * 2443 * * 2444 * An SREAD from a RAF starts at the current position and * 2445 * continues until a LF is encountered or the end position is * 2446 * encountered. The current position is left pointing to the * 2447 * character position beyond the terminating LF (or is set equal * 2448 * to the end position pointer. * 2449 * * 2450 * CRASH RESISTANCE * 2451 * The block number of a major access block may be * 2452 * entered into the file directory before the major access * 2453 * block is written to the volume. This is because the * 2454 * FBI will stop any use of the file. However, as each * 2455 * minor access block (or data block) is created, it must * 2456 * be written to the volume before its address may be * 2457 * entered into the major access block (or minor access * 2458 * block). Major access blocks, minor access blocks, and * 2459 * data blocks may all be updated in place. * 2460 * * 2461 * MASS STORAGE ERRORS * 2462 * See the mass storage error section for files. * 2463 * * 2464 ********************************************************************************** 2465 000000A0 BYTE 2466 RAFMAJINDX EQU PGNUMFLDMAJ determines which minor access block 2467 to retrieve from the major access block 000014A0 BYTE 2468 RAFMININDX EQU PGNUMFLDMIN determines which data block to 2469 retrieve from the minor access block 000028C0 BYTE 2470 RAFCHARIDX EQU BYTEDISP determines the character position within 2471 the data block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 130 (DISKDEFS) F 8 Disk Data Structures 2473 2474 ********************************************************************************** 2475 * * 2476 * CODE FILES (.CODE) * 2477 * Code files consist of a code control block (CCB) and * 2478 * file blocks containing page images. The FDE specifies * 2479 * the CCB block address. Each word in the CCB (below * 2480 * CCBMAXPAGE) controls a block of the file. A zero word * 2481 * indicates none allocated. Otherwise, the upper 8 bits * 2482 * contain control information and the lower MSBLKLOG bits * 2483 * contain an MS address. * 2484 * * 2485 * A code file must be equipped before it may be linked * 2486 * with a LIBCALL. The code file may not be unequipped until * 2487 * all pages belonging to it are unmapped. * 2488 * * 2489 * The first 128 pages of the code files address space * 2490 * correspond to the memory of the executing process. When a * 2491 * code file is set up to run, each page is mapped into the * 2492 * corresponding page in the users virtual memory. If the * 2493 * CCBPROTECT bit was on for the page, it is set up as read * 2494 * only, otherwise, it is set up read only with own copy * 2495 * allowed. The CCBINFO area contains the transfer addresses * 2496 * and privilege and restriction information. * 2497 * * 2498 * A code file is like a small RAF that has had a transfer * 2499 * address specified. XREQs are provided to specify primary * 2500 * and secondary transfer addresses, and to indicate the * 2501 * state of each page (impure, protected, etc.). * 2502 * * 2503 * CRASH RESISTANCE * 2504 * See the crash resistance section for RAFs. * 2505 * * 2506 * MASS STORAGE ERRORS * 2507 * See the mass storage error section for files. * 2508 * * 2509 ********************************************************************************** 2510 2511 ********************************************************************************** 2512 * CCB INFO BLOCK * 2513 * This block resides near the end of the CCB and contains * 2514 * information special to code files. * 2515 ********************************************************************************** 2516 00000839 2517 CCBINFPROT BASE R0 00160800 0 BASE 2518 CCBPERMIT LABEL beginning of restriction block 00080050 0 ZBM 2519 CCBRSTCTG1 BSSB 5 who set restriction group 1 override (limit change) 00080A50 0 ZBM 2520 CCBRSTCTG2 BSSB 5 " group 2 " (catalog fetch) 00081450 0 ZBM 2521 CCBRSTCTG3 BSSB 5 " group 3 " (account attribute change) 00081E50 0 ZBM 2522 CCBRSTCTG4 BSSB 5 " group 4 " (unassigned) 00082850 0 ZBM 2523 CCBRSTCTG5 BSSB 5 " group 5 " (unassigned) 00083210 0 ZBM 2524 CCBMAINTR BSSB 1 allowed maintenance read 00083410 0 ZBM 2525 CCBMAINTW BSSB 1 allowed maintenance write 00083620 0 ZBM 2526 CCBOPREQ BSSB 2 allowed operator requests 00083A40 0 ZBM 2527 CCBMANAGR BSSB 4 allowed manager requests 00080211 0 ZBM 2528 CCBOWNDIR BSSB 1 use own directory pointers when run 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 131 (DISKDEFS) F 8 Disk Data Structures 00080421 0 ZBM 2529 CCBBACKUP BSSB 2 allowed backup requests 00003E10 BYTE 2530 CCBALWFRC EQU BIT 31 restriction/privilege forced always 00003C10 BYTE 2531 CCBOWNFRC EQU BIT 30 restriction/privilege forced by owner 00003A10 BYTE 2532 CCBDIVFRC EQU BIT 29 restriction/privilege forced by division 00003810 BYTE 2533 CCBPRJFRC EQU BIT 28 restriction/privilege forced by project 00003610 BYTE 2534 CCBUSRFRC EQU BIT 27 restriction/privilege forced by user 2535 BSS 0 force word alignment 2536 BSS 8-(DISPW CCBPERMIT) allow 8 words for restrictions 00160808 0 BASE 2537 CCBPREGS BSS 16 initial program registers, same form as CA 00081F18 0 ZBM 2538 CCBPTRANS EQU CCBPREGS/CAPC primary transfer address (same as PC) 0016080A 0 BASE 2539 CCB2TRANS EQU CCBPREGS/CAR0 secondary transfer address (same as R0) 2540 DRCT 00000018 ABS 2541 CCBINFOL EQU DISPW CCBINFPROT length of info for code file 2542 ORG CCBINFPROT 2543 2544 BASE 000003E8 ABS 2545 CCBMAXPAGE EQU WPP-CCBINFOL maximum number of page pointers in CCB 00000000 DISP 2546 CCBPAGE0 LABEL location of the first page pointer 2547 BSS CCBMAXPAGE each word controls a page 2548 * within each word, 2549 * the upper bits are control information 2550 * the lower MSBLKLOG bits are the block number 00000010 BYTE 2551 CCBPROTECT EQU BIT 0 bit indicates page is protected 000003E8 DISP 2552 CCBINFO LABEL CCB info block starts here 2553 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 132 (DISKDEFS) F 8 Disk Data Structures 2555 2556 ********************************************************************************** 2557 * * 2558 * The following tables are present only on the system volume. * 2559 * * 2560 ********************************************************************************** 2561 2562 ********************************************************************************** 2563 * * 2564 * SYSTEM CONFIGURATION TABLE (SCT) * 2565 * This table contains all of the data concerning all * 2566 * I/O devices on the system. It contains the map between * 2567 * device number and descriptor (this mapping must be * 2568 * determined at run time). * 2569 * * 2570 * It may be wise to make this table a user file so * 2571 * that a given system volume could run on either of two * 2572 * hardware configurations, as determined at load time. * 2573 * This might save a lot of field service time * 2574 * when distributing new systems. * 2575 * * 2576 * CRASH RESISTANCE * 2577 * Not applicable * 2578 * * 2579 * MASS STORAGE ERRORS * 2580 * Pointer in volume label. May be substituted. * 2581 * Recovery will be complete except that maintenance will * 2582 * be required to re-establish the SCT. * 2583 * * 2584 ********************************************************************************** 2585 2586 ********************************************************************************** 2587 * * 2588 * ACCOUNT FINDER TABLE (AFT) * 2589 * This table is provided to determine what volume a given * 2590 * account name is on. It is updated at the same time as * 2591 * the user index. It must also be updated when volumes are * 2592 * mounted or dismounted. It is essentially a scratch * 2593 * table set up for the convenience of the system. This table * 2594 * is rebuilt each time the system is booted. This helps avoid * 2595 * problems with UDIR's moving around if one of the volumes is * 2596 * backed up. * 2597 * * 2598 * The table is indexed by account name (in the case of * 2599 * foreign volume entries, by volume name and account name) * 2600 * and provides the logical unit number (which must be * 2601 * decoded to hardware descriptor elsewhere) and the UDIR * 2602 * block number. * 2603 * * 2604 * This table has the same format as the IDX, * 2605 * which see for further information. * 2606 * * 2607 * CRASH RESISTANCE * 2608 * This table should be updated only after the IDX * 2609 * has received a new entry and before an entry is * 2610 * removed from an IDX. This table is rebuilt when * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 133 (DISKDEFS) F 8 Disk Data Structures 2611 * the system is initialized after a crash so as to * 2612 * ensure that it matches the data in the IDXs. * 2613 * * 2614 * MASS STORAGE ERRORS * 2615 * Pointer in volume label. May be substituted. * 2616 * Recovery will be complete. * 2617 * * 2618 ********************************************************************************** 2619 2620 * exactly the same format as the IDX (except for FBI type) 2621 2622 2623 ********************************************************************************** 2624 * * 2625 * Several other desirable table structures are * 2626 * implemented as SAFs or RAFs on the maintenance, * 2627 * manager, or operator accounts, as appropriate. These * 2628 * files and their location are: * 2629 * 1.) system code file. File = SYSTEM.!!!:SYSTEM.CODE * 2630 * Previous system = SYSTEM.!!!:OLDSYSTEM.CODE * 2631 * Experimental system = SYSTEM.!!!:EXPSYSTEM.CODE * 2632 * 2.) system crash file. File = SYSTEM.!!!:CRASHDUMP.CODE * 2633 * 3.) error log file. File = SYSTEM.!!!:ERRORLOG.LOGFIL * 2634 * 4.) supported library account. Manufacturers * 2635 * library = .!!! (referencable as +) * 2636 * 5.) system library account = .SYS (referencable as * 2637 * $$$. This account is the responsibility * 2638 * of the system owner (manager). * 2639 * * 2640 ********************************************************************************** 2641 2642 ORG CRANDALL recapture all of the lost space 14 INPUT VIRTDEFS virtual machine definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 134 (VIRTDEFS) F 9 Error codes of all kinds 4 5 ********************************************************************************** 6 * * 7 * Any changes to this file (additions, deletions of * 8 * codes) should be made also to the appropriate section(s) of * 9 * .SYS:VIRTDEFS.PASCAL. * 10 * * 11 ********************************************************************************** 12 13 ********************************************************************************** 14 * * 15 * ERROR CODES * 16 * As sure as the sun shines, there will be errors and * 17 * these errors need to be reported to users and the system. * 18 * The following is a list of the error codes broken down into * 19 * groups: * 20 * * 21 * 001-01F These errors are generated by the machine in * 22 * response to illegal instruction usage * 23 * (undefined opcodes, CALL/ENTR mismatch, etc.). * 24 * The error is reported to the operating system * 25 * using this error code and the error code * 26 * is either passed on to the program causing * 27 * the error (if the program has notified the * 28 * system of its ability to handle such errors) * 29 * or to the overprocess controlling that * 30 * program. * 31 * 020-07F These errors are conditions noticed by the * 32 * system software and are passed on to the * 33 * program or to the overprocess. Some of these * 34 * codes are notifications of events in the * 35 * system that the user wished to know about * 36 * (break from terminal, time interval completed, * 37 * receipt of a message from another session, etc.). * 38 * 080-... These error codes are returned by the XREQs * 39 * to give notification of illegal usage, bad * 40 * parameters, or other unacceptable conditions. * 41 * If an error occurs on an XREQ, the error code * 42 * is always returned in R0 with the sign bit * 43 * set to indicate that an error has occurred. * 44 * Note that these error codes apply to any * 45 * XREQ, they are not segregated by FREQ, * 46 * UREQ, or OPREQ. * 47 * * 48 ********************************************************************************** 49 50 * 0 no error 51 * 001-01F machine generated errors 00000001 ABS 52 UINTUOP EQU 001 undefined opcode 00000002 ABS 53 UINTUMODE EQU 002 undefined address mode 00000003 ABS 54 UINTIMS EQU 003 illegal addr. mode for store inst. 00000004 ABS 55 UINTUMP EQU 004 undefined addr. mode in pointer 56 * EQU 005 unassigned (was 'illegal pointer for indexing') 00000006 ABS 57 UINTIMI EQU 006 illegal addr. mode for instruction 00000007 ABS 58 UINTXTI EQU 007 execute target illegal 00000008 ABS 59 UINTCEM EQU 008 CALL/ENTR mismatch 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 135 (VIRTDEFS) F 9 Error codes of all kinds 00000009 ABS 60 UINTPARL EQU 009 PAR/STP mismatch 0000000A ABS 61 UINTIONOV EQU 00A ION/IOFF overflow/underflow 0000000B ABS 62 UINTUOP2 EQU 00B unimplemented instruction 0000000C ABS 63 UINTCKB EQU 00C check bounds failure 0000000D ABS 64 UINTSTNG EQU 00D undefined number or illegal data 0000000E ABS 65 UINTSTKO EQU 00E stack overflow 0000000F ABS 66 UINTBCDO EQU 00F decimal overflow 00000010 ABS 67 UINTARTHOV EQU 010 arithmetic overflow 00000011 ABS 68 UINTDIV0 EQU 011 divide by zero 00000012 ABS 69 UINTFIXOVP EQU 012 fixing overflow positive 00000013 ABS 70 UINTFIXOVN EQU 013 fixing overflow negative 00000014 ABS 71 UINTFLTOVN EQU 014 floating overflow negative 00000015 ABS 72 UINTFLTUFN EQU 015 floating underflow negative 00000016 ABS 73 UINTFLTOVP EQU 016 floating overflow positive 00000017 ABS 74 UINTFLTUFP EQU 017 floating underflow positive 00000018 ABS 75 UINTUNDEF EQU 018 reference to undefined number 00000018 ABS 76 UINTINST EQU 018 this and below codes are instruction failures 0000001F ABS 77 UINTTRACEI EQU 01F instruction trace interrupt 78 * 020-07F software generated errors 00000020 ABS 79 UINTBREAK EQU 020 terminal BREAK request 00000021 ABS 80 UINTTIMCUT EQU 021 time cut interrupt 00000022 ABS 81 UINTNETERM EQU 022 non-empty term 00000023 ABS 82 UINTNEPATH EQU 023 non-empty path 00000024 ABS 83 UINTTDISC EQU 024 terminal disconnect 00000025 ABS 84 UINTTIMINT EQU 025 time interrupt 00000026 ABS 85 UINTMSG EQU 026 inter-session message received 00000027 ABS 86 UINTOPRQA EQU 027 operator abort 00000028 ABS 87 UINTGUNIT EQU 028 received a gift unit 88 * 060-07F codes that enter next higher program level 00000070 ABS 89 UINTVMFPE EQU 070 virtual memory failure - parity error 00000071 ABS 90 UINTVMFDE EQU 071 virtual memory failure - disk error 00000072 ABS 91 UINTVMFIDS EQU 072 virtual memory failure - insufficient disk space 00000073 ABS 92 UINTVMFISR EQU 073 virtual memory failure - insufficient system resources 00000074 ABS 93 UINTMPV EQU 074 memory protect violation 00000075 ABS 94 UINTATTACH EQU 075 request to attach to session 00000079 ABS 95 UINTBRKINS EQU 079 "break" instruction 0000007A ABS 96 UINTLOGOFF EQU 07A request to log off session 0000007B ABS 97 UINTCHAIN EQU 07B request to chain 0000007C ABS 98 UINTVAR EQU 07C request for variable 0000007D ABS 99 UINTOPRQ EQU 07D operator request (sub-code in R1) 00000001 ABS 100 UINTOPRQL EQU 1 do a logoff 00000002 ABS 101 UINTOPRQT EQU 2 do a terminate 00000003 ABS 102 UINTOPRQW EQU 3 give a warning 00000004 ABS 103 UINTOPRQUL EQU 4 user logoff 00000005 ABS 104 UINTOPRQP EQU 5 abort parallel session 0000007E ABS 105 UINTPTERM EQU 07E program termination (sub-code in R1) 106 * (right 4 bits of URSTOPxx) 0000007F ABS 107 UINTLOGIN EQU 07F initial creation entry 108 * 080-... errors made by XREQs 00000080 ABS 109 XREQERILR EQU 080 illegal request 110 * a catch-all error code 00000081 ABS 111 XREQERLNE EQU 081 *unit not equipped 00000082 ABS 112 XREQERPOB EQU 082 parameter out of bounds 00000083 ABS 113 XREQERLAE EQU 083 unit already equipped 00000084 ABS 114 XREQERPFM EQU 084 protected from modification 00000085 ABS 115 XREQERRNA EQU 085 read not allowed 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 136 (VIRTDEFS) F 9 Error codes of all kinds 00000086 ABS 116 XREQERMWNA EQU 086 multiple write not allowed 00000087 ABS 117 XREQERDSKL EQU 087 *exceeding disk limits 00000088 ABS 118 XREQERISAV EQU 088 *insufficient save file space 00000089 ABS 119 XREQERFAU EQU 089 *file abnormal/unavailable 120 * a MS error has occurred on users data 0000008A ABS 121 XREQERFBZ EQU 08A file busy 0000008B ABS 122 XREQERLAS EQU 08B unit already saved 0000008C ABS 123 XREQERLNS EQU 08C unit not saved 0000008D ABS 124 XREQERFNF EQU 08D file not found 125 * this error is given without elaboration for 126 * files that the user is not authorized to 127 * access 0000008E ABS 128 XREQERNAE EQU 08E name already exists 0000008F ABS 129 XREQERBFN EQU 08F bad filename 00000090 ABS 130 XREQERFHBD EQU 090 file has been destroyed 00000091 ABS 131 XREQERILOP EQU 091 illegal operation on device 00000092 ABS 132 XREQERFPRG EQU 092 file was purged 00000093 ABS 133 XREQERISYR EQU 093 *insufficient system resources 134 * the system has run out of MS table 135 * space or monitor free space 00000094 ABS 136 XREQERPNS EQU 094 privilege not sufficient 00000095 ABS 137 XREQERLPE EQU 095 lock protocol error 00000096 ABS 138 XREQERPWW EQU 096 password wrong 139 * this error is given without elaboration 140 * for attempts to log on to non-existant 141 * accounts or with an improper password 00000097 ABS 142 XREQERBVAR EQU 097 bad variable (genned by control mode) 00000098 ABS 143 XREQERWPT EQU 098 wrong parameter terminator 00000099 ABS 144 XREQERSIU EQU 099 system/resource in use 0000009A ABS 145 XREQERUAM EQU 09A unknown access mode 0000009B ABS 146 XREQERVLB EQU 09B volume label bad 0000009C ABS 147 XREQERVNMR EQU 09C volume not mountable by this revision 0000009D ABS 148 XREQERNFSV EQU 09D no free storage on volume 0000009E ABS 149 XREQERBSBL EQU 09E bad substitution list 0000009F ABS 150 XREQERDSE EQU 09F disk structure error 151 * a MS error has occurred on system tables 152 * or data. The users data is probably 153 * intact (if it exists) and may be 154 * recovered by a recovery program. 000000A0 ABS 155 XREQEROFC EQU 0A0 write off end of CODE file 000000A1 ABS 156 XREQERVIU EQU 0A1 volume in use 000000A2 ABS 157 XREQERMNRP EQU 0A2 may not reference other process/session 000000A3 ABS 158 XREQERNSPP EQU 0A3 no such process/session 000000A4 ABS 159 XREQERREOD EQU 0A4 *reread at end-of-data 000000A5 ABS 160 XREQERWANA EQU 0A5 must not have write access 000000A6 ABS 161 XREQERNSV EQU 0A6 no such volume 000000A7 ABS 162 XREQERIAUT EQU 0A7 insufficient authorization 000000A8 ABS 163 XREQERFIP EQU 0A8 freeing in progress (to OPR only) 000000A9 ABS 164 XREQERINHI EQU 0A9 access inhibited 165 * return given to login saying 166 * port/system is inhibited 000000AA ABS 167 XREQERNSL EQU 0AA no such unit 000000AB ABS 168 XREQERNSE EQU 0AB no such entry 000000AC ABS 169 XREQERNR EQU 0AC no room for entry 000000AD ABS 170 XREQERSUSP EQU 0AD item/access not available -- did not suspend 000000AE ABS 171 XREQERDNR EQU 0AE device not ready 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 137 (VIRTDEFS) F 9 Error codes of all kinds 000000AF ABS 172 XREQERDNA EQU 0AF device not assigned to caller 000000B0 ABS 173 XREQERDAA EQU 0B0 device already assigned 000000B1 ABS 174 XREQERDNC EQU 0B1 device not callers 000000B2 ABS 175 XREQERUKS EQU 0B2 unknown shift 000000B3 ABS 176 XREQERUKC EQU 0B3 unknown class 000000B4 ABS 177 XREQERUKF EQU 0B4 unknown forms 000000B5 ABS 178 XREQERNSS EQU 0B5 no such site 000000B6 ABS 179 XREQERNDS EQU 0B6 no device of specified name at site 000000B7 ABS 180 XREQERNDT EQU 0B7 no device of specified type at site 000000B8 ABS 181 XREQERRIB EQU 0B8 "ROUTE" illegal for batch jobs (spooler) 000000B9 ABS 182 XREQEROIO EQU 0B9 "OUT" illegal for output jobs (spooler) 000000BA ABS 183 XREQERAIR EQU 0BA "ATTR" illegal for batch jobs (spooler) 000000BB ABS 184 XREQERSIO EQU 0BB "SEQ" illegal for output jobs (spooler) 000000BC ABS 185 XREQERUKP EQU 0BC unknown parameter 000000BD ABS 186 XREQERSIB EQU 0BD "SITE" illegal for batch jobs (spooler) 000000BE ABS 187 XREQERUIB EQU 0BE "UNIT" illegal for batch jobs (spooler) 000000BF ABS 188 XREQERSPB EQU 0BF "SUPPRESS" illegal for batch jobs (spooler) 000000C0 ABS 189 XREQERSDE EQU 0C0 "SPOOLED" and "DIRECT" may not appear together (spooler) 000000C1 ABS 190 XREQERULT EQU 0C1 unknown logical device type (spooler) 000000C2 ABS 191 XREQERTMD EQU 0C2 too many different devices for batch job (spooler) 000000C3 ABS 192 XREQERDCM EQU 0C3 some device count appears >1 times for 193 * batch job (spooler) 000000C4 ABS 194 XREQERDIO EQU 0C4 "DEVICE" illegal for output job 195 000000C5 ABS 196 XREQERESDL EQU 0C5 exceeding session disk limits 000000C6 ABS 197 XREQERLBZ EQU 0C6 lock busy 000000C7 ABS 198 XREQERSCU EQU 0C7 spooler is currently unavailable 000000C8 ABS 199 XREQERVBB EQU 0C8 "VERBATIM" illegal for batch jobs (spooler) 000000C9 ABS 200 XREQERITK EQU 0C9 "TRACK" parameter out of bounds (spooler) 000000CA ABS 201 XREQERITM EQU 0CA "TIME" parameter out of bounds (spooler) 202 203 ********************************************************************************** 204 * * 205 * Error codes 0E0:0FF are reserved for device dependent * 206 * codes. * 207 * * 208 ********************************************************************************** 209 000000E0 ABS 210 DEVERPFE EQU 0E0 port framing error 000000E1 ABS 211 DEVERPPE EQU 0E1 port parity error 000000E2 ABS 212 DEVERPIBO EQU 0E2 port input buffer overflow 213 000000E3 ABS 214 DEVERTRE EQU 0E3 tape read error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 138 (VIRTDEFS) F 9 Executive Request (XREQ) codes 217 218 ********************************************************************************** 219 * * 220 * A unit is an unsigned 8 bit integer used to refer to a * 221 * 'logical unit'. These logical units may be 'equipped' to * 222 * mass storage files or to pseudo device types. The * 223 * following are special unit assignments. * 224 * * 225 ********************************************************************************** 226 227 * unit 0 does not exist 00000001 ABS 228 LUNSIN EQU 1 standard input 00000002 ABS 229 LUNSOUT EQU 2 standard output 00000003 ABS 230 LUNSERR EQU 3 error output 00000064 ABS 231 MAXLOCAL EQU 100 highest possible local unit number 000000C9 ABS 232 LUNAIN EQU 201 absolute input 000000CA ABS 233 LUNAOUT EQU 202 absolute output 234 000000C9 ABS 235 LUNCMLOW EQU 201 any unit above this is not the user's 000000D2 ABS 236 LUNCMCNTL EQU 210 above this, only CM may diddle 237 238 ********************************************************************************** 239 * * 240 * Below are defined the codes for the requests that a * 241 * user may make to the system to do useful things for him. * 242 * The requests are grouped into file requests (FREQs) which * 243 * begin with the characters "FR", user requests (UREQs) which * 244 * begin with the characters "UR", and operator, manager, and * 245 * control mode requests which begin with the characters "OR". * 246 * A table containing the current maximum request code * 247 * values for each request type is kept with the XREQ call * 248 * monitor definitions (XREQMAXTAB). That table must be kept * 249 * up to date as greater numbers are used. * 250 * * 251 * The machine hardware traps the XREQ opcode to the * 252 * monitor after calculating the operand. The operand is * 253 * calculated using the 22 bit address field in the same * 254 * manner as a normal mem ref instruction (e.g. LD). The * 255 * monitor further decodes the R field to distinguish the type * 256 * of request. * 257 * The XREQ opcode is 08000000. The valid subops are * 258 * FREQ=2 (088xxxxx), UREQ=4 (090xxxxx), and OPREQ=5 * 259 * (094xxxxx). * 260 * Each request code is preceeded by a brief description * 261 * of the calling register setup, the request and operand, and * 262 * the registers returned. * 263 * * 264 ********************************************************************************** 265 00002CA0 BYTE 266 XRFLDCODE EQU BITS 22:31 XREQ request field 00003840 BYTE 267 XRFLDSUBOP EQU BITS 28:31 sub-operation part 00002C60 BYTE 268 XRFLDREQ EQU BITS 22:27 operation part 269 * EQU BIT 18:21 unused - reserved 00002210 BYTE 270 XRFLDNRWD EQU BIT 17 skip rewind if xreq attempts to do so 00004000 ABS 271 XRNOREWND EQU 1*XRFLDNRWD 00001E20 BYTE 272 XRFLDSUSP EQU BITS 15:16 suspension control field 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 139 (VIRTDEFS) F 9 Executive Request (XREQ) codes 00000000 ABS 273 XRSUSPNORM EQU 0*XRFLDSUSP suspend if request must wait 00008000 ABS 274 XRSUSPERR EQU 1*XRFLDSUSP give error if request must wait 275 * EQU 2*XRFLDSUSP suspend level above if request must wait 276 * EQU 3*XRFLDSUSP not used 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 140 (VIRTDEFS) F 9 Executive Request (XREQ) codes 278 279 ********************************************************************************** 280 * * 281 * FREQs * 282 * The file requests (FREQs) perform operations on a * 283 * unit. The unit is specified by the operand of the * 284 * instruction. Note that the unit number is actually the * 285 * operand of the FREQ and not the effective address, as in * 286 * some other systems! * 287 * * 288 ********************************************************************************** 289 290 * (R0:=request|FREQ unit|R0=dynamic status|R1=static status) 00000010 ABS 291 FRSTATUS EQU 0010 device status 00000011 ABS 292 FRCLEAR EQU 0011 clear errors 00000012 ABS 293 FRREWIND EQU 0012 rewind 00000013 ABS 294 FRRELEASE EQU 0013 release data 00000014 ABS 295 FRSEOD EQU 0014 search for EOD 00000015 ABS 296 FRFWSP EQU 0015 forward-space 00000016 ABS 297 FRBKSP EQU 0016 backspace 00000017 ABS 298 FRSEFF EQU 0017 search EOF forward 00000018 ABS 299 FRSEFB EQU 0018 search EOF backward 00000019 ABS 300 FRWFM EQU 0019 write file mark 0000001A ABS 301 FRFORCE EQU 001A force write modified file pages 0000001C ABS 302 FRWRITEMOD EQU 001C write out modified file pages 0000001D ABS 303 FRCYCLE EQU 001D cycle cartridge tape 0000001E ABS 304 FREPP EQU 001E return EPP (in R1) 0000001F ABS 305 FRDEVSTAT EQU 001F return device status (R1 = PPU status 306 * R2 = controller status) 307 308 * (R0:=request|R1:= 0(MFM), 1(GCR)|FREQ unit|R0=dynamic status) 309 * unstable due to possible controller micro-code problems 310 *FRDENSITY EQU 001B select recording density on cartridge tape 311 312 * (R0:=request|R1:=count|R2:=buffer-addr|FREQ unit|R0=dynamic status) 00000020 ABS 313 FRRWRITE EQU 0020 text rewrite 00000020 ABS 314 FRRWRITET EQU 0020 text rewrite 00000021 ABS 315 FRRWRITETF EQU 0021 text with forms control rewrite 00000022 ABS 316 FRRWRITEB EQU 0022 binary rewrite 00000023 ABS 317 FRRWRITEF EQU 0023 forms rewrite 00000024 ABS 318 FRRWRITEL EQU 0024 label rewrite 00000025 ABS 319 FRRWRITEC EQU 0025 comment rewrite 320 321 * (R0:=request|R1:=count|R2:=buffer-addr|FREQ unit|R0=dynamic status| 322 * R1=count-bytes remaining|R2=terminating character ) 00000030 ABS 323 FRREAD EQU 0030 read 00000031 ABS 324 FRREADB EQU 0031 read binary 00000032 ABS 325 FRSREAD EQU 0032 sequential read 00000033 ABS 326 FRSREADB EQU 0033 sequential binary read 327 328 * (R0:=request|R1:=count|R2:=buffer-addr|FREQ unit|R0=dynamic status) 00000040 ABS 329 FRWRITE EQU 0040 text write 00000040 ABS 330 FRWRITET EQU 0040 text write 00000041 ABS 331 FRWRITETF EQU 0041 text with forms control write 00000042 ABS 332 FRWRITEB EQU 0042 binary write 00000043 ABS 333 FRWRITEF EQU 0043 forms write 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 141 (VIRTDEFS) F 9 Executive Request (XREQ) codes 00000044 ABS 334 FRWRITEL EQU 0044 label write 00000045 ABS 335 FRWRITEC EQU 0045 comment write 336 337 * (R0:=request|R1:=count|R2:=buffer-addr|FREQ unit|R0=dynamic status) 338 * (R1 = number of bytes not written|R2 = advanced source pointer) 000002A0 ABS 339 FRSWRITE EQU 02A0 sequential write 000002A0 ABS 340 FRSWRITET EQU 02A0 sequential text write 000002A1 ABS 341 FRSWRITETF EQU 02A1 sequential text with forms control write 000002A2 ABS 342 FRSWRITEB EQU 02A2 sequential binary write 000002A3 ABS 343 FRSWRITEF EQU 02A3 sequential forms write 344 345 * (R0:=request|R1:=pntr-to-param-block|FREQ unit| 346 * R0=error-code or static-status ) 00000050 ABS 347 FREQUIP EQU 0050 equip + access 00000050 ABS 348 FREQUIPW EQU 0050 equip read-write 00000051 ABS 349 FREQUIPR EQU 0051 equip read-only 00000054 ABS 350 FREQUIPMW EQU 0054 equip multiple-write 00000057 ABS 351 FREQUIPNA EQU 0057 equip with no data access 352 00000050 ABS 353 FROPEN EQU 0050 open + access 00000050 ABS 354 FROPENW EQU 0050 open read-write 00000051 ABS 355 FROPENR EQU 0051 open read-only 00000054 ABS 356 FROPENMW EQU 0054 open multiple-write 00000057 ABS 357 FROPENNA EQU 0057 open with no data access 358 359 * (R0:=request | R1=length | R2:=string addr | FREQ unit | 360 * R0=error code or static status) 00000260 ABS 361 FRNOPEN EQU 0260 use FRNOPEN+access to open 00000260 ABS 362 FRNOPENW EQU 0260 open for write 00000261 ABS 363 FRNOPENR EQU 0261 open for read 00000264 ABS 364 FRNOPENMW EQU 0264 open for multiple write 00000267 ABS 365 FRNOPENNA EQU 0267 open for no data access 00000268 ABS 366 FRNOPENC EQU 0268 use FRNOPENC+access to open, create if necessary 00000268 ABS 367 FRNOPENCW EQU 0268 open for write, create if necessary 00000269 ABS 368 FRNOPENCR EQU 0269 open for read, create if necessary 0000026C ABS 369 FRNOPENCMW EQU 026C open for multiple write, create if necessary 0000026F ABS 370 FRNOPENCNA EQU 026F open for no data access, create if necessary 371 372 * (R0:=request | R1:=length | R2:=string addr | FREQ unit | 373 * R0:=error code or static status) 00000280 ABS 374 FRUOPEN EQU 0280 use FRUOPEN+access to open 00000280 ABS 375 FRUOPENW EQU 0280 open for write 00000281 ABS 376 FRUOPENR EQU 0281 open for read 00000284 ABS 377 FRUOPENMW EQU 0284 open for multiple write 00000287 ABS 378 FRUOPENNA EQU 0287 open for no data access 00000288 ABS 379 FRUOPENC EQU 0288 use FRUOPENC+access to open, create if necessary 00000288 ABS 380 FRUOPENCW EQU 0288 open for write, create if necessary 00000289 ABS 381 FRUOPENCR EQU 0289 open for read, create if necessary 0000028C ABS 382 FRUOPENCMW EQU 028C open for multiple write, create if necessary 0000028F ABS 383 FRUOPENCNA EQU 028F open for no data access, create if necessary 384 385 * (R0:=request|FREQ unit|R0=dynamic-status) 00000060 ABS 386 FRUNEQUIP EQU 0060 unequip unit 387 00000060 ABS 388 FRCLOSE EQU 0060 close unit 389 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 142 (VIRTDEFS) F 9 Executive Request (XREQ) codes 390 * (R0:=request|R1:=extension|R2,R3:=name|FREQ unit| 391 * R0=error-code or dynamic-status ) 00000070 ABS 392 FRSAVE EQU 0070 save in catalog 393 394 * (R0:=request|FREQ unit| 395 * R0=error-code or dynamic-status ) 00000080 ABS 396 FRUNSAVE EQU 0080 remove from catalog 397 398 * (R0:=request|R1:=position|FREQ unit|R0=dynamic-status| 399 * R1=zero if RAF now positioned in hole ) 00000090 ABS 400 FRPOSITION EQU 0090 position a RAF or CODE 401 * (R0:=request|R1:=RAFpage|R2:=memory-page|FREQ unit| 402 * R0=dynamic-status) 403 * note that R1 and R2 both contain page numbers (not addresses) 00000091 ABS 404 FRMAPIN EQU 0091 map RAF page into memory 00000092 ABS 405 FRMAPINR EQU 0092 map in with read-only access 00000094 ABS 406 FRMAPINOC EQU 0094 map in with own copy access 407 * (R0:=request|FREQ unit|R0=dynamic-status|R1=last-char-in-RAF ) 00000093 ABS 408 FRRAFLAST EQU 0093 get last addr in RAF 409 * (R0:=request|FREQ unit|R0=dynamic status|R1=current position) 00000095 ABS 410 FRRAFCPOS EQU 0095 get the RAF/CODE current position 411 * (R0:=request|R1:=page num|FREQ unit|R0=dynamic status| 412 * R2=non-zero if protected) 00000096 ABS 413 FRPGPROTG EQU 0096 get protected status of page 414 * (R0:=request|R1:=page number|R2:=new protect bit| 415 * FREQ unit|R0=dynamic status) 00000097 ABS 416 FRPGPROTS EQU 0097 set protected status of a page 417 * (R0:=request|R1:=byte address in page|FREQ unit| 418 * R0=dynamic status) 00000098 ABS 419 FRDELPAGE EQU 0098 delete page in RAF or CODE 420 * (R0:=request|FREQ unit|R0=dynamic status|R1=new position) 00000099 ABS 421 FRRAFNEXT EQU 0099 position to next non-hole 422 423 * (R0:=request+access|R1:=pntr-to-param-block|FREQ unit| 424 * R0=error-code or dynamic-status ) 000000A0 ABS 425 FRSHARE EQU 00A0 share file 426 427 * (R0:=request+access|R1:=pntr-to-param-block|FREQ unit| 428 * R0=error-code or dynamic-status ) 000000B0 ABS 429 FRUNSHARE EQU 00B0 unshare file 430 431 * (R0:=request|R1:= requested code|FREQ unit|R0=dynamic-status) 000000C0 ABS 432 FRCACCESS EQU 00C0 change equip access 000000C1 ABS 433 FRCHGTRANS EQU 00C1 modify transaction in progress flag (FCB) 434 435 * (R0:=request|FREQ unit|R0=dynamic-status|R1=transaction flag) 000000C2 ABS 436 FRGETTRANS EQU 00C2 get transaction in progress flag (FCB) 437 438 * (R0:=request|R1:=new value|FREQ unit|R0=dynamic status) 000000D0 ABS 439 FRMODACS EQU 00D0 modify access code 440 * EQU 00D1 unused - was modify access lock (unimp) 000000D2 ABS 441 FRMODPRGI EQU 00D2 modify purge interval 000000D3 ABS 442 FRMODNBKUP EQU 00D3 modify no-backup flag 000000D4 ABS 443 FRMODFWWSC EQU 00D4 modify FWWSC flag 000000D5 ABS 444 FRMODUSRN EQU 00D5 modify user value 000000D6 ABS 445 FRMODLBKU EQU 00D6 modify last backup date 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 143 (VIRTDEFS) F 9 Executive Request (XREQ) codes 000000D7 ABS 446 FRMODGHOST EQU 00D7 modify ghost flag 000000D8 ABS 447 FRMODLWD EQU 00D8 modify last write date 000000D9 ABS 448 FRMODLRD EQU 00D9 modify last read date 000000DA ABS 449 FRMODTRANS EQU 00DA modify transaction in progress flag (DIR) 000000DB ABS 450 FRMODFLOG EQU 00DB modify file log flag 451 452 * (R0:=request|R1:=count|R2:=buffadr|FREQ unit|R0=dynamic-status| 453 * R1=count - chars-copied) 000000E0 ABS 454 FRCATALOG EQU 00E0 catalog info fetch 000000E1 ABS 455 FRREADSHL EQU 00E1 read shared list 456 457 * EQU 00F0 unused (reserved for file info fetch) 458 459 * (R0:=request|R1:=extension|R2,R3:=new name|FREQ unit|R0=error-code or 460 * dynamic-status) 00000100 ABS 461 FRRENAMER EQU 0100 rename saved file 462 463 * (R0:=request|R1,R2:=value|FREQ unit|R0=dynamic-status|R1,R2=old value) 00000110 ABS 464 FRTSETTYPE EQU 0110 set terminal type 465 * (R0:=request|R1:=value|FREQ unit|R0=dynamic-status|R1=old value) 00000111 ABS 466 FRTSETCRD EQU 0111 set CR delay (MS) 00000112 ABS 467 FRTSETLFD EQU 0112 set LF delay (MS) 00000113 ABS 468 FRTSETFFD EQU 0113 set FF delay (MS) 00000114 ABS 469 FRTSETBKSP EQU 0114 set backspace char 00000115 ABS 470 FRTSETKILL EQU 0115 set line kill char 00000116 ABS 471 FRTSETCW EQU 0116 set carriage width 00000117 ABS 472 FRTSETSH EQU 0117 set screen height 00000118 ABS 473 FRTSETECHO EQU 0118 set echo (on/off) 00000119 ABS 474 FRTSETRATE EQU 0119 set input and output baud rate 0000011A ABS 475 FRTSETTCG EQU 011A set terminating char group 0000011C ABS 476 FRTSETIRAT EQU 011C set input baud rate 0000011D ABS 477 FRTSETORAT EQU 011D set output baud rate 0000011F ABS 478 FRTSETTRNS EQU 011F set transmitters 00000220 ABS 479 FRTSETMODE EQU 0220 set interface mode 00000221 ABS 480 FRTSETOPT EQU 0221 set CIA options 00000222 ABS 481 FRTSETHTD EQU 0222 set HT delay (MS) 00000223 ABS 482 FRTSETBRCH EQU 0223 set 'break' character 00000224 ABS 483 FRTSETXOIQ EQU 0224 set XOFF on port's input buffer full 484 * (R0:=request|R1:=pntr-to-def-block|FREQ unit|R0=dynamic-status) 0000011B ABS 485 FRTSETTCS EQU 011B set user defined term chars 486 487 * (R0:=request|FREQ unit|R0=dynamic-status|R1,R2=value) 00000120 ABS 488 FRTGETTYPE EQU 0120 get terminal type 489 * (R0:=request|FREQ unit|R0=dynamic-status|R1=value) 00000121 ABS 490 FRTGETCRD EQU 0121 get CR delay (MS) 00000122 ABS 491 FRTGETLFD EQU 0122 get LF delay (MS) 00000123 ABS 492 FRTGETFFD EQU 0123 get FF delay (MS) 00000124 ABS 493 FRTGETBKSP EQU 0124 get backspace char 00000125 ABS 494 FRTGETKILL EQU 0125 get line kill char 00000126 ABS 495 FRTGETCW EQU 0126 get carriage width 00000127 ABS 496 FRTGETSH EQU 0127 get screen height 00000128 ABS 497 FRTGETECHO EQU 0128 get echo mode 00000129 ABS 498 FRTGETRATE EQU 0129 get output baud rate 0000012A ABS 499 FRTGETTCG EQU 012A get terminating char group 0000012C ABS 500 FRTGETIRAT EQU 012C get input baud rate 0000012E ABS 501 FRTGETPORT EQU 012E get port number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 144 (VIRTDEFS) F 9 Executive Request (XREQ) codes 0000012F ABS 502 FRTGETRCVR EQU 012F get receiver states 00000230 ABS 503 FRTGETMODE EQU 0230 get interface mode 00000231 ABS 504 FRTGETOPT EQU 0231 get selected CIA options 00000232 ABS 505 FRTGETHTD EQU 0232 get HT delay (MS) 00000233 ABS 506 FRTGETBRCH EQU 0233 get 'break' character 00000235 ABS 507 FRTGETXOIQ EQU 0235 get XOFF on port's input buffer full 508 * (R0:=request|R1:=buffer size|R2:=buffer address|FREQ unit| 509 * R0=dynamic status|R1=buffer remaining) 00000234 ABS 510 FRTGETINFO EQU 0234 get all port info 511 * (R0:=request|R1:=pntr-to-block|FREQ unit| R0=dynamic-status) 0000012B ABS 512 FRTGETTCS EQU 012B get characters that terminate 513 514 * (R0:=request|FREQ unit|R0=error-code|R1=process serial number) 00000130 ABS 515 FRCHAIN EQU 0130 chain, run program 00000131 ABS 516 FRSETUPP EQU 0131 set up under program 00000132 ABS 517 FRINSRTP EQU 0132 insert under program 00000134 ABS 518 FRCREATP EQU 0134 create another underprocess 519 * (R0:=request|R1:=input-unit|R2:=output-unit|FREQ program-unit| 520 * R0=error code or session number) 00000133 ABS 521 FRCONCP EQU 0133 create concurrent session 522 523 * (R0:=request|R1:=unit-of-saved-file|FREQ unit-of-new-data| 524 * R0=dynamic-status) 00000140 ABS 525 FRXSAVE EQU 0140 exchange saved file data 526 527 * (R0:=request|FREQ unit|R0=error-code|R1=hard-limit|R2=soft-limit| 528 * R3=saved-limit) 00000150 ABS 529 FRBLKLIM EQU 0150 get block limits 530 * (R0:=request|FREQ unit|R0=error-code|R1=blocks-used|R2=soft-limit| 531 * R3=saved-limit) 00000151 ABS 532 FRBLKUSED EQU 0151 get blocks used 533 534 * (R0:=request|FREQ unit|R0=dynamic-status) 00000170 ABS 535 FRDESTROY EQU 0170 destroy a saved file 536 537 * (R0:=request|FREQ unit|R0=dynamic status|R1=value) 00000180 ABS 538 FRCGPTRANS EQU 0180 get primary transfer address 00000181 ABS 539 FRCG2TRANS EQU 0181 get secondary transfer address 00000182 ABS 540 FRCGOWND EQU 0182 get to use own directory when run 00000183 ABS 541 FRCGRG1 EQU 0183 get restriction group 1 override 00000184 ABS 542 FRCGRG2 EQU 0184 get restriction group 2 override 00000185 ABS 543 FRCGRG3 EQU 0185 get restriction group 3 override 00000186 ABS 544 FRCGRG4 EQU 0186 get restriction group 4 override 00000187 ABS 545 FRCGRG5 EQU 0187 get restriction group 5 override 00000188 ABS 546 FRCGOPREQ EQU 0188 get operator requests 00000189 ABS 547 FRCGMANAGR EQU 0189 get manager request priv 0000018A ABS 548 FRCGMANTR EQU 018A get maintenance read 0000018B ABS 549 FRCGMANTW EQU 018B get maintenance write 0000018C ABS 550 FRCGBCKUP EQU 018C get backup priv 551 * (R0:=request|R1:=field-number|FREQ unit| 552 * R0=dynamic status|R2=value of field) 0000018F ABS 553 FRGETCCB EQU 018F get field from CCB 00000000 ABS 554 CCBFLDR0 EQU 0 field number for R0 00000001 ABS 555 CCBFLDR1 EQU 1 00000002 ABS 556 CCBFLDR2 EQU 2 00000003 ABS 557 CCBFLDR3 EQU 3 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 145 (VIRTDEFS) F 9 Executive Request (XREQ) codes 00000004 ABS 558 CCBFLDR4 EQU 4 00000005 ABS 559 CCBFLDR5 EQU 5 00000006 ABS 560 CCBFLDR6 EQU 6 00000007 ABS 561 CCBFLDR7 EQU 7 00000008 ABS 562 CCBFLDPC EQU 8 field number for PC 00000009 ABS 563 CCBFLDPSR EQU 9 field number for PSR 0000000A ABS 564 CCBFLDIMR EQU 10 field for interrupt mask register 0000000B ABS 565 CCBFLDIAR EQU 11 field for interrupt address 00000010 ABS 566 CCBFLDOWND EQU 16 field for own directory privilege 00000011 ABS 567 CCBFLDRG1 EQU 17 field for restriction group 1 00000012 ABS 568 CCBFLDRG2 EQU 18 field for restriction group 2 00000013 ABS 569 CCBFLDRG3 EQU 19 field for restriction group 3 00000014 ABS 570 CCBFLDRG4 EQU 20 field for restriction group 4 00000015 ABS 571 CCBFLDRG5 EQU 21 field for restriction group 5 00000016 ABS 572 CCBFLDMNTR EQU 22 field for maintenance read 00000017 ABS 573 CCBFLDMNTW EQU 23 field for maintenance write 00000018 ABS 574 CCBFLDOPR EQU 24 field for operator privilege 00000019 ABS 575 CCBFLDMGR EQU 25 field for manager privilege 0000001A ABS 576 CCBFLDBKUP EQU 26 field for backup privilege 00000008 ABS 577 CCBFLDPTRN EQU CCBFLDPC primary transfer address 00000000 ABS 578 CCBFLD2TRN EQU CCBFLDR0 secondary transfer address 579 * (R0:=request|R1:=new value|FREQ unit|R0=dynamic status) 00000190 ABS 580 FRCSPTRANS EQU 0190 set primary transfer address 00000191 ABS 581 FRCS2TRANS EQU 0191 set secondary transfer address 00000192 ABS 582 FRCSOWND EQU 0192 set to use own directory when run 00000193 ABS 583 FRCSRG1 EQU 0193 set restriction group 1 override 00000194 ABS 584 FRCSRG2 EQU 0194 set restriction group 2 override 00000195 ABS 585 FRCSRG3 EQU 0195 set restriction group 3 override 00000196 ABS 586 FRCSRG4 EQU 0196 set restriction group 4 override 00000197 ABS 587 FRCSRG5 EQU 0197 set restriction group 5 override 00000198 ABS 588 FRCSOPREQ EQU 0198 set operator requests 00000199 ABS 589 FRCSMANAGR EQU 0199 set manager request priv 0000019A ABS 590 FRCSMANTR EQU 019A set maintenance read 0000019B ABS 591 FRCSMANTW EQU 019B set maintenance write 0000019C ABS 592 FRCSBCKUP EQU 019C set backup priv 593 * (R0:=request|R1:=field-number|R2:=new-value|FREQ unit| 594 * R0=dynamic status) 0000019F ABS 595 FRSETCCB EQU 019F set field in CCB 596 597 * (R0:=request|FREQ unit|R0=dynamic status) 000001A0 ABS 598 FRALIAS EQU 01A0 set default directory 599 600 * (R0:=request|FREQ unit|R0=error code) 000001B0 ABS 601 FRTFLSHO EQU 01B0 flush output queue 000001B1 ABS 602 FRTFLSHI EQU 01B1 flush input queue 000001B2 ABS 603 FRTFLSHIO EQU 01B2 flush both input and output queues 000001B3 ABS 604 FRTRESET EQU 01B3 restore term to 'default' configuration 605 * (R0:=request|R1=delay in Ms|FREQ unit|R0=error code) 000001B4 ABS 606 FRTDELAY EQU 01B4 delay terminal outputting 607 * (R0:=request|R1:=character times|FREQ unit|R0=error code) 000001B5 ABS 608 FRTBREAK EQU 01B5 send 'break' 609 * (R0:=request|FREQ unit|R0=error code) 000001B6 ABS 610 FRTCLRXOFF EQU 01B6 clears xoff 611 612 * (R0:=request|FREQ unit|R0=error code|R1=value) 000001C0 ABS 613 FRAGCPUL EQU 01C0 get acct CPU limit (in sec) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 146 (VIRTDEFS) F 9 Executive Request (XREQ) codes 000001C1 ABS 614 FRAGCPUU EQU 01C1 get acct CPU time used 000001C2 ABS 615 FRAGWLCKL EQU 01C2 get acct wallclock limit (in min) 000001C3 ABS 616 FRAGWLCKU EQU 01C3 get acct wallclock time used 000001C4 ABS 617 FRAGDSKL EQU 01C4 get acct disk block limit 000001C5 ABS 618 FRAGDSKU EQU 01C5 get acct saved disk blocks used 000001C6 ABS 619 FRAGWARN EQU 01C6 get acct soft disk limit 000001C7 ABS 620 FRAGSAVL EQU 01C7 get acct saved disk limit 000001C8 ABS 621 FRAGSSCF EQU 01C8 get acct subsystem control flags 000001C9 ABS 622 FRAGBUSY EQU 01C9 get acct busy counter 000001CA ABS 623 FRAGFAC EQU 01CA get acct file access control 000001CB ABS 624 FRAGPWAC EQU 01CB get acct password access control 000001CD ABS 625 FRAGACCT EQU 01CD get acct accounting control 626 * (R0:=request|R1:=ptr to filename|FREQ unit|R0=error code) 000001CE ABS 627 FRAGINITP EQU 01CE get acct initial program 628 * (R0:=request|R1:=buffer size|R2:=ptr to buffer|FREQ unit| 629 * R0=error code|R1=buffer remaining) 000001CF ABS 630 FRAGACCTT EQU 01CF get account title 000001D1 ABS 631 FRAGSHAD EQU 01D1 get account shadow flag 000001D2 ABS 632 FRAGDFLTR EQU 01D2 get acct default restriction 633 634 * (R0:=request | FREQ unit | R0:=error code | R1:R2:=value) 000001D0 ABS 635 FRAGSERNO EQU 01D0 get account serial number 636 637 * (R0:=request | FREQ unit | R0:=error code | R1:=value) 000001D3 ABS 638 FRAGENCF EQU 01D3 get account encryption flag 639 640 * (R0:=request|R1:=new value|FREQ unit|R0=error code|R1=set value) 000001E0 ABS 641 FRASCPUL EQU 01E0 set acct CPU limit (in sec) 000001E1 ABS 642 FRASCPUU EQU 01E1 set acct CPU time used 000001E2 ABS 643 FRASWLCKL EQU 01E2 set acct wallclock limit (in min) 000001E3 ABS 644 FRASWLCKU EQU 01E3 set acct wallclock time used 000001E4 ABS 645 FRASDSKL EQU 01E4 set acct disk block limit 000001E6 ABS 646 FRASWARN EQU 01E6 set acct soft block limit 000001E7 ABS 647 FRASSAVL EQU 01E7 set acct saved disk limit 000001E8 ABS 648 FRASSSCF EQU 01E8 set acct subsystem control flags 000001EA ABS 649 FRASFAC EQU 01EA set acct file access control 000001EB ABS 650 FRASPWAC EQU 01EB set acct password access control 000001ED ABS 651 FRASACCT EQU 01ED set acct accounting control 652 * (R0:=request|R1:=ptr to filename buffer|FREQ unit|R0=error code) 000001EE ABS 653 FRASINITP EQU 01EE set account initial program 654 * (R0:=request|R1:=string len|R2:=ptr to string|FREQ unit| 655 * R0=error code) 000001EF ABS 656 FRASACCTT EQU 01EF set account title 657 * (R0:=request|R1:=ptr passwords|FREQ unit|R0=error code) 000001F0 ABS 658 FRASPASS EQU 01F0 set account logon password 659 * (R0:=request|R1:=new value|FREQ unit|R0=error code) 000001F2 ABS 660 FRASDFLTR EQU 01F2 set acct default restrictions 661 662 * (R0:=request | R1:= 1 or 0 | FREQ unit | R0:=error code) 000001F3 ABS 663 FRASENCF EQU 01F3 set account encryption flag 664 665 * (R0:=request | FREQ unit | R0:=error code or dynamic status) 00000200 ABS 666 FRFILELOCK EQU 0200 lock files implicit .LOCK 00000201 ABS 667 FRFILEULOK EQU 0201 unlock files implicit .LOCK 668 * (R0:=request | R1:=resource# | FREQ unit | R0:=error code or dynamic status) 00000203 ABS 669 FRRESLOCKR EQU 0203 lock file resource lock for read 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 147 (VIRTDEFS) F 9 Executive Request (XREQ) codes 00000204 ABS 670 FRRESLOCKW EQU 0204 lock file resource lock for write 00000205 ABS 671 FRRESULOCK EQU 0205 unlock files resource lock 672 * (R0:=request|FREQ unit|R0=error code or dynamic status| 673 * R1=0 (no lock), 1 (unlocked lock), or 2 (locked lock)) 00000202 ABS 674 FRFILELOKT EQU 0202 test state of files implicit .LOCK 675 * (R0:=request|R1:=resource#|FREQ unit|R0=error code or dynamic status| 676 * R1=0 (no lock), 1 (write locked), or 2 (read locked)| 677 * R2=session number of a locker, if R1=1 or 2) 00000206 ABS 678 FRRESLOKT EQU 0206 test state of files resource lock 00000206 ABS 679 FRRESLOCKT EQU 0206 test state of files resource lock 680 681 * (R0:=request|FREQ unit|R0=errorcode or dynamic status) 00000210 ABS 682 FRUNITID EQU 0210 unit interrupt disable 00000211 ABS 683 FRUNITIE EQU 0211 unit interrupt enable 684 * (R0:=request|FREQ unit|R0=error code|R1=non-zero if enabled) 00000212 ABS 685 FRUNITIGET EQU 0212 unit interrupt flag state get 686 687 * (R0:=request|R1:=echo unit|FREQ unit|R0=errorcode or dynamic status) 00000240 ABS 688 FRECHOUNIT EQU 0240 enable echoing of read lines 689 * (R0:=request|FREQ unit|R0=errorcode or dynamic status) 00000241 ABS 690 FRECHOOFF EQU 0241 disable echoing of read lines 691 * (R0:=request|FREQ unit|R0=errorcode or dynamic status|R1=unit) 00000242 ABS 692 FRECHOGET EQU 0242 get the echo unit (zero if none) 693 * (R0:=request|R1:=buffer length|R2:=buffer address|FREQ unit| 694 * R0=dynamic status or error code) 00000250 ABS 695 FRSETVVFU EQU 0250 load and enable line printer VVFU 696 * (R0:=request|FREQ unit|R0=dynamic status or error code) 00000251 ABS 697 FRCLRVVFU EQU 0251 disable line printer VVFU 698 699 * (R0:=request|R1:=read-unit|FREQ write-unit|R0=error-code) 00000270 ABS 700 FRMAKEPATH EQU 0270 create path, opening both ends 701 702 * (R0:=request|R1:=unit|FREQ unit|R0=error code or static status of unit) 00000290 ABS 703 FRRESSWTCH EQU 0290 switch resources associated with units 704 705 ********************************************************************************** 706 * * 707 * When extending the range of FREQ constants, please * 708 * update the table of maximum values, XREQMAXTAB. * 709 * * 710 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 148 (VIRTDEFS) F 9 Executive Request (XREQ) codes 712 713 ********************************************************************************** 714 * * 715 * UREQs * 716 * The user requests (UREQs) perform operations related * 717 * to the users session ( or to sessions that it controls ). * 718 * The operand of the UREQ is usually not used, but it may * 719 * contain either a session number or a process serial number. * 720 * A process serial number or session number of 0 refers to * 721 * the process/session itself. Negative process serial * 722 * numbers refer to under processes in the process tree * 723 * relative to the position of the current process. Positive * 724 * process serial numbers refer directly to another * 725 * underprocess. A positive session number refers directly to * 726 * a session on the system. The user must, of course, have * 727 * the proper privileges to access other sessions. Negative * 728 * session numbers are undefined. * 729 * * 730 ********************************************************************************** 731 732 * (R0:=request|R1:=value|R2,R3:=variable-name|UREQ 0| 733 * R0=error-code) 00000010 ABS 734 URVARSET EQU 0010 set variable 735 * for string: (R0:=request|R1:=char addr of string| 736 * R2,R3:=variable-name|UREQ buffer length| 737 * R0:=error-code) 00000011 ABS 738 URVARSETS EQU 0011 set string variable 739 740 * (R0:=request|R2,R3:=variable-name|UREQ 0|R0=error-code| 741 * R1=value) 00000020 ABS 742 URVARGET EQU 0020 get variable 743 * for string: (R0:=request|R1:=buffer address| 744 * R2,R3:=variable-name|UREQ buffer length| 745 * R0=error-code [or 0=number, 1=string]| 746 * R1=value or bufferlen-stringlen) 00000021 ABS 747 URVARGETS EQU 0021 get string variable 748 749 * (R0:=request|R1:=buffer addr|R2:=error number|UREQ bufferlen| 750 * R0=error code|R1=buffer remaining) 00000028 ABS 751 URERRORGET EQU 0028 get string for error number 752 753 * (R0:=request|UREQ|R0=error-code|R1=number-of-terms-on| 754 * R2=number-of-sessions) 00000050 ABS 755 URTRAFFIC EQU 0050 get system traffic 00000051 ABS 756 URLOADFACT EQU 0051 get system load factor in R1 757 * (R0:=request|R1:=buffer size|R2:=buffer address| 758 * UREQ -1, 0, or session number|R0=error code|R1=buffer remaining) 00000052 ABS 759 URSESSINFO EQU 0052 get session information 00000052 ABS 760 URPROCINFO EQU 0052 (old name for URSESSINFO) 761 * (R0:=request|UREQ 0|R1=system serial number|R2=system name in PAK6) 00000053 ABS 762 URGETSSN EQU 0053 return system serial number and name 763 * (R0:=request|UREQ 0|R2,R3=system version in ASCII) 00000054 ABS 764 URGETVERS EQU 0054 return system version in ASCII 765 * (R0:=request|R1:=program number|UREQ 0|R0=0 if ok to run, non-zero otherwise) 00000055 ABS 766 URMAYIRUN EQU 0055 see if proprietary program may run 767 * (R0:=request|R1:=buffer size|R2:=buffer address|UREQ 0| 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 149 (VIRTDEFS) F 9 Executive Request (XREQ) codes 768 * R0=error code|R1=buffer remaining) 00000056 ABS 769 URUDRPINFO EQU 0056 get under process information 770 * (R0:=request|R1:=buffer size|R2:=buffer address|UREQ | 771 * R0=error code|R1=buffer remaining) 00000057 ABS 772 URLUNITS EQU 0057 get local unit information 773 * (R0:=request|UREQ 0|R0=error code|R1=process level(CM=0)) 00000058 ABS 774 URPROCLVL EQU 058 get level in process tree 775 776 * (R0:=request|UREQ|R0=error-code|R1=timezone|R2,R3=system-date) 777 * The timezone word contains the three letter abb. for 778 * the local time zone in chars 0-2 and char 3 holds 779 * a signed 8 bit integer that is the offset (in hours) 780 * from UT for the specified time zone. 00000060 ABS 781 URRAWDATE EQU 0060 get date and time 00000061 ABS 782 URFSERNO EQU 0061 same except has uniqueness property 783 * (R0:=request|UREQ|R0=error-code if negative| 784 * R0/BITS 11:22=year|R0/BITS 23:26=month| 785 * R0/BITS 27:31=date|R1=timezone|R2=time of day| 786 * R3=day of week) 00000062 ABS 787 URUNRDATE EQU 0062 unpack rawdate 00000063 ABS 788 URUNLDATE EQU 0063 make rawdate local, unpack 789 * (R0:=request|R2,R3:=time to unpack|UREQ|R0=error-code 790 * if negative|R0/BITS 11:22=year|R0/BITS 23:26=month| 791 * R0/BITS 27:31=date|R1=timezone|R2=time of day| 792 * R3=day of week) 00000064 ABS 793 URUGDATE EQU 0064 unpack time given 00000065 ABS 794 URULDATE EQU 0065 make time given local, unpack 795 796 * (R0:=request|R1:=timezone (not needed for local conversion)| 797 * R2:=time of day|R3/bits 0:22:=year|R3/bits 23:26:=month| 798 * R3/bits 27:31:=date|UREQ|R0,R1=system time) 0000006C ABS 799 URPAKTIME EQU 006C pack time, given time zone 0000006D ABS 800 URPAKTIML EQU 006D pack time, given local time 801 802 * (R0:=request|UREQ) 00000070 ABS 803 URSTOP EQU 0070 program termination 00000071 ABS 804 URSTOPZ EQU 0071 stop and zero virtual memory 00000072 ABS 805 URSTOPR EQU 0072 stop and reset units 00000073 ABS 806 URSTOPZR EQU 0073 stop. zero and reset 00000074 ABS 807 URSTOPI EQU 0074 stop and increment PC 00000078 ABS 808 URSTOPA EQU 0078 stop and set abort status 00000079 ABS 809 URSTOPAZ EQU 0079 stop. abort and zero 0000007A ABS 810 URSTOPAR EQU 007A stop. abort and reset 0000007B ABS 811 URSTOPAZR EQU 007B stop. abort,zero,reset 0000007C ABS 812 URSTOPIA EQU 007C stop, increment PC, and set abort 813 814 * (R0:=request|R1:=bit mask|UREQ psn|R1=new contents) 00000080 ABS 815 URSSINTARM EQU 0080 selectively set interrupt arming mask 00000081 ABS 816 URSCINTARM EQU 0081 selectively clear interrupt arming mask 817 * (R0:=request|UREQ ADR regarea|R0=error-code) 00000082 ABS 818 URINTRTN EQU 0082 return from interrupt 819 820 * (R0:=request|UREQ 0|R0:=error code) 00000085 ABS 821 URSETDEBUG EQU 0085 set flag saying process is a debugger 00000086 ABS 822 URCLRDEBUG EQU 0086 clear flag saying whether debugger 823 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 150 (VIRTDEFS) F 9 Executive Request (XREQ) codes 824 * (R0:=request|R1=error code|R2=param|UREQ 825 * |R0:=error code or termination code|R1=sub-code|R3:=psn ) 00000087 ABS 826 URSENDERR EQU 0087 send error to specified underprocess 827 828 * (R0:=request|UREQ |R0:=zero|error code) 00000088 ABS 829 URSERPROC EQU 0088 receive errors from specified underprocess 00000089 ABS 830 URCERPROC EQU 0089 clear receiving errors from underprocess 831 832 * (R0:=request|R1:= psn|UREQ ADR regarea|R0=error-code) 0000008A ABS 833 URINTRGO EQU 008A return from interrupt to underprocess 834 835 * (R0:=request|UREQ|R0=error-code) 00000090 ABS 836 URBYE EQU 0090 logoff request 837 838 * (R0:=request|R1:=new-limit|UREQ psn|R0=error-code| 839 * R1=CPU-limit|R2=CPU-time-used) 000000A0 ABS 840 URCPTIMES EQU 00A0 CPU time limit set 841 * (R0:=request|UREQ psn|R0=error-code| 842 * R1=CPU-limit|R2=CPU-time-used) 000000A1 ABS 843 URCPTIMEG EQU 00A1 CPU time use/limit get 844 * (R0:=request|UREQ psn|R0=error-code|R0,1=sessiom-WC-limit| 845 * R2=session-WC-used) 000000A7 ABS 846 URSESWCLK EQU 00A7 session wallclock used and limit get 847 * (R0:=request|UREQ psn|R0=error-code|R0,1=session-WC-limit| 848 * R2=session-WC-used) 000000A8 ABS 849 URACCTCPUL EQU 00A8 limiting acct CPU time use/limit get 850 * (R0:=request|UREQ psn|R0=error-code|R1=account-WC-limit| 851 * R2=account-WC-used) 000000A9 ABS 852 URACCTWCL EQU 00A9 limiting acct WC time used/limit get 853 854 * (R0:=request|R1=new-limit|UREQ psn|R0=error-code| 855 * R1=session-limit|R2=session-in-use) 000000B0 ABS 856 URSESBLKS EQU 00B0 session limit set 857 858 * (R0:=request|UREQ psn|R0=error-code| 859 * R1=session-limit|R2=session-used) 000000B1 ABS 860 URSESBLKG EQU 00B1 session limit get 861 862 * (R0:=request|UREQ 0|R1=hard-limit|R2=soft-limit|R3=saved-limit) 000000B2 ABS 863 URBLKLIM EQU 00B2 get account's block limits 864 865 * (R0:=request|UREQ 0|R1=blocks-used|R2=soft-limit|R3=saved-limit) 000000B3 ABS 866 URBLKUSED EQU 00B3 get account's block usage 867 868 * (R0:=request|UREQ pagenum|R0=error-code) 000000C0 ABS 869 URFREEPAGE EQU 00C0 release memory page 870 * (R0:=request|R1=pagenum|UREQ psn|R0=pagetype or errorcode| 871 * R1=other info) 000000C1 ABS 872 URPAGETYPE EQU 00C1 get association of page in memory 873 * (R0:=request|UREQ pagenum|R0=error code) 000000C2 ABS 874 UREXCLPAGE EQU 00C2 make page unreferencable 000000C4 ABS 875 URFORCEP EQU 00C4 force write this page, wait for xfer 000000C5 ABS 876 URWRITEP EQU 00C5 force write this page, don't wait for xfer 877 878 * (R0:=request|UREQ process-serial-number| 879 * R0=termination-code|R1=subcode|R2=process-serial-number) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 151 (VIRTDEFS) F 9 Executive Request (XREQ) codes 880 * (if R0=UINTPTERM, then R1=right 4 bits of URSTOPxx) 000000D0 ABS 881 URPGO EQU 00D0 set a program running 000000D4 ABS 882 URPSTEP EQU 00D4 single step a program 883 * (R0:=request|UREQ -1,0, or session number|R0=error-code) 000000D2 ABS 884 URPDSTRY EQU 00D2 destroy a session or the 885 immediate under process 886 * (R0:=request|UREQ -1 |R0=error-code) 000000D3 ABS 887 URPDSTRYA EQU 00D3 destroy all under processes 888 * (R0:=request|UREQ psn |R0=error-code) 000000D5 ABS 889 URPDSTRYP EQU 00D5 destroy an under process 000000D6 ABS 890 URPDSTRYAP EQU 00D6 destroy all under processes 891 of a given under process 892 893 * (R0:=request+register|R1:=new-contents|UREQ process-serial-number| 894 * R0=error-code|R1=previous-register-contents) 895 * registers: 896 * 0 => R0 ... 7 => R7, 8 = PC 897 * 9 => PSR, 10 => int mask 898 * 11 => interrupt address. 12:15 => errors 000000E0 ABS 899 URPSETREG EQU 00E0 set a process register 900 901 * (R0:=request+register|UREQ psn|R0=error-code| 902 * R1=register-contents) 000000F0 ABS 903 URPGETREG EQU 00F0 get a process register 904 905 * (R0:=request|R1:=char-pointer|UREQ 0|R0=item-type or error-code| 906 * R1=pntr-to-terminator|(R2,R3)=packed-item) 00000100 ABS 907 URPACKI EQU 0100 pack an item 908 * (R0:=request|R1:=char-pointer|R2:=pointer-to-block|UREQ 0| 909 * R0=error-code|R1=pntr-to-terminator) 00000101 ABS 910 URPACKFI EQU 0101 pack a file specifier item 00000102 ABS 911 URPACKFS EQU 0102 pack a complete file specifier 912 913 * (R0:=request|R1:=requester page|R2:=others page| 914 * UREQ psn|R0=error code) 00000110 ABS 915 URMAPINAS EQU 0110 mapin other address space 916 917 * (R0:=request|UREQ psn|R0=error-code or run unit if no error) 00000120 ABS 918 URGRUNLUN EQU 0120 get the run unit number 919 * (R0:=request|UREQ unit|R0=error code|R1=next unit) 00000121 ABS 920 URNEXTLUN EQU 0121 find next higher in use unit 921 * (R0:=request|UREQ unit|R0=error code|R1=next free unit) 00000122 ABS 922 URFREELUN EQU 0122 find next lower free unit 923 * (R0:=request|R1:=current #|R2:=target unit #|UREQ psn|R0=error code) 00000123 ABS 924 URGIVELUN EQU 0123 pass unit to an underprocess 925 926 * (R0:=request|R1:=mode to load|UREQ psn| 927 * R0=error code|R1=-1 or effective address) 00000130 ABS 928 URLEA EQU 0130 do LEA in other address space 00000131 ABS 929 URLEA2 EQU 0131 do LEA2 in other address space 930 931 * (R0:=request|R1:=seconds|R2:=event mask|UREQ 0|R0=error code| 932 * R1=seconds remaining|R2=event|R3=event parameter) 00000140 ABS 933 URDELAY EQU 0140 delay for the given seconds 00000143 ABS 934 URDELAYR EQU 0143 restore console terminal 935 * (R0:=request|R1:=seconds|UREQ 0|R0=error code|R1=seconds remaining 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 152 (VIRTDEFS) F 9 Executive Request (XREQ) codes 936 * on previous request) 00000141 ABS 937 URSETTIMIN EQU 0141 set timer interrupt 938 * (R0:=request|UREQ 0|R0=error code|R1=seconds remaining) 00000142 ABS 939 URCLRTIMIN EQU 0142 clear timer interrupt 940 941 * (R0:=request|R1:=message size|R2:=address|UREQ 0| 942 * R0=error code) 00000150 ABS 943 URGENOPMSG EQU 0150 generate message to operator 944 * (R0:=request|UREQ 0|R0=error code) 00000151 ABS 945 URCANOPMSG EQU 0151 cancel message to operator 946 947 * (R0:=request|R1:=message-size|R2:=address|UREQ 0|R0=error code) 00000160 ABS 948 URSENDMSG EQU 0160 send message to other session 949 * (R0:=request|R1:=buffer-size|R2:=address|UREQ message-class-mask| 950 * R0=error-code|R1=buffer-remaining) 00000161 ABS 951 URGETMSG EQU 0161 receive message from other session 952 * (R0:=request|UREQ 0|R0=error-code|R1=message-class-mask) 00000162 ABS 953 URGETMSGA EQU 0162 get mask of acceptable messages 954 * (R0:=request|R1=bits-to-set/clear|UREQ 0|R0=error-code|R1=bits-changed) 00000163 ABS 955 URSSMSGA EQU 0163 sets bits in mask of acceptable messages 00000164 ABS 956 URSCMSGA EQU 0164 clear bits in mask of acceptable messages 957 958 * (R0:=request|R1:=length-of-name|R2:=address-of-name|UREQ 0| 959 * R0=error-code|R1=session-number) 00000170 ABS 960 URGETPNUM EQU 0170 lookup server name 961 962 * (R0=request|R2,3:=new-program-name|UREQ 0| 963 * R0:=error-code|R2,3:=old-program-name) 00000180 ABS 964 URCNAME EQU 0180 change program name 965 * (R0:=request|UREQ |R0=error-code) 00000181 ABS 966 URSETLGFSES EQU 0181 set session to give message at logoff 967 * (R0:=request|R1:=privs-to-release|UREQ 0|R0=error-code) 00000182 ABS 968 URDROPPRIV EQU 0182 relinquish program privileges 969 970 * (R0=request|R1=unit number|R2=privilege|UREQ ) 00000190 ABS 971 URGIVEUNIT EQU 0190 give a unit to another session 972 * (R0=request|UREQ | 973 * R0=error-code|R1=|R2=) 00000191 ABS 974 URRCVUNIT EQU 0191 receive a unit from another session 975 976 ********************************************************************************** 977 * * 978 * When extending the range of UREQ constants, please * 979 * update the table of maximum values, XREQMAXTAB. * 980 * * 981 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 153 (VIRTDEFS) F 9 Executive Request (XREQ) codes 983 984 ********************************************************************************** 985 * * 986 * OPREQs * 987 * Operator requests (OPREQs) are provided for operator, * 988 * manager, and control mode functions. Processes must have * 989 * the proper privileges to do OPREQs. * 990 * * 991 ********************************************************************************** 992 993 * (R0:=request|R1:=pntr-to-PAK12 name,PAK6 proj,PAK12 pwd|OPREQ 0| 994 * R0=error-code) 00000010 ABS 995 ORHELLO EQU 0010 logon request 996 * (R0:=request|OPREQ|R0=error-code|R1=wall clock time used) 00000011 ABS 997 ORGOODBYE EQU 0011 disassign user and do accounting 998 * (R0:=request|R1=>equip name buffer|OPREQ 0|R0=error code) 00000012 ABS 999 ORLOGONP EQU 0012 fetch logon program name 1000 * (R0:=request|R1:=options|OPREQ |R0=error-code) 00000013 ABS 1001 ORATTACH EQU 0013 attach to a session 1002 * (R0:=request|OPREQ |R0=error-code) 00000014 ABS 1003 ORRESETVM EQU 0014 reset virtual memory 1004 1005 * (R0:=request|OPREQ) 00000020 ABS 1006 ORVANISH EQU 0020 vanish request 1007 1008 * (R0:=request|OPREQ) 00000030 ABS 1009 ORSLEEP EQU 0030 sleep request 1010 1011 * (R0:=request|R2,R3:=password|OPREQ =pak6 drive name| 1012 * R0=error code|R0=number of accounts|R1=number of shadows| 1013 * R2,R3=volume name) 00000040 ABS 1014 ORMOUNT EQU 0040 mount a volume given drive name 1015 * (R0:=request|R2,R3:=volume name|OPREQ|R0=error code) 00000041 ABS 1016 ORDISMOUNT EQU 0041 dismount a volume given volume name 1017 * (R0:=request|R1:=non-zero to inhibit|R2,R3:=volume name| 1018 * OPREQ|R0=error code) 00000042 ABS 1019 ORINHIBVOL EQU 0042 inhibit/allow volume access 1020 * (R0:=request|R1:=buffer size|R2:=buffer adr|OPREQ 0| 1021 * R0=error code|R1=buffer remaining) 00000043 ABS 1022 ORVINFO EQU 0043 get volume information 1023 * (R0:=request|R1:=buffer size|R2:=buffer adr|OPREQ unit (.vol)| 1024 * R0=error code|R1=buffer remaining) 00000044 ABS 1025 ORVOLINFO EQU 0044 get volume information 1026 * (R0:=request|OPREQ drivename|R0=error code) 00000045 ABS 1027 ORDISMTDRV EQU 0045 dismount volume given drive name 1028 * (R0:=request|R2,R3:=volume name|OPREQ| 1029 * R0=error code|R0=number of accounts|R1=number of shadows| 1030 * R2,R3=volume name) 00000046 ABS 1031 ORMOUNTVOL EQU 0046 mount volume given volume name 1032 * (R0:=request|R1:=buffer size|R2:=buffer adr|OPREQ unit (.vol)| 1033 * R0=dynstat or errorcode|R1=buffer remaining) 00000047 ABS 1034 ORBUSYVOL EQU 0047 get accounts busy on a volume 1035 1036 * (R0:=request|R1:=pntr-to-param-block|OPREQ 0| 1037 * R0=error-code) 00000050 ABS 1038 ORCREACCT EQU 0050 manager create account 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 154 (VIRTDEFS) F 9 Executive Request (XREQ) codes 00000051 ABS 1039 ORBKCACCT EQU 0051 backup create account 1040 1041 * (R0:=request|OPREQ unit (.dir)|R0=error-code) 00000060 ABS 1042 ORDESACCT EQU 0060 destroy an account 1043 1044 * (R0:=request|OPREQ portnum|R0=error code) 00000070 ABS 1045 ORPINHIB EQU 0070 inhibit port access 00000071 ABS 1046 ORPALLOW EQU 0071 allow port access 1047 * (R0:=request|R1:=buffer size|R2=buffer adr| 1048 * OPREQ -1, 0, or portnum|R0=error code|R1=buffer remaining) 00000072 ABS 1049 ORPINFO EQU 0072 port information fetch 1050 * (R0:=request|OPREQ portnum|R0=error code) 00000073 ABS 1051 ORPWARN EQU 0073 warn port is inhibited 1052 * (R0:=request|OPREQ portnum|R0=error code) 00000074 ABS 1053 ORPRESET EQU 0074 reset a ports configuration 1054 1055 * (R0:=request|R1:=zone name|OPREQ GMT difference|R0=error code) 00000080 ABS 1056 ORTZONE EQU 0080 set system local time zone 1057 * (R0:=request|R1:=time correction|OPREQ 0|R0:=error code) 00000081 ABS 1058 ORTADJUST EQU 0081 correct system time by gradual adjustment 1059 1060 * (R0:=request|OPREQ 0|R0,R1:=time of last correction| 1061 * R2=current clock error (ms), + sez slow|R3=drift 1062 * (ppb), + sez clock loses time) 00000082 ABS 1063 ORTIMPAR EQU 0082 get clock adjustment variables 1064 1065 * (R0:=request|OPREQ |R0=error code) 00000090 ABS 1066 ORPTERMIN EQU 0090 "terminate" a session 00000091 ABS 1067 ORPEVICT EQU 0091 "evict" a session 00000092 ABS 1068 ORSESSINFO EQU 0092 fetch session information (see URSESSINFO) 00000092 ABS 1069 ORPROCINFO EQU 0092 (old name for ORSESSINFO) 00000093 ABS 1070 ORPABORT EQU 0093 "abort" a session 1071 1072 * (R0:=request|R1:=buffer size|R2:=buffer address|OPREQ 0| 1073 * R0=dynstat or errorcode|R1=buffer remaining) 000000A0 ABS 1074 ORREADAFT EQU 00A0 read account finder table 1075 * (R0:=request|R1:=buffer size|R2:=buffer address| 1076 * OPREQ unit (.vol)|R0=error code|R1=buffer remaining) 000000A1 ABS 1077 ORREADIDX EQU 00A1 read IDX from a volume 1078 * (R0:=request|OPREQ unit (.dir)|R0=dynstat or errorcode) 000000A2 ABS 1079 ORADDAFT EQU 00A2 add entry to the AFT 000000A3 ABS 1080 ORDELAFT EQU 00A3 delete entry from the AFT 1081 1082 * (R0:=request|R1:=pak6 device name|OPREQ unit(unused)| 1083 * R0=error code|R2,3=volume name) 000000B0 ABS 1084 ORMOUNTMAI EQU 00B0 maint mount pack(no IDX AFT) 000000B1 ABS 1085 ORVOLHANDLE EQU 00B1 fully maint mount a pack 1086 1087 * (R0:=request|R1:=buffer size|R2:=buffer addr|OPREQ unit (.vol)| 1088 * R0=dynstat or errorcode|R1=buffer remaining) 000000C0 ABS 1089 ORBKUPVOL EQU 00C0 get volume backup information 000000C1 ABS 1090 ORBKUPACT EQU 00C1 get account backup information 000000C2 ABS 1091 ORBKUPFIL EQU 00C2 get file backup information 000000C3 ABS 1092 ORGETFP EQU 00C3 get file data to backup 1093 1094 * (R0:=request | R1:=time stamp | OPREQ unit (.vol) | 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 155 (VIRTDEFS) F 9 Executive Request (XREQ) codes 1095 * R0:=error code) 000000C4 ABS 1096 ORBKUPDONE EQU 00C4 place time stamp on disk 1097 1098 * (R0:=request|R1:=buffer size|R2:=buffer addr|R3:=page #| 1099 * OPREQ unit (.vol)|R0=dynstat or errorcode|R1=buffer remaining) 000000C5 ABS 1100 ORMAPFP EQU 00C5 mapin file data to backup 1101 1102 * (R0:=request|R1:=buffer size|R2:=buffer addr|OPREQ unit (.vol)| 1103 * R0=dynstat or errorcode) 000000D0 ABS 1104 ORINITVOL EQU 00D0 initialize volume for recovery 000000D1 ABS 1105 ORRCVRACT EQU 00D1 initialize account for recovery 000000D2 ABS 1106 ORRCVRFIL EQU 00D2 initialize file for recovery 000000D3 ABS 1107 ORPUTFP EQU 00D3 output file recovery data (old style) 000000D6 ABS 1108 ORRCVRACTL EQU 00D6 account recovery/limits adjustments 1109 1110 * (R0:=request|OPREQ unit (.vol)|R0=errorcode or dynstat) 000000D4 ABS 1111 ORINITEND EQU 00D4 say recovery done 1112 1113 * (R0:=request|R1:=buffer size|R2:=buffer addr|R3:=page #| 1114 * OPREQ unit (.vol)|R0=dynstat or errorcode) 000000D5 ABS 1115 ORPUTPFP EQU 00D5 recover paged recovery data 1116 1117 * (R0:=request|R1:=CPU time allocatable|OPREQ unit (.dir)|R0=errorcode) 000000E0 ABS 1118 ORCREAUTHL EQU 00E0 create auth list 1119 * (R0:=request|R1:=CPU time allocatable|OPREQ unit (.dir)|R0=errorcode| 1120 * R1=prev CPU time allocatable|R2=CPU time allocated) 000000E1 ABS 1121 ORCHGAUTHL EQU 00E1 change auth list 1122 * (R0:=request|OPREQ unit (.dir)|R0=errorcode|R1=prev CPU time allocatable| 1123 * R2=CPU time allocated) 000000E8 ABS 1124 ORDESAUTHL EQU 00E8 destroy auth list 000000E9 ABS 1125 ORGETAUTHL EQU 00E9 get auth list values 1126 1127 * (R0:=request|R2,R3:=volume name|OPREQ unit (.dir)|R0=errorcode) 000000F0 ABS 1128 ORCREAUTHE EQU 00F0 create auth list entry 000000F8 ABS 1129 ORDESAUTHE EQU 00F8 destroy auth list entry 1130 1131 * (R0:=request|R1:=new value|R2,R3:=volume name|OPREQ unit (.dir)|R0=errorcode| 1132 * R1=old allocatable value|R2=value allocated) 000000F2 ABS 1133 ORCAUTHDL EQU 00F2 change auth entry disk space allocatable 000000F3 ABS 1134 ORCAUTHSL EQU 00F3 change auth entry saved allocatable 1135 * (R0:=request|R2,R3:=volume name|OPREQ unit (.dir)|R0=errorcode| 1136 * R1=amount allocatable|R2=amount allocated) 000000FA ABS 1137 ORGAUTHDL EQU 00FA get disk space allocatable 000000FB ABS 1138 ORGAUTHSL EQU 00FB get saved allocatable 1139 * (R0:=request|R1:=buffer size|R2:=buffer addr|OPREQ unit (.dir)| 1140 * R0=error code|R1=buffer remaining) 000000FF ABS 1141 ORGAUTENS EQU 00FF get auth list entries (the whole thing) 1142 1143 * (R0:=request|R1:=ADR buffer|OPREQ 0|R0=error-code|R2,3=44-bit UT date) 00000101 ABS 1144 ORREADCNT EQU 0101 fetch block read counts 00000102 ABS 1145 ORWRITECNT EQU 0102 fetch block write counts 00000103 ABS 1146 ORRWCOUNTS EQU 0103 fetch both read and write counts 1147 1148 * (R0:=request|R1:=buffersize|R2:=bufferaddr|OPREQ 0| 1149 * R0=errorcode|R1=buffer remaining) 00000110 ABS 1150 ORDEVINFO EQU 0110 fetch system device information 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 156 (VIRTDEFS) F 9 Executive Request (XREQ) codes 1151 1152 * (R0:=request|R1=trace classes|OPREQ 0|R0=errorcode) 00000120 ABS 1153 ORSTRTTRC EQU 0120 start system trace 1154 * (R0:=request|OPREQ 0|R0=errorcode) 00000121 ABS 1155 ORSTRTMON EQU 0121 start system instruction monitor 00000122 ABS 1156 ORSTRTDYNW EQU 0122 start system dynamic wait monitor 00000123 ABS 1157 ORSTRTXMON EQU 0123 start system XREQ call monitor 1158 1159 * (R0:=request|R1:=buffersize|R2:=bufferaddr|OPREQ 0| 1160 * R0=errorcode|R1=buffer remaining) 00000130 ABS 1161 ORSTOPTRC EQU 0130 stop system trace and return results 00000131 ABS 1162 ORSTOPMON EQU 0131 stop system instruction monitor and give results 00000132 ABS 1163 ORSTOPDYNW EQU 0132 stop dynamic wait monitor and give results 00000133 ABS 1164 ORSTOPXMON EQU 0133 stop XREQ call monitor and give results 00000138 ABS 1165 ORGETTRC EQU 0138 return trace info (but don't stop trace) 1166 1167 * definition of control field in R0 for ORMAINTR and ORMAINTW 00002630 BYTE 1168 XRMAIFLD EQU BITS 19:21 field holding maintenance information 00001000 ABS 1169 XRNOSUB EQU 4*XRMAIFLD indicates no substitutions 00000800 ABS 1170 XRNOERRS EQU 2*XRMAIFLD indicates no error recovery/retries 00000400 ABS 1171 XRWWCHK EQU 1*XRMAIFLD indicates to perform write-check 1172 1173 * (R0:=request + control|R1:=ADR block buffer|R2:=ADR FBI buffer| 1174 * R3:=MS address|OPREQ unit (.vol)|R0=error code) 00000140 ABS 1175 ORMAINTR EQU 0140 maintenance read 00000142 ABS 1176 ORMAINTRSUB EQU 0142 maintenance read and substitute 1177 * (R0:=request|R1:=address|OPREQ 0|R0=error code|R2=data) 00000141 ABS 1178 ORREADNVM EQU 0141 get data from NVM 1179 * (R0:=request + control|R1:=ADR block buffer|R2:=ADR FBI buffer| 1180 * R3:=MS address|OPREQ unit (.vol)|R0=error code) 00000150 ABS 1181 ORMAINTW EQU 0150 maintenance write 1182 * (R0:=request|R1:=address|R2:=data|OPREQ 0|R0=error code) 00000151 ABS 1183 ORWRITENVM EQU 0151 write data into NVM 1184 * (R0:=request|R1:=MS address|OPREQ unit (.vol)|R0=dynstat| 1185 * R1=PPU status|R2=BFD Controller status) 00000152 ABS 1186 ORFORMAT EQU 0152 format a track 1187 * (R0:=request|R1:=sec/trk|R2:=trk/cyl|OPREQ |R0=error-code) 00000153 ABS 1188 ORSECTRK EQU 0153 set sec/trk and trk/cyl 1189 * (R0:=request|R1:=new state|OPREQ |R0=error-code|R1=old state) 00000154 ABS 1190 ORHEADCHK EQU 0154 start/inhibit head checker 1191 * (R0:=request|OPREQ |R0=error-code 00000155 ABS 1192 ORINITFMT EQU 0155 prepare volume for formatting 00000156 ABS 1193 ORRESETDRV EQU 0156 reinitialize drive information 1194 * (R0:=request|R1:=message size|R2:=message address|OPREQ 0| 1195 * R0=message serial number or error code) 00000160 ABS 1196 ORGENOPMSG EQU 0160 generate message to operator 1197 * (R0:=request|R1:=buffer size|R2:=buffer address|OPREQ anything| 1198 * R0=error code|R1=buffer remaining) 00000161 ABS 1199 ORGETOPMSG EQU 0161 get messages to operator 1200 * (R0:=request|R1:=message serial number|OPREQ 0|R0=error code) 00000162 ABS 1201 ORCANOPMSG EQU 0162 cancel message to operator 1202 1203 * (R0:=request|R1:=name-length|R2:=name-address|OPREQ 0|R0=error-code) 00000170 ABS 1204 ORSETPNUM EQU 0170 set entry in server name table 00000171 ABS 1205 ORCLRPNUM EQU 0171 clear entry in server name table 1206 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 157 (VIRTDEFS) F 9 Executive Request (XREQ) codes 1207 * (R0:=request|R1:=length-of-output-file-name|R2:=addr-of-output-file-name| 1208 * R3:=addr-of-logon-info|OPREQ input-unit-number|R0=error-code-or- 1209 * session-number) 00000180 ABS 1210 ORSTRTBAT EQU 0180 start spooled batch job 1211 * (R0:=request|R1:=length-of-logon-string|R2:=addr-of-logon-string 1212 * R3:=terminal-output-unit|OPREQ terminal-input-unit| 1213 * R0=error-code-or-session-number) 00000181 ABS 1214 ORSTRTTERM EQU 0181 remote port startup 1215 * (R0:=request|OPREQ unit|R0=error-code-or-session-number) 00000182 ABS 1216 ORSTRTJOB EQU 0182 start spooler-less batch job 1217 * (R0:=request|OPREQ 0|R0=error-code-or-session-number) 00000183 ABS 1218 ORSTRTSPLR EQU 0183 start spooler session 1219 1220 * (R0:=request|R2,3:=new volume name|OPREQ unit (a .vol)| 1221 * R0=error code) 00000190 ABS 1222 ORCVOLNAME EQU 0190 change volume name 1223 * (R0:=request|R2,3:=new volume password|OPREQ unit (a .vol)| 1224 * R0=error code) 00000191 ABS 1225 ORCVOLPWD EQU 0191 change volume password 1226 * (R0:=request|R1:=new customer number|R2:=new system serial number| 1227 * OPREQ unit (a .vol)|R0=error code) 00000192 ABS 1228 ORCVOLSSN EQU 0192 change volume SSN 1229 * (R0:=request|R1:=new value|OPREQ unit (a .vol)| 1230 * R0=error code) 00000193 ABS 1231 ORCVOLNEWO EQU 0193 change volume new owner flag 1232 * (R0:=request|R1:=buffer len|R2:=ptr to string|OPREQ unit (a .vol)| 1233 * R0=error code) 00000194 ABS 1234 ORCVOLTITLE EQU 0194 change volume title 1235 * (R0:=request|OPREQ unit (a .vol)|R0=error code| 1236 * R2,3=volume name) 00000198 ABS 1237 ORGVOLNAME EQU 0198 get volume name 1238 * (R0:=request|OPREQ unit (a .vol)|R0=error code| 1239 * R1=customer number|R2=system number) 0000019A ABS 1240 ORGVOLSSN EQU 019A get system serial number 1241 * (R0:=request|OPREQ unit (a .vol)|R0=error code| 1242 * R1=new owner flag) 0000019B ABS 1243 ORGVOLNEWO EQU 019B get volume new owner flag 1244 * (R0:=request|R1:=buffer size|R2:=buffer ptr|OPREQ unit (a .vol)| 1245 * R0:=error code|R1:=buffer remaining) 0000019C ABS 1246 ORGVOLTITLE EQU 019C get volume title 1247 1248 * (R0:=request|R1:=info value index|OPREQ 0|R0=error-code|R2=value requested) 000001A0 ABS 1249 ORGSYSINFO EQU 01A0 fetch system information 1250 1251 * (R0:=request|R1:=CPU number|OPREQ process number (0 means me)|R0=error-code| 1252 * R1:=original CPU number (0 if none)) 000001B0 ABS 1253 ORSETCPU EQU 01B0 assign a process to a particular CPU 1254 * (R0:=request|R1:=CPU number|OPREQ 0|R0=error-code| 1255 * R1:=CPU number 000001B1 ABS 1256 ORCPUSTOP EQU 01B1 stop a CPU from active service 000001B2 ABS 1257 ORCPUSTRT EQU 01B2 restart a stopped CPU 1258 * (R0:=request|R1:=number of pages|OPREQ 0|R0=error-code) 000001C0 ABS 1259 ORTAKEPAGS EQU 01C0 remove physical memory from use 1260 * (R0:=request|OPREQ |R0=error code) 000001D0 ABS 1261 ORPSTOP EQU 01D0 "stop" a session 000001D1 ABS 1262 ORPGO EQU 01D1 restart a session 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 158 (VIRTDEFS) F 9 Executive Request (XREQ) codes 1263 1264 ********************************************************************************** 1265 * * 1266 * When extending the range of OPREQ constants, please * 1267 * update the table of maximum values, XREQMAXTAB. * 1268 * * 1269 ********************************************************************************** 16 INPUT XREQINFOMACS format for info returned by XREQs 2 * System variable definition macros version 4.7 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 159 (XREQINFOMACS) F 10 Macro Definitions 4 5 * 4.7 890120 Added VT. RC. 6 * 4.6 870815 Added FSSTATABS. DH. 7 * 4.5 860523 Added PILGFSESS field (PROCINFORD). JB. 8 * 4.4 851017 Addition of PISYSPROC field (PROCINFORD). JB. 9 * 4.3 C8504 Addition of DIRFLOG field. MH 10 * 4.2 C8411 Addition of macro LUINFORD. JB. 11 * 4.1 C8410 DIRSERNO(1) now DIRUNITNM for hardware devices. JB. 12 * 4.0 C8409 Addition of macro UNDRPINFORD. JB. 13 * 3.7 C8407 Removed LOCK RC 14 * 3.6 Addition of DTYPECT and DTYPEVOL. DH 15 * 3.5 Addition of BCD overflow detect enable and floating 16 * point reduced precision enable in PSRDEFS. DH 17 * 3.4 Addition of DIRTRANS field. JB. 18 * 3.4 Addition of length field to share list read data RC 19 * 3.3 Addition of DIRGHOST field RC 20 * 2.1 Change of FSSTATPRW and addition of FSPRIVBKUP,XO,NOT 21 * 1.3 New field in DIRINFORD. JL. 22 * A8110 New field in PROCINFORD. JL. 23 * A8109 New field in FILESTAT, new macro MSGDEFS. JL. 24 * A8104 New field in DIRINFORD, PROCINFORD. JL. 25 * A8102 Minor changes to PROCINFORD. JL. 26 * A8007 Minor changes to DIRINFORD and PROCINFORD. JL. 27 * A7909 Initial release. RA. 28 29 ********************************************************************************** 30 * * 31 * This is the definition of macros that define symbols * 32 * that are required in communication with the system. This * 33 * file is INPUT in assembly language programs and it defines * 34 * macros that, when invoked, define the requested group of * 35 * symbols. The macro invocation is of the form: * 36 * * 37 * macname [list] * 38 * * 39 * where "macname" is the name of the requested macro and "list" is * 40 * optionally included (the square brackets denote optionality) if the * 41 * body of the macro (i.e., the definition of the symbols) is to * 42 * be listed. * 43 * * 44 * Macros that are defined herein are: * 45 * * 46 * DIRINFORD Format of data returned by directory information reads. * 47 * FILESTAT Fields and values in the static and dynamic file status * 48 * words. * 49 * FLDDEFS Definitions of instruction and address field names. * 50 * MSGDEFS Definitions of messages passed via URSENDMSG. * 51 * PSRDEFS Fields and values in the Process Status Register. * 52 * PROCINFORD Format of data returned by session information request. * 53 * SHLINFORD Format of data returned by shared list read request. * 54 * UNDRPINFORD Format of data of the underprocess tree structure. * 55 * LUINFORD Format of data returned by the local unit request. * 56 * * 57 ********************************************************************************** 58 59 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 160 (XREQINFOMACS) F 10 Macro Definitions 60 DIRINFORD MACRO 61 NOLIST 62 $P 63 BOX 64 65 This is the format of information that is returned to 66 the user when he requests directory information. The 67 header is returned only when the .DIR is at load point. 68 After that the buffer is filled with an integral number of 69 entries, one for each file. 70 When the directory is exhausted, an end-of-data status 71 is returned. 72 73 EBOX 74 75 DIRHINFO BASE R0 Header giving account information 76 DIRHLNTH BSS 1 Length of entry in words (now 8) 77 DIRFLAGS BSS 1 Flags 78 DIRSHADOW EQU DIRFLAGS/BIT 0 On if a shadow account 79 DIRFOREIGN EQU DIRFLAGS/BIT 1 On if account not at home here 80 DIRNETWORK EQU DIRFLAGS/BIT 2 On if account accessed via network 81 DIRVOLUME BSS2 1 Volume account is on (PAK12) 82 DIRSYSTEM BSS 1 System account is on (PAK6) 83 DIRACCOUNT BSS2 1 Account name (PAK12) 84 DIRPROJECT BSS 1 Project of account (PAK6) 85 DRCT 86 DIRHWIDE EQU DISPW DIRHINFO Template length 87 ORG DIRHINFO Recover template space 88 89 90 BOX 91 92 Template for .DIR file entry block 93 94 EBOX 95 96 DIREINFO BASE R0 Entry for individual file 97 DIRENTLEN BSS 1 Entry length in words 98 DIRNAME BSS2 1 Name of file (PAK12) 99 DIREXT BSS 1 File name extension (PAK6) 100 DIRCREATD BSS 1 Creation date 101 DIRLACSD BSS 1 Last access date 102 DIRLMODD BSS 1 Last modified date 103 DIRLBKUPD BSS 1 Last backup date 104 105 DIRTOTRACS BSSB 16 Total read accesses 106 DIRTOTWACS BSSB 16 Total write accesses 107 108 DIRRACS BSSB 16 Currently active EQUIPs for RO 109 DIRWACS BSSB 16 Currently active EQUIPs for RW 110 111 DIRMWACS BSSB 16 Currently active EQUIPs for MW 112 DIRTFL BSSB 24 Total file length (in blocks) 113 DIRROOTBLK BSSB 24 Root block (or 0 if not GOD) 114 115 DIRTYPE BSSB 8 Type of file (see FSSTATDTYP) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 161 (XREQINFOMACS) F 10 Macro Definitions 116 DIRACCESS BSSB 4 Access allowed (see FSSTATACS) 117 DIRRAFTYPE BSSB 2 Empty, Tiny, Small, Large 118 BSSB 2 filler 119 DIRPRGINT BSSB 8 Purge interval 120 DIRPRGFLG BSSB 1 On if file was purged 121 DIRNOBKUP BSSB 1 On if file should not be backed up 122 DIRRCVRD BSSB 1 On if file recovered from backup 123 DIRFWWSC BSSB 1 On if file EQUIPed for W at crash 124 DIRFBC BSSB 1 On if file being closed 125 DIRGHOST BSSB 1 On if file not yet recovered from backup 126 DIRTRANS BSSB 1 On if file opened when user program crashed 127 DIRFLOG BSSB 1 On if file access should be logged 128 129 BSSB 1 unused filler 130 DIRLRAF BSSB 1 On if a large (2 level) .RAF 131 DIRCUSE BSSB 16 current use count 132 133 DIRUSRFLD BSS 1 user-definable field 134 DIRSERNO BSS2 1 file serial number 135 DIRUNITNM EQU DIRSERNO(1) unit number for hardware devices 136 BSS 0 *** filler *** 137 DRCT 138 DIRENTWIDE EQU DISPW DIREINFO Template size in words 139 ORG DIREINFO Recover template space 140 EMAC end of DIRINFORD 141 142 143 FILESTAT MACRO 144 NOLIST 145 $P 146 BOX 147 148 Definition of the fields and values for the static and 149 dynamic statuses of a file. 150 151 EBOX 152 153 * Format of File static status 154 * 155 * EQU BIT 0 always zero 156 FSSTATPRIV EQU BITS 14:17 privilege to access device 157 FSSTATCRT EQU BIT 18 file was created by OPEN 158 FSSTATACS EQU BITS 19:21 access allowed to device 159 * EQU BIT 22 unused - reserved 160 FSSTATABS EQU BIT 23 on if unit is absolute I/O 161 FSSTATWSC EQU BIT 24 on if file writing when system crashed 162 FSSTATSAV EQU BIT 25 on if device in directory somewhere 163 FSSTATDTYP EQU BITS 26:31 type code for the device 164 165 * Values for FSSTATPRIV 166 * (privilege implies what you would be allowed to have) 167 FSPRIVRW EQU 0 read/write 168 FSPRIVRO EQU 1 read only 169 FSPRIVMOD EQU 2 modify 170 FSPRIVXO EQU 3 execute only 171 FSPRIVBKUP EQU 8 backup 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 162 (XREQINFOMACS) F 10 Macro Definitions 172 FSPRIVNOT EQU 0F no privilege 173 FSPRIVNWB EQU BIT 31 bit, if on, implies no write possible 174 * Values for FSSTATACS 175 * (access implies what you actually requested and have) 176 FSACSRW EQU 0 read/write 177 FSACSRO EQU 1 read only 178 FSACSAO EQU 2 append only 179 FSACSXO EQU 3 execute only 180 FSACSMW EQU 4 multiple write 181 FSACSDR EQU FSACSMW+1 multiple write 182 FSACSNDA EQU 7 no data access 183 FSACSNWB EQU BIT 31 bit, if on, sez no write possible 184 * Values for FSSTATDTYP 185 DTYPEUNDEF EQU 0 undefined and illegal 186 DTYPESAF EQU 1 sequential access file 187 DTYPERAF EQU 2 random access file 188 DTYPECODE EQU 3 code file 189 DTYPEPATH EQU 4 communication path 190 DTYPEDIR EQU 5 directory 191 DTYPENULL EQU 6 output eater 192 DTYPETERM EQU 7 interactive terminal 193 * EQU 8 unused (was lock) 194 DTYPETASK EQU 9 "batch" job submission unit 195 DTYPECDR EQU 10 card reader 196 DTYPELP EQU 11 line printer 197 DTYPEMT EQU 12 magnetic tape 198 DTYPECT EQU 13 cartridge magnetic tape 199 DTYPEVOL EQU 14 a volume 200 DTYPEVT EQU 15 video tape 201 DTYPELAST EQU 16 last code plus one 202 203 204 * Format of a file's dynamic status 205 FDSTATAERR EQU BIT 0 on if error code not zero 206 FDSTATLUN EQU BITS 4:11 lun having this status 207 FDSTATRTYP EQU BITS 16:19 type of last record read 208 FDSTATLP EQU BIT 20 on if device positioned at beginning 209 FDSTATERR EQU BITS 21:31 error code 210 211 * Values for FDSTATRTYP - record types 212 FDRTYPSYSB EQU BIT 28 if on, record is either EOD or EOF 213 FDRTYPEODB EQU BIT 31 if FDRTYPSYSB also, then EOD 214 FDRTYPTEXT EQU 0 text record 215 FDRTYPTXTF EQU 1 text with forms control 216 FDRTYPBIN EQU 2 binary record 217 FDRTYPLBL EQU 4 label record 218 FDRTYPCOMM EQU 5 comment record 219 FDRTYPFM EQU 8 file mark (end of file, EOF) 220 FDRTYPEOD EQU 9 end of data (EOD) 221 FDRTYPAEOD EQU 11 abnormal end of date (AEOD) 222 EMAC of FILESTAT 223 224 225 FLDDEFS MACRO 226 NOLIST 227 $P 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 163 (XREQINFOMACS) F 10 Macro Definitions 228 BOX 229 230 Definition of useful instruction and address fields. 231 232 EBOX 233 234 FLDADRS EQU BITS 15:31 word address in a pointer 235 FLDCHARS EQU BITS 15:1 character address in a pointer 236 FLDBITS EQU BITS 15:4 bit address in a pointer 237 FLDPAGE EQU BITS 15:21 page number in word address 238 FLDRAFPAGE EQU BITS 0:19 page number in RAF byte address 239 FLDUPR15 EQU BITS 0:14 upper 15 bits of a word 240 FLDCH0 EQU BITS 0:7 character 0 in a word 241 FLDCH1 EQU BITS 8:15 character 1 in a word 242 FLDCH2 EQU BITS 16:23 character 2 in a word 243 FLDCH3 EQU BITS 24:31 character 3 in a word 244 FLDMODE EQU BITS 10:14 mode part of an operand 245 FLDIMMED EQU BITS 14:31 immediate part of operand 246 FLDOPND EQU FLDMODE+FLDADRS instruction operand 247 248 EMAC end of FLDDEFS 249 250 251 MSGDEFS MACRO 252 NOLIST 253 $P 254 BOX 255 256 Definition of messages sent by URSENDMSG and received 257 by URGETMSG. 258 259 EBOX 260 261 MSGPROTO BASE R0 262 MSGPROC BSSB 16 when sending: session number of receiver 263 * when receiving: session number of sender 264 MSGCLASS BSSB 16 class number of this message (0..31) 265 MSGPRIVS BSS 1 privileges associated with this message 266 * (see below for format) 267 MSGSTEXT BSS 0 when sending: start of message text 268 MSGACCT BSSC 20 when receiving: account name of sender, 269 * in ASCII, padded with blanks, or blank 270 * if account name not given. 271 MSGRTEXT BSS 0 when receiving: start of message text 272 273 * Definition of bits MSGPRIVS: 274 275 MSGPRIVID EQU BIT 0 Sender's Privilege Account name will be put into MSGACCT. 276 MSGPRIVOS EQU BIT 1 Sender is the operating system. 277 MSGPRIVLID EQU BIT 2 Sender's Logged On Account name will be put into MSGACCT. 278 MSGPRIVCM EQU BIT 20 Sender is Control Mode 279 MSGPRIVNXO EQU BIT 21 Sender is NOT Execute Only. 280 MSGPRIVMGR EQU BIT 22 Sender can execute MANAGER requests. 281 MSGPRIVBKP EQU BIT 23 Sender can execute BACKUP requests. 282 MSGPRIVMW EQU BIT 24 . . . MAINTENANCE WRITE requests. 283 MSGPRIVMR EQU BIT 25 . . . MAINTENANCE READ requests. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 164 (XREQINFOMACS) F 10 Macro Definitions 284 MSGPRIVOPR EQU BIT 26 . . . OPERATOR requests. 285 MSGPRIVG5 EQU BIT 27 . . . GROUP 5 (currently unused) requests. 286 MSGPRIVG4 EQU BIT 28 . . . GROUP 4 (message and batch) requests. 287 MSGPRIVG3 EQU BIT 29 . . . GROUP 3 (attribute change) requests. 288 MSGPRIVG2 EQU BIT 30 . . . GROUP 2 (catalog fetch) requests. 289 MSGPRIVG1 EQU BIT 31 . . . GROUP 1 (limit change) requests. 290 291 * Some message classes are pre defined (or at least usually used for...) 292 MSGCLSRESP EQU 0 response message 293 MSGCLSVERB EQU 1 verbal communication between users 294 MSGCLSOPR EQU 2 urgent communication from OPR 295 MSGCLSSPLR EQU 3 messages to the spooler 296 MSGCLSTERM EQU 4 concurrent session termination message 297 * EQU 5:15 reserved for BTI 298 * EQU 16:31 available to implementors 299 300 DRCT 301 ORG MSGPROTO recover lost space 302 EMAC of MSGDEFS 303 304 305 PSRDEFS MACRO 306 NOLIST 307 $P 308 BOX 309 310 Definition of Process Status Register. 311 312 EBOX 313 314 PSRBCDTRPB EQU BIT 22 BCD overflow trap enable 315 PSRFLTRPEB EQU BIT 23 floating point reduced precision enable 316 PSRFIXTRPB EQU BIT 24 fixed point arith error trap enable 317 PSRFLTTRPB EQU BIT 25 floating point arith error trap enable 318 PSRUNDTRPB EQU BIT 26 undefined number error trap enable 319 PSRMODIFB EQU BIT 27 modify arithmetic enable 320 PSROVERFB EQU BIT 28 overflow indication 321 PSRCARRYB EQU BIT 29 carry indication 322 PSRCONDB EQU BITS 30:31 condition (30-EQ, 31-LT) 323 * values used in changing PSR 324 PSRBCDTRP EQU 1*PSRBCDTRPB 325 PSRFLTRPE EQU 1*PSRFLTRPEB 326 PSRFIXTRP EQU 1*PSRFIXTRPB 327 PSRFLTTRP EQU 1*PSRFLTTRPB 328 PSRUNDTRP EQU 1*PSRUNDTRPB 329 PSRMODIF EQU 1*PSRMODIFB 330 PSROVERF EQU 1*PSROVERFB 331 PSRCARRY EQU 1*PSRCARRYB 332 333 EMAC end of PSRDEFS 334 335 336 PROCINFORD MACRO 337 NOLIST 338 $P 339 BOX 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 165 (XREQINFOMACS) F 10 Macro Definitions 340 341 The session information read request returns the 342 following block of information for each session. 343 344 EBOX 345 346 * Format of session information returned 347 PIPROTO BASE R0 348 PIPROCNUM BSSB 32-17 session number 349 PIENTLEN BSSB 17 length of this entry in words 350 PIWORDZ BSSB 32/2 bits giving more information 351 PIBATCH EQU PIWORDZ/BIT 31 on if a "batch" session 352 PIINTER EQU PIWORDZ/BIT 30 on if "interactive" session 353 PIDIALUP EQU PIWORDZ/BIT 29 on if a dialup port 354 PIINHIB EQU PIWORDZ/BIT 28 on if this port is inhibited 355 PIRFP EQU PIWORDZ/BIT 27 on if this is the special RFP term 356 PISHADL EQU PIWORDZ/BIT 26 on if logged on acct is shadow 357 PISHADA EQU PIWORDZ/BIT 25 on if alias acct is a shadow 358 PISPECPROC EQU PIWORDZ/BIT 24 on if job is special (started by ORSTRTJOB) 359 PISYSPROC EQU PIWORDZ/BIT 23 on if job is system process 360 361 PIPORTNUM BSSB 32/2 terminal port associated (-1 if none) 362 PISHORT EQU DISPW PIPROCNUM size of short element 363 * The above information is given for all sessions. The 364 * below information is only given if privileged. 365 PILOGACCT BSS 6 account logged on 366 PILAVOL EQU PILOGACCT(0) volume name 367 PILASYS EQU PILOGACCT(2) system name 368 PILAACCT EQU PILOGACCT(3) account name 369 PILAPROJ EQU PILOGACCT(5) division-project 370 PIALIASACT BSS 6 account aliased to 371 PIAAVOL EQU PIALIASACT(0) volume name 372 PIAASYS EQU PIALIASACT(2) system name 373 PIAAACCT EQU PIALIASACT(3) account name 374 PIAAPROJ EQU PIALIASACT(5) division-project 375 PIPROGNAME BSS 2 name of program (PAK12) 376 PISTATE BSS 2 program execution state (PAK12) 377 PIWCTIME BSS 1 wall clock time on (in minutes) 378 PICPUUSED BSS 1 cpu time used (in seconds) 379 PICPULIM BSS 1 cpu limit (in seconds) 380 PIDSKLIM BSS 1 disk space hard limit 381 PIDSKUSD BSS 1 disk space used 382 PISESUSD BSS 1 session space used 383 PISESLIM BSS 1 session space limit 384 PIWSSIZE BSS 1 working set size 385 PIDSKWARN BSS 1 disk block soft limit 386 PIPARENT BSS 1 session number of parent (or zero if none) 387 PISITE BSS 2 site name for this session 388 PILGFSESS BSS 1 session to send logoff message to 389 DRCT 390 PILONG EQU DISPW PIPROTO length of long information 391 PILOG EQU PILONG LOG 2 log length for getmem 392 ORG PIPROTO recover the space 393 EMAC end of PROCINFORD 394 395 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 166 (XREQINFOMACS) F 10 Macro Definitions 396 SHLINFORD MACRO 397 NOLIST 398 $P 399 BOX 400 401 Shared list information read format. 402 403 EBOX 404 405 SHRPROTO BASE R0 406 SHRACCESS BSSB 8 access given (codes for FSPRIVxx) 407 SHRPW BSSB 1 on if password present 408 BSSB 6 filler 409 SHRENLEN BSSB 17 contains length of this entry 410 SHRSYS BSS 1 system shared with 411 SHRACCT BSS 2 account shared with 412 SHRPROJ BSS 1 project shared with 413 DRCT 414 SHRLNTH EQU DISPW SHRPROTO length of an entry 415 ORG SHRPROTO 416 EMAC of SHLINFORD 417 418 419 UNDRPINFORD MACRO 420 NOLIST 421 $P 422 BOX 423 424 The under process structure read request returns the 425 following block of information for each process. 426 427 EBOX 428 429 UNDRPROTO BASE R0 430 UNDRRSTR BSSB 15 process restrictions 431 UNDRELEN BSSB 17 length of this entry, in words 432 UNDRLEVEL BSSB 9 level number of this under process 433 UNDRPSN BSSB 23 process serial number of this process 434 UNDRDPSN BSSB 23 process serial number of father 435 UNDRDBG BSSB 23 process serial number of debugger process 436 BSSB 18 reserved for future expansion 437 UNDRNAME BSS 2 process name 438 439 UNDRSTCTG1 EQU UNDRRSTR/BIT 31 on if group 1 restrictions (limit change) 440 UNDRSTCTG2 EQU UNDRRSTR/BIT 30 on if group 2 restrictions (catalog fetch) 441 UNDRSTCTG3 EQU UNDRRSTR/BIT 29 on if group 3 restrictions (acct att. chng) 442 UNDRSTCTG4 EQU UNDRRSTR/BIT 28 on if group 4 restrictions (unassigned) 443 UNDRSTCTG5 EQU UNDRRSTR/BIT 27 on if group 5 restrictions (unassigned) 444 UNDROPREQ EQU UNDRRSTR/BIT 26 on if operator requests restricted 445 UNDRMAINTR EQU UNDRRSTR/BIT 25 on if maintenance read restricted 446 UNDRMAINTW EQU UNDRRSTR/BIT 24 on if maintenance write restricted 447 UNDRBACKUP EQU UNDRRSTR/BIT 23 on if backup requests restricted 448 UNDRMANAGR EQU UNDRRSTR/BIT 22 on if manager requests restricted 449 UNDREXO EQU UNDRRSTR/BIT 21 on if address space is execute only 450 UNDRCNTLM EQU UNDRRSTR/BIT 20 on if in Control Mode 451 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 167 (XREQINFOMACS) F 10 Macro Definitions 452 DRCT 453 UNDRPLONG EQU DISPW UNDRPROTO 454 UNDRPLOG EQU UNDRPLONG LOG 2 455 ORG UNDRPROTO recover lost space 456 EMAC 457 458 459 LUINFORD MACRO 460 NOLIST 461 $P 462 BOX 463 464 The request that returns information on the local 465 units for a specific underprocess conforms to the following 466 format. 467 468 EBOX 469 470 LUPROTO BASE R0 471 LUEQUIVS BSSB 8 number of units opened to this device 472 LULASTREC BSSB 4 type of last record read 473 LULOADPT BSSB 1 unit is currently position at the load point 474 LUTRANS BSSB 1 on if unit has transaction in progress 475 BSSB 1 reserved for future expansion 476 LUELEN BSSB 17 length of this entry (words) 477 478 LUUNIT BSSB 8 unit number having this status 479 LUSSTAT BSSB 18 unit static status 480 BSSB 6 reserved for future expansion 481 482 LUPRIV EQU LUSSTAT/BITS 14:17 privilege to access this device 483 LUCRT EQU LUSSTAT/BIT 18 file created by OPEN 484 LUACS EQU LUSSTAT/BITS 19:21 access allowed to device 485 LUWWC EQU LUSSTAT/BIT 24 on if file writing when system crashed 486 LUSAVE EQU LUSSTAT/BIT 25 on if device in directory somewhere 487 LUTYPE EQU LUSSTAT/BITS 26:31 type of device 488 489 LUVOLNM BSS 2 volume name for device 490 LUSYSNM BSS 1 system name for device 491 LUACCT BSS 2 account name for device 492 LUACCPROJ BSS 1 div/proj name for device 493 LUFILENM BSS 2 filename for device 494 LUEXT BSS 1 filename extension for device 495 496 DRCT 497 LULONG EQU DISPW LUPROTO 498 LULOG EQU LULONG LOG 2 499 ORG LUPROTO recover lost space 500 501 EMAC 17 INPUT OPRQINFOMACS format for info returned by OPREQs 2 * Operator variable definition macros. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 168 (OPRQINFOMACS) F 11 4 5 * A9107 Added ERLCSCSIDE, ERLCSCSIID and ERLCSCSIRS. JB. 6 * A9105 Modifications of trace event format. RC 7 * A8901 Addition of VT defs to DEVINFORD. RC 8 * A8805 Addition of disk name to several ERRORFILE entries. DH 9 * A8602 Addition of exchange save record types for accounting record. MH 10 * A8511 Addition of STOP and GO record types for accounting record. MH 11 * A8510 Addition LOAD and UNLOAD record types for accounting record. JB. 12 * A8508 Addition of SMU error code. MH. 13 * A8507 Changes to PORTFILE macro, PCFUNCT contains additional info. JB. 14 * A8504 Addition of new fields and record types for accounting record. MH. 15 * 3.6 Addition of VBSYINFORD. JB. 16 * 3.5 Added DIUNIT, DICHAN, and DISLOT to DEVINFORD. DH. 17 * 3.4 Added POTERMTYPE to PORTINFORD, PCTERMTYPE to PORTFILE. JB. 18 * 3.3 AUTHGDSK and AUTHGDSKA changed to AUTHS... RC. 19 * 2.0 New field in VOLINFORD. BB. 20 * 1.3 Addition of BKUPINFORD. BB. 21 * A8110 New fields in PORTFILE, PORTINFORD. JL. 22 * A8104a Changes to ERRORFILE. JL. 23 * A8104 Changes to ERRORFILE. JL. 24 * A8102 Addition of OPMSGINFO. Change PROCINFORD and ERRORFILE. JL. 25 * A8012a Addition of AUTHINFORD. Change DEVINFORD. New error codes. JL. 26 * A8008 Change of accounting record format. RA. 27 * A8007 Addition of DEVINFORD and TRINFORD. VOLINFORD changed. JL. 28 * A8005a Addition of ACCTFILE and ERRORFILE. RA. 29 * A8005 Addition of CONFINFRD. RA. 30 * A7912 Initial release. RA. 31 32 ********************************************************************************** 33 * * 34 * This is the definition of macros that define symbols * 35 * that are required in communication with the system. This * 36 * file is INPUT in assembly language programs and it defines * 37 * macros that, when invoked, define the requested group of * 38 * symbols. The macro invocation is of the form: * 39 * * 40 * macname [list] * 41 * * 42 * where "macname" is the name of the requested macro and "list" is * 43 * optionally included (the square brackets denote optionality) if the * 44 * body of the macro (i.e., the definition of the symbols) is to * 45 * be listed. * 46 * * 47 * Macros that are defined herein are: * 48 * * 49 * ACCTFILE Format of accounting file. * 50 * AFTINFORD Format of data returned by AFT information request. * 51 * AUTHINFORD Format of data returned by auth list information reads. * 52 * CONFINFORD Format of data returned by configuration request. * 53 * DEVINFORD Format of data returned by device information request. * 54 * ERRORFILE Format of error log file. * 55 * OPMSGINFO Format of data returned by operator message request. * 56 * PORTFILE Format of port configuration file. * 57 * PORTINFORD Format of data returned by port information request. * 58 * TRINFORD Format of data returned by stop trace request. * 59 * VOLINFORD Format of data returned by volume information request. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 169 (OPRQINFOMACS) F 11 60 * VBSYINFORD Format of data returned by volume busy request. * 61 * * 62 ********************************************************************************** 63 64 65 ACCTFILE MACRO 66 NOLIST 67 $P 68 BOX 69 70 Accounting files. 71 A system session writes records into accounting files 72 whenever certain events occur. The events and the format 73 of the files are described below. The files where log 74 entries are made are determined by a bit mask in the 75 ULLIMITS block called LIMLOGSPOT. Each accounting record is 76 written to as many as 4 log files: 77 78 user.divprj:ACCOUNTING.LOGFIL 79 MANAGER.divprj:ACCOUNTING.LOGFIL 80 MANAGER.div:ACCOUNTING.LOGFIL 81 MANAGER.SYS:ACCOUNTING.LOGFIL 82 83 The manufacturers account logging may go to himself, 84 MANAGER.!!!, or MANAGER.SYS. 85 These files should be opened as empty .RAFs. The 86 accounting session will add records to the end of the file 87 and advance the end pointer. The begin pointer is provided 88 for the benefit of the reading process. It is the 89 responsibility of the reading process to free blocks when 90 they are no longer needed, otherwise, the log file will 91 grow until it occupies all available space. Note that 92 block 0 should never be freed. 93 If AFEND is in the range of -AFRSIZE to 2*CPW, then it 94 is set to 2*CPW. The reading routine should do the same 95 for AFBEGIN. 96 97 It should be noted that for file entries being logged 98 the primary account name and project is for the account 99 owning the file and the secondary one is for the account 100 accessing the file. Also for aliases and unaliases the 101 file name and extension field is used to hold the logon 102 account name and project of the user performing the alias. 103 104 EBOX 105 106 AFBEGIN EQU 0 RAF char position of read pointer 107 AFEND EQU 1*4 RAF char position of write pointer 108 * (points to next records location) 109 110 AFRPROTO BASE R0 111 AFRTYPE BSSB 5 type of record 112 APTSLEEP EQU 0 sleep record (tested with JEQZ!) 113 APTSTARTUP EQU 1 system startup 114 APTON EQU 2 successful logon 115 APTPWW EQU 3 unsuccessful logon 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 170 (OPRQINFOMACS) F 11 116 APTALIAS EQU 4 alias 117 APTALIER EQU 5 alias failure 118 APTOFF EQU 6 logoff 119 APTALOFF EQU 7 unalias 120 APTPWRFAIL EQU 8 power failure 121 APTPWRUP EQU 9 power up restart 122 APTCONCP EQU 10 concurrent session startup 123 APTABORT EQU 11 opr abort 124 APTTERMIN EQU 12 opr terminate 125 APTEVICT EQU 13 opr evict 126 APTFILOP EQU 14 file open 127 APTFILCL EQU 15 file close 128 APTFBC EQU 16 file being destroyed 129 APTLOAD EQU 17 volume mount 130 APTUNLOAD EQU 18 volume dismount 131 APTSTOP EQU 19 stop process 132 APTGO EQU 20 start process 133 APTXSAVE EQU 21 file exchange save 134 APTMAX EQU 21 largest type 135 * Bit array of those APTs that are long 136 AFRSZLONG EQU 1*(BIT APTON)+1*(BIT APTALIAS)+1*(BIT APTOFF)+1*(BIT APTALOFF) 137 138 AFRPORTNUM BSSB 10 port number of activity 139 AFRLEN BSSB 17 character size of record 140 AFRPROCN BSSB 12 session number 141 AFRSHADOW BSSB 1 on if mentioned acct shadow 142 AFRFOREIGN BSSB 1 on if mentioned acct foreign 143 AFRFILLER BSSB 32-14 filler 144 AFRACCT BSS2 1 account name 145 AFRPROJ BSS 1 division-project 146 AFRTIME BSS2 1 time of occurrence 147 AFRSHORT EQU DISPC AFRTYPE size of short acct file record 148 AFRCPUTIME BSS 1 CPU time used (sec) 149 AFRSVDUSD BSS 1 saved file space (fb) 150 AFRSESMAX BSS 1 session output max (high water mark) 151 AFRACCT2 EQU AFRCPUTIME second account name in record 152 AFRPROJ2 EQU AFRSESMAX second project in record 153 154 AFRSIZE EQU DISPC AFRTYPE size of account file record 155 AFRWORDA BSS 1 156 AFRPORT2 EQU AFRWORDA/BITS 0:9 second port in record 157 AFRPROC2 EQU AFRWORDA/BITS 10:21 second session number in record 158 AFRLONG EQU DISPC AFRTYPE size of long account record 159 BSS 1 second word of file name 160 AFRFILNAM EQU AFRWORDA file name 161 AFRFILEXT BSS 1 file extention 162 AFRFILLEN EQU DISPC AFRTYPE size of record with file info in it 163 AFRMAXLEN EQU AFRFILLEN max length of an accounting record 164 DRCT 165 ORG AFRPROTO reclaim area 166 EMAC 167 168 169 AFTINFORD MACRO 170 NOLIST 171 $P 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 171 (OPRQINFOMACS) F 11 172 BOX 173 174 Format of each entry returned by the read AFT request. 175 176 EBOX 177 AIPROTO BASE R0 178 AIVOL BSS 2 volume name (PAK12) 179 AIACCT BSS 2 account name (PAK12) 180 AIPROJ BSS 1 account project (PAK6) 181 DRCT 182 AILEN EQU DISPW AIPROTO length of the entry in words 183 ORG AIPROTO 184 EMAC end of AFTINFORD 185 186 187 AUTHINFORD MACRO 188 NOLIST 189 $P 190 BOX 191 192 Authorization list read request results. 193 194 EBOX 195 196 AUTLPROTO BASE R0 197 AUTVNAME BSS2 1 volume name 198 BSS 2 unused 199 AUTDSK BSS 1 disk space authorized 200 AUTDSKA BSS 1 disk space delegated 201 AUTSDSK BSS 1 saved space authorized 202 AUTSDSKA BSS 1 saved space delegated 203 BSS 4 unused - reserved for future expansion 204 DRCT 205 AUTLLNTH EQU DISPW AUTLPROTO length of entry 206 ORG AUTLPROTO 207 EMAC 208 209 210 CONFINFORD MACRO 211 NOLIST 212 $P 213 BOX 214 215 Format of each entry returned by the read system 216 configuration request. 217 218 EBOX 219 220 SCPROTO BASE R0 221 SCSLOT BSSB 15 slot of device 222 SCLENGTH BSSB 17 length of the entry in words 223 SCTYPE BSS 1 PAK6 device type name 224 SCWRU BSS 1 WRU response of the device 225 SCCHAN BSS 1 channel number of device (-1 if none) 226 SCDTYPE BSS 1 PAK6 name of device on chan(-1 if none) 227 SCDWRU BSS 1 device WRU response (-1 if none) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 172 (OPRQINFOMACS) F 11 228 SCDUNIT BSS 1 unit on device controller (-1 if none) 229 SCDUSIZE BSS 1 size of device (-1 if no size) 230 SCDUUNIT BSS 1 PAK6 units of device size 231 DRCT 232 SCLEN EQU DISPW SCPROTO length of the entry in words 233 ORG SCPROTO 234 EMAC end of CONFINFORD 235 236 237 DEVINFORD MACRO 238 NOLIST 239 $P 240 BOX 241 242 Information returned by the device information 243 request. 244 245 EBOX 246 247 DIPROTO BASE R0 248 DISTART BSS 0 beginning of entry 249 DITYPE BSSB 15 device type: 250 DIDISK EQU 1 disk 251 DIMT EQU 2 magnetic tape (standard 9 track) 252 DICT EQU 3 cartridge tape (DEI) 253 DILP EQU 4 line printer 254 DIVT EQU 5 video tape (exabyte) 255 * others to be defined 256 DIENTLEN BSSB 17 length of this entry in words 257 DIDNAME BSS 1 device name (pak6) 258 DIHARDADR BSSB 16:1 hardware address 259 DIUNIT EQU BITS 28:31 unit number in hardware address 260 DICHAN EQU BITS 24:27 channel number in hardware address 261 DISLOT EQU BITS 20:23 slot number in hardware address 262 DIDEVINFO BSS 0 start of device-specific info 263 264 * For disks only: 265 DIDRVNUM BSSB 8 drive number (cable position) 266 DISPT BSSB 8 sectors per track 267 DITPC BSSB 16 tracks per cylinder 268 DIDISKLEN EQU DISPW DISTART length of disk entry 269 270 * For mag tapes only: 271 ORG DIPROTO/DIDEVINFO 272 DIMTPROC BSS 1 session number of owner (or zero if none) 273 DIMTLEN EQU DISPW DISTART length of mag tape entry 274 275 * For cart tapes only: 276 ORG DIPROTO/DIDEVINFO 277 DICTPROC BSS 1 session number of owner (or zero if none) 278 DICTLEN EQU DISPW DISTART length of cart tape entry 279 280 * For video tapes only: 281 ORG DIPROTO/DIDEVINFO 282 DIVTPROC BSS 1 session number of owner (or zero if none) 283 DIVTLEN EQU DISPW DISTART length of video tape entry 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 173 (OPRQINFOMACS) F 11 284 285 * For line printers only: 286 ORG DIPROTO/DIDEVINFO 287 DILPPROC BSS 1 session number of owner (or zero if none) 288 DILPLEN EQU DISPW DISTART length of line printer entry 289 290 DRCT 291 ORG DIPROTO recover space 292 EMAC 293 294 295 ERRORFILE MACRO 296 NOLIST 297 $P 298 BOX 299 300 The system logs in a file IO and other errors that 301 occur while the system is running. This file is of the 302 format given. The errors consist of a code and a variable 303 number of parameters. Defined error codes are ("|" 304 separates words): 305 306 ERLCEND | dummy parameter 307 ERLCTS ( no longer used ) 308 ERLCTEXT | variable length string (blank filled) 309 ERLCBFBI ( new code below ) 310 ERLCCKFBI ( new code below ) 311 ERLCBKFBI ( new code below ) 312 ERLCPFFBI ( no longer used ) 313 ERLCBLNK | MS address expected | found 314 ERLCFSAF | MS address 315 ERLCFUD1 | MS address 316 ERLCFUD2 | MS address 317 ERLCPPUBT | PF for channel | PPU status 318 ERLCCIAE | PF for channel | CIA status 319 ERLCCIATO | PF for channel 320 ERLCDSKTO | PF for channel | unit 321 ERLCSSUTO | PF for SSU 322 ERLCSUB ( new code below ) 323 ERLCNOSUB ( new code below ) 324 ERLCUNSUB ( new code below ) 325 ERLCPPUTO (no longer used) 326 ERLCBOOT | system version (upper) | system version (lower) | boot switches 327 ERLCMOUNT | volume number | drive name | volume name (upper) | 328 volume name (lower) 329 ERLCDMOUNT | volume number 330 ERLCMPE | status + virtual address | PF | block 331 ERLCMPED | PF | block 332 ERLCDNRDY ( new code below ) 333 ERLCRMNT | volume number | drive name 334 ERLCCTC (no longer used) 335 ERLCCTCTO (no longer used) 336 ERLCDSKRD ( new code below ) 337 ERLCDCNT | drive name | cable number | read count | write count 338 ERLCDSKRW ( new code below ) 339 ERLCLPERR | LP name | LP status 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 174 (OPRQINFOMACS) F 11 340 ERLCLPIFPE ( no longer used ) 341 ERLCLPTO | LP name 342 ERLCPPUBAD | PPU slot number 343 ERLCPPUOK | PPU slot number 344 ERLCCTLBAD | PPU slot number | channel number 345 ERLCCTLOK | PPU slot number | channel number 346 ERLCDATBAD | target date | current date 347 ERLCNVMTIM | dummy parm 348 ERLCMTC (no longer used) 349 ERLCMTCTO | page map value 350 ERLCMTCERR | drive name | operation | tape status | PPU status 351 ERLCDSKID | drive name | drive id (3 words) | 352 pack mfg | pack s/n | fmt date (2 words) | 353 volume name (2 words) 354 ERLCUNLOAD | drive name 355 ERLCDE | drive name | block number | seek address | 356 operation | BFD status | PPU status 357 ERLCPWFAIL | dummy parameter 358 ERLCPWRUP | dummy parameter 359 ERLCBFBI | drive name | MS address | expected | found 360 ERLCCKFBI | drive name | MS address | difference | found 361 ERLCBKFBI | drive name | MS address | found 362 ERLCRDGCS | drive name | MS address | segment# 363 ERLCSUB | drive name | bad MS address | substitute address 364 ERLCNOSUB | drive name | bad MS address | reason 365 ERLCUNSUB | drive name | bad MS address | substitute MS address 366 ERLCDNRDY | drive name | volume number 367 ERLCDSKRD | drive name | MS address | seek address 368 ERLCDSKRW | drive name | MS address | seek address 369 ERLCSCSIRS | drive name | MS address | seek address | operation | 370 SCSI status | PPU status | sense key | sense code 371 ERLCSCSIDE | drive name | block number | seek address | 372 operation | SCSI status | PPU status 373 ERLCSCSIID | drive name | vendor id (2 words) | 374 product id (3 words) | firmware rev (2 words) | 375 fmt date (2 words) | volume name (2 words) 376 377 The error logging file is SYSTEM.!!!:ERRORLOG.LOGFIL. 378 This file should be opened as an empty .RAF. The error 379 logging session will add records to the end of the file and 380 advance the end pointer. The begin pointer is provided for 381 the benefit of the reading process. It is the 382 responsibility of the reading process to free blocks when 383 they are no longer needed, otherwise, the log file will 384 grow until it occupies all available mass storage space. 385 Note that block 0 should never be freed ( except possibly 386 to release the entire file ). 387 If EFEND is in the range of -EFRSIZE to 2*CPW, then it 388 is set to 2*CPW. The reading routine should do the same 389 for EFBEGIN. 390 391 EBOX 392 393 * These addresses are used to get the pointers from the error log file 394 EFBEGIN EQU 0 pointer to first error entry 395 EFEND EQU 1*4 pointer to end of error entries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 175 (OPRQINFOMACS) F 11 396 397 EFPROTO BASE R0 prototype of error entry 398 EFWORDA BSS 1 399 EFLEN EQU BITS 17:21 number of parameters for this error 400 EFERROR EQU BIT 22 0 => routine log entry, 1 => error 401 EFCODE EQU BITS 23:31 code for this error 402 EFTYPE EQU EFWORDA/BITS 0:14 code for this error 403 EFLENGTH EQU EFWORDA/BITS 15:31 length of this entry in words 404 EFDATE BSS 2 system time word when error happened 405 EFPARAMS LABEL first word of parameters 406 DRCT 407 ORG EFPROTO reclaim space 408 409 * The actual codes 410 ERLCEND EQU 1*EFLEN+0*EFERROR+01*EFCODE end system 411 *ERLCTS EQU 1*EFLEN+0*EFERROR+02*EFCODE time stamp 412 ERLCTEXT EQU 1*EFLEN+1*EFERROR+03*EFCODE text record 413 *ERLCBFBI EQU 3*EFLEN+1*EFERROR+04*EFCODE unused - was FBI type mismatch 414 *ERLCCKFBI EQU 3*EFLEN+1*EFERROR+05*EFCODE unused - was FBI checksum bad 415 *ERLCBKFBI EQU 2*EFLEN+1*EFERROR+06*EFCODE unused - was FBI DA mismatch 416 * EQU 6*EFLEN+1*EFERROR+07*EFCODE unused - was old format MS error 417 *ERLCPFFBI EQU 3*EFLEN+1*EFERROR+08*EFCODE bad FBI in PFPROC 418 ERLCBLNK EQU 3*EFLEN+1*EFERROR+09*EFCODE bad backward link while freeing 419 ERLCFSAF EQU 1*EFLEN+1*EFERROR+10*EFCODE bad block while freeing SAF 420 ERLCFUD1 EQU 1*EFLEN+1*EFERROR+11*EFCODE bad UD1 block while freeing DIR 421 ERLCFUD2 EQU 1*EFLEN+1*EFERROR+12*EFCODE bad UD2 block while freeing DIR 422 ERLCPPUBT EQU 2*EFLEN+1*EFERROR+13*EFCODE bad transfer status from PPU 423 ERLCCIAE EQU 2*EFLEN+1*EFERROR+14*EFCODE error code from CIA 424 ERLCCIATO EQU 1*EFLEN+1*EFERROR+15*EFCODE CIA deadman timeout 425 ERLCDSKTO EQU 2*EFLEN+1*EFERROR+16*EFCODE Disk deadman timeout 426 ERLCSSUTO EQU 1*EFLEN+1*EFERROR+17*EFCODE SSU timeout 427 *ERLCSUB EQU 2*EFLEN+1*EFERROR+18*EFCODE unused - was MS block substituted 428 *ERLCNOSUB EQU 2*EFLEN+1*EFERROR+19*EFCODE unused - was MS block not substituted 429 *ERLCUNSUB EQU 2*EFLEN+0*EFERROR+20*EFCODE unused - was MS block unsubstituted 430 *ERLCPPUTO EQU 1*EFLEN+1*EFERROR+21*EFCODE PPU timeout, PPU not talking 431 ERLCBOOT EQU 3*EFLEN+0*EFERROR+22*EFCODE system boot 432 ERLCMOUNT EQU 4*EFLEN+0*EFERROR+23*EFCODE volume mount 433 ERLCDMOUNT EQU 1*EFLEN+0*EFERROR+24*EFCODE volume dismount 434 ERLCMPE EQU 3*EFLEN+1*EFERROR+25*EFCODE memory parity error 435 ERLCMPED EQU 2*EFLEN+1*EFERROR+26*EFCODE memory parity error 436 *ERLCDNRDY EQU 2*EFLEN+1*EFERROR+27*EFCODE unused - was disk dropped ready 437 ERLCRMNT EQU 2*EFLEN+0*EFERROR+28*EFCODE volume remounted 438 *ERLCCTC EQU 4*EFLEN+1*EFERROR+29*EFCODE CTC operation error 439 *ERLCCTCTO EQU 2*EFLEN+1*EFERROR+30*EFCODE CTC deadman timeout 440 * EQU 5*EFLEN+1*EFERROR+31*EFCODE unused - was MS error 441 *ERLCDSKRD EQU 3*EFLEN+1*EFERROR+32*EFCODE unused - was perm read error 442 ERLCDCNT EQU 4*EFLEN+0*EFERROR+33*EFCODE disk activity count 443 *ERLCDSKRW EQU 2*EFLEN+0*EFERROR+34*EFCODE unused - was rewrite after read 444 ERLCLPERR EQU 2*EFLEN+1*EFERROR+35*EFCODE line printer error 445 *ERLCLPIFPE EQU 2*EFLEN+1*EFERROR+36*EFCODE line printer interface parity error (obsolete) 446 ERLCLPTO EQU 1*EFLEN+1*EFERROR+37*EFCODE line printer timeout 447 ERLCPPUBAD EQU 1*EFLEN+1*EFERROR+38*EFCODE PPU doesn't respond 448 ERLCPPUOK EQU 1*EFLEN+0*EFERROR+39*EFCODE PPU started talking again 449 ERLCCTLBAD EQU 2*EFLEN+1*EFERROR+40*EFCODE controller doesn't respond 450 ERLCCTLOK EQU 2*EFLEN+0*EFERROR+41*EFCODE controller is OK again 451 ERLCDATBAD EQU 2*EFLEN+1*EFERROR+42*EFCODE SSU clock is bad 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 176 (OPRQINFOMACS) F 11 452 ERLCNVMTIM EQU 1*EFLEN+1*EFERROR+43*EFCODE NVM time is bad 453 *ERLCMTC EQU 4*EFLEN+1*EFERROR+44*EFCODE MTC operation error 454 *ERLCMTCTO EQU 2*EFLEN+1*EFERROR+45*EFCODE MTC deadman timeout 455 ERLCMTCTO EQU 1*EFLEN+1*EFERROR+46*EFCODE MTC deadman timeout 456 ERLCMTCERR EQU 4*EFLEN+1*EFERROR+47*EFCODE MTC tape error 457 ERLCDSKID EQU 10*EFLEN+0*EFERROR+48*EFCODE drive and pack id 458 ERLCUNLOAD EQU 1*EFLEN+1*EFERROR+49*EFCODE unload disk heads 459 ERLCDE EQU 6*EFLEN+1*EFERROR+50*EFCODE disk I/O error 460 ERLCPWFAIL EQU 1*EFLEN+1*EFERROR+51*EFCODE power failure 461 ERLCPWRUP EQU 1*EFLEN+0*EFERROR+52*EFCODE power up restart 462 ERLCSMU EQU 2*EFLEN+1*EFERROR+53*EFCODE SMU error 463 ERLCBFBI EQU 4*EFLEN+1*EFERROR+54*EFCODE FBI type mismatch 464 ERLCCKFBI EQU 4*EFLEN+1*EFERROR+55*EFCODE FBI checksum bad 465 ERLCBKFBI EQU 3*EFLEN+1*EFERROR+56*EFCODE FBI MS block didn't match 466 ERLCRDGCS EQU 3*EFLEN+0*EFERROR+57*EFCODE reading MS correction segment 467 ERLCSUB EQU 3*EFLEN+1*EFERROR+58*EFCODE MS block substituted 468 ERLCNOSUB EQU 3*EFLEN+1*EFERROR+59*EFCODE MS block not substituted 469 ERLCUNSUB EQU 3*EFLEN+0*EFERROR+60*EFCODE MS block unsubstituted 470 ERLCDNRDY EQU 2*EFLEN+1*EFERROR+61*EFCODE disk dropped ready 471 ERLCDSKRD EQU 3*EFLEN+1*EFERROR+62*EFCODE permanent disk read error (data lost) 472 ERLCDSKRW EQU 3*EFLEN+0*EFERROR+63*EFCODE rewrite disk block after read 473 ERLCSCSIRS EQU 8*EFLEN+1*EFERROR+64*EFCODE request sense data for disk error 474 ERLCSCSIDE EQU 6*EFLEN+1*EFERROR+65*EFCODE SCSI disk I/O error 475 ERLCSCSIID EQU 13*EFLEN+0*EFERROR+66*EFCODE SCSI device identification 476 477 ERLMAXLEN EQU 13 maximum number of parameters 478 EMAC 479 480 481 OPMSGINFO MACRO 482 NOLIST 483 $P 484 BOX 485 486 Format of data returned by ORGETOPMSG. 487 488 EBOX 489 490 OMIPROTO BASE R0 491 OMISTART LABEL 492 OMIPROCNUM BSSB 15 session number originating message (or 0) 493 OMIENTLEN BSSB 17 length of this entry, in words 494 OMISERIAL BSSB 24 message serial number 495 OMILENGTH BSSB 8 length of this message, in characters 496 OMIMESSAGE BSSC 0 beginning of message text 497 DRCT 498 ORG OMIPROTO 499 EMAC 500 501 502 PORTFILE MACRO 503 NOLIST 504 $P 505 BOX 506 507 There is a file from which the system reads the 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 177 (OPRQINFOMACS) F 11 508 initial port configuration. That files format is described 509 herein. 510 The file is a RAF and the first words of it describe 511 the location of the entries for each port. Word zero of 512 the RAF (chars 0-3) is always zero so the file is not 513 mangled by other RAF users. Word 1 (PCPLENGTH) contains 514 the length of each port entry in characters and word 2 515 (PCPBASE) gives the character base for the information for 516 port zero. Therefore, to find the information of a 517 particular port, a program positions to *+. 519 Each of the entries are considered "not specified" if 520 the sign bit of its word is not on. This excludes PCTERMA 521 and PCTERMT which are always there. 522 523 EBOX 524 525 PCPLENGTH EQU 4 position of 4 chars giving length 526 PCPBASE EQU 8 position of 4 chars giving base 527 528 PCPROTO BASE R0 529 PCIBAUD BSS 1 input baud rate 530 PCOBAUD BSS 1 output baud rate 531 PCFUNCT BSS 1 532 PCFCTSP EQU BIT 24 clear to send processing 533 PCFXOFF EQU BIT 25 XON/XOFF processing 534 PCFBRKOUT EQU BIT 26 don't output when recieving break 535 PCFRDE EQU BIT 27 receive data enable 536 PCCHKIP EQU BIT 28 1 sez check parity of input character 537 PCPGEN EQU BITS 29:30 parity generation of output characters 538 PCFSTOPB EQU BIT 31 stop bits (0=>1, 1=>2) 539 PCCARW BSS 1 carriage width 540 PCHEIGHT BSS 1 height of a page 541 PCCRD BSS 1 carriage return delay (MS) 542 PCLFD BSS 1 line feed delay (MS) 543 PCFFD BSS 1 form feed delay (MS) 544 PCBKSPC BSS 1 backspace character 545 PCLKILLC BSS 1 line kill character 546 PCECHOM BSS 1 echo mode 547 PCTERMT BSS 1 terminal type code (pak6) 548 PCTERMG BSS 1 terminating character group 549 PCTERMA BSS 8 terminating character array 550 PCLOCATION BSSC 30 text describing terminal location 551 PCAUTOLOG BSS 10 auto logon account 552 PCIXOFF BSS 1 1 sez xoff port on input buffer full 553 PCFPROTO BSS 1 interface protocal 554 PCPNONE EQU 0 none 555 PCPDISC EQU 1 disconnect on DTR drop 556 PCP103H EQU 2 103 handshake 557 PCTSMTR BSS 1 initial state of our transmitters 558 PCTRI EQU BIT 24 ring indicator 559 PCTCARD EQU BIT 25 carrier detect 560 PCTDTR EQU BIT 26 data terminal ready/data set ready 561 PCTRTS EQU BIT 28 request to send/clear to send 562 PCHTD BSS 1 horizontal tab delay (MS) 563 PCBRCH BSS 1 'break' character 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 178 (OPRQINFOMACS) F 11 564 PCSITE BSS 2 site name for terminal (pak12) 565 PCTERMTYPE BSS 2 terminal type (pak12) 566 BSS 12 expansion 567 DRCT 568 PCLENGTH EQU DISPW PCPROTO 569 ORG PCPROTO 570 EMAC end of PORTFILE 571 572 573 PORTINFORD MACRO 574 NOLIST 575 $P 576 BOX 577 578 Information returned by the port information request. 579 580 EBOX 581 582 POPROTO BASE R0 583 POPORTNUM BSSB 32-17 the port being considered 584 POENTLEN BSSB 17 length of this entry in words 585 POWORDZ BSSB 32/2 586 * EQU POWORDZ/BIT 31 unused 587 POINTER EQU POWORDZ/BIT 30 "interactive terminal" 588 PODIALUP EQU POWORDZ/BIT 29 dialup port 589 POINHIB EQU POWORDZ/BIT 28 port is inhibited 590 PORFP EQU POWORDZ/BIT 27 remote front panel port 591 POPROCNUM BSSB 32/2 session number (zero if none) 592 POIBAUD BSS 1 input baud rate 593 POOBAUD BSS 1 output baud rate 594 POTTYPE BSS 1 *old* terminal "type" (use POTERMTYPE) 595 POICNT BSS 1 input character count 596 POOCNT BSS 1 output character count 597 POINTSTATE BSSC 1 interface state 598 POLASTST BSSC 1 last status from PORT 599 POLASTCOM BSSC 1 last command sent to PORT 600 POCIAPORT BSSC 1 actual port number on CIA 601 POTIMECNT BSS 1 timing count 602 POSITE BSS 2 site name for terminal (pak12) 603 POTERMTYPE BSS 2 terminal type (pak12) 604 DRCT 605 POLENGTH EQU DISPW POPROTO 606 POLOG EQU POLENGTH LOG 2 607 ORG POPROTO reclaim the space 608 EMAC end of PORTINFORD 609 610 611 TRINFORD MACRO 612 NOLIST 613 $P 614 BOX 615 616 Information returned by the stop trace request. 617 618 EBOX 619 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 179 (OPRQINFOMACS) F 11 620 TIPROTO BASE R0 621 TISLOT BSSB 4 slot number of CPU creating this entry 622 TIEVENT BSSB 10 class and event number 623 TITIME BSSB 18 right bits of clock 624 TIR0 BSS 1 contents of R0 at time of event 625 TIR1 BSS 1 contents of R1 at time of event 626 TIR2 BSS 1 contents of R2 at time of event 627 DRCT 628 TILENGTH EQU DISPW TIPROTO entry length 629 ORG TIPROTO 630 EMAC 631 632 633 VOLINFORD MACRO 634 NOLIST 635 $P 636 BOX 637 638 Information returned on volumes by the volume 639 information request. 640 641 EBOX 642 643 VIPROTO BASE R0 644 VIWORDZ BSSB 32-17 645 VIINHIB EQU VIWORDZ/BIT 31 on if access inhibited 646 VINOTMNT EQU VIWORDZ/BIT 30 on if not completely mounted 647 VISYSVOL EQU VIWORDZ/BIT 29 on if the system volume 648 VIQDW EQU VIWORDZ/BIT 27 on if writes queued 649 VIQDR EQU VIWORDZ/BIT 26 on if reads queued 650 VIADTBZY EQU VIWORDZ/BIT 25 on if ADT access busy 651 VIMAIM EQU VIWORDZ/BIT 24 on if maintenance mounted only 652 VIENTLEN BSSB 17 length of this entry in words 653 VIDNAME BSS 1 "name" of the drive (PAK6) 654 VIVNAME BSS 2 volume name (PAK12) 655 VIVNUM BSSB 8 system volume index number 656 VIBUSY BSSB 32-8 volume busy counter 657 VIFREEBLK BSS 1 free blocks on the volume 658 VITOTBLK BSS 1 total blocks on volume 659 VIACCTNUM BSS 1 number of accounts on the volume 660 VIREALNAME BSS 2 real name on volume label 661 DRCT 662 VILENGTH EQU DISPW VIPROTO 663 VILOG EQU VILENGTH LOG 2 664 ORG VIPROTO reclaim space 665 EMAC end of VOLINFORD 666 667 668 BKUPINFORD MACRO 669 NOLIST 670 $P 671 BOX 672 673 Definition of system header made in backup. 674 675 EBOX 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 180 (OPRQINFOMACS) F 11 676 677 HDRPROTO BASE R0 678 BKUPHDRW1 BSS 1 first word of header 679 FILEINFOT EQU BITS 0:14 type of backup information 680 FILEINFOTV EQU 0 volume information 681 FILEINFOTA EQU 1 account information 682 FILEINFOTF EQU 2 file information 683 FILEINFOTD EQU 3 file page information 684 FILEINFOTM EQU 4 mapped file page information 685 BKUPREV EQU BITS 15:31 revision number 686 BKUPHDRW2 BSS 1 second word of header 687 FSTBKUPLEN EQU BITS 0:14 first optional length 688 SNDBKUPLEN EQU BITS 15:31 second optional length 689 DRCT 690 BKUPHDRLEN EQU DISPW HDRPROTO length of header 691 ORG HDRPROTO reclaim space 692 EMAC end of BKUPINFORD 693 694 695 VBSYINFORD MACRO 696 NOLIST 697 $P 698 BOX 699 700 Format of information returned by the volume busy 701 request. 702 703 EBOX 704 705 VBPROTO BASE R0 706 BSSB 15 filler 707 VBLENFLD BSSB 17 length of this entry, in words 708 VBACCTNM BSS 2 account name 709 VBDIVPRJ BSS 1 division/project name 710 DRCT 711 VBLNTH EQU DISPW VBPROTO 712 ORG VBPROTO reclaim space 713 EMAC end of VBSYINFORD 714 18 INPUT MACROINVOK invocation of used macros 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 181 (MACROINVOK) F 12 3 ********************************************************************************** 4 * * 5 * Invocation of macros that are used globally. * 6 * * 7 ********************************************************************************** 8 9 PORTFILE LIST 9 ********************************************************************************** 9 * * 9 * There is a file from which the system reads the * 9 * initial port configuration. That files format is described * 9 * herein. * 9 * The file is a RAF and the first words of it describe * 9 * the location of the entries for each port. Word zero of * 9 * the RAF (chars 0-3) is always zero so the file is not * 9 * mangled by other RAF users. Word 1 (PCPLENGTH) contains * 9 * the length of each port entry in characters and word 2 * 9 * (PCPBASE) gives the character base for the information for * 9 * port zero. Therefore, to find the information of a * 9 * particular port, a program positions to *+. * 9 * Each of the entries are considered "not specified" if * 9 * the sign bit of its word is not on. This excludes PCTERMA * 9 * and PCTERMT which are always there. * 9 * * 9 ********************************************************************************** 9 00000004 ABS 9 PCPLENGTH EQU 4 position of 4 chars giving length 00000008 ABS 9 PCPBASE EQU 8 position of 4 chars giving base 9 00000000 9 PCPROTO BASE R0 00160800 0 BASE 9 PCIBAUD BSS 1 input baud rate 00160801 0 BASE 9 PCOBAUD BSS 1 output baud rate 00160802 0 BASE 9 PCFUNCT BSS 1 00003010 BYTE 9 PCFCTSP EQU BIT 24 clear to send processing 00003210 BYTE 9 PCFXOFF EQU BIT 25 XON/XOFF processing 00003410 BYTE 9 PCFBRKOUT EQU BIT 26 don't output when recieving break 00003610 BYTE 9 PCFRDE EQU BIT 27 receive data enable 00003810 BYTE 9 PCCHKIP EQU BIT 28 1 sez check parity of input character 00003A20 BYTE 9 PCPGEN EQU BITS 29:30 parity generation of output characters 00003E10 BYTE 9 PCFSTOPB EQU BIT 31 stop bits (0=>1, 1=>2) 00160803 0 BASE 9 PCCARW BSS 1 carriage width 00160804 0 BASE 9 PCHEIGHT BSS 1 height of a page 00160805 0 BASE 9 PCCRD BSS 1 carriage return delay (MS) 00160806 0 BASE 9 PCLFD BSS 1 line feed delay (MS) 00160807 0 BASE 9 PCFFD BSS 1 form feed delay (MS) 00160808 0 BASE 9 PCBKSPC BSS 1 backspace character 00160809 0 BASE 9 PCLKILLC BSS 1 line kill character 0016080A 0 BASE 9 PCECHOM BSS 1 echo mode 0016080B 0 BASE 9 PCTERMT BSS 1 terminal type code (pak6) 0016080C 0 BASE 9 PCTERMG BSS 1 terminating character group 0016080D 0 BASE 9 PCTERMA BSS 8 terminating character array 00160054 0 CACH 9 PCLOCATION BSSC 30 text describing terminal location 0016081D 0 BASE 9 PCAUTOLOG BSS 10 auto logon account 00160827 0 BASE 9 PCIXOFF BSS 1 1 sez xoff port on input buffer full 00160828 0 BASE 9 PCFPROTO BSS 1 interface protocal 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 182 (MACROINVOK) F 12 00000000 ABS 9 PCPNONE EQU 0 none 00000001 ABS 9 PCPDISC EQU 1 disconnect on DTR drop 00000002 ABS 9 PCP103H EQU 2 103 handshake 00160829 0 BASE 9 PCTSMTR BSS 1 initial state of our transmitters 00003010 BYTE 9 PCTRI EQU BIT 24 ring indicator 00003210 BYTE 9 PCTCARD EQU BIT 25 carrier detect 00003410 BYTE 9 PCTDTR EQU BIT 26 data terminal ready/data set ready 00003810 BYTE 9 PCTRTS EQU BIT 28 request to send/clear to send 0016082A 0 BASE 9 PCHTD BSS 1 horizontal tab delay (MS) 0016082B 0 BASE 9 PCBRCH BSS 1 'break' character 0016082C 0 BASE 9 PCSITE BSS 2 site name for terminal (pak12) 0016082E 0 BASE 9 PCTERMTYPE BSS 2 terminal type (pak12) 9 BSS 12 expansion 9 DRCT 0000003C ABS 9 PCLENGTH EQU DISPW PCPROTO 9 ORG PCPROTO 10 11 DIRINFORD LIST 11 ********************************************************************************** 11 * * 11 * This is the format of information that is returned to * 11 * the user when he requests directory information. The * 11 * header is returned only when the .DIR is at load point. * 11 * After that the buffer is filled with an integral number of * 11 * entries, one for each file. * 11 * When the directory is exhausted, an end-of-data status * 11 * is returned. * 11 * * 11 ********************************************************************************** 11 00000000 11 DIRHINFO BASE R0 Header giving account information 00160800 0 BASE 11 DIRHLNTH BSS 1 Length of entry in words (now 8) 00160801 0 BASE 11 DIRFLAGS BSS 1 Flags 00080011 0 ZBM 11 DIRSHADOW EQU DIRFLAGS/BIT 0 On if a shadow account 00080211 0 ZBM 11 DIRFOREIGN EQU DIRFLAGS/BIT 1 On if account not at home here 00080411 0 ZBM 11 DIRNETWORK EQU DIRFLAGS/BIT 2 On if account accessed via network 00160802 0 BASE 11 DIRVOLUME BSS2 1 Volume account is on (PAK12) 00160804 0 BASE 11 DIRSYSTEM BSS 1 System account is on (PAK6) 00160805 0 BASE 11 DIRACCOUNT BSS2 1 Account name (PAK12) 00160807 0 BASE 11 DIRPROJECT BSS 1 Project of account (PAK6) 11 DRCT 00000008 ABS 11 DIRHWIDE EQU DISPW DIRHINFO Template length 11 ORG DIRHINFO Recover template space 11 11 11 ********************************************************************************** 11 * * 11 * Template for .DIR file entry block * 11 * * 11 ********************************************************************************** 11 00000000 11 DIREINFO BASE R0 Entry for individual file 00160800 0 BASE 11 DIRENTLEN BSS 1 Entry length in words 00160801 0 BASE 11 DIRNAME BSS2 1 Name of file (PAK12) 00160803 0 BASE 11 DIREXT BSS 1 File name extension (PAK6) 00160804 0 BASE 11 DIRCREATD BSS 1 Creation date 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 183 (MACROINVOK) F 12 00160805 0 BASE 11 DIRLACSD BSS 1 Last access date 00160806 0 BASE 11 DIRLMODD BSS 1 Last modified date 00160807 0 BASE 11 DIRLBKUPD BSS 1 Last backup date 11 00080108 0 ZBM 11 DIRTOTRACS BSSB 16 Total read accesses 00082108 0 ZBM 11 DIRTOTWACS BSSB 16 Total write accesses 11 00080109 0 ZBM 11 DIRRACS BSSB 16 Currently active EQUIPs for RO 00082109 0 ZBM 11 DIRWACS BSSB 16 Currently active EQUIPs for RW 11 0008010A 0 ZBM 11 DIRMWACS BSSB 16 Currently active EQUIPs for MW 0008218A 0 ZBM 11 DIRTFL BSSB 24 Total file length (in blocks) 0008118B 0 ZBM 11 DIRROOTBLK BSSB 24 Root block (or 0 if not GOD) 11 00160030 0 CACH 11 DIRTYPE BSSB 8 Type of file (see FSSTATDTYP) 0008104C 0 ZBM 11 DIRACCESS BSSB 4 Access allowed (see FSSTATACS) 0008182C 0 ZBM 11 DIRRAFTYPE BSSB 2 Empty, Tiny, Small, Large 11 BSSB 2 filler 00160032 0 CACH 11 DIRPRGINT BSSB 8 Purge interval 0008301C 0 ZBM 11 DIRPRGFLG BSSB 1 On if file was purged 0008321C 0 ZBM 11 DIRNOBKUP BSSB 1 On if file should not be backed up 0008341C 0 ZBM 11 DIRRCVRD BSSB 1 On if file recovered from backup 0008361C 0 ZBM 11 DIRFWWSC BSSB 1 On if file EQUIPed for W at crash 0008381C 0 ZBM 11 DIRFBC BSSB 1 On if file being closed 00083A1C 0 ZBM 11 DIRGHOST BSSB 1 On if file not yet recovered from backup 00083C1C 0 ZBM 11 DIRTRANS BSSB 1 On if file opened when user program crashed 00083E1C 0 ZBM 11 DIRFLOG BSSB 1 On if file access should be logged 11 11 BSSB 1 unused filler 0008021D 0 ZBM 11 DIRLRAF BSSB 1 On if a large (2 level) .RAF 0008050D 0 ZBM 11 DIRCUSE BSSB 16 current use count 11 0016080E 0 BASE 11 DIRUSRFLD BSS 1 user-definable field 0016080F 0 BASE 11 DIRSERNO BSS2 1 file serial number 00160810 0 BASE 11 DIRUNITNM EQU DIRSERNO(1) unit number for hardware devices 11 BSS 0 *** filler *** 11 DRCT 00000011 ABS 11 DIRENTWIDE EQU DISPW DIREINFO Template size in words 11 ORG DIREINFO Recover template space 12 13 FILESTAT LIST 13 ********************************************************************************** 13 * * 13 * Definition of the fields and values for the static and * 13 * dynamic statuses of a file. * 13 * * 13 ********************************************************************************** 13 13 * Format of File static status 13 * 13 * EQU BIT 0 always zero 00001C40 BYTE 13 FSSTATPRIV EQU BITS 14:17 privilege to access device 00002410 BYTE 13 FSSTATCRT EQU BIT 18 file was created by OPEN 00002630 BYTE 13 FSSTATACS EQU BITS 19:21 access allowed to device 13 * EQU BIT 22 unused - reserved 00002E10 BYTE 13 FSSTATABS EQU BIT 23 on if unit is absolute I/O 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 184 (MACROINVOK) F 12 00003010 BYTE 13 FSSTATWSC EQU BIT 24 on if file writing when system crashed 00003210 BYTE 13 FSSTATSAV EQU BIT 25 on if device in directory somewhere 00003460 BYTE 13 FSSTATDTYP EQU BITS 26:31 type code for the device 13 13 * Values for FSSTATPRIV 13 * (privilege implies what you would be allowed to have) 00000000 ABS 13 FSPRIVRW EQU 0 read/write 00000001 ABS 13 FSPRIVRO EQU 1 read only 00000002 ABS 13 FSPRIVMOD EQU 2 modify 00000003 ABS 13 FSPRIVXO EQU 3 execute only 00000008 ABS 13 FSPRIVBKUP EQU 8 backup 0000000F ABS 13 FSPRIVNOT EQU 0F no privilege 00003E10 BYTE 13 FSPRIVNWB EQU BIT 31 bit, if on, implies no write possible 13 * Values for FSSTATACS 13 * (access implies what you actually requested and have) 00000000 ABS 13 FSACSRW EQU 0 read/write 00000001 ABS 13 FSACSRO EQU 1 read only 00000002 ABS 13 FSACSAO EQU 2 append only 00000003 ABS 13 FSACSXO EQU 3 execute only 00000004 ABS 13 FSACSMW EQU 4 multiple write 00000005 ABS 13 FSACSDR EQU FSACSMW+1 multiple write 00000007 ABS 13 FSACSNDA EQU 7 no data access 00003E10 BYTE 13 FSACSNWB EQU BIT 31 bit, if on, sez no write possible 13 * Values for FSSTATDTYP 00000000 ABS 13 DTYPEUNDEF EQU 0 undefined and illegal 00000001 ABS 13 DTYPESAF EQU 1 sequential access file 00000002 ABS 13 DTYPERAF EQU 2 random access file 00000003 ABS 13 DTYPECODE EQU 3 code file 00000004 ABS 13 DTYPEPATH EQU 4 communication path 00000005 ABS 13 DTYPEDIR EQU 5 directory 00000006 ABS 13 DTYPENULL EQU 6 output eater 00000007 ABS 13 DTYPETERM EQU 7 interactive terminal 13 * EQU 8 unused (was lock) 00000009 ABS 13 DTYPETASK EQU 9 "batch" job submission unit 0000000A ABS 13 DTYPECDR EQU 10 card reader 0000000B ABS 13 DTYPELP EQU 11 line printer 0000000C ABS 13 DTYPEMT EQU 12 magnetic tape 0000000D ABS 13 DTYPECT EQU 13 cartridge magnetic tape 0000000E ABS 13 DTYPEVOL EQU 14 a volume 0000000F ABS 13 DTYPEVT EQU 15 video tape 00000010 ABS 13 DTYPELAST EQU 16 last code plus one 13 13 13 * Format of a file's dynamic status 00000010 BYTE 13 FDSTATAERR EQU BIT 0 on if error code not zero 00000880 BYTE 13 FDSTATLUN EQU BITS 4:11 lun having this status 00002040 BYTE 13 FDSTATRTYP EQU BITS 16:19 type of last record read 00002810 BYTE 13 FDSTATLP EQU BIT 20 on if device positioned at beginning 00002AB0 BYTE 13 FDSTATERR EQU BITS 21:31 error code 13 13 * Values for FDSTATRTYP - record types 00003810 BYTE 13 FDRTYPSYSB EQU BIT 28 if on, record is either EOD or EOF 00003E10 BYTE 13 FDRTYPEODB EQU BIT 31 if FDRTYPSYSB also, then EOD 00000000 ABS 13 FDRTYPTEXT EQU 0 text record 00000001 ABS 13 FDRTYPTXTF EQU 1 text with forms control 00000002 ABS 13 FDRTYPBIN EQU 2 binary record 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 185 (MACROINVOK) F 12 00000004 ABS 13 FDRTYPLBL EQU 4 label record 00000005 ABS 13 FDRTYPCOMM EQU 5 comment record 00000008 ABS 13 FDRTYPFM EQU 8 file mark (end of file, EOF) 00000009 ABS 13 FDRTYPEOD EQU 9 end of data (EOD) 0000000B ABS 13 FDRTYPAEOD EQU 11 abnormal end of date (AEOD) 14 15 BKUPINFORD LIST 15 ********************************************************************************** 15 * * 15 * Definition of system header made in backup. * 15 * * 15 ********************************************************************************** 15 00000000 15 HDRPROTO BASE R0 00160800 0 BASE 15 BKUPHDRW1 BSS 1 first word of header 000000F0 BYTE 15 FILEINFOT EQU BITS 0:14 type of backup information 00000000 ABS 15 FILEINFOTV EQU 0 volume information 00000001 ABS 15 FILEINFOTA EQU 1 account information 00000002 ABS 15 FILEINFOTF EQU 2 file information 00000003 ABS 15 FILEINFOTD EQU 3 file page information 00000004 ABS 15 FILEINFOTM EQU 4 mapped file page information 00001F10 BYTE 15 BKUPREV EQU BITS 15:31 revision number 00160801 0 BASE 15 BKUPHDRW2 BSS 1 second word of header 000000F0 BYTE 15 FSTBKUPLEN EQU BITS 0:14 first optional length 00001F10 BYTE 15 SNDBKUPLEN EQU BITS 15:31 second optional length 15 DRCT 00000002 ABS 15 BKUPHDRLEN EQU DISPW HDRPROTO length of header 15 ORG HDRPROTO reclaim space 16 17 UNDRPINFORD LIST 17 ********************************************************************************** 17 * * 17 * The under process structure read request returns the * 17 * following block of information for each process. * 17 * * 17 ********************************************************************************** 17 00000000 17 UNDRPROTO BASE R0 000800F0 0 ZBM 17 UNDRRSTR BSSB 15 process restrictions 00081F10 0 ZBM 17 UNDRELEN BSSB 17 length of this entry, in words 00080091 0 ZBM 17 UNDRLEVEL BSSB 9 level number of this under process 00081371 0 ZBM 17 UNDRPSN BSSB 23 process serial number of this process 00080172 0 ZBM 17 UNDRDPSN BSSB 23 process serial number of father 00082F72 0 ZBM 17 UNDRDBG BSSB 23 process serial number of debugger process 17 BSSB 18 reserved for future expansion 00160804 0 BASE 17 UNDRNAME BSS 2 process name 17 00081C10 0 ZBM 17 UNDRSTCTG1 EQU UNDRRSTR/BIT 31 on if group 1 restrictions (limit change) 00081A10 0 ZBM 17 UNDRSTCTG2 EQU UNDRRSTR/BIT 30 on if group 2 restrictions (catalog fetch) 00081810 0 ZBM 17 UNDRSTCTG3 EQU UNDRRSTR/BIT 29 on if group 3 restrictions (acct att. chng) 00081610 0 ZBM 17 UNDRSTCTG4 EQU UNDRRSTR/BIT 28 on if group 4 restrictions (unassigned) 00081410 0 ZBM 17 UNDRSTCTG5 EQU UNDRRSTR/BIT 27 on if group 5 restrictions (unassigned) 00081210 0 ZBM 17 UNDROPREQ EQU UNDRRSTR/BIT 26 on if operator requests restricted 00081010 0 ZBM 17 UNDRMAINTR EQU UNDRRSTR/BIT 25 on if maintenance read restricted 00080E10 0 ZBM 17 UNDRMAINTW EQU UNDRRSTR/BIT 24 on if maintenance write restricted 00080C10 0 ZBM 17 UNDRBACKUP EQU UNDRRSTR/BIT 23 on if backup requests restricted 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 186 (MACROINVOK) F 12 00080A10 0 ZBM 17 UNDRMANAGR EQU UNDRRSTR/BIT 22 on if manager requests restricted 00080810 0 ZBM 17 UNDREXO EQU UNDRRSTR/BIT 21 on if address space is execute only 00080610 0 ZBM 17 UNDRCNTLM EQU UNDRRSTR/BIT 20 on if in Control Mode 17 17 DRCT 00000006 ABS 17 UNDRPLONG EQU DISPW UNDRPROTO 00000003 ABS 17 UNDRPLOG EQU UNDRPLONG LOG 2 17 ORG UNDRPROTO recover lost space 18 19 LUINFORD LIST 19 ********************************************************************************** 19 * * 19 * The request that returns information on the local * 19 * units for a specific underprocess conforms to the following * 19 * format. * 19 * * 19 ********************************************************************************** 19 00000000 19 LUPROTO BASE R0 00160000 0 CACH 19 LUEQUIVS BSSB 8 number of units opened to this device 00081040 0 ZBM 19 LULASTREC BSSB 4 type of last record read 00081810 0 ZBM 19 LULOADPT BSSB 1 unit is currently position at the load point 00081A10 0 ZBM 19 LUTRANS BSSB 1 on if unit has transaction in progress 19 BSSB 1 reserved for future expansion 00081F10 0 ZBM 19 LUELEN BSSB 17 length of this entry (words) 19 00160004 0 CACH 19 LUUNIT BSSB 8 unit number having this status 00081121 0 ZBM 19 LUSSTAT BSSB 18 unit static status 19 BSSB 6 reserved for future expansion 19 00081041 0 ZBM 19 LUPRIV EQU LUSSTAT/BITS 14:17 privilege to access this device 00081811 0 ZBM 19 LUCRT EQU LUSSTAT/BIT 18 file created by OPEN 00081A31 0 ZBM 19 LUACS EQU LUSSTAT/BITS 19:21 access allowed to device 00082411 0 ZBM 19 LUWWC EQU LUSSTAT/BIT 24 on if file writing when system crashed 00082611 0 ZBM 19 LUSAVE EQU LUSSTAT/BIT 25 on if device in directory somewhere 00082861 0 ZBM 19 LUTYPE EQU LUSSTAT/BITS 26:31 type of device 19 00160802 0 BASE 19 LUVOLNM BSS 2 volume name for device 00160804 0 BASE 19 LUSYSNM BSS 1 system name for device 00160805 0 BASE 19 LUACCT BSS 2 account name for device 00160807 0 BASE 19 LUACCPROJ BSS 1 div/proj name for device 00160808 0 BASE 19 LUFILENM BSS 2 filename for device 0016080A 0 BASE 19 LUEXT BSS 1 filename extension for device 19 19 DRCT 0000000B ABS 19 LULONG EQU DISPW LUPROTO 00000004 ABS 19 LULOG EQU LULONG LOG 2 19 ORG LUPROTO recover lost space 19 19 INPUT HALTDEFS system halt definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 187 (HALTDEFS) F 13 Definitions for operating system halts 4 5 ********************************************************************************** 6 * * 7 * Hardware provided displays * 8 * -------- -------- -------- * 9 * * 10 * The SSU and CPU may interact upon the discovery of * 11 * certain errors and display an appropriate error message in * 12 * the front panel display. This box contains a description * 13 * of those displays. * 14 * * 15 * POWER ON This display comes on when the SSU is cycling * 16 * MCLR and PFW after a power up start. * 17 * * 18 * BSE INIT This display comes on when BSE is already * 19 * asserted immediately after the SSU has * 20 * cycled MCLR and PFW. * 21 * * 22 * NO MEMORY This display comes on when the SSU finds no * 23 * MCU or SMU with memory at page zero. * 24 * * 25 * SELF TEST This display comes on while the SSU sends self * 26 * test commands to the other VRA modules, * 27 * waits two seconds and gets the WRU 15 (self * 28 * test responses). * 29 * * 30 * STF SLOTn This display comes on when the SSU gets either * 31 * a non-zero or a no response to a WRU 15. "n" * 32 * is the slot number of the offending module. * 33 * * 34 * NO CPU This display comes on when the SSU finds no CPU * 35 * in the system. * 36 * * 37 * BSE ACTIVE This display comes on when a module other than * 38 * the SSU is asserting BSE. * 39 * * 40 * ERRx SLOTn This display comes on when the SSU itself notices * 41 * a bus error. "x" is the error code (same as * 42 * the first digit of a WRU 1, and "n" is the slot * 43 * number of the offending module. * 44 * The codes for x are: * 45 * 1 - bus parity error * 46 * 2 - flags wrong or DBW bit wrong * 47 * 3 - bad command code * 48 * 4 - illegal address * 49 * 5 - RTO time out * 50 * 6 - response time out * 51 * 7 - illegal data * 52 * 8 - * 53 * 9 - data wrong during boot * 54 * A - bad WRU response * 55 * * 56 * CPUn ERRxx This display appears when a CPU sends the SSU a * 57 * CPU ERROR command. "n" is the slot number of * 58 * the CPU, and "xx" is the most significant byte * 59 * of the error data sent by the CPU. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 188 (HALTDEFS) F 13 Definitions for operating system halts 60 * * 61 * CPU ERROR CODES (Rev 12 and greater microcode) * 62 * * 63 * The CPU has two types of fatal errors: Bus errors * 64 * and CPU errors. When the CPU gets a Bus error, it asserts * 65 * BSE. When a CPU error occurs, a CPU error message is sent * 66 * to the SSU. In both cases, certain state information has * 67 * been saved by the CPU, and is accessable from the RFP. * 68 * * 69 * The state information is saved as follows: * 70 * * 71 * R11 (SP17) = Microstatus register 1 * 72 * R12 (SP18) = Microstatus register 2 ([28:31]=From register)* 73 * R13 (SP19) = Microstatus register 3 * 74 * R14 (SP20) = Input register 1 * 75 * R15 (SP21) = Input register 2 * 76 * R16 (SP22) = Output register 1 * 77 * R17 (SP23) = Output register 2 * 78 * R19 (SP24) [0:3] = Error code * 79 * [4:7] = Error parameter * 80 * [20:31] = ucode address where error was * 81 * detected * 82 * * 83 * The error codes are listed below. Error codes 1 * 84 * through 7 are Bus error codes and codes 8 through A are * 85 * CPU error codes. * 86 * * 87 * 1 --> Parity error on the Bus. * 88 * 2 --> Bad flags on the Bus. * 89 * 3 --> Bad command code on the Bus. * 90 * 4 --> Bad command address on the Bus. * 91 * 5 --> RTO timeout on the Bus. * 92 * 6 --> IBF timeout on the Bus. * 93 * 7 --> Parity and flag error on the Bus (same as * 94 * codes 1 and 2) * 95 * 8 --> Page fault during trap setup * 96 * 9 --> Page fault when trying to store console * 97 * area * 98 * A --> Hardware error * 99 * * 100 * The second digit of the error message is the error * 101 * parameter. These are used to indicate the type of word * 102 * which caused a flag or parity error. * 103 * * 104 * 0 --> No information * 105 * 1 --> Error in command word of received command * 106 * 2 --> Error in data word of received command * 107 * 3 --> Error in instruction fetch data * 108 * 4 --> Error in operand fetch data * 109 * 5 --> Error in pointer fetch data * 110 * 6 --> Error in interrupt poll data * 111 * 7 --> Error in trap fetch data * 112 * * 113 * POWER OFF This display comes on when the SSU sees the * 114 * Control Panel Power switch turned off. * 115 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 189 (HALTDEFS) F 13 Definitions for operating system halts 116 * acdctempPF This display comes on when the SSU sees a power * 117 * failure of some kind. * 118 * AC PF AC Power Fail warning (detected by the AC * 119 * Power Fail Detector board or from memory power * 120 * failure). * 121 * DC PF Bad +5 VDC on the SSU. * 122 * TEMPPF Overtemperature in the main cardcage. * 123 * Note: more than one of these may be active at * 124 * a time. * 125 * * 126 * SSU ERR ps This display comes on when the SSU fails its own * 127 * self test. "p" is the primary error code, and * 128 * "s" is the secondary error code. The error codes * 129 * are listed below: * 130 * 1 -- Real Time Clock not ticking * 131 * 2 -- SSU Ram Error 0 -- Zeros test error * 132 * 1 -- #FF test error * 133 * 2 -- Address test error * 134 * 3 -- Complement address test error * 135 * 3 -- SSU Bus Error 1 -- Reset logic error * 136 * 2 -- WBTOR/status error * 137 * 3 -- Call back logic error * 138 * 4 -- Data path error * 139 * 5 -- Parity error when good * 140 * parity expected * 141 * 6 -- No parity error when bad * 142 * parity forced * 143 * 4 -- Control Panel Switch read/write error * 144 * 5 -- Bootstrap Eprom checksum error * 145 * 6 -- Bus Control Register read/write error * 146 * * 147 * SSU HALTxx This code is displayed when the SSU microcode * 148 * has detected an internal inconsistency that * 149 * makes it unlikely to be able to continue. * 150 * xx gives the reason (see list below). * 151 * * 152 * SSU HALT CODE LIST FOR REV 14 MICROCODE * 153 * This is a list of SSU halt codes for SSU * 154 * microcode rev 14. (The halt code lists for * 155 * earlier microcode revisions are different.) * 156 * There are only two ways to restart an SSU that * 157 * has halted. One way is to manipulate the SSU's * 158 * program counter with a hardware debugger. The * 159 * other way to restart a halted SSU is to power * 160 * down the VRA cardcage and then power it up * 161 * again. (This is done by cycling the front panel * 162 * power switch.) * 163 * * 164 * HALT CODE EXPLANATION * 165 * * 166 * SSU HALT01 CreateProc called with all Process blocks in use * 167 * SSU HALT02 DestroyProc called with no process to destroy * 168 * SSU HALT03 Timer.Wait called with too low of a base address * 169 * SSU HALT04 Timer in use when Timer.Wait called * 170 * SSU HALT05 Cancel.Timer called with no timer in use * 171 * SSU HALT06 Event.Wait called with both events in use * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 190 (HALTDEFS) F 13 Definitions for operating system halts 172 * SSU HALT07 Cancel.Event called with no event in use * 173 * SSU HALT08 Cancel.Event called with incorrect event return index* 174 * SSU HALT09 PFW interrupt reached as general interrupt * 175 * SSU HALT0A CBN asserted with IBF unasserted * 176 * SSU HALT0B RFP.State = WF.Modem when starting from RXR interrupt* 177 * SSU HALT0C RFP.State = Send.Output when starting from RXR interrupt* 178 * SSU HALT0D RFP.State = Send.WF.CP when starting from RXR interrupt* 179 * SSU HALT0E RFP.State = WF.CP when starting from RXR interrupt * 180 * SSU HALT0F RFP.State = WF.Ring when entering from Txr Interrupt* 181 * SSU HALT10 RFP.State = WF.Modem when entering from Txr Interrupt* 182 * SSU HALT11 RFP.State = WF.Break when entering from Txr Interrupt* 183 * SSU HALT12 RFP.State = WF.CP when entering from Txr Interrupt * 184 * SSU HALT13 RFP.State = WF.Input.SOM when entering from Txr Interrupt* 185 * SSU HALT14 RFP.State = WF.InputChar when entering from Txr Interrupt* 186 * SSU HALT15 RFP.State = WF.Ring when entering from CP Interrupt * 187 * SSU HALT16 RFP.State = WF.Modem when entering from CP Interrupt* 188 * SSU HALT17 RFP.State = WF.Break when entering from CP Interrupt* 189 * SSU HALT18 RFP.State = Send.Output when entering from CP Interrupt* 190 * SSU HALT19 RFP.State = WF.Input.SOM when entering from CP Interrupt* 191 * SSU HALT1A RFP.State = WF.InputChar when entering from CP Interrupt* 192 * SSU HALT1B RFP.State = Send.Output when entering * 193 * SSU HALT1C RFP.State = Send.WF.CP when entering * 194 * SSU HALT1D RFP.State = WF.CP when entering from Short Timer interrupt* 195 * SSU HALT1E RFP.State = WF.Input.SOM when entering * 196 * SSU HALT1F RFP.State = WF.Ring when entering * 197 * SSU HALT20 RFP.State = Send.Output when entering * 198 * SSU HALT21 RFP.State = Send.WF.CP when entering * 199 * SSU HALT22 RFP.State = WF.CP when entering from Long Timer Interrupt* 200 * SSU HALT23 Trap for possible bugs, ReturnA with return index of 0* 201 * SSU HALT24 Trap for possible bugs, ReturnB with return index of 0* 202 * * 203 * HLTn ahhhh This display comes on when the CPU sends a CPU HALT * 204 * command to the SSU. "n" is the slot number of * 205 * the CPU. "ahhhh" is the halt code in the least * 206 * significant 22 bits of data from the CPU. Note: * 207 * if the halt code is all ones, the SSU will not * 208 * change the Control Panel display. * 209 * See the following descriptions of these codes. * 210 * * 211 * STPn ahhhh This display comes on when the CPU sends a CPU STOP * 212 * command to the SSU. "n" is the slot number of * 213 * the CPU. "ahhhh" is the stop code in the least * 214 * significant 22 bits of data from the CPU. Note: * 215 * if the stop code is all ones, the SSU will not * 216 * change the Control Panel display. * 217 * See the following descriptions of these codes. * 218 * * 219 * BOOT n This display comes on when the boot switch is * 220 * pushed. "n" is the value of the switches 1-4. * 221 * * 222 * FP RUNNING This display comes on when the Front Panel (RDU or * 223 * RITA) has control of the system. * 224 * * 225 * @@@@@@@@ These displays (and other similar ones) occur * 226 * ???????? when the logic driving the control panel * 227 * @ has failed or is not being clocked. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 191 (HALTDEFS) F 13 Definitions for operating system halts 228 * * 229 ********************************************************************************** 230 231 ********************************************************************************** 232 * * 233 * Other text displays * 234 * ----- ---- -------- * 235 * * 236 * See PROMBOOT for a description of its text error * 237 * messages. * 238 * During normal system operation, the front panel is * 239 * driven by the FPFLASHER routine in TIMER. That routine will * 240 * display one of the normal displays (selected by the FP * 241 * switches) alternating with any error messages. See the * 242 * timer routine for a description of the normal displays. * 243 * See the operator code for a description of the error * 244 * displays. * 245 * * 246 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 192 (HALTDEFS) F 13 Definitions for operating system halts 248 249 ********************************************************************************** 250 * * 251 * Operating System Halts * 252 * --------- ------ ----- * 253 * * 254 * The operating system is absolutely riddled with halts. * 255 * This is so that errors show up at the earliest possible * 256 * moment and give us a chance to find the source of the * 257 * problem. * 258 * In case bugs escape to the field, or a system has an * 259 * intermittant hardware problem, each halt has a unique code * 260 * associated with it. * 261 * The instruction word is sent to the SSU on a halt or a * 262 * stop. The SSU displays the HALT information on the front * 263 * panel. The left 3 characters on the display are "HLT" or * 264 * "STP" as appropriate. The next character is the slot * 265 * number of the CPU that sent the HALT or STOP. The next * 266 * character is a blank and the remaining 5 characters are * 267 * filled with the rightmost 22 bits of the instruction. The * 268 * left 6 bits are displayed as a 6 bit ASCII character and * 269 * the remaining 16 bits as 4 hex digits. * 270 * There are only a few STOP instructions. They are used * 271 * in those cases where a remedial course of action is readily * 272 * apparent and the cause of the error is at least partially * 273 * anticipated. A good example is that of a table filling up * 274 * where the extra entries can be safely discarded. The * 275 * operator may press run and the system will do its best to * 276 * continue operation. Even these STOPs, however, really * 277 * should not appear and their cause should be investigated. * 278 * * 279 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 193 (HALTDEFS) F 13 Definitions for operating system halts 281 282 ********************************************************************************** 283 * * 284 * Diagnostic actions * 285 * ---------- ------- * 286 * * 287 * When a halt or stop occurs, the appropriate code * 288 * should be found in the listing. To find them, use the * 289 * front panel display to produce a symbol of the form * 290 * 'HALTS10D1' or 'STOPF10A7'. This symbol may then be found * 291 * in the CREF for the OS. The definition will be found here * 292 * in the HALTDEFS file, and there will be one use of the * 293 * symbol. That place where the symbol is used often contains * 294 * commentary about what is in the registers, etc. * 295 * Any of these halts represents some problem discovered * 296 * by the system, generally quite a serious one. The notes in * 297 * this file give only a cursory feeling of what is happening. * 298 * In many cases, a HALT was inserted into the operating * 299 * system because it was easy to do, but we don't really * 300 * expect to see one. The 'bogus return from LIMITCHECK' is a * 301 * good example of this. Checking in the listing will just * 302 * show the HALT surrounded by relatively normal code and * 303 * commentary. * 304 * However, there are a number of halts that were * 305 * designed into the system to detect a specific class of * 306 * error. A check in the listing will reveal a more complete * 307 * description of the problem, and what registers mean what, * 308 * etc. These halts often get associated with a particular * 309 * bug, especially when the bug is not fixed right away. This * 310 * has the particular danger of causing that halt to assume a * 311 * low importance even after the bug is fixed. A good example * 312 * of this is the HLT S0007 that became intimately associated * 313 * with COMM input buffer overflows. This bug is now fixed, * 314 * yet anyone encountering a S0007 halt still thinks of it as * 315 * a known but not yet fixed COMM bug. Any new S0007 halts * 316 * now indicate some entirely different problem, or (ecch) * 317 * evidence that the bug is not really fixed. * 318 * Generally, the register readings should be recorded by * 319 * issuing a STATUS command to the RDU. In those cases where * 320 * the commentary indicates that a particular register * 321 * (generally R4) points to the console area (CA) of the * 322 * offending process, a dump of that CA is necessary (although * 323 * it is included in the crash dump, it is extremely helpful * 324 * to have without redialling the site to look at the crash * 325 * dump). * 326 * * 327 ********************************************************************************** 328 329 * HALT letter codes and meaning 00001460 BYTE 330 LETTERSPOT EQU BITS 10:15 position in HALT of letter 00020000 ABS 331 BHALT EQU ("B" AND 03F)*LETTERSPOT for bootstrap and power fail problems 00030000 ABS 332 CHALT EQU ("C" AND 03F)*LETTERSPOT control mode and system process errors 00040000 ABS 333 DHALT EQU ("D" AND 03F)*LETTERSPOT disk structure problem 00060000 ABS 334 FHALT EQU ("F" AND 03F)*LETTERSPOT a table has filled up 00080000 ABS 335 HHALT EQU ("H" AND 03F)*LETTERSPOT hardware problems 00090000 ABS 336 IHALT EQU ("I" AND 03F)*LETTERSPOT interrupt code error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 194 (HALTDEFS) F 13 Definitions for operating system halts 000D0000 ABS 337 MHALT EQU ("M" AND 03F)*LETTERSPOT memory failure 00100000 ABS 338 PHALT EQU ("P" AND 03F)*LETTERSPOT for peripheral equipment problems 00130000 ABS 339 SHALT EQU ("S" AND 03F)*LETTERSPOT for system errors 00170000 ABS 340 WHALT EQU ("W" AND 03F)*LETTERSPOT errors from an offline utility 001A0000 ABS 341 ZHALT EQU ("Z" AND 03F)*LETTERSPOT for shutdown (sleep) errors 342 343 ********************************************************************************** 344 * * 345 * Important Notice!!! * 346 * All errors flagged with a star ("*") are security * 347 * violations. Exercise due caution in dealing with these * 348 * halts to avoid: * 349 * 1) offending customers who have accidently encountered one * 350 * 2) defeating the purpose of protecting BTI & proprietary * 351 * account owners. * 352 * * 353 ********************************************************************************** 354 002A0000 ABS 355 SVHLT EQU ("*" AND 03F)*LETTERSPOT for security violations 356 003FFFFF ABS 357 NOHALTCODE EQU -1/BITS 10:31 do not display HALT/STOP code in lights 358 359 * individual halt codes 360 361 * Power fail restart 362 * BHALT+01000 memory battery exhausted. Stored by SMU microcode 00021001 ABS 363 HALTB1001 EQU BHALT+01001 power up without corresponding power down processing 364 * This is the normal halt if power is 365 * cycled following a sleep. 00021004 ABS 366 HALTB1004 EQU BHALT+01004 VRA module missing at power up time 367 * This happens if someone changes the configuration 368 * of the system while it is powered down, e.g. by 369 * removing a CPU. 370 371 * PROMBOOT routine 00021002 ABS 372 HALTB1002 EQU BHALT+01002 power up, offline stuff not restartable 373 * B1002 is the normal halt if power is 374 * cycled following completion of off-line work. 00021003 ABS 375 STOPB1003 EQU BHALT+01003 recoverable error reading boot block 00022000 ABS 376 STOPB2XXX EQU BHALT+02000 disk DSKxxx failed self-test 377 378 * TAPEBOOT routine 00023010 ABS 379 HALTB3010 EQU BHALT+03010 invalid front panel switches for boot 00023011 ABS 380 HALTB3011 EQU BHALT+03011 *** to be determined *** 381 382 * TAPERECOVER routine 00023100 ABS 383 HALTB3100 EQU BHALT+03100 ran out of disk space in unusual circumstance 00023101 ABS 384 HALTB3101 EQU BHALT+03101 ran out of disk space allocating first sec block 00023102 ABS 385 HALTB3102 EQU BHALT+03102 ran out of disk space allocating second sec block 00023103 ABS 386 HALTB3103 EQU BHALT+03103 disk error reading IDX 00023104 ABS 387 HALTB3104 EQU BHALT+03104 disk error reading IDX 00023106 ABS 388 HALTB3106 EQU BHALT+03106 disk error reading IDX 00023107 ABS 389 HALTB3107 EQU BHALT+03107 disk error reading IDX 00023108 ABS 390 HALTB3108 EQU BHALT+03108 disk error reading IDX 00023109 ABS 391 HALTB3109 EQU BHALT+03109 duplicate account found 0002310A ABS 392 HALTB310A EQU BHALT+0310A duplicate file found 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 195 (HALTDEFS) F 13 Definitions for operating system halts 0002310B ABS 393 HALTB310B EQU BHALT+0310B in DUMMYACCT without a file or file page logical rec 0002310C ABS 394 HALTB310C EQU BHALT+0310C UDIR block overflow 0002310D ABS 395 HALTB310D EQU BHALT+0310D Illegal hardware type 0002310E ABS 396 HALTB310E EQU BHALT+0310E record miscompare on read twice option 0002310F ABS 397 HALTB310F EQU BHALT+0310F not recoverable tape error on reread 00023110 ABS 398 HALTB3110 EQU BHALT+03110 disk error reading UDIR 00023111 ABS 399 HALTB3111 EQU BHALT+03111 account not present for latecomer 00023112 ABS 400 HALTB3112 EQU BHALT+03112 excessive tape errors 00023113 ABS 401 HALTB3113 EQU BHALT+03113 excessive tape errors 402 403 * DISKCOPY routine 00023200 ABS 404 HALTB3200 EQU BHALT+03200 internal table error 00023201 ABS 405 HALTB3201 EQU BHALT+03201 internal table error 406 407 * DISKBOOT routine 00024004 ABS 408 HALTB4004 EQU BHALT+04004 no SSU found 00024011 ABS 409 HALTB4011 EQU BHALT+04011 disk error: volume label 00024012 ABS 410 HALTB4012 EQU BHALT+04012 disk error: security block 00024013 ABS 411 HALTB4013 EQU BHALT+04013 disk error: IDX 00024014 ABS 412 HALTB4014 EQU BHALT+04014 disk error: directory 00024015 ABS 413 HALTB4015 EQU BHALT+04015 system account not found 00024016 ABS 414 HALTB4016 EQU BHALT+04016 system or crashdump code file not found 00024017 ABS 415 HALTB4017 EQU BHALT+04017 crash dump file is not a code file 00024018 ABS 416 HALTB4018 EQU BHALT+04018 disk error: system file's CCB or data 00024019 ABS 417 HALTB4019 EQU BHALT+04019 system file not a CODE file 00024021 ABS 418 HALTB4021 EQU BHALT+04021 crashdump file not readable 00024022 ABS 419 HALTB4022 EQU BHALT+04022 crashdump file not writable 00024023 ABS 420 HALTB4023 EQU BHALT+04023 segment error status reading check segment 00024024 ABS 421 HALTB4024 EQU BHALT+04024 segment error status while writing 00024025 ABS 422 STOPB4025 EQU BHALT+04025 seek error while doing rezero operation 00024100 ABS 423 HALTB4100 EQU BHALT+04100 offline call to non-existent routine 424 425 * SALON (offline disk driver) 00024031 ABS 426 STOPB4031 EQU BHALT+04031 timeout during seek operation 427 428 * OPL (Offline Program Loader) 00025000 ABS 429 HALTB5000 EQU BHALT+05000 no PPU with comm found by OPL 00025001 ABS 430 HALTB5001 EQU BHALT+05001 no port boards found in first comm. 00025002 ABS 431 HALTB5002 EQU BHALT+05002 no EOP from read operation 00025003 ABS 432 HALTB5003 EQU BHALT+05003 comm not responding to output 00025004 ABS 433 HALTB5004 EQU BHALT+05004 boot switches too high for OPL 00025005 ABS 434 HALTB5005 EQU BHALT+05005 boot switches were too low for OPL 00025006 ABS 435 HALTB5006 EQU BHALT+05006 impossible fall out of IRJ loop 00025007 ABS 436 HALTB5007 EQU BHALT+05007 impossible fall out of JDR loop 437 438 * Halt definitions for DiskToTape. 439 * Halts in the packing process 00173210 ABS 440 HALTW3210 EQU WHALT+03210 first element in PRPQ was not volume name 00173211 ABS 441 HALTW3211 EQU WHALT+03211 wrong type encountered in PRPQ element 00173212 ABS 442 HALTW3212 EQU WHALT+03212 one of the disk blocks required for 443 * building a volume record is missing 00173213 ABS 444 HALTW3213 EQU WHALT+03213 bad PRPQ entry, wrong FBI type 445 446 * Halts in the encryption process 00173220 ABS 447 HALTW3220 EQU WHALT+03220 bad encryption format code 00173221 ABS 448 HALTW3221 EQU WHALT+03221 bad encrypt buffer size 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 196 (HALTDEFS) F 13 Definitions for operating system halts 449 450 * Halts in the tape writing process 00173230 ABS 451 HALTW3230 EQU WHALT+03230 could not write on tape, die for now 00173231 ABS 452 HALTW3231 EQU WHALT+03231 first record on TWQ was not fileset 00173232 ABS 453 HALTW3232 EQU WHALT+03232 could not write file mark 00173233 ABS 454 HALTW3233 EQU WHALT+03233 could not write end of tape record 00173234 ABS 455 HALTW3234 EQU WHALT+03234 could not write end of file set record 456 457 * 458 * Halt definitions for PieInTheSky volume rebuilder 459 * 00173300 ABS 460 HALTW3300 EQU WHALT+03300 Insufficient physical memory 00173301 ABS 461 HALTW3301 EQU WHALT+03301 Volume too large for program 462 463 464 * INITIAL 00026000 ABS 465 STOPB600X EQU BHALT+06000 memory is cabled wrong in slot X - RUN to ignore 00026040 ABS 466 HALTB6040 EQU BHALT+06040 PPL FBI table has filled up 00026044 ABS 467 HALTB6044 EQU BHALT+06044 no free pages for the initial process 468 * must rebuild or diskcopy system volume 469 470 * page fault processor 471 *** This batch of halts always represents errors in 472 *** OTHER parts of the system. Rather than getting 473 *** the CPU registers, remember that R4 of the CPU 474 *** that halted contains the console area address 475 *** for the failing process. Dump out the console 476 *** area (use DL in RDU) or execute the LDCA R4 477 *** instruction provided then dump the registers. 00130000 ABS 478 HALTS0000 EQU SHALT+0000 page fault with no user process running 00130001 ABS 479 HALTS0001 EQU SHALT+0001 monitor memory protect violation 00130002 ABS 480 HALTS0002 EQU SHALT+0002 VPAGE element not found 00130004 ABS 481 HALTS0004 EQU SHALT+0004 write into monitor memory 00130005 ABS 482 HALTS0005 EQU SHALT+0005 stop for unknown monitor page 00130007 ABS 483 HALTS0007 EQU SHALT+0007 reference to an unmapped window 00130008 ABS 484 HALTS0008 EQU SHALT+0008 wrong or not mapped virtual free storage 485 486 * MAPOUTFBI subroutine 0013001A ABS 487 STOPS001A EQU SHALT+001A PPLWINDOW is already mapped, check 488 * MFBILAST to see where last call was made from 489 490 * FINDVP routine 00130010 ABS 491 HALTS0010 EQU SHALT+00010 VM list changed out from under us 492 493 * memory parity error processing 000D00C0 ABS 494 HALTM00C0 EQU MHALT+000C0 another PE occurred while processing PE 000800C1 ABS 495 HALTH00C1 EQU HHALT+000C1 meaningless interrupt code (R2) on PE int 00080D00 ABS 496 HALTH0DSC EQU HHALT+00D00 a bus device is dead (gave no response) 000800C3 ABS 497 HALTH00C3 EQU HHALT+000C3 bus device giving repeated spurious errors 00080C00 ABS 498 HALTH0CSC EQU HHALT+00C00 abnormal data from device other than memory 499 * this normally means that a controller has 500 * failed to answer to some type of fetch. 501 * look for a dead controller in slot S, channel C. 000D00C5 ABS 502 HALTM00C5 EQU MHALT+000C5 parity error in OS tables 000D00C6 ABS 503 HALTM00C6 EQU MHALT+000C6 uncorrectable PE in resident OS 000D00C7 ABS 504 HALTM00C7 EQU MHALT+000C7 PE in resident OS while checksums not valid 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 197 (HALTDEFS) F 13 Definitions for operating system halts 001300C8 ABS 505 HALTS00C8 EQU SHALT+000C8 PAL not found 506 507 * dispatcher 00080021 ABS 508 HALTH0021 EQU HHALT+0021 mass storage error on required page 00130022 ABS 509 HALTS0022 EQU SHALT+0022 no PPL corresponding to recombined free storage page 00130023 ABS 510 HALTS0023 EQU SHALT+0023 used all of monitor memory 511 512 * scheduler 00130040 ABS 513 HALTS0040 EQU SHALT+0040 PCB not found on SQRUNNING 514 515 * liquidate a process 00130030 ABS 516 HALTS0030 EQU SHALT+0030 no PCB found for this process 00130031 ABS 517 HALTS0031 EQU SHALT+0031 no PCB found for this process 00130032 ABS 518 HALTS0032 EQU SHALT+0032 improper vanish call 00130033 ABS 519 HALTS0033 EQU SHALT+0033 improper vanish call 00130035 ABS 520 HALTS0035 EQU SHALT+0035 PPL busy count went negative 00130037 ABS 521 HALTS0037 EQU SHALT+0037 PPAGE list went bad 522 523 * ULBTWIDDLE routines 001300E0 ABS 524 HALTS00E0 EQU SHALT+00E0 fetchdir on a non-ULB 001300E1 ABS 525 HALTS00E1 EQU SHALT+00E1 freedir on a non-ULB 001300E2 ABS 526 HALTS00E2 EQU SHALT+00E2 freedir on already free directory 527 528 * WINDOW routines 00130062 ABS 529 HALTS0062 EQU SHALT+0062 attempted DUALWRITE of unlocked page 00130063 ABS 530 HALTS0063 EQU SHALT+0063 block not found in PPAGE list 00130064 ABS 531 STOPS0064 EQU SHALT+0064 window #1 not grubbed before XREQ return 00130065 ABS 532 STOPS0065 EQU SHALT+0065 window #2 not grubbed before XREQ return 533 534 * PROCINOUT routines 001300D0 ABS 535 HALTS00D0 EQU SHALT+00D0 PCB not found on SQxxxxx 001300D1 ABS 536 HALTS00D1 EQU SHALT+00D1 destroying UPC. VASP list didn't empty 001300D2 ABS 537 HALTS00D2 EQU SHALT+00D2 UERRSETY. Wrong PSA mapped. 538 539 * BLDPROCESS 00130070 ABS 540 HALTS0070 EQU SHALT+0070 no legal process number found for new process 00130071 ABS 541 HALTS0071 EQU SHALT+0071 could not initialize user free memory 00130072 ABS 542 HALTS0072 EQU SHALT+0072 could not reserve emergency user free memory 543 544 * GETMEM, FREEMEM 00130080 ABS 545 HALTS0080 EQU SHALT+0080 no free storage available 00130081 ABS 546 HALTS0081 EQU SHALT+0081 illegal block freed (low order bits) 00130082 ABS 547 HALTS0082 EQU SHALT+0082 illegal block freed (high order bits) 00130083 ABS 548 HALTS0083 EQU SHALT+0083 request for block larger than a page 00130084 ABS 549 HALTS0084 EQU SHALT+0084 request to free block larger than a page 550 551 * VGETMEM, VFREEMEM 00130086 ABS 552 HALTS0086 EQU SHALT+0086 wrong mapping while getting user memory 00130087 ABS 553 HALTS0087 EQU SHALT+0087 wrong mapping while freeing user memory 00130088 ABS 554 HALTS0088 EQU SHALT+0088 request for a block larger than a page 00130089 ABS 555 HALTS0089 EQU SHALT+0089 tried to free a block larger than a page 0013008A ABS 556 HALTS008A EQU SHALT+008A lost page out of the PSA 0013008B ABS 557 HALTS008B EQU SHALT+008B user ran out of free storage 0013008C ABS 558 HALTS008C EQU SHALT+008C completely out of physical primary storage 0013008D ABS 559 HALTS008D EQU SHALT+008D couldn't supply user any virtual pages 0013008E ABS 560 HALTS008E EQU SHALT+008E no idle pages for user memory lists 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 198 (HALTDEFS) F 13 Definitions for operating system halts 0013008F ABS 561 HALTS008F EQU SHALT+008F PPL not in FSPPLIST where it should be 562 563 * STACKER 00130090 ABS 564 HALTS0090 EQU SHALT+0090 stack overflow found by DROPCA 00130091 ABS 565 HALTS0091 EQU SHALT+0091 stack overflow found by FREESTACK 566 567 * GETPUTADT 001300A0 ABS 568 HALTS00A0 EQU SHALT+00A0 bad voln table 001300A1 ABS 569 HALTS00A1 EQU SHALT+00A1 duplicate entry while moving entries to disk 570 * THIS IS SERIOUS!!! Run REBUILD on the volume! 001300A3 ABS 571 HALTS00A3 EQU SHALT+00A3 no free lists in use, contrary indication 001300A4 ABS 572 HALTS00A4 EQU SHALT+00A4 no ADT list busy - which list was I using? 000400A5 ABS 573 HALTD00A5 EQU DHALT+00A5 error in both security blocks 001300A6 ABS 574 HALTS00A6 EQU SHALT+00A6 attempt to create too many ADT lists 575 576 * I/O interrupt processor 00090800 ABS 577 HALTI0800 EQU IHALT+0800 SLOTTABLE was garbage or 578 * interrupt from unbelievable slot 00090801 ABS 579 HALTI0801 EQU IHALT+0801 channel table garbage or interrupt 580 * from unbelievable device 581 582 * interrupt sorter 00080050 ABS 583 HALTH0050 EQU HHALT+0050 bad instruction from monitor 00080051 ABS 584 HALTH0051 EQU HHALT+0051 instruction trap from monitor 585 586 * MS driver 00130101 ABS 587 HALTS0101 EQU SHALT+0101 write: FBIDA and PPBLOCK disagree 00130102 ABS 588 HALTS0102 EQU SHALT+0102 remount: matched VOLN HCB <> 0 00100103 ABS 589 HALTP0103 EQU PHALT+0103 error writing non-substitutable block 00130104 ABS 590 HALTS0104 EQU SHALT+0104 MDV element not found in MDV list 00130105 ABS 591 HALTS0105 EQU SHALT+0105 bad segment number in segment reconstructor 592 593 * clock driver routine 00080700 ABS 594 STOPH0700 EQU HHALT+0700 clock moved backwards 595 596 * CIA driver 00100200 ABS 597 STOPP0200 EQU PHALT+0200 CIA board magically appeared 598 599 * CIA utility 00130210 ABS 600 HALTS0210 EQU SHALT+0210 terminator not found in block that claims it 00130213 ABS 601 HALTS0213 EQU SHALT+0213 bad command code passed 00130214 ABS 602 HALTS0214 EQU SHALT+0214 empty PSPROCLIST in CHECKLOGD 603 604 * CPUPATCH process 001310A0 ABS 605 HALTS10A0 EQU SHALT+010A0 patch for this rev level disappeared 606 607 * FREEFILE process 001310B0 ABS 608 HALTS10B0 EQU SHALT+010B0 passed garbage for type to free 001310B1 ABS 609 HALTS10B1 EQU SHALT+010B1 quit when error log file really bad 001310B2 ABS 610 HALTS10B2 EQU SHALT+010B2 called to free a swapping block 611 612 * accounting process 001310C0 ABS 613 HALTS10C0 EQU SHALT+010C0 couldn't unequip work unit 614 615 * substitution process 001010D1 ABS 616 STOPP10D1 EQU PHALT+010D1 multiple disk errors. go tries to continue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 199 (HALTDEFS) F 13 Definitions for operating system halts 001010D2 ABS 617 HALTP10D2 EQU PHALT+010D2 error on bad trax block 001010D3 ABS 618 HALTP10D3 EQU PHALT+010D3 error on substitution block 000610D4 ABS 619 STOPF10D4 EQU FHALT+010D4 bad trax block is full. go to continue 001310D5 ABS 620 HALTS10D5 EQU SHALT+010D5 PPL not found 001310D6 ABS 621 HALTS10D6 EQU SHALT+010D6 substitution list entry not found 000610D7 ABS 622 STOPF10D7 EQU FHALT+010D7 substitution block is full 001310D8 ABS 623 HALTS10D8 EQU SHALT+010D8 substitution list element not found 624 625 * ULB manager 001310E0 ABS 626 HALTS10E0 EQU SHALT+010E0 bad ULB pointer given to FREEULB 001310E1 ABS 627 HALTS10E1 EQU SHALT+010E1 bad ULB pointer given to USEULB 001310E2 ABS 628 HALTS10E2 EQU SHALT+010E2 bad ULB pointer given to FREEULBLK 629 630 * DIOSETUP 00131300 ABS 631 HALTS1300 EQU SHALT+01300 locked page not found in VASP list 632 633 * Utility subroutines for logical units 001311F0 ABS 634 HALTS11F0 EQU SHALT+011F0 bad use count when linking FCB 635 636 * INITDEVACS 00131128 ABS 637 HALTS1128 EQU SHALT+01128 GFC use count went negative 00131129 ABS 638 HALTS1129 EQU SHALT+01129 GFC disappeared 639 640 * NOPEN code 00131131 ABS 641 HALTS1131 EQU SHALT+01131 illegal access for the file privilege 00131132 ABS 642 HALTS1132 EQU SHALT+01132 LIMITCHECK gave bogus return 00131133 ABS 643 HALTS1133 EQU SHALT+01133 LIMITCHECK gave bogus return 00131134 ABS 644 HALTS1134 EQU SHALT+01134 LIMITCHECK gave bogus return 00131135 ABS 645 HALTS1135 EQU SHALT+01135 LIMITCHECK gave bogus return 646 647 * SAF write code 00131108 ABS 648 HALTS1108 EQU SHALT+01108 LIMITCHECK gave bogus return 649 650 * RAF write code 00131110 ABS 651 HALTS1110 EQU SHALT+01110 existing DIR entry disappeared 00131111 ABS 652 HALTS1111 EQU SHALT+01111 LIMITCHECK gave bogus return 00131112 ABS 653 HALTS1112 EQU SHALT+01112 LIMITCHECK gave bogus return 00131113 ABS 654 HALTS1113 EQU SHALT+01113 LIMITCHECK gave bogus return 00131114 ABS 655 HALTS1114 EQU SHALT+01114 LIMITCHECK gave bogus return 00131115 ABS 656 HALTS1115 EQU SHALT+01115 LIMITCHECK gave bogus return 00131116 ABS 657 HALTS1116 EQU SHALT+01116 LIMITCHECK gave bogus return 658 00131118 ABS 659 HALTS1118 EQU SHALT+01118 existing DIR entry disappeared 0013111A ABS 660 HALTS111A EQU SHALT+0111A LIMITCHECK gave bogus return 0013111B ABS 661 HALTS111B EQU SHALT+0111B LIMITCHECK gave bogus return 0013111C ABS 662 HALTS111C EQU SHALT+0111C existing DIR entry disappeared 663 664 * terminal read code 00131120 ABS 665 HALTS1120 EQU SHALT+01120 no terminator in character list 666 667 * FRQCNTL 00131140 ABS 668 HALTS1140 EQU SHALT+01140 saved file not found by SRCHDIRSN 00131141 ABS 669 HALTS1141 EQU SHALT+01141 LIMITCHECK gave a bogus return 00131142 ABS 670 HALTS1142 EQU SHALT+01142 saved file not found by SRCHDIRSN 671 672 * FRQRAFCNTL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 200 (HALTDEFS) F 13 Definitions for operating system halts 00131148 ABS 673 HALTS1148 EQU SHALT+01148 LIMITCHECK gave a bogus return 00131149 ABS 674 HALTS1149 EQU SHALT+01149 saved file directory entry disappeared 675 676 * implicit lock code 00131150 ABS 677 HALTS1150 EQU SHALT+01150 a lock control element disappeared 00131151 ABS 678 HALTS1151 EQU SHALT+01151 empty lock user ID list 679 680 * change file access 00131160 ABS 681 HALTS1160 EQU SHALT+01160 saved file not found in DIR 00131161 ABS 682 HALTS1161 EQU SHALT+01161 bogus access type 00131162 ABS 683 HALTS1162 EQU SHALT+01162 bogus access type 00131163 ABS 684 HALTS1163 EQU SHALT+01163 saved file not found in DIR 00131164 ABS 685 HALTS1164 EQU SHALT+01164 bogus access type 00131165 ABS 686 HALTS1165 EQU SHALT+01165 bogus access type 00131166 ABS 687 HALTS1166 EQU SHALT+01166 bogus access type 00131167 ABS 688 HALTS1167 EQU SHALT+01167 bogus access type 00131168 ABS 689 HALTS1168 EQU SHALT+01168 bogus access type 00131169 ABS 690 HALTS1169 EQU SHALT+01169 bogus access type 0013116A ABS 691 HALTS116A EQU SHALT+0116A bogus access type 0013116B ABS 692 HALTS116B EQU SHALT+0116B bogus access type 0013116C ABS 693 HALTS116C EQU SHALT+0116C bogus access type 0013116D ABS 694 HALTS116D EQU SHALT+0116D bogus access type 695 696 * SAVE code 00131170 ABS 697 HALTS1170 EQU SHALT+01170 saved file was not found in DIR 00131171 ABS 698 HALTS1171 EQU SHALT+01171 bogus access code 00131172 ABS 699 HALTS1172 EQU SHALT+01172 bogus access code 700 701 * unsave code 00131180 ABS 702 HALTS1180 EQU SHALT+01180 saved file no longer in DIR 00131181 ABS 703 HALTS1181 EQU SHALT+01181 bogus return from LIMITCHECK 704 705 * UNEQUIP code 00131191 ABS 706 HALTS1191 EQU SHALT+01191 FCB use count went negative 00131192 ABS 707 HALTS1192 EQU SHALT+01192 saved file no longer in DIR 00131193 ABS 708 HALTS1193 EQU SHALT+01193 disk error while closing unit list 00131198 ABS 709 HALTS1198 EQU SHALT+01198 UCE not found either global or local 00131199 ABS 710 HALTS1199 EQU SHALT+01199 list went bad 0013119A ABS 711 HALTS119A EQU SHALT+0119A couldn't find path control element 0013119C ABS 712 HALTS119C EQU SHALT+0119C file use count went negative 713 714 * RENAME code 001311A0 ABS 715 HALTS11A0 EQU SHALT+011A0 saved file no longer in directory 716 717 * SHARE/UNSHARE 001311B0 ABS 718 HALTS11B0 EQU SHALT+011B0 saved file disappeared 001311B1 ABS 719 HALTS11B1 EQU SHALT+011B1 LIMITCHECK returned impossible error 001311B2 ABS 720 HALTS11B2 EQU SHALT+011B2 LIMITCHECK returned impossible error 721 722 * catalog information request 001311C0 ABS 723 HALTS11C0 EQU SHALT+011C0 serious error, saved file not in DIR 001311C1 ABS 724 HALTS11C1 EQU SHALT+011C1 serious error, saved file not in DIR 001311C2 ABS 725 HALTS11C2 EQU SHALT+011C2 garbage in share list 726 727 * set account attribute 001311D0 ABS 728 HALTS11D0 EQU SHALT+011D0 bad index, was okay 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 201 (HALTDEFS) F 13 Definitions for operating system halts 729 730 * XRQUREQ1, XRQUREQ2, XRQUREQ3, and XRQUREQ4 001311E0 ABS 731 HALTS11E0 EQU SHALT+011E0 couldn't find under program 001311E1 ABS 732 HALTS11E1 EQU SHALT+011E1 stop if under program disappeared 001311E2 ABS 733 HALTS11E2 EQU SHALT+011E2 couldn't get back to over program 001311E3 ABS 734 HALTS11E3 EQU SHALT+011E3 underprogram disappeared 001311E5 ABS 735 HALTS11E5 EQU SHALT+011E5 run unit not found 736 737 * user interrupt processor 00031200 ABS 738 HALTC1200 EQU CHALT+01200 control mode error 00031201 ABS 739 HALTC1201 EQU CHALT+01201 system process error 00031202 ABS 740 HALTC1202 EQU CHALT+01202 mem error giving int to CM 741 742 * Operator requests 00031210 ABS 743 HALTC1210 EQU CHALT+01210 attempt to log off nobody 00131211 ABS 744 HALTS1211 EQU SHALT+01211 FCBs left in PSA 001A1212 ABS 745 HALTZ1212 EQU ZHALT+01212 can't get rid of volume 001A1213 ABS 746 HALTZ1213 EQU ZHALT+01213 system was sleeping and another request came in 00131214 ABS 747 HALTS1214 EQU SHALT+01214 volume went busy when not possible 00031215 ABS 748 HALTC1215 EQU CHALT+01215 erroneous parameter from CM 00031216 ABS 749 HALTC1216 EQU CHALT+01216 underprocesses left at logoff 00131218 ABS 750 HALTS1218 EQU SHALT+01218 giveaway unit disappeared 751 752 * auth list requests 00131224 ABS 753 HALTS1224 EQU SHALT+01224 LIMITCHECK returned impossible error 00131225 ABS 754 HALTS1225 EQU SHALT+01225 test indicates big account after known not 00131226 ABS 755 HALTS1226 EQU SHALT+01226 now sez big account, previously not 00131227 ABS 756 HALTS1227 EQU SHALT+01227 LIMITCHECK returned impossible error 00131228 ABS 757 HALTS1228 EQU SHALT+01228 previous manager account now super account 00131229 ABS 758 HALTS1229 EQU SHALT+01229 previous manager account now super account 759 760 * process creation 00131230 ABS 761 HALTS1230 EQU SHALT+01230 illegal device type in FCB 00131231 ABS 762 HALTS1231 EQU SHALT+01231 illegal device type in FCB 763 764 * AFTMANGLE 00061250 ABS 765 HALTF1250 EQU FHALT+01250 quit for full AFT or IDX 00131251 ABS 766 HALTS1251 EQU SHALT+01251 table overflow while expanding, impossible 00131252 ABS 767 HALTS1252 EQU SHALT+01252 dup entry while expanding table, impossible 00041253 ABS 768 STOPD1253 EQU DHALT+01253 disk error 00041254 ABS 769 HALTD1254 EQU DHALT+01254 both security blocks bad 00131255 ABS 770 HALTS1255 EQU SHALT+01255 new table too small while expanding IDX or AFT 771 772 * HOURPROC 00041261 ABS 773 HALTD1261 EQU DHALT+01261 both security blocks bad 002A1270 ABS 774 HLTSV1270 EQU SVHLT+01270 authorization to use system has expired 775 776 * Backup and Recovery requests 00131280 ABS 777 HALTS1280 EQU SHALT+01280 file gone when expanding to large RAF 00041281 ABS 778 HALTD1281 EQU DHALT+01281 could read neither copy of security block 00131282 ABS 779 HALTS1282 EQU SHALT+01282 file gone when expanding to large RAF 780 781 * Initial process 00027001 ABS 782 HALTB7001 EQU BHALT+07001 couldn't mount pack label 00027002 ABS 783 HALTB7002 EQU BHALT+07002 system volume could not be mounted 00027003 ABS 784 HALTB7003 EQU BHALT+07003 account finder table is bad 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 202 (HALTDEFS) F 13 Definitions for operating system halts 00027004 ABS 785 HALTB7004 EQU BHALT+07004 could not fit IDX into brand new AFT 00027007 ABS 786 HALTB7007 EQU BHALT+07007 no CM corresponding to system 787 * This stop is only temporary 00027008 ABS 788 STOPB7008 EQU BHALT+07008 couldn't write to terminal.config file 00027009 ABS 789 HALTB7009 EQU BHALT+07009 error on control mode file 0002700A ABS 790 HALTB700A EQU BHALT+0700A lun no longer in list 0002700B ABS 791 HALTB700B EQU BHALT+0700B could not unequip CM file 0002700C ABS 792 HALTB700C EQU BHALT+0700C not enough free space on system volume 0013700D ABS 793 HALTS700D EQU SHALT+0700D device type not in table when building HARDWARE.SYS 0013700E ABS 794 HALTS700E EQU SHALT+0700E could not find file in UDIR 795 796 * unauthorized resource module halts in initial. 797 * Form is SVHLT + 07000 + * 100 + 798 * * 10 + <0 for controller, 1 for units> 002A7000 ABS 799 HLTSV7000 EQU SVHLT+07000 system operation is no longer authorized 002A7100 ABS 800 HLTSV7100 EQU SVHLT+07100 unauthorized MCU 002A7101 ABS 801 HLTSV7101 EQU SVHLT+07101 more memory than authorized 002A7200 ABS 802 HLTSV7200 EQU SVHLT+07200 unauthorized CPU 002A7300 ABS 803 HLTSV7300 EQU SVHLT+07300 unauthorized PPU 002A7310 ABS 804 HLTSV7310 EQU SVHLT+07310 unauthorized disk controller 002A7311 ABS 805 HLTSV7311 EQU SVHLT+07311 unauthorized disk unit 002A7320 ABS 806 HLTSV7320 EQU SVHLT+07320 unauthorized line printer (controller & unit) 002A7380 ABS 807 HLTSV7380 EQU SVHLT+07380 unauthorized comm controller 002A7381 ABS 808 HLTSV7381 EQU SVHLT+07381 unauthorized comm port board 002A7390 ABS 809 HLTSV7390 EQU SVHLT+07390 unauthorized mag tape controller 002A7391 ABS 810 HLTSV7391 EQU SVHLT+07391 unauthorized mag tape unit 002A73A0 ABS 811 HLTSV73A0 EQU SVHLT+073A0 unauthorized cartridge tape controller 002A73A1 ABS 812 HLTSV73A1 EQU SVHLT+073A1 unauthorized cartridge tape unit 002A73B0 ABS 813 HLTSV73B0 EQU SVHLT+073B0 unauthorized video tape controller 002A73B1 ABS 814 HLTSV73B1 EQU SVHLT+073B1 unauthorized video tape unit 20 INPUT PAGEDEFS definitions for memory allocation 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 203 (PAGEDEFS) F 14 Virtual Page Definitions 4 5 ********************************************************************************** 6 * * 7 * Monitor Virtual Pages * 8 * * 9 * Page 0 [00000] * 10 * Physical page zero is mapped into monitor virtual page * 11 * zero during bootstrap and power fail recovery operations and * 12 * contains the code (either bootstrap or power up) and * 13 * appropriate tables. This page file entry is cleared by the * 14 * system at the end of the initial code and remains excluded * 15 * during normal system operation except when it is * 16 * specifically mapped in for the updating of the page map on * 17 * physical page zero (PFMAP). Because this virtual page is * 18 * illegal to reference (in general) any bug that causes a * 19 * reference to this page will be trapped in the page fault * 20 * processer rather than continuing to trash monitor memory. * 21 * Page 1 [00400] (CPUPAGE) * 22 * This virtual page is used only for variables local to a * 23 * single CPU including the Interrupt Vector Table (IVT). Each * 24 * CPU must have its own distinct physical page. However, * 25 * since a CPU needs only a small number of local variables, * 26 * the remainder of the physical page is available for other * 27 * use. Therefore, each physical page used as a CPU page is * 28 * also mapped into the page file in another virtual memory * 29 * location common to all CPUs and the remaining space in the * 30 * physical page is used for other tables or free storage by * 31 * using the virtual addresses that are common to all CPUs. * 32 * This page should not be pre-initialized by assembling * 33 * anything into it since it is not loaded by initial. * 34 * * * * * 35 * Window pages are pages in the monitor address space * 36 * that are treated like user virtual pages. That is, they * 37 * have their page file locations loaded and unloaded along * 38 * with the rest of the users pages, and page faults cause a * 39 * swap in. They are provided so that the virtual monitor has * 40 * virtual buffer space for each user. * 41 * Page 2 [00800] (WNDO1) * 42 * Page 3 [00C00] (WNDO2) * 43 * These virtual pages are used for the executive request * 44 * processor windows. * 45 * Page 4 [01000] (WNDO3) * 46 * This is the window used by any routines that might run * 47 * under the XREQ processor, such as the ADT manager. The XREQ * 48 * processor windows must not be disturbed by subsidiary * 49 * routines, so this window is provided as a scratch location * 50 * for them. * 51 * Page 5 [01400] (WNDO4) * 52 * This window is used by the mass storage driver routines * 53 * that deal with error correction and page copying. It may * 54 * also be used by other I/O devices. * 55 * Page 6 [01800] (CIX) * 56 * This virtual page is used as a temporary page file * 57 * location for conversations with the I/O devices. * 58 * * * * * 59 * Each resident page from 7 on is mapped to * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 204 (PAGEDEFS) F 14 Virtual Page Definitions 60 * exactly the same physical page by the page * 61 * map in all of the CPUs. * 62 * Page 7 [01C00] (HEADPAGE) * 63 * This virtual page is used for inter-CPU communication * 64 * (the system variable area). Each CPU maps the same physical * 65 * page into this location. Since the system variable area * 66 * does not use the entire area, the remainder of this physical * 67 * page is available for other use. In order to waste as * 68 * little space as possible, the physical page used here * 69 * contains a block of CPU local variables (mapped into page 1 * 70 * of only one CPU), the block of system variables (mapped into * 71 * page 7 of all CPUs), and the remaining space is used for * 72 * free storage (using the page 7 virtual addresses which are * 73 * common to all CPUs). * 74 * Page 8 [02000] (INITIAL) * 75 * This virtual page contains the initialization routines. * 76 * After system initialization, it is set excluded and the * 77 * physical page is available for use. The virtual page bit * 78 * in the AVPAGES array is set so that the monitor virtual * 79 * page may be subsequently used for free space. * 80 * * * * * 81 * Resident Pages * 82 * The resident monitor consists of code that must be * 83 * available at all times to service interrupts. This * 84 * includes: * 85 * I/O drivers and support routines * 86 * Interrupt handlers for PF, XREQ, parity error, IAPR * 87 * Code associated with the scheduling and dispatching * 88 * of processes. * 89 * During the bootstrap operation, the page file is * 90 * loaded so that each virtual page needed by the operating * 91 * system (as determined from the CCB) is allocated in the * 92 * next available page in the first memory. The bootstrap * 93 * then reads in the operating system. In initialization, * 94 * the system code may be spread between the available * 95 * memories (see the routine SPREADSYS in INITIAL). Once * 96 * this (potential) move is completed the physical pages are * 97 * completely locked in for the duration of the system * 98 * operation. The page files of each CPU are all set to * 99 * point to the physical memory as appropriate and this * 100 * mapping remains throughout system operation. A table is * 101 * maintained on page zero so that this mapping may be * 102 * restored following a power failure. * 103 * Page 9 [02400] * 104 * This is the first page of resident code. * 105 * * * * * 106 * "Virtual Monitor" * 107 * The original plan for the operating system was for much * 108 * of the OS code to be swappable. There was no particular * 109 * problem in the page fault processor since the mechanism to * 110 * load a page was essentially the same as for any user page. * 111 * However, in order for this to work there can be no locks * 112 * held during execution of any code that might page fault. We * 113 * originally attempted to move the code requiring locks into * 114 * the resident part of the system and deal with the critical * 115 * region problem by calling the code that was guaranteed to be * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 205 (PAGEDEFS) F 14 Virtual Page Definitions 116 * resident. Even this proved to be troublesome, however, * 117 * since a page fault could occur during the calling sequence. * 118 * Certain code (such as xGETMEM) has already locked a critical * 119 * region before returning for parameters. * 120 * In the end, the advent of 8 MB SMUs obviated the need * 121 * to expend any more energy on an intractable problem with, at * 122 * best, marginal improvement of the memory situation. * 123 * * * * * 124 * Monitor Table Space * 125 * The operating system constructs essentially all of its * 126 * "tables" in the form of linked lists. Routines called * 127 * xGETMEM and xFREEMEM are used to allocate storage for use * 128 * in these linked lists. See those routines for a description * 129 * of the methods used to manage the monitor free space. This * 130 * free space is divided into two major subdivisions. First, * 131 * that which is global and which must be present at essentially * 132 * all times that operating system code is running. This space * 133 * is limited by the size of the monitor address space. Second, * 134 * that space which is required only while the operating system * 135 * is dealing with a particular user. We have allocated four * 136 * pages of virtual address space that are mapped and unmapped * 137 * as required. See the description which follows labeled * 138 * "user table space". * 139 * The initial process only runs when the system is first * 140 * booted. This code may occupy up to two pages. Since * 141 * monitor address space is scarce, the last operation of the * 142 * initial process is to make the pages that it occupies * 143 * available in the AVPAGES array. * 144 * The virtual addresses from the end of the initial process * 145 * pages to the start of the user memory lists are all available * 146 * for allocation as free storage addresses. A bit array called * 147 * AVPAGES indicates whether a virtual page is in use or not. * 148 * These virtual pages are all managed by the dispatcher code * 149 * FSXPAND (or the initial code FREECHECK). When a physical * 150 * page is allocated to a particular monitor virtual page, the * 151 * appropriate page map value is loaded into the PFMAP array * 152 * on page zero (which is especially mapped and unmapped for * 153 * this update), and the appropriate monitor page file location * 154 * is loaded in all CPUs (and remains loaded during normal * 155 * system operation). * 156 * FBI Window * 157 * This window is used for any references to a resident * 158 * FBI. * 159 * There exists an FBI for each page. These FBIs are read * 160 * on disk reads, possibly modified while the page is resident, * 161 * and written on disk writes. Each FBI must be allocated * 162 * space for the entire time that the corresponding page is * 163 * resident. In order to avoid consuming monitor address space * 164 * for these FBIs they are mapped only as needed. That is, a * 165 * single virtual page is reserved to point to the physical * 166 * page containing the FBI currently of interest. The initial * 167 * code allocates an FBI each time it generates a PPL for a * 168 * page. The PPL indexes a table of page map values (rather * 169 * than attempting to store PMVs in each PPL) and provides the * 170 * offset into the physical page. * 171 * There are special provisions in crashdump to save the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 206 (PAGEDEFS) F 14 Virtual Page Definitions 172 * pages containing the FBIs. * 173 * User Memory Lists * 174 * In order to allow the best use of the available monitor * 175 * address space, we have segregrated the system lists into two * 176 * groups, those that must be addressable at all times and * 177 * those that may be unmapped when the associated user is not * 178 * dispatched. Four pages of monitor address are reserved for * 179 * these mappable user lists and special GETMEM and FREEMEM * 180 * routines are provided to manage the free space. The * 181 * routines MAPINMEM and MAPOUTMEM are provided to load and * 182 * unload the appropriate page file locations. A map-in is * 183 * normally done when the user page file is loaded and a * 184 * map-out is done when the page file is unloaded. A few * 185 * routines (such as WHICHHUNT) need access to the user lists * 186 * while the user is not dispatched so they call MAPINMEM and * 187 * MAPOUTMEM directly. * 188 * There are special provisions in crashdump to save the 4 * 189 * pages from each CPU. * 190 * * * * * 191 * Monitor Page File Appearance * 192 * 1) Everything not explicitly mentioned is marked * 193 * 'illegal to reference'. * 194 * 2) The monitor CPU pages are always loaded in * 195 * PF81 RW. Each CPU has a different physical * 196 * page. They are assigned during boot and do * 197 * not move. * 198 * 3) The headpage is always loaded in PF87 RW. * 199 * 4) All monitor code is loaded RO. * 200 * 5) All monitor table space is always loaded RW. * 201 * * * * * 202 * The following pages are subject to memory management, * 203 * which means that a page might not be loaded into the page * 204 * file even though its process has been dispatched. * 205 * * 206 * 6) Monitor windows are loaded RO or RW as appropriate * 207 * only when a process having them mapped has been * 208 * dispatched. * 209 * 7) User pages are loaded RO or RW as appropriate only * 210 * when a process having them mapped has been dispatched. * 211 * * 212 ********************************************************************************** 213 214 ORG ZERO(WPP) virtual page zero is not used 215 * except for boot and power up processing 216 00000400 217 CPUPAGE BSS WPP individual CPU information page 00000081 ABS 218 PNCPUPAGE EQU MONPF+(CPUPAGE DISPW ZERO)/WPP page number 219 00000800 220 WNDO1 BSS WPP primary window for xreq buffer system 00000082 ABS 221 PNWNDO1 EQU MONPF+(WNDO1 DISPW ZERO)/WPP page number 222 00000C00 223 WNDO2 BSS WPP secondary window 00003070 BYTE 224 PASIGBITS EQU BITS 24:30 all but low order bit of PAVPN 00000083 ABS 225 PNWNDO2 EQU MONPF+(WNDO2 DISPW ZERO)/WPP page number 00000041 ABS 226 PNWNDO12 EQU PNWNDO2/PASIGBITS bits shared by PNWNDO1, PNWNDO2 227 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 207 (PAGEDEFS) F 14 Virtual Page Definitions 00001000 228 WNDO3 BSS WPP window for ADT routines 00000084 ABS 229 PNWNDO3 EQU MONPF+(WNDO3 DISPW ZERO)/WPP page number 230 00001400 231 WNDO4 BSS WPP mass storage driver window 00000085 ABS 232 PNWNDO4 EQU MONPF+(WNDO4 DISPW ZERO)/WPP page number 233 00001800 234 CIX BSS WPP channel index page 00000086 ABS 235 PNCIX EQU MONPF+(CIX DISPW ZERO)/WPP page number 236 00001C00 237 HEADPAGE BSS WPP inter-cpu variable page 00000087 ABS 238 PNHEADPAGE EQU MONPF+(HEADPAGE DISPW ZERO)/WPP page number 00001C80 239 FBIPOINTRS EQU HEADPAGE(080) table of PMVs for pages holding FBIs 240 00002000 241 INITPAGE BSS WPP this whole page is reserved for initialization 00000088 ABS 242 PNINITPAGE EQU MONPF+(INITPAGE DISPW ZERO)/WPP page number 243 244 ORG NPS*WPP-(MAXMAPVALS+1)*WPP FBI window 0001EC00 245 PPLWINDOW BSS WPP for mapping in pages of FBIs for PPLs 000000FB ABS 246 PNPPLWNDO EQU MONPF+(PPLWINDOW DISPW ZERO)/WPP page number 247 248 ORG NPS*WPP-(MAXMAPVALS*WPP) first "user virtual" page 0001F000 249 USERMEM LABEL page reserved for user memory lists 000000FC ABS 250 PNUSERMEM EQU MONPF+(USERMEM DISPW ZERO)/WPP page number 251 BSS WPP LOG 2 area for free memory lists 0000000A ABS 252 UMEMSIZE EQU DISPW USERMEM number of lists 253 BSS 3 filler 0001F00D 254 UMEMXTRA BSS 1 pointer to reserve memory 00000007 ABS 255 XALOG EQU 7 log size of reserve memory 0001F00E 256 UMEMPSA BSS 1 PSA associated with this storage 0001F00F 257 UMEMLOCK BSS 1 lock word for user free storage 258 * BSS (WPP-DISPW USERMEM)+(MAXMAPVALS-1)*WPP the rest of the area 259 260 ORG CPUPAGE restore LC to safe place 22 INPUT CPUPAGE definitions of CPUs variables 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 208 (CPUPAGE) F 15 CPU Page Definitions 3 4 ********************************************************************************** 5 * * 6 * RESIDENT TABLE DEFINITIONS * 7 * * 8 ********************************************************************************** 9 10 11 ********************************************************************************** 12 * * 13 * CPUPAGE * 14 * Due to the nature of this multi-processor system, each * 15 * CPU requires a small number of private variables for use * 16 * during interrupt processing, etc. This is provided by * 17 * having each CPU page file location CPUPAGE point to a * 18 * different physical page. Each CPU then has temporary * 19 * storage areas that are totally isolated from any other CPU, * 20 * but the exact same code will run properly on any CPU * 21 * without indexing tables by CPU number. Following are * 22 * definitions for this page. * 23 * * 24 ********************************************************************************** 25 26 ********************************************************************************** 27 * * 28 * Interrupting Devices Mask * 29 * This word is defined by the hardware. It is read up * 30 * by each CPU. Bits 0:15 contain a one bit for each * 31 * corresponding slot that may interrupt. This tells the CPU * 32 * what slots to poll when the bus interrupt line is asserted. * 33 * This word also contains in bits 28:31 the slot number of * 34 * the SSU that is running the front panel. This is so that * 35 * the CPU microcode knows where to send notice of any * 36 * problems that it might encounter. * 37 * * 38 ********************************************************************************** 39 40 ORG CPUPAGE(1) machine defined locations 00000401 41 INTABLSLOT BSS 1 mask of slots that may interrupt 42 * and SSU slot number 43 44 ********************************************************************************** 45 * * 46 * Interrupt Vector Table * 47 * In each entry, the first word is the new console area * 48 * pointer. The second is the new program counter. Each is * 49 * right justified. The rest is unused. * 50 * When an interrupt occurs, the CPU stores the registers * 51 * according to its current console register, picks up a new * 52 * CA and PC from the IVT, fixes the MSR and PSR, and sets * 53 * several other registers as described in the comments. * 54 * * 55 ********************************************************************************** 56 00000402 57 IVTPWFL BSS 2 POWER FAILURE 58 * R2:=why 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 209 (CPUPAGE) F 15 CPU Page Definitions 59 * 1 - power fail 60 * 2 - temp fault 61 * R4:=previous CA address 00000404 62 IVTMEMPAR BSS 2 MEMORY ERROR 63 * R2:=why 64 * 0 - no response, inst fetch 65 * 1 - abnormal data, inst fetch 66 * 2 - no response, opnd fetch 67 * 3 - abnormal data, opnd fetch 68 * 4 - no response, interrupt poll 69 * 5 - abnormal data, interrupt poll 70 * R3:=where (18 bit virtual address) 71 * ( or slot number if R2 = 4 or 5 ) 72 * R4:=previous CA address 00000406 73 IVTPAGE BSS 2 PAGE FAULT 74 * R2:=why 75 * 1 - read from excluded 76 * 2 - write on read-only 77 * 3 - write on excluded 78 * R3:=where (8 bit page file address) 79 * R4:=previous CA address 00000408 80 IVTIOINT BSS 2 I/O INTERRUPTS 81 * R2:=IP response 82 * R3:=interrupting slot number 83 * R4:=previous CA address 0000040A 84 IVTIAPR BSS 2 ASSOCIATED PROCESSOR INTERRUPT 85 * no data is remembered, only the 86 * fact that an IAPR was requested 87 * R4:=previous CA address 0000040C 88 IVTXREQ BSS 2 XREQ INSTRUCTION 89 * R2:=trapping opcode ( 08 ) 90 * R3:=operand of instruction 91 * R4:=previous CA address 0000040E 92 IVTUERR BSS 2 USER ERROR CONDITIONS 93 * R2:=why (see the UINT codes) 94 * R3:=parameter to why 95 * R4:=previous CA address 00000410 96 IVTXCALL BSS 2 XCALL TRAPS 97 * R2:=instruction image 98 * R3:=operand 99 * R4:=previous CA address 100 101 * end of IVT 102 00000412 103 CPPSA BSS 1 pointer to PSA of session being 104 * run by this CPU (zero if none) 00000413 105 CMAPPSA BSS 1 pointer to the PSA whose virtual free 106 * storage is currently mapped (zero if 107 * none). 00000414 108 CPCUPC BSS 1 pointer to UPC of process being 109 * run by this CPU (zero if none) 00000415 110 OURSLOT BSS 1 this CPUs slot number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 210 (CPUPAGE) F 15 CPU Page Definitions 112 113 ********************************************************************************** 114 * * 115 * The following array is used to save the page map * 116 * values for the virtual free storage required by this user * 117 * on this CPU. The reason we need to save this away is so * 118 * that during a crashdump we can find each of these pages and * 119 * write them out to the crashdump file. Each time that a new * 120 * user is run and his free storage mapped in we update this * 121 * array. CAUTION!!! Warning, the boot code expects, nay, * 122 * demands, that this array begin at a particular word * 123 * address. If this changes this then the boot code must also * 124 * be modified or beware the consequences. Currently this * 125 * address is #41A. * 126 * * 127 ********************************************************************************** 128 129 BSS 4 allow a little room 0000041A 130 UMAPVALS BSS MAXMAPVALS array to store the free storage page 131 * map values. 132 133 * Console area used by this processor for the dispatcher. 134 0000041E 135 PCONSOLE BSS CALNTH 136 0000042D 137 RESSTAKTOP BSS 32 stack area for some resident routines 0000044D 138 RESSTAK LABEL 139 0000044D 140 CPXTRACA BSS 1 extra CA/Stack for this CPU 141 142 * Flag to indicate successful power fail execution 143 0000044E 144 POWERFLAG BSS 1 0 during normal operation, 145 * if positive, powerfail shutdown was completed, 146 * and this word points to the interrupted CA 147 * if negative, power fail restart is in progress. 0000044F 148 POWERUPLOC BSS 1 At power-fail time, where to resume interrupted routine 00000450 149 POWERRTNPC BSS 1 At power-up time, location where routine was interrupted 150 151 * Temps used by the page file routines 152 00000451 153 VMTSSLA BSS 1 00000452 154 VMTSSLB BSS 1 155 156 * Temps used by getmem and freemem routines. Please note 157 * that these variables MUST NOT be altered without holding MEMLOCK. 158 00000453 159 GETMR2 BSS 2 00000454 160 GETMR3 EQU GETMR2(1) 00000455 161 GETMREGS BSS 2 00000457 162 GETMR7 BSS 1 163 00000453 164 FREMR2 EQU GETMR2 00000454 165 FREMR3 EQU GETMR3 00000455 166 FREMR4 EQU GETMREGS 00000457 167 FREMR7 EQU GETMR7 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 211 (CPUPAGE) F 15 CPU Page Definitions 168 169 170 * These variables are for routines that are called by getmem and freemem 171 * so that we do not need to use the stack. This is because various 172 * callers may not have a stack during system startup, most notably 173 * the I/O drivers. 174 00000458 175 MEMVAR1 BSS 1 used by CPUPFLOAD routine 00000459 176 MEMVARPC BSS 1 place to store return address 0000045A 177 MEMVARPC2 BSS 1 additional storage for return addresses 0000045B 178 MEMVAREG1 BSS 1 additional area to save away registers 0000045C 179 MEMVAREG2 BSS 1 ditto!!! 180 181 * Variable locations used by the FINDVP routine 182 0000045D 183 FNDVPLPSA BSS 1 => PSA of eventual VM list 0000045E 184 FNDVPFPN BSS 1 page number originally searched for 0000045F 185 FNDVPPN BSS 1 final page number looked for 00000460 186 FNDVPVMR BSS 1 => root of VM list containing found VM element 00000461 187 FNDVPUPC BSS 1 => UPC where VM element was found 0 means not indirect reference 188 189 * Variable for memory parity error routine 190 00000462 191 MEMERRFLAG BSS 1 1 sez processing parity error 192 193 * Temps used by performance monitors 194 00000463 195 DYNLINK BSS 1 return link for DYNMON 00000464 196 DYNTEMP BSS 1 temp for DYNMON 197 198 * Temp used by MAPINFBI to save away return address 199 00000465 200 MFBILAST BSS 1 last call to MAPINFBI 00000466 201 MOFBILAST BSS 1 last call to MAPOUTFBI 202 203 BSS 4 room to patch in additional CPU temps 204 0000006B DISP 205 CPULNTH EQU DISP CPUPAGE amount of this page needed for 206 * the variables local to a CPU 207 208 ********************************************************************************** 209 * * 210 * The range of virtual addresses represented by the * 211 * remainder of this page is never used. In order not to * 212 * waste the physical memory, each physical page used as a * 213 * CPUPAGE is mapped into another location in the address * 214 * space: one that may be shared by all of the CPUs. The * 215 * remaining unused space on the physical page is then used * 216 * through that alias. * 217 * * 218 ********************************************************************************** 23 INPUT COREDEFS in-core structure definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 212 (COREDEFS) F 16 Resident Data Structure Definitions 3 4 ********************************************************************************** 5 * * 6 * HEADPAGE * 7 * This page contains constants, variables, and list * 8 * control elements that are accessable to every CPU on the * 9 * system at the same address. * 10 * Since this physical page is also mapped into the page * 11 * file at another virtual address by one CPU and used as its * 12 * CPU page, we skip over the variables that we reference * 13 * through that alias. * 14 * * 15 ********************************************************************************** 16 17 ORG HEADPAGE(CPULNTH) skip over CPU #1 private variables 18 19 ********************************************************************************** 20 * * 21 * The following flag is set to zero when the system is * 22 * totally together and ready to accept useful work. * 23 * * 24 ********************************************************************************** 25 01C6B 00000001 26 BOOTFLAG VFD 1+STORE booting in progress 27 28 ********************************************************************************** 29 * * 30 * Pointers for system free storage * 31 * The system builds most of its tables from system free * 32 * storage elements. The space is managed by a binary buddy * 33 * system. The blocks are arranged carefully on power of 2 * 34 * address boundaries so that the address tells whether any * 35 * given block is the first half or last half of its parent. * 36 * Note that these lists are terminated by a word which * 37 * has zeros in the link field (a legal list terminator) but * 38 * has a high bit on. This is so that the search for a buddy * 39 * in FREEMEM (via RLSHLE) will never fall off the end of the * 40 * list, but will stop at the insertion point, even if the * 41 * insertion point is at the end of the list. * 42 * There are no whole pages placed into the whole page * 43 * lists. Instead, FREEMEM will place such pages into the * 44 * systems idle page list. When GETMEM needs a whole page to * 45 * break up, it finds it in the idle page list. GETMEM has no * 46 * provisions for failure on an attempt to find a whole page * 47 * list. Therefore, the system must ensure that the idle page * 48 * list always contains sufficient pages for GETMEM. * 49 * * 50 ********************************************************************************** 51 01C6C 00000000 52 MEMLOCK VFD STORE lock word for the FS lists 53 01C6D 01000000 54 MEMLIST VFD 01000000 1 word blocks 01C6E 01000000 55 VFD 01000000 2 01C6F 01000000 56 VFD 01000000 4 01C70 01000000 57 VFD 01000000 8 01C71 01000000 58 VFD 01000000 16 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 213 (COREDEFS) F 16 Resident Data Structure Definitions 01C72 01000000 59 VFD 01000000 32 01C73 01000000 60 VFD 01000000 64 01C74 01000000 61 VFD 01000000 128 01C75 01000000 62 VFD 01000000 256 01C76 01000000 63 VFD 01000000 512 0000000A DISP 64 MEMLISTMAX EQU DISP MEMLIST indicate largest allowable request 65 * The following must be true so storage handlers can share code 66 ASSERTEQ MEMLISTMAX,UMEMSIZE 66 BSS MEMLISTMAX-UMEMSIZE error if MEMLISTMAX < UMEMSIZE 66 BSS UMEMSIZE-MEMLISTMAX error if UMEMSIZE < MEMLISTMAX 67 68 69 ********************************************************************************** 70 * * 71 * Physical Page Element List for Pages Being Used for Free Storage. * 72 * When a whole page is to be used the PPL is first * 73 * removed from the whole page list and placed into this list. * 74 * If a whole page is ever recombined, it is first found in * 75 * this list and then moved to the whole page list. * 76 * This list does not contain a PPL for any of the * 77 * CPUPAGEs, since they obviously may not be recombined. * 78 * Also, during INITIAL, PPLs are generated and use up a * 79 * substantial amount of free storage. Since PPLs are not * 80 * freed, these pages can never be recombined. The PPLs for * 81 * those pages are therefore removed from this list and freed. * 82 * They are then almost certainly re-used as a PPL * 83 * immediately. * 84 * * 85 ********************************************************************************** 86 01C77 00000000 87 FSPPLIST VFD STORE inuse free storage PPL holder 88 89 ********************************************************************************** 90 * * 91 * Physical page elements for whole available free pages. * 92 * The reason this list exists is for the VGETMEM and * 93 * VFREEMEM routines. Since these routines give free storage * 94 * to one user only, we had to separate pages to be used by * 95 * the system as a whole and those by a user. You will note * 96 * that MEMLIST no longer contains pointers to whole pages, * 97 * the pointer should always be null. Now whenever a whole * 98 * page is needed we come here and get one for the user. A * 99 * special note, when the system needs a whole page for the * 100 * BLDPROCESS routine we get it directly from the idle page * 101 * list. The lock, WPAGELOCK, must be held when searching * 102 * and/or modifying the whole page list. * 103 * * 104 ********************************************************************************** 105 01C78 00000000 106 WPAGELOCK VFD STORE lock for the whole page list 01C79 00000000 107 WHOLEPAGE VFD STORE whole page PPL holder 108 109 ********************************************************************************** 110 * * 111 * FREE STORAGE PAGE COUNT * 112 * This count word is the excess (positive) or deficiency * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 214 (COREDEFS) F 16 Resident Data Structure Definitions 113 * (negative) of whole pages in the whole page list. A count * 114 * of zero causes no action. Otherwise, the dispatcher * 115 * attempts to move pages between the idle page list and the * 116 * whole page list to ensure the proper amount of free * 117 * storage. * 118 * The count word is decremented by GETMEM when a whole * 119 * page is split up. It is incremented by FREEMEM when a * 120 * whole page is produced. It is adjusted by the dispatcher * 121 * when a page is moved to or from the idle list. The count * 122 * may also be adjusted by a process (such as the comm. * 123 * processor) in order to alter the amount of available free * 124 * memory. * 125 * Some special circumstances exist during initial. * 126 * Since the DISPATCHER is not running, INITIAL must * 127 * occasionally put another idle page into WHOLEPAGE. GETMEM * 128 * busily decrements this count whenever it breaks one up. * 129 * After INITIAL has run to completion, it sets this word to * 130 * indicate to the DISPATCHER how many more whole pages are * 131 * needed for the system operation. * 132 * * 133 ********************************************************************************** 134 01C7A 00000000 135 FSXCOUNT VFD STORE - 136 137 ********************************************************************************** 138 * * 139 * PPL FBI PAGE MAP TABLE * 140 * To conserve monitor virtual address space, the FBIs * 141 * associated with Physical Page Elements (PPLs) are kept * 142 * apart from the the PPLs themselves in resident blocks that * 143 * are not always mapped. Access to an FBI is gained by * 144 * mapping in the appropriate block using the PM values in * 145 * PPLPFMAP and using a displacement into that block to locate * 146 * the FBI itself. * 147 * INITIAL sets up PPLPFMAP when it processes a memory * 148 * board. PPLPMINDX is the index into PPLPFMAP that is * 149 * currently being used. If non-zero, the number in that * 150 * table location is the PM value of the block currently being * 151 * allocated for FBIs. PPLPMDISP is the displacement into that * 152 * block of the next allocatable FBILNTH words. INITIAL * 153 * stores into each PPL it builds the index and displacement * 154 * for that PPLs FBI. The PPLWINDOW virtual page is used to * 155 * map in the blocks. * 156 * * 157 ********************************************************************************** 158 159 ORG FBIPOINTRS(-2) force map to defined location 160 01C7E 00000000 161 PPLPMINDX VFD 0 current index into PPLPFMAP 01C7F 00000000 162 PPLPMDISP VFD 0 current disp into current block 000003F4 ABS 163 PPLMAXDISP EQU ((WPP/FBILNTH)-1)*FBILNTH last FBI in block 00000042 ABS 164 PPLMAPSIZE EQU 66 66 blocks = 24 MB 00001C80 165 PPLPFMAP BSS PPLMAPSIZE table of PM values for PPL FBIs 166 167 ********************************************************************************** 168 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 215 (COREDEFS) F 16 Resident Data Structure Definitions 169 * USED ADDRESS SPACE ARRAY * 170 * This array has one bit for every monitor virtual page. * 171 * Set bits indicate that the virtual page address is * 172 * available for use ( usually as a free storage address ). * 173 * Pages omitted in the assembled words are: * 174 * page 0, CPUPAGE, WNDO1, WNDO2, * 175 * WNDO3, WNDO4, CIX, HEADPAGE, * 176 * INITPAGE, PPLWINDOW, and the USERPAGES * 177 * Other pages are removed by the initial routines. * 178 * MAXMAPVALS controls the number of pages available for user * 179 * virtual free storage. This value also controls the area * 180 * reserved in the PSA for page map values that map virtual * 181 * pages to physical pages. * 182 * * 183 ********************************************************************************** 184 00401CC2 185 AVPAGES BSSB 0 set up array of 1 bit elements 01CC2 FFFFFFFF 186 VFDB 9:0,23:-1 01CC4 FFFFFFFF 187 VFD -1,-1 01CC5 00000000 188 VFDB (WORDLNTH-1)-MAXMAPVALS:-1,1:0,MAXMAPVALS:0 01CC6 00481CBE 189 PAVPAGES PTR AVPAGES(-MONPF) pointer to above bit array 190 191 ********************************************************************************** 192 * * 193 * The monitor from time to time must load up the * 194 * physical page zero page file location in order to adjust * 195 * the power fail tables. The page map value is stored here. * 196 * * 197 ********************************************************************************** 198 01CC7 00000000 199 PAGEZERO VFD STORE page map value for physical/virtual page zero 01CC8 00000000 200 TOTALPAGES VFD STORE total pages of memory in system 201 202 ********************************************************************************** 203 * * 204 * Parity error recovery information * 205 * Each page of the resident operating system has a * 206 * checksum word stored into the following table. Therefore, * 207 * if only one word goes bad, we can reconstruct it from the * 208 * checksum and the other words on the page. The checksum is * 209 * the XOR of all of the words on the page. * 210 * There are also a number of circumstances that cause * 211 * "flakey" parity error interrupts, for which recovery is * 212 * neither possible nor necessary. When we get one of these, * 213 * we save the page file value and the time of the interrupt * 214 * below. If we get a second one with the same page file * 215 * value within 10 seconds of the first one, we declare the * 216 * device to be very flakey and halt. * 217 * * 218 ********************************************************************************** 219 00000028 ABS 220 MAXMEMCKS EQU 40 maximum words of memory checksums 01CC9 00000000 221 MEMCHKLOCK VFD STORE 1 iff a CPU attempting an XOR recovery 00001CCA 222 MEMCKSUM BSS MAXMEMCKS checksum words 223 * WARNING! Must have at least as 224 * many words here as there are 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 216 (COREDEFS) F 16 Resident Data Structure Definitions 225 * pages in the resident operating 226 * system. 01CF2 00000000 227 MPEPFILE VFD STORE page file of last flakey interrupt 01CF4 00000000 228 MPEDATE VFD STORE,STORE date and time of last flakey interrupt 229 230 ********************************************************************************** 231 * * 232 * CPU COMMUNICATIONS LOCK * 233 * In order to prevent awkward hangups, any STTB/LDFB * 234 * operation addressed to another CPU must be interlocked by * 235 * this word so that 2 CPUs never simultaneously try to * 236 * communicate with one another. * 237 * This applies to LDFB and STTB in any combination, * 238 * including STTB/STTB due to a subtle timing possibility (the * 239 * CPUs wait for RTO to go away before they will answer a * 240 * CBN). * 241 * Surprise! This also applies to regular loads and * 242 * stores if they are addressed to another CPU. Same reason * 243 * applies. * 244 * * 245 ********************************************************************************** 246 01CF5 00000000 247 CPUCOMLOCK VFD STORE communications lock 248 249 ********************************************************************************** 250 * * 251 * Bits are set in this word to indicate system tasks * 252 * that must be completed. See DISPATCHER for bit definitions * 253 * * 254 ********************************************************************************** 255 01CF6 00000000 256 FLAGS VFD STORE 257 258 * counters for CPUs on the system. 01CF7 00000000 259 CPUCOUNT VFD 0+STORE total number of CPUs 01CF8 00000000 260 CPUCOUNT1 VFD 0+STORE count of non-frozen CPUs 01CF9 00000000 261 CPUCOUNT2 VFD 0+STORE count of CPUs after power fail 01CFA 00000000 262 CPUINIT VFD 0+STORE count of CPUs on initial page 263 00001CFB 264 CPUSLOTS BSS NUMSLOTS slot numbers of all CPUs 265 01D0B 00000000 266 BUSYCPUS VFD STORE number of CPUs that are 267 * currently running a process 268 269 ********************************************************************************** 270 * * 271 * Flag to say that the system wishes to sleep. Zero sez * 272 * running, non-zero means halt when I/O finished. If * 273 * non-zero, PSA pointer for session doing sleep. * 274 * * 275 ********************************************************************************** 276 01D0C 00000000 277 SLEEPFLAG VFD 0+STORE non-zero sez sleep 278 279 ********************************************************************************** 280 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 217 (COREDEFS) F 16 Resident Data Structure Definitions 281 * If non-zero: the system will not answer the telephone, * 282 * processes will not be created by the CIA driver, and logon * 283 * requests will be refused. Initialized as one so that nothing * 284 * will happen until the system is together. Also set by SLEEP. * 285 * * 286 ********************************************************************************** 287 01D0D 00000001 288 ALLINHIBIT VFD 1+STORE non-zero sez inhibit 289 290 ********************************************************************************** 291 * * 292 * Every time that PLOCK is required to loop while * 293 * waiting for a lock, this location is incremented. * 294 * * 295 ********************************************************************************** 296 01D0E 00000000 297 DYNWAIT VFD 0+STORE dynamic wait count 298 299 ********************************************************************************** 300 * * 301 * The following lock controls the searching of and * 302 * suspending in SQFILEWAIT. That list's lock itself is not * 303 * sufficient since it gets locked and unlocked while being * 304 * searched and entered (the marvels of structured code). * 305 * This lock insures that the searching of the file wait list * 306 * and then the subsequent possible suspension does not allow * 307 * other processes to sneak through. * 308 * * 309 ********************************************************************************** 310 01D0F 00000000 311 FILEWAITL VFD STORE access to SQFILEWAIT controller 312 313 ********************************************************************************** 314 * * 315 * OPEN (and anybody else), when talking to the spooler, * 316 * sends an ID so that the response can be verified to be a * 317 * response to the sent request. This thing is referenced * 318 * with an INCL. We only wait so long for responses from the * 319 * spooler. The time-out value (in seconds) is kept here. * 320 * * 321 ********************************************************************************** 322 01D10 00000000 323 SPLRMSGID VFD 0 message ID to the spooler 01D11 00000258 324 SPLRTIME VFD 600 seconds to wait for response 325 326 ********************************************************************************** 327 * * 328 * Process Serial Number. Whenever a new underprocess is created * 329 * we need to give it a process serial number. The following * 330 * variable is incremented and the low-order 23 bits are used * 331 * as the serial number. Overflow is ignored because it * 332 * provides wrap-around. Duplicates are inevitable, however * 333 * they are unlikely between successive system boots. * 334 * * 335 ********************************************************************************** 336 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 218 (COREDEFS) F 16 Resident Data Structure Definitions 00000017 ABS 337 PSNFLDLN EQU 23 PSN field length 01D12 00000000 338 PROCSERNM VFD STORE process serial number 339 340 ********************************************************************************** 341 * * 342 * TSMSAGE is a counter that is incremented each time the * 343 * clock scheduling interrupt (TICK) occurs. This count is * 344 * used in determining if the processes waiting in MSWAIT * 345 * should have their pages aged or not. The reason being, * 346 * that we want to keep from aging pages away from processes * 347 * in MSWAIT. Note that if we do take pages away then a * 348 * certain percentage will almost certainly be requested * 349 * again. * 350 * TSMSTIME indicates how many times we go through the * 351 * TICK routine before we age pages in the MSWAIT queue. If * 352 * this number is increased, pages will age more slowly. If * 353 * decreased, pages age more rapidly. Since TICK is called * 354 * every two seconds pages held by processes in MSWAIT will * 355 * hang around for quite sometime, unless TSMSTIME is * 356 * exceedingly small (1 or 2). * 357 * * 358 ********************************************************************************** 359 0000000F ABS 360 TSMSTIME EQU 0F age pages every 30 seconds 01D13 0000000F 361 TSMSAGE VFD TSMSTIME MSWAIT age counter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 219 (COREDEFS) F 16 Resident Data Structure Definitions 363 364 * PERFORMANCE MONITORS: 365 366 ********************************************************************************** 367 * * 368 * DYNAMIC WAIT - A table may be allocated that will have * 369 * entries counted each time a CPU has to loop while waiting * 370 * for a lock. This will tell us where we have lock * 371 * contention. * 372 * * 373 ********************************************************************************** 374 01D14 00000000 375 DYNBLOCK VFD 0+STORE address of monitoring block, if any 00001EC0 BYTE 376 DYNBITS EQU BITS 15:26 bits of PC to use as index 00000100 ABS 377 DYNBASE EQU 02000/DYNBITS below this we don't account 00000400 ABS 378 DYNMAX EQU WPP number of entries in table (02000 - 0A000) 379 380 ********************************************************************************** 381 * * 382 * INSTRUCTION HISTOGRAM - One of the CPU's in a * 383 * multi-CPU system may be captured to spend all of its time * 384 * sampling the PC's of other CPU's and creating a histogram * 385 * of the instruction usage within the monitor. In this way, * 386 * we can find out where we are spending our time, and where * 387 * to concentrate on improvements. * 388 * * 389 ********************************************************************************** 390 01D15 00000000 391 IHBUSY VFD 0+STORE 0 => no monitoring in progress, 392 * 1 => some CPU is collecting data, 393 * -1=> request CPU to stop collecting data. 394 395 * Header for returned information 00001D16 396 MONHDR LABEL 00001D16 397 IHBASE BSS 1 lowest PC to track 00001D17 398 IHBUKSIZE BSS 1 bits of PC to use as index 00000008 ABS 399 MONHDRLEN EQU DISPC MONHDR 400 00000800 ABS 401 IHMAX EQU 2048 number of entries in table 00000002 ABS 402 IHBLOCKN EQU (IHMAX+WPP-1)/WPP number of pages to allocate 00001D18 403 IHBLOCKS BSS IHBLOCKN pointers to the allocated pages 404 405 406 ********************************************************************************** 407 * * 408 * XREQ CALL HISTOGRAM - A subroutine in the XREQ * 409 * interrupt processor can be enabled to tabulate in histogram * 410 * form the number of times each request is used. Note that * 411 * this information is gathered VERY early in the XREQ game, * 412 * therefore the table will include entries for illegal (or * 413 * non-existent) requests as well as for the legal ones. * 414 * * 415 ********************************************************************************** 416 01D1A 00000000 417 XHBUSY VFD 0+STORE 0 => no monitoring in progress, 418 * 1 => someone is collecting data 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 220 (COREDEFS) F 16 Resident Data Structure Definitions 419 01D1B FEC00000 420 XHCHECK NOP 0 inst executed by XREQ processor 00000800 ABS 421 XHMAX EQU 2048 number of entries in table 00000002 ABS 422 XHBLOCKN EQU (XHMAX+WPP-1)/WPP number of pages to allocate 00001D1C 423 XHBLOCKS BSS XHBLOCKN pointers to the allocated pages 424 425 * header to give back with the info, mimics LOWPC and BUCKSIZE 426 * of instruction and dynwait monitors 01D1E 00000000 427 XMONHDR VFD 0 lowest XREQ recorded 01D1F 00000001 428 VFD 1 "increment" (we record all XREQs) 00000008 ABS 429 XMONHDRLEN EQU DISPC XMONHDR length of header 430 431 * table of table heads by XREQ type 01D20 00000000 432 XHTABLCK VFD 0 lock for table (list type) 00001D21 433 XHTABTAB LABEL 01D21 00000000 434 VFD 0 unimplemented 01D22 00000000 435 VFD 0 unimplemented 01D23 00000000 436 FREQTAB VFD 0 FREQs 01D24 00000000 437 VFD 0 unimplemented 01D25 00000000 438 UREQTAB VFD 0 UREQs 01D26 00000000 439 OPREQTAB VFD 0 OPREQs 01D27 00000000 440 VFD 0 unimplemented 01D28 00000000 441 BREAKTAB VFD 0 BREAK instruction 00000020 ABS 442 XHTABLEN EQU DISPC XHTABTAB char length of table 443 444 445 ********************************************************************************** 446 * * 447 * TRACE TABLE - a block may be allocated to record the * 448 * most recent 256 events that have occurred. This is most * 449 * useful for system dubugging. * 450 * * 451 ********************************************************************************** 452 01D29 00000000 453 TRACEADDR VFD 0+STORE address of trace table page 01D2A 00000000 454 TRACEINDEX VFD STORE index of last entry in table 01D2B 00000000 455 TRACEGIVEN VFD STORE index of last entry returned to user 456 00001D2C 457 TRACECALL BASE table of instructions executed by TRACE macro 01D2C FEC00000 458 MSTRACE NOP 0 class 00 - MS driver 01D2D FEC00000 459 CIATRACE NOP 0 class 01 - CIA driver 01D2E FEC00000 460 ULBTRACE NOP 0 class 02 - ULB manager 01D2F FEC00000 461 NOP 0 class 03 - unassigned 01D30 FEC00000 462 MTTRACE NOP 0 class 04 - mag tape driver 01D31 FEC00000 463 LPTRACE NOP 0 class 05 - line printer driver 01D32 FEC00000 464 SUBSTRACE NOP 0 class 06 - substitution process 01D33 FEC00000 465 NOP 0 class 07 - unassigned 01D34 FEC00000 466 NOP 0 class 08 - unassigned 01D35 FEC00000 467 NOP 0 class 09 - unassigned 01D36 FEC00000 468 NOP 0 class 10 - unassigned 01D37 FEC00000 469 NOP 0 class 11 - unassigned 01D38 FEC00000 470 NOP 0 class 12 - unassigned 01D39 FEC00000 471 NOP 0 class 13 - unassigned 01D3A FEC00000 472 NOP 0 class 14 - unassigned 01D3B FEC00000 473 NOP 0 class 15 - unassigned 01D3C FEC00000 474 NOP 0 class 16 - unassigned 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 221 (COREDEFS) F 16 Resident Data Structure Definitions 01D3D FEC00000 475 NOP 0 class 17 - unassigned 01D3E FEC00000 476 NOP 0 class 18 - unassigned 01D3F FEC00000 477 NOP 0 class 19 - unassigned 01D40 FEC00000 478 NOP 0 class 20 - unassigned 01D41 FEC00000 479 NOP 0 class 21 - unassigned 01D42 FEC00000 480 NOP 0 class 22 - unassigned 01D43 FEC00000 481 NOP 0 class 23 - unassigned 01D44 FEC00000 482 NOP 0 class 24 - unassigned 01D45 FEC00000 483 NOP 0 class 25 - unassigned 01D46 FEC00000 484 NOP 0 class 26 - unassigned 01D47 FEC00000 485 NOP 0 class 27 - unassigned 01D48 FEC00000 486 NOP 0 class 28 - unassigned 01D49 FEC00000 487 NOP 0 class 29 - unassigned 01D4A FEC00000 488 NOP 0 class 30 - unassigned 01D4B FEC00000 489 NOP 0 class 31 - unassigned 490 DRCT 491 492 ********************************************************************************** 493 * * 494 * READ/WRITE COUNTS BY BLOCK TYPE - The following * 495 * vectors are used to accumulate the numbers of reads and * 496 * writes for each FBI type. These vectors are indexed * 497 * starting with zero. FBI type 0 is undefined, so the 0th * 498 * word holds the table size since it should never be * 499 * incremented (!). * 500 * * 501 ********************************************************************************** 502 00000016 ABS 503 MAXFBITYPE EQU 016 largest index in table 01D4C 00000017 504 READCOUNTS VFD MAXFBITYPE+1 size of table 505 BSS MAXFBITYPE counters of READS 01D63 00000017 506 WRITCOUNTS VFD MAXFBITYPE+1 size of table 507 BSS MAXFBITYPE counters of WRITES 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 222 (COREDEFS) F 16 Resident Data Structure Definitions 509 510 ********************************************************************************** 511 * * 512 * Generalized system process template. * 513 * All the system processes that may be started have * 514 * control blocks that conform to the following format. The * 515 * lock word is used when adding to or deleting from the list * 516 * of elements. The busy word tells us that a process of this * 517 * type has been or is about to be started except for free * 518 * file, which uses a special mechanism. Only interlocked * 519 * instructions should be used to set the busyword. * 520 * * 521 ********************************************************************************** 522 00001D7A 523 FFCPCPROT BASE R4 00170800 4 BASE 524 FFCPCLOCK BSS 1 lock word for the list 00170801 4 BASE 525 FFCPCLIST BSS 1 root of list of elements 00170802 4 BASE 526 FFCPCBUSY BSS 1 zero or non-zero if process started 00170803 4 BASE 527 FFCPCNAME BSS2 1 name to give process 00170805 4 BASE 528 FFCPCPC BSS 1 initial PC for process 00170806 4 BASE 529 FFCPCPROC BSS 1 process to start 530 DRCT 531 ORG FFCPCPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 223 (COREDEFS) F 16 Resident Data Structure Definitions 533 534 ********************************************************************************** 535 * * 536 * File Freer Queue * 537 * List of disk structures being freed. A process is in * 538 * charge of freeing the disk structures and when something is * 539 * placed in the queue the freeing process is started if it is * 540 * idle. The lock on the free list locks the list of free * 541 * file elements. The FFCPCBUSY word (marked unused) is not * 542 * used for the free file process since a special mechanism is * 543 * used for free file to allow multiple freefile processes to * 544 * run simultaneously. The word must be included here so that * 545 * this control block matches the others. Free file processes * 546 * are started based on the number of elements in the list and * 547 * the number of free file processes that currently exists. * 548 * * 549 ********************************************************************************** 550 01D7A 00000000 551 FFLOCK VFD STORE one if FF list locked 01D7B 00000000 552 FFLIST VFD STORE root of the freeing list 01D7C 00000000 553 VFD STORE (unused. makes structure match) 01D7D B674F85C 554 PAK12 SYS_FREEFILE name of the FF process 01D7F 000050B5 555 VFD ADR FFPRESTART place to start the process 01D80 00000100 556 VFD 1*BIT FLFREEFL process to start is free file 557 01D81 00000000 558 FFLISTSIZ VFD STORE+0 num elements in FF list 01D82 00000000 559 FFPROCS VFD STORE+0 num of FF processes going 560 00001D83 561 FFPROT BASE R0 element in the free file list 00160800 0 BASE 562 FFWORDA BSS 1 00080080 0 ZBM 563 FFTYPE EQU FFWORDA/BITS 0:7 FBI type of structure being freed 00081F10 0 ZBM 564 FFLINK EQU FFWORDA/FLDADRS link to the next element in list 00160801 0 BASE 565 FFBLOCK BSS 1 MS address of structure head 00080081 0 ZBM 566 FFDRIVE EQU FFBLOCK/VOLFIELD drive where structure resides 00081181 0 ZBM 567 FFMSBLK EQU FFBLOCK/MSBLKFIELD root block of the structure 00160802 0 BASE 568 FFVOLBPTR BSS 1 pointer to the busy counter in the VOLN element 569 DRCT 00000003 DISP 570 FFLNTH EQU DISP FFPROT length of a FF list element 00000002 ABS 571 FFLOG EQU FFLNTH LOG 2 size of element for free memory routines 572 ORG FFPROT recover lost space 573 574 * extra codes for FFTYPE, since no FBITYPE corresponding 575 00000000 ABS 576 FFTUNKNOWN EQU 0 a single block of unknown type 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 224 (COREDEFS) F 16 Resident Data Structure Definitions 578 579 ********************************************************************************** 580 * * 581 * Queue of Elements to be put into the ADT * 582 * A process is in charge of consuming these elements and * 583 * calling the PUTFREEBLK routine to cause them to be placed * 584 * into the ADT for that volume. This process is started if * 585 * it is idle when a new element is queued. The lock on the * 586 * list locks only the list of elements. The busy word * 587 * indicates whether the ADT process has been started or not. * 588 * * 589 ********************************************************************************** 590 01D83 00000000 591 PADTLOCK VFD STORE one if PADT list locked 01D84 00000000 592 PADTLIST VFD STORE root of the list 01D85 00000000 593 PADTBUSY VFD STORE flag indicating ADT started 01D86 B674F9EF 594 PAK12 SYS_PUTADT name of this process 01D88 00005201 595 VFD ADR PADTRSTRT place to start the process 01D89 00000080 596 VFD 1*BIT FLADT process to start is ADT 597 00001D8A 598 PADTPROT BASE R0 element in the put adt list 00160800 0 BASE 599 PADTWORDA BSS 1 00081F10 0 ZBM 600 PADTLINK EQU PADTWORDA/FLDADRS link to next element 00160801 0 BASE 601 PADTBLOCK BSS 1 MS address of structure head 00080081 0 ZBM 602 PADTDRIVE EQU PADTBLOCK/VOLFIELD drive where block resides 00081181 0 ZBM 603 PADTMSBLK EQU PADTBLOCK/MSBLKFIELD MS address 604 DRCT 00000002 DISP 605 PADTLNTH EQU DISP PADTPROT length of a put adt list element 00000001 ABS 606 PADTLOG EQU PADTLNTH LOG 2 size of element for free memory routines 607 ORG PADTPROT recover lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 225 (COREDEFS) F 16 Resident Data Structure Definitions 609 610 ********************************************************************************** 611 * * 612 * List of elements that contain volume numbers that have * 613 * been maintenance mounted and need to be dismounted. The * 614 * VOLN element has been marked as unusable and once the busy * 615 * count hits zero we can do our thing. One reason we have a * 616 * separate process is to save stack space, since the dismount * 617 * routines use quite a bit of it. * 618 * * 619 ********************************************************************************** 620 01D8A 00000000 621 DMNTLOCK VFD STORE lock for this list 01D8B 00000000 622 DMNTLIST VFD STORE root of the element list 01D8C 00000000 623 DMNTBUSY VFD STORE flag indicating dismounter started 01D8D B674F803 624 PAK12 SYS_DISMOUNT name of this process 01D8F 00005221 625 VFD ADR DMNTSTRT place to start this process 01D90 00000400 626 VFD 1*BIT FLDISMNT flag to start dismount process 627 00001D91 628 DMNTPROTO BASE R0 element for the volume dismounter 00160800 0 BASE 629 DMNTWORDA BSS 1 00081F10 0 ZBM 630 DMNTLINK EQU DMNTWORDA/FLDADRS link to next element in the list 00160801 0 BASE 631 DMNTVOLN BSS 1 volume number to dismount 632 DRCT 00000001 ABS 633 DMNTLOG EQU (DISPW DMNTPROTO) LOG 2 log of the block size 634 ORG DMNTPROTO recover lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 226 (COREDEFS) F 16 Resident Data Structure Definitions 636 637 ********************************************************************************** 638 * * 639 * ERROR LOG QUEUE * 640 * Error log process and queue. Errors generated by the * 641 * system are placed in the below defined queue and then a * 642 * process will consume this queue and write the errors onto * 643 * the error log. The ERRLOGLOCK locks only the list of * 644 * elements. The busyword indicates whether the error log * 645 * process has been started or not. * 646 * * 647 ********************************************************************************** 648 01D91 00000000 649 ERRLOGLOCK VFD STORE lock for list ( one if locked ) 01D92 00000000 650 ERRLOGLIST VFD 0+STORE root of element list 01D93 00000000 651 ERRLOGBUSY VFD 0+STORE flag indicating error log started 01D94 B674F834 652 PAK12 SYS_ERRORLOG name of this process 01D96 00005241 653 VFD ADR ELPRESTART place to start this process 01D97 00000040 654 VFD 1*BIT FLERRLOG process to start is error log 655 01D98 00000000 656 ERRLOGCNT VFD 0+STORE number of logged errors 657 00001D99 658 ERLPROT BASE R0 00160800 0 BASE 659 ERLWORDA BSS 1 000800F0 0 ZBM 660 ERLTYPE EQU ERLWORDA/UPR15 type of error (fields below) 661 ERLLEN EQU EFLEN length of error params in words 662 * (does not include this word) 663 ERERROR EQU EFERROR flag saying count ECNT 664 ERLCODE EQU EFCODE type of error 00081F10 0 ZBM 665 ERLLINK EQU ERLWORDA/FLDADRS link to next element 00160801 0 BASE 666 ERLDATE BSS 2 time of the error 00160803 0 BASE 667 ERLPARAMS LABEL variable size parameter list 668 * the rest of the message is ERLTYPE/ERLLEN 669 * words long 670 DRCT 671 ORG ERLPROT recover the space 672 00000002 ABS 673 ERLFUNK EQU (ERLPARAMS DISPW ERLWORDA)-1 674 675 ERRORFILE LIST 675 ********************************************************************************** 675 * * 675 * The system logs in a file IO and other errors that * 675 * occur while the system is running. This file is of the * 675 * format given. The errors consist of a code and a variable * 675 * number of parameters. Defined error codes are ("|" * 675 * separates words): * 675 * * 675 * ERLCEND | dummy parameter * 675 * ERLCTS ( no longer used ) * 675 * ERLCTEXT | variable length string (blank filled) * 675 * ERLCBFBI ( new code below ) * 675 * ERLCCKFBI ( new code below ) * 675 * ERLCBKFBI ( new code below ) * 675 * ERLCPFFBI ( no longer used ) * 675 * ERLCBLNK | MS address expected | found * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 227 (COREDEFS) F 16 Resident Data Structure Definitions 675 * ERLCFSAF | MS address * 675 * ERLCFUD1 | MS address * 675 * ERLCFUD2 | MS address * 675 * ERLCPPUBT | PF for channel | PPU status * 675 * ERLCCIAE | PF for channel | CIA status * 675 * ERLCCIATO | PF for channel * 675 * ERLCDSKTO | PF for channel | unit * 675 * ERLCSSUTO | PF for SSU * 675 * ERLCSUB ( new code below ) * 675 * ERLCNOSUB ( new code below ) * 675 * ERLCUNSUB ( new code below ) * 675 * ERLCPPUTO (no longer used) * 675 * ERLCBOOT | system version (upper) | system version (lower) | boot switches* 675 * ERLCMOUNT | volume number | drive name | volume name (upper) | * 675 * volume name (lower) * 675 * ERLCDMOUNT | volume number * 675 * ERLCMPE | status + virtual address | PF | block * 675 * ERLCMPED | PF | block * 675 * ERLCDNRDY ( new code below ) * 675 * ERLCRMNT | volume number | drive name * 675 * ERLCCTC (no longer used) * 675 * ERLCCTCTO (no longer used) * 675 * ERLCDSKRD ( new code below ) * 675 * ERLCDCNT | drive name | cable number | read count | write count * 675 * ERLCDSKRW ( new code below ) * 675 * ERLCLPERR | LP name | LP status * 675 * ERLCLPIFPE ( no longer used ) * 675 * ERLCLPTO | LP name * 675 * ERLCPPUBAD | PPU slot number * 675 * ERLCPPUOK | PPU slot number * 675 * ERLCCTLBAD | PPU slot number | channel number * 675 * ERLCCTLOK | PPU slot number | channel number * 675 * ERLCDATBAD | target date | current date * 675 * ERLCNVMTIM | dummy parm * 675 * ERLCMTC (no longer used) * 675 * ERLCMTCTO | page map value * 675 * ERLCMTCERR | drive name | operation | tape status | PPU status * 675 * ERLCDSKID | drive name | drive id (3 words) | * 675 * pack mfg | pack s/n | fmt date (2 words) | * 675 * volume name (2 words) * 675 * ERLCUNLOAD | drive name * 675 * ERLCDE | drive name | block number | seek address | * 675 * operation | BFD status | PPU status * 675 * ERLCPWFAIL | dummy parameter * 675 * ERLCPWRUP | dummy parameter * 675 * ERLCBFBI | drive name | MS address | expected | found * 675 * ERLCCKFBI | drive name | MS address | difference | found * 675 * ERLCBKFBI | drive name | MS address | found * 675 * ERLCRDGCS | drive name | MS address | segment# * 675 * ERLCSUB | drive name | bad MS address | substitute address * 675 * ERLCNOSUB | drive name | bad MS address | reason * 675 * ERLCUNSUB | drive name | bad MS address | substitute MS address * 675 * ERLCDNRDY | drive name | volume number * 675 * ERLCDSKRD | drive name | MS address | seek address * 675 * ERLCDSKRW | drive name | MS address | seek address * 675 * ERLCSCSIRS | drive name | MS address | seek address | operation | * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 228 (COREDEFS) F 16 Resident Data Structure Definitions 675 * SCSI status | PPU status | sense key | sense code * 675 * ERLCSCSIDE | drive name | block number | seek address | * 675 * operation | SCSI status | PPU status * 675 * ERLCSCSIID | drive name | vendor id (2 words) | * 675 * product id (3 words) | firmware rev (2 words) | * 675 * fmt date (2 words) | volume name (2 words) * 675 * * 675 * The error logging file is SYSTEM.!!!:ERRORLOG.LOGFIL. * 675 * This file should be opened as an empty .RAF. The error * 675 * logging session will add records to the end of the file and * 675 * advance the end pointer. The begin pointer is provided for * 675 * the benefit of the reading process. It is the * 675 * responsibility of the reading process to free blocks when * 675 * they are no longer needed, otherwise, the log file will * 675 * grow until it occupies all available mass storage space. * 675 * Note that block 0 should never be freed ( except possibly * 675 * to release the entire file ). * 675 * If EFEND is in the range of -EFRSIZE to 2*CPW, then it * 675 * is set to 2*CPW. The reading routine should do the same * 675 * for EFBEGIN. * 675 * * 675 ********************************************************************************** 675 675 * These addresses are used to get the pointers from the error log file 00000000 ABS 675 EFBEGIN EQU 0 pointer to first error entry 00000004 ABS 675 EFEND EQU 1*4 pointer to end of error entries 675 00001D99 675 EFPROTO BASE R0 prototype of error entry 00160800 0 BASE 675 EFWORDA BSS 1 00002250 BYTE 675 EFLEN EQU BITS 17:21 number of parameters for this error 00002C10 BYTE 675 EFERROR EQU BIT 22 0 => routine log entry, 1 => error 00002E90 BYTE 675 EFCODE EQU BITS 23:31 code for this error 000800F0 0 ZBM 675 EFTYPE EQU EFWORDA/BITS 0:14 code for this error 00081F10 0 ZBM 675 EFLENGTH EQU EFWORDA/BITS 15:31 length of this entry in words 00160801 0 BASE 675 EFDATE BSS 2 system time word when error happened 00160803 0 BASE 675 EFPARAMS LABEL first word of parameters 675 DRCT 675 ORG EFPROTO reclaim space 675 675 * The actual codes 00000401 ABS 675 ERLCEND EQU 1*EFLEN+0*EFERROR+01*EFCODE end system 675 *ERLCTS EQU 1*EFLEN+0*EFERROR+02*EFCODE time stamp 00000603 ABS 675 ERLCTEXT EQU 1*EFLEN+1*EFERROR+03*EFCODE text record 675 *ERLCBFBI EQU 3*EFLEN+1*EFERROR+04*EFCODE unused - was FBI type mismatch 675 *ERLCCKFBI EQU 3*EFLEN+1*EFERROR+05*EFCODE unused - was FBI checksum bad 675 *ERLCBKFBI EQU 2*EFLEN+1*EFERROR+06*EFCODE unused - was FBI DA mismatch 675 * EQU 6*EFLEN+1*EFERROR+07*EFCODE unused - was old format MS error 675 *ERLCPFFBI EQU 3*EFLEN+1*EFERROR+08*EFCODE bad FBI in PFPROC 00000E09 ABS 675 ERLCBLNK EQU 3*EFLEN+1*EFERROR+09*EFCODE bad backward link while freeing 0000060A ABS 675 ERLCFSAF EQU 1*EFLEN+1*EFERROR+10*EFCODE bad block while freeing SAF 0000060B ABS 675 ERLCFUD1 EQU 1*EFLEN+1*EFERROR+11*EFCODE bad UD1 block while freeing DIR 0000060C ABS 675 ERLCFUD2 EQU 1*EFLEN+1*EFERROR+12*EFCODE bad UD2 block while freeing DIR 00000A0D ABS 675 ERLCPPUBT EQU 2*EFLEN+1*EFERROR+13*EFCODE bad transfer status from PPU 00000A0E ABS 675 ERLCCIAE EQU 2*EFLEN+1*EFERROR+14*EFCODE error code from CIA 0000060F ABS 675 ERLCCIATO EQU 1*EFLEN+1*EFERROR+15*EFCODE CIA deadman timeout 00000A10 ABS 675 ERLCDSKTO EQU 2*EFLEN+1*EFERROR+16*EFCODE Disk deadman timeout 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 229 (COREDEFS) F 16 Resident Data Structure Definitions 00000611 ABS 675 ERLCSSUTO EQU 1*EFLEN+1*EFERROR+17*EFCODE SSU timeout 675 *ERLCSUB EQU 2*EFLEN+1*EFERROR+18*EFCODE unused - was MS block substituted 675 *ERLCNOSUB EQU 2*EFLEN+1*EFERROR+19*EFCODE unused - was MS block not substituted 675 *ERLCUNSUB EQU 2*EFLEN+0*EFERROR+20*EFCODE unused - was MS block unsubstituted 675 *ERLCPPUTO EQU 1*EFLEN+1*EFERROR+21*EFCODE PPU timeout, PPU not talking 00000C16 ABS 675 ERLCBOOT EQU 3*EFLEN+0*EFERROR+22*EFCODE system boot 00001017 ABS 675 ERLCMOUNT EQU 4*EFLEN+0*EFERROR+23*EFCODE volume mount 00000418 ABS 675 ERLCDMOUNT EQU 1*EFLEN+0*EFERROR+24*EFCODE volume dismount 00000E19 ABS 675 ERLCMPE EQU 3*EFLEN+1*EFERROR+25*EFCODE memory parity error 00000A1A ABS 675 ERLCMPED EQU 2*EFLEN+1*EFERROR+26*EFCODE memory parity error 675 *ERLCDNRDY EQU 2*EFLEN+1*EFERROR+27*EFCODE unused - was disk dropped ready 0000081C ABS 675 ERLCRMNT EQU 2*EFLEN+0*EFERROR+28*EFCODE volume remounted 675 *ERLCCTC EQU 4*EFLEN+1*EFERROR+29*EFCODE CTC operation error 675 *ERLCCTCTO EQU 2*EFLEN+1*EFERROR+30*EFCODE CTC deadman timeout 675 * EQU 5*EFLEN+1*EFERROR+31*EFCODE unused - was MS error 675 *ERLCDSKRD EQU 3*EFLEN+1*EFERROR+32*EFCODE unused - was perm read error 00001021 ABS 675 ERLCDCNT EQU 4*EFLEN+0*EFERROR+33*EFCODE disk activity count 675 *ERLCDSKRW EQU 2*EFLEN+0*EFERROR+34*EFCODE unused - was rewrite after read 00000A23 ABS 675 ERLCLPERR EQU 2*EFLEN+1*EFERROR+35*EFCODE line printer error 675 *ERLCLPIFPE EQU 2*EFLEN+1*EFERROR+36*EFCODE line printer interface parity error (obsolete) 00000625 ABS 675 ERLCLPTO EQU 1*EFLEN+1*EFERROR+37*EFCODE line printer timeout 00000626 ABS 675 ERLCPPUBAD EQU 1*EFLEN+1*EFERROR+38*EFCODE PPU doesn't respond 00000427 ABS 675 ERLCPPUOK EQU 1*EFLEN+0*EFERROR+39*EFCODE PPU started talking again 00000A28 ABS 675 ERLCCTLBAD EQU 2*EFLEN+1*EFERROR+40*EFCODE controller doesn't respond 00000829 ABS 675 ERLCCTLOK EQU 2*EFLEN+0*EFERROR+41*EFCODE controller is OK again 00000A2A ABS 675 ERLCDATBAD EQU 2*EFLEN+1*EFERROR+42*EFCODE SSU clock is bad 0000062B ABS 675 ERLCNVMTIM EQU 1*EFLEN+1*EFERROR+43*EFCODE NVM time is bad 675 *ERLCMTC EQU 4*EFLEN+1*EFERROR+44*EFCODE MTC operation error 675 *ERLCMTCTO EQU 2*EFLEN+1*EFERROR+45*EFCODE MTC deadman timeout 0000062E ABS 675 ERLCMTCTO EQU 1*EFLEN+1*EFERROR+46*EFCODE MTC deadman timeout 0000122F ABS 675 ERLCMTCERR EQU 4*EFLEN+1*EFERROR+47*EFCODE MTC tape error 00002830 ABS 675 ERLCDSKID EQU 10*EFLEN+0*EFERROR+48*EFCODE drive and pack id 00000631 ABS 675 ERLCUNLOAD EQU 1*EFLEN+1*EFERROR+49*EFCODE unload disk heads 00001A32 ABS 675 ERLCDE EQU 6*EFLEN+1*EFERROR+50*EFCODE disk I/O error 00000633 ABS 675 ERLCPWFAIL EQU 1*EFLEN+1*EFERROR+51*EFCODE power failure 00000434 ABS 675 ERLCPWRUP EQU 1*EFLEN+0*EFERROR+52*EFCODE power up restart 00000A35 ABS 675 ERLCSMU EQU 2*EFLEN+1*EFERROR+53*EFCODE SMU error 00001236 ABS 675 ERLCBFBI EQU 4*EFLEN+1*EFERROR+54*EFCODE FBI type mismatch 00001237 ABS 675 ERLCCKFBI EQU 4*EFLEN+1*EFERROR+55*EFCODE FBI checksum bad 00000E38 ABS 675 ERLCBKFBI EQU 3*EFLEN+1*EFERROR+56*EFCODE FBI MS block didn't match 00000C39 ABS 675 ERLCRDGCS EQU 3*EFLEN+0*EFERROR+57*EFCODE reading MS correction segment 00000E3A ABS 675 ERLCSUB EQU 3*EFLEN+1*EFERROR+58*EFCODE MS block substituted 00000E3B ABS 675 ERLCNOSUB EQU 3*EFLEN+1*EFERROR+59*EFCODE MS block not substituted 00000C3C ABS 675 ERLCUNSUB EQU 3*EFLEN+0*EFERROR+60*EFCODE MS block unsubstituted 00000A3D ABS 675 ERLCDNRDY EQU 2*EFLEN+1*EFERROR+61*EFCODE disk dropped ready 00000E3E ABS 675 ERLCDSKRD EQU 3*EFLEN+1*EFERROR+62*EFCODE permanent disk read error (data lost) 00000C3F ABS 675 ERLCDSKRW EQU 3*EFLEN+0*EFERROR+63*EFCODE rewrite disk block after read 00002240 ABS 675 ERLCSCSIRS EQU 8*EFLEN+1*EFERROR+64*EFCODE request sense data for disk error 00001A41 ABS 675 ERLCSCSIDE EQU 6*EFLEN+1*EFERROR+65*EFCODE SCSI disk I/O error 00003442 ABS 675 ERLCSCSIID EQU 13*EFLEN+0*EFERROR+66*EFCODE SCSI device identification 675 0000000D ABS 675 ERLMAXLEN EQU 13 maximum number of parameters 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 230 (COREDEFS) F 16 Resident Data Structure Definitions 677 678 ********************************************************************************** 679 * * 680 * System Accounting Process Queue * 681 * This is a list of accounting records that must be * 682 * written to the various accounting files. A process is in * 683 * charge of writing the records to mass storage. If it is * 684 * not already running, it is started when an entry is placed * 685 * into the queue. The APLOCK locks only the list of * 686 * elements. The busyword indicates whether the accounting * 687 * process has been started or not. * 688 * * 689 ********************************************************************************** 690 01D99 00000000 691 APLOCK VFD STORE one if AP list locked 01D9A 00000000 692 APLIST VFD STORE root of the accounting list - top bit is lock 01D9B 00000000 693 APBUSY VFD STORE flag indicating accounting started 01D9C B674F785 694 PAK12 SYS_ACCOUNT name for this process 01D9E 00005316 695 VFD ADR ACCTRESTRT place to start this process 01D9F 00000200 696 VFD 1*BIT FLACCTNG process to start is accounting 697 01DA0 00000000 698 APREQUE VFD 0*STORE incremented for every requeued accounting element 699 700 ACCTFILE LIST 700 ********************************************************************************** 700 * * 700 * Accounting files. * 700 * A system session writes records into accounting files * 700 * whenever certain events occur. The events and the format * 700 * of the files are described below. The files where log * 700 * entries are made are determined by a bit mask in the * 700 * ULLIMITS block called LIMLOGSPOT. Each accounting record is * 700 * written to as many as 4 log files: * 700 * * 700 * user.divprj:ACCOUNTING.LOGFIL * 700 * MANAGER.divprj:ACCOUNTING.LOGFIL * 700 * MANAGER.div:ACCOUNTING.LOGFIL * 700 * MANAGER.SYS:ACCOUNTING.LOGFIL * 700 * * 700 * The manufacturers account logging may go to himself, * 700 * MANAGER.!!!, or MANAGER.SYS. * 700 * These files should be opened as empty .RAFs. The * 700 * accounting session will add records to the end of the file * 700 * and advance the end pointer. The begin pointer is provided * 700 * for the benefit of the reading process. It is the * 700 * responsibility of the reading process to free blocks when * 700 * they are no longer needed, otherwise, the log file will * 700 * grow until it occupies all available space. Note that * 700 * block 0 should never be freed. * 700 * If AFEND is in the range of -AFRSIZE to 2*CPW, then it * 700 * is set to 2*CPW. The reading routine should do the same * 700 * for AFBEGIN. * 700 * * 700 * It should be noted that for file entries being logged * 700 * the primary account name and project is for the account * 700 * owning the file and the secondary one is for the account * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 231 (COREDEFS) F 16 Resident Data Structure Definitions 700 * accessing the file. Also for aliases and unaliases the * 700 * file name and extension field is used to hold the logon * 700 * account name and project of the user performing the alias. * 700 * * 700 ********************************************************************************** 700 00000000 ABS 700 AFBEGIN EQU 0 RAF char position of read pointer 00000004 ABS 700 AFEND EQU 1*4 RAF char position of write pointer 700 * (points to next records location) 700 00001DA1 700 AFRPROTO BASE R0 00080050 0 ZBM 700 AFRTYPE BSSB 5 type of record 00000000 ABS 700 APTSLEEP EQU 0 sleep record (tested with JEQZ!) 00000001 ABS 700 APTSTARTUP EQU 1 system startup 00000002 ABS 700 APTON EQU 2 successful logon 00000003 ABS 700 APTPWW EQU 3 unsuccessful logon 00000004 ABS 700 APTALIAS EQU 4 alias 00000005 ABS 700 APTALIER EQU 5 alias failure 00000006 ABS 700 APTOFF EQU 6 logoff 00000007 ABS 700 APTALOFF EQU 7 unalias 00000008 ABS 700 APTPWRFAIL EQU 8 power failure 00000009 ABS 700 APTPWRUP EQU 9 power up restart 0000000A ABS 700 APTCONCP EQU 10 concurrent session startup 0000000B ABS 700 APTABORT EQU 11 opr abort 0000000C ABS 700 APTTERMIN EQU 12 opr terminate 0000000D ABS 700 APTEVICT EQU 13 opr evict 0000000E ABS 700 APTFILOP EQU 14 file open 0000000F ABS 700 APTFILCL EQU 15 file close 00000010 ABS 700 APTFBC EQU 16 file being destroyed 00000011 ABS 700 APTLOAD EQU 17 volume mount 00000012 ABS 700 APTUNLOAD EQU 18 volume dismount 00000013 ABS 700 APTSTOP EQU 19 stop process 00000014 ABS 700 APTGO EQU 20 start process 00000015 ABS 700 APTXSAVE EQU 21 file exchange save 00000015 ABS 700 APTMAX EQU 21 largest type 700 * Bit array of those APTs that are long 2B000000 ABS 700 AFRSZLONG EQU 1*(BIT APTON)+1*(BIT APTALIAS)+1*(BIT APTOFF)+1*(BIT APTALOFF) 700 00080AA0 0 ZBM 700 AFRPORTNUM BSSB 10 port number of activity 00081F10 0 ZBM 700 AFRLEN BSSB 17 character size of record 000800C1 0 ZBM 700 AFRPROCN BSSB 12 session number 00081811 0 ZBM 700 AFRSHADOW BSSB 1 on if mentioned acct shadow 00081A11 0 ZBM 700 AFRFOREIGN BSSB 1 on if mentioned acct foreign 00081D21 0 ZBM 700 AFRFILLER BSSB 32-14 filler 00160802 0 BASE 700 AFRACCT BSS2 1 account name 00160804 0 BASE 700 AFRPROJ BSS 1 division-project 00160805 0 BASE 700 AFRTIME BSS2 1 time of occurrence 0000001C ABS 700 AFRSHORT EQU DISPC AFRTYPE size of short acct file record 00160807 0 BASE 700 AFRCPUTIME BSS 1 CPU time used (sec) 00160808 0 BASE 700 AFRSVDUSD BSS 1 saved file space (fb) 00160809 0 BASE 700 AFRSESMAX BSS 1 session output max (high water mark) 00160807 0 BASE 700 AFRACCT2 EQU AFRCPUTIME second account name in record 00160809 0 BASE 700 AFRPROJ2 EQU AFRSESMAX second project in record 700 00000028 ABS 700 AFRSIZE EQU DISPC AFRTYPE size of account file record 0016080A 0 BASE 700 AFRWORDA BSS 1 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 232 (COREDEFS) F 16 Resident Data Structure Definitions 000800AA 0 ZBM 700 AFRPORT2 EQU AFRWORDA/BITS 0:9 second port in record 000814CA 0 ZBM 700 AFRPROC2 EQU AFRWORDA/BITS 10:21 second session number in record 0000002C ABS 700 AFRLONG EQU DISPC AFRTYPE size of long account record 700 BSS 1 second word of file name 0016080A 0 BASE 700 AFRFILNAM EQU AFRWORDA file name 0016080C 0 BASE 700 AFRFILEXT BSS 1 file extention 00000034 ABS 700 AFRFILLEN EQU DISPC AFRTYPE size of record with file info in it 00000034 ABS 700 AFRMAXLEN EQU AFRFILLEN max length of an accounting record 700 DRCT 700 ORG AFRPROTO reclaim area 701 00001DA1 702 APPROT BASE R4 element in the accounting list 00170800 4 BASE 703 APWORDA BSS 1 00090050 4 ZBM 704 APWHOGETS EQU APWORDA/BITS 0:4 bit mask of whose acct. file 00091F10 4 ZBM 705 APLINK EQU APWORDA/FLDADRS 00170801 4 BASE 706 APRECORD BSS (AFRMAXLEN+3)/CPW holds the accounting entry (round up) 707 DRCT 0000000E DISP 708 APLNTH EQU DISP APPROT length of accounting list element 00000004 ABS 709 APLOG EQU APLNTH LOG 2 log size of element for free storage 710 ORG APPROT recover lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 233 (COREDEFS) F 16 Resident Data Structure Definitions 712 713 ********************************************************************************** 714 * * 715 * CPU4s can load microcode patches into their RAM from a * 716 * predefined patch file. We read in any patch files at boot * 717 * time and keep them linked in a list. At power up and boot * 718 * we tell the CPUs to load the microcode patches. * 719 * * 720 ********************************************************************************** 721 01DA1 00000000 722 PATCHLIST VFD STORE list of CPU microcode patches 01DA2 B674F7E2 723 CPUPROCNAM PAK12 SYS_CPUPATCH 724 00001DA4 725 CPUPPROTO BASE R3 0016C000 3 CACH 726 CPUPREV BSSB 8 rev level this patch is for 727 BSSB 7 filler 0008DF10 3 ZBM 728 CPUPLINK BSSB ADDRESS link to next patch 00000001 ABS 729 CPUPSIZE EQU DISPW CPUPREV length of the control stuff 0016C801 3 BASE 730 CPUPLNTH BSS 1 length of actual CPU patch 0016C802 3 BASE 731 CPUPSTRT BSS 0 where the rest of the patch goes 732 DRCT 733 ORG CPUPPROTO recover space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 234 (COREDEFS) F 16 Resident Data Structure Definitions 735 736 ********************************************************************************** 737 * * 738 * When a CPU is removed from service for load testing, * 739 * etc. we need to keep track of it. The following is a list, * 740 * lock, and element which is used for this purpose * 741 * * 742 ********************************************************************************** 743 01DA4 00000000 744 IDLECPULCK VFD STORE 01DA5 00000000 745 IDLECPULST VFD STORE 01DA6 00000000 746 IDLECPUCNT VFD STORE number of idle CPUs 01DA7 B674FA66 747 IDLENAME PAK12 SYS_STOPCPU 00002710 ABS 748 IDLETIME EQU 10000 time to wait between seeing if it 749 * is time to resume normal work 750 00001DA9 751 ICPROTO BASE R2 752 BSSB 4 some filler 00088840 2 ZBM 753 ICSLOT BSSB 4 slot number of idle CPU 00089010 2 ZBM 754 ICNOTBUILT BSSB 1 1 sez this process has been built 00089210 2 ZBM 755 ICSTART BSSB 1 when set sez we should start back to work 756 BSSB 5 some more filler 00089F10 2 ZBM 757 ICLINK BSSB ADDRESS link to next element 758 DRCT 00000000 ABS 759 ICBLKLOG EQU (DISPW ICPROTO) LOG 2 760 ORG ICPROTO 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 235 (COREDEFS) F 16 Resident Data Structure Definitions 762 763 ********************************************************************************** 764 * * 765 * PROCESS IOBOUND QUEUES * 766 * The PCB for each process not currently running appears * 767 * in exactly one of these queues. * 768 * The PCQPARM word in each PCB contains a parameter that * 769 * usually indicates in some way what releases the user from * 770 * the queue that he is in. * 771 * Usually, users are placed onto the distal end of these * 772 * queues and removed when appropriate or from the proximal * 773 * end ( first on, first off ). However, the runnable queue * 774 * is kept in run priority order (calculated by the * 775 * scheduler). * 776 * SQLOCKS is an array of lock words corresponding to the * 777 * queues. At least one routine (SHUTDOWN) relies on the fact * 778 * that this array immediately follows the array of queue * 779 * heads. * 780 * The appropriate number from the SDPARM array is used * 781 * to determine the pre-aging of pages when a process is * 782 * entered into that queue. * 783 * * 784 ********************************************************************************** 785 786 ********************************************************************************** 787 * * 788 * When entries are added to or removed from this table * 789 * of queues, the SDPARM, LFWEIGHTAB, and STATENAME arrays * 790 * must be altered to match! * 791 * * 792 ********************************************************************************** 793 00001DA9 794 SQBEGIN LABEL start of the user wait queues 795 00000000 ABS 796 NQRUNNING EQU DISPW SQBEGIN number of this queue 01DA9 00000000 797 SQRUNNING VFD FLDADRS*STORE currently running users 798 * PCQPARM contains the CPU slot number 799 00000001 ABS 800 NQRUNNABLE EQU DISPW SQBEGIN number of this queue 01DAA 00000000 801 SQRUNNABLE VFD FLDADRS*STORE users ready but waiting ( not IOBOUND ) 802 * PCQPARM contains this elements queue priority 803 00000002 ABS 804 NQMSWAIT EQU DISPW SQBEGIN 01DAB 00000000 805 SQMSWAIT VFD FLDADRS*STORE waiting for page from MS 806 * PCQPARM contains the MS block number 807 * PCQPARM2 contains the virtual page number 808 00000003 ABS 809 NQDIOWAIT EQU DISPW SQBEGIN 01DAC 00000000 810 SQDIOWAIT VFD FLDADRS*STORE waiting for a direct I/O transfer 811 * PCQPARM contains address of an I/O control block 812 00000004 ABS 813 NQDIRWAIT EQU DISPW SQBEGIN 01DAD 00000000 814 SQDIRWAIT VFD FLDADRS*STORE waiting for directory 815 * PCQPARM contains the ULB pointer 816 00000005 ABS 817 NQADTWAIT EQU DISPW SQBEGIN 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 236 (COREDEFS) F 16 Resident Data Structure Definitions 01DAE 00000000 818 SQADTWAIT VFD FLDADRS*STORE waiting for ADT blocks 819 * PCQPARM contains the volume number 820 00000006 ABS 821 NQIDXWAIT EQU DISPW SQBEGIN 01DAF 00000000 822 SQIDXWAIT VFD FLDADRS*STORE waiting for IDX 823 * PCQPARM contains volume number, or zero if waiting for AFT 824 00000007 ABS 825 NQLOCKWAIT EQU DISPW SQBEGIN 01DB0 00000000 826 SQLOCKWAIT VFD FLDADRS*STORE waiting for access to file resource lock 827 * PCQPARM = vol num, resource number, 828 and file serial number 829 * PCQPARM2 = requested access 830 00000008 ABS 831 NQFILEWAIT EQU DISPW SQBEGIN 01DB1 00000000 832 SQFILEWAIT VFD FLDADRS*STORE waiting for file access 833 * PCQPARM = vol num and file serial number waiting for 834 * PCQPARM2 = requested access 835 00000009 ABS 836 NQPATHWAIT EQU DISPW SQBEGIN 01DB2 00000000 837 SQPATHWAIT VFD FLDADRS*STORE waiting for info to/from .PATH 838 * PCQPARM => path control block waiting on (sign if writing) 839 0000000A ABS 840 NQMSGWAIT EQU DISPW SQBEGIN 01DB3 00000000 841 SQMSGWAIT VFD FLDADRS*STORE waiting to send/receive MSG 842 * PCQPARAM => my PSA if, receiving, other PSA with sign set 843 * if waiting to send 844 0000000B ABS 845 NQUNITWAIT EQU DISPW SQBEGIN 01DB4 00000000 846 SQUNITWAIT VFD FLDADRS*STORE waiting to send/receive UNIT 847 * PCQPARAM => my PSA if, receiving, other PSA with sign set 848 * if waiting to send 849 0000000C ABS 850 NQTERMWAIT EQU DISPW SQBEGIN 01DB5 00000000 851 SQTERMWAIT VFD FLDADRS*STORE waiting for terminal input 852 * PCQPARM => TCB waiting on 853 0000000D ABS 854 NQTRMOWAIT EQU DISPW SQBEGIN 01DB6 00000000 855 SQTRMOWAIT VFD FLDADRS*STORE waiting for terminal output 856 * PCQPARM => TCB waiting on 857 0000000E ABS 858 NQTIMEWAIT EQU DISPW SQBEGIN 01DB7 00000000 859 SQTIMEWAIT VFD FLDADRS*STORE waiting for the clock to move 860 * PCQPARM = event bits waiting for 861 0000000F ABS 862 NQSTOPWAIT EQU DISPW SQBEGIN 01DB8 00000000 863 SQSTOPWAIT VFD FLDADRS*STORE process stopped by another 864 00000010 ABS 865 NQTROUBLE EQU DISPW SQBEGIN 01DB9 00000000 866 SQTROUBLE VFD FLDADRS*STORE troublemaker 867 * PCQPARM contains jail term 868 00000011 ABS 869 NQUEUES EQU DISPW SQBEGIN number of user wait queues 870 00001DBA 871 SQLOCKS BSS NQUEUES locks for the SQs 872 873 * define a bit array to indicate the queues on which new elements 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 237 (COREDEFS) F 16 Resident Data Structure Definitions 874 * must be added at the end (i.e. queues for resources) 4C000000 ABS 875 FIRSTPART EQU (1*BIT NQRUNNABLE)+(1*BIT NQDIRWAIT)+(1*BIT NQADTWAIT) 03800000 ABS 876 SECONDPART EQU (1*BIT NQIDXWAIT)+(1*BIT NQLOCKWAIT)+(1*BIT NQFILEWAIT) 00700000 ABS 877 THIRDPART EQU (1*BIT NQPATHWAIT)+(1*BIT NQMSGWAIT)+(1*BIT NQUNITWAIT) 01DCB 00481DCC 878 SQAPPENDIT PTR SQENDARRAY/BIT 0 01DCC 4FF00000 879 SQENDARRAY VFD FIRSTPART+SECONDPART+THIRDPART 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 238 (COREDEFS) F 16 Resident Data Structure Definitions 881 882 ********************************************************************************** 883 * * 884 * SDPARM array * 885 * When a process is placed into a queue, its pages are * 886 * all aged by the number extracted from this table, then the * 887 * TAKEOLD routine is called to remove any ancient pages. * 888 * When a user gets suspended, we can assume that he will * 889 * stay suspended for a short length of time. During this * 890 * time, the pages that he owns might more profitably be used * 891 * by other running processes. These parameter values are * 892 * adjusted based on the expected length of time that the * 893 * process will spend suspended in the corresponding queue. * 894 * If a parameter is decreased, it has the effect of * 895 * leaving more pages in the users working set when he enters * 896 * the queue. If he remains in the queue for a short time * 897 * only, he will have more pages available when he is * 898 * restarted. * 899 * If a parameter is increased, it has the effect of * 900 * removing more pages from the users working set when he * 901 * enters the queue. He will therefore have fewer pages * 902 * available when he leaves the queue, even if he stays * 903 * suspended for a very short time. * 904 * Note that on a heavily loaded system, a parameter * 905 * greater that MMAGE means that essentially no pages will be * 906 * left in this users working set when he is suspended. * 907 * Note also, that the IDLSPEED parameter controls * 908 * additional periodic aging of a suspended users working set. * 909 * The value for the sizewait (trouble maker) queue is * 910 * set to the largest value that can be added to an existing * 911 * PAGEAGE without overflowing the field. This ensures that * 912 * during the shutdown of a troublemaker we remove all of his * 913 * pages. * 914 * * 915 ********************************************************************************** 916 01DCC 00000000 917 SDPARM VFDB 16:0 running (never used) 01DCD 00000000 918 VFDB 16:0 runnable 01DCE 00000000 919 VFDB 16:0,0 mswait, diowait 01DD0 00000004 920 VFDB 16:4,4,4,4 dirwait, adtwait, idxwait, lockwait 01DD0 0000000C 921 VFDB 16:00C filewait 01DD2 00000008 922 VFDB 16:008,008,008 pathwait, msgwait, unitwait 01DD3 00000010 923 VFDB 16:010,010 termwait, termowait 01DD3 00000010 924 VFDB 16:010 timewait 01DD4 00001FFF 925 VFDB 16:01FFF stopwait 01DD4 00001FFF 926 VFDB 16:01FFF trouble 00000011 ABS 927 SDPARMNUM EQU (DISPB SDPARM)/16 number of entries in this table 928 ASSERTEQ NQUEUES,SDPARMNUM make sure it's right number 928 BSS NQUEUES-SDPARMNUM error if NQUEUES < SDPARMNUM 928 BSS SDPARMNUM-NQUEUES error if SDPARMNUM < NQUEUES 01DD6 04081DCD 929 PSDPARM PTR SDPARM pointer to above table 930 931 ********************************************************************************** 932 * * 933 * Load factor parameters. * 934 * The load factor algorithm calculates a number based on * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 239 (COREDEFS) F 16 Resident Data Structure Definitions 935 * the number of users waiting for system resources (NOT user * 936 * controllable resources). The LFWEIGHT table controls the * 937 * the amount of weight given for each user in a given SQ. In * 938 * order to smooth out the variations in this value, the newly * 939 * calculated value is combined with the old value using a * 940 * weighted averaging scheme. Here live the parameters that * 941 * get changed controlling the load factor algorithm. The * 942 * constants used are defined in TICK. * 943 * * 944 ********************************************************************************** 945 01DD7 00000000 946 LOADFACT VFD STORE current integer load factor 01DD8 00000000 947 SCALEDLF VFD STORE the raw (scaled) version of the load factor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 240 (COREDEFS) F 16 Resident Data Structure Definitions 949 950 ********************************************************************************** 951 * * 952 * PHYSICAL PAGE ELEMENTS (PPL) * 953 * Exactly one PPL exists for each swappable physical * 954 * page on the system. This element may be in: the chain of * 955 * available pages (PPIDLE), one of the chains of active pages * 956 * (PPAGELIST), or held by the mass storage driver during a * 957 * transfer in. Also, if a physical page is reserved for free * 958 * storage, the PPL is placed in a special holding area by the * 959 * free storage manager ( so that if the page is later * 960 * recombined, its PPL may be returned to the idle list ). * 961 * The PPAGELIST actually consists of multiple list heads * 962 * in order to reduce search time. A hash code on PPBLOCK * 963 * determines which list head is used. Due to the uniform * 964 * distribution and unsystematic use of block numbers, the * 965 * rightmost bits of PPBLOCK are used directly as the hash * 966 * code. * 967 * A copy of the file block identifier for the disk block * 968 * is kept associated with the PPL. FBIs for PPLs are always * 969 * accessed via the PPLWINDOW virtual page. Page map values * 970 * for pages containing PPL FBI's are kept in the PPLPFMAP * 971 * table. Each PPL has an index into this table (PPFBIBLK) in * 972 * which location the PM value for its FBI is kept. Another * 973 * field, PPFBIDISP is the displacement into the virtual page * 974 * of the first word of the FBI. PPLWINDOW is kept generally * 975 * unmapped. Access to it is acquired by first mapping in the * 976 * page. Interrupts must be off throughout access, as the * 977 * interrupt system is not smart enough to re-map this window * 978 * should it destroy it. Watch out for page fault interrupts! * 979 * The PPMODIFIED bit is set to indicate that this * 980 * physical page ( or its FBI ) has been altered. Implicitly, * 981 * the altered page must be written to mass storage. * 982 * The PPPUTADT bit indicates that this block is being * 983 * written to mass storage because it has been freed. After * 984 * the prior users MS data is safely destroyed (by this * 985 * write), the PPL is set to indicate that no MS block is * 986 * present. This is so that a subsequent zeropage request for * 987 * this block will not cause two main memory pages to be * 988 * images of the same MS block (this would be fatal!). * 989 * Afterwards, the block is made available in the ADT. We also * 990 * move this PPL to the head of the clean IDLE list (where it * 991 * will be used next). * 992 * The PPFWIP bit indicates that this page is being * 993 * forced out to Mass Storage, generally because of a * 994 * crashproofing requirement. This bit forces any new * 995 * reference to this page to wait for the forcewrite to * 996 * finish. * 997 * The PPBUSYWORD is incremented for each PAL that exists * 998 * and for each MSQ write element that exists. If this count * 999 * goes to zero on a dirty page, a MSQ write element is * 1000 * created. If this count goes to zero on a clean page, the * 1001 * PPL is moved to the IDLE list. * 1002 * * 1003 ********************************************************************************** 1004 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 241 (COREDEFS) F 16 Resident Data Structure Definitions 00000006 ABS 1005 LOGHASHTSZ EQU 6 number of bits used for hash 00000040 ABS 1006 HASHTSIZ EQU 2 POWER LOGHASHTSZ number of page table headers 00003460 BYTE 1007 PPHASHFLD BITS (32-LOGHASHTSZ):31 field in MS address which 1008 * is used for hashing 01DD9 00000000 1009 PPIDLOCK VFD STORE lock for idle lists (clean and used) 01DDA 00000000 1010 PPIDLCOUNT VFD STORE count of idle pages (clean and used) 01DDB 00000000 1011 PPLASTL VFD STORE last chain searched for used idle pages 1012 00000005 ABS 1013 LIDLHASHSZ EQU 5 number of bits used for hash 00000020 ABS 1014 IDLETBSZ EQU 2 POWER LIDLHASHSZ size of used idle tables 00003650 BYTE 1015 IDLHASHFLD BITS (32-LIDLHASHSZ):31 field in MS address used 1016 * for hashing 01DDC 00000000 1017 PPCLNIDLE VFD STORE list of 'clean' idle pages 00001DDD 1018 PPUSDIDLE BSS IDLETBSZ chain of 'used' idle pages 00001DFD 1019 PPENDIDLE BSS IDLETBSZ ends of 'used' idle page chains 1020 1021 * ( PPLs in PPIDLE ) 1022 01E1D 00000000 1023 PPLINIT VFD STORE list of PPLs generated for INITIAL and 1024 * INITPROC pages. These get added to the 1025 * clean idle list after INITPROC has run. 1026 01E1E 00000000 1027 PPERRLOCK VFD STORE lock used for the following list 01E1F 00000000 1028 PPERRLIST VFD STORE list of "retired" pages (usually due 1029 * to parity errors) PPLs 01E20 00000000 1030 PPERRCOUNT VFD 0+STORE count of retired pages 1031 00001E21 1032 PPAGELOCK BSS HASHTSIZ locks for PPAGE lists 00001E61 1033 PPAGELIST BSS HASHTSIZ chain of physical pages 1034 1035 1036 NOLIST CREF 00130000 4 REG 1037 PPL EQU R4 pointer to PPAGE element 1038 LIST CREF 00001EA1 1039 PPAGEPROT BASE PPL PHYSICAL PAGE ELEMENT 1040 BSSB 2 for readability 000904A0 4 ZBM 1041 PPFBIDISP BSSB WPP LOG 2 displacement part of FBI location 00091810 4 ZBM 1042 DUALWPPL BSSB 1 indicates second PPL in dualwrite 1043 BSSB 2 for readability 00091F10 4 ZBM 1044 PPLINK BSSB ADDRESS link to next element 1045 00170801 4 BASE 1046 PPBLOCK BSS 1 drive and MS block number 1047 00170802 4 BASE 1048 PPBUSYWORD BSS 1 count of page access elements pointing here 00090052 4 ZBM 1049 PPCNTL EQU PPBUSYWORD/BITS 0:4 control field 00090012 4 ZBM 1050 PPMODIFIED EQU PPCNTL/BIT 27 page modified flag 00090212 4 ZBM 1051 PPDISKERR EQU PPCNTL/BIT 28 on if mass storage error reading in block 00090412 4 ZBM 1052 PPPUTADT EQU PPCNTL/BIT 29 when page is written out, MS driver 1053 * should place block into ADT and 1054 * prevent block from being found resident. 00090612 4 ZBM 1055 PPFWIP EQU PPCNTL/BIT 30 indicates a force write is in progress 00090812 4 ZBM 1056 PPMEMERR EQU PPCNTL/BIT 31 a parity error has occurred on this page 00090C62 4 ZBM 1057 PPFBIBLK EQU PPBUSYWORD/BITS 6:11 index into PPLPFMAP for FBI 00001E10 BYTE 1058 PPBSYHIBIT EQU BIT 15 highest bit still in the count field 1059 * the busy count is tested with a JZA 1060 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 242 (COREDEFS) F 16 Resident Data Structure Definitions 00170803 4 BASE 1061 PPPMVALUE BSS 1 page map value, always read/write here 1062 * the copy of this value that 1063 * goes into a PAL will be made 1064 * read-only there if needed. 1065 DRCT 00000004 ABS 1066 PPLNTH EQU DISPW PPAGEPROT length of a PPAGE element 00000002 ABS 1067 PPLOG EQU PPLNTH LOG 2 1068 ORG PPAGEPROT 1069 1070 ********************************************************************************** 1071 * * 1072 * PPFB elements. * 1073 * For a few special cases, a PPL and a corresponding FBI * 1074 * are placed into a single block of free storage. This * 1075 * definition serves to format a block of this form. * 1076 * * 1077 ********************************************************************************** 1078 00001EA1 1079 PPFBPROTO BASE PPL 1080 BSS PPLNTH allot room for the PPL 00170804 4 BASE 1081 PPFBFBI BSS FBILNTH and room for the FBI 1082 DRCT 0000000F ABS 1083 PPFBLNTH EQU DISPW PPFBPROTO length of the element 00000004 ABS 1084 PPFBLOG EQU PPFBLNTH LOG 2 1085 ORG PPFBPROTO 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 243 (COREDEFS) F 16 Resident Data Structure Definitions 1087 1088 ********************************************************************************** 1089 * * 1090 * For doing system load testing pages are sometimes * 1091 * taken out of service from the system. We keep track of * 1092 * these pages on the TAKELIST. TAKENUM is set to indicate the * 1093 * number of pages we want removed from the system, and * 1094 * TAKECOUNT is the number actually removed. The dispatcher * 1095 * checks to see if these are equal and if not will do what * 1096 * ever is necessary to make them equal. * 1097 * * 1098 ********************************************************************************** 1099 01EA1 00000000 1100 TAKELOCK VFD STORE lock for the following list 01EA2 00000000 1101 TAKELIST VFD STORE list of pages taken from system 01EA3 00000000 1102 TAKENUM VFD STORE number of pages requested to be taken 01EA4 00000000 1103 TAKECOUNT VFD STORE number of pages actually taken 1104 00000014 ABS 1105 TAKEFUDGE EQU 20 number of extra pages needed beyond 1106 * the amount used by the system and 1107 * a set amount for each user 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 244 (COREDEFS) F 16 Resident Data Structure Definitions 1109 ********************************************************************************** 1110 * * 1111 * Session Name/Number Table * 1112 * This table associates server names (like "!SPOOLER") * 1113 * with session numbers. It is manipulated with the * 1114 * URGETPNUM, ORSETPNUM and ORCLRPNUM requests. * 1115 * * 1116 ********************************************************************************** 1117 01EA5 00000000 1118 PNAMELOCK VFD STORE lock for this list (LOCKLIST & SRCHLIST) 01EA6 00000000 1119 PNAMELIST VFD STORE root for this list 1120 00001EA7 1121 PNAMEPROT BASE R0 one for each server name 00160800 0 BASE 1122 PNAMELINK BSS 1 link to next PNAME element 00160801 0 BASE 1123 PNAMEPROC BSS 1 session number responsible for this entry 00160802 0 BASE 1124 PNAMELEN BSS 1 length of the following name 00000028 ABS 1125 PNAMEMAXLN EQU 40 maximum name length 0016000C 0 CACH 1126 PNAMENAME BSSC PNAMEMAXLN the actual name 1127 DRCT 00000004 ABS 1128 PNAMELOG EQU (DISPW PNAMEPROT) LOG 2 log size of this block 1129 ORG PNAMEPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 245 (COREDEFS) F 16 Resident Data Structure Definitions 1131 1132 ********************************************************************************** 1133 * * 1134 * Operator Message List * 1135 * The following list describes the pending messages to * 1136 * the operator. These can be automatically generated by the * 1137 * system (eg, for device not ready errors) or by XREQs. The * 1138 * first 10 characters of each message will be displayed in * 1139 * the front panel lights and the rest is available for output * 1140 * to the operator via an XREQ. * 1141 * Each message has a unique serial number (assigned * 1142 * sequentially from 1 after boot) which is never re-used. * 1143 * The serial number is needed to cancel a message. * 1144 * * 1145 ********************************************************************************** 1146 01EA7 00000000 1147 OPMSGLOCK VFD STORE lock for the operator message list 01EA8 00000000 1148 OPMSGLIST VFD STORE head of the list 1149 00001EA9 1150 OPMSGPROTO BASE R0 prototype of message 00160800 0 BASE 1151 OPMSGWORDA BSS 0 word label for beginning 00080010 0 ZBM 1152 OPMSGHORN BSSB 1 sound horn when displaying this message 000802E0 0 ZBM 1153 OPMSGPROC BSSB 14 session originating message 00081F10 0 ZBM 1154 OPMSGLINK BSSB ADDRESS link to next element 00080181 0 ZBM 1155 OPMSGID BSSB 24 message serial number 00160007 0 CACH 1156 OPMSGLEN BSSB 8 length of this message 00160802 0 BASE 1157 OPMSGTEXT LABEL 00160008 0 CACH 1158 OPMSGTEXTC BSSC 0 1159 BSS 32-(DISPW OPMSGWORDA) room for message text 00000077 ABS 1160 OPMSGMAXLN EQU (DISPC OPMSGTEXT)-1 max message length, 1161 * with room for final null 1162 DRCT 00000005 ABS 1163 OPMSGLOG EQU (DISPW OPMSGPROTO) LOG 2 log size of block 1164 ORG OPMSGPROTO recover lost space 1165 01EA9 00000000 1166 OPMSGSER VFD STORE last serial number assigned 01EAA 00000000 1167 OPMSGDISP VFD STORE serial number of message being displayed 1168 * (zero if normal display) 24 INPUT VIRTCOREDEFS virtual system in-core structure definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 246 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 3 4 ********************************************************************************** 5 * * 6 * USER LIMIT LIST * 7 * This list contains the limits for accounts that are in * 8 * use. When a file is referenced or an account is logged * 9 * onto the system its limit block is copied into a resident * 10 * ULB. This allows all usage of an account to be accounted * 11 * and limited by one copy of that accounts limits. * 12 * ULLOCK is incremented by one when someone is searching * 13 * the list and decremented once the searcher has incremented * 14 * the busy counter on his entry. The top bit of ULLOCK goes * 15 * on when someone wishes to modify the links of the list - * 16 * any new searchers must wait and the modifier must wait * 17 * until all searching is finished. * 18 * Note that ULLOCK locks all changing of the first word * 19 * of the ULB. A failure may occur if the first word is * 20 * changed without the lock held, even if the change is by a * 21 * RMW instruction. Especially note the individual bits in * 22 * the upper part of the word. * 23 * The ULLIMITS part of this block is a bit by bit copy * 24 * of the UDLIMITS area in the directory corresponding to this * 25 * entry. Whenever one wants to update any of these fields in * 26 * the ULB they should hold the lock ULLIMLOCK. For whole word * 27 * entries RMW instructions will be sufficient. Note that * 28 * some of these fields are cleared with a STZ, this is not a * 29 * RMW instruction. Since the limits are not critical fields * 30 * ( not likely to cause a system crash ) this is an * 31 * acceptable risk. * 32 * * 33 ********************************************************************************** 34 01EAB 00000000 35 ULLIST VFD FLDADRS*STORE root of user limit list 01EAC 00000000 36 ULLOCK VFD STORE lock word for user limit list 01EAD 00000000 37 DIRLOCKING VFD STORE in the process of locking or unlocking a ULB 01EAE 00000000 38 SYSTEMULB VFD FLDADRS*STORE pointer to system overhead ULB 01EAF 00000000 39 ULLIMLOCK VFD STORE lock for updating ULB limits 40 41 NOLIST CREF 00130000 4 REG 42 ULB EQU R4 43 LIST CREF 00001EB0 44 USERLIMITS BASE ULB USER LIMITS BLOCK 00170800 4 BASE 45 ULWORDA BSS 1 00090010 4 ZBM 46 ULSHADOW EQU ULWORDA/BIT 0 on if account is a shadow 00090210 4 ZBM 47 ULFOREIGN EQU ULWORDA/BIT 1 on if account volume is foreign 00090410 4 ZBM 48 ULRAFDIR EQU ULWORDA/BIT 2 1 sez directory is two level indexed 00090610 4 ZBM 49 ULNOTHERE EQU ULWORDA/BIT 3 on if ULB is only partially here 50 * ( being destroyed ) 10000000 ABS 51 ULNOTHING EQU 1*BIT 3 to set above bit 000908B0 4 ZBM 52 ULIDENT EQU ULWORDA/BITS 4:14 constant value identifying a ULB 00000765 ABS 53 ULIDVAL EQU 0765 value in ULIDENT (looks like xECA) 00091F10 4 ZBM 54 ULLINK EQU ULWORDA/FLDADRS pointer to next limit block 00170801 4 BASE 55 ULBLOCK BSS 1 MS address of directory 00090081 4 ZBM 56 ULDRIVE EQU ULBLOCK/VOLFIELD drive dir. on 00091181 4 ZBM 57 ULMSBLK EQU ULBLOCK/MSBLKFIELD drive address of dir. 00170802 4 BASE 58 ULACCNM BSS2 1 programmer name of account 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 247 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 00170804 4 BASE 59 ULACCPROJ BSS 1 division-project of account 60 * NOTE: CAUTION, HAZARD, DANGER, DANGER. The following 61 * word may not be modified at any time, in any way shape 62 * or form, by any operation that is not a RMW. No 63 * ZBMs will do. 00170805 4 BASE 64 ULBUSYWORD BSS 1 80000000 ABS 65 ULBLOCKING EQU 1*BIT 0 bit set in busy word to indicate dir in use 66 * The following symbol may only be used to examine 67 * the current count. It may not be modified. 00091F15 4 ZBM 68 ULBUSYCTR EQU ULBUSYWORD/FLDADRS count of people using this ULB 69 * UDLIMITS -- copy of directory information 00170806 4 BASE 70 ULLIMITS BSS LIMITSIZE user limits 00170806 4 BASE 71 ULRWORD EQU ULLIMITS/RESTRWORD restrictions word 00090816 4 ZBM 72 ULRSTRG1 EQU ULRWORD/XREQRSTR/BIT 31 00090616 4 ZBM 73 ULRSTRG2 EQU ULRWORD/XREQRSTR/BIT 30 00090416 4 ZBM 74 ULRSTRG3 EQU ULRWORD/XREQRSTR/BIT 29 00090216 4 ZBM 75 ULRSTRG4 EQU ULRWORD/XREQRSTR/BIT 28 00090016 4 ZBM 76 ULRSTRG5 EQU ULRWORD/XREQRSTR/BIT 27 00170807 4 BASE 77 ULPWORD EQU ULLIMITS/PRIVWORD privilege word 00090047 4 ZBM 78 ULFACCESS EQU ULPWORD/LIMFACCESS file access control 00090847 4 ZBM 79 ULPACCESS EQU ULPWORD/LIMPACCESS password access control 00091A57 4 ZBM 80 ULLOGSPOT EQU ULPWORD/LIMLOGSPOT where to write accounting info 00170808 4 BASE 81 ULTIMLIM EQU ULLIMITS/TIMLIM time limit ( in seconds ) 00170809 4 BASE 82 ULTIMUSD EQU ULLIMITS/TIMUSD time used ( in seconds ) 0017080A 4 BASE 83 ULWLCKLIM EQU ULLIMITS/WLCKLIM wall clock limit ( in minutes ) 0017080B 4 BASE 84 ULWLCKUSD EQU ULLIMITS/WLCKUSD wall clock time used ( in minutes ) 0009018C 4 ZBM 85 ULDSKSAVL EQU ULLIMITS/DSKSAVL saved disk blocks limit 0009318C 4 ZBM 86 ULDSKWARN EQU ULLIMITS/DSKWARN disk block warning limit 0009218D 4 ZBM 87 ULDSKLIM EQU ULLIMITS/DSKLIM disk block hard limit 0009118E 4 ZBM 88 ULDSKUSD EQU ULLIMITS/DSKUSD disk blocks used 89 * end of copy of directory information 0017080F 4 BASE 90 ULSCRDSK BSS 1 scratch disk space 91 DRCT 00000004 ABS 92 ULLOG EQU (DISP USERLIMITS) LOG 2 length of limit block 93 ORG USERLIMITS 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 248 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 95 96 ********************************************************************************** 97 * * 98 * PROCESS CONTROL BLOCK * 99 * One PCB is associated with each session. This block * 100 * holds the suspension information for a process. The reason * 101 * these exist and the information is not just kept in the PSA * 102 * is that it is planned that someday the PSA would be in * 103 * virtual memory and that the PCBs would be the only * 104 * guaranteed resident part of a user. Thus it holds his * 105 * running/suspended information. * 106 * The first three words of this list element are locked * 107 * by the lock word for the SQ. The remainder is locked by * 108 * PCNTLLOCK. * 109 * * 110 ********************************************************************************** 111 01EB0 00000000 112 PCCOUNT VFD STORE number of entries in PCONTROL list 01EB1 00000000 113 PCONTROL VFD FLDADRS*STORE list of process control blocks 114 * non-standard links 01EB2 00000000 115 PCNTLLOCK VFD STORE lock for above and PCNUMARRAY 116 * incremented when searching, 117 * sign on when changing 01EB3 00481EB4 118 PPCNUMARR PTR PCNUMARRAY/BIT 0 bit pointer to pnum array 01EB4 7FFFFFFF 119 PCNUMARRAY VFD 07FFFFFFF array of available process numbers 01EB6 FFFFFFFF 120 VFD -1,-1 (0 is not available) 01EB8 FFFFFFFF 121 VFD -1,-1 ARRAY SIZE MUST BE POWER OF TWO, 01EBA FFFFFFFF 122 VFD -1,-1 GREATER THAN TWO (for FINDSESSNM 01EBC FFFFFFFF 123 VFD -1,-1 to work) 01EBE FFFFFFFF 124 VFD -1,-1 array is locked by PCNTLLOCK 01EC0 FFFFFFFF 125 VFD -1,-1 01EC2 FFFFFFFF 126 VFD -1,-1 01EC3 FFFFFFFF 127 VFD -1 16 words = 511 possible numbers 00000010 ABS 128 PCNUMARRSZ EQU DISPW PCNUMARRAY size of table 129 00130000 4 REG 130 PCB EQU R4 00001EC4 131 PCBPROT BASE PCB 00170000 4 CACH 132 PCQPARM2 BSSB 8 extra reason field for shutdown 00091010 4 ZBM 133 PCQCLNMARK BSSB 1 marker used by WHICHHUNT 00091260 4 ZBM 134 PCQUEUE BSSB 6 'name' of queue this session is in 00091F10 4 ZBM 135 PCQLINK BSSB ADDRESS link in queue 00170801 4 BASE 136 PCQPARM BSS 2 reason that user is in this queue 137 138 * Above locked by SQLOCKS, below by PCNTLLOCK 139 0000000C ABS 140 PROCNUMSIZ EQU 12 size of session number in bits 141 * ( may have 4096 sessions ) 00001000 ABS 142 MAXPROCNUM EQU 2 POWER PROCNUMSIZ highest session number (+1) 000900C3 4 ZBM 143 PCPROCNUM BSSB PROCNUMSIZ identifying session number 00091813 4 ZBM 144 PCSYSPROC BSSB 1 one sez this is a system process 00091A13 4 ZBM 145 PCSPECPROC BSSB 1 this guy is special (not an ALL for the OPR) 146 BSSB 1 filler to make things easier to read 00091F13 4 ZBM 147 PCPSADRS BSSB ADDRESS pointer to associated PSA 000900C4 4 ZBM 148 PCPARENT BSSB PROCNUMSIZ session number of parent session 149 BSSB 3 filler to make things readable 00091F14 4 ZBM 150 PCNXTCB BSSB ADDRESS pointer to next PCB 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 249 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 00170805 4 BASE 151 PCBSITE BSS 2 site name for this session 152 153 DRCT 00000007 DISP 154 PCBLNTH EQU DISP PCBPROT length of a PCB 00000003 ABS 155 PCBLOG EQU PCBLNTH LOG 2 size for memory routines 156 ORG PCBPROT reclaim lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 250 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 158 159 ********************************************************************************** 160 * * 161 * VIRTUAL TABLES * 162 * * 163 ********************************************************************************** 164 165 ********************************************************************************** 166 * * 167 * PROCESS STATUS AREA * 168 * A PSA is created for each user session. It contains * 169 * the chain heads for all of the lists associated with the * 170 * session, pointers to other items associated with the * 171 * session, and any other miscellaneous items required. * 172 * * 173 * PSLOCK and foreign access to a PSA. * 174 * * 175 * A PSA may be safely accessed by either the process * 176 * that is running from that PSA or by a properly cautious * 177 * process via the PCB list. These cases are explained * 178 * separately: * 179 * * 180 * 1) The session data structures are designed to allow free access to * 181 * the process running out of the PSA. That is, nearly no locking * 182 * is required to diddle the structures. The only exceptions being, * 183 * creation, destruction, and modification of those structures that * 184 * are required by the asynchronous interrupts. * 185 * Creation: since access is gained to the PSA via its PCB, a * 186 * session is created by building the PSA and all associated * 187 * tables and then lastly placing the PCB into the PCB list. * 188 * Destruction: since someone could be looking at the PSA while * 189 * it is being destroyed, the PCB is first removed from its * 190 * list and the destroyer waits until PSLOCK is unlocked. * 191 * That is, the session is removed so no one else may find it * 192 * and then you wait until all of the lookers are gone. * 193 * Session data structure examination: the process running from * 194 * the PSA may examine any data structure associated with that * 195 * PSA without any locking since only that process modifies * 196 * the structures and any transient modifiers only add to * 197 * the ends of lists. The exceptions to this are the UPCVASP * 198 * and UPCWSX lists that may be altered by the core scheduler * 199 * on any interrupt. Examination and/or modification of * 200 * these lists may only occur in the resident system with the * 201 * interrupts off. * 202 * Session data structure modification: the process running * 203 * from the PSA may modify list links freely except for the * 204 * following lists that require that PSLOCK be locked: * 205 * PSUERROR, PSGIFTUNIT * 206 * In general, though, all lists should be added to and deleted * 207 * from "cleanly". That is, at every instant the list should * 208 * be searchable. * 209 * NOTE: An interlocking problem exists in relation to * 210 * PSDFLTDIR. The current UPC (PSCURRPROC) may change * 211 * this pointer (in FRALIAS and ORBYE) and call FREEULB * 212 * or FREEULBC. If this is the only user of the ULB, * 213 * the ULB space is freed. Another session doing a * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 251 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 214 * URSESSINFO or ORSESSINFO request against this session * 215 * may get a 'bad ULB' halt (HALT10E1) if it (in STATPI) * 216 * grabs the ULB being freed. A semaphore is impossible * 217 * since it would have to to be locked (IOFF) across the * 218 * FREEULB or FREEULBC, but the latter subroutines may * 219 * result in a page fault. We settle for minimizing the * 220 * critical region by expanding, slightly, the time * 221 * between changing the pointer and freeing the ULB. * 222 * * 223 * * 224 * 2) For the posting of asynchronous events, one process is required * 225 * to examine and add entries to another session's PSA lists. * 226 * The PSA is found via its PCB so, to protect the looker from * 227 * having the PSA destroyed out from under it, either the PCB * 228 * list should be locked (so that it and its PSA cannot be * 229 * removed) or the wait queue that it's in should be locked * 230 * (so that the process cannot run to destroy itself) until * 231 * PSLOCK is locked. For a foreign looker, PSLOCK must * 232 * be locked to either look at or to modify anything in * 233 * the PSA. The only foreign accessors are * 234 * those that are either posting an event interrupt or * 235 * examining the current interrupt mask to see if it should * 236 * post one. These examine the registers in the console area (the * 237 * "bottom most" one) or add to the error list. * 238 * * 239 ********************************************************************************** 240 00001EC4 241 PSAPROT BASE R2 PROGRAM STATUS AREA 00088010 2 ZBM 242 PSWAITED BSSB 1 1 sez job released from wait queue 243 (SQLOCKWAIT or SQFILEWAIT) 244 * scheduling variables 00088230 2 ZBM 245 PSLOCKCNTR BSSB 3 count for each resource locked 246 BSSB 8 filler 00089830 2 ZBM 247 PSPRIORITY BSSB 3 priority for this session 248 * 0 is highest priority, 7 least valuable 00089F10 2 ZBM 249 PSCACHN BSSB ADDRESS pntr to chain of console areas 250 00168004 2 CACH 251 PSGRACE BSSB 8 grace for ex-trouble-makers 00089071 2 ZBM 252 PSPFFREQ BSSB 7 disk xfers frequency parameter 00089F11 2 ZBM 253 PSCACHNP1 BSSB ADDRESS pntr to 2nd console area in chain 254 000880F2 2 ZBM 255 PSWSSIZE BSSB 15 working set size (oversized) 00089F12 2 ZBM 256 PSPROCCB BSSB ADDRESS pntr to process control block 257 00088043 2 ZBM 258 PSOURCPU BSSB 4 CPU that we want to run on (0=>don't care) 000888B3 2 ZBM 259 PSLGFSESS BSSB 11 session to send logoff message to 00089F13 2 ZBM 260 PSUSERLIMP BSSB ADDRESS pntr to user limit block (logged on) 261 00088044 2 ZBM 262 PSDDIRPRIV BSSB 4 privilege to access default dir. 00088854 2 ZBM 263 PSPRIVMASK BSSB 5 bits for current restrictions enforced 264 * by user, same bits as UPCPRIV 00089214 2 ZBM 265 PSCNTLMODE BSSB 1 bit indicating current UPC is CM 00089414 2 ZBM 266 PSENDRUN BSSB 1 says to put guy at end of SQRUNNABLE 267 BSSB 4 filler 00089F14 2 ZBM 268 PSDFLTDIR BSSB ADDRESS pntr to ULB of directory used as default (alias) 269 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 252 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 270 BSSB 15 filler 00089F15 2 ZBM 271 PSPROCLIST BSSB ADDRESS ptr to all UPC blocks 272 00088116 2 ZBM 273 PSCURRPROC BSSB ADDRESS ptr to current UPC block 0008A316 2 ZBM 274 PSUNITS BSSB ADDRESS list of global UCEs for this session 275 BSSB 13 filler 00089F17 2 ZBM 276 PSFCBLIST BSSB ADDRESS list of all FCBs for this session 277 00168808 2 BASE 278 EVENTLOCK BSS 1 event lock for URDELAY and GIVEUINT 279 00168809 2 BASE 280 PSGIFTUNIT BSS 1 list of gift units 281 BSS 0 the following words are not implicitly interlocked 0008810A 2 ZBM 282 PSSUMCPU BSSB 16 sum of CPU time used 0008A10A 2 ZBM 283 PSSUMSDT BSSB 16 sum of shut down time 0000FFFF ABS 284 PSSUMMAX EQU (2 POWER 16)-1 max possible value for above fields. 0008810B 2 ZBM 285 PSLASTQUAN BSSB 16 size of last quantum 0016880C 2 BASE 286 PSLOCK BSS 1 lock controlling foreign access 287 * to these fields: PSUERROR, PSGIFTUNIT 0016880D 2 BASE 288 PSUERROR BSS 1 list of pending user error codes 289 * error list locked by PSLOCK 290 * Following fields define the format of both PSUERROR and UPCUERROR, 291 * the 'root' words of the user error lists for the session and for 292 * individual underprocesses. Some fields are not used by both, and 293 * the non-user should leave such fields 0. 00001610 BYTE 294 RTVMFISRB EQU BIT 11 on if session should get UINTVMFISR 00001810 BYTE 295 RTSTOPB EQU BIT 12 on if session is to go to STOPWAIT 00001A10 BYTE 296 RTSWITCHB EQU BIT 13 on if to switch this session out 00001C10 BYTE 297 RTVERYBADB EQU BIT 14 1 sez a monitor interruptable condition in list 00001750 BYTE 298 RTUERRORZ EQU RTVMFISRB+RTSTOPB+RTSWITCHB+RTVERYBADB+FLDADRS 299 0016880E 2 BASE 300 PSSHUTTIME BSS 1 time of last shutdown 0016880F 2 BASE 301 PSQUANTPTR BSS 1 serial number of quantum timer element 00168810 2 BASE 302 PSTIMEUSED BSS 1 cpu time used ( in ms. ) 00168811 2 BASE 303 PSTIMLIM BSS 1 limit for PSTIMEUSED ( in ms. ) 00168812 2 BASE 304 PSSESUSD BSS 1 session output blocks created 00168813 2 BASE 305 PSSESLIM BSS 1 session output blocks limit 00168814 2 BASE 306 PSSESMAX BSS 1 session output blocks maximum (high water mark) 00168815 2 BASE 307 PSHELDATE BSS2 1 wall clock time of hello 00168817 2 BASE 308 PSOPMSGID BSS 1 id of most recent message to operator 00168818 2 BASE 309 PSMSGALLOW BSS 1 mask for message classes allowed 00168819 2 BASE 310 PSMSGINT BSS 1 mask for msg classes causing interrupt 0016881A 2 BASE 311 PSMSGLIST BSS 1 list of pending messages 0016881B 2 BASE 312 PSMAPVALS BSS MAXMAPVALS PM values for free storage pages, 313 * defined with page file definintions. 314 DRCT 00000005 ABS 315 PSLOG EQU (DISPW PSAPROT) LOG 2 length of PSA 316 ORG PSAPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 253 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 318 319 ********************************************************************************** 320 * * 321 * Temporary area used in the processing of file name * 322 * parameters. * 323 * * 324 ********************************************************************************** 325 326 NOLIST CREF 00134000 5 REG 327 EQT EQU R5 328 LIST CREF 00001EC4 329 EQTEMPPROT BASE EQT 00174800 5 BASE 330 EQWORDA BSS 1 00094010 5 ZBM 331 CNTLPKFLG EQU EQWORDA/BIT 0 on if control chars to pack as letters 00174801 5 BASE 332 EQVOLUME BSS2 1 volume name 00174803 5 BASE 333 EQSYSTEM BSS 1 system name 00174804 5 BASE 334 EQVOLPW BSS2 1 password (not used as yet) 00000005 ABS 335 EQELSIZE EQU DISPW EQVOLUME words in each part 00174806 5 BASE 336 EQACCT BSS2 1 account name 00174808 5 BASE 337 EQACCTPROJ BSS 1 account project 00174809 5 BASE 338 EQACCTPW BSS2 1 account directory password 0017480B 5 BASE 339 EQFILENM BSS2 1 filename 0017480D 5 BASE 340 EQFILEEXT BSS 1 file name extension 0017480E 5 BASE 341 EQFILEPW BSS2 1 file access password 342 DRCT 00000004 ABS 343 EQTEMPLOG EQU (DISPW EQTEMPPROT) LOG 2 344 ORG EQTEMPPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 254 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 346 347 ********************************************************************************** 348 * * 349 * GLOBAL FILE CONTROL BLOCK * 350 * All files opened for multiple write get a global file * 351 * control block to coordinate the actions between users. The * 352 * GFCs are kept in a linked list which must be locked * 353 * whenever searching for an element in the list. A pointer * 354 * to a GFC is kept in the FCB of any unit opened to a MW * 355 * file. * 356 * * 357 ********************************************************************************** 358 01EC4 00000000 359 GFCLIST VFD STORE linked list of GFCs 01EC5 00000000 360 GFCLOCK VFD STORE lock for the above list 361 00001EC6 362 GFCPROT BASE R3 0008C0F0 3 ZBM 363 GFUSECNT BSSB 15 count of users using this file 0008DF10 3 ZBM 364 GFLINK BSSB ADDRESS link to next GFC in the list 365 0008C021 3 ZBM 366 GFRAFTYPE BSSB 2 type of RAF 367 * 0 -> empty RAF 368 * 1 -> tiny RAF 369 * 2 -> small RAF 370 * 3 -> large RAF 371 BSSB 30 filler 372 0016C802 3 BASE 373 GFBLOCK BSS 1 root block of the file 0008C082 3 ZBM 374 GFVOL EQU GFBLOCK/VOLFIELD volume number portion of MS address 0008D182 3 ZBM 375 GFMSBLK EQU GFBLOCK/MSBLKFIELD actual block number 376 0016C803 3 BASE 377 GFFSN BSS 2 file serial number 0008C083 3 ZBM 378 GFFSNVOL EQU GFFSN/VOLFIELD 379 0016C805 3 BASE 380 GFXPNDLOCK BSS 1 lock held whenever a user is expanding 381 * the file 382 DRCT 00000003 ABS 383 GFCLOG EQU (DISPW GFCPROT) LOG 2 384 ORG GFCPROT recover wasted space 385 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 255 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 387 388 ********************************************************************************** 389 * * 390 * PATH CONTROL BLOCK * 391 * All the .PATHs in the system have an element in the * 392 * below list. These elements contain the queue elements for * 393 * the messages in the queue and the count of how many readers * 394 * and writers there are currently. * 395 * * 396 ********************************************************************************** 397 01EC6 00000000 398 PATHLOCK VFD 0 search and modify lock for list 01EC7 00000000 399 PATHLIST VFD 0 list of PATH control blocks 400 00001EC8 401 PTHPROT BASE R0 .PATH control block 00160800 0 BASE 402 PTHWORDA BSS 1 00081F10 0 ZBM 403 PTHLINK EQU PTHWORDA/FLDADRS link to next control block 404 00160801 0 BASE 405 PTHWORDB BSS 1 00080011 0 ZBM 406 PTHRDR EQU PTHWORDB/BIT 0 on if a reader exists 00080211 0 ZBM 407 PTHUSED EQU PTHWORDB/BIT 1 on if path hookup was once complete 00080411 0 ZBM 408 PTHINTE EQU PTHWORDB/BIT 2 ints enabled by reader 000808B1 0 ZBM 409 PTHSIZE EQU PTHWORDB/BITS 4:14 words used for messages 00000200 ABS 410 MAXPATHCORE EQU 2 POWER 9 max core use for message buffers 00081F11 0 ZBM 411 PTHQUE EQU PTHWORDB/FLDADRS root of message queue 412 00080112 0 ZBM 413 PTHREADER BSSB ADDRESS => PCB of path reader 00082312 0 ZBM 414 PTHREADFCB BSSB ADDRESS FCB pointer for reader of path 415 BSSB 7 filler 00081373 0 ZBM 416 PTHEXCWR BSSB PSNFLDLN UPC PSN with exclusive write access 417 00160804 0 BASE 418 PTHID BSS 2 creation date of path (unique identifier) 00080084 0 ZBM 419 PTHVOL EQU PTHID(0)/BITS 0:7 volume path is from 000810C4 0 ZBM 420 PTHBUSY EQU PTHID(0)/BITS 8:19 number of people equipped to path 000828C4 0 ZBM 421 PTHIDTOP EQU PTHID(0)/BITS 20:31 top 12 bits of date code 422 00160806 0 BASE 423 PTHWRTRS BSS 1 number of writers using this 00160807 0 BASE 424 PTHLOCK BSS 1 locks WORDB through end 425 DRCT 00000008 ABS 426 PTHLNTH EQU DISPW PTHPROT 00000003 ABS 427 PTHLOG EQU PTHLNTH LOG 2 428 ORG PTHPROT 429 430 * Proto-type for path message queue elements 00001EC8 431 PTHEPROT BASE R0 00160800 0 BASE 432 PTHEWORDA BSS 1 000800B0 0 ZBM 433 PTHENCHARS EQU PTHEWORDA/BITS 0:10 number of characters in record 00081640 0 ZBM 434 PTHELOGL EQU PTHEWORDA/BITS 11:14 word length of block log 2 00081F10 0 ZBM 435 PTHELINK EQU PTHEWORDA/BITS 15:31 pointer to next record 00160004 0 CACH 436 PTHECHARB BSSC 1 00080011 0 ZBM 437 PTHECONTN EQU PTHECHARB/BIT 24 indicates continued record 00080271 0 ZBM 438 PTHERTYPE EQU PTHECHARB/BITS 25:31 record type 00000005 ABS 439 PTHEHDR EQU DISPC PTHEWORDA fixed header size, in characters 00160005 0 CACH 440 PTHECHARS BSSC 0 user record starts here 441 DRCT 442 ORG PTHEPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 256 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 443 000000FB ABS 444 MAXRECWR EQU 64*CPW-PTHEHDR longest chunk allowed in path queue 445 * (user record size to use 64 words) 446 447 ********************************************************************************** 448 * * 449 * The next three sections define the structures used to * 450 * implement locks on file resources. The general structure * 451 * is that DLOCKLIST holds the list of Lock Control Blocks * 452 * (LOKs). Each LOK holds a list of Resource Control Elements * 453 * (RCEs). Each RCE holds a list of Lock Identifiers. (LIDs). * 454 * The first word of LOK elements in DLOCKLIST are locked by * 455 * DLOCKLOCK. Everything else (rest of LOKs, RCEs, and LIDs) * 456 * are locked by LOKLOCK. * 457 * * 458 ********************************************************************************** 459 ********************************************************************************** 460 * * 461 * LOCK CONTROL BLOCK * 462 * One of these elements exists for each of the files for * 463 * which there is at least one resource in use. They are * 464 * created when a locking a resource of a file for which there * 465 * are no current resources. They are destroyed when * 466 * LOKRCELIST becomes empty. A lock bit is provided for * 467 * access to LOKRCELIST and any structure or data therein. * 468 * Processes that attempt to lock a resource already held by * 469 * someone else are suspended if either one wants/has write or * 470 * if someone else is already suspended waiting for that * 471 * resource. Waiting processes suspend in SQLOCKWAIT. The * 472 * shutdown parameter is the LOKSERIAL number with the * 473 * resource number plugged into LOCKRESFIELD of the first word * 474 * (a tight fit!). The "additional reason" field in the PCB * 475 * holds the type of access the guy wants. * 476 * * 477 ********************************************************************************** 478 01EC8 00000000 479 DLOCKLOCK VFD STORE search and modify lock for list 01EC9 00000000 480 DLOCKLIST VFD STORE list of LOK control blocks 000010C0 BYTE 481 LOCKRESFLD EQU BITS 8:19 extra bits in PCB to ID resource 482 00001ECA 483 LOKPROT BASE R0 lock control block 00160800 0 BASE 484 LOKLINK BSS 1 link to next LOK 00160801 0 BASE 485 LOKLOCK BSS 1 lock for sublists and data 00160802 0 BASE 486 LOKRCELIST BSS 1 full word pointer to resources 00160803 0 BASE 487 LOKRCECNT BSS 1 number of RCEs on this LOK 488 BSS 2 filler 00160806 0 BASE 489 LOKSERIAL BSS2 1 serial number of this file 00080086 0 ZBM 490 LOKVOL EQU LOKSERIAL/VOLFIELD volume that file is from 491 * (to catch duplicate serial numbers) 492 DRCT 00000008 ABS 493 LOKLNTH EQU DISPW LOKPROT length of an element 00000003 ABS 494 LOKLOG EQU LOKLNTH LOG 2 log length for GETMEM 495 ORG LOKPROT recover lost space 496 497 ********************************************************************************** 498 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 257 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 499 * RESOURCE CONTROL ELEMENT * 500 * Each of these elements holds the list of users for a * 501 * particular "resource" from the file. They are created when * 502 * locking a resource for which there are no users. They are * 503 * destroyed when RCELIDLIST becomes empty. They can only be * 504 * accessed when the corresponding LOK element is locked. * 505 * * 506 ********************************************************************************** 507 00001ECA 508 RCEPROT BASE R0 resource control element 00160800 0 BASE 509 RCELINK BSS 1 link to next RCE 00160801 0 BASE 510 RCERESRCE BSS 1 resource number 511 BSS 1 filler 00160803 0 BASE 512 RCELIDLIST BSS 1 full word list head for users 513 DRCT 00000002 ABS 514 RCELOG EQU (DISP RCEPROT) LOG 2 515 ORG RCEPROT 516 517 ********************************************************************************** 518 * * 519 * LOCK IDENTIFIER * 520 * These elements identify a resource user. The * 521 * existence of one of these elements on the RCE list * 522 * signifies that the named session currently locks the * 523 * resource. LIDs are created and destroyed as the user locks * 524 * and unlocks the resource . LIDFCB identifies the logical * 525 * unit which was used to lock the file. When that unit is * 526 * closed all LIDs associated with it are destroyed. * 527 * LIDREADING indicates whether the lock is for reading * 528 * access. * 529 * * 530 ********************************************************************************** 531 00001ECA 532 LIDPROT BASE R0 Lock IDentifier 00080010 0 ZBM 533 LIDREADING BSSB 1 1 says for read access, 0 for write 534 BSSB 14 filler 00081F10 0 ZBM 535 LIDLINK BSSB ADDRESS link to next LID 00160801 0 BASE 536 LIDTAG LABEL labels word identifying user 000800C1 0 ZBM 537 LIDSESSION BSSB PROCNUMSIZ session number of user 538 BSSB WORDLNTH-ADDRESS-PROCNUMSIZ filler for readability 00081F11 0 ZBM 539 LIDFCB BSSB ADDRESS users unit used to lock 540 DRCT 00000001 ABS 541 LIDLOG EQU (DISP LIDPROT) LOG 2 542 ORG LIDPROT 543 544 ********************************************************************************** 545 * * 546 * USER ERROR ENTRY * 547 * One of these blocks get associated with the user * 548 * whenever an error occurs requiring a User Interrupt or * 549 * an entry to Control Mode. Elements specific to a UPC * 550 * (e.g. instruction failure) go on the UPC, all others * 551 * go on the PSA. The lists are maintained FIFO, except * 552 * that "serious" errors leap to the front. They are * 553 * checked whenever the session is associated with a CPU * 554 * that is passing through the dispatcher. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 258 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 555 * In addition to an error code and subcode, each * 556 * element has a modest control field to help us internally. * 557 * The 'Control Mode error' flag indicates whether the error * 558 * is directed toward the Control Mode process (e.g. Evict). * 559 * The 'very bad' flag indicates whether the error is * 560 * particularly serious. These errors are processed ahead * 561 * of all others in the list, and can not be "held off". * 562 * Also, they are the only errors that are processed even * 563 * if the process is in monitor state. The 'skip debug' * 564 * flag says whether the error was explicitly generated by * 565 * a debugger and so should not be given back to that * 566 * debugger. * 567 * * 568 ********************************************************************************** 569 00001ECA 570 UERPROT BASE R0 00160800 0 BASE 571 UERWORDA BSS 1 000800D0 0 ZBM 572 UERCODEZ EQU UERWORDA/BITS 0:12 control bits and code 00002610 BYTE 573 CMERRB EQU BIT 19 sez error is destined for CM 00001000 ABS 574 CMERR EQU 1*CMERRB 00002810 BYTE 575 VERYBADB EQU BIT 20 sez error is serious 00000800 ABS 576 VERYBAD EQU 1*VERYBADB 00002A10 BYTE 577 SKIPDEBUGB EQU BIT 21 sez miss debugger on pass up 00002CA0 BYTE 578 CODEPART EQU BITS 22:31 error code itself 00080210 0 ZBM 579 UERVERYBAD EQU UERCODEZ/VERYBADB 00080410 0 ZBM 580 UERCSKIPDB EQU UERCODEZ/SKIPDEBUGB 000806A0 0 ZBM 581 UERCODE EQU UERCODEZ/CODEPART 00081F10 0 ZBM 582 UERLINK EQU UERWORDA/FLDADRS link to next error 00160801 0 BASE 583 UERPARAM BSS 1 extra information on error 584 DRCT 00000001 ABS 585 UERLOG EQU (DISP UERPROT) LOG 2 size of UER element 586 ORG UERPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 259 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 588 589 ********************************************************************************** 590 * * 591 * Message Queue Element * 592 * Each of these elements describes a message sent via * 593 * URSENDMSG. They are chained off of the PSA of the receiving * 594 * session in chronological order. All of the message lists * 595 * are locked by MSGLOCK. * 596 * * 597 ********************************************************************************** 598 01ECA 00000000 599 MSGLOCK VFD STORE lock for these lists - PLOCK and PUNLOCK 600 00001ECB 601 MQEPROT BASE R0 message queue element 00160800 0 BASE 602 MQESTART BSS 0 beginning of element 00080040 0 ZBM 603 MQELOGSIZ BSSB 4 log size of this block 000808B0 0 ZBM 604 MQELENGTH BSSB 11 length of message, in characters 00081F10 0 ZBM 605 MQELINK BSSB ADDRESS link to next message 606 00160801 0 BASE 607 MQEBUF BSS 0 start of message buffer 00080101 0 ZBM 608 MQEPROC BSSB 16 session number of sender 00082101 0 ZBM 609 MQECLASS BSSB 16 class of this message (0..31) 00160802 0 BASE 610 MQEPRIVS BSS 1 privileges asserted with this message 00000008 ABS 611 MQEHEADLEN EQU DISPC MQEBUF size of preceeding header 612 00000014 ABS 613 MQEACCTLEN EQU 20 number of characters in account name 0016000C 0 CACH 614 MQEACCT BSSC MQEACCTLEN privilege account of sender 00160020 0 CACH 615 MQETEXT BSSC 0 beginning of message text 616 00000200 ABS 617 MQEMAXCORE EQU WPP/2 maximum core occupied by all MQEs for 1 session 00000018 ABS 618 MQEOVHDLEN EQU (MQEBUF DISPC MQESTART)+MQEACCTLEN overhead on message length 000007E8 ABS 619 MQEMAXLEN EQU MQEMAXCORE*CPW-MQEOVHDLEN length of longest allowed message 620 621 DRCT 622 ORG MQEPROT 623 624 * Define message format for user buffer. 625 MSGDEFS LIST 625 ********************************************************************************** 625 * * 625 * Definition of messages sent by URSENDMSG and received * 625 * by URGETMSG. * 625 * * 625 ********************************************************************************** 625 00001ECB 625 MSGPROTO BASE R0 00080100 0 ZBM 625 MSGPROC BSSB 16 when sending: session number of receiver 625 * when receiving: session number of sender 00082100 0 ZBM 625 MSGCLASS BSSB 16 class number of this message (0..31) 00160801 0 BASE 625 MSGPRIVS BSS 1 privileges associated with this message 625 * (see below for format) 00160802 0 BASE 625 MSGSTEXT BSS 0 when sending: start of message text 00160008 0 CACH 625 MSGACCT BSSC 20 when receiving: account name of sender, 625 * in ASCII, padded with blanks, or blank 625 * if account name not given. 00160807 0 BASE 625 MSGRTEXT BSS 0 when receiving: start of message text 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 260 (VIRTCOREDEFS) F 17 Virtual System Data Structure Definitions 625 625 * Definition of bits MSGPRIVS: 625 00000010 BYTE 625 MSGPRIVID EQU BIT 0 Sender's Privilege Account name will be put into MSGACCT. 00000210 BYTE 625 MSGPRIVOS EQU BIT 1 Sender is the operating system. 00000410 BYTE 625 MSGPRIVLID EQU BIT 2 Sender's Logged On Account name will be put into MSGACCT. 00002810 BYTE 625 MSGPRIVCM EQU BIT 20 Sender is Control Mode 00002A10 BYTE 625 MSGPRIVNXO EQU BIT 21 Sender is NOT Execute Only. 00002C10 BYTE 625 MSGPRIVMGR EQU BIT 22 Sender can execute MANAGER requests. 00002E10 BYTE 625 MSGPRIVBKP EQU BIT 23 Sender can execute BACKUP requests. 00003010 BYTE 625 MSGPRIVMW EQU BIT 24 . . . MAINTENANCE WRITE requests. 00003210 BYTE 625 MSGPRIVMR EQU BIT 25 . . . MAINTENANCE READ requests. 00003410 BYTE 625 MSGPRIVOPR EQU BIT 26 . . . OPERATOR requests. 00003610 BYTE 625 MSGPRIVG5 EQU BIT 27 . . . GROUP 5 (currently unused) requests. 00003810 BYTE 625 MSGPRIVG4 EQU BIT 28 . . . GROUP 4 (message and batch) requests. 00003A10 BYTE 625 MSGPRIVG3 EQU BIT 29 . . . GROUP 3 (attribute change) requests. 00003C10 BYTE 625 MSGPRIVG2 EQU BIT 30 . . . GROUP 2 (catalog fetch) requests. 00003E10 BYTE 625 MSGPRIVG1 EQU BIT 31 . . . GROUP 1 (limit change) requests. 625 625 * Some message classes are pre defined (or at least usually used for...) 00000000 ABS 625 MSGCLSRESP EQU 0 response message 00000001 ABS 625 MSGCLSVERB EQU 1 verbal communication between users 00000002 ABS 625 MSGCLSOPR EQU 2 urgent communication from OPR 00000003 ABS 625 MSGCLSSPLR EQU 3 messages to the spooler 00000004 ABS 625 MSGCLSTERM EQU 4 concurrent session termination message 625 * EQU 5:15 reserved for BTI 625 * EQU 16:31 available to implementors 625 625 DRCT 625 ORG MSGPROTO recover lost space 25 INPUT USERCOREDEFS user in-core structure definitions 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 261 (USERCOREDEFS) F 18 User Data Structure Definitions 3 4 ********************************************************************************** 5 * * 6 * OVER/UNDER PROGRAM CONTROL * 7 * These blocks keep the variables that are associated * 8 * with a particular program ( memory, restrictions, * 9 * registers, ... etc ). Programs in a session are organized * 10 * as a tree with CM being at the top, with sons, * 11 * grandchildren, etc below it. * 12 * The PSA has one pointer to the tree head and another * 13 * pointer to the current program. Normally, there are only * 14 * two programs in any session: control mode at the top level * 15 * and the users program below it. A debugger may be inserted * 16 * between them. * 17 * A note on memory management. As discussed in the * 18 * scheduler notes, a PAL present in any UPC will prevent a * 19 * page from being removed from memory. However, a PAL does * 20 * not by itself make a volume busy. Therefore, PALs in the * 21 * working set must always be associated with a volume busy * 22 * count, otherwise the volume may be dismounted while pages * 23 * from it are still present in the PPAGE list. As a practical * 24 * matter, we must prevent any page that is part of the volume * 25 * structure (label, sec, idx) from being placed into the WSX * 26 * list. If a page is present and associated with any type of * 27 * file, it is okay to place it into the WSX. * 28 * * 29 ********************************************************************************** 30 00001ECB 31 UPCPROT BASE R0 00160800 0 BASE 32 UPCWORDA BSS 1 00081F10 0 ZBM 33 UPCSONPTR EQU UPCWORDA/FLDADRS pointer to son process 000800F0 0 ZBM 34 UPCPRIV EQU UPCWORDA/UPR15 35 00003E10 BYTE 36 UPRSTCTG1B EQU BIT 31 on if group 1 restrictions (limit change) 00003C10 BYTE 37 UPRSTCTG2B EQU BIT 30 on if group 2 restrictions (catalog fetch) 00003A10 BYTE 38 UPRSTCTG3B EQU BIT 29 on if group 3 restrictions (acct att. chng) 00003810 BYTE 39 UPRSTCTG4B EQU BIT 28 on if group 4 restrictions (unassigned) 00003610 BYTE 40 UPRSTCTG5B EQU BIT 27 on if group 5 restrictions (unassigned) 00003410 BYTE 41 UPOPREQB EQU BIT 26 on if operator requests restricted 00003210 BYTE 42 UPMAINTRB EQU BIT 25 on if maintenance read restricted 00003010 BYTE 43 UPMAINTWB EQU BIT 24 on if maintenance write restricted 00002E10 BYTE 44 UPBACKUPB EQU BIT 23 on if backup requests restricted 00002C10 BYTE 45 UPMANAGRB EQU BIT 22 on if manager requests restricted 00002A10 BYTE 46 UPEXECUTOB EQU BIT 21 on if address space is execute only 00002810 BYTE 47 UPCNTLMODB EQU BIT 20 on if in CONTROL MODE 000003E0 ABS 48 UPDFLTREST EQU 1*UPMANAGRB+1*UPMAINTWB+1*UPMAINTRB+1*UPBACKUPB+1*UPOPREQB 49 * default restrictions 50 00081C10 0 ZBM 51 UPRSTCTG1 EQU UPCPRIV/UPRSTCTG1B 00081A10 0 ZBM 52 UPRSTCTG2 EQU UPCPRIV/UPRSTCTG2B 00081810 0 ZBM 53 UPRSTCTG3 EQU UPCPRIV/UPRSTCTG3B 00081610 0 ZBM 54 UPRSTCTG4 EQU UPCPRIV/UPRSTCTG4B 00081410 0 ZBM 55 UPRSTCTG5 EQU UPCPRIV/UPRSTCTG5B 00081210 0 ZBM 56 UPOPREQ EQU UPCPRIV/UPOPREQB 00081010 0 ZBM 57 UPMAINTR EQU UPCPRIV/UPMAINTRB 00080E10 0 ZBM 58 UPMAINTW EQU UPCPRIV/UPMAINTWB 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 262 (USERCOREDEFS) F 18 User Data Structure Definitions 00080C10 0 ZBM 59 UPBACKUP EQU UPCPRIV/UPBACKUPB 00080A10 0 ZBM 60 UPMANAGR EQU UPCPRIV/UPMANAGRB 00080810 0 ZBM 61 UPEXECUTO EQU UPCPRIV/UPEXECUTOB 00080610 0 ZBM 62 UPCNTLMODE EQU UPCPRIV/UPCNTLMODB 63 00080041 0 ZBM 64 UPCTERMGRP BSSB 4 terminating character set 65 BSSB 3 filler 00080E11 0 ZBM 66 UPCIMDBUG BSSB 1 says whether prog thinks its debugging 00081011 0 ZBM 67 UPCNETINTE BSSB 1 non-empty term unit interrupt enable 00081371 0 ZBM 68 UPCSERNM BSSB PSNFLDLN underprocess serial number 69 BSSB 15 filler to make things easy to read 00081F12 0 ZBM 70 UPCCONSOLE BSSB ADDRESS => CCA at this level 71 BSSB 15 filler to make things easy to read 00081F13 0 ZBM 72 UPCPRIVULB BSSB ADDRESS => ULB giving privilege 000800F4 0 ZBM 73 UPCMAGEV BSSB 15 maximum age of PAL in VASP list 00081F14 0 ZBM 74 UPCRUNFCB BSSB ADDRESS unit this is executing from 000800F5 0 ZBM 75 UPCMAGEW BSSB 15 maximum age of PAL in WSX list 00081F15 0 ZBM 76 UPCUNITS BSSB ADDRESS => local unit list 000800F6 0 ZBM 77 UPXAGEVASP BSSB 15 extra page age for VASP list 00081F16 0 ZBM 78 UPCBROPTR BSSB ADDRESS pointer to brother process 000800F7 0 ZBM 79 UPXAGEWSX BSSB 15 extra page age for WSX list 00081F17 0 ZBM 80 UPCDADPTR BSSB ADDRESS pointer to father, our creator 81 BSSB 9 filler 00081378 0 ZBM 82 UPCERRPSN BSSB PSNFLDLN process to pass our errors to 00160809 0 BASE 83 UPCPROCNM BSS2 1 "name" of process 84 * PSLOCK of sponsoring PSA must be locked 85 * during ANY alteration of UPCUERROR or 86 * the associated UER list. Format of 87 * this word is exactly the same as that 88 * of PSUERROR (though some fields aren't 89 * actually used by both, and must remain 90 * 0 when "unused"). 0016080B 0 BASE 91 UPCUERROR BSS 1 error list root (see PSUERROR format) 0016080C 0 BASE 92 UPCINTTIME BSS 1 time for time interrupt 93 * The virtual monitor may examine UPCVMLIST 94 * with the interrupts on, since it is the only 95 * code allowed to modify the UPCVMLIST. 96 * ----- THESE MUST BE FULL WORD FIELDS ----- 0016080D 0 BASE 97 UPCVMLIST BSS 1 => virtual memory list of this level 0016080E 0 BASE 98 UPCWVMLIST BSS 1 => virtual memory list for windows 99 * The UPCVASP and UPCWSX may be altered on 100 * any interrupt, so the process looking 101 * or altering must not page fault and must 102 * have interrupts off. These list heads must 103 * be full words. 0016080F 0 BASE 104 UPCVASP BSS 1 => list of currently mapped or mappable pages 00160810 0 BASE 105 UPCWSX BSS 1 => working set extension 106 * (list of recently mapped pages) 00160811 0 BASE 107 UPCTIMESER BSS 1 serial number of time interrupt request 00160812 0 BASE 108 UPCTERMA BSS 256/WORDLNTH terminating character array 109 DRCT 0000001A ABS 110 UPCLNTH EQU DISPW UPCPROT size of an element 00000005 ABS 111 UPCLOG EQU UPCLNTH LOG 2 log size for free memory routines 112 ORG UPCPROT reclaim lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 263 (USERCOREDEFS) F 18 User Data Structure Definitions 114 115 ********************************************************************************** 116 * * 117 * UNIT CONTROL ELEMENT * 118 * A unit control element (UCE) is created for each open * 119 * logical unit. It contains the number of that unit and the * 120 * address of the FCB corresponding to the device. UCEs for * 121 * local units (1:100) are kept in the UPC (UPCUNITS) of the * 122 * process. UCEs for global units (101:200) are kept in the * 123 * PSA (PSUNITS). * 124 * * 125 ********************************************************************************** 126 00001ECB 127 UCEPROT BASE R0 00160800 0 BASE 128 UCWORDA BSS 1 00080080 0 ZBM 129 UCEUNIT EQU UCWORDA/BITS 0:7 logical unit # for this element 000000FF ABS 130 MAXUNIT EQU 255 largest unit number allowed 00081F10 0 ZBM 131 UCELINK EQU UCWORDA/FLDADRS link to next element 132 BSSB 15 filler 00081F11 0 ZBM 133 UCEFCB BSSB ADDRESS address of FCB for this element 134 DRCT 00000001 ABS 135 UCELOG EQU (DISPW UCEPROT) LOG 2 size of UCE element 136 137 ORG UCEPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 264 (USERCOREDEFS) F 18 User Data Structure Definitions 139 140 ********************************************************************************** 141 * * 142 * FILE CONTROL BLOCK * 143 * A file control block (FCB) is created for each opened * 144 * device. The FCB contains all of the resident controlling * 145 * information for that unit. * 146 * These elements are chained together in a PSA list * 147 * (PSFCBLIST). They are pointed to by UCEs in the global * 148 * list (PSUNITS) and UCEs in the local unit lists of the * 149 * underprocesses (UPCUNITS). The use count FCBUSYCNT * 150 * indicates the number of UCEs sharing this FCB (i.e. by unit * 151 * equivalence). UCEs come and go, but the FCB is freed when * 152 * its use count goes to zero. * 153 * * 154 ********************************************************************************** 155 156 NOLIST CREF 00134000 5 REG 157 FCB EQU R5 pointer to file control block 158 LIST CREF 00001ECB 159 FCBPROT BASE FCB FILE CONTROL BLOCK 160 00174800 5 BASE 161 FCWORDA BSS 1 00094080 5 ZBM 162 FCBUSYCNT EQU FCWORDA/BITS 0:7 number of UCEs using this FCB 00095040 5 ZBM 163 FCREQUEST EQU FCWORDA/BITS 8:11 sub-op of request being made 164 * EQU FCWORDA/BIT 12 unused 00095A10 5 ZBM 165 FCRELOC EQU FCWORDA/BIT 13 store relocation (used in some XREQs) 00095C10 5 ZBM 166 FCDIRINUSE EQU FCWORDA/BIT 14 on if directory locked by 167 * this FCBs process 00095F10 5 ZBM 168 FCLINK EQU FCWORDA/FLDADRS link to next element 169 00174801 5 BASE 170 FCBLOCK BSS 1 the current mass storage address 00094081 5 ZBM 171 FCDRIVE EQU FCBLOCK/VOLFIELD drive containing this file 00095181 5 ZBM 172 FCMSBLK EQU FCBLOCK/MSBLKFIELD block number on this drive 173 00094182 5 ZBM 174 FCTFL BSSB MSBLKLOG total file length 00097182 5 ZBM 175 FCLPBLK BSSB MSBLKLOG load point block (minor access block if RAF) 00096183 5 ZBM 176 FCMABLK BSSB MSBLKLOG if RAF, addr of major access block (0 if small) 00095114 5 ZBM 177 FCLIMITPTR BSSB ADDRESS pntr to limit block for this file 00097214 5 ZBM 178 FCSRCHSN BSSB 1 used by the directory searchers 179 * 1 sez look for serial number 00097484 5 ZBM 180 FCECHOLUN BSSB MAXUNIT LOG 2 unit to echo read lines on (zero if none) 181 * The dynamic status word in the FCB 00094455 5 ZBM 182 FCDYNSTAT BSSB 5 00094445 5 ZBM 183 FCLASTREAD EQU FCDYNSTAT/BITS 27:30 00094C15 5 ZBM 184 FCLOADPT EQU FCDYNSTAT/BIT 31 00002050 BYTE 185 FCDSTATPLC EQU FDSTATRTYP+FDSTATLP place for these bits in status 186 * The static status word in the FCB 00094F25 5 ZBM 187 FCSTATSTAT BSSB 18 00094E45 5 ZBM 188 FCPRIV EQU FCSTATSTAT/FSSTATPRIV 00095615 5 ZBM 189 FCCRT EQU FCSTATSTAT/FSSTATCRT 00095835 5 ZBM 190 FCACCESS EQU FCSTATSTAT/FSSTATACS 00096015 5 ZBM 191 FCABSIO EQU FCSTATSTAT/FSSTATABS 00096215 5 ZBM 192 FCFEWSC EQU FCSTATSTAT/FSSTATWSC 00096415 5 ZBM 193 FCSAVED EQU FCSTATSTAT/FSSTATSAV 00096665 5 ZBM 194 FCHTYPE EQU FCSTATSTAT/FSSTATDTYP 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 265 (USERCOREDEFS) F 18 User Data Structure Definitions 195 00097215 5 ZBM 196 FCOPWRITE BSSB 1 on iff last operation was WRITE 00097415 5 ZBM 197 FCSPOOLED BSSB 1 non zero if executed with the spooler 00097615 5 ZBM 198 FCTRANS BSSB 1 on if file opened when user program crashed 00097815 5 ZBM 199 FCFBD BSSB 1 bit OR'd into FDFBD when the FCB is freed 200 * indicates file is being destroyed 00097A15 5 ZBM 201 FCCMUNIT BSSB 1 says that unit number is in Control Mode range 00097CA5 5 ZBM 202 FCQUEUEID BSSB 10 ID of file from spooler (1023 max) 203 204 * These two fields are used to define the end of file 205 * for SAFs (FCEND is used to avoid the chain search) 206 * and for RAFs (FCEPP is the last byte pointer). 207 * For other devices, these words contain other fields. 00095186 5 ZBM 208 FCEND BSSB MSBLKLOG last block disk address 00174807 5 BASE 209 FCEPP BSS 1 last block byte position pointer 210 00174808 5 BASE 211 FCCPP BSS 1 current position pointer 00094148 5 ZBM 212 FCCBLK EQU FCCPP/PGNUMFLD current block number minus one 000968C8 5 ZBM 213 FCCBYTE EQU FCCPP/BYTEDISP current byte in current block 214 00095F16 5 ZBM 215 FCDCBPTR EQU FCEND/BITS 15:31 pointer to hardware control block 00095C16 5 ZBM 216 FCRESEEK EQU FCEND/BIT 14 1 sez must go through RAF structure 00095826 5 ZBM 217 FCRAFTYPE EQU FCEND/BITS 12:13 RAF type field 218 00174809 5 BASE 219 FCSERIAL BSS2 1 file serial number/account serial number 0017480B 5 BASE 220 FCNAME BSS2 1 name of file if saved 0017480D 5 BASE 221 FCNAMEEXT BSS 1 extension of filename 222 223 * These two symbols are used in .DIRs 00174807 5 BASE 224 FCANAME EQU FCEPP account name (with FCCPP) 0017480D 5 BASE 225 FCAPROJ EQU FCNAMEEXT and extension 226 227 * This symbol is used in .VOLs 0017480B 5 BASE 228 FCVNAME EQU FCNAME volume name 229 230 * What follows is the non-permanent part of the FCB 0017480E 5 BASE 231 FCPWORD BSS2 1 password while EQUIPing file 0017480E 5 BASE 232 FCJCXH EQU FCPWORD(0) pointer to current index entry 0017480F 5 BASE 233 FCJCDE EQU FCPWORD(1) pointer to current directory entry 234 BSS 0 235 DRCT 00000004 ABS 236 FCLOG EQU (DISPW FCBPROT) LOG 2 SIZE OF AN FCB ELEMENT 237 * 238 239 ORG FCBPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 266 (USERCOREDEFS) F 18 User Data Structure Definitions 241 242 ********************************************************************************** 243 * * 244 * PAGE ACCESS ELEMENTS * 245 * Page access elements exist whenever a page is resident * 246 * and a user is actively using it. A page access element * 247 * will be in the users UPCVASP list if it is currently mapped * 248 * into virtual memory, or in the UPCWSX list if it has been * 249 * recently referenced but is no longer mapped. * 250 * When a user is set up to run, his virtual address * 251 * space list (UPCVASP) is scanned and the page file is loaded * 252 * according to the page access elements found. * 253 * * 254 ********************************************************************************** 255 0000000E ABS 256 PALRTLOG EQU 14 length of the page age fields 257 258 NOLIST CREF 00130000 4 REG 259 PAL EQU R4 used for pointer to PALs 260 LIST CREF 261 00001ECB 262 PALMNT BASE PAL PAGE ACCESS ELEMENT 00170800 4 BASE 263 PAWORDA BSS 0 word label for following fields 00170000 4 CACH 264 PAVPN BSSB 8 page number in users virtual memory 00091010 4 ZBM 265 PAINDVP BSSB 1 PAL associated with indirect VP element 00091210 4 ZBM 266 PALOCK BSSB 1 locked into main memory 267 * See definition of MDVMAIFLD for description of the following field 00091430 4 ZBM 268 PAMAIFLD BSSB 3 maintenance field 269 BSSB 2 filler 00091F10 4 ZBM 270 PALINK BSSB ADDRESS link to next element 271 00170801 4 BASE 272 PAPMVALUE BSS 1 page map value 273 00170802 4 BASE 274 PAWORDC BSS 0 (for clearing on initialization) 000900E2 4 ZBM 275 PAGEAGE BSSB PALRTLOG time since last reference 00091C12 4 ZBM 276 PAMODIFIED BSSB 1 page modified flag 00091F12 4 ZBM 277 PAFCB BSSB ADDRESS FCB that page is mapped from, zero if not 00170803 4 BASE 278 PAPPLPTR BSS 1 pointer to associated PPL 279 DRCT 280 00000004 DISP 281 PALNTH EQU DISP PALMNT length of a PAL 00000002 ABS 282 PALOG EQU PALNTH LOG 2 block size indicator 283 ORG PALMNT recover lost space 284 285 286 ********************************************************************************** 287 * * 288 * VIRTUAL PAGE ELEMENTS * 289 * Each virtual page element contains the information * 290 * required to find a page whether or not it is resident. * 291 * Often, the FBI type indicator on a block is being * 292 * changed. The VPFBIOLD field is then used to hold the type * 293 * that should have been on the volume. The operation of * 294 * VPFBIOLD & VPFBINEW is as follows: if OLD = 0 and NEW = * 295 * then a block is read in and checked to ensure * 296 * that it is of that type. If OLD = and NEW = * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 267 (USERCOREDEFS) F 18 User Data Structure Definitions 297 * then a block of type OLD is read in and it is * 298 * converted to type NEW. If both OLD and NEW = 0, then no FBI * 299 * type checking is done. * 300 * Virtual pages that have no VPAGE element are presumed * 301 * to be zero pages. VPAGE elements are built whenever the * 302 * contents of a page is specified, such as when a zero page * 303 * is referenced or a RAF or CODE page is mapped in. * 304 * The lock bit is copied into the PAL for the associated * 305 * page. This bit must be cleared by doing: 1) a SETWNDOx on * 306 * the page. 2) an ULKPAGE. 3) A GRUBPAGE (or GRUBWNDO). 4) a * 307 * FORCEWRITE or DUALWRITE. * 308 * Indirect VP elements allow a debugging type process to * 309 * look at the memory of some other process. The VP element * 310 * specifies a process and page number. Please note also, * 311 * that VPFBITYPE in an indirect VP element must be a 0. A * 312 * particular problem with this structure is that a VP element * 313 * may be used to construct a PAL for the VASP list. The PAL * 314 * will then continue to refer to that page until it ages out, * 315 * even though a process has been inserted or destroyed. When * 316 * a page fault occurs after the ageing, PFPROC goes to the * 317 * new process to construct the PAL. This can manifest itself * 318 * as a timing dependent bug, since the end result depends on * 319 * page aging algorithms invisible to the user. * 320 * Each UPC has a list (UPCVMLIST) of all of its user * 321 * virtual pages that have been allocated. * 322 * The monitor also has a list (MONVM) of all of its * 323 * virtual (not resident) pages. The MONVM list is set up by * 324 * system initialization. * 325 * * 326 ********************************************************************************** 327 328 NOLIST CREF 00134000 5 REG 329 VPP EQU R5 normal ptr register for VPAGE 330 LIST CREF 331 00001ECB 332 VPAGEPROT BASE VPP virtual page element 333 BSSB 7 filler 00094E80 5 ZBM 334 VPCNTL BSSB 8 control field 00003010 BYTE 335 VPNOSUBB EQU BIT 24 ignore substitution process 00003210 BYTE 336 VPNOERRB EQU BIT 25 do not perform error recovery/retries 00003410 BYTE 337 VPWWCHKB EQU BIT 26 if set write check this page 00003030 BYTE 338 VPMAIFLD EQU BITS 24:26 bits indicating maintenance functions 00003610 BYTE 339 VPEXCLUDEB EQU BIT 27 page is excluded, access gives trap 00003810 BYTE 340 VPZEROPGB EQU BIT 28 request for zero page bit 00003620 BYTE 341 VPCNTLSRF EQU VPEXCLUDEB+VPZEROPGB magic combined field 342 * Field decoded by jump table in PFPROC. Codes are: 343 * 00 - normal 344 * 01 - zero page 345 * 10 - excluded 346 * 11 - zero page or resident copy 00003A10 BYTE 347 VPCNTLOCB EQU BIT 29 own copy bit 348 * 0 sez give error on write 349 * protect violation. 350 * 1 sez make a copy on write 351 * protect violation. 00003C10 BYTE 352 VPCNTLLKB EQU BIT 30 marks page as locked in core 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 268 (USERCOREDEFS) F 18 User Data Structure Definitions 00003E10 BYTE 353 VPCNTLROB EQU BIT 31 marks page as read only 00003650 BYTE 354 VPCNTLFLD EQU BITS 27:31 actual control field 355 00000000 ABS 356 VPCNTLW EQU 0*VPCNTLROB value of VPCNTL if writeable 00000001 ABS 357 VPCNTLRO EQU 1*VPCNTLROB value of VPCNTL if read only 00000002 ABS 358 VPCNTLLK EQU 1*VPCNTLLKB value of VPCNTL if locked 00000004 ABS 359 VPCNTLOC EQU 1*VPCNTLOCB value of VPCNTL if user allowed impure copy 360 * EQU 0*VPCNTLSRF value of VPCNTL for normal page 00000008 ABS 361 VPZEROPG EQU 1*VPCNTLSRF value of VPCNTL if zero page requested 00000010 ABS 362 VPEXCLUDE EQU 2*VPCNTLSRF value of VPCNTL if illegal to reference 00000018 ABS 363 VPCNTLNR EQU 3*VPCNTLSRF value sez no read 00000020 ABS 364 VPWWCHK EQU 1*VPWWCHKB value of VPCNTL if to write check page 00000040 ABS 365 VPNOERR EQU 1*VPNOERRB value of VPCNTL if errors ignored 00000080 ABS 366 VPNOSUB EQU 1*VPNOSUBB value of VPCNTL if substitutions ignored 367 00095F10 5 ZBM 368 VPLINK BSSB ADDRESS link to next element 369 00174004 5 CACH 370 VPVPN BSSB 8 virtual page number 000000FF ABS 371 NOSUCHVPN EQU 0FF an impossible number for this field 00095011 5 ZBM 372 VPINDRCT BSSB 1 flag saying indirect reference 373 BSSB 6 space filler 00000000 ABS 374 VPNOFCB EQU 0 code indicating no FCB associated with this page 00095F11 5 ZBM 375 VPFCB BSSB ADDRESS FCB address (if .CODE or .RAF page) 376 00174802 5 BASE 377 VPWORDC BSS 1 has same format as MSQWORDC 00002470 BYTE 378 VPFBIOLDB EQU BITS 18:24 type to read in if type changing 00003270 BYTE 379 VPFBINEWB EQU BITS 25:31 ultimate type of block 00094272 5 ZBM 380 VPFBIOLD EQU VPP,VPWORDC/UPR15/VPFBIOLDB 00095072 5 ZBM 381 VPFBINEW EQU VPP,VPWORDC/UPR15/VPFBINEWB 000942E2 5 ZBM 382 VPFBITYPE EQU VPP,VPWORDC/UPR15/(VPFBIOLDB+VPFBINEWB) 00095F12 5 ZBM 383 VPERAD EQU VPP,VPWORDC/FLDADRS error address 384 00174803 5 BASE 385 VPBLOCK BSS 1 volume number and MS block number 00094083 5 ZBM 386 VPDRIVE EQU VPBLOCK/VOLFIELD drive index number 00095183 5 ZBM 387 VPMSBLK EQU VPBLOCK/MSBLKFIELD relative MS block number 388 * VPBLOCK contains the following info if this VP element 389 * is an indirect reference: 00094083 5 ZBM 390 VPINDPN EQU VPBLOCK/BITS 0:7 page number in other address space 00001370 BYTE 391 UPCSRLFLD EQU BITS (WORDLNTH-PSNFLDLN):(WORDLNTH-1) process serial number field 00095373 5 ZBM 392 VPUPCSERL EQU VPBLOCK/UPCSRLFLD UPC serial number of page owner 393 DRCT 00000004 DISP 394 VPAGELNTH EQU DISP VPAGEPROT length of VPAGE element 00000002 ABS 395 VPLOG EQU VPAGELNTH LOG 2 size for memory routines 396 ORG VPAGEPROT 397 00000085 ABS 398 HIUSERPAGE EQU PNWNDO4 highest page in user VM list 399 01ECB 00000000 400 MONVM VFD FLDADRS*STORE root for monitor virtual memory list 401 402 ********************************************************************************** 403 * * 404 * Control Mode Virtual Page List * 405 * The initializer equips the control mode file and uses * 406 * the code control block to build this list. Each page in * 407 * the CCB produces a VPAGE element prototype for this list. * 408 * These VPAGE elements have user memory page numbers and are * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 269 (USERCOREDEFS) F 18 User Data Structure Definitions 409 * set up to give own copies when written on. These elements * 410 * are copied and used in the VM list of the users in control * 411 * mode. * 412 * * 413 ********************************************************************************** 414 01ECC 00000000 415 CMODEVP VFD STORE list of CM VPAGE elements 01ECD 00000000 416 CMODECA VFD STORE copy of CM CA from CCB 0000003E ABS 417 CMCHAR EQU ">" prompt char for control mode 418 419 420 ********************************************************************************** 421 * * 422 * Initial Control-Mode Entry Code Definitions * 423 * These codes appear in R1 when Control-Mode is * 424 * initially entered to tell it how the new session came into * 425 * existance. * 426 * * 427 ********************************************************************************** 428 00000010 BYTE 429 CMSKAPPL EQU BIT 0 on if CM should set skill=application 00000210 BYTE 430 CMBATCHJOB EQU BIT 1 on if this is a batch job 00000410 BYTE 431 CMERRIDS EQU BIT 2 on if insufficient disk space for logon 00000610 BYTE 432 CMERRINH EQU BIT 3 on if terminal inhibited 000009C0 BYTE 433 CMENTRYCD EQU BITS 4:31 entry code: 00000000 ABS 434 CMNLOGIO EQU 0 not logged on, std input and output exist 00000001 ABS 435 CMNLOGI EQU 1 not logged on, std input only exists 00000002 ABS 436 CMLOGIO EQU 2 logged on, std input and output exist 00000003 ABS 437 CMLOGI EQU 3 logged on, std input only exists 00000004 ABS 438 CMCONCP EQU 4 concurrent session creation 26 INPUT COREIOTABS in-core I/O tables 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 270 (COREIOTABS) F 19 Resident I/O tables 3 4 ********************************************************************************** 5 * * 6 * Tables describing the configuration of this system. * 7 * * 8 ********************************************************************************** 9 10 ********************************************************************************** 11 * * 12 * SLOTTABLE * 13 * This table contains one word for each device address on * 14 * the mousebus. The upper 3 bits of each word indicate the type * 15 * of device that the bootstrap found in that slot. Zero * 16 * indicates nobody home. The address of each word corresponding * 17 * to a channel points to a channel control element. The lower * 18 * bits in each CPU's entry contain WRU0 info for that CPU. This * 19 * prevents having to reference IBSLOTS on zero page for CPU * 20 * microcode patching. * 21 * * 22 ********************************************************************************** 23 00001ECE 24 SLOTTABLE BSS NUMSLOTS channel descriptor block pointers 00000030 BYTE 25 SLOTTYPE EQU BITS 0:2 type of device in this slot 00001F10 BYTE 26 SLOTPTR EQU FLDADRS pointer to channel element 00000DA0 BYTE 27 SLOTCPUI EQU BITS 6:31 CPU WRU0 info 28 29 ********************************************************************************** 30 * * 31 * Location to hold the page map value for the active SSU. * 32 * * 33 ********************************************************************************** 34 01EDE 00000000 35 CLOCKPF VFD 0+STORE holds page map value for SSU 36 00001EDF 37 FPSWITCH BSS 1 current state of the FP switches 00001EE0 38 FPSWITCHB BSS 1 switches at boot time 39 40 ********************************************************************************** 41 * * 42 * The SSU provides a .TERM for maintenance use through * 43 * the RDU. This terminal behaves pretty much like one on the * 44 * COMM, except that essentially all configuration items (baud * 45 * rate, DTR, etc.) are controlled by SSU microcode. We have * 46 * here a pointer to the TCB so that the read/write code, and * 47 * even a lot of COMM driver code can be used to drive this * 48 * special diagnostic terminal. * 49 * A flag is provided for output so that we know whether * 50 * the SSU is busy processing output characters. If the flag * 51 * is set, we must wait for an output ready interrupt. If the * 52 * flag is not set, we can output a new character immediately * 53 * (but must set the flag). * 54 * A lock is provided for input so that we don't have the * 55 * problem of multiple CPUs each picking up an input character * 56 * thus causing them to be inserted in the order that the CPUs * 57 * get through the TCLOCK wait. * 58 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 271 (COREIOTABS) F 19 Resident I/O tables 59 ********************************************************************************** 60 00001EE1 61 FPTCB BSS 1 => terminal control block for front panel 01EE2 00000000 62 FPTERMBZY VFD 0+STORE busy flag for FP output 01EE3 00000000 63 FPCHARINLK VFD 0+STORE indicates CPU busy processing input char 64 65 ********************************************************************************** 66 * * 67 * This word is set to one if the SSU is a new enough * 68 * version (MINVERSION) to support break and dwell processing * 69 * with port 0. We also define here the first version of the * 70 * SSU that contains a working new 2K NVM. * 71 * * 72 ********************************************************************************** 73 00001EE4 74 SSUVER BSS 1 1 sez new version of SSU 0000000D ABS 75 MINVERSION EQU 13 oldest SSU version that is compatible 0000000F ABS 76 NVMVERSION EQU 15 version with new 2K NVM 77 78 ********************************************************************************** 79 * * 80 * The date word is updated on each clock interrupt. In * 81 * order that it may be used to provide unique file serial * 82 * numbers, it is also incremented whenever it is fetched for * 83 * use as a file serial number. Also, it may never be set * 84 * back by a clock interrupt. * 85 * The newer SSUs update FDATE constantly for us. To * 86 * insure unique serial numbers we keep the last serial number * 87 * given in FSNDATE and make sure FDATE is larger than * 88 * FSNDATE. If FDATE is not larger we increment FSNDATE and * 89 * hand that back as the serial number. * 90 * FDATE is assembled as zeros. This is so that the * 91 * initial startup code will run no matter what is in the real * 92 * time clock. That is, FDATE will never have to be set back * 93 * in time by the simple minded routines that normally deal * 94 * with it. * 95 * Initproc is responsible for ensuring that the SSU * 96 * clock is reasonable before it lets the system run. Among * 97 * other things, it ensures that the SSU clock is not earlier * 98 * than: * 99 * 1) the time of the last system assembly * 100 * 2) the time stored in the NVM * 101 * 3) the time stored in the security block * 102 * Also, times too far into the future are caught. * 103 * * 104 ********************************************************************************** 105 01EE6 00000000 106 FDATE VFD 00,00 the clock is 44 bits, right justified 01EE7 A0081EE5 107 FDATEPTR PTR FDATE/DATEHORD field in time with 32 bit date 01EE8 00000000 108 FDATELOCK VFD 0 lock for date field modification 01EEA 00000000 109 FSNDATE VFD 00,00 last serial number dispensed 110 111 ********************************************************************************** 112 * * 113 * The following variables are used to control the accuracy * 114 * of the system SSU clock. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 272 (COREIOTABS) F 19 Resident I/O tables 115 * FDATERROR contains the number of milliseconds that the * 116 * operator told us the clock was in error, + indicates that the * 117 * clock is slow, - indicates fast. The SSU clock will be * 118 * adjusted at a rate of 1000 ppm so as not to shock accounting * 119 * routines or user benchmarks. * 120 * FDATEDRFT is the parts per billion that the clock seems * 121 * to drift, + indicates that the clock is slow, - indicates * 122 * fast. This is calculated from the successive error * 123 * corrections that the operator makes. It should be noted that * 124 * this error correction scheme runs only when the system is * 125 * running. This shouldn't be any hardship, since it should be * 126 * unusual for the system to be shut down for any appreciable * 127 * length of time. * 128 * The drift correction is vitally dependant on the * 129 * accuracy of the adjustments made by the operator. The * 130 * ultimate accuracy of the clocks in the BTI lab has been * 131 * better than one second a month. This means that the operator * 132 * should use a time reference that is close to WWV in * 133 * stability. * 134 * LASTCORR is the time that the clock was last * 135 * corrected. * 136 * Ideally, all of these variables would be stored in the * 137 * NVM to ensure that they remain with the particular clock * 138 * whose values they represent. However, since the NVM is * 139 * space limited, only the drift value is stored there. It is * 140 * placed into the NVM when a new value is calculated and read * 141 * out during system boot. * 142 * The correction date is not crucial to proper * 143 * functioning of the algorithms, since once it is set by a * 144 * new correction all future corrections will be evaluated * 145 * properly. The current error in the clock is zero almost * 146 * all of the time, and when set will most likely be nulled * 147 * out before a system sleep. Therefore, these values are * 148 * relegated to the security block. These values are stored * 149 * during the hour interrupt processing and during sleep * 150 * processing, and are restored at system boot. * 151 * * 152 ********************************************************************************** 153 00001EEB 154 LASTCORR BSS2 1 date clock last corrected 01EED 00000000 155 FDATERROR VFD STORE ms that the clock is off 01EEE 00000000 156 FDATEDRFT VFD STORE ppb that the clock drifts 157 158 ********************************************************************************** 159 * * 160 * TIMEZONE * 161 * This word contains the 3 letter abb. for the systems * 162 * local time zone in the left three characters. The * 163 * rightmost character is an 8 bit signed number indicating * 164 * the difference from UT. If you live where the local time is * 165 * not an even hour off from UT, you're tough out of luck. * 166 * * 167 ********************************************************************************** 168 00001EEF 169 TIMEZONE BSS 0 01EEF FFFFFFF8 170 VFDC "P","S","T",-8 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 273 (COREIOTABS) F 19 Resident I/O tables 171 172 ********************************************************************************** 173 * * 174 * TIMER QUEUE * 175 * All work with the queue or with the I/O device is * 176 * interlocked with this lock word. TIMESERIAL is used to * 177 * provide unique identifiers for use by the TIMEKILL routine. * 178 * The available codes may be used at rates up to about 100 * 179 * each second. With a 32 bit field, nothing over 1 year is * 180 * safe. One month is a reasonable maximum delay! The queue * 181 * is kept in order by time. * 182 * Note that TMRLINK is made a full word since we have * 183 * no use for the upper 15 bits and this makes the loads and * 184 * stores use the faster base mode addressing. * 185 * * 186 ********************************************************************************** 187 01EF0 00000000 188 TIMESERIAL VFD 0+STORE serial number for queue elements 01EF1 00000000 189 TIMERLOCK VFD STORE queue and device lock word 01EF2 00000000 190 TIMERQ VFD STORE list head 00130000 4 REG 191 TMR EQU R4 register used for timer element pointer 192 00001EF3 193 TMRPROT BASE TMR timer queue element prototype 00170800 4 BASE 194 TMRLINK BSS 1 link to next element 00170801 4 BASE 195 TMRTIME BSS2 1 time at which interrupt is scheduled to occur 00090043 4 ZBM 196 TMRCPU BSSB 4 slot number of cpu to get this interrupt 197 * zero cannot be a cpu, so that number 198 * indicates that any cpu can take it 199 BSSB 11 filler 00091F13 4 ZBM 200 TMRPC BSSB ADDRESS location to go to on time out 00170804 4 BASE 201 TMRSERIAL BSS 1 this elements serial number 00170805 4 BASE 202 TMRPARAM BSS 1 parameter to interrupt 203 DRCT 00000006 ABS 204 TMRLNTH EQU DISPW TMRPROT length of timer element 00000003 ABS 205 TMRLOG EQU TMRLNTH LOG 2 log of element length 206 ORG TMRPROT recover space 207 00001EF3 208 DEADMANTMR BSS 1 serial number of DEADMAN's timer request 209 210 ********************************************************************************** 211 * * 212 * Non Volatile memory * 213 * The non-volatile memory (NVM) in the SSU is a slow * 214 * memory taking some 120 milliseconds (sic) to erase and write * 215 * a location. The new 2K NVM is faster, but it still requires * 216 * several milliseconds to complete a write. Worse yet, the * 217 * state of a location if the power fails during an erase/write * 218 * operation is completely undefined. We therefore store most * 219 * data twice and alternate a flag to indicate which copy is to * 220 * be used. This is relatively crashproof. * 221 * Here are the locks for operations on the NVM. Any * 222 * write operation makes the NVM busy. If the NVM is busy, * 223 * any operation causes the requesting process to be queued. * 224 * Last are the values that control the clock values in the * 225 * NVM. They currently are variable because it is possible to * 226 * have two different NVM sizes. The old SSUs have 128 bytes * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 274 (COREIOTABS) F 19 Resident I/O tables 227 * while the new SSUs have 2048 bytes. The base value, count * 228 * and mask word are set dynamically during each boot. * 229 * Since there are multiple clock values the latest date * 230 * is assumed to be the good date iff another clock value is * 231 * within an hour or so, else the dates are all assumed to be * 232 * bogus. * 233 * * 234 ********************************************************************************** 235 01EF4 00000000 236 NVMBSYLOCK VFD STORE lock word for NVM 01EF5 00000000 237 NVMBSYFLAG VFD STORE flag indicating NVM busy 238 239 * DO NOT rearrange the following four words!!!!!!! 01EF6 00000000 240 NVMCLOCKS VFD STORE base address of the clocks 01EF7 00000000 241 NVMCLKNUM VFD STORE number of legtimate clock values 01EF8 00000000 242 NVMCLKMASK VFD STORE mask for clock index 01EF9 00000000 243 NVMCLKINDX VFD STORE last good NVM clock index 244 245 246 ********************************************************************************** 247 * * 248 * The following is this system's serial number that is * 249 * fetched from the SSU. It consists of two halves, the upper * 250 * being the 'customer number' and the lower being the * 251 * 'customers system number'. Customer 0 is BTI. The system * 252 * name is either this number in PAK6 if not in a network, or * 253 * the net node name if networking. * 254 * * 255 ********************************************************************************** 256 01EFA 00000001 257 SYSTEMSN VFD 00001 customer 0, system 1 01EFB 0BE8D400 258 SYSTEMNM PAK6 0&1 the 'name' of the system 259 260 ********************************************************************************** 261 * * 262 * The following word is the start up number which is * 263 * incremented every time the system is booted. It is a full * 264 * word number, but the bottom 8 bits are never zero. These * 265 * are used to validate file use counts in case of system * 266 * crashes. * 267 * * 268 ********************************************************************************** 269 00001EFC 270 SYSTEMSUN BSS 1 01EFD C20C1EFC 271 FILESUNP PTR SYSTEMSUN/BITS 24:31 00101EFD @ 272 FILESUN EQU @FILESUNP 273 274 ********************************************************************************** 275 * * 276 * SMU ELEMENT * 277 * This block is used to keep track of all SMUs on the * 278 * system. * 279 * * 280 ********************************************************************************** 281 01EFE 00000000 282 SMULIST VFD 0 pointer to first element in this list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 275 (COREIOTABS) F 19 Resident I/O tables 283 00000006 ABS 284 SMUCHKINTV EQU 6 number of times though DEADMAN between reading 285 * SMU error log 01EFF 00000006 286 SMUCHKCNT VFD SMUCHKINTV we decrement this count each time 287 * through DEADMAN. When it equals 0 we reset it 288 * and read the SMU error log. 289 00001F00 290 SMUPROT BASE R3 0008C040 3 ZBM 291 SMUSLOT BSSB 4 slot containing this SMU 292 BSSB 11 filler 0008DF10 3 ZBM 293 SMULINK BSSB ADDRESS pointer to next in list 294 DRCT 00000000 ABS 295 SMUBLKLOG EQU (DISPW SMUPROT) LOG 2 log size of this block 296 ORG SMUPROT recover lost space 297 298 ********************************************************************************** 299 * * 300 * PPU CONTROL ELEMENT * 301 * This block contains a pointer to a control block for * 302 * each operational peripheral controller. * 303 * * 304 ********************************************************************************** 305 00001F00 306 PPUPROT BASE R5 descriptor for an individual PPU 00174800 5 BASE 307 PPUPF BSS 1 page file to get to the PPU 00174801 5 BASE 308 PPUOPMSGID BSS 1 id of msg to operator saying PPU is bad 00174802 5 BASE 309 PPULASTST BSS 1 internal status on last interrupt 00174803 5 BASE 310 PPU3WORD BSS 1 1 sez this PPU can do triple word transfers 00174804 5 BASE 311 PPUCNTLPTR BSS PPUCHANS pointers to controller tables 00000080 BYTE 312 DEVTYPE EQU CH0 field contains the type of device here 00001F10 BYTE 313 DEVPTR EQU FLDADRS field contains pointer to device control element 314 DRCT 00000003 ABS 315 PPULOG EQU (DISP PPUPROT) LOG 2 length of PPU element 316 ORG PPUPROT recover the lost space 317 01F00 00006540 318 PPUBADSTAT VFD 1*PPUIBCNR+1*PPUIMPE+1*PPUICONF+1*PPUIDPPE+1*PPUIXTRA 319 * bits in the PPU channel status 320 * signifying transfer error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 276 (COREIOTABS) F 19 Resident I/O tables 322 323 ********************************************************************************** 324 * * 325 * COMM CONTROL ELEMENT * 326 * * 327 ********************************************************************************** 328 00001F01 329 COMLIST BSS 1 root of list of COM elements 330 00001F02 331 COMPROT BASE R0 descriptor for a CIA 00160800 0 BASE 332 COMLINK BSS 1 link to next COM element 00160801 0 BASE 333 COMWRU BSS 1 WRU response from controller 00160802 0 BASE 334 COMPF BSS 1 PF to access this CIA 00160803 0 BASE 335 COMOPMSGID BSS 1 id of message saying controller not talking 00160804 0 BASE 336 COMLASTST BSS 1 status word 1 on last interrupt 00160805 0 BASE 337 COMWORDC BSS 1 00080215 0 ZBM 338 COMTIMEOUT EQU COMWORDC/BIT 1 1 sez CIA timed out 00083085 0 ZBM 339 COMSTATE EQU COMWORDC/BITS 24:31 state of driver 00000000 ABS 340 COMSTIDLE EQU 0 idle (must be zero) 00000001 ABS 341 COMSTREAD EQU 1 doing read 00000002 ABS 342 COMSTWRITE EQU 2 doing write 00000003 ABS 343 COMSTWRIT2 EQU 3 doing continuation write 00000004 ABS 344 COMSTDREAD EQU 4 'delayed' read 00160806 0 BASE 345 COMINBUF BSS 1 comm input buffer pointer 00160807 0 BASE 346 COMINBUFS BSS 1 size of input buffer 00160808 0 BASE 347 COMOUTBUF BSS 1 comm output buffer pointer 00160809 0 BASE 348 COMOUTBUFS BSS 1 size of output buffer 0016080A 0 BASE 349 COMTRMTMNG BSS 1 count of terminals timing on this CIA 0016080B 0 BASE 350 COMFRSTTRM BSS 1 first terminal in list of TCBs for this CIA 0016080C 0 BASE 351 COMTERMS BSS 8 one pointer for each of the 8 boards 352 DRCT 00000005 ABS 353 COMLOG EQU (DISPW COMPROT) LOG 2 log size of COM element 354 ORG COMPROT recover the lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 277 (COREIOTABS) F 19 Resident I/O tables 356 357 ********************************************************************************** 358 * * 359 * TERMINAL CONTROL BLOCK * 360 * Each terminal has a TCB associated with it to control * 361 * the console output and input and to hold a PCB pointer. * 362 * * 363 * A terminal is not associated with any process in * 364 * particular, but supposedly only one PSA points to each * 365 * active TCB. A TCPCADRS of zero sez no process associated * 366 * with this terminal, otherwise it points to the process * 367 * control block of the process. * 368 * * 369 * TCB elements are an unusual size (not near a multiple * 370 * of 2) and are never destroyed, so while they behave like a * 371 * normal linked list, the elements are constructed from much * 372 * larger chunks of free memory and the excess is freed. * 373 * * 374 * LOCKING * 375 * There are many fields in a TCB that may be updated by * 376 * asynchronously running processes, such as the user process * 377 * and the driver. There are basicly three critical regions * 378 * in use here. These critical regions are as follows... * 379 * 1) The section at the beginning. This section is * 380 * interlocked by the implicit fact that only the * 381 * current user process can modify fields therein. * 382 * 2) There is a section that is only altered by the * 383 * driver. This section includes the fields in * 384 * line and also TCTIMECNT which has been moved * 385 * to the end of the TCB so as to not interfere * 386 * with ZBM addressing range. * 387 * 3) The remaining section may be altered by either * 388 * the driver or the user process. Anyone altering * 389 * any field in this section must hold TCLOCK. * 390 * * 391 * Special note should be made of the fields TCPCADRS, * 392 * TCINTE, and TCFCB. These fields are set by CHECKLOGD which * 393 * is in the driver. However, this can only happen if no user * 394 * process is currently attached to this TCB. These fields, * 395 * which otherwise are only modified by the implicit process * 396 * part, are therefore placed there. * 397 * * 398 ********************************************************************************** 399 01F02 00000000 400 TERMCOUNT VFD STORE number of logged on terminals 01F03 00000001 401 TERMNUM VFD 1 number of terminals found 402 * (first terminal is number 1) 01F04 00000000 403 TERMBASE VFD FLDADRS*STORE => base of real terminal TCBs 01F05 00000000 404 TERMWBUSY VFD STORE number of terminals busy writing 00000200 ABS 405 MAXTERMNUM EQU 512 number of terminals possible 000007BA ABS 406 MAXINQUE EQU (80+2)*24+10 max number of chars in input queue 000003DD ABS 407 MAXIXOFF EQU MAXINQUE/2 max in input queue before getting XOFFed 00000004 ABS 408 TCCMNDBURD EQU 4 each command in output counts this many 409 * characters toward suspending the process 410 * for terminal output wait 411 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 278 (COREIOTABS) F 19 Resident I/O tables 00130000 4 REG 412 TCB EQU R4 POINTER TO TERMINAL CONTROL BLOCK 413 00001F06 414 TCBPROT BASE TCB TERMINAL CONTROL BLOCK 00090040 4 ZBM 415 TCRT BSSB 4 current record type 00090890 4 ZBM 416 TCTNUM BSSB (MAXTERMNUM LOG 2) logical terminal number field 00091A10 4 ZBM 417 TCRFP BSSB 1 on if special SSU terminal 00091C10 4 ZBM 418 TCINHIB BSSB 1 on if logon access inhibited 00091F10 4 ZBM 419 TCLINK BSSB ADDRESS link to next element 420 * (fills first word) 000900F1 4 ZBM 421 TCIRATE BSSB 15 input baud rate 00091EF1 4 ZBM 422 TCORATE BSSB 15 output baud rate 00093C21 4 ZBM 423 TCECHO BSSB 2 echo status 00000000 ABS 424 ECHOMOFF EQU 0 no echo 00000001 ABS 425 ECHOMCIA EQU 1 echo done by controller 00000002 ABS 426 ECHOMSOFT EQU 2 echo done by me 00000003 ABS 427 ECHOMREAD EQU 3 echo done on read 428 000900A2 4 ZBM 429 TCMAXCHAR BSSB 10 number of chars before suspend (funct of baud) 000914A2 4 ZBM 430 TCUNSUSP BSSB 10 number of output chars to unsuspend 000928C2 4 ZBM 431 TCCRDELAY BSSB 12 carriage return delay 432 000900C3 4 ZBM 433 TCLFDELAY BSSB 12 line feed delay 000918C3 4 ZBM 434 TCFFDELAY BSSB 12 form feed delay 0017000F 4 CACH 435 TCCIAPORT BSSB 8 hardware port number on CIA 436 00170010 4 CACH 437 TCCRWIDTH BSSB 8 carriage width 00170011 4 CACH 438 TCSCRNHTH BSSB 8 screen height 00170012 4 CACH 439 TCLASTCOM BSSB 8 last transmitter setting command 00170013 4 CACH 440 TCLASTCOM2 BSSB 8 last CIA option selected 441 00170014 4 CACH 442 TCBAUDROOM BSSB 8 how much to remove from TCOUTSPACE to 443 * keep the output buffer from overfilling 00091015 4 ZBM 444 TCXOFFIQ BSSB 1 1 sez we XOFF the terminal if input buffer overfills 00091225 4 ZBM 445 TCACS BSSB 2 bits indicating access to this terminal 00091215 4 ZBM 446 TCACSRO EQU TCACS/BIT 30 on sez this terminal is accessed RO 00091415 4 ZBM 447 TCACSRW EQU TCACS/BIT 31 on sez this terminal is accessed RW 00091615 4 ZBM 448 TCINTTCG BSSB 1 sez TCG/TCS is for a NE terminal trapper 00091815 4 ZBM 449 TCRDRTCG BSSB 1 sez TCG/TCS is for a terminal reader (CPCUPC) 450 BSSB 2 filler 00091F15 4 ZBM 451 TCFCB BSSB ADDRESS FCB address of terminal user 452 00170018 4 CACH 453 TCBRCH BSSB 8 'break' character 00091076 4 ZBM 454 TCLKILLC BSSB 7 line kill character 00091F16 4 ZBM 455 TCCIABLOCK BSSB ADDRESS => CIA control block 456 457 BSSB 8 filler 00091077 4 ZBM 458 TCBKSPC BSSB 7 backspace character 00091F17 4 ZBM 459 TCPCADRS BSSB ADDRESS pointer to associated process control block 460 461 BSS 0 ensure word boundary, see box below 000900C8 4 ZBM 462 TCHTDELAY BSSB 12 horizontal tab delay 00091838 4 ZBM 463 TCPVC BSSB 3 previous line print control 00091E18 4 ZBM 464 TCINTE BSSB 1 interrupts enabled by term user 00092018 4 ZBM 465 TCINECHOD BSSB 1 on if chars in line echoed 466 467 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 279 (COREIOTABS) F 19 Resident I/O tables 468 * * 469 * The field TCCONTROL has three components. TCINTPROTO * 470 * and TCMODEM are locked by the implicit process lock. They * 471 * consequently are made to fall into the last word of the * 472 * implicitly locked region of the TCB. TCINTSTATE however, * 473 * is locked by the CIA driver lock. We fiddle to make that * 474 * component of TCCONTROL fall into the word reserved for * 475 * control by this driver lock. * 476 * The fields TCOUTSPACE, TCLASTST, TCTIMERTN, and * 477 * TCTIMECNT are also interlocked by the driver lock. * 478 * * 479 ********************************************************************************** 480 481 482 BSSB 13 filler to make word boundary between ... 483 * ...TCMODEM and TCINTSTATE 00093C78 4 ZBM 484 TCCONTROL BSSB 7 control for phones stuff 00093C28 4 ZBM 485 TCINTPROTO EQU TCCONTROL/BITS 25:26 interface protocol 486 * EQU 0 no interface control 487 * EQU 1 DTR/DSR disconnect 488 * EQU 2 modem handling 00090019 4 ZBM 489 TCMODEM EQU TCCONTROL/BIT 27 1 iff modem on port 00090249 4 ZBM 490 TCINTSTATE EQU TCCONTROL/BITS 28:31 current state of interface 491 * EQU 0 initialize 492 * EQU 1 restart 00000002 ABS 493 TCINTSNORM EQU 2 normal state 494 * and many more 00090A39 4 ZBM 495 TCTIMERTN BSSB 3 routine to process timeout 496 BSSB 1 filler to make easier to read 00091289 4 ZBM 497 TCOUTSPACE BSSB 256 LOG 2 space available in hardware output buffer 00092289 4 ZBM 498 TCLASTST BSSB 8 last port status 499 500 ********************************************************************************** 501 * * 502 * Beware that the following fields may only be changed * 503 * when TCLOCK is held. This is because all of the fields * 504 * here are ZBMs and they are not interlocked. * 505 * I assure you that this is true and it has been * 506 * discovered and re-discovered many, many times the hard way. * 507 * This applies down to the lock word itself. Several * 508 * whole words are placed down at the end (since ZBMs must be * 509 * within 15 words of the beginning) that need not be * 510 * interlocked. * 511 * * 512 ********************************************************************************** 513 514 BSS 0 force word boundary 000900FA 4 ZBM 515 TCTTOCNT BSSB (WORDLNTH-ADDRESS) number of chars in output queue 00091F1A 4 ZBM 516 TCTTOBP BSSB ADDRESS POINTER TO OUTPUT BUFFER BEGINNING 0009011B 4 ZBM 517 TCTTOEP BSSB ADDRESS POINTER TO OUTPUT BUFFER END 000922FB 4 ZBM 518 TCTTICNT BSSB (WORDLNTH-ADDRESS) number of chars in input queue 0009011C 4 ZBM 519 TCTTIEP BSSB ADDRESS POINTER TO INPUT BUFFER END 0009231C 4 ZBM 520 TCTTIBP BSSB ADDRESS POINTER TO INPUT BUFFER BEGINNING 0009041D 4 ZBM 521 TCREADIP BSSB 1 on if read in progress 0009061D 4 ZBM 522 TCINQFILL BSSB 1 on if input queue overflow, cleared by read 0009083D 4 ZBM 523 TCTERMGRP BSSB 3 terminating character group 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 280 (COREIOTABS) F 19 Resident I/O tables 00000000 ABS 524 TCTERMGRP0 EQU 0 standard term set 0 00000001 ABS 525 TCTERMGRP1 EQU 1 standard term set 1 00000002 ABS 526 TCTERMGRP2 EQU 2 standard term set 2 00000003 ABS 527 TCTERMGRPU EQU 3 user defined term set 00090E1D 4 ZBM 528 TCINECHO BSSB 1 on if to echo character input 0009101D 4 ZBM 529 TCIQXOFFED BSSB 1 on if input has been XOFFed 530 0017080E 4 BASE 531 TCTERMLOC BSS 1 holds location of terminator, 0 iff none 00091F1E 4 ZBM 532 TCTERMTCQ EQU TCTERMLOC/FLDADRS holds pointer to TCQ of terminator 000900FE 4 ZBM 533 TCTERMCHLC EQU TCTERMLOC/UPR15 holds index to terminator 534 535 ********************************************************************************** 536 * * 537 * End of the items that must be modified only when * 538 * TCLOCK is held, except for TCLOCK itself, which was moved * 539 * after TCTERMA so that TCTERMA could have a ZBM pointer made * 540 * easily. * 541 * * 542 ********************************************************************************** 543 0017080F 4 BASE 544 TCTERMA BSS 256/WORDLNTH user terminating character set 545 0017005C 4 CACH 546 TCTIMEFLAG BSSC 0 we keep a negative count so this char 547 * should be all 1's when terminal is timing 00170817 4 BASE 548 TCTIMECNT BSS 1 timing counter, counted up 00170818 4 BASE 549 TCLOCK BSS 1 on sez pointers being changed 00170819 4 BASE 550 TCTERMTYPE BSS 2 terminal type 0017081B 4 BASE 551 TCSITE BSS 2 terminal site name 552 DRCT 0000001D ABS 553 TCBLNTH EQU DISPW TCBPROT length of a TCB entry 554 ORG TCBPROT 555 556 ********************************************************************************** 557 * * 558 * A character input/output queue element looks like: * 559 * * 560 ********************************************************************************** 561 0012C000 3 REG 562 TCQ EQU R3 00001F06 563 TCQPROT BASE TCQ 0016C000 3 CACH 564 TCQFIRST BSSB 8 index to first character minus one 0008D060 3 ZBM 565 TCQLOG BSSB 6 log size of this block 0008DC10 3 ZBM 566 TCQCOMND BSSB 1 in output Q: on if second word a command 567 * in input Q: 0008DF10 3 ZBM 568 TCQLINK BSSB ADDRESS link to next element 0016C801 3 BASE 569 TCQWORDB BSS 0 second word 0016C004 3 CACH 570 TCQLAST BSSC 1 index to last character 0016C005 3 CACH 571 TCQSIZE BSSC 1 size of block in characters 00000006 ABS 572 TCQUSED EQU DISPC TCQFIRST num of chars used in block before info 0016C005 3 CACH 573 TCQCHARS EQU TCQSIZE characters (first index = 1) 574 BSS 0 variable length block 575 DRCT 576 ORG TCQPROT 577 578 * If carrying a command (output list) or an error (input list) 579 * the following format is used: 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 281 (COREIOTABS) F 19 Resident I/O tables 0008C081 3 ZBM 580 TCQCCODE EQU TCQWORDB/CH0 the command code 0008D181 3 ZBM 581 TCQCPARMS EQU TCQWORDB/(CH1+CH2+CH3) the parameter to the command 582 * or the error code 0016C000 3 CACH 583 TCQCLNTH EQU TCQFIRST the length of command in characters 000000FF ABS 584 TCQMXDELAY EQU (2 POWER 8)-1 maximum delay value that fits here 585 586 ********************************************************************************** 587 * * 588 * Table of number of characters that go into the various * 589 * queue element sizes. Indexed by log(2) of size. * 590 * * 591 ********************************************************************************** 592 00001F06 593 TCQSIZES LABEL 01F06 00000000 594 VFD 0 01F07 00000002 595 VFD (2 POWER (DISPW TCQSIZES))*CPW-TCQUSED 01F08 0000000A 596 VFD (2 POWER (DISPW TCQSIZES))*CPW-TCQUSED 01F09 0000001A 597 VFD (2 POWER (DISPW TCQSIZES))*CPW-TCQUSED 01F0A 0000003A 598 VFD (2 POWER (DISPW TCQSIZES))*CPW-TCQUSED 00001F0B 599 TCQMAXSIZE LABEL 01F0B 0000007A 600 VFD (2 POWER (DISPW TCQSIZES))*CPW-TCQUSED 601 602 ********************************************************************************** 603 * * 604 * Each of the CIA commands have a length and here is a * 605 * table of same indexed by command code. A length of zero * 606 * sez that this code is not a command. * 607 * * 608 ********************************************************************************** 609 01F0D 00000002 610 TCQCLENS VFDC 0,3,3,2,1,1,2,2 80-87 01F0F 00000002 611 VFDC 1,1,2,2,1,2,2,2 88-8F 01F11 00000000 612 VFDC 1,4,0,0,0,0,0,0 90-97 (pseudo-commands) 01F12 020C1EEC 613 TCQCLEN PTR TCQCLENS(-080) 614 615 ********************************************************************************** 616 * * 617 * Char used inside comm routines to indicate break. * 618 * * 619 ********************************************************************************** 620 00000100 ABS 621 BREAKMARK EQU 0100 indicates incoming break 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 282 (COREIOTABS) F 19 Resident I/O tables 623 624 ********************************************************************************** 625 * * 626 * MASS STORAGE CONTROLLER ELEMENT * 627 * This block contains the information for each mass * 628 * storage controller. * 629 * * 630 ********************************************************************************** 631 00000003 ABS 632 LOGUPC EQU 3 size of unit number field 00000008 ABS 633 UPC EQU 2 POWER LOGUPC number of units on a controller 634 01F13 00000000 635 MCTLIST VFD STORE list of all MS controllers 0013C000 7 REG 636 MCT EQU R7 637 00001F14 638 MCTPROT BASE MCT mass storage controller table proto 0017C800 7 BASE 639 MCTLINK BSS 1 link to next controller element 0017C801 7 BASE 640 MCTPMVALUE BSS 1 page file value to access this controller 0017C802 7 BASE 641 MCTOPMSGID BSS 1 id of message saying BFD not talking 0017C803 7 BASE 642 MCTELOCK BSS 1 lock word to prevent two processors 643 * from talking to one BFD simultaneously 0009C014 7 ZBM 644 MCTBUSY BSSB 1 indicates data transfer going 0009C234 7 ZBM 645 MCTUNIT BSSB LOGUPC indicates which unit going 0009C814 7 ZBM 646 MCTTIMEOUT BSSB 1 timeout flag: set by DEADMAN 0009CA34 7 ZBM 647 MCTMAXUNIT BSSB LOGUPC largest unit on this controller 0009D014 7 ZBM 648 MCTDEAD BSSB 1 on if PPU or BFD is not talking 649 BSSB 16 filler 0017C805 7 BASE 650 MCTDRIVE BSS UPC pointers to drive elements 651 DRCT 0000000D DISP 652 MCTLNTH EQU DISP MCTPROT length of controller table 00000004 ABS 653 MCTLOG EQU MCTLNTH LOG 2 log of element length 654 ORG MCTPROT 655 656 ********************************************************************************** 657 * * 658 * MASS STORAGE DEVICE LIST * 659 * Each separately addressable mass storage device has * 660 * an entry in this list. Each entry has its own queue of * 661 * requests. This allows the mass storage driver to keep the * 662 * greatest possible number of requests going at all times. * 663 * This list is locked by MDVLOCK (using LOCKLIST and * 664 * SRCHLIST). * 665 * * 666 ********************************************************************************** 667 01F14 00000000 668 MDVLOCK VFD STORE lock word for MDVLIST 01F15 00000000 669 MDVLIST VFD FLDADRS*STORE list of all MS devices 00134000 5 REG 670 MDV EQU R5 671 00001F16 672 MDVPROT BASE MDV MASS STORAGE DRIVE TABLE 00174800 5 BASE 673 MDVWORDA BSS 1 first word of MDV. All store-type 674 * references to this word MUST be 675 * read-modify-writes. 00000080 BYTE 676 MDVVOLFLD EQU BITS 0:7 field for volume number 00094080 5 ZBM 677 MDVVOLUME EQU MDVWORDA/MDVVOLFLD volume residing here (0 if none) 00095010 5 ZBM 678 MDVREADY EQU MDVWORDA/BIT 8 1 => drive is ready (mount is allowed) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 283 (COREIOTABS) F 19 Resident I/O tables 00095210 5 ZBM 679 MDVCHKSTAT EQU MDVWORDA/BIT 9 1 => must check drive status for offline 00095410 5 ZBM 680 MDVLOGCNT EQU MDVWORDA/BIT 10 1 => must log activity counts 00095610 5 ZBM 681 MDVCHKHEAD EQU MDVWORDA/BIT 11 1 => must check for head crash 00095830 5 ZBM 682 MDVUNIT EQU MDVWORDA/BITS 12:(12+LOGUPC-1) unit number of this drive 00095F10 5 ZBM 683 MDVLINK EQU MDVWORDA/FLDADRS link for volume list 684 00094011 5 ZBM 685 MDVDIDXFER BSSB 1 a request has been completed 00094231 5 ZBM 686 MDVSTATE BSSB 3 current state of unit 687 * use caution if you feel a need to reassign 688 * states because several jump tables use them 689 * code state 00000000 ABS 690 MDVSTINIT EQU 0 drive must be initialized 00000001 ABS 691 MDVSTRUN EQU 1 drive code is runnable 00000002 ABS 692 MDVSTSEEK EQU 2 awaiting seek end 00000003 ABS 693 MDVSTONCYL EQU 3 waiting our turn to start data transfer 00000004 ABS 694 MDVSTDT EQU 4 transferring data - awaiting interrupt 00000005 ABS 695 MDVSTKILL EQU 5 MDV should be destroyed 00000006 ABS 696 MDVSTPFAIL EQU 6 interrupted by power failure 00000007 ABS 697 MDVSTIDLE EQU 7 delaying for IDLETIME milliseconds 698 00094811 5 ZBM 699 MDVWPROT BSSB 1 last known BFDSSWPROT (write-protect) 700 BSSB 4 filler 00095231 5 ZBM 701 MDVCABLE BSSB LOGUPC cable position of drive 702 BSSB 3 filler 00095F11 5 ZBM 703 MDVCNTL BSSB ADDRESS address of controller block (MCT) 704 00094012 5 ZBM 705 MDVBADDISK BSSB 1 1 => heads have been unloaded because of crash 00094212 5 ZBM 706 MDVBADSKS BSSB 1 1 => disk can't seek, should go offline 707 BSSB 14 filler 0017400A 5 CACH 708 MDVTRKPCYL BSSB 8 number of tracks per cylinder 0017400B 5 CACH 709 MDVSECPTRK BSSB 8 number of sectors per track 00174803 5 BASE 710 MDVERRWORD BSS 1 error control word 00000010 BYTE 711 MDVNOSUBB EQU BIT 0 on if substitution procedure ignored 00094013 5 ZBM 712 MDVNOSUB EQU MDVERRWORD/MDVNOSUBB on if substitution procedure ignored 00000210 BYTE 713 MDVNOERRSB EQU BIT 1 on if error recovery/retries skipped 00094213 5 ZBM 714 MDVNOERRS EQU MDVERRWORD/MDVNOERRSB on if error recovery/retries skipped 00000410 BYTE 715 MDVWWCHKB EQU BIT 2 on if block should be write checked 00094413 5 ZBM 716 MDVWWCHK EQU MDVERRWORD/MDVWWCHKB on if block should be write checked 00094023 5 ZBM 717 MDVSPECDA EQU MDVERRWORD/(MDVNOSUBB+MDVNOERRSB) non-zero skips PPL/FBI DA mismatch HALT 00094033 5 ZBM 718 MDVMAIFLD EQU MDVERRWORD/(MDVNOSUBB+MDVNOERRSB+MDVWWCHKB) bits for maintenance functions 00000610 BYTE 719 MDVNOLOGB EQU BIT 3 on if error logging disabled 00094613 5 ZBM 720 MDVNOLOG EQU MDVERRWORD/MDVNOLOGB on if error logging disabled 00094813 5 ZBM 721 MDVREWRITE EQU MDVERRWORD/BIT 4 on if block should be rewritten 00094A13 5 ZBM 722 MDVSUB EQU MDVERRWORD/BIT 5 on if block should be substituted 723 * BITS 6:7 unused 00095043 5 ZBM 724 MDVFLTERRS EQU MDVERRWORD/BITS 8:11 fault errors 00000005 ABS 725 MDVFLERLIM EQU 5 limit for fault errors 00095843 5 ZBM 726 MDVSKERRS EQU MDVERRWORD/BITS 12:15 seek error counter 00000005 ABS 727 MDVSKERLIM EQU 5 maximum number allowed 00096083 5 ZBM 728 MDVCHERRS EQU MDVERRWORD/BITS 16:23 channel error counter 00000032 ABS 729 MDVCHERLIM EQU 50 limit for channel errors 00097083 5 ZBM 730 MDVDKERRS EQU MDVERRWORD/BITS 24:31 disk media error counter 00000014 ABS 731 MDVDKERLIM EQU 20 maximum number allowed 000949C3 5 ZBM 732 MDVERRFLDS EQU MDVERRWORD/BITS 4:31 field indicating errors, if any 733 00000005 ABS 734 MDVRZRTLIM EQU 5 limit of immediate re-zero retries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 284 (COREIOTABS) F 19 Resident I/O tables 00000005 ABS 735 MDVRZERLIM EQU 5 limit of times we can hit MDVRZRTLIM 736 00174804 5 BASE 737 MDVMAXSEEK BSS 1 first illegal seek address (hardware format) 00174805 5 BASE 738 MDVNAME BSS 1 PAK6 name of drive 739 00174806 5 BASE 740 MDVCOUNTS BSS2 1 activity counters 00174806 5 BASE 741 MDVREADCNT EQU MDVCOUNTS(0) number of read operations performed 00174807 5 BASE 742 MDVWRITCNT EQU MDVCOUNTS(1) number of write operations performed 743 00174808 5 BASE 744 MDVSEEKADR BSS 1 most recent seek address 745 746 * The following two words must be contiguous! 00174809 5 BASE 747 MDVBFDSTAT BSS 2 BFD status at transfer end 0017480A 5 BASE 748 MDVPPUSTAT EQU MDVBFDSTAT(1) PPU status at transfer end 0017480B 5 BASE 749 MDVLOPSTAT BSS 2 last operation status 750 0017480D 5 BASE 751 MDVTIMCODE BSS 1 time code used on write operation 0017480E 5 BASE 752 MDVVOLNAME BSS 2 name of volume mounted here 00174810 5 BASE 753 MDVFMTDAT BSS 2 formatted date of pack here 00174812 5 BASE 754 MDVTIMESER BSS 1 serial number of timer reset for next head-crash check 00174813 5 BASE 755 MDVIDLESER BSS 1 serial number of timer reset for coroutine delay 00174814 5 BASE 756 MDVCHKCYL BSS 1 cylinder last used for head-crash check 00174815 5 BASE 757 MDVRZPROBS BSS 1 number of times REZERO failed 00174816 5 BASE 758 MDVBTRXDA BSS 1 disk address of bad tracks block 00174817 5 BASE 759 MDVBTRXPPL BSS 1 addr of PPL containing bad tracks block 00174818 5 BASE 760 MDVSUBSDA BSS 1 disk address of substitution block 00174819 5 BASE 761 MDVSUBSPPL BSS 1 addr of PPL containing substitution block 0017481A 5 BASE 762 MDVSIZE BSS 1 size of drive in blocks 763 0017481B 5 BASE 764 MDVPC BSS 1 save area for PC in coroutine call 0017481C 5 BASE 765 MDVSAVER34 BSS 2 save area for R3-R4 in coroutine call 0017481E 5 BASE 766 MDVSAVER67 BSS 2 save area for R6-R7 in coroutine call 767 DRCT 00000020 DISP 768 MDVLNTH EQU DISP MDVPROT LENGTH OF DRIVE INFORMATION 00000005 ABS 769 MDVLOG EQU MDVLNTH LOG 2 log of element length 770 ORG MDVPROT 771 772 ********************************************************************************** 773 * * 774 * MASS STORAGE QUEUE ELEMENT * 775 * When MS blocks are requested, an element of this form * 776 * is created for each such block. * 777 * When a block becomes resident, its PPL is entered into * 778 * the PPAGELIST or PPIDLE and the MSQ element is discarded. * 779 * Whenever any page comes in, the SQMSWAIT queue is * 780 * searched for ALL users requesting this page. * 781 * Requests for writes of a page also fetch blocks of * 782 * this general form, but only the MSQXPTR and MSQPPPTR words * 783 * are significant. MSQXPTR may contain a pointer to a * 784 * temporary, duplicate PPL used to cause a write of the page * 785 * to two different locations on mass storage. The write * 786 * represented by the duplicate PPL is done first, then that * 787 * duplicate PPL is freed. MSQXPTR is set to zero. The MSQ * 788 * element then represents a normal write. * 789 * Note that the mass storage driver looks at the queue * 790 * head elements with the queues unlocked ( although it locks * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 285 (COREIOTABS) F 19 Resident I/O tables 791 * the queue before removing an element ). In other words, * 792 * the inserting routines must complete the queue elements * 793 * before they are inserted into the queue ( which must be * 794 * locked by the inserting routine ) and new elements may not * 795 * be added to the beginning of the queue (unless the queue is * 796 * empty). * 797 * * 798 ********************************************************************************** 799 01F16 00000000 800 MSQINLOCK VFD STORE lock word for the mass storage input queues 01F17 00000000 801 MSQOUTLOCK VFD STORE lock for the MS output queues 802 0012C000 3 REG 803 MSQ EQU R3 pointer to read request element 804 00001F18 805 MSQPROT BASE MSQ request queue element proto 0016C800 3 BASE 806 MSQWORDA BSS 1 first word 0008C0F0 3 ZBM 807 MSQTYPE EQU MSQWORDA/UPR15 R contains control info 00003010 BYTE 808 MSQREINIT EQU BIT 24 R read is actually an MDV re-init 00003210 BYTE 809 MSQFORMAT EQU BIT 25 R read is actually a format operation 00003430 BYTE 810 MSQMAIFLD EQU BITS 26:28 RW maintenance field (see MDVMAIFLD) 00003C10 BYTE 811 MSQZPAGE EQU BIT 30 R provide a zero page ( no MS read ) 812 * the new address bit must also be 813 * set for a zero page request. 00003E10 BYTE 814 MSQSNEWAD EQU BIT 31 R indicate a block number switch 00003C20 BYTE 815 MSQTYPFLD EQU BITS 30:31 non maintenance part of the field 0008DF10 3 ZBM 816 MSQLINK EQU MSQWORDA/FLDADRS RW link to next element 817 0016C801 3 BASE 818 MSQBLOCK BSS 1 R drive and MS block number 0016C802 3 BASE 819 MSQACTAD BSS 1 R actual MS address to be read 0016C802 3 BASE 820 MSQPPPTR EQU MSQACTAD W points to the PPL 0016C803 3 BASE 821 MSQXPTR BSS 1 RW points to a secondary PPL-FBI, 0 if none 822 DRCT 00000004 ABS 823 MSQLNTH EQU DISPW MSQPROT 00000002 ABS 824 MSQLOG EQU MSQLNTH LOG 2 825 ORG MSQPROT recover lost space 826 827 ********************************************************************************** 828 * * 829 * Busy words which note if I/O devices are still busy. * 830 * Used mainly to know when to halt after a sleep, and also * 831 * for the front panel display. * 832 * * 833 ********************************************************************************** 834 01F18 00000000 835 DISKRBUSY VFD 0+STORE increment for element in a MS read queue 01F19 00000000 836 DISKWBUSY VFD 0+STORE increment for element in a MS write queue 837 838 ********************************************************************************** 839 * * 840 * The following two values are used in the insertion of * 841 * disk read elements into the MS read queue. All elements that * 842 * are placed onto the disk read queue are place at the head of * 843 * the list (right behind the first one). This is done in an * 844 * attempt to push users through MSWAIT more rapidly. To * 845 * prevent starvation of some poor guy we put every DISKRENDth * 846 * element onto the end of the list, DISKCOUNT is our count to * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 286 (COREIOTABS) F 19 Resident I/O tables 847 * tell us when to do this. * 848 * * 849 ********************************************************************************** 850 01F1A 00000000 851 DISKCOUNT VFD 0 count of disk reads up to DISKREND 01F1B 0000001E 852 DISKREND VFD 30 every 30th element goes onto the end. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 287 (COREIOTABS) F 19 Resident I/O tables 854 855 ********************************************************************************** 856 * * 857 * Magnetic Tape Controller Element * 858 * This block contains all control information associated * 859 * with a given tape controller. * 860 * * 861 ********************************************************************************** 862 0013C000 7 REG 863 MTC EQU R7 register normally holds pointer to MTC 01F1C 00000000 864 MTCLIST VFD STORE head of MT controller list 865 00001F1D 866 MTCPROT BASE MTC tape controller element 0017C800 7 BASE 867 MTCLINK BSS 1 link to next element 0017C801 7 BASE 868 MTCPMVALUE BSS 1 page file value to access this controller 0017C802 7 BASE 869 MTCOPMSGID BSS 1 id of message saying MTC not talking 0017C803 7 BASE 870 MTCELOCK BSS 1 lock word to prevent two processors 871 * from talking to the one controller, also locks 872 * flags and lists 873 874 * The following two words are referenced and altered without 875 * holding any locks. They therefore need their own words. 0017C804 7 BASE 876 MTCTIMEOUT BSS 1 number of intervals remaining before timeout 0017C805 7 BASE 877 MTCREQUEST BSS 1 set by user when he wants something done 878 879 BSSB 2 filler 0009C426 7 ZBM 880 MTCTYPE BSSB 2 0 if CT, 1 if MT, 2 if VT 0009C816 7 ZBM 881 MTCDEAD BSSB 1 on if controller or PPU not talking 0009CA36 7 ZBM 882 MTCUNIT BSSB 3 unit number to start scan from 883 BSSB 7 filler 0009DF16 7 ZBM 884 MTCBUSY BSSB 17 => MTU element that has controller busy 885 00000004 ABS 886 MTCUPC EQU 4 units per tape controller 00000003 ABS 887 MTUNITMASK EQU MTCUPC-1 mask to isolate low bits 0017C807 7 BASE 888 MTCDRIVE BSS MTCUPC pointers to MTU elements for each unit 889 DRCT 00000004 ABS 890 MTCLOG EQU (DISPW MTCPROT) LOG 2 size for getmem 891 ORG MTCPROT recover lost space 892 893 894 ********************************************************************************** 895 * * 896 * Magnetic Tape Unit Element * 897 * Each tape unit has an element in one of these queues. * 898 * This element contains all status and control information * 899 * for that unit, including the queue of user buffer space * 900 * elements. * 901 * * 902 ********************************************************************************** 903 01F1D 00000000 904 MTULIST VFD STORE list head for MT units 01F1E 00000000 905 CTULIST VFD STORE list head for CT units 01F1F 00000000 906 VTULIST VFD STORE list head for VT units 00134000 5 REG 907 MTU EQU R5 register normally holds MT unit pointer 908 00001F20 909 MTUPROT BASE MTU 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 288 (COREIOTABS) F 19 Resident I/O tables 00174800 5 BASE 910 MTUSTART LABEL beginning of MTU element 911 912 * The following words may only be altered while MTCELOCK is held. 00094020 5 ZBM 913 MTUSTATE BSSB 2 current drive state 00000000 ABS 914 MTUSTRUN EQU 0 runnable 00000001 ABS 915 MTUSTWAIT EQU 1 waiting to start data transfer 00000002 ABS 916 MTUSTBUSY EQU 2 busy with data transfer 00000003 ABS 917 MTUSTPFAIL EQU 3 interrupted by power failure 00094460 5 ZBM 918 MTUDNUM BSSB 6 drive number (sequential from 0) 00095040 5 ZBM 919 MTUUNIT BSSB 4 unit number on controller 00095810 5 ZBM 920 MTUEOF BSSB 1 last record read was a file mark 00095A20 5 ZBM 921 MTUDENSITY BSSB 2 density value (0=lowest, 3=highest) 00095F10 5 ZBM 922 MTULINK BSSB 17 link to next element 923 00094021 5 ZBM 924 MTUTYPE BSSB 2 0 => CT unit, 1 => MT unit, 2 => VT unit, 000944A1 5 ZBM 925 MTUERRCODE BSSB 10 error code from last operation 00095831 5 ZBM 926 MTUTRACK BSSB 3 track number (for CT's) 00095F11 5 ZBM 927 MTUCNTL BSSB 17 pointer to MTC element 928 929 * The following word may be altered by both the user and the 930 * tape driver, hence you must hold MTREQLOCK when trying to 931 * change one of these fields. 00174008 5 CACH 932 MTUREQUEST BSSB 8 request code from user 00000001 ABS 933 MTURQREW EQU 1 do rewind 00000002 ABS 934 MTURQSEFF EQU 2 do skip to EOF forward 00000003 ABS 935 MTURQSEFB EQU 3 do skip to EOF backward 00000004 ABS 936 MTURQFWSP EQU 4 do forward space 00000005 ABS 937 MTURQBKSP EQU 5 do back space 00000006 ABS 938 MTURQREAD EQU 6 do read 00000007 ABS 939 MTURQWRITE EQU 7 do write 00000008 ABS 940 MTURQWFM EQU 8 do write file mark 00000009 ABS 941 MTURQGAP EQU 9 do erase gap 0000000A ABS 942 MTURQSET EQU 10 do select track and density 0000000B ABS 943 MTURQCYCLE EQU 11 cycle tape 944 BSSB 24 filler 945 946 * The following word is changed only by the user, therefore 947 * no lock need be held when changing its value. 00174803 5 BASE 948 MTUPCADRS BSS 1 pointer to PCB of user 949 950 * The following, being full word fields, do not get us 951 * into nearly so much trouble with interlocks. 00174804 5 BASE 952 MTUNAME BSS 1 name of this drive 00174805 5 BASE 953 MTUMSGID BSS 1 id of message about drive not ready 00174806 5 BASE 954 MTURECLEN BSS 1 record length (set by user before 955 * write request, set by driver 956 * during read request) 00174807 5 BASE 957 MTUREQLEN BSS 1 requested length for read 00174808 5 BASE 958 MTUUBS BSS 1 pointer to head of UBS chain (set by user) 00174809 5 BASE 959 MTUNUBS BSS 1 pointer to next UBS element to use 960 961 * The following two words MUST be contiguous (referenced by LD2, etc.) 0017480A 5 BASE 962 MTUPPUSTAT BSS 1 PPU status from last transfer 0017480B 5 BASE 963 MTUMTCSTAT BSS 1 tape controller status from last transfer 964 0017480C 5 BASE 965 MTUSAVER34 BSS 2 save area for R3,R4 for drive coroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 289 (COREIOTABS) F 19 Resident I/O tables 0017480E 5 BASE 966 MTUSAVER67 BSS 2 save area for R6,R7 for drive coroutine 00174810 5 BASE 967 MTUPC BSS 1 save area for PC for drive coroutine 968 969 * Stack area is currently 15 words in length 970 BSS 32-(DISPW MTUSTART) stack for drive coroutine 00174820 5 BASE 971 MTUSTACK LABEL label for top of stack 972 DRCT 00000005 ABS 973 MTULOG EQU (DISPW MTUPROT) LOG 2 size for getmem 974 ORG MTUPROT recover lost space 975 976 977 ********************************************************************************** 978 * * 979 * The following lock is held by users while requesting a * 980 * tape operation. It is held by the driver while awakening a * 981 * user. * 982 * * 983 ********************************************************************************** 984 01F20 00000000 985 MTREQLOCK VFD STORE tape request lock 986 987 988 ********************************************************************************** 989 * * 990 * User Buffer Space elements * 991 * These elements are set up whenever the user specifies * 992 * a buffer that is to be locked in and be used by a direct * 993 * I/O device. They are created as the pages are locked in by * 994 * DIOSETUP. * 995 * * 996 ********************************************************************************** 997 00001F21 998 UBSPROT BASE R0 00160000 0 CACH 999 UBSVPN BSSB 8 virtual page number locked in here 1000 BSSB 7 filler 00081F10 0 ZBM 1001 UBSLINK BSSB ADDRESS link to next element 00160801 0 BASE 1002 UBSMAW BSS 1 memory address word (in format for PPU) 00160802 0 BASE 1003 UBSBCW BSS 1 byte count word (in format for PPU) 1004 DRCT 00000002 ABS 1005 UBSLOG EQU (DISPW UBSPROT) LOG 2 size of UBS elements for GETMEM 1006 ORG UBSPROT recover lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 290 (COREIOTABS) F 19 Resident I/O tables 1008 1009 ********************************************************************************** 1010 * * 1011 * The following element describes a line printer * 1012 * controller. * 1013 * * 1014 ********************************************************************************** 1015 0012C000 3 REG 1016 LPC EQU R3 register for accessing this 01F21 00000000 1017 LPCLIST VFD STORE list of all line printers 00001F22 1018 LPCPROT BASE LPC 0016C800 3 BASE 1019 LPCLINK BSS 1 link to next LPC element 0016C801 3 BASE 1020 LPCPMVALUE BSS 1 page map value for controller 0016C802 3 BASE 1021 LPCMSGID1 BSS 1 id of message saying LPC not talking 0016C803 3 BASE 1022 LPCMSGID2 BSS 1 id of message saying LPC not ready 0016C804 3 BASE 1023 LPCNAME BSS 1 device name (pak6) 0016C805 3 BASE 1024 LPCELOCK BSS 1 lock to prevent 2 CPU's from diddling 0016C806 3 BASE 1025 LPCBUFPTR BSS 1 pointer to line buffer block 0016C807 3 BASE 1026 LPCFLAGS BSS 1 flags - change via RMW 0008C017 3 ZBM 1027 LPCTIMEOUT EQU LPCFLAGS/BIT 0 time out flag 0008C217 3 ZBM 1028 LPCBUSY EQU LPCFLAGS/BIT 1 write operation (or load VVFU) in progress 0008C417 3 ZBM 1029 LPCOPEN EQU LPCFLAGS/BIT 2 someone has this LP open 0008C617 3 ZBM 1030 LPCWAITING EQU LPCFLAGS/BIT 3 someone is suspended in DIO wait 0008C847 3 ZBM 1031 LPCUNIT EQU LPCFLAGS/BITS 4:7 unit number of LP (from dip switches) 0008D017 3 ZBM 1032 LPCLDVVFU EQU LPCFLAGS/BIT 8 on if load VVFU in progress 0008D217 3 ZBM 1033 LPCVVFUON EQU LPCFLAGS/BIT 9 on if VVFU should be enabled 0008D417 3 ZBM 1034 LPCDEAD EQU LPCFLAGS/BIT 10 on if PPU or controller not talking 0016C808 3 BASE 1035 LPCPCADRS BSS 1 addr of PCB of current user (if LPCOPEN) 0016C809 3 BASE 1036 LPCVVFULNS BSS 1 number of lines of VVFU data 0000005A ABS 1037 LPCVVFUMAX EQU 90 max number of lines of VVFU data 0016C80A 3 BASE 1038 LPCVVFUDAT BSS (LPCVVFUMAX+1)/2 data for VVFU 1039 DRCT 00000037 ABS 1040 LPCLNTH EQU DISPW LPCPROT length of entry 00000006 ABS 1041 LPCLOG EQU LPCLNTH LOG 2 1042 ORG LPCPROT 1043 1044 1045 ********************************************************************************** 1046 * * 1047 * Format of line printer buffer block. This block * 1048 * exists only while the line printer is open. * 1049 * * 1050 ********************************************************************************** 1051 00001F22 1052 LPBPROT BASE R0 00160800 0 BASE 1053 LPBPHYSADR BSS 1 physical address of page containing this block 00160801 0 BASE 1054 LPBLINECNT BSS 1 number of lines currently in buffer 00160802 0 BASE 1055 LPBFIRSTLN BSS 1 index of first line to output 00160803 0 BASE 1056 LPBNEXTLN BSS 1 index of next line to put into buffer 00000007 ABS 1057 LPBMAXCNT EQU 7 max number of lines in buffer 00000024 ABS 1058 LPBLINESZ EQU 36 number of words per line 00160804 0 BASE 1059 LPBLINES BSS LPBMAXCNT*LPBLINESZ buffer space 1060 * The first word of each line is the data 1061 * to store into LPC to cause the write. 1062 * The actual line starts at the second word. 1063 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 291 (COREIOTABS) F 19 Resident I/O tables 00000008 ABS 1064 LPBLOG EQU (DISPW LPBPROT) LOG 2 size log 2 1065 ORG LPBPROT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 292 (COREIOTABS) F 19 Resident I/O tables 1067 1068 ********************************************************************************** 1069 * * 1070 * VOLUME NAME ELEMENT * 1071 * Each volume mounted on the system has one of the * 1072 * following blocks associated with it. This gives the name * 1073 * of the volume, a list of some free blocks, and pointers to * 1074 * the disk routines for this volume. * 1075 * The VOLNTABLE, indexed by the volume number, contains * 1076 * a pointer to the VOLN element. When adding an element, * 1077 * deleting an element, or searching the entire table, it is * 1078 * necessary to hold VOLNLOCK (which is really index zero in * 1079 * the table). However, if you have a volume number and are * 1080 * looking for the VOLN element, and you are sure that the * 1081 * VOLN element is not about to go away, you can directly * 1082 * index into the table without locking it. VOLNLOCK is * 1083 * acquired using LOCKLIST or SRCHLIST, and release with * 1084 * UNLOCKLIST or UNSRCHLIST. * 1085 * Some of the VOLN entries have funny names. If the * 1086 * name is not printable, then the volume is not completely * 1087 * mounted or is maintenance mounted. If you mount a volume * 1088 * with the same name as one that is already mounted, it is * 1089 * given the name "!", where is the * 1090 * actual name of the volume and is the smallest * 1091 * integer that will make the name unique. will be * 1092 * truncated from the right if necessary. * 1093 * * 1094 ********************************************************************************** 1095 00000001 ABS 1096 SYSVOLNUM EQU 1 number assigned to system volume 00000040 ABS 1097 MAXVOLNUM EQU 64 maximum volume number (+1) 00001F22 1098 VOLNTABLE BSS MAXVOLNUM pointers to VOLN elements 00001F22 1099 VOLNLOCK EQU VOLNTABLE(0) lockword is index zero in table 1100 00000080 ABS 1101 VOLNLEN EQU 128 length of volume table elements 00130000 4 REG 1102 VLN EQU R4 1103 00001F62 1104 VOLNPROT BASE VLN 00170800 4 BASE 1105 VOLNSTART BSS 0 00090010 4 ZBM 1106 VOLNSYS BSSB 1 on if this be the system volume 00090210 4 ZBM 1107 VOLNNEWLST BSSB 1 on if creating a new ADT list 00090410 4 ZBM 1108 VOLNCLNUP BSSB 1 causes PUTFREEBLK to force out ADT 00090610 4 ZBM 1109 VOLNSBFLAG BSSB 1 on if substitution process exists 00090840 4 ZBM 1110 VOLNNOUSE BSSB 4 field sez volume not available 00090810 4 ZBM 1111 VOLNAWAY EQU VOLNNOUSE/BIT 28 volume in process of being dismounted 00090A10 4 ZBM 1112 VOLNMOUNT EQU VOLNNOUSE/BIT 29 on if not completely mounted 00090C10 4 ZBM 1113 VOLNINHIB EQU VOLNNOUSE/BIT 30 all new accesses to this volume 1114 * are inhibited 00090E10 4 ZBM 1115 VOLNMAIM EQU VOLNNOUSE/BIT 31 on if maintenance mounted 00091180 4 ZBM 1116 VOLNMSGID BSSB 24 id of message about volume 1117 00090181 4 ZBM 1118 VOLNBTRXBK BSSB MSBLKLOG address of bad trax block 00093181 4 ZBM 1119 VOLNSUBBLK BSSB MSBLKLOG address of substitution block 00092182 4 ZBM 1120 VOLNSECBK1 BSSB MSBLKLOG address of primary security block 00091183 4 ZBM 1121 VOLNSECBK2 BSSB MSBLKLOG address of secondary security block 1122 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 293 (COREIOTABS) F 19 Resident I/O tables 00090184 4 ZBM 1123 VOLNADTPT BSSB MSBLKLOG current ADT block 1124 BSSB 1 FILLER 00093274 4 ZBM 1125 VOLNADTFBX BSSB (PPLMAPSIZE LOG 2) index into PPLPFMAP for FBI 1126 00090015 4 ZBM 1127 VOLNHDCK BSSB 1 on if head checker is inhibited 00090215 4 ZBM 1128 VOLNFOREN BSSB 1 on if volume is foreign 000904A5 4 ZBM 1129 VOLNADTDSP BSSB (WPP LOG 2) disp into PPLWINDOW for FBI 1130 BSSB 3 FILLER 00091F15 4 ZBM 1131 VOLNHCB BSSB ADDRESS => hardware control block 1132 00170806 4 BASE 1133 VOLNBLOCK BSS 1 word used in setting windows 00090086 4 ZBM 1134 VOLNNUM EQU VOLNBLOCK/VOLFIELD number of this volume 00091186 4 ZBM 1135 VOLNMSBLK EQU VOLNBLOCK/MSBLKFIELD temp block pointer 1136 00170807 4 BASE 1137 VOLNSECAD BSS 1 MS address for security block 00090087 4 ZBM 1138 VOLNSNUM EQU VOLNSECAD/VOLFIELD volume number 00091187 4 ZBM 1139 VOLNSMSBLK EQU VOLNSECAD/MSBLKFIELD displacement 1140 00170808 4 BASE 1141 VOLNIDXLK BSS 1 lock for these two counters 1142 00090019 4 ZBM 1143 VOLNIDXMOD BSSB 1 counted if table modifier around 000902D9 4 ZBM 1144 VOLNIDXLOK BSSB 13 counted for each searching table 1145 BSSB 1 FILLER 00091F19 4 ZBM 1146 VOLNIDXPTR BSSB ADDRESS pointer to IDXT block for table 1147 0017080A 4 BASE 1148 VOLNSUBQ BSS 1 queue of substitution requests 0017080B 4 BASE 1149 VOLNSUBQL BSS 1 lock for substitution request queue 0017080C 4 BASE 1150 VOLNFBZY BSS 1 set if resident lists busy 0017080D 4 BASE 1151 VOLNADTF BSS 1 set if MS ADT tables busy 1152 * ( a process is already running to 1153 * empty/fill the resident table ) 1154 0017080E 4 BASE 1155 VOLNSSN BSS 1 system serial number of this volume 0009010E 4 ZBM 1156 VOLNCUST EQU VOLNSSN/CUSTNUM customer number part 0017080F 4 BASE 1157 VOLNRNAME BSS2 1 real name of volume 00170811 4 BASE 1158 VOLNNAME BSS2 1 the RAD packed name of this volume 00170813 4 BASE 1159 VOLNMNTDAT BSS2 1 date when pack was mounted 00170815 4 BASE 1160 VOLNBUSY BSS 1 the count of processes referencing this volume 1161 * one for each ULB and for each non-user process 1162 * (file freer, device queuer, etc.) 1163 1164 ********************************************************************************** 1165 * * 1166 * Following are the queues of I/O requests pending for * 1167 * this volume. These must remain contiguous and in this order. * 1168 * * 1169 ********************************************************************************** 1170 00170816 4 BASE 1171 VOLNREADQ BSS 1 read requests 00170817 4 BASE 1172 VOLNWRITEQ BSS 1 write requests 1173 1174 ********************************************************************************** 1175 * * 1176 * The following two variables are used when a volume is * 1177 * being initialized and recovered onto. VOLNINLIST contains * 1178 * a pointer to a list of elements representing bad tracks * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 294 (COREIOTABS) F 19 Resident I/O tables 1179 * with the end element representing the size of the pack. * 1180 * VOLNBCNTR is successively incremented to provide all MS * 1181 * addresses on the volume. * 1182 * * 1183 ********************************************************************************** 1184 00170818 4 BASE 1185 VOLNINLIST BSS 1 initialization list 00170819 4 BASE 1186 VOLNBCNTR BSS 1 block counter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 295 (COREIOTABS) F 19 Resident I/O tables 1188 ********************************************************************************** 1189 * * 1190 * Resident ADT section of the volume name list element. * 1191 * * 1192 ********************************************************************************** 1193 0017081A 4 BASE 1194 VOLNFRECNT BSS 1 number of free blocks in the below list 0017081B 4 BASE 1195 VOLNFRELST BSS 1 number of free blocks in this ADT chain 0017081C 4 BASE 1196 VOLNFREBLK BSS 1 number of free blocks on the volume 1197 * (excludes count of entries in below list) 0017081D 4 BASE 1198 VOLNSIZE BSS 1 number of blocks on this volume 1199 1200 ********************************************************************************** 1201 * * 1202 * When disk space gets low an operator message is sent. * 1203 * Its serial number is saved here so that when disk space * 1204 * goes above the critical level the message can be cancelled. * 1205 * * 1206 ********************************************************************************** 1207 0017081E 4 BASE 1208 VOLNLOMSN BSS 1 low disk space message serial number 00000100 ABS 1209 BLKWRNMIN EQU 256 number of blocks at which to give warning 00000118 ABS 1210 BLKWRNMAX EQU 280 number of blocks at which to remove warning 1211 00000008 ABS 1212 VOLNFREDSP EQU 8 displacement from middle for fill or empty 00000005 ABS 1213 VOLNFREMIN EQU 5 displacement from end for starting action 00000061 ABS 1214 VOLNFREEN EQU VOLNLEN-(DISP VOLNSTART) number of free block 1215 * pointers herein 1216 0017081F 4 BASE 1217 VOLNFREE BSS VOLNFREEN area for free block addresses 1218 DRCT 00000007 ABS 1219 VOLNLOG EQU VOLNLEN LOG 2 size for free memory routines 1220 ORG VOLNPROT recover the space 1221 1222 ********************************************************************************** 1223 * * 1224 * VINLIST * 1225 * This is the format for the small elements linked * 1226 * together in the VOLNINLIST chain. * 1227 * * 1228 ********************************************************************************** 1229 00001F62 1230 VINPROT BASE R0 volume initializer element 00160800 0 BASE 1231 VINLINK BSS 1 link to next element 00160801 0 BASE 1232 VINBLOCK BSS 1 bad block MS address 1233 * (note that the last list element 1234 * contains the pack size which is 1235 * the first address that doesn't exist) 1236 DRCT 00000002 ABS 1237 VINLEN EQU DISPW VINPROT element length 00000001 ABS 1238 VINLOG EQU VINLEN LOG 2 log size for GETMEM 1239 ORG VINPROT recover lost space 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 296 (COREIOTABS) F 19 Resident I/O tables 1241 1242 ********************************************************************************** 1243 * * 1244 * Substitution Queue Element * 1245 * This is the list of requests to substitute or * 1246 * unsubstitute mass storage blocks. The disk driver requests * 1247 * that a block be substituted when it encounters a soft error * 1248 * reading a block, and the ADT manager requests that a block * 1249 * be unsubstituted when that block is finally freed. Since * 1250 * it is inconvenient for either of them to do the * 1251 * substitutions themselves, they just put one of these * 1252 * elements onto a queue and let the substitution process * 1253 * worry about it. * 1254 * There is one of these lists for each volume, anchored * 1255 * at VOLNSUBQ, and locked by VOLNSUBQL. Elements are appended * 1256 * to the list by SUBSTITUTE and UNSUBS, and removed by * 1257 * SUBSPROC. * 1258 * * 1259 ********************************************************************************** 1260 00001F62 1261 SUBQUEUE BASE R0 substitution queue element 00160800 0 BASE 1262 SUBQWORDA BSS 1 first word 00080080 0 ZBM 1263 SUBQREQ EQU SUBQWORDA/CH0 0 => substitute, 1 => unsubstitute 00081F10 0 ZBM 1264 SUBQLINK EQU SUBQWORDA/FLDADRS link to next element 00160801 0 BASE 1265 SUBQBLOCK BSS 1 block number to substitute or 1266 unsubstitute (includes volume number) 1267 DRCT 00000001 ABS 1268 SUBQLOG EQU (DISPW SUBQUEUE) LOG 2 size log 2 1269 ORG SUBQUEUE 1270 1271 ********************************************************************************** 1272 * * 1273 * Substitution List Element * 1274 * This is the list of substituted blocks on the system. * 1275 * There is one chain containing any substitutions that have * 1276 * been made on any mounted volume. * 1277 * This list is created by MOUNTSUBS, destroyed by * 1278 * DISMTSUBS and altered by SUBSPROC. * 1279 * * 1280 ********************************************************************************** 1281 01F62 00000000 1282 SUBSLOCK VFD STORE lock word for substitution list 01F63 00000000 1283 SUBSLIST VFD STORE list of substitution elements 1284 00001F64 1285 SUBLIST BASE R0 substitution list element 00160800 0 BASE 1286 SUBLLINK BSS 1 link to next element 00160801 0 BASE 1287 SUBLBAD BSS 1 bad block number (includes volume number) 00160802 0 BASE 1288 SUBLGOOD BSS 1 substitute block number (includes volume number) 1289 DRCT 00000002 ABS 1290 SUBLLOG EQU (DISPW SUBLIST) LOG 2 size log 2 1291 ORG SUBLIST 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 297 (COREIOTABS) F 19 Resident I/O tables 1293 1294 ********************************************************************************** 1295 * * 1296 * Account Finder Table head * 1297 * This points to a block of free storage that contains * 1298 * an array of block numbers of the account finder table. * 1299 * This is fetched from the system volume when the system is * 1300 * initialized. * 1301 * * 1302 ********************************************************************************** 1303 01F64 00000000 1304 AFTINDEX VFD FLDADRS*STORE pointer to resident AFT 01F65 00000000 1305 AFTLOCK VFD STORE lock word for next two counters 01F66 00000000 1306 AFTLOOKERS VFD STORE number of folk looking at AFT 01F67 00000000 1307 AFTMODIFY VFD STORE number of folk wishing to modify AFT 1308 00000000 ABS 1309 AFTACSRO EQU 0 indicates read only access requested 00000001 ABS 1310 AFTACSMO EQU 1 indicates modify access requested 1311 1312 ********************************************************************************** 1313 * * 1314 * User InDeX Table Head * 1315 * Entries that point at the blocks in IDX's or the AFT. * 1316 * The IDXT blocks of the IDX's are pointed to from the volume * 1317 * name entry while the AFT is pointed to from the head page. * 1318 * The block is of variable length. * 1319 * IDXTBNUM should never be zero, but buckets within the * 1320 * range of IDXTBNUM may have zero for pointers (in which * 1321 * case, they are created as needed). * 1322 * * 1323 ********************************************************************************** 1324 00001F68 1325 IDXTABPROT BASE R4 00170800 4 BASE 1326 IDXTBLOCK BSS 1 current block number 00090080 4 ZBM 1327 IDXTVOL EQU IDXTBLOCK/VOLFIELD volume that table is on 00091180 4 ZBM 1328 IDXTMSBLK EQU IDXTBLOCK/MSBLKFIELD relative disk address 00170004 4 CACH 1329 IDXTFBIT BSSB 8 type of table 00170005 4 CACH 1330 IDXTBNUM BSSB 8 number of buckets in below lists 00092101 4 ZBM 1331 IDXTENTS BSSB 16 total number of entries in buckets 00170802 4 BASE 1332 IDXTTEMP3 BSS 1 holds insert point - block number 00170803 4 BASE 1333 IDXTTEMP4 BSS 1 holds insert point - memory address 00000004 ABS 1334 IDXTPWR2 EQU DISPW IDXTVOL difference of number of buckets from 1335 * power of two 00170804 4 BASE 1336 IDXTBUCKET LABEL one word entry for each bucket 1337 * (holds MS address of corresponding 1338 * bucket. zero indicates bucket was 1339 * empty, so it was not created) 1340 * ... (variable length) 1341 DRCT 1342 ORG IDXTABPROT recover lost space 1343 00001F68 1344 PATCHAREA BSS 80 area for system patches 01FB8 FFFFFFFF 1345 VFD ONEBITS so that we notice the end of the area 00001FB9 1346 HEADPAGEND LABEL first unused word of head page 1347 28 INPUT IBLOCK definitions for initialization 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 298 (IBLOCK) F 20 Initialization information block 4 5 ********************************************************************************** 6 * * 7 * Physical page zero is reserved for bootstrap and power * 8 * fail. While this page is in use, it is mapped into virtual * 9 * page zero of the monitors address space. Otherwise, * 10 * monitor virtual page zero is illegal to reference ( to help * 11 * catch various errors ). * 12 * This file (IBLOCK) defines all locations in the second * 13 * half (200:3FF) of page zero and is assembled with each * 14 * program that uses that area. * 15 * * 16 * Page zero has the following map: * 17 * locs contents * 18 * ---- -------- * 19 * 0000-01ff code copied from PROM in SSU that does * 20 * booting, etc. During system operation * 21 * this bootstrap area is overlaid by the * 22 * power fail restart code. * 23 * 0200:02ff 16 16-word blocks, one for each slot on * 24 * the bus. Each contains the responses * 25 * for WRUs 0 thru 15 on that slot. * 26 * 0300:030f currently unused. Reserved for * 27 * hardware features. * 28 * * * * end of hardware dependent area * 29 * 0310:031E communication area between PROMBOOT, * 30 * DISKBOOT, and the Operating System * 31 * *** this boundary is approximate * 32 * 031F:032F variable area * 33 * 0330:035F stack area for PROMBOOT and DISKBOOT * 34 * 0360:03ff Information saved by the system to * 35 * allow rebuilding of the page file after * 36 * a power failure. * 37 * * 38 ********************************************************************************** 39 40 ORG MA (WPP/2) start in second half of page 00000200 41 IBLOCK LABEL 00000200 42 WRUIPROTO BASE 00000000 DISP 43 WRU0 BSS 1 identity and revision 00000001 DISP 44 WRU1 BSS 1 bus error info 00000002 DISP 45 WRU2 BSS 1 bus error info 00000003 DISP 46 WRU3 BSS 1 bus error info 00000004 DISP 47 WRU4 BSS 1 device dependent info 00000005 DISP 48 WRU5 BSS 1 device dependent info 00000006 DISP 49 WRU6 BSS 1 device dependent info 00000007 DISP 50 WRU7 BSS 1 device dependent info 00000008 DISP 51 WRU8 BSS 1 device dependent info 00000009 DISP 52 WRU9 BSS 1 device dependent info 0000000A DISP 53 WRU10 BSS 1 device dependent info 0000000B DISP 54 WRU11 BSS 1 device dependent info 0000000C DISP 55 WRU12 BSS 1 device dependent info 0000000D DISP 56 WRU13 BSS 1 device dependent info 0000000E DISP 57 WRU14 BSS 1 device dependent info 0000000F DISP 58 WRU15 BSS 1 self test results 59 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 299 (IBLOCK) F 20 Initialization information block 00000010 ABS 60 WRUIMAX EQU DISPW WRUIPROTO size of WRU info block 61 ORG WRUIPROTO recover the lost space 62 00000200 63 WRUINFO BSS NUMSLOTS*WRUIMAX WRU info blocks, 1 per slot 00000300 64 EWRUINFO LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 300 (IBLOCK) F 20 Initialization information block 66 67 ********************************************************************************** 68 * * 69 * Reserved for future feature. * 70 * This area was assigned as the communication area * 71 * between macro code and micro code for a debugging feature. * 72 * * 73 ********************************************************************************** 74 75 BSS 16 76 77 ********************************************************************************** 78 * * 79 * End of hardware assigned area. * 80 * * 81 ********************************************************************************** 82 83 ********************************************************************************** 84 * * 85 * Variable area * 86 * The area between here and the tables at the end is * 87 * available for assignment as: * 88 * 1) variables to be communicated between PROMBOOT, * 89 * DISKBOOT, and the SYSTEM. * 90 * 2) variables to be communicated between CPUs * 91 * during system initialization. * 92 * 3) variables local to PROMBOOT or DISKBOOT. * 93 * * 94 ********************************************************************************** 95 96 ********************************************************************************** 97 * * 98 * PROMBOOT constructs a page map value for the SSU with * 99 * the SSU command offset and saves it in SSUPF for future use * 100 * by DISKBOOT, OPL, and the Operating System. * 101 * PROMBOOT uses several pages of memory. When control * 102 * is passed on, PHPNAV may be used to determine the next * 103 * available memory page. * 104 * * 105 ********************************************************************************** 106 00000310 107 SSUPF BSS 1 page map value for SSU control 00000311 108 PHPNAV BSS 1 PF contents for last used page 109 110 ********************************************************************************** 111 * * 112 * This is the contents of the CPU interrupt polling word * 113 * built by initial. It is here so that the many CPUs may * 114 * each load it. * 115 * * 116 ********************************************************************************** 117 00000312 118 INTDEVICES BSS 1 interrupt polling word 119 120 ********************************************************************************** 121 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 301 (IBLOCK) F 20 Initialization information block 122 * PROMBOOT recovers from the SSU the contents of the * 123 * front panel switches at boot time and stores the value * 124 * here. * 125 * DISKBOOT and the system get the switches from here * 126 * so that everyone is using the same data. * 127 * * 128 ********************************************************************************** 129 00000313 130 FPSWITCHX BSS 1 131 132 ********************************************************************************** 133 * This holds the filename of the routine loaded. The * 134 * system can thus find its name here. * 135 ********************************************************************************** 136 00000314 137 CALLNAME BSS2 1 the name of the system loaded 138 139 ********************************************************************************** 140 * * 141 * This block contains the information from DISKBOOT * 142 * about the disk from which it booted the system. It is used * 143 * by the system to ensure that the "system volume" is the * 144 * same one used by DISKBOOT. This vector must be in the same * 145 * format as an offline device control block. * 146 * During TAPEBOOT this same vector is used to describe * 147 * the tape unit that we have booted from. * 148 * * 149 ********************************************************************************** 150 00000316 151 BOOTDEVCB BSS 0 control block for booted device 00000316 152 BOOTDEVPF BSS 1 page file for boot device 00000317 153 BOOTUNIT BSS 1 unit number for boot unit 154 00000318 155 BOOTSCPTRK BSS 1 sectors per track 00000319 156 BOOTRKPCYL BSS 1 tracks per cylinder 157 BSS 4 remainder of disk control block 158 159 ********************************************************************************** 160 * During initialization, one processor is chosen as a * 161 * master and the other processors wait on this flag until it * 162 * is cleared by the "master" processor. * 163 ********************************************************************************** 164 0000031E 165 RELESEFLAG BSS 1 multi-proc control during initial 166 167 ********************************************************************************** 168 * This is the FBI buffer for use by PROMBOOT, * 169 * DISKBOOT, and TAPEBOOT. * 170 ********************************************************************************** 171 0000031F 172 BOOTFBIBF BSS FBILNTH FBI buffer for DISKBOOT 173 174 ********************************************************************************** 175 * * 176 * Definitions for tape boot reading and decryption. * 177 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 302 (IBLOCK) F 20 Initialization information block 178 * A tape suitable for the tape boot operation contains a * 179 * TAPEBOOT record after the first file mark on the tape. The * 180 * TAPEBOOT record must be followed by TOPL and other offline * 181 * utility programs. The second file mark on the tape * 182 * indicates the end of the boot utility programs, and the * 183 * beginning of the +BACKUP info. The format for these tape * 184 * records are all the same, and are all (TPHDRLNTH+WPP)*CPW * 185 * characters long, with the first TPHDRLNTH*CPW characters a * 186 * label for convenience in identifying the record. The * 187 * remainder of the record consists of the encrypted TAPEBOOT, * 188 * or offline utility program code. * 189 * * 190 ********************************************************************************** 191 0000000B ABS 192 TPHDRLNTH EQU FBILNTH length of header on tapeboot record 0000031F 193 TPHDRBF EQU BOOTFBIBF buffer for tapeboot record header 0000032A 194 TPHDR BASE 00000000 DISP 195 TPHDRTAG BSS 2 block identifier (name) 00000002 DISP 196 TPHDRIND BSS 1 word for decryptor to use 00000003 DISP 197 TPHDRDATE BSS 2 date backup tape was made 198 BSS 4 (reserved) 00000009 DISP 199 TPHDRDCKS BSS 1 checksum of data block 0000000A DISP 200 TPHDRHCKS BSS 1 checksum of header 201 DRCT 202 ORG TPHDR 0000000C ABS 203 SIZELOG2 EQU 12 log of decrypt buffer size 00001000 ABS 204 L EQU 2 POWER SIZELOG2 size of the decrypt buffer (in characters) 00000003 ABS 205 ROUNDS EQU 3 number of rounds of encryption 206 207 ********************************************************************************** 208 * * 209 * The following area is used for variables that are * 210 * local to PROMBOOT, DISKBOOT, TAPEBOOT, or INITIAL. These * 211 * variables may, of course, have different definitions for * 212 * each user. * 213 * * 214 ********************************************************************************** 215 0000032A 216 VARAREA LABEL marks beginning of re-usable area 217 218 ********************************************************************************** 219 * Definitions for PROMBOOT. * 220 ********************************************************************************** 221 0400032A 222 KEYH BSS 16:0 describe key by half words 0000032A 223 KEYIND BSS 1 holds the indicator (read from tape) 0000032B 224 KEYPWDATE BSS2 1 holds XOR of PW and backup date 0000032D 225 APROGBC BSS 1 data pointer for decrypting 0000032E 226 APROGB5S BSS 1 data pointer for decrypting 227 228 ********************************************************************************** 229 * * 230 * The IZONEWORD is used to hold the local time zone * 231 * information. This word is picked up by the SRCHDIR routine * 232 * of DISKBOOT and TAPEBOOT from the security block * 233 * (SECTZONE). It is used by OPL utilities to enable printing * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 303 (IBLOCK) F 20 Initialization information block 234 * of local times. * 235 * * 236 ********************************************************************************** 237 0000032F 238 IZONEWORD BSS 1 holds time zone word 00000330 239 BOOTYPE BSS 1 boot type for PROMBOOT 00000331 240 BOOTCLOC BSS 1 control location for PROMBOOT 241 00000332 242 IBLKPATCH BSS 0 patch area, may be used for variables 243 244 ********************************************************************************** 245 * * 246 * This ORG is the beginning of the power fail table * 247 * area. The tables that follow are (in addition to acting * 248 * as bootstrap variables) also passed to the power fail * 249 * restart code. * 250 * Note that simple variables should not overlay these * 251 * tables unless a careful determination is made that no * 252 * conflict exists. * 253 * These tables should be zeroed to start. * 254 * Since the stacks grow toward low memory, the stack * 255 * top label is defined here. * 256 * * 257 ********************************************************************************** 258 259 ORG MA (WPP-2*NUMSLOTS-NPS) place flush with end of page 00000360 260 IBSTACK LABEL 261 262 ********************************************************************************** 263 * * 264 * The initial boot into memory containing parity errors * 265 * requires that a fill operation be done to clear out the * 266 * parity errors. This label marks the limit of the area * 267 * that must be filled. * 268 * * 269 ********************************************************************************** 270 00000360 271 EVARCLEAR LABEL 272 273 ********************************************************************************** 274 * * 275 * This table holds the page map value for each page that * 276 * was assigned as a CPUPAGE. The HEADPAGE also becomes the * 277 * CPUPAGE for the 'master' CPU. However, that entry is not * 278 * made until well into the system initialization. That way, * 279 * the HEADPAGE doesn't get freed twice. After that is * 280 * resolved, CPUPT contains all of the CPUPAGES so that all * 281 * CPUs get their brains back during a power fail recovery. * 282 * Each CPUPAGE is mapped into another monitor virtual * 283 * page where it is used for the free storage addresses. This * 284 * occurrence of the page map value appears in the PFMAP * 285 * table. * 286 * * 287 ********************************************************************************** 288 00000360 289 CPUPT BSS NUMSLOTS page file contents for each CPU page 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 304 (IBLOCK) F 20 Initialization information block 290 291 ********************************************************************************** 292 * This table will be loaded up with the information * 293 * about each slot on the bus. Each entry is the WRU 0 * 294 * response for that slot. This table is constructed by * 295 * PROMBOOT using the information in WRUINFO (above). * 296 ********************************************************************************** 297 00000370 298 IBSLOTS BSS NUMSLOTS one for each slot on system 299 300 ********************************************************************************** 301 * * 302 * This table contains one word for each monitor virtual * 303 * page. That word contains the page map value for the * 304 * physical page corresponding (zero if none). This table * 305 * is initialized by DISKBOOT and kept up to date by the * 306 * dispatcher. It is used by the power fail routine to * 307 * recover the monitor page files. * 308 * * 309 ********************************************************************************** 310 00000380 311 PFMAP BSS NPS page map for monitor virtual address space 00000387 312 HEADPMV EQU PFMAP(PNHEADPAGE-MONPF) head page location 30 INPUT INITIAL first system executed code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 305 (INITIAL) F 21 Initialization Routine 3 4 ORG INITPAGE 5 6 BLOCK System Initialization Routine 7 ENTRY INITIAL primary entry for CPU doing the work 8 ENTRY SUCKERS secondary entry for lazy CPUs 9 10 * Some global constants used in the initial code 02000 0F000FFF 11 PFCLNMASK VFD ONEBITS/PFSLOT*PFSLOT+ONEBITS/PFPAGENUM*PFPAGENUM clear page file mask 02001 00480312 12 PTRINTDEV PTR INTDEVICES/BIT 0 pntr to mask of slots that interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 306 (INITIAL) F 21 Initialization Routine 14 15 ********************************************************************************** 16 * * 17 * INITIAL - System Initialization * 18 * This is the primary entry point for the system * 19 * overlay. The 'master' CPU enters here from the bootstrap. * 20 * This CPU is the one that uses HEADPAGE as its CPUPAGE. We * 21 * start by loading up the page file for the CPUPAGE. * 22 * * 23 * Stack required = 19 * 24 * 1 + max ( BLDPROCESS(2), BUILDIVT (3), BUILDPPL (1), * 25 * FREEAFTER (2), FREECHECK (2), GENPPL (2), * 26 * GETIDLE (1), GETMAD (0), HAVEMEMORY(8), * 27 * HAVEPPU (19), HAVESSU (6), MAPOUTMEM (1), * 28 * MERGEPPLS (1), SETRUNNING (2), SGETMEM (0), * 29 * SPREADSYS (5), ZEROIT (1) ) * 30 * * 31 ********************************************************************************** 32 33 JB1 BLOCK INITIAL routine 34 ENTRY INITIAL 35 36 BEGFRAME2 00178800 6 BASE 37 SLOTNUM BSS 1 slot being initialized 38 ENDFRAME 39 40 00002002 41 INITIAL LABEL 02002 FE0E201C 42 JMP OVERVERSN jump over version id 43 * --- 44 45 ********************************************************************************** 46 * * 47 * This version is normally not updated when the system * 48 * is patched, only the version field labeled 'VERSION' is * 49 * patched up to the current rev. This spot allows us to know * 50 * for sure what version this system started as. The * 51 * copyright notice should protect our rights to the code. * 52 * * 53 ********************************************************************************** 54 02003 43393330 55 VFD REVNAMEH high half of name 02004 33202020 56 VFD REVNAMEL low half of name 02005 434F5059 57 TEXTZ "COPYRIGHT 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990 BTI Computer Systems, Inc." 58 0000201C 59 OVERVERSN LABEL 0201C D0001CF7 60 INC CPUCOUNT count number of CPUs 0201D D0001CFA 61 INC CPUINIT say we are on the initial page 0201E BC001CF8 0 62 INCL R0 CPUCOUNT1 ...twice since we need two counts 63 * and this gives us an index 0201F D9124000 1 REG 64 STMSR R1 pick up a copy of our MSR 02020 604A7840 1 1 CBM 65 LD R1 R1/MSRSLOT and extract the slot number of this CPU 02021 E4601CFA 1 0 66 ST R1 CPUSLOTS(R0-1) store CPU slot number into table using index 67 02022 60C40081 3 IMM 68 LD PFPTR PNCPUPAGE get CPUPAGE PF index 02023 00C00387 69 LDPF HEADPMV load our CPUPAGE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 307 (INITIAL) F 21 Initialization Routine 02024 E4400415 1 70 ST R1 OURSLOT save CPU slot number for ourselves 02025 60002832 0 71 LD R0 STACKIDENT get stack marker and 02026 E400042D 0 72 ST R0 RESSTAKTOP identify this stack 02027 6184044D 6 IMM 73 LD SP ADR RESSTAK initialize stack pointer 02028 EC1F8001 6 STAK 74 STZ PUSH allocate stack area 02029 EC000462 75 STZ MEMERRFLAG indicate not processing memory error 76 * \ / 77 78 ********************************************************************************** 79 * * 80 * Save PM value of bootstrap so that others may use it. * 81 * This must be done before any calls to GETMEM routines that * 82 * get a new page. * 83 * * 84 ********************************************************************************** 85 86 * \ / 0202A 60C40080 3 IMM 87 LD PFPTR MONPF+0 point to bootstrap page 0202B 80801CC7 88 PFRD PAGEZERO save reloc for it 89 90 ********************************************************************************** 91 * * 92 * The first order of business is to free up the unused * 93 * space on HEADPAGE. Since this page is mapped into the same * 94 * location in every CPU, we may free it up with no addressing * 95 * problems. * 96 * * 97 ********************************************************************************** 98 99 * \ / 0202C 6044000A 1 IMM 100 LD R1 LWPP a whole page 0202D 60841FB9 2 IMM 101 LD R2 ADR HEADPAGEND load the first address available 0202E DC402328 102 CALLNP FREEAFTER call this handy routine 103 * \ / 104 105 ********************************************************************************** 106 * * 107 * Defer freeing the other CPU pages until after we have * 108 * generated the MONVM list and know the first address * 109 * available for free memory. * 110 * * 111 ********************************************************************************** 112 113 ********************************************************************************** 114 * * 115 * Generate the MONVM list, excluding those pages that * 116 * must remain resident. The physical page for the * 117 * initializer (this code!) will have a PPAGE element * 118 * generated and entered into the idle list. We'll be done * 119 * with it before it is missed (used!). * 120 * The DISKBOOT routine has left the code control block * 121 * for the SYSTEM.CODE file in window 1. * 122 * * 123 ********************************************************************************** 124 125 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 308 (INITIAL) F 21 Initialization Routine 0202F 61040088 4 IMM 126 LD R4 PNINITPAGE start checking here 00002030 127 CRAVP LABEL 02030 60A80780 2 4 128 LD R2 WNDO1(CCBPAGE0-MONPF+R4) check the MS address 02031 FA822042 2 129 JEQZ R2 ENDLOOP jump if no page corresponding 02032 EC381CC6 4 @ 130 STZ @PAVPAGES(R4) remove page from virtual monitor address 02033 F6802042 2 131 JBT R2/CCBPROTECT ENDLOOP jump if a permanent page 132 * \ / 133 134 ********************************************************************************** 135 * * 136 * The page is not flagged as protected. During the * 137 * bootstrap operation, this means that the page was not * 138 * loaded and is not part of the resident code. * 139 * Therefore, we now create a VPAGE element for this page * 140 * and place it into the MONVM list. * 141 * * 142 ********************************************************************************** 143 144 * \ / 02034 DC002ED0 145 CALL SGETMEM get a chunk of memory 02035 40440002 IMM 146 PARVL VPLOG indicate its length 02036 61520000 5 0 REG 147 LD VPP R0 copy the pointer 02037 60001ECB 0 148 LD R0 MONVM get pointer to current list 02038 E4095F10 0 5 ZBM 149 ST R0 VPP,VPLINK hook it behind this element 02039 E5401ECB 5 150 ST VPP MONVM make this element the new head 0203A E5174004 4 5 CACH 151 ST R4 VPP,VPVPN set the page number 0203B 60040001 0 IMM 152 LD R0 VPCNTLRO get read-only marker and 0203C E4094E80 0 5 ZBM 153 ST R0 VPP,VPCNTL indicate that this page is read only 0203D 60040014 0 IMM 154 LD R0 FBITCODED get FBI type for code data page 0203E E40942E2 0 5 ZBM 155 ST R0 VPP,VPFBITYPE and set the page type expected 0203F EDC94083 5 ZBM 156 STW VPP,VPDRIVE indicate on system drive 02040 EC095F11 5 ZBM 157 STZ VPP,VPFCB say no associated lun 02041 E4895183 2 5 ZBM 158 ST R2 VPP,VPMSBLK set block address 159 00002042 160 ENDLOOP LABEL 02042 19040001 4 IMM 161 ADD R4 1 up to next address in CCB 02043 65040100 4 IMM 162 CPR R4 MONPF+NPS check for beyond usable memory 02044 FE082030 163 JLT CRAVP jump if still in allowable area 02045 60040002 0 IMM 164 LD R0 1*BIT FLCHKSUM 02046 FC001CF6 0 165 IORM R0 FLAGS say we need to recalculate checksums 166 * \ / 167 168 ********************************************************************************** 169 * * 170 * Free the remaining CPUPAGEs. * 171 * The HEADPAGE (CPUPAGE for master CPU) has already been * 172 * freed. We must be careful not to free it twice. This is * 173 * accomplished by omitting it from the CPUPT table until all * 174 * other CPUPAGEs are freed (this loop). * 175 * * 176 ********************************************************************************** 177 178 * \ / 02047 6107FFF0 4 IMM 179 LD R4 -NUMSLOTS load count 00002048 180 CCPUPLD LABEL 02048 60280370 0 4 181 LD R0 CPUPT(NUMSLOTS)(R4) see if another CPU has loaded a CPUPAGE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 309 (INITIAL) F 21 Initialization Routine 02049 FA022051 0 182 JEQZ R0 CLPEND jump if none here 183 * MEMLOCK need not be locked since we are the only CPU 0204A DC40301D 184 CALLNP GETMAD get an available monitor address 0204B 00D20000 0 REG 185 LDPF R0 setup this address in PF 0204C E4260300 0 3 186 ST R0 PFMAP(-MONPF)(PFPTR) save in table 0204D 608AE960 2 3 CBM 187 LD R2 PFPTR/BITS 20:9 make memory address of page 0204E 1884006B 2 IMM 188 ADD R2 CPULNTH make first freeable address 0204F 6044000A 1 IMM 189 LD R1 LWPP a whole page 02050 DC402328 190 CALLNP FREEAFTER free the rest of the page 00002051 191 CLPEND LABEL 02051 FB202048 4 192 IRJ R4 CCPUPLD continue for all slots 193 * \ / 194 195 ********************************************************************************** 196 * * 197 * The HEADPAGE is also used as the 'master' CPUs * 198 * CPUPAGE. It now gets placed into the CPUPT table so that * 199 * power fail will properly restore our brains. * 200 * * 201 ********************************************************************************** 202 203 * \ / 02052 60000415 0 204 LD R0 OURSLOT get our slot number 02053 60800387 2 205 LD R2 HEADPMV load the page map value 02054 E4A00360 2 0 206 ST R2 CPUPT(R0) plug into the CPUPT table 207 * \ / 208 209 ********************************************************************************** 210 * * 211 * Clean out the VOLN table. * 212 * * 213 ********************************************************************************** 214 215 * \ / 02055 38801F22 2 216 LEA R2 VOLNTABLE pointer to start of the table 02056 60440100 1 IMM 217 LD R1 MAXVOLNUM*CPW length of table in characters 02057 FE580000 218 CFILL 0 nothing remains 219 * \ / 220 221 ********************************************************************************** 222 * * 223 * Make PPAGEs for the following special cases: * 224 * - the bootstrap code itself, * 225 * - the three windows used by the bootstrap, * 226 * - the page used by the initial routine, and * 227 * - the pages used by INITPROC. * 228 * * 229 * Note that the first call to GENPPL uses that page for * 230 * FBIs for the following pages. Thus we call GENPPL once * 231 * before calling BUILDPPL so that there will be a page * 232 * allocated for the FBIs. We then build PPLs for the initial * 233 * page and initial process pages and tuck them away in a safe * 234 * place. When INITPROC has finished running it places these * 235 * PPLs in the idle lists for mass consumption. * 236 * Also note that the first page of INITPROC gets its PPL * 237 * built first (of the initial PPLs) so that it will be on the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 310 (INITIAL) F 21 Initialization Routine 238 * bottom of the list. This must be this way or else when * 239 * INITPROC is giving the PPLs to the idle lists it will give * 240 * the one its finishing up code is running on before it is * 241 * finished and die a horrible death. * 242 * * 243 ********************************************************************************** 244 245 * \ / 02058 60C40082 3 IMM 246 LD PFPTR PNWNDO1 points to window 1 02059 80D34000 5 REG 247 PFRC R5 read physical page number 0205A DC40235E 248 CALLNP GENPPL make a PPAGE element for this page 249 0205B 60C400AC 3 IMM 250 LD PFPTR PNINITPROC index to INITPROC page 0205C 60840000 2 IMM 251 LD R2 0 no PPLs built yet 0000205D 252 GENINITPPL LABEL 0205D 80934000 5 REG 253 PFRD R5 read page file contents 0205E DC402374 254 CALLNP BUILDPPL build a PPL for this page 0205F E4891F10 2 4 ZBM 255 ST R2 PPL,PPLINK link previous PPLs onto us 02060 60930000 2 4 REG 256 LD R2 PPL R2 -> list of initial PPLs 02061 18C40001 3 IMM 257 ADD PFPTR 1 move to next page 02062 64C400AD 3 IMM 258 CPR PFPTR ENDOFSYS/WPP+MONPF have we done the last of the system? 02063 FE0A205D 259 JLE GENINITPPL if not, then keep building PPLs 260 * \ / 261 02064 60C40088 3 IMM 262 LD PFPTR PNINITPAGE the index to this page 02065 80934000 5 REG 263 PFRD R5 read my page file contents 02066 79402000 5 264 AND R5 PFCLNMASK mask off read-only bits 02067 DC402374 265 CALLNP BUILDPPL make a PPL for the initializer page 02068 E4891F10 2 4 ZBM 266 ST R2 PPL,PPLINK link previous list onto new PPL 02069 E5001E1D 4 267 ST PPL PPLINIT save pointer to entire list 0206A EC000388 268 STZ PFMAP(PNINITPAGE-NPS) clear out of the page file map 269 0206B 60C40083 3 IMM 270 LD PFPTR PNWNDO2 points to window 2 0206C 80D34000 5 REG 271 PFRC R5 read physical page number 0206D DC40235E 272 CALLNP GENPPL make a PPAGE element for this page 273 0206E 60C40084 3 IMM 274 LD PFPTR PNWNDO3 points to bootstrap page 0206F 80D34000 5 REG 275 PFRC R5 read physical page number 02070 DC40235E 276 CALLNP GENPPL make PPAGE element for this page 277 02071 60C40085 3 IMM 278 LD PFPTR PNWNDO4 another window used by the booter 02072 80D34000 5 REG 279 PFRC R5 get where he is 02073 DC40235E 280 CALLNP GENPPL generate control element 281 * \ / 282 02074 60000313 0 283 LD R0 FPSWITCHX get the boot time FP switches passed 02075 E4001EE0 0 284 ST R0 FPSWITCHB from PROMBOOT and save on headpage 02076 EC000312 285 STZ INTDEVICES initialize mask of devices that can interrupt 286 * \ / 287 288 ********************************************************************************** 289 * * 290 * Scan the slot table looking for memory, and if found * 291 * initialize it. We do this in a separate loop from the * 292 * initializing loop for PPUs and SSUs since they require a * 293 * fair amount of memory to build their control elements. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 311 (INITIAL) F 21 Initialization Routine 294 * Also, this way when we get to the PPUs we know for sure * 295 * whether there are any old MCUs around and will (or will * 296 * not) enable the PPU to do triple word transfers * 297 * accordingly. * 298 * Note that we use R7 as a flag to indicate whether * 299 * there are any MCUs on the system. (0 means all SMUs, 1 * 300 * means at least one MCU.) * 301 * * 302 ********************************************************************************** 303 304 * \ / 02077 60C40000 3 IMM 305 LD R3 0 slot loop counter 02078 61C40000 7 IMM 306 LD R7 0 assume all SMUs 00002079 307 NEXTMEM LABEL 02079 60260370 0 3 308 LD R0 IBSLOTS(R3) get this slots data word 0207A FA022088 0 309 JEQZ R0 NEXTONE jump if nobody home there 0207B 604A0040 1 0 CBM 310 LD R1 R0/WRU0TYPE fetch the type of the device 0207C 64440001 1 IMM 311 CPR R1 SLTTMEM is this a memory device? 0207D FE022084 312 JEQ DOMEM jump if so 0207E 64440004 1 IMM 313 CPR R1 SLTTSSU is it an SSU? 0207F FE0C2088 314 JNE NEXTONE jump if not 315 * \ / 316 317 * SSU in slot R3 02080 E4D78800 3 6 BASE 318 ST R3 SP,SLOTNUM save the slot number 02081 DC402172 319 CALLNP HAVESSU initialize our SSU 02082 60D78800 3 6 BASE 320 LD R3 SP,SLOTNUM get back the slot number 02083 FE0E2088 321 JMP NEXTONE move on 322 * --- 323 324 * MCU or SMU in slot R3 00002084 325 DOMEM LABEL 02084 E4D78800 3 6 BASE 326 ST R3 SP,SLOTNUM save the slot number 02085 DC402133 327 CALLNP HAVEMEMORY initialize our memory 02086 7DD20000 7 0 REG 328 IOR R7 R0 say if we are SMU or MCU 02087 60D78800 3 6 BASE 329 LD R3 SP,SLOTNUM get back the slot number 330 * \ / 331 00002088 332 NEXTONE LABEL 02088 18C40001 3 IMM 333 ADD R3 1 advance to next slot 02089 64C40010 3 IMM 334 CPR R3 NUMSLOTS see if we're done 0208A FE082079 335 JLT NEXTMEM jump if not, on to next device 336 * \ / 337 338 ********************************************************************************** 339 * * 340 * Scan the slot table and initialize PPUs and SSUs. We * 341 * also set the corresponding bit in INTDEVICES for any PPU or * 342 * SSU found since they may interrupt us. * 343 * * 344 ********************************************************************************** 345 0208B 60C40000 3 IMM 346 LD R3 0 loop slot counter 0000208C 347 NEXTDEVICE LABEL 0208C 60260370 0 3 348 LD R0 IBSLOTS(R3) get this slots data word 0208D FA02209B 0 349 JEQZ R0 EMPTYSLOTX jump if nobody home there 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 312 (INITIAL) F 21 Initialization Routine 0208E 604A0040 1 0 CBM 350 LD R1 R0/WRU0TYPE fetch the type of the device 0208F 60840000 2 IMM 351 LD R2 0 02090 E44A8030 1 2 CBM 352 ST R1 R2/SLOTTYPE make system table format 02091 64440002 1 IMM 353 CPR R1 SLTTCPU is this one a CPU? 02092 FE0C2094 354 JNE NOTACPU jump if not 02093 E40A8DA0 0 2 CBM 355 ST R0 R2/SLOTCPUI keep extra info about CPU 00002094 356 NOTACPU LABEL 02094 E4A61ECE 2 3 357 ST R2 SLOTTABLE(R3) place as what's in this slot 02095 64440003 1 IMM 358 CPR R1 SLTTPPU is it a PPU? 02096 FE0C209B 359 JNE EMPTYSLOTX jump if not 02097 E4D78800 3 6 BASE 360 ST R3 SP,SLOTNUM save the slot number 02098 6153C000 5 7 REG 361 LD R5 R7 let callee know if there are SMUs 02099 DC4021A4 362 CALLNP HAVEPPU call the initializer 0209A 60D78800 3 6 BASE 363 LD R3 SP,SLOTNUM get back the slot number 364 * \ / 365 0000209B 366 EMPTYSLOTX LABEL 0209B 18C40001 3 IMM 367 ADD R3 1 advance to next slot 0209C 64C40010 3 IMM 368 CPR R3 NUMSLOTS see if we're done 0209D FE08208C 369 JLT NEXTDEVICE jump if not, on to next device 0209E FE0E209F 370 JMP DONESLOTS jump when all slots initialized 371 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 313 (INITIAL) F 21 Initialization Routine 373 374 ********************************************************************************** 375 * * 376 * At this point we need enough whole pages in the * 377 * wholepage list until we go virtual. If we ever run out * 378 * during this initial processes I suggest that more pages be * 379 * given to the wholepage list. Note: be sure to adjust the * 380 * FSXCOUNT word appropriately. * 381 * Until now, the PPLs that have been created were hashed * 382 * into the PPUSDIDLE table, indexed by the slot number of the * 383 * corresponding MCU. We can now merge them into PPCLNIDLE to * 384 * produce a list that is evenly ordered with respect to MCU. * 385 * This results in a more distributed usage of MCUs. We assume * 386 * that we do not have to mess with the end-pointers in * 387 * PPENDIDLE. * 388 * The call to FREECHECK ensures that we have at least * 389 * (exactly?) one page in the WHOLEPAGE list. From there we * 390 * put one more page into the wholepage list. This should be * 391 * enough until we go virtual. * 392 * * 393 ********************************************************************************** 394 0000209F 395 DONESLOTS LABEL 0209F DC402396 396 CALLNP MERGEPPLS make one idle list from many 020A0 DC4023A6 397 CALLNP SPREADSYS distribute monitor pages to other MCUs 020A1 DC402387 398 CALLNP FREECHECK ensure presence of one page 020A2 DC402D1C 399 CALLNP GETIDLE request a free PPL 020A3 00026044 400 HALT HALTB6044 no pages for initial process 401 * No locks need be held since we are alone 020A4 60001C79 0 402 LD R0 WHOLEPAGE get the current head element 020A5 E4091F10 0 4 ZBM 403 ST R0 PPL,PPLINK link this additional page into the list 020A6 E5001C79 4 404 ST PPL WHOLEPAGE and make him the head cheese 405 * \ / 406 407 ********************************************************************************** 408 * * 409 * GETMEM has been setting the flags bit for free storage * 410 * expansion and decrementing the count word. At this point * 411 * we know there are at least two pages available in the * 412 * wholepage list. Here we want to set our equilibrium value * 413 * for the number of pages on the wholepage list. Since every * 414 * CPU could request a page and this could happen before * 415 * anyone reaches the dispatcher, we need at least one page * 416 * for every CPU. Here we calculate the number of pages needed * 417 * and alert the dispatcher. Good Luck!!! * 418 * * 419 ********************************************************************************** 420 421 * \ / 020A7 70001CF7 0 422 LDN R0 CPUCOUNT number of CPUs ( - ) 020A8 5007FFFE 0 IMM 423 MIN R0 -2 two pages is the minimum allocation 020A9 18040002 0 IMM 424 ADD R0 2 adjust for pages already there 020AA E4001C7A 0 425 ST R0 FSXCOUNT set equilibrium value (-) 020AB 60040004 0 IMM 426 LD R0 1*BIT FLFSX flag to start free storage routine 020AC FC001CF6 0 427 IORM R0 FLAGS let the dispatcher know 428 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 314 (INITIAL) F 21 Initialization Routine 429 430 ********************************************************************************** 431 * * 432 * We need to initialize the tail pointers for the idle * 433 * page list. This is done here so we don't have to do any * 434 * fancy checking when PUTIDLE is first called. * 435 * * 436 ********************************************************************************** 437 438 * \ / 020AD 6044001F 1 IMM 439 LD R1 IDLETBSZ-1 size of the idle page table 000020AE 440 INITIDLE LABEL 020AE 38221DDD 0 1 441 LEA R0 PPUSDIDLE(R1) create the tail address 020AF E4221DFD 0 1 442 ST R0 PPENDIDLE(R1) set it where it needs to be 020B0 FA6620AE 1 443 JDR R1 INITIDLE jump until zero done 444 * \ / 445 446 ********************************************************************************** 447 * * 448 * We now build a TCB for the SSU. Port 0. * 449 * * 450 ********************************************************************************** 451 452 * \ / 020B1 DC002ED0 453 CALL SGETMEM get area for a TCB 020B2 40440005 IMM 454 PARVL (TCBLNTH LOG 2) indicate size 020B3 61120000 4 0 REG 455 LD R4 R0 R4 => TCB 020B4 DC003090 456 CALL ZEROIT make it clean 020B5 41170800 4 BASE 457 PAR R4,0 pass address and 020B6 4044001D IMM 458 PARVL TCBLNTH length 020B7 60440005 1 IMM 459 LD R1 TCBLNTH LOG 2 020B8 6097101D 2 4 REG 460 LD R2 R4+TCBLNTH 020B9 DC402328 461 CALLNP FREEAFTER give back the unused area after 020BA E5001EE1 4 462 ST R4 FPTCB save pointer to SSU tcb 020BB EC090890 4 ZBM 463 STZ R4,TCTNUM terminal number zero 020BC EDC91A10 4 ZBM 464 STW R4,TCRFP this is the front panel term 020BD 60040002 0 IMM 465 LD R0 TCINTSNORM 020BE E4090249 0 4 ZBM 466 ST R0 R4,TCINTSTATE the front panel is always normal 020BF 60001F04 0 467 LD R0 TERMBASE pick up existing list 020C0 E4091F10 0 4 ZBM 468 ST R0 R4,TCLINK link it behind us and 020C1 E5001F04 4 469 ST R4 TERMBASE put onto list of TCB's 470 * \ / 471 472 ********************************************************************************** 473 * * 474 * Memory and the system is now together enough to * 475 * operate with some interrupts. We herein initialize the * 476 * vectors. * 477 * * 478 ********************************************************************************** 479 480 * \ / 020C2 DC402336 481 CALLNP BUILDIVT set up the interrupt vectors 482 * \ / 483 484 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 315 (INITIAL) F 21 Initialization Routine 485 * * 486 * Physical page zero ( the prom boot page ) is also used * 487 * by power fail restart. The power up routine must be loaded * 488 * into the physical page. The power fail routine must be * 489 * able to restore all page file locations, so pointers to all * 490 * physical pages are saved on physical page zero. * 491 * The power up routine is moved in two pieces so that a * 492 * HALT for unable to restart is always present. * 493 * * 494 ********************************************************************************** 495 496 * \ / 020C3 600420F7 0 IMM 497 LD R0 ADR PFCODE(1) 020C4 6044004C 1 IMM 498 LD R1 (PFCODELEN-1)*CPW 020C5 60840001 2 IMM 499 LD R2 ADR PWRUPADDR(1) 020C6 FE400000 500 CMOVE 020C7 600020F6 0 501 LD R0 PFCODE move over the first word 020C8 E4000000 0 502 ST R0 PWRUPADDR 503 * \ / 504 505 ********************************************************************************** 506 * * 507 * This code is most definitely temporary. * 508 * Unfortunately, the current PROMBOOT does not initialize * 509 * parts of page 0. Until PROMBOOT changes this code must * 510 * remain lest the crashdump routine die in the middle and * 511 * other anomalies occur. * 512 * The current version of PROMBOOT is B2.1 8412. * 513 * * 514 ********************************************************************************** 515 516 * \ / 020C9 60840300 2 IMM 517 LD R2 0300 zap locations 300:310 020CA 60440040 1 IMM 518 LD R1 16*CPW 16 words worth 020CB FE580000 519 CFILL 000 fill with zeros 020CC 6084031A 2 IMM 520 LD R2 031A zap locations 31A:35F 020CD 60440114 1 IMM 521 LD R1 69*CPW 46 words worth 020CE FE580000 522 CFILL 000 fill with zeros 523 * \ / 524 525 ********************************************************************************** 526 * * 527 * The dispatcher needs to map in page zero from time to * 528 * time to update the page map table, so we save the page map * 529 * value for physical page zero. * 530 * * 531 ********************************************************************************** 532 533 * \ / 020CF EC00031E 534 STZ RELESEFLAG let other processors go 020D0 60C40080 3 IMM 535 LD PFPTR MONPF+0 point to bootstrap page 020D1 80920000 0 REG 536 PFRD R0 get the page zero PF value 020D2 E4000380 0 537 ST R0 PFMAP(0) save in the power fail page map 020D3 80D20000 0 REG 538 PFRC R0 zap page zero for now 539 * \ / 540 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 316 (INITIAL) F 21 Initialization Routine 541 ********************************************************************************** 542 * * 543 * Create a user limit block (ULB) for an account that * 544 * doesn't exist in the system (!!!!!!!!!!!!.!!!!!!) but that * 545 * is used by this initial routine, by assorted overhead * 546 * routines, and by PSAs when logging on or off users. * 547 * * 548 ********************************************************************************** 549 550 * \ / 020D4 DC002ED0 551 CALL SGETMEM allocate the ULB space 020D5 40440004 IMM 552 PARVL ULLOG indicate desired size 020D6 E4001EAE 0 553 ST R0 SYSTEMULB save pointer to same 020D7 DC003090 554 CALL ZEROIT clear it out 020D8 41160800 0 BASE 555 PAR R0,0 020D9 40440010 IMM 556 PARVL 2 POWER ULLOG 020DA 61001EAE 4 557 LD ULB SYSTEMULB 020DB 620023D2 01 558 LD2 R0 SYSACTNAM set system account name 020DC E6170802 014 BASE 559 ST2 R0 ULB,ULACCNM 020DD 600023D4 0 560 LD R0 SYSACTPROJ 020DE E4170804 0 4 BASE 561 ST R0 ULB,ULACCPROJ 562 * 020DF D1570808 4 BASE 563 STMW ULB,ULTIMLIM set no limits upon us 020E0 D157080A 4 BASE 564 STMW ULB,ULWLCKLIM 020E1 D149318C 4 ZBM 565 STMW ULB,ULDSKWARN 020E2 D149018C 4 ZBM 566 STMW ULB,ULDSKSAVL 020E3 D149218D 4 ZBM 567 STMW ULB,ULDSKLIM 020E4 60040800 0 IMM 568 LD R0 0800 020E5 E4170805 0 4 BASE 569 ST R0 ULB,ULBUSYWORD set it busy enough to not go away 020E6 EDC90081 4 ZBM 570 STW ULB,ULDRIVE say system disk is home 020E7 60040765 0 IMM 571 LD R0 ULIDVAL get the marker indicating ULB 020E8 E40908B0 0 4 ZBM 572 ST R0 ULB,ULIDENT say this is really a ULB 573 * \ / 574 575 ********************************************************************************** 576 * * 577 * Create a process to do the rest of the system * 578 * initialization. There should be at least one page * 579 * available since we call GETPAGE from within BLDPROCESS. * 580 * * 581 ********************************************************************************** 582 583 * \ / 020E9 DC0035D2 584 CALL BLDPROCESS build the process 020EA 4144F1F0 IMM 585 PARV MONMSR indicate monitor relocation 020EB 43440000 IMM 586 PARV2 0 name of process 020EC 4144B01B IMM 587 PARV ADR INITPROC PC of initial process 020ED 40440001 IMM 588 PARVL 1 indicate system process 589 * \ / 590 * R3 => PSA, PCB 591 592 ********************************************************************************** 593 * * 594 * Give our process enough privileges so it can do all * 595 * sorts of useful (and dangerous) things. ( Notice that * 596 * these fields are assumed zero when we arrive here which * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 317 (INITIAL) F 21 Initialization Routine 597 * disables restrictions ) * 598 * * 599 ********************************************************************************** 600 601 * \ / 020EE 6088C116 2 3 ZBM 602 LD R2 R3,PSCURRPROC get pointer to UPC 020EF EDC8D214 3 ZBM 603 STW R3,PSCNTLMODE non virtual control mode semaphore 020F0 EDC88610 2 ZBM 604 STW R2,UPCNTLMODE in control mode 020F1 EC089210 2 ZBM 605 STZ R2,UPOPREQ operator functions OK too 020F2 EC088A20 2 ZBM 606 STZ R2,UPCPRIV/(UPMANAGRB+UPBACKUPB) manager and backup requests 607 * \ / 608 609 ********************************************************************************** 610 * * 611 * Set our process up to run and then let the other * 612 * processors in the system go. * 613 * * 614 ********************************************************************************** 615 616 * \ / 020F3 DC402B99 617 CALLNP SETRUNNING set the process runnable 020F4 DC4025FC 618 CALLNP MAPOUTMEM no one should be mapped in at this point 619 020F5 FE0E2885 620 JMP STARTUP clear page file and into the dispatcher 621 * --- 622 623 ********************************************************************************** 624 * * 625 * Power up code. This code is loaded over the PROMBOOT * 626 * code in memory page zero. It gains control in the power up * 627 * restart. * 628 * * 629 ********************************************************************************** 630 000020F6 631 PFCODE DRCT PWRUPADDR produce code that loads at 0 632 020F6 FE0E0003 633 JMP REALSTART jump over the identifier 634 * --- 635 020F7 50462043 636 TEXTZ "PF CODE" 637 638 ********************************************************************************** 639 * * 640 * The page file is full of self test results (garbage). * 641 * Make every user page (except ours) illegal to reference. * 642 * * 643 ********************************************************************************** 644 00000003 645 REALSTART LABEL 020F9 60C400FF 3 IMM 646 LD PFPTR PFSIZE-1 number of PF locations 647 00000004 648 CLEARLOOP LABEL 020FA 64C40080 3 IMM 649 CPR PFPTR PNPAGEZERO check for page that we're in 020FB FE020007 650 JEQ SKIPCLEAR skip self 020FC 80D28000 2 REG 651 PFRC R2 Read and clear PF location 00000007 652 SKIPCLEAR LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 318 (INITIAL) F 21 Initialization Routine 020FD FAE60004 3 653 JDR PFPTR CLEARLOOP repeat for all pages 654 * \ / 655 020FE 60C400FF 3 IMM 656 LD PFPTR MONPF+NPS-1 load address of last monitor page 00000009 657 LOADLOOP LABEL 020FF 64C40080 3 IMM 658 CPR PFPTR PNPAGEZERO we are done after arrival... 02100 FE0A000F 659 JLE LOADDONE ... at our own page 02101 60260300 0 3 660 LD R0 PFMAP(PFPTR-MONPF) get the map value 02102 FA02000E 0 661 JEQZ R0 LOADEND see if unloaded 02103 00D20000 0 REG 662 LDPF R0 otherwise, restore PF location 0000000E 663 LOADEND LABEL 02104 FAE60009 3 664 JDR PFPTR LOADLOOP do all monitor pages, 665 * --- stopped before fallout 666 0000000F 667 LOADDONE LABEL 668 * Now map in CPU page for this CPU 02105 D9124000 1 REG 669 STMSR R1 Fetch MSR to find who we are 02106 604A7840 1 1 CBM 670 LD R1 R1/MSRSLOT isolate our slot number 02107 60C40081 3 IMM 671 LD PFPTR PNCPUPAGE get CPU page number 02108 00E20360 1 672 LDPF CPUPT(R1) load up PF for individual CPU page 673 * \ / 674 02109 FE0E278F 675 JMP POWERUP now into the system to continue 676 * --- 677 678 DRCT don't forget to restore symbol defs 00000014 ABS 679 PFCODELEN EQU DISPW PFCODE 680 681 END JB1 INITIAL routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 319 (INITIAL) F 21 Initialization Routine 683 684 ********************************************************************************** 685 * * 686 * SUCKERS - All of the other CPUs enter here. * 687 * This is the secondary entry point for the system * 688 * overlay. Basicly, these clods twiddle their bits until * 689 * it's time to run the system. They then load up their page * 690 * files and scratch off. * 691 * * 692 * Stack required = 3. * 693 * 0 + max ( BUILDIVT (3) ) * 694 * * 695 ********************************************************************************** 696 697 BLOCK SUCKERS routine 698 ENTRY SUCKERS 699 0000210A 700 SUCKERS LABEL 0210A D0001CF7 701 INC CPUCOUNT count number of CPUs 0210B D0001CFA 702 INC CPUINIT say another CPU on initial page 0210C BC001CF8 0 703 INCL R0 CPUCOUNT1 ...twice since we need two counts 704 * and this gives us an index 0210D D9130000 4 REG 705 STMSR R4 get a copy of our MSR 0210E 610B3840 4 4 CBM 706 LD R4 R4/MSRSLOT extract our slot number 0210F E5201CFA 4 0 707 ST R4 CPUSLOTS(R0-1) store CPU slot number into table using index 708 * \ / 709 710 ********************************************************************************** 711 * * 712 * Fetch a page for the CPUPAGE for this machine. We are * 713 * racing with the primary CPU and other secondary CPUs but * 714 * the INCLs are interlocked instructions. We make an entry * 715 * in CPUPT so that all CPUs end up knowing where the pages * 716 * are. * 717 * * 718 ********************************************************************************** 719 720 * \ / 02110 60C40081 3 IMM 721 LD PFPTR PNCPUPAGE load the virtual page number 02111 BC000311 0 722 INCL R0 PHPNAV get next available physical page 02112 00D20000 0 REG 723 LDPF R0 load up the page file 02113 E4280360 0 4 724 ST R0 CPUPT(R4) save page map value for other CPUs 02114 60441000 1 IMM 725 LD R1 CPP 02115 60840400 2 IMM 726 LD R2 ADR CPUPAGE 02116 FE580000 727 CFILL 0 clear out the CPU page 02117 E5000415 4 728 ST R4 OURSLOT save this CPUs slot number 02118 EC000462 729 STZ MEMERRFLAG indicate not processing memory error 02119 60002832 0 730 LD R0 STACKIDENT 0211A E400042D 0 731 ST R0 RESSTAKTOP set stack identifier 0211B 6184044D 6 IMM 732 LD SP ADR RESSTAK initialize stack pointer 733 * \ / 734 735 ********************************************************************************** 736 * * 737 * Unmap the windows that were left mapped by DISKBOOT. * 738 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 320 (INITIAL) F 21 Initialization Routine 739 ********************************************************************************** 740 741 * \ / 0211C 60C40082 3 IMM 742 LD PFPTR PNWNDO1 unmap window1 0211D 80D20000 0 REG 743 PFRC R0 0211E 60C40083 3 IMM 744 LD PFPTR PNWNDO2 unmap window2 0211F 80D20000 0 REG 745 PFRC R0 02120 60C40084 3 IMM 746 LD PFPTR PNWNDO3 unmap window3 02121 80D20000 0 REG 747 PFRC R0 02122 60C40085 3 IMM 748 LD PFPTR PNWNDO4 unmap window4 02123 80D20000 0 REG 749 PFRC R0 750 * \ / 751 00002124 752 WAITRELESE LABEL 02124 5C00031E 753 CMZ RELESEFLAG check for OK to go 02125 FE0C2124 754 JNE WAITRELESE jump back if not 755 * \ / 756 757 ********************************************************************************** 758 * * 759 * Load up the page file with all of the permanently * 760 * resident pages. DISKBOOT has already loaded our page file * 761 * to map the pages that it loaded, however, the primary CPU * 762 * has mapped some more pages since then. So we do it all * 763 * again. * 764 * * 765 ********************************************************************************** 766 767 * \ / 02126 60C40087 3 IMM 768 LD PFPTR PNHEADPAGE load page number 00002127 769 MORELOAD LABEL 02127 64C40100 3 IMM 770 CPR PFPTR PFSIZE see if we've gone too far 02128 FE06212D 771 JGE PLOADED exit if so 02129 60A60300 2 3 772 LD R2 PFMAP(-MONPF)(PFPTR) load the map word 0212A FA82212C 2 773 JEQZ R2 NOLOAD jump if nothing here 0212B 00D28000 2 REG 774 LDPF R2 load up the page file 0000212C 775 NOLOAD LABEL 0212C FAE02127 3 776 IRJ PFPTR MORELOAD advance to next page, 777 * --- stopped by compare test 778 779 0000212D 780 PLOADED LABEL 781 * Now set up the interrupt vectors for each 782 * individual processor 783 0212D DC402336 784 CALLNP BUILDIVT set up the interrupt vectors 785 * get rid of the boot pages 0212E 60C40080 3 IMM 786 LD PFPTR MONPF+0 points to the prom boot page 0212F 80D20000 0 REG 787 PFRC R0 zap the page file entry 02130 60C40084 3 IMM 788 LD PFPTR PNBOOTLOC points to the disk boot page 02131 80D20000 0 REG 789 PFRC R0 zap the page file entry 790 791 02132 FE0E2885 792 JMP STARTUP off to see the wizard (we must be) 793 * --- 794 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 321 (INITIAL) F 21 Initialization Routine 795 END SUCKERS routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 322 (INITIAL) F 21 Initialization Routine 797 798 ********************************************************************************** 799 * * 800 * HAVEMEMORY - Generate PPAGE Elements for a Memory * 801 * We scan through the slot table. Each memory is carved * 802 * up into pages and a PPL is generated for each page. As * 803 * this is going on, we are using up free memory like mad (for * 804 * the PPLs). In order not to die a horrible death (use up * 805 * more free storage than was provided by the freeing of the * 806 * CPUPAGEs), we check every time around the loop and keep * 807 * replenishing the supply of whole pages in the free storage * 808 * list. * 809 * Several pages are taken by the boot routine to read * 810 * the resident system into. The location PHPNAV has the PF * 811 * contents for the last such allocated page. If the memory * 812 * box being configured here is the memory that was booted * 813 * into (known by comparing against the slot number in the * 814 * PHPNAV), we do not generate PPL's for those pages up to and * 815 * including PHPNAV. Call: * 816 * * 817 * LD R0 * 818 * LD R3 * 819 * CALLNP HAVEMEMORY * 820 * R0 = 0 if this is SMU * 821 * * 822 * Eats R0:R5. * 823 * Stack required = 8 * 824 * 6 + max ( FREECHECK (2), GENPPL (2), MAYBESMU (2) ) * 825 * * 826 ********************************************************************************** 827 828 BLOCK HAVEMEMORY subroutine 829 ENTRY HAVEMEMORY 830 831 BEGFRAME 00178801 6 BASE 832 MEMMASK BSS 1 number of pages described by each bit 833 * of WRUMEMHERE, less one. 00178802 6 BASE 834 MEMBITS BSS 1 bits for memory addresses present, 835 * from WRUMEMHERE. 00178803 6 BASE 836 MEMPFILE BSS 1 running page file value. 00178804 6 BASE 837 LASTSYS BSS 1 lowest page in memory used by system, or -1 if none 00178805 6 BASE 838 SMUFLAG BSS 1 0 sez this is an SMU 839 ENDFRAME 840 02133 DD5F8006 6 STAK 841 HAVEMEMORY ENTRNP PUSH 02134 DC402161 842 CALLNP MAYBESMU see if SMU and build element if so 02135 E4578805 1 6 BASE 843 ST R1 SP,SMUFLAG save indication of SMU or not 02136 EC178803 6 BASE 844 STZ SP,MEMPFILE clean out page file 02137 D1578804 6 BASE 845 STMW SP,LASTSYS assume we didn't boot from this mem 02138 E4C98843 3 6 ZBM 846 ST R3 SP,MEMPFILE/PFSLOT save slot number in page file 02139 60400311 1 847 LD R1 PHPNAV last page used by boot routine 0213A 64CA4840 3 1 CBM 848 CPR R3 R1/PFSLOT did we use this memory? 0213B FE0C213E 849 JNE NOTBOOTMEM jump if not 0213C 78402000 1 850 AND R1 PFCLNMASK clean out garbage bits in page file 0213D E4578804 1 6 BASE 851 ST R1 SP,LASTSYS last used system page 0000213E 852 NOTBOOTMEM LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 323 (INITIAL) F 21 Initialization Routine 853 0213E 600A2040 0 0 CBM 854 LD R0 R0/WRUMEMINC description of size of blocks of mem 855 * (see WRUMEMINC description) 0213F 60440010 1 IMM 856 LD R1 16 00002140 857 MEMDOUBLE LABEL 02140 18524000 1 1 REG 858 ADD R1 R1 double piece size each time around 02141 FA262140 0 859 JDR R0 MEMDOUBLE 860 * \ / 861 * Now, R1 has the number of pages that are described by 862 * each bit of the memory's WRU4 response. 863 * \ / 02142 10440001 1 IMM 864 SUB R1 1 turn into mask of lower bits 02143 E4578801 1 6 BASE 865 ST R1 MEMMASK save it 02144 6012C000 0 3 REG 866 LD R0 R3 slot number 02145 1C040010 0 IMM 867 MUL R0 WRUIMAX index for array 02146 60200204 0 0 868 LD R0 WRUIPROTO/WRU4(R0) get WRU4 response 02147 F62C215F 0 869 JBT R0/WRUMEMNONE RETURN jump if no memory connected 02148 F22E214D 0 870 JBF R0/WRUMEMBAD SETUPBLOCK jump if memory is useable 871 * \ / 872 * This memory is not useable. Let's say so. 873 * \ / 02149 18C0214C 3 874 ADD R3 STOPINST build a stop instruction 0214A 5D52C000 3 REG 875 XCT R3 do it. 0214B FE0E215F 876 JMP RETURN if he wants to RUN, skip this MCU 877 * --- 878 0214C 00826000 879 STOPINST STOP STOPB600X memory cabled wrong to MCU 880 0000214D 881 SETUPBLOCK LABEL 0214D 600A3080 0 0 CBM 882 LD R0 R0/WRUMEMHERE get bits for addresses present 883 * \ / 884 * Each time through the following loop builds the PPL's for 885 * one contiguous chunk of memory (MEMMASK+1 pages). 886 * \ / 0000214E 887 BUILDBLOCK LABEL 0214E E4178802 0 6 BASE 888 ST R0 SP,MEMBITS save the bits 0214F F63E2154 0 889 JBT R0/BIT 31 BUILDPAGE jump if the memory is really here 890 * \ / 891 * Here, the block doesn't exist. Just increment the page number. 892 * \ / 02150 60178801 0 6 BASE 893 LD R0 SP,MEMMASK 02151 60161001 0 0 REG 894 LD R0 R0+1 number of pages per chunk 02152 98178803 0 6 BASE 895 ADDM R0 SP,MEMPFILE increment counter 02153 FE0E215D 896 JMP NEXTBLOCK 897 * --- 898 00002154 899 BUILDPAGE LABEL 02154 D0001CC8 900 INC TOTALPAGES say one more page exists 02155 61578803 5 6 BASE 901 LD R5 SP,MEMPFILE page file value for first page 02156 65578804 5 6 BASE 902 CPR R5 SP,LASTSYS page used by boot? 02157 FE0A215A 903 JLE NOREGENSYS if so, no PPL wanted 02158 DC40235E 904 CALLNP GENPPL build a PPL for it 02159 DC402387 905 CALLNP FREECHECK check for free storage availability 0000215A 906 NOREGENSYS LABEL 0215A BC178803 0 6 BASE 907 INCL R0 SP,MEMPFILE increment to next page 0215B 78178801 0 6 BASE 908 AND R0 SP,MEMMASK are we done with one block? 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 324 (INITIAL) F 21 Initialization Routine 0215C FA0C2154 0 909 JNEZ R0 BUILDPAGE jump if not 910 * \ / 0000215D 911 NEXTBLOCK LABEL 0215D 600981F2 0 6 ZBM 912 LD R0 SP,MEMBITS/BITS 0:30 remove bit for work done 0215E FA0C214E 0 913 JNEZ R0 BUILDBLOCK jump if more to do 914 * \ / 915 0000215F 916 RETURN LABEL 0215F 60178805 0 6 BASE 917 LD R0 SP,SMUFLAG return 0 if SMU, 1 if not 02160 5D1F8006 6 STAK 918 LEAVE POP all done 919 * --- 920 921 END HAVEMEMORY subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 325 (INITIAL) F 21 Initialization Routine 923 924 ********************************************************************************** 925 * * 926 * Here we check to see if this memory unit is a SMU and * 927 * if so build an element for it and link it into the SMULIST. * 928 * Call: * 929 * * 930 * LD R0 * 931 * LD R3 * 932 * CALLNP MAYBESMU * 933 * R1 = 0 if SMU, 1 if not * 934 * * 935 * Eats R1. * 936 * Stack required = 2. * 937 * 2 + max (SGETMEM (0) ) * 938 * * 939 ********************************************************************************** 940 941 BLOCK MAYBESMU subroutine 942 ENTRY MAYBESMU 943 944 BEGFRAME 00178801 6 BASE 945 SAVER0 BSS 1 temp for R0 946 ENDFRAME 947 02161 DD5F8002 6 STAK 948 MAYBESMU ENTRNP PUSH 02162 604A1040 1 0 CBM 949 LD R1 R0/WRUMEMDEVT get memory device type bits 02163 64440001 1 IMM 950 CPR R1 WRU0SMUDEV is it a SMU? 02164 FE0C2170 951 JNE NOTSMU if not then leave 952 * \ / 953 02165 E4178801 0 6 BASE 954 ST R0 SP,SAVER0 save this register 02166 DC002ED0 955 CALL SGETMEM get a chunk for the element 02167 40440000 IMM 956 PARVL SMUBLKLOG how big of a piece to get 02168 EC160800 0 BASE 957 STZ R0,0 make it empty 02169 E4C80040 3 0 ZBM 958 ST R3 R0,SMUSLOT put in the slot number 0216A 60401EFE 1 959 LD R1 SMULIST get pointer to list 0216B E4481F10 1 0 ZBM 960 ST R1 R0,SMULINK link it to the new element 0216C E4001EFE 0 961 ST R0 SMULIST make ours the new list head 0216D 60178801 0 6 BASE 962 LD R0 SP,SAVER0 restore R0 0216E 60440000 1 IMM 963 LD R1 0 say we are an SMU 0216F 5D1F8002 6 STAK 964 LEAVE POP 965 * --- 966 00002170 967 NOTSMU LABEL 02170 60440001 1 IMM 968 LD R1 1 say we are an MCU 02171 5D1F8002 6 STAK 969 LEAVE POP 970 * --- 971 972 END of MAYBESMU subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 326 (INITIAL) F 21 Initialization Routine 974 975 ********************************************************************************** 976 * * 977 * HAVESSU - Initialize the SSU. * 978 * The SSU was found in slot R3. Here we initialize it by * 979 * getting the information from the real time clock and the * 980 * front panel and then setting up the basic timer interrupts. * 981 * The initial process will verify the reasonableness of * 982 * the real time clock. Until then, we will use whatever * 983 * value is in the SSU clock without verification. The * 984 * interval timing will work fine no matter what value happens * 985 * to be in the clock. Call: * 986 * * 987 * LD R0 * 988 * LD R3 * 989 * CALLNP HAVESSU * 990 * * 991 * Eats R0:R5. * 992 * Stack required = 6. * 993 * 1 + max ( SSU_RESET (5), TIMESET (2) ) * 994 * * 995 ********************************************************************************** 996 997 BLOCK HAVESSU subroutine 998 ENTRY HAVESSU 999 1000 BEGFRAME 1001 ENDFRAME 1002 02172 DD5F8001 6 STAK 1003 HAVESSU ENTRNP PUSH 02173 EDF62001 3 @ 1004 STW @PTRINTDEV(R3) say this slot interrupts 02174 604A3080 1 0 CBM 1005 LD R1 R0/WRU0MREV SSU version number 02175 6444000D 1 IMM 1006 CPR R1 MINVERSION new enough for BREAK and DWELL handling? 02176 ECC01EE4 1007 STLGE SSUVER set flag 1008 * \ / 02177 60040005 0 IMM 1009 LD R0 SSUCOFFSET/FLDABSPG get displacement part 02178 E4CA0840 3 0 CBM 1010 ST R3 R0/PFSLOT make PF to get at SSU 02179 64000310 0 1011 CPR R0 SSUPF is this the same one as used by DISKBOOT? 0217A FE0C219C 1012 JNE NOTACTIVE jump if not, must be hot spare 1013 * (later, may have special processing for it) 0217B E4001EDE 0 1014 ST R0 CLOCKPF save for later use by system 0217C E4D0219D 3 @ 1015 ST R3 @PTRSSUCONT remember the SSU place 1016 * \ / 0217D 3800219E 0 1017 LEA R0 OCLKPARAMS old NVM clock parameter values 0217E 6444000F 1 IMM 1018 CPR R1 NVMVERSION check if SSU has new NVM 0217F FE082181 1019 JLT SETCLKPARMS jump if not 02180 380021A1 0 1020 LEA R0 NCLKPARAMS new NVM clock parameter values 00002181 1021 SETCLKPARMS LABEL 02181 6044000C 1 IMM 1022 LD R1 CLKPARMLEN*CPW need to set three words 02182 38801EF6 2 1023 LEA R2 NVMCLOCKS move values to the head page 02183 FE400000 1024 CMOVE that should do it 1025 * \ / 02184 DC4044C9 1026 CALLNP SSU_RESET call to initialize the SSU 1027 * \ / 02185 0CC00000 1028 IOFF for calls to TIMESET 02186 DC0044F8 1029 CALL TIMESET set up the one second events 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 327 (INITIAL) F 21 Initialization Routine 02187 434403E8 IMM 1030 PARV2 1*MSECSS one second events 02188 41440000 IMM 1031 PARV 0 any CPU okay 02189 4100472B 1032 PAR ONCEASEC address of routine to call 0218A 40440000 IMM 1033 PARVL 0 1034 * \ / 0218B DC0044F8 1035 CALL TIMESET set up deadman I/O timer 0218C 43442710 IMM 1036 PARV2 10*MSECSS use 10 second interval 0218D 41440000 IMM 1037 PARV 0 don't care which CPU 0218E 41004E5E 1038 PAR DEADMAN who to call 0218F 40440000 IMM 1039 PARVL 0 parameter unused 02190 E5001EF3 4 1040 ST TMR DEADMANTMR save serial number for power fail 1041 * \ / 02191 DC0044F8 1042 CALL TIMESET core scheduler interrupt 02192 434407D0 IMM 1043 PARV2 2*MSECSS two seconds for now 02193 41440000 IMM 1044 PARV 0 no CPU in particular 02194 41002C91 1045 PAR TICK 02195 40440000 IMM 1046 PARVL 0 1047 * \ / 02196 DC0044F8 1048 CALL TIMESET file wait unqueuer 02197 4344EA60 IMM 1049 PARV2 60*MSECSS once per minute 02198 41440000 IMM 1050 PARV 0 no CPU in particular 02199 4100474D 1051 PAR UNFILEWAIT who to call 0219A 40440000 IMM 1052 PARVL 0 parameter 1053 * \ / 0219B 0C800000 1054 ION restore interrupts 0000219C 1055 NOTACTIVE LABEL 0219C 5D1F8001 6 STAK 1056 LEAVE POP then return 1057 * --- 1058 0219D E1080312 1059 PTRSSUCONT PTR INTDEVICES/BITS 28:31 SSU location 1060 0000219E 1061 OCLKPARAMS LABEL 0219E 00000050 1062 VFD ONVMCLOCKS base address for start of clock values 0219F 00000004 1063 VFD 04 number of clock values (must be power of two) 021A0 00000003 1064 VFD 03 mask used to wrap around clock value index 00000003 ABS 1065 CLKPARMLEN EQU DISPW OCLKPARAMS 1066 000021A1 1067 NCLKPARAMS LABEL 021A1 00000300 1068 VFD NNVMCLOCKS base address for start of clock values 021A2 00000040 1069 VFD 040 number of clock values (must be power of two) 021A3 0000003F 1070 VFD 03F mask used to wrap around clock value index 1071 1072 END HAVESSU subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 328 (INITIAL) F 21 Initialization Routine 1074 1075 ********************************************************************************** 1076 * * 1077 * HAVEPPU - Configure a PPU * 1078 * A PPU is on the bus. We create the control element * 1079 * for it that contains the PF pointer to the PPU and then * 1080 * check out and configure the devices that are on the * 1081 * channels. * 1082 * Call: * 1083 * LD R0 WRU response * 1084 * LD R3 slot number * 1085 * R5 = 0 if no MCUs on system * 1086 * CALLNP HAVEPPU * 1087 * * 1088 * Eats R0:R5. * 1089 * Stack required = 19. * 1090 * 2 + max ( COMMDEV (9), CTCDEV (17), DISKDEV (12), * 1091 * FREECHECK (2), LPCDEV (11), MTCDEV (17), * 1092 * SETPPU3WRD (1), SGETMEM (0), VTCDEV (17), * 1093 * ZEROIT (1) ) * 1094 * * 1095 ********************************************************************************** 1096 1097 BLOCK HAVEPPU subroutine 1098 ENTRY HAVEPPU 1099 1100 BEGFRAME 00178801 6 BASE 1101 TEMPWRU0 BSS 1 temp place for WRU0 00178801 6 BASE 1102 PPUELEMENT EQU TEMPWRU0 holds PPU element address 1103 ENDFRAME 1104 021A4 DD5F8002 6 STAK 1105 HAVEPPU ENTRNP PUSH 021A5 EDF62001 3 @ 1106 STW @PTRINTDEV(R3) say this slot interrupts 021A6 E4178801 0 6 BASE 1107 ST R0 SP,TEMPWRU0 save the WRU0 response for later 1108 * R3=slot number 021A7 DC002ED0 1109 CALL SGETMEM get the control block 021A8 40440003 IMM 1110 PARVL PPULOG indicate desired size 021A9 61120000 4 0 REG 1111 LD R4 R0 R4 => PPU control block 021AA DC003090 1112 CALL ZEROIT clean it out 021AB 41170800 4 BASE 1113 PAR R4,0 021AC 40440008 IMM 1114 PARVL 2 POWER PPULOG 021AD 604AF000 1 3 CBM 1115 LD R1 R3*PFSLOT produce page map value from slot # 021AE E4570800 1 4 BASE 1116 ST R1 R4,PPUPF remember addressing PF 021AF 7D02C000 4 IMM 1117 IOR R4 SLTTPPU*SLOTTYPE 021B0 E5261ECE 4 3 1118 ST R4 SLOTTABLE(R3) place block in slot table 1119 * \ / 1120 1121 ********************************************************************************** 1122 * * 1123 * Due to ever improving hardware and a certain lack of * 1124 * compatibilty between some of the new features and the old * 1125 * hardware we are forced to keep close track of what versions * 1126 * of various hardware types are on the system and enable * 1127 * certain capabilities accordingly. * 1128 * In particular, if it has been determined that all * 1129 * memory modules on the system are SMUs then we may enable * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 329 (INITIAL) F 21 Initialization Routine 1130 * new versions of PPUs to perform triple word transfers. * 1131 * Note that if we were to enable all PPUs, regardless of * 1132 * rev, old PPUs would bus error as we would be doing a store * 1133 * to a non-defined location on the PPU. Similarly if we were * 1134 * to enable all new PPUs, regardless of types of memory, the * 1135 * MCUs would bus error as they are not designed to handle * 1136 * triple word transfers. * 1137 * To add to the complexity, the microcode revisions * 1138 * leapfrog, with varying revisions being for PPU3 or PPU4, as * 1139 * needed. The test is done using a bit map for the * 1140 * revisions, so it can be patched if needed. * 1141 * * 1142 ********************************************************************************** 1143 1144 * R5 = 0 if no MCUs on system 1145 * \ / 021B1 FB4C21B8 5 1146 JNEZ R5 NOTRIPLES if not zero then there are MCUs 021B2 6009B081 0 6 ZBM 1147 LD R0 SP,TEMPWRU0/WRU0MREV get microcode revision 021B3 5C3021D4 0 @ 1148 CMZ @PPUREV3MP(R0) is it new enough for 3 word transfers? 021B4 FE0221B8 1149 JEQ NOTRIPLES no triples for this PPU 1150 * \ / 1151 021B5 7905FFFF 4 IMM 1152 AND R4 ONEBITS/FLDADRS get rid of unnecessary crap 021B6 EDD70803 4 BASE 1153 STW R4,PPU3WORD set flag saying we can do triple worders 021B7 DC404F0B 1154 CALLNP SETPPU3WRD now enable this PPU to do triplers 1155 * \ / 000021B8 1156 NOTRIPLES LABEL 021B8 61440000 5 IMM 1157 LD R5 0 start with channel zero 021B9 E5178801 4 6 BASE 1158 ST R4 SP,PPUELEMENT save address 1159 * \ / 1160 1161 ********************************************************************************** 1162 * * 1163 * Loop through all of the channels and initialize the * 1164 * devices there. * 1165 * * 1166 ********************************************************************************** 1167 1168 * \ / 000021BA 1169 CHANGETI LABEL 021BA DC402387 1170 CALLNP FREECHECK ensure enough memory available 021BB 61178801 4 6 BASE 1171 LD R4 SP,PPUELEMENT restore address 021BC 60C40086 3 IMM 1172 LD PFPTR PNCIX page file for IO 021BD 60170800 0 4 BASE 1173 LD R0 R4,PPUPF 021BE 7C0B4C00 0 5 CBM 1174 IOR R0 R5*PPUCHAN create the PF value to address the device 021BF 00D20000 0 REG 1175 LDPF R0 set addressing to the channel 021C0 EC001801 1176 STZ CIX(PPUABORT) zap any foolishness 021C1 FEC00000 1177 NOP 0 waste time for PPU 021C2 D1401803 1178 STMW CIX(PPUSCSTAT) clear any status bits we can 021C3 FEC00000 1179 NOP 0 waste time for PPU 021C4 60001800 0 1180 LD R0 CIX(PPUCABLED) get WRU of who's there (0 if none) 021C5 E41D2804 0 45 BASE 1181 ST R0 R4,PPUCNTLPTR(R5) save for later processing 021C6 604A0080 1 0 CBM 1182 LD R1 R0/DWRUTYPE get the type of device 021C7 6844000C 1 IMM 1183 UCPR R1 DEVJMPMAX within range? 021C8 FE0621CD 1184 JGE FORGETDEV jump if not 021C9 606221D5 1 1 1185 LD R1 DEVJMPTAB(R1) R1 -> device initializer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 330 (INITIAL) F 21 Initialization Routine 021CA FA7021CD 1 1186 JZA R1 FORGETDEV jump if unknown device 021CB DC564400 1 @R 1187 CALLNP @R1 call the initializer 021CC FE0E21CF 1188 JMP AFTERDEV 1189 * --- 1190 000021CD 1191 FORGETDEV LABEL 021CD 60440000 1 IMM 1192 LD R1 0 unknown so forget about it 021CE EC1D2804 45 BASE 1193 STZ R4,PPUCNTLPTR(R5) 1194 * \ / 000021CF 1195 AFTERDEV LABEL 021CF 19440001 5 IMM 1196 ADD R5 1 advance to next channel 021D0 65440004 5 IMM 1197 CPR R5 PPUCHANS check for done 021D1 FE0821BA 1198 JLT CHANGETI jump if another channel 021D2 5D1F8002 6 STAK 1199 LEAVE POP else return 1200 * --- 1201 021D3 00000AAA 1202 PPUREV3MSK VFD 00000AAA mask of PPU revs that can handle triple word transfers 021D4 004821D3 1203 PPUREV3MP PTR PPUREV3MSK/BIT 0 pointer to mask word 1204 1205 ********************************************************************************** 1206 * * 1207 * Device initialization routines are entered with: * 1208 * R4 => PPU control element * 1209 * R5 = channel number * 1210 * R6 => stack * 1211 * These registers must be restored by the controller * 1212 * configuration routines. They should exit to CNTLCNFIG. * 1213 * * 1214 ********************************************************************************** 1215 000021D5 1216 DEVJMPTAB LABEL 021D5 00000000 1217 VFD 0 00 - empty slot 021D6 000021E1 1218 VFD ADR DISKDEV 01 - disk controller 021D7 00002282 1219 VFD ADR LPCDEV 02 - line printer controller 021D8 00000000 1220 VFD 0 03 - unknown 021D9 00000000 1221 VFD 0 04 - unknown 021DA 00000000 1222 VFD 0 05 - unknown 021DB 00000000 1223 VFD 0 06 - unknown 021DC 00000000 1224 VFD 0 07 - unknown 021DD 00002217 1225 VFD ADR COMMDEV 08 - async. comm. controller 021DE 000022B3 1226 VFD ADR MTCDEV 09 - mag tape controller 021DF 0000229D 1227 VFD ADR CTCDEV 0A - cartridge mag tape controller 021E0 000022CA 1228 VFD ADR VTCDEV 0B - video tape controller 0000000C ABS 1229 DEVJMPMAX EQU DISPW DEVJMPTAB 1230 1231 END HAVEPPU subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 331 (INITIAL) F 21 Initialization Routine 1233 1234 ********************************************************************************** 1235 * * 1236 * DISKDEV - Initialization for a Mass Storage Controller. * 1237 * First, create a controller element. Call MS_RESET to * 1238 * build drive elements, we create a VOLN entry for the system * 1239 * volume using the information passed by DISKBOOT. * 1240 * Call: * 1241 * LD R4 => PPU control element * 1242 * LD R5 channel number * 1243 * CALLNP DISKDEV * 1244 * * 1245 * Eats R0:R3. * 1246 * Stack required = 12. * 1247 * 4 + max ( LOCKWAIT (0), MS_RESET (8), SGETMEM (0), * 1248 * ZEROIT (1) ) * 1249 * * 1250 ********************************************************************************** 1251 1252 BLOCK DISKDEV subroutine 1253 ENTRY DISKDEV 1254 1255 BEGFRAME 00178801 6 BASE 1256 SAVER7 BSS 1 save area for R7 00178802 6 BASE 1257 SAVER45 BSS 2 save area for R4,R5 1258 ENDFRAME 1259 021E1 DD5F8004 6 STAK 1260 DISKDEV ENTRNP PUSH 021E2 E5D78801 7 6 BASE 1261 ST R7 SP,SAVER7 save this register 021E3 DC002ED0 1262 CALL SGETMEM fetch memory for a controller element 021E4 40440004 IMM 1263 PARVL MCTLOG indicate its length 021E5 61D20000 7 0 REG 1264 LD MCT R0 copy the pointer 021E6 7C020200 0 IMM 1265 IOR R0 DVCTBFD*DEVTYPE insert device type 021E7 E41D2804 0 45 BASE 1266 ST R0 R4,PPUCNTLPTR(R5) place type and block addr into PPU table 021E8 DC003090 1267 CALL ZEROIT clear out the element 021E9 41160800 0 BASE 1268 PAR R0,0 indicate its address 021EA 4044000D IMM 1269 PARVL MCTLNTH and the length to clear 021EB 60170800 0 4 BASE 1270 LD R0 R4,PPUPF get the PPU page map value 021EC 7C0B4C00 0 5 CBM 1271 IOR R0 R5*PPUCHAN get this channel number 021ED E417C801 0 7 BASE 1272 ST R0 MCT,MCTPMVALUE set up access address 021EE 60001F13 0 1273 LD R0 MCTLIST get ptr to current list 021EF E417C800 0 7 BASE 1274 ST R0 MCT,MCTLINK place current list after us 021F0 E5C01F13 7 1275 ST MCT MCTLIST this element is new list head 021F1 E7178802 456 BASE 1276 ST2 R4 SP,SAVER45 save these registers 1277 1278 PLOCK (MCT,MCTELOCK) lock the controller 021F2 0CC00000 1278 IOFF 021F3 D1D7C803 7 BASE 1278 SETT (MCT,MCTELOCK) 021F4 FE0C21F6 1278 JNE MA(2+DISPW MA 0) 021F5 DC40308B 1278 CALLNP LOCKWAIT 021F6 60040001 0 IMM 1279 LD R0 1 PPU is talking 021F7 6153C000 5 7 REG 1280 LD R5 MCT parm for MS_RESET 021F8 DC4039A9 1281 CALLNP MS_RESET reset the controller 021F9 FEC00000 1282 NOP 0 (ignore no skip return) 1283 PUNLOCK (MCT,MCTELOCK) unlock the controller 021FA EC17C803 7 BASE 1283 STZ (MCT,MCTELOCK) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 332 (INITIAL) F 21 Initialization Routine 021FB 0C800000 1283 ION 1284 021FC 6017C801 0 7 BASE 1285 LD R0 MCT,MCTPMVALUE 021FD 64000316 0 1286 CPR R0 BOOTDEVPF is this our boot controller? 021FE FE0C2214 1287 JNE DISKDONE jump if not 1288 1289 * set up a drive control element for the system disk 021FF 60000317 0 1290 LD R0 BOOTUNIT get unit number of sys disk 02200 615DC005 5 70 BASE 1291 LD MDV MCT,MCTDRIVE(R0) get MDV of system disk 1292 02201 60000318 0 1293 LD R0 BOOTSCPTRK get number of sectors on each track 02202 E417400B 0 5 CACH 1294 ST R0 MDV,MDVSECPTRK set sectors per track 02203 60000319 0 1295 LD R0 BOOTRKPCYL get tracks (heads) per cylinder 02204 E417400A 0 5 CACH 1296 ST R0 MDV,MDVTRKPCYL set tracks per cylinder 02205 EDC94080 5 ZBM 1297 STW MDV,MDVVOLUME fake like the system volume is here 02206 DC002ED0 1298 CALL SGETMEM get a VOLN for the system volume 02207 40440007 IMM 1299 PARVL VOLNLOG indicate desired size 02208 61120000 4 0 REG 1300 LD VLN R0 save pointer to it 02209 E5001F23 4 1301 ST VLN VOLNTABLE(1) put into table as volume 1 0220A DC003090 1302 CALL ZEROIT clean it out 0220B 41170800 4 BASE 1303 PAR VLN,0 0220C 40440080 IMM 1304 PARVL VOLNLEN 0220D EDC90A10 4 ZBM 1305 STW VLN,VOLNMOUNT say mounting in progress 0220E EDC90010 4 ZBM 1306 STW VLN,VOLNSYS say is system volume 0220F EDD7080C 4 BASE 1307 STW VLN,VOLNFBZY lock the lists 02210 EDD70811 4 BASE 1308 STW VLN,VOLNNAME impossible name 02211 EDC90086 4 ZBM 1309 STW VLN,VOLNNUM volume number 02212 EDC90087 4 ZBM 1310 STW VLN,VOLNSNUM second occurrence of number 02213 E5491F15 5 4 ZBM 1311 ST MDV VLN,VOLNHCB pointer to associated MDV 1312 * \ / 00002214 1313 DISKDONE LABEL 02214 63178802 456 BASE 1314 LD2 R4 SP,SAVER45 restore these registers 02215 61D78801 7 6 BASE 1315 LD R7 SP,SAVER7 restore this register 02216 5D1F8004 6 STAK 1316 LEAVE POP and return 1317 * --- 1318 1319 END DISKDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 333 (INITIAL) F 21 Initialization Routine 1321 1322 ********************************************************************************** 1323 * * 1324 * COMMDEV - Initialization for an ACC. * 1325 * Async. Comm. Controller. This code sets up the * 1326 * resident tables for this controller and initializes the * 1327 * device. This involves setting up the controller element, * 1328 * fetching the permanent input and output buffers, and * 1329 * building a TCB for each port present on this CIA. The port * 1330 * numbers are assigned based on physical location so that * 1331 * addition or deletion of a port board does not require * 1332 * reconfiguration. * 1333 * We do the I/O initialization. * 1334 * The tables involved here are: * 1335 * 1) PPU control table. Gets a pointer to the CIA * 1336 * controller element * 1337 * 2) CIA controller element. Describes this CIA. * 1338 * Contains pointers to each block of 8 TCBs. * 1339 * 3) TCBs. TCBs are allocated in blocks of 8. There * 1340 * is one TCB for each port on the CIA. * 1341 * * 1342 * LD R4 => PPU control element * 1343 * LD R5 channel number * 1344 * CALLNP COMMDEV * 1345 * * 1346 * Eats R0:R3. * 1347 * Stack required = 9. * 1348 * 7 + max ( FREEAFTER (2), FREECHECK (2), SGETMEM (0), * 1349 * ZEROIT (1) ) * 1350 * * 1351 ********************************************************************************** 1352 1353 BLOCK COMMDEV subroutine 1354 ENTRY COMMDEV 1355 1356 BEGFRAME 00178801 6 BASE 1357 SAVER45 BSS 2 save area for R4,R5 00178803 6 BASE 1358 COMSTKBLK BSS 1 => control block 00178804 6 BASE 1359 COMSTKBITS BSS 1 bits for boards from CIA 00178805 6 BASE 1360 COMSTKTRM BSS 1 terminal number 00178806 6 BASE 1361 COMBRDBLK BSS 1 => block for boards TCBs 1362 ENDFRAME 1363 02217 DD5F8007 6 STAK 1364 COMMDEV ENTRNP PUSH 02218 E7178801 456 BASE 1365 ST2 R4 SP,SAVER45 save these registers 02219 60D20000 3 0 REG 1366 LD R3 R0 save the WRU response 0221A DC002ED0 1367 CALL SGETMEM get the comm controller block 0221B 40440005 IMM 1368 PARVL COMLOG indicate desired size 0221C E4178803 0 6 BASE 1369 ST R0 SP,COMSTKBLK remember the control block location 0221D 60920000 2 0 REG 1370 LD R2 R0 copy the pointer 0221E DC003090 1371 CALL ZEROIT clear out the element 0221F 41168800 2 BASE 1372 PAR R2,0 pass the address... 02220 40440020 IMM 1373 PARVL 2 POWER COMLOG ... and length 02221 E4D68801 3 2 BASE 1374 ST R3 R2,COMWRU save the WRU response 02222 60C40086 3 IMM 1375 LD PFPTR PNCIX get page number for PFRD 02223 80968802 2 BASE 1376 PFRD R2,COMPF place page map value into control element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 334 (INITIAL) F 21 Initialization Routine 02224 60D28000 3 2 REG 1377 LD R3 R2 copy control block pointer 02225 7C821000 2 IMM 1378 IOR R2 DVCTCOMM*DEVTYPE combine address with type 02226 E49D2804 2 45 BASE 1379 ST R2 R4,PPUCNTLPTR(R5) type and block into PPU table 02227 60001F01 0 1380 LD R0 COMLIST get head of COM list 02228 E4168800 0 2 BASE 1381 ST R0 R2,COMLINK link existing list behind us 02229 E4801F01 2 1382 ST R2 COMLIST put us on head of list 1383 * \ / 0222A 60040000 0 IMM 1384 LD R0 CIAMODEN set the CIA to "normal" operation mode 0222B E4001A09 0 1385 ST R0 CIX(CIAMODE) 0222C EC001A02 1386 STZ CIX(CIAINTMASK) clear interrupt mask for now 0222D D1401A01 1387 STMW CIX(CIAINTACK) acknowledge any prior interrupts so we get new ones 0222E 6004002D 0 IMM 1388 LD R0 CIATICKTIME interrupt approx every 20th of sec 0222F E4001A06 0 1389 ST R0 CIX(CIASETTICK) 02230 60040000 0 IMM 1390 LD R0 COMSTIDLE get idle state value... 02231 E408F085 0 3 ZBM 1391 ST R0 R3,COMSTATE ... and set as initial state 1392 * \ / 1393 1394 ********************************************************************************** 1395 * * 1396 * Allocate buffers for this CIA * 1397 * The input and output buffers are held permanently by * 1398 * this CIA after being allocated here. We allocate 512 words * 1399 * for output and 128 words for input. * 1400 * * 1401 ********************************************************************************** 1402 1403 * \ / 02232 DC402387 1404 CALLNP FREECHECK ensure adequate free memory 02233 60D78803 3 6 BASE 1405 LD R3 SP,COMSTKBLK get pointer to CIA control block 02234 DC002ED0 1406 CALL SGETMEM get an output buffer 02235 40440009 IMM 1407 PARVL 512 LOG 2 02236 E416C808 0 3 BASE 1408 ST R0 R3,COMOUTBUF 02237 600407F8 0 IMM 1409 LD R0 512*CPW-8 size of output buffer minus fudge 02238 E416C809 0 3 BASE 1410 ST R0 R3,COMOUTBUFS 02239 DC002ED0 1411 CALL SGETMEM get an input buffer 1412 * PARVL 128 LOG 2 specify its length 0223A 40440008 IMM 1413 PARVL 256 LOG 2 (allow for CIA microcode bug) 0223B E416C806 0 3 BASE 1414 ST R0 R3,COMINBUF place addr of input buffer 1415 * LD R0 128*CPW get character size of input buffer 0223C 60040400 0 IMM 1416 LD R0 256*CPW (allow for CIA microcode bug) 0223D E416C807 0 3 BASE 1417 ST R0 R3,COMINBUFS size of input buffer in chars 0223E DC402387 1418 CALLNP FREECHECK ensure adequate free memory 1419 * \ / 1420 1421 ********************************************************************************** 1422 * * 1423 * Allocate TCBs * 1424 * The CIA can have only multiples of 8 ports, since it * 1425 * can only have whole port boards. Therefore, we scan the * 1426 * CIA and for each port board proceed to build the necessary * 1427 * TCBs. Since the TCBs are an odd size, we fetch a block of * 1428 * free storage big enough for 8, then free the excess. This * 1429 * cuts down on the amount of free storage lost to internal * 1430 * fragmentation. * 1431 * Each board causes an entry in the CIA control block. * 1432 * We later use these entries to enable a quick lookup for a * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 335 (INITIAL) F 21 Initialization Routine 1433 * given ports TCB. We also rely on all TCBs on a board being * 1434 * sequential from the base entry for that board. i.e. there * 1435 * is no searching for a given ports TCB, the address * 1436 * calculation is a lookup and multiply. * 1437 * * 1438 ********************************************************************************** 1439 1440 * \ / 0223F 60D78803 3 6 BASE 1441 LD R3 SP,COMSTKBLK get pointer to CIA control block 02240 6008E081 0 3 ZBM 1442 LD R0 R3,COMWRU/DWRUDD get the configuration info 02241 E4178804 0 6 BASE 1443 ST R0 SP,COMSTKBITS save mask of boards present 02242 61440000 5 IMM 1444 LD R5 0 root of the list is null 1445 * R5 contains the running pointer to 1446 * the already built list of TCBs. 1447 1448 * Find and configure the block for one board 00002243 1449 NEXTBOARD LABEL 02243 5C578804 6 BASE 1450 HIB SP,COMSTKBITS find next board bit 02244 F6342271 0 1451 JBT R0/BIT 26 ALLPORTSC jump if all boards done 02245 38498014 1 6 ZBM 1452 LEA R1 SP,COMSTKBITS/BIT 0 get bit pointer 02246 EC1A4400 10 @R 1453 STZ @R1(R0) clear bit just processed 02247 3004001F 0 IMM 1454 RSB R0 31 convert to board number 02248 60D78803 3 6 BASE 1455 LD R3 SP,COMSTKBLK get control block addr 02249 38DCC00C 3 30 BASE 1456 LEA R3 R3,COMTERMS(R0) => to place for these TCBs 0224A 1C040008 0 IMM 1457 MUL R0 CIABOARDS R0=first port number 0224B 18001F03 0 1458 ADD R0 TERMNUM R0 now equals real first term num 0224C E4178805 0 6 BASE 1459 ST R0 SP,COMSTKTRM save terminal number 0224D DC002ED0 1460 CALL SGETMEM get a block to hold the TCBs 0224E 40440008 IMM 1461 PARVL (TCBLNTH*CIAPPBRD) LOG 2 specify length sufficient... 1462 * ...for all ports on one board 0224F 61120000 4 0 REG 1463 LD R4 R0 make R4 point to the TCBs 02250 E5178806 4 6 BASE 1464 ST R4 SP,COMBRDBLK save addr 02251 E516C400 4 3 @R 1465 ST R4 @R3 store address in device control table 02252 DC003090 1466 CALL ZEROIT make it clean 02253 41170800 4 BASE 1467 PAR R4,0 pass address 02254 404400E8 IMM 1468 PARVL TCBLNTH*CIAPPBRD ... and amount to clear 02255 60440008 1 IMM 1469 LD R1 (TCBLNTH*CIAPPBRD) LOG 2 log size of original block for FREEAFTER 02256 389708E8 2 4 BASE 1470 LEA R2 R4,(TCBLNTH*CIABOARDS) R2=first unused address 02257 DC402328 1471 CALLNP FREEAFTER let others use unused part of block 02258 DC402387 1472 CALLNP FREECHECK check available free 1473 * \ / 1474 1475 ********************************************************************************** 1476 * * 1477 * Loop to build TCBs for each of the 8 ports on this * 1478 * board. We build these 8 TCBs in sequential locations in * 1479 * this block of memory. * 1480 * * 1481 ********************************************************************************** 1482 1483 * \ / 02259 61178806 4 6 BASE 1484 LD R4 SP,COMBRDBLK R4 => top of block 1485 * Configure one port TCB 0000225A 1486 NEXTPORT LABEL 0225A 60978805 2 6 BASE 1487 LD R2 SP,COMSTKTRM get the port number 0225B E4890890 2 4 ZBM 1488 ST R2 R4,TCTNUM set the port into the TCB 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 336 (INITIAL) F 21 Initialization Routine 0225C 6017101D 0 4 REG 1489 LD R0 R4+TCBLNTH make pointer to next TCB in this block 0225D E4091F10 0 4 ZBM 1490 ST R0 R4,TCLINK point this block at it 0225E 10801F03 2 1491 SUB R2 TERMNUM R2=port on this controller 0225F 60578803 1 6 BASE 1492 LD R1 SP,COMSTKBLK pick up control block pointer 02260 E4491F16 1 4 ZBM 1493 ST R1 R4,TCCIABLOCK save control block pointer in TCB 02261 E497000F 2 4 CACH 1494 ST R2 R4,TCCIAPORT store the port number 02262 60241A80 0 2 1495 LD R0 CIX(CIAPORT+R2) get state information 02263 5C0A3E10 0 CBM 1496 CMZ R0/CIAPMODM is this to be configured for modem control? 02264 ED890019 4 ZBM 1497 STLNE R4,TCMODEM remember if modem configuration 02265 6004012C 0 IMM 1498 LD R0 300 default baud rates 02266 E40900F1 0 4 ZBM 1499 ST R0 R4,TCIRATE set input baud rate 02267 E4091EF1 0 4 ZBM 1500 ST R0 R4,TCORATE also set output baud rate 02268 BC178805 0 6 BASE 1501 INCL R0 SP,COMSTKTRM count up the port number 02269 10001F03 0 1502 SUB R0 TERMNUM 0226A 78040007 0 IMM 1503 AND R0 CIAPPBRD-1 check for the next power of two 0226B FA02226E 0 1504 JEQZ R0 BRDDONE jump if all boards done 0226C 1904001D 4 IMM 1505 ADD R4 TCBLNTH move pointer to next TCB 0226D FE0E225A 1506 JMP NEXTPORT 1507 * --- 1508 1509 ********************************************************************************** 1510 * * 1511 * The board is configured, link in the 8 TCBs for this * 1512 * one and move to next. * 1513 * R5 points to the previous block of 8 TCBs, * 1514 * R4 points to the most recent TCB made. * 1515 * * 1516 ********************************************************************************** 1517 0000226E 1518 BRDDONE LABEL 0226E E5491F10 5 4 ZBM 1519 ST R5 R4,TCLINK link previous list behind current TCB 0226F E51750CB 4 5 REG 1520 ST R4 R5+((CIABOARDS-1)*TCBLNTH) set R5 to point to this block of 8 TCBs 02270 FE0E2243 1521 JMP NEXTBOARD do the next one 1522 * --- 1523 1524 * All ports configured for this controller. Enable the comm 1525 * to interrupt after placing the built tables in the terminal lists. 1526 * We arrive here with R5 pointing to the last block 1527 * of 8 TCBs. 1528 00002271 1529 ALLPORTSC LABEL 02271 FB70227E 5 1530 JZA R5 NOPORTSC nothing there - odd but possible 02272 60040000 0 IMM 1531 LD R0 0 02273 60534000 1 5 REG 1532 LD R1 R5 copy pointer to our list 02274 3C085F10 0 1 ZBM 1533 LSRCH R0 R1,TCLINK find the end of our list 02275 60001F04 0 1534 LD R0 TERMBASE pick up head of existing list 02276 E4085F10 0 1 ZBM 1535 ST R0 R1,TCLINK link the existing list after our end 02277 E5401F04 5 1536 ST R5 TERMBASE and make our list the new head 02278 60178803 0 6 BASE 1537 LD R0 SP,COMSTKBLK get pointer to comm block 02279 E556080B 5 0 BASE 1538 ST R5 R0,COMFRSTTRM keep pointer to the first one 1539 * \ / 0227A 60040013 0 IMM 1540 LD R0 1*CIATICK+1*CIAERR+1*CIAFULL 0227B E4001A02 0 1541 ST R0 CIX(CIAINTMASK) enable the interrupts 0227C 60040800 0 IMM 1542 LD R0 1*PPUICIA 0227D E4001802 0 1543 ST R0 CIX(PPUSSSTAT) allow the controller to interrupt 1544 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 337 (INITIAL) F 21 Initialization Routine 0000227E 1545 NOPORTSC LABEL 0227E 60040040 0 IMM 1546 LD R0 CIABOARDS*CIAPPBRD number of ports on controller 0227F 98001F03 0 1547 ADDM R0 TERMNUM 02280 63178801 456 BASE 1548 LD2 R4 SP,SAVER45 restore R4 and R5 02281 5D1F8007 6 STAK 1549 LEAVE POP and return 1550 * --- 1551 1552 END COMMDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 338 (INITIAL) F 21 Initialization Routine 1554 1555 ********************************************************************************** 1556 * * 1557 * LPCDEV - Initialization for line printer controller. * 1558 * * 1559 * LD R4 => PPU control element * 1560 * LD R5 channel number * 1561 * CALLNP LPCDEV * 1562 * * 1563 * Eats R0:R3. * 1564 * Stack required = 11. * 1565 * 1 + max ( MAKEDEVNAME (10), SGETMEM (0), ZEROIT (1) ) * 1566 * * 1567 ********************************************************************************** 1568 1569 BLOCK LPCDEV subroutine 1570 ENTRY LPCDEV 1571 1572 BEGFRAME 1573 ENDFRAME 1574 02282 DD5F8001 6 STAK 1575 LPCDEV ENTRNP PUSH 02283 DC002ED0 1576 CALL SGETMEM get an LPC element 02284 40440006 IMM 1577 PARVL LPCLOG indicate desired size 02285 60D20000 3 0 REG 1578 LD LPC R0 set pointer to it 02286 7C020400 0 IMM 1579 IOR R0 DVCTLPC*DEVTYPE merge in device type with address 02287 E41D2804 0 45 BASE 1580 ST R0 R4,PPUCNTLPTR(R5) save pointer in PPU block 02288 DC003090 1581 CALL ZEROIT clear out the block 02289 41160800 0 BASE 1582 PAR R0,0 address 0228A 40440037 IMM 1583 PARVL LPCLNTH length 0228B 60170800 0 4 BASE 1584 LD R0 R4,PPUPF get page file for PPU 0228C E54A3020 5 0 CBM 1585 ST R5 R0/PPUCHAN get page file for LPC 0228D E416C801 0 3 BASE 1586 ST R0 LPC,LPCPMVALUE save page map value 0228E 60001F21 0 1587 LD R0 LPCLIST get head of list 0228F E416C800 0 3 BASE 1588 ST R0 LPC,LPCLINK link behind us 02290 E4C01F21 3 1589 ST LPC LPCLIST save us as new head 02291 60401A20 1 1590 LD R1 CIX(LPSTATUS) get current status 02292 600A5840 0 1 CBM 1591 LD R0 R1/LPSTUNIT get unit number 02293 E408C847 0 3 ZBM 1592 ST R0 LPC,LPCUNIT save it 02294 DC002316 1593 CALL MAKEDEVNAME construct the device name 02295 4140229C 1594 PARV LPTNAME prefix 02296 4048C847 3 ZBM 1595 PARVL LPC,LPCUNIT unit number 02297 E416C804 0 3 BASE 1596 ST R0 LPC,LPCNAME save device name 02298 EC001A80 1597 STZ CIX(LPNOP+LPINT) enable interrupts 02299 60040800 0 IMM 1598 LD R0 1*PPUICIA get bit for controller interrupt enable 0229A E4001802 0 1599 ST R0 CIX(PPUSSSTAT) enable the interrupts 0229B 5D1F8001 6 STAK 1600 LEAVE POP then return 1601 * --- 1602 0229C 4C500000 1603 LPTNAME TEXTZ "LP" prototype name 1604 1605 END LPCDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 339 (INITIAL) F 21 Initialization Routine 1607 1608 ********************************************************************************** 1609 * * 1610 * CTCDEV - Initialization for a Cartridge Tape Controller. * 1611 * * 1612 * LD R4 => PPU control element * 1613 * LD R5 channel number * 1614 * CALLNP CTCDEV * 1615 * * 1616 * Eats R0:R3. * 1617 * Stack required = 17. * 1618 * 2 + max ( DOMTUNIT (15), SGETMEM (0), ZEROIT (1) ) * 1619 * * 1620 ********************************************************************************** 1621 1622 BLOCK CTCDEV subroutine 1623 ENTRY CTCDEV 1624 1625 BEGFRAME 00178801 6 BASE 1626 SAVER7 BSS 1 save area for R7 1627 ENDFRAME 1628 0229D DD5F8002 6 STAK 1629 CTCDEV ENTRNP PUSH 0229E E5D78801 7 6 BASE 1630 ST R7 SP,SAVER7 save this register 0229F DC002ED0 1631 CALL SGETMEM fetch memory for a controller element 022A0 40440004 IMM 1632 PARVL MTCLOG indicate its length 022A1 61D20000 7 0 REG 1633 LD MTC R0 copy the pointer 022A2 7C021400 0 IMM 1634 IOR R0 DVCTCTC*DEVTYPE insert device type 022A3 E41D2804 0 45 BASE 1635 ST R0 R4,PPUCNTLPTR(R5) place type and block addr into PPU table 022A4 DC003090 1636 CALL ZEROIT clear out the element 022A5 41160800 0 BASE 1637 PAR R0,0 indicate its address 022A6 40440010 IMM 1638 PARVL (2 POWER MTCLOG) and the length to clear 022A7 60170800 0 4 BASE 1639 LD R0 R4,PPUPF get the PPU page map value 022A8 7C0B4C00 0 5 CBM 1640 IOR R0 R5*PPUCHAN get this channel number 022A9 E417C801 0 7 BASE 1641 ST R0 MTC,MTCPMVALUE set up access address 1642 * STZ MTC,MTCTYPE indicate that this is a CT 022AA 60001F1C 0 1643 LD R0 MTCLIST get pointer to current list 022AB E417C800 0 7 BASE 1644 ST R0 MTC,MTCLINK place current list after us 022AC E5C01F1C 7 1645 ST MTC MTCLIST and make this element new list head 1646 022AD DC0022E2 1647 CALL DOMTUNIT set up element for individual unit 022AE 41001F1E 1648 PAR CTULIST indicate which list to place element into 022AF 404022B2 1649 PARVL CTNAME and indicate device name substrate 1650 022B0 61D78801 7 6 BASE 1651 LD R7 SP,SAVER7 restore this register 022B1 5D1F8002 6 STAK 1652 LEAVE POP then all done 1653 * --- 1654 022B2 43540000 1655 CTNAME TEXTZ "CT" skeleton name for CT units 1656 1657 END CTCDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 340 (INITIAL) F 21 Initialization Routine 1659 1660 ********************************************************************************** 1661 * * 1662 * MTCDEV - Initialization for a Mag Tape Controller * 1663 * * 1664 * LD R4 => PPU control element * 1665 * LD R5 channel number * 1666 * CALLNP MTCDEV * 1667 * * 1668 * Eats R0:R3. * 1669 * Stack required = 17. * 1670 * 2 + max ( DOMTUNIT (15), SGETMEM (0), ZEROIT (1) ) * 1671 * * 1672 ********************************************************************************** 1673 1674 BLOCK MTCDEV subroutine 1675 ENTRY MTCDEV 1676 1677 BEGFRAME 00178801 6 BASE 1678 SAVER7 BSS 1 save area for R7 1679 ENDFRAME 1680 022B3 DD5F8002 6 STAK 1681 MTCDEV ENTRNP PUSH 022B4 E5D78801 7 6 BASE 1682 ST R7 SP,SAVER7 save this register 022B5 DC002ED0 1683 CALL SGETMEM fetch memory for a controller element 022B6 40440004 IMM 1684 PARVL MTCLOG indicate its length 022B7 61D20000 7 0 REG 1685 LD MTC R0 copy the pointer 022B8 7C021200 0 IMM 1686 IOR R0 DVCTMTC*DEVTYPE insert device type 022B9 E41D2804 0 45 BASE 1687 ST R0 R4,PPUCNTLPTR(R5) place type and block addr into PPU table 022BA DC003090 1688 CALL ZEROIT clear out the element 022BB 41160800 0 BASE 1689 PAR R0,0 indicate its address 022BC 40440010 IMM 1690 PARVL (2 POWER MTCLOG) and the length to clear 022BD 60170800 0 4 BASE 1691 LD R0 R4,PPUPF get the PPU page map value 022BE 7C0B4C00 0 5 CBM 1692 IOR R0 R5*PPUCHAN get this channel number 022BF E417C801 0 7 BASE 1693 ST R0 MTC,MTCPMVALUE set up access address 022C0 EDC9C426 7 ZBM 1694 STW MTC,MTCTYPE indicate that this is a 9 track tape 022C1 60001F1C 0 1695 LD R0 MTCLIST get pointer to current list 022C2 E417C800 0 7 BASE 1696 ST R0 MTC,MTCLINK place current list after us 022C3 E5C01F1C 7 1697 ST MTC MTCLIST and make this element new list head 1698 022C4 DC0022E2 1699 CALL DOMTUNIT set up element for individual unit 022C5 41001F1D 1700 PAR MTULIST indicate where to place unit 022C6 404022C9 1701 PARVL MTNAME and indicate device name base 1702 022C7 61D78801 7 6 BASE 1703 LD R7 SP,SAVER7 restore this register 022C8 5D1F8002 6 STAK 1704 LEAVE POP all done 1705 * --- 1706 022C9 4D540000 1707 MTNAME TEXTZ "MT" skeleton name for MT units 1708 1709 END MTCDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 341 (INITIAL) F 21 Initialization Routine 1711 1712 ********************************************************************************** 1713 * * 1714 * VTCDEV - Initialization for a Video Tape Controller * 1715 * * 1716 * LD R4 => PPU control element * 1717 * LD R5 channel number * 1718 * CALLNP VTCDEV * 1719 * * 1720 * Eats R0:R3. * 1721 * Stack required = 17. * 1722 * 2 + max ( DOMTUNIT (15), SGETMEM (0), ZEROIT (1) ) * 1723 * * 1724 ********************************************************************************** 1725 1726 BLOCK VTCDEV subroutine 1727 ENTRY VTCDEV 1728 1729 BEGFRAME 00178801 6 BASE 1730 SAVER7 BSS 1 save area for R7 1731 ENDFRAME 1732 022CA DD5F8002 6 STAK 1733 VTCDEV ENTRNP PUSH 022CB E5D78801 7 6 BASE 1734 ST R7 SP,SAVER7 save this register 022CC DC002ED0 1735 CALL SGETMEM fetch memory for a controller element 022CD 40440004 IMM 1736 PARVL MTCLOG indicate its length 022CE 61D20000 7 0 REG 1737 LD MTC R0 copy the pointer 022CF 7C021600 0 IMM 1738 IOR R0 DVCTVTC*DEVTYPE insert device type 022D0 E41D2804 0 45 BASE 1739 ST R0 R4,PPUCNTLPTR(R5) place type and block addr into PPU table 022D1 DC003090 1740 CALL ZEROIT clear out the element 022D2 41160800 0 BASE 1741 PAR R0,0 indicate its address 022D3 40440010 IMM 1742 PARVL (2 POWER MTCLOG) and the length to clear 022D4 60170800 0 4 BASE 1743 LD R0 R4,PPUPF get the PPU page map value 022D5 7C0B4C00 0 5 CBM 1744 IOR R0 R5*PPUCHAN get this channel number 022D6 E417C801 0 7 BASE 1745 ST R0 MTC,MTCPMVALUE set up access address 022D7 60040002 0 IMM 1746 LD R0 2 022D8 E409C426 0 7 ZBM 1747 ST R0 MTC,MTCTYPE indicate that this is a video tape 022D9 60001F1C 0 1748 LD R0 MTCLIST get pointer to current list 022DA E417C800 0 7 BASE 1749 ST R0 MTC,MTCLINK place current list after us 022DB E5C01F1C 7 1750 ST MTC MTCLIST and make this element new list head 1751 022DC DC0022E2 1752 CALL DOMTUNIT set up element for individual unit 022DD 41001F1F 1753 PAR VTULIST indicate where to place unit 022DE 404022E1 1754 PARVL VTNAME and indicate device name base 1755 022DF 61D78801 7 6 BASE 1756 LD R7 SP,SAVER7 restore this register 022E0 5D1F8002 6 STAK 1757 LEAVE POP all done 1758 * --- 1759 022E1 56540000 1760 VTNAME TEXTZ "VT" skeleton name for VT units 1761 1762 END VTCDEV subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 342 (INITIAL) F 21 Initialization Routine 1764 1765 ********************************************************************************** 1766 * * 1767 * Routine to do a single mag tape controller. * 1768 * Call: * 1769 * LD MTC => MTC element * 1770 * CALL DOMTUNIT * 1771 * PAR MTULIST or CTULIST * 1772 * PARL drive name prefix (TEXTZ "MT" or "CT") * 1773 * * 1774 * Eats R0:R3. * 1775 * Stack required = 15. * 1776 * 5 + max ( LOCKWAIT (0), MAKEDEVNAME (10), MT_RESET (7), * 1777 * SGETMEM (0), ZEROIT (1) ) * 1778 * * 1779 ********************************************************************************** 1780 1781 BLOCK DOMTUNIT subroutine 1782 ENTRY DOMTUNIT 1783 1784 BEGFRAME 00178801 6 BASE 1785 REGSAVE BSS2 1 to save some registers 00178803 6 BASE 1786 LISTHEAD BSS 1 pointer to the list head 00178804 6 BASE 1787 NAMEPROTO BSS 1 prototype for the device name 1788 ENDFRAME 1789 022E2 DD1F8005 6 STAK 1790 DOMTUNIT ENTR PUSH 022E3 C1178803 6 BASE 1791 STP SP,LISTHEAD save the list head address 022E4 C0578804 6 BASE 1792 STPVL SP,NAMEPROTO save the device name prototype 022E5 E7178801 456 BASE 1793 ST2 R4 SP,REGSAVE save R4 and R5 022E6 E1D78800 7 6 BASE 1794 EXCH R7 SP,0 put MTC pointer back into MTC 022E7 61040000 4 IMM 1795 LD R4 0 start with unit 0 022E8 60C01A40 3 1796 LD R3 CIX(MTLDDRVST) fetch all drive statuses 000022E9 1797 NEXTMTUNIT LABEL 022E9 60CAD000 3 3 CBM 1798 LD R3 R3/BITS 8:7 shift to next unit 022EA F2FC2306 3 1799 JBF R3/MTDSTPRS NOMTUNIT jump if no drive present 022EB DC002ED0 1800 CALL SGETMEM get memory for MTU element 022EC 40440005 IMM 1801 PARVL MTULOG indicate required size 022ED 61520000 5 0 REG 1802 LD MTU R0 copy the pointer 022EE E41DE007 0 74 BASE 1803 ST R0 MTC,MTCDRIVE(R4) make controller element point here 022EF DC003090 1804 CALL ZEROIT clear out new element 022F0 41160800 0 BASE 1805 PAR R0,0 indicate address 022F1 40440020 IMM 1806 PARVL 2 POWER MTULOG and how much to clear 022F2 60178C03 0 6 FPVR 1807 LD R0 @(SP,LISTHEAD) get pointer to current list 022F3 E4095F10 0 5 ZBM 1808 ST R0 MTU,MTULINK put list behind us 022F4 FA3022F7 0 1809 JZA R0 FIRSTMT jump if this is first unit 022F5 60080460 0 0 ZBM 1810 LD R0 R0,MTUDNUM else get previous drive number 022F6 60161001 0 0 REG 1811 LD R0 R0+1 and make us one more 000022F7 1812 FIRSTMT LABEL 022F7 E4094460 0 5 ZBM 1813 ST R0 MTU,MTUDNUM and give next number to current element 022F8 E5578C03 5 6 FPVR 1814 ST MTU @(SP,LISTHEAD) and this element new list head 022F9 E5095040 4 5 ZBM 1815 ST R4 MTU,MTUUNIT save the unit number 022FA E5C95F11 7 5 ZBM 1816 ST MTC MTU,MTUCNTL save pointer to controller element 022FB 6009C426 0 7 ZBM 1817 LD R0 MTC,MTCTYPE get indicator for 9 track tape 022FC E4094021 0 5 ZBM 1818 ST R0 MTU,MTUTYPE and copy to unit element 022FD 6004426E 0 IMM 1819 LD R0 ADR MTDRIVE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 343 (INITIAL) F 21 Initialization Routine 022FE E4174810 0 5 BASE 1820 ST R0 MTU,MTUPC initialize the coroutine PC 022FF 60040000 0 IMM 1821 LD R0 MTUSTRUN 02300 E4094020 0 5 ZBM 1822 ST R0 MTU,MTUSTATE initialize the state 02301 60178804 0 6 BASE 1823 LD R0 SP,NAMEPROTO get name prototype 02302 DC002316 1824 CALL MAKEDEVNAME construct the device name 02303 41520000 0 REG 1825 PARV R0 name prefix 02304 40494460 5 ZBM 1826 PARVL MTU,MTUDNUM device number 02305 E4174804 0 5 BASE 1827 ST R0 MTU,MTUNAME save the name 1828 * \ / 00002306 1829 NOMTUNIT LABEL 02306 19040001 4 IMM 1830 ADD R4 1 advance to next possible unit 02307 65040004 4 IMM 1831 CPR R4 MTCUPC check against max possible on controller 02308 FE0822E9 1832 JLT NEXTMTUNIT return to do next unit 1833 * \ / 1834 PLOCK (MTC,MTCELOCK) lock the controller 02309 0CC00000 1834 IOFF 0230A D1D7C803 7 BASE 1834 SETT (MTC,MTCELOCK) 0230B FE0C230D 1834 JNE MA(2+DISPW MA 0) 0230C DC40308B 1834 CALLNP LOCKWAIT 0230D 6153C000 5 7 REG 1835 LD R5 MTC parm for MT_RESET 0230E 60040001 0 IMM 1836 LD R0 1 parm for MT_RESET 0230F DC4041CB 1837 CALLNP MT_RESET reset the controller 02310 FEC00000 1838 NOP 0 ignore skip return 1839 PUNLOCK (MTC,MTCELOCK) unlock the controller 02311 EC17C803 7 BASE 1839 STZ (MTC,MTCELOCK) 02312 0C800000 1839 ION 1840 02313 E1D78800 7 6 BASE 1841 EXCH R7 SP,0 restore R7 values 02314 63178801 456 BASE 1842 LD2 R4 SP,REGSAVE restore R4 and R5 02315 5D1F8005 6 STAK 1843 LEAVE POP return to caller 1844 * --- 1845 1846 END DOMTUNIT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 344 (INITIAL) F 21 Initialization Routine 1848 1849 ********************************************************************************** 1850 * * 1851 * MAKEDEVNAME - Construct a device name. * 1852 * * 1853 * CALL MAKEDEVNAME * 1854 * PARV name prefix (1-3 chars, left justified, zero filled) * 1855 * PARVL unit number * 1856 * ST R0 pak6 device name * 1857 * * 1858 * Eats R0:R2. * 1859 * Stack required = 10. * 1860 * 4 + max ( CHARTOP6 (1), INTTOCHAR (6) ) * 1861 * * 1862 ********************************************************************************** 1863 1864 BLOCK MAKEDEVNAME subroutine 1865 ENTRY MAKEDEVNAME 1866 1867 BEGFRAME 00178801 6 BASE 1868 SAVER3 BSS 1 save area for this reg 00178802 6 BASE 1869 NAMEBUF BSS 2 buffer to build name in 1870 ENDFRAME 1871 02316 DD1F8004 6 STAK 1872 MAKEDEVNAME ENTR PUSH 02317 C1578802 6 BASE 1873 STPV SP,NAMEBUF save prefix of name 02318 C0520000 0 REG 1874 STPVL R0 save unit number 02319 E4D78801 3 6 BASE 1875 ST R3 SP,SAVER3 save this register 0231A 38978802 2 6 BASE 1876 LEA R2 SP,NAMEBUF R2 -> first char of name 1877 * \ / 1878 0000231B 1879 LOOP LABEL 0231B 5C168000 2 CACH 1880 CMZ CACH R2,0 at end of prefix? 0231C FE02231F 1881 JEQ GOTEND jump if so 0231D 38968001 2 2 CACH 1882 LEA R2 CACH R2,1 else point to next char 0231E FE0E231B 1883 JMP LOOP and try again 1884 * --- 1885 0000231F 1886 GOTEND LABEL 0231F DC005903 1887 CALL INTTOCHAR convert unit number to characters 02320 41520000 0 REG 1888 PARV R0 number to convert 02321 40168000 2 CACH 1889 PARL CACH R2,0 where to put it 02322 38178802 0 6 BASE 1890 LEA R0 SP,NAMEBUF R0 -> name, in characters 02323 DC005898 1891 CALL CHARTOP6 pack it up 02324 40160000 0 CACH 1892 PARL CACH R0,0 thing to pack 02325 60124000 0 1 REG 1893 LD R0 R1 R0 = packed name 02326 60D78801 3 6 BASE 1894 LD R3 SP,SAVER3 restore this register 02327 5D1F8004 6 STAK 1895 LEAVE POP and all done 1896 * --- 1897 1898 END MAKEDEVNAME subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 345 (INITIAL) F 21 Initialization Routine 1900 1901 ********************************************************************************** 1902 * * 1903 * This routine frees all of a memory block beyond a * 1904 * specified location. * 1905 * * 1906 * R1 = log size of block * 1907 * R2 => first available word * 1908 * CALLNP FREEAFTER * 1909 * * 1910 * Eats R0:R3. * 1911 * Stack required = 2 * 1912 * 2 + max ( SFREEMEM (0) ) * 1913 * * 1914 ********************************************************************************** 1915 1916 BLOCK FREEAFTER subroutine 1917 ENTRY FREEAFTER 1918 1919 BEGFRAME 00178801 6 BASE 1920 LOGMAX BSS 1 log of max block size 1921 ENDFRAME 1922 1923 * R2=current first available word, 1924 * R3=log 2 block size being considered 1925 02328 DD5F8002 6 STAK 1926 FREEAFTER ENTRNP PUSH 02329 E4578801 1 6 BASE 1927 ST R1 SP,LOGMAX save max log size 0232A 60C40000 3 IMM 1928 LD R3 0 start with block size of 1 0000232B 1929 FREENEXT LABEL 0232B 60128000 0 2 REG 1930 LD R0 R2 copy the address being considered 0232C 7826255E 0 3 1931 AND R0 BITTAB(R3) check to see if address odd here 0232D FA022332 0 1932 JEQZ R0 ENDCHECK jump if no block starting here 0232E DC002F5D 1933 CALL SFREEMEM free up a piece 0232F 4152C000 3 REG 1934 PARV R3 indicate the length (log) 02330 40528000 2 REG 1935 PARVL R2 and address 02331 18A6255E 2 3 1936 ADD R2 BITTAB(R3) skip over piece just freed 00002332 1937 ENDCHECK LABEL 02332 18C40001 3 IMM 1938 ADD R3 1 double size being checked 02333 64D78801 3 6 BASE 1939 CPR R3 SP,LOGMAX check for beyond block or page end 02334 FE08232B 1940 JLT FREENEXT not yet, continue 02335 5D1F8002 6 STAK 1941 LEAVE POP return to caller 1942 * --- 1943 1944 END FREEAFTER subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 346 (INITIAL) F 21 Initialization Routine 1946 1947 ********************************************************************************** 1948 * * 1949 * Routine to set up the interrupt vector table for the * 1950 * current CPU. Gets a console area for each actual interrupt * 1951 * level that requires one. * 1952 * Sets up pointers to the CAs in the IVT and sets up the * 1953 * new program counter information. Unused interrupts are set * 1954 * to stop the machine. * 1955 * * 1956 * Eats R0:R1. * 1957 * Stack required = 3. * 1958 * 1 + max ( BUILDCA (2) ) * 1959 * * 1960 ********************************************************************************** 1961 1962 BLOCK BUILDIVT subroutine 1963 ENTRY BUILDIVT 1964 1965 BEGFRAME 1966 ENDFRAME 1967 02336 DD5F8001 6 STAK 1968 BUILDIVT ENTRNP PUSH 02337 EC000412 1969 STZ CPPSA also indicate no process now 02338 EC000414 1970 STZ CPCUPC indicate no UPC now 02339 EC00044D 1971 STZ CPXTRACA indicate no CA/Stack present 0233A EC00044E 1972 STZ POWERFLAG initialize power fail marker 1973 0233B DC402833 1974 CALLNP BUILDCA 0233C E4000402 0 1975 ST R0 IVTPWFL set address into IVT 0233D 6004277A 0 IMM 1976 LD R0 ADR POWERFAIL load the interrupt routine address 0233E E4000403 0 1977 ST R0 IVTPWFL(1) and set into the IVT 1978 0233F DC402833 1979 CALLNP BUILDCA 02340 E4000404 0 1980 ST R0 IVTMEMPAR set address into IVT 02341 600426C6 0 IMM 1981 LD R0 ADR PARITYERR load the interrupt routine address 02342 E4000405 0 1982 ST R0 IVTMEMPAR(1) and set into the IVT 1983 02343 DC402833 1984 CALLNP BUILDCA 02344 E400040A 0 1985 ST R0 IVTIAPR set address into IVT 02345 60044E54 0 IMM 1986 LD R0 ADR OTHERTALK load the interrupt routine address 02346 E400040B 0 1987 ST R0 IVTIAPR(1) and set into the IVT 1988 02347 DC402833 1989 CALLNP BUILDCA 02348 E4000408 0 1990 ST R0 IVTIOINT set the address into the IVT 02349 60043908 0 IMM 1991 LD R0 ADR IOINTPROC load the address of the interrupt routine 0234A E4000409 0 1992 ST R0 IVTIOINT(1) and set into the IVT 1993 0234B DC402833 1994 CALLNP BUILDCA 0234C E4000406 0 1995 ST R0 IVTPAGE 0234D 60042402 0 IMM 1996 LD R0 ADR PFPROC 0234E E4000407 0 1997 ST R0 IVTPAGE(1) 1998 0234F DC402833 1999 CALLNP BUILDCA 02350 E400040C 0 2000 ST R0 IVTXREQ 02351 600438BD 0 IMM 2001 LD R0 ADR XREQTRAP 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 347 (INITIAL) F 21 Initialization Routine 02352 E400040D 0 2002 ST R0 IVTXREQ(1) 2003 02353 DC402833 2004 CALLNP BUILDCA 02354 E400040E 0 2005 ST R0 IVTUERR 02355 600438E8 0 IMM 2006 LD R0 ADR UERRTRAP 02356 E400040F 0 2007 ST R0 IVTUERR(1) 2008 02357 DC402833 2009 CALLNP BUILDCA 02358 E4000410 0 2010 ST R0 IVTXCALL 02359 600438E5 0 IMM 2011 LD R0 ADR XCALLTRAP 0235A E4000411 0 2012 ST R0 IVTXCALL(1) 2013 2014 ********************************************************************************** 2015 * * 2016 * Interrupting Devices Mask * 2017 * This word is defined by the hardware. It is read up * 2018 * by the CPU and tells that CPU what slots to poll when the * 2019 * bus interrupt line is asserted. It also contains the slot * 2020 * number of the SSU that is running the front panel. This is * 2021 * so that the CPU microcode knows where to send notice of any * 2022 * problems that it might encounter. * 2023 * * 2024 ********************************************************************************** 2025 0235B 60000312 0 2026 LD R0 INTDEVICES 0235C E4000401 0 2027 ST R0 INTABLSLOT say which devices interrupt 2028 0235D 5D1F8001 6 STAK 2029 LEAVE PUSH return to caller 2030 * --- 2031 2032 END BUILDIVT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 348 (INITIAL) F 21 Initialization Routine 2034 2035 ********************************************************************************** 2036 * * 2037 * GENPPL - Generate a PPAGE element. * 2038 * We create the PPL for the specified page. The FBI for * 2039 * the page is kept in a virtual area that must be mapped in * 2040 * whenever access to the FBI is needed. We keep track of the * 2041 * available places for FBIs and store in the PPL the unique * 2042 * location it may use. * 2043 * The MCU slot number of the new PPL is used as an index * 2044 * into the PPUSDIDLE array and the PPL is placed as the head * 2045 * of the corresponding 'unclean' idle page list. This * 2046 * separates the PPLs by MCU. * 2047 * Since PPLs created here are never destroyed, we * 2048 * allocate FBI space in a linear fashion and without worrying * 2049 * about ever recovering the space. The array PPLPFMAP * 2050 * contains the page map values for each of the pages used to * 2051 * store the FBIs. Into any particular PPL we store an index * 2052 * (PPFBIBLK) into this array and a displacement (PPFBIDISP) * 2053 * into the associated page. The virtual page PPLWINDOW is * 2054 * used to map in the page when the FBI is to be accessed. * 2055 * We keep track of allocations with the head page * 2056 * variables PPLINDX and PPLDISP. They are the next assignable * 2057 * values for PPFBIBLK and PPFBIDISP. If PPLPFMAP(PPFBIBLK) is * 2058 * 0, no page has yet been assigned for this location and we * 2059 * use the passed page for this purpose. * 2060 * * 2061 * R5 contains the PF entry for this page * 2062 * CALLNP GENPPL * 2063 * * 2064 * Eats R0:R2,PPL * 2065 * Stack usage = 2 * 2066 * 1 + max ( BUILDPPL (1) ) * 2067 * * 2068 ********************************************************************************** 2069 2070 BLOCK GENPPL subroutine 2071 ENTRY GENPPL 2072 2073 BEGFRAME 2074 ENDFRAME 2075 0235E DD5F8001 6 STAK 2076 GENPPL ENTRNP PUSH 0235F 60001C7E 0 2077 LD R0 PPLPMINDX get current index into PPLPFMAP 02360 68040042 0 IMM 2078 UCPR R0 PPLMAPSIZE off ends of table? 02361 FE082363 2079 JLT INDEXOK jump if not 02362 00026040 2080 HALT HALTB6040 out of table space (or negative index) 2081 * \ / 2082 00002363 2083 INDEXOK LABEL 02363 5C201C80 0 2084 CMZ PPLPFMAP(R0) do we have a page allocated? 02364 FE02236C 2085 JEQ USETHISONE jump if not 02365 DC402374 2086 CALLNP BUILDPPL build the PPL 2087 2088 ********************************************************************************** 2089 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 349 (INITIAL) F 21 Initialization Routine 2090 * Place the new PPL into list in PPUSDIDLE array * 2091 * corresponding to the PPLs MCU. The end-pointer array, * 2092 * PPENDIDLE, is not changed. This is intentional, to make * 2093 * merging these lists easier. Note that GETIDLE will look in * 2094 * this array for free PPLs and does not need the end-pointers * 2095 * set (in fact, it sets them). * 2096 * * 2097 ********************************************************************************** 2098 02366 608B4840 2 5 CBM 2099 LD R2 R5/PFSLOT get slot number of mother MCU 02367 60641DDD 1 2 2100 LD R1 PPUSDIDLE(R2) use as index to get list head 02368 E4491F10 1 4 ZBM 2101 ST R1 PPL,PPLINK link list behind us 02369 E5241DDD 4 2 2102 ST PPL PPUSDIDLE(R2) make us the new list head 2103 0236A D0001DDA 2104 INC PPIDLCOUNT count each idle page available 2105 0000236B 2106 EXIT2 LABEL 0236B 5D1F8001 6 STAK 2107 LEAVE POP return 2108 * --- 2109 2110 ********************************************************************************** 2111 * * 2112 * There is no block allocated for storing the FBIs from * 2113 * the PPLs. Allocate one without creating a PPL. Note also * 2114 * that we initialize the page with all zeros, this is to * 2115 * prevent the OS from ever reading from uninitialized memory. * 2116 * * 2117 ********************************************************************************** 2118 0000236C 2119 USETHISONE LABEL 0236C E5601C80 5 0 2120 ST R5 PPLPFMAP(R0) 0236D 60C400FB 3 IMM 2121 LD R3 PNPPLWNDO page number for virtual FBIs 0236E 00D34000 5 REG 2122 LDPF R5 associate virtual page with memory page 0236F 3881EC00 2 2123 LEA R2 PPLWINDOW generate destination address 02370 60441000 1 IMM 2124 LD R1 WPP*CPW page length in characters 02371 FE580000 2125 CFILL 0 the page is now initialized 02372 80D20000 0 REG 2126 PFRC R0 undo the mapping 02373 FE0E236B 2127 JMP EXIT2 2128 * --- 2129 2130 END GENPPL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 350 (INITIAL) F 21 Initialization Routine 2132 2133 ********************************************************************************** 2134 * * 2135 * BUILDPPL * 2136 * The PPL is built here. The FBI for the page is kept * 2137 * in a virtual area that must be mapped in whenever access to * 2138 * the FBI is needed. We keep track of the available places * 2139 * for FBIs and store in the PPL the unique location it may * 2140 * use. * 2141 * Since PPLs created here are never destroyed, we * 2142 * allocate FBI space in a linear fashion and without worrying * 2143 * about ever recovering the space. The array PPLPFMAP * 2144 * contains the page map values for each of the pages used to * 2145 * store the FBIs. Into any particular PPL we store an index * 2146 * (PPFBIBLK) into this array and a displacement (PPFBIDISP) * 2147 * into the associated page. The virtual page PPLWINDOW is * 2148 * used to map in the page when the FBI is to be accessed. * 2149 * It is assumed that some one else is checking that * 2150 * PPLPFMAP(PPFBIBLK) contains a page map value for a page of * 2151 * FBIs. Call: * 2152 * * 2153 * R5 contains PF entry for this page * 2154 * CALLNP BUILDPPL * 2155 * PPL -> PPL * 2156 * * 2157 * Eats R0. * 2158 * Stack usage = 1 * 2159 * 1 + max ( SGETMEM (0) ) * 2160 * * 2161 ********************************************************************************** 2162 2163 BLOCK BUILDPPL subroutine 2164 ENTRY BUILDPPL 2165 2166 BEGFRAME 2167 ENDFRAME 2168 02374 DD5F8001 6 STAK 2169 BUILDPPL ENTRNP PUSH 02375 DC002ED0 2170 CALL SGETMEM call for a chunk of memory 02376 40440002 IMM 2171 PARVL PPLOG indicate its length 02377 61120000 4 0 REG 2172 LD PPL R0 copy the pointer 02378 EE170800 4 BASE 2173 STZ2 PPL,0 clear out top half 02379 EE170802 4 BASE 2174 STZ2 PPL,2 clear out bottom half 2175 * \ / 2176 2177 * PPL => zeroed physical page element, fill in the details 0237A E5570803 5 4 BASE 2178 ST R5 PPL,PPPMVALUE set page map value 0237B EC091A33 4 ZBM 2179 STZ PPL,PPPMVALUE/(PFROBIT+PFALTBIT+PFREFBIT) clear this garbage 0237C 60001C7E 0 2180 LD R0 PPLPMINDX get index back 0237D E4090C62 0 4 ZBM 2181 ST R0 PPL,PPFBIBLK say where to find FBI 0237E 60001C7F 0 2182 LD R0 PPLPMDISP get loc for FBI 0237F E40904A0 0 4 ZBM 2183 ST R0 PPL,PPFBIDISP save displacement into indexed block 2184 * \ / 2185 2186 ********************************************************************************** 2187 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 351 (INITIAL) F 21 Initialization Routine 2188 * The following instruction causes all the FBIs to start * 2189 * on even word boundaries. This is required for all systems * 2190 * with pre-rev 012 PPU micro-code. It is in the source so we * 2191 * don't forget! The code file can be patched to ADD R0 * 2192 * FBILNTH to produce an odd/even mix for systems with rev 012 * 2193 * and above for tests, but the source should not be changed * 2194 * until all sites have appropriate microcode. * 2195 * * 2196 ********************************************************************************** 2197 2198 * label for patchers 00002380 2199 ODDFBI LABEL 02380 1804000C 0 IMM 2200 ADD R0 FBILNTH+1 R0:=next available displacement 02381 640403F4 0 IMM 2201 CPR R0 PPLMAXDISP is it too big? 02382 FE0A2385 2202 JLE EXIT jump if not 02383 D0001C7E 2203 INC PPLPMINDX otherwise, we must use next index 02384 60040000 0 IMM 2204 LD R0 0 from the beginning 00002385 2205 EXIT LABEL 02385 E4001C7F 0 2206 ST R0 PPLPMDISP set next disp 02386 5D1F8001 6 STAK 2207 LEAVE POP 2208 * --- 2209 2210 END of BUILDPPL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 352 (INITIAL) F 21 Initialization Routine 2212 2213 ********************************************************************************** 2214 * * 2215 * FREECHECK - See whether more free storage is needed. * 2216 * Routine to check to see whether a whole page is * 2217 * present in the free storage lists or not. If not, the PPL * 2218 * that is now in the FSPPLIST is freed and a new whole page * 2219 * is acquired from PPCLNIDLE. The first time that this * 2220 * routine is called, there will be lots of free storage * 2221 * because all of the extra space on the CPUPAGEs will have * 2222 * been freed. However, there will be no whole pages in the * 2223 * list, so this code will proceed to acquire an idle page and * 2224 * enter it into the whole page memory list (WHOLEPAGE). Once * 2225 * that is done, we will go for quite a while before fetching * 2226 * another. * 2227 * Call: * 2228 * CALLNP FREECHECK * 2229 * * 2230 * Registers Used: R0:R3. * 2231 * Stack Required: 2. * 2232 * 1 + max ( GETIDLE (1), SFREEMEM (0) ) * 2233 * * 2234 ********************************************************************************** 2235 2236 BLOCK FREECHECK subroutine 2237 ENTRY FREECHECK 2238 2239 BEGFRAME 2240 ENDFRAME 2241 02387 DD5F8001 6 STAK 2242 FREECHECK ENTRNP PUSH 02388 5C001C79 2243 CMZ WHOLEPAGE check for whole pages in list 02389 FE0C2395 2244 JNE STILPAGS jump if still some there 2245 * \ / 2246 2247 ********************************************************************************** 2248 * * 2249 * The last PPL that was fetched caused a whole page to * 2250 * break up. Since PPLs are never freed ( except right here * 2251 * for this reason only ), this page will never be put back * 2252 * together. Therefore, its PPL (which is now in FSPPLIST) * 2253 * will never be needed and it may be returned to free * 2254 * storage. It will of course, never cause any recombination * 2255 * because its buddy was part of a prior page and is now (and * 2256 * forevermore) a PPL. * 2257 * The free storage lists are initialized to empty ( with * 2258 * FSPPLIST empty also ). The unused part of the CPUPAGES * 2259 * will have been freed ( using alias addresses ) but no whole * 2260 * pages are entered by the initializer prior to this point. * 2261 * Therefore, the first time we come here there will be no PPL * 2262 * in the list. * 2263 * * 2264 ********************************************************************************** 2265 2266 * \ / 0238A 60801C77 2 2267 LD R2 FSPPLIST get pointer to this PPL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 353 (INITIAL) F 21 Initialization Routine 0238B FA822390 2 2268 JEQZ R2 NOFREE jump if no whole page in existing list 0238C EC001C77 2269 STZ FSPPLIST get rid of the old pointer 0238D DC002F5D 2270 CALL SFREEMEM call to free this PPL 0238E 41440002 IMM 2271 PARV PPLOG indicate length 0238F 40528000 2 REG 2272 PARVL R2 and memory address 2273 * \ / 2274 2275 ********************************************************************************** 2276 * * 2277 * We must now get an idle page from the idle page list * 2278 * and stick it into the wholepage list, so it may be used as * 2279 * free storage. Since the other CPUs are off spining their * 2280 * wheels somewhere no inlocking for the idle list is needed. * 2281 * * 2282 ********************************************************************************** 2283 2284 * \ / 00002390 2285 NOFREE LABEL 02390 DC402D1C 2286 CALLNP GETIDLE fwtxh an idle page 02391 FE0E2395 2287 JMP STILPAGS fails on very first PPL 02392 60001C79 0 2288 LD R0 WHOLEPAGE list head of available whole pages 02393 E4091F10 0 4 ZBM 2289 ST R0 PPL,PPLINK this now becomes the head of the list 02394 E5001C79 4 2290 ST PPL WHOLEPAGE that is all there is to it 2291 * \ / 00002395 2292 STILPAGS LABEL 02395 5D1F8001 6 STAK 2293 LEAVE POP return 2294 * --- 2295 2296 END FREECHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 354 (INITIAL) F 21 Initialization Routine 2298 2299 ********************************************************************************** 2300 * * 2301 * MERGEPPLS * 2302 * Cycle through the PPUSDIDLE array to merge the PPLs * 2303 * from those lists (indexed by MCU slot number) into one * 2304 * master PPCLNIDLE list. This shuffled ordering gives an * 2305 * even distribution of page usage across the MCUs. The order * 2306 * of slot numbers in the resulting list is cyclic from * 2307 * highest through lowest. * 2308 * * 2309 * For a number of reasons, we create this list by adding * 2310 * at the end. Primarily, it is done so that the PPLs * 2311 * that were first created get buried deeply under the * 2312 * newer ones. See the comments regarding GENPPLing the * 2313 * INITIAL page, WNDO pages, etc. Also, this keeps the * 2314 * pages from all MCUs nicely shuffled at the beginning * 2315 * of the list (regardless of relative memory sizes or * 2316 * page availability). Finally, it fulfills the requirement * 2317 * of SPREADSYS that the first PPL not correspond to the * 2318 * first MCU. * 2319 * * 2320 * N.B. We assume that we do not have to mess with the * 2321 * end-pointer array, PPENDIDLE. * 2322 * * 2323 * We loop through the array, moving the first PPL off each * 2324 * list until all lists are empty. Each non-empty list sets * 2325 * a flag (R2) to 1. After every NUMSLOT cycles, we check this * 2326 * flag to see whether anything was moved since the last check, * 2327 * and exit if not. Note that we do not clear the flag before * 2328 * cycling the first time. This was a practical decision based * 2329 * on the fact that not finding any non-empty lists the first * 2330 * time through would imply that no MCUs exist. Hardly likely. * 2331 * We couldn't even get as far as this subroutine if there were * 2332 * no MCUs! If it is true, however, we find this out in the * 2333 * next cycle (because the JDR R2 resets the flag). * 2334 * * 2335 * Call: CALLNP MERGEPPLS * 2336 * * 2337 * Eats R0:R3, PPL * 2338 * Stack usage: 1 * 2339 * * 2340 ********************************************************************************** 2341 2342 BLOCK MERGEPPLS subroutine 2343 ENTRY MERGEPPLS 2344 2345 BEGFRAME 2346 ENDFRAME 2347 02396 DD5F8001 6 STAK 2348 MERGEPPLS ENTRNP PUSH 02397 60040000 0 IMM 2349 LD R0 0 value of null pointer 02398 38C01DDC 3 2350 LEA R3 PPCLNIDLE get address of 'clean' unused PPLS list 02399 3C08DF10 0 3 ZBM 2351 LSRCH R0 R3,PPLINK find list end 0000239A 2352 NOTDONEYET LABEL 0239A 6044000F 1 IMM 2353 LD R1 NUMSLOTS-1 counter for done check 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 355 (INITIAL) F 21 Initialization Routine 0000239B 2354 MPLOOP LABEL 0239B 61221DDD 4 1 2355 LD PPL PPUSDIDLE(R1) get PPL from slot 0239C FB3023A3 4 2356 JZA PPL GOROUND jump if list is empty 2357 * \ / 2358 2359 * PPL points to an element, move it to PPCLNIDLE 0239D 60840001 2 IMM 2360 LD R2 1 say a non-empty slot was found 0239E 60091F10 0 4 ZBM 2361 LD R0 PPL,PPLINK get forward pointer 0239F E4221DDD 0 1 2362 ST R0 PPUSDIDLE(R1) shrink the list 023A0 EC091F10 4 ZBM 2363 STZ PPL,PPLINK make suitable null pointer 023A1 E508DF10 4 3 ZBM 2364 ST PPL R3,PPLINK give transient a home 023A2 60D30000 3 4 REG 2365 LD R3 PPL save as new end 2366 * \ / 2367 000023A3 2368 GOROUND LABEL 023A3 FA66239B 1 2369 JDR R1 MPLOOP try next slot, or do done check 2370 * \ / 2371 2372 * Test our flag to see whether the lists are empty 023A4 FAA6239A 2 2373 JDR R2 NOTDONEYET jump if non-empty list was found 2374 * \ / 2375 023A5 5D1F8001 6 STAK 2376 LEAVE POP 2377 * --- 2378 2379 END MERGEPPLS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 356 (INITIAL) F 21 Initialization Routine 2381 2382 ********************************************************************************** 2383 * * 2384 * SPREADSYS * 2385 * This routine moves the first few pages of the resident * 2386 * operating system into MCUs other than the one we've been * 2387 * using up to now. This is intended to further distribute * 2388 * the workload of the MCUs. * 2389 * We assume that this subroutine is called immediately * 2390 * after perfectly shuffling the PPLs from all the MCUs, and * 2391 * that, if there is more than one MCU, that the first PPL * 2392 * does not correspond to the first MCU. The second assumption * 2393 * is made because we wish to place the first monitor page * 2394 * (which is very heavily used) on another MCU, and a check * 2395 * for this is awkward. * 2396 * * 2397 * Call: CALLNP SPREADSYS * 2398 * * 2399 * Eats R0:R3, PPL * 2400 * Stack usage: 5 * 2401 * 3 + SWAPPMVS (2) * 2402 * * 2403 ********************************************************************************** 2404 2405 BLOCK SPREADSYS subroutine 2406 ENTRY SPREADSYS 2407 2408 BEGFRAME 00178801 6 BASE 2409 PRIMESLOT BSS 1 slot number of primary MCU 00178802 6 BASE 2410 CURRPAGE BSS 1 current page in loop 2411 ENDFRAME 2412 023A6 DD5F8003 6 STAK 2413 SPREADSYS ENTRNP PUSH 023A7 60C40088 3 IMM 2414 LD PFPTR PNINITPAGE get our own page's number 023A8 80920000 0 REG 2415 PFRD R0 get the relocation 023A9 600A0840 0 0 CBM 2416 LD R0 R0/PFSLOT get the primary MCU's slot # 023AA E4178801 0 6 BASE 2417 ST R0 SP,PRIMESLOT save on stack 2418 2419 * Do the work. 2420 023AB 61001DDC 4 2421 LD PPL PPCLNIDLE get first available PPL 023AC FB3023B7 4 2422 JZA PPL ALLDONE jump if list is empty 2423 * \ / 2424 2425 ********************************************************************************** 2426 * * 2427 * Loop around until we run out of monitor pages to swap, * 2428 * or until there's only one MCU supplying us with PPLs, or * 2429 * until we run out of PPLs. * 2430 * * 2431 ********************************************************************************** 2432 * \ / 2433 023AD D1578802 6 BASE 2434 STMW SP,CURRPAGE initialize loop counter 000023AE 2435 SPREADLOOP LABEL 023AE BC578802 1 6 BASE 2436 INCL R1 SP,CURRPAGE increment loop counter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 357 (INITIAL) F 21 Initialization Routine 023AF 6440253E 1 2437 CPR R1 MONSPREAD have we done enough? 023B0 FE0623B7 2438 JGE ALLDONE jump, finished our job 023B1 60090843 0 4 ZBM 2439 LD R0 PPL,PPPMVALUE/PFSLOT get current PPLs PMV 023B2 64178801 0 6 BASE 2440 CPR R0 SP,PRIMESLOT PPL from original MCU? 023B3 FE0223B6 2441 JEQ CYCLE jump if swizzle would be NOP 023B4 DC0023B8 2442 CALL SWAPPMVS swizzle this page 023B5 40565009 1 REG 2443 PARVL R1+RESIDENT/FLDPAGE pass page number 000023B6 2444 CYCLE LABEL 023B6 FB3623AE 4 2445 LJNA PPL SPREADLOOP fall through if no more PPLs 2446 * \ / 2447 000023B7 2448 ALLDONE LABEL 023B7 5D1F8003 6 STAK 2449 LEAVE POP return 2450 * --- 2451 2452 END SPREADSYS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 358 (INITIAL) F 21 Initialization Routine 2454 2455 ********************************************************************************** 2456 * * 2457 * SWAPPMVS * 2458 * Copies a monitor resident page to the page in PPL, and * 2459 * swaps page map values between same. Preserves the PF * 2460 * control bits in the monitor page and zeroes them in the PPL * 2461 * page. Since the has-been monitor page is now free for * 2462 * general consumption, we also zero its contents to preserve * 2463 * propriety. Updates the PFMAP. * 2464 * * 2465 * Call: PPL => physical page element * 2466 * CALL SWAPPMVS * 2467 * PARVL * 2468 * * 2469 * Eats R0:R3 * 2470 * Window usage: WNDO1, virtual page of parm * 2471 * Stack usage: 2 * 2472 * * 2473 ********************************************************************************** 2474 2475 BLOCK SWAPPMVS subroutine 2476 ENTRY SWAPPMVS 2477 2478 BEGFRAME 00178801 6 BASE 2479 HASBEEN BSS 1 number of page being replaced 2480 ENDFRAME 2481 023B8 DD1F8002 6 STAK 2482 SWAPPMVS ENTR PUSH 023B9 C0578801 6 BASE 2483 STPVL SP,HASBEEN save monitor page number 2484 2485 * Copy monitor page into PPLs page 023BA 60C40082 3 IMM 2486 LD PFPTR PNWNDO1 grab on to WNDO1 023BB 00D70803 4 BASE 2487 LDPF PPL,PPPMVALUE map in page from PPL 023BC 600A1400 0 0 CBM 2488 LD R0 R0*FLDPAGE make address out of parameter 023BD 60441000 1 IMM 2489 LD R1 CPW*WPP size of page in chars 023BE 60840800 2 IMM 2490 LD R2 ADR WNDO1 address of new guy 023BF FE400000 2491 CMOVE copy monitor page into PPLs page 2492 * \ / 2493 2494 * Swap pagemap values cleanly 023C0 60D78801 3 6 BASE 2495 LD PFPTR SP,HASBEEN get monitor page 023C1 7CC40080 3 IMM 2496 IOR PFPTR MONPF find monitor half of PF 023C2 80924000 1 REG 2497 PFRD R1 get page's relocation 023C3 600A5A30 0 1 CBM 2498 LD R0 R1/PFCNTL get the control bits 023C4 EC0A5A30 1 CBM 2499 STZ R1/PFCNTL now clear them 023C5 E0570803 1 4 BASE 2500 EXCH R1 PPL,PPPMVALUE get/set PPL's PMV 023C6 E40A5A30 0 1 CBM 2501 ST R0 R1/PFCNTL restore mon pages control 023C7 28450000 1 IMM 2502 BSUB R1 1*PFREFBIT clear "referenced" flag 023C8 60978801 2 6 BASE 2503 LD R2 SP,HASBEEN retrieve relative page in monitor space 023C9 E4640380 1 2 2504 ST R1 PFMAP(R2) save new PMV in PFMAP 023CA 00D24000 1 REG 2505 LDPF R1 and put in this CPUs PF 2506 * \ / 2507 2508 * PMVs are switched, finish by zeroing old page 023CB 60C40082 3 IMM 2509 LD PFPTR PNWNDO1 map-over WNDO1 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 359 (INITIAL) F 21 Initialization Routine 023CC 00D70803 4 BASE 2510 LDPF PPL,PPPMVALUE with has-beens PMV 023CD 60441000 1 IMM 2511 LD R1 CPW*WPP get char size of page 023CE 60840800 2 IMM 2512 LD R2 ADR WNDO1 make destination addr 023CF FE580000 2513 CFILL 00 clear the page 023D0 80D20000 0 REG 2514 PFRC R0 must unmap get window faults later 2515 023D1 5D1F8002 6 STAK 2516 LEAVE POP return 2517 * --- 2518 2519 END SWAPPMVS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 360 (INITIAL) F 21 Initialization Routine 2521 2522 ********************************************************************************** 2523 * * 2524 * Constants * 2525 * * 2526 ********************************************************************************** 2527 2528 023D2 E79EDF2D 2529 SYSACTNAM PAK12 !!!!!!!!!!!! 023D4 E79EDF2D 2530 SYSACTPROJ PAK6 !!!!!! account and project for dummy ULB 2531 2532 ********************************************************************************** 2533 * * 2534 * These goodies are put in here so that system * 2535 * programmers can see the PAK6 representions of the commonly * 2536 * needed stuff without going very far. They serve no other * 2537 * purpose. * 2538 * * 2539 ********************************************************************************** 2540 023D5 B674BFEF 2541 PAK6 SYSTEM 023D6 E79DF200 2542 PAK6 !!! 023D7 60D7BED5 2543 PAK6 EXPSYS 023D8 B97B6600 2544 PAK6 TEM 023D9 533719C0 2545 PAK6 CODE 023DA 9B17AC90 2546 PAK6 OFFLINE 023DB 8A28910E 2547 PAK6 LOGFIL 023DC 52DAF000 2548 PAK6 CM 023DD 60D758D8 2549 PAK6 EXPCM 023DE 9BFFE0D8 2550 PAK6 OLDCM 023DF 9C0046D5 2551 PAK6 OLDSYS 023E0 9CA39C00 2552 PAK6 OPL 2553 2554 END SYSINIT System Initialization Routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 361 F 0 Initialization Routine 32 33 ********************************************************************************** 34 * * 35 * Place to break the listing. * 36 * This is the beginning of the resident operating system. * 37 * * 38 ********************************************************************************** 39 40 ORG ((DISPW MA 0)+WPP-1) AND (-WPP) get off initializer page 00002400 ABS 41 RESIDENT EQU DISPW MA 0 beginning of resident nucleus 42 00002400 43 VERSION LABEL 02400 43393330 44 VFD REVNAMEH insert the system version (in ascii) 02401 33202020 45 VFD REVNAMEL and low half 46 47 INPUT PFPROC page fault processor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 362 (PFPROC) F 22 Page Fault Processor - Overview 3 4 PFPROCESS BLOCK Page Fault Processor - Main Block 5 ENTRY PFPROC only job of this routine 6 7 ********************************************************************************** 8 * * 9 * PAGE FAULT PROCESSING * 10 * The page fault processor is the man on the spot who * 11 * implements the schedulers desires. See the scheduling * 12 * routines and the list element prototypes for further * 13 * information concerning their operation. * 14 * * 15 * HARDWARE * 16 * The access privilege to each virtual page belonging to * 17 * a process is controlled by an entry in the page file. The * 18 * page file hardware recognizes the following privileges: * 19 * * 20 * 1) Read/Write. The process is allowed complete * 21 * access to the page. * 22 * 2) Read Only. The process is allowed only read * 23 * operations on this page. Any attempt to alter * 24 * the page causes a page fault interrupt. * 25 * 3) Excluded. Any attempt to access this page causes * 26 * a page fault interrupt. * 27 * * 28 * A process may have privileges that don't correspond * 29 * exactly to these hardware supplied protections. These * 30 * privileges are controlled by the page fault processor based * 31 * on control information set up by the scheduling or memory * 32 * management code. * 33 * * 34 * OPERATION * 35 * The functions of the page fault processor is, for each * 36 * page fault interrupt, to determine what actions to take to * 37 * make the requested page available to the process. If the * 38 * user has requested an operation that he is not allowed, an * 39 * appropriate error entry to his overprocess is initiated. * 40 * Otherwise, the necessary table changes are made and the * 41 * user restarted, or the necessary mass storage transfers are * 42 * requested and the user is shutdown to wait for them. * 43 * * 44 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 363 (PFPROC) F 22 Page Fault Processor - PFPROC routine 47 48 ********************************************************************************** 49 * * 50 * HERE ABIDE MONSTERS * 51 * * 52 * PFPROC - Enter here on a page fault. * 53 * The page fault interrupt sets up the registers as follows: * 54 * R2 = 1 if excluded, * 55 * 2 if protect violation, * 56 * 3 if write attempted on excluded page * 57 * R3 = page number where violation occurred * 58 * R4 => previous console area * 59 * * 60 * We do a bunch of messy logic to sort out the * 61 * following cases: * 62 * * 63 * The normal case. A process is attempting to access an * 64 * existing page that is not in its working set. * 65 * The zeropage case. A process is attempting to access * 66 * an unmapped page. He must be supplied with a new page of * 67 * zeros. * 68 * The own copy case. A process is attempting to write to * 69 * a page that is already in its working set read only, and he * 70 * should be given his own copy of the page to dirty. * 71 * The protection violation case. A process is * 72 * attempting to reference a page which has been explicitly * 73 * excluded from his working set, or is attempting to write a * 74 * page which has been explicitly marked read only. The * 75 * process will suffer an error. * 76 * * 77 * Error conditions. * 78 * The page fault processor also recognizes a number of * 79 * error conditions. Usually, somebody in the monitor screwed * 80 * up and attempted to reference a page that he shouldn't * 81 * have. These are recognizable because, while the user can * 82 * reference unmapped memory (and just gets a zero page) this * 83 * is not allowed for the monitor. * 84 * This category of HALTS represents problems elsewhere in * 85 * the monitor. They can sometimes be restarted by using the * 86 * "LDCA R4" conveniently supplied to restore the interrupted * 87 * process registers, then fixing whatever is wrong before * 88 * resuming execution. * 89 * * 90 * Exits to ZEROPAGE, OWNCOPY, NORMALPAGE, or PROTECTED. * 91 * * 92 * Stack required = 15. * 93 * 0 + max ( FINDVP (4), NOREADPAGE (15), NORMALPAGE (15), * 94 * PROTECTED (1), ZEROPAGE (15) ) * 95 * * 96 ********************************************************************************** 97 98 BLOCK PFPROC routine 99 ENTRY PFPROC 100 00002402 101 PFPROC LABEL 02402 5C000412 102 CMZ CPPSA check pointer for current user 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 364 (PFPROC) F 22 Page Fault Processor - PFPROC routine 02403 FE0C2406 103 JNE PFHVPSA jump if a valid PSA pointer 104 * \ / 105 106 ********************************************************************************** 107 * * 108 * A page fault has occurred while no session is running. * 109 * This is a definite no-no. It means that we were executing a * 110 * piece of the kernal that MUST run without suspension. * 111 * If you wish to attempt a repair, execute the "LDCA R4" * 112 * (R4 points to the console area of the interrupted routine). * 113 * You are then back at the instruction that caused the trap and * 114 * may take whatever actions are required to repair the system. * 115 * * 116 ********************************************************************************** 117 118 * \ / 02404 00130000 119 HALT HALTS0000 page fault with no user session running 120 * --- 02405 01130000 4 REG 121 LDCA R4 for system debuggers, P.T. Barnum was right! 122 * --- 123 00002406 124 PFHVPSA LABEL 02406 6001F00E 0 125 LD R0 UMEMPSA do the mapped in virtual tables 02407 64000413 0 126 CPR R0 CMAPPSA ... match the current process? 02408 FE02240A 127 JEQ PFMAPOK jump if we've got the right guy mapped in 128 * \ / 129 130 ********************************************************************************** 131 * * 132 * The virtual free storage we have mapped in is not for * 133 * the guy who page faulted. All I can say is to back track * 134 * through the subroutine calls in an attempt to find the mix * 135 * up. * 136 * * 137 ********************************************************************************** 138 139 * \ / 02409 00130008 140 HALT HALTS0008 wrong memory lists mapped in 141 * --- 142 0000240A 143 PFMAPOK LABEL 144 * get stack associated with the new CA 145 SETSP 0240A 81538000 6 REG 145 STCAR SP 0240B 6197880D 6 6 BASE 145 LD SP SP,CASTACKPTR 0240C 61979020 6 6 REG 145 LD SP SP+(2 POWER STAKLOG) 0240D 61D2C000 7 3 REG 146 LD R7 R3 copy page number where violation occurred 0240E F6BE2419 2 147 JBT R2/BIT 31 PFEXCLUDED excluded memory, different treatment 148 * \ / 149 150 ********************************************************************************** 151 * * 152 * PROTECT VIOLATION * 153 * This code is entered when a page already exists, but is * 154 * read only. The normal treatment of this condition is to give * 155 * the user a protect violation. However, if the VPCNTLOCB bit * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 365 (PFPROC) F 22 Page Fault Processor - PFPROC routine 156 * is set, we give the user a copy of the page to dabble with. * 157 * * 158 ********************************************************************************** 159 160 * R2=REASON, R3=fault page number, R4 => old CA, SP, R7=VPN 161 162 * \ / 0240F 65C40085 7 IMM 163 CPR R7 HIUSERPAGE above highest in user VM list? 02410 FE0A2412 164 JLE USERVI jump if in user memory 165 * \ / 166 167 ********************************************************************************** 168 * * 169 * A store reference has been made to a monitor page. * 170 * This is definitely a no-no. This probably means that some * 171 * free storage points off into the night (monitor). If the * 172 * problem can be repaired (lists fixed or whatever), the * 173 * system may be restarted by doing a LDCA R4. R4 points to * 174 * the console area of the program that attempted the store. * 175 * Good luck. * 176 * * 177 ********************************************************************************** 178 179 * \ / 02411 00130001 180 HALT HALTS0001 monitor memory protect violation 181 * --- 182 00002412 183 USERVI LABEL 02412 6013C000 0 7 REG 184 LD R0 R7 copy the virtual page number 02413 60400412 1 185 LD R1 CPPSA and the PSA pointer 02414 DC40265F 186 CALLNP FINDVP look for the virtual page element 02415 00130002 187 HALT HALTS0002 VPAGE element not found 188 * (this was a store reference to a RO page. 189 * It MUST already exist!) 190 191 * R3=fault page number, R4 => old CA, VPP=>VPAGE, SP, R7=VPN 192 02416 5C095810 5 ZBM 193 CMZ VPP,VPCNTL/VPCNTLOCB is the user allowed a copy? 02417 FE0224BD 194 JEQ PROTECTED jump if not, protect violation 02418 FE0E246A 195 JMP OWNCOPY else it's an own-copy page 196 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 366 (PFPROC) F 22 Page Fault Processor - PFPROC routine 198 199 ********************************************************************************** 200 * * 201 * EXCLUDED PAGE * 202 * The user has referenced a page that is not mapped at all. * 203 * There are three possibilities: * 204 * 1) The page has never been referenced or specified. * 205 * We will supply a zeropage. * 206 * 2) The page has been specified as 'excluded'. We * 207 * give the user a protect violation. * 208 * 3) Otherwise, it is a normal page request. * 209 * * 210 ********************************************************************************** 211 00002419 212 PFEXCLUDED LABEL 213 214 * R2=REASON, R3=fault page number, R4 => old CA, SP, R7=VPN 215 02419 65C40085 7 IMM 216 CPR R7 HIUSERPAGE above highest in user VM list? 0241A FE0A2422 217 JLE PFUPAGE jump if a user page 218 * \ / 219 220 ********************************************************************************** 221 * * 222 * The page was a monitor page. Ensure that the * 223 * reference was not for a store, and search the MONVM list * 224 * for its VP element. * 225 * * 226 ********************************************************************************** 227 228 * \ / 0241B F2BC241D 2 229 JBF R2/BIT 30 MONREAD jump if read operation 230 231 ********************************************************************************** 232 * * 233 * A store reference has been make to a monitor page not * 234 * presently mapped. Look for bad monitor free storage. * 235 * If the problem can be fixed, the system may be restarted * 236 * with a LDCA R4. R4 points to the bad guys console area. * 237 * * 238 ********************************************************************************** 239 0241C 00130004 240 HALT HALTS0004 write into monitor memory 241 * --- 242 0000241D 243 MONREAD LABEL 0241D E4C0045E 3 244 ST R3 FNDVPFPN save this users page number 0241E 61401ECB 5 245 LD VPP MONVM get pointer to monitor VM list 0241F 3DD74004 7 5 CACH 246 LSRCH R7 VPP,VPVPN look for the proper page 02420 FE022426 247 JEQ PFUVIRT process a known monitor page 248 * \ / 249 250 ********************************************************************************** 251 * * 252 * A reference has been made to a monitor page that does * 253 * not exist. The most likely cause is a zero base register * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 367 (PFPROC) F 22 Page Fault Processor - PFPROC routine 254 * (i.e. screwed up list pointers or, even worse, mangled free * 255 * storage). If the problem can be fixed (lists repaired or * 256 * whatever) the process may be restarted by a LDCA R4. R4 * 257 * points to the console area of he who tried the reference. * 258 * Good luck. * 259 * * 260 ********************************************************************************** 261 262 * \ / 02421 00130005 263 HALT HALTS0005 stop for unknown monitor page 264 * --- 265 266 ********************************************************************************** 267 * * 268 * USER PAGE * 269 * The page is a user page. Look for it in his VMLIST. * 270 * If not present, supply a zeropage. * 271 * * 272 ********************************************************************************** 273 00002422 274 PFUPAGE LABEL 02422 6013C000 0 7 REG 275 LD R0 R7 copy the virtual page number 02423 60400412 1 276 LD R1 CPPSA and the PSA pointer 02424 DC40265F 277 CALLNP FINDVP find the VP element 02425 FE0E242C 278 JMP PFMAKENEW jump if not mapped 279 * \ / 280 281 ********************************************************************************** 282 * * 283 * The VP element was found. We examine it and decode the * 284 * VPCNTL field which indicates one of the following items.. * 285 * 1) A normal page. The MS address is present in the * 286 * VP element and we use that. * 287 * 2) A zero page. We call the ADT manager to get us * 288 * an available page of mass storage. * 289 * 3) A protected page. We give back the error to the user. * 290 * 4) A no-read page. If we can find the page resident, * 291 * we give it to the requesting process. If it is no * 292 * longer resident, we treat this request as a zero * 293 * page request. * 294 * After that decode, if the requested page was not found * 295 * resident, we call the MS driver to make the indicated page * 296 * available. In the case of zero page, we still call the MS * 297 * driver, since it must also manage the acquisition of * 298 * available resident pages of memory. * 299 * After the call to the MS driver, we suspend this * 300 * process in the MSWAIT scheduler queue. * 301 * * 302 ********************************************************************************** 303 304 * \ / 00002426 305 PFUVIRT LABEL the virtual page is known 306 307 * R4 => old CA, VPP=VPAGE, SP, R7=VPN 308 02426 60095420 0 5 ZBM 309 LD R0 VPP,VPCNTL/VPCNTLSRF get zeropage, excluded, no read field 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 368 (PFPROC) F 22 Page Fault Processor - PFPROC routine 02427 5CA02428 0 310 LDPC VPUVITAB(R0) 311 * --- 312 00002428 313 VPUVITAB LABEL 02428 000024C1 314 ADR NORMALPAGE 02429 0000242E 315 ADR ZEROPAGE 0242A 000024BD 316 ADR PROTECTED 0242B 000024CF 317 ADR NOREADPAGE 318 319 ********************************************************************************** 320 * * 321 * The corresponding virtual page is unknown to this * 322 * user. We will make a VM list entry for a zeropage and put * 323 * a request for a zeropage into the MSQ. * 324 * * 325 ********************************************************************************** 326 327 * SP, R7=VPN 328 0000242C 329 PFMAKENEW LABEL 0242C F3F0242E 7 330 JBF R7/MONBIT ZEROPAGE jump if not a user window ref 331 * \ / 332 333 ********************************************************************************** 334 * * 335 * The page referenced by the process is in the range * 336 * from 80 to HIUSERPAGE. Of these pages, page faults are only * 337 * allowed on the windows, which must be mapped prior to any * 338 * reference. * 339 * If the problem can be fixed, the process may be restarted * 340 * with a LDCA R4. * 341 * R4 => CA of the offending process * 342 * * 343 ********************************************************************************** 344 345 * \ / 0242D 00130007 346 HALT HALTS0007 reference to an unmapped window, die 347 * --- 348 349 END PFPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 369 (PFPROC) F 22 Page Fault Processor - ZEROPAGE Routine 352 353 ********************************************************************************** 354 * * 355 * Routine to handle zero-page requests. We: * 356 * 1. Check for trouble-maker and shut this guy down if necessary. * 357 * 2. Create a VPP if we don't already have one. * 358 * 3. Allocate a disk block for the new page. * 359 * 4. Shut down the user and ask the disk driver to supply * 360 * the page of zeros. * 361 * * 362 * R5 => VPP, or zero if none * 363 * FNDVPFPN = original page number * 364 * FNDVPPN = page number after equivalencing * 365 * FNDVPLPSA = ptr to PSA owning page after equivalencing * 366 * FNDVPVMR = ptr to root of VM list after equivalencing * 367 * JMP ZEROPAGE * 368 * * 369 * Exits to DISPATCH. * 370 * * 371 * Stack required = 15 * 372 * 0 + max ( ADDSWAP (1), DROPCA (3), FCGETMEM (0), * 373 * GETFREEBLK (15), GRABCA (4), LOCKWAIT (0), * 374 * MSREADREQ (1), MSSHUTDOWN (14), TESTTRUBL (13), * 375 * UERRSET (1) ) * 376 * * 377 ********************************************************************************** 378 379 BLOCK ZEROPAGE routine 380 ENTRY ZEROPAGE 381 0000242E 382 ZEROPAGE LABEL 0242E DC402BF3 383 CALLNP TESTTRUBL check for this user a trouble maker 0242F FB722442 5 384 JNZA VPP HAVEVPP jump if we already have a VP element 385 02430 DC002F0A 386 CALL VGETMEM get a piece of storage 02431 40440002 IMM 387 PARVL VPLOG indicate its length 388 02432 61520000 5 0 REG 389 LD VPP R0 make the index point at the new block 02433 EE174800 5 BASE 390 STZ2 VPP,0 clear the element 02434 EE174802 5 BASE 391 STZ2 VPP,2 02435 6000045F 0 392 LD R0 FNDVPPN load the virtual page number 02436 E4174004 0 5 CACH 393 ST R0 VPP,VPVPN set the virtual page number 02437 60040008 0 IMM 394 LD R0 VPZEROPG get the value for zero page request 02438 E4094E80 0 5 ZBM 395 ST R0 VPP,VPCNTL set control field to indicate zero page 02439 6000045D 0 396 LD R0 FNDVPLPSA get the PSA containing the VPP 0243A 60081F13 0 0 ZBM 397 LD R0 R0,PSUSERLIMP get the user limit block 0243B 60080081 0 0 ZBM 398 LD R0 R0,ULDRIVE get the volume number 0243C E4094083 0 5 ZBM 399 ST R0 VPP,VPDRIVE indicate where the page is 0243D 60043F8B 0 IMM 400 LD R0 FBITSYS*VPFBINEWB+FBITFREE*VPFBIOLDB 0243E E40942E2 0 5 ZBM 401 ST R0 VPP,VPFBITYPE indicate swapping memory 0243F 60100460 0 @ 402 LD R0 @FNDVPVMR get pointer to VM list 02440 E4095F10 0 5 ZBM 403 ST R0 VPP,VPLINK set forward link 02441 E5500460 5 @ 404 ST VPP @FNDVPVMR place new entry at list head 00002442 405 HAVEVPP LABEL 406 * \ / 407 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 370 (PFPROC) F 22 Page Fault Processor - ZEROPAGE Routine 02442 60095072 0 5 ZBM 408 LD R0 VPP,VPFBITYPE/VPFBINEWB 02443 6404000B 0 IMM 409 CPR R0 FBITSYS is this to be a swapping page? 02444 FE0C2447 410 JNE NOTSWAP jump if not 02445 DC40257E 411 CALLNP ADDSWAP check for excessive disk space used 02446 FE0E2467 412 JMP LIMEXCEED give error if too much space in use 413 * \ / 00002447 414 NOTSWAP LABEL 415 416 ********************************************************************************** 417 * * 418 * Request a free MS block ( from the ADT ) * 419 * * 420 ********************************************************************************** 421 422 * \ / 02447 DC00284A 423 CALL GRABCA get a new console area 02448 40000406 424 PARL IVTPAGE for the IVT 425 02449 61C0045E 7 426 LD R7 FNDVPFPN get the page number that we were looking for 0244A DC003654 427 CALL GETFREEBLK call for a MS block 0244B 41495072 5 ZBM 428 PARV VPP,VPFBINEW pass the type it will become 0244C 40494083 5 ZBM 429 PARVL VPP,VPDRIVE specify volume to be used 0244D E5C0045E 7 430 ST R7 FNDVPFPN save original page number 0244E FE042461 431 JGT NODISKSPC out of storage 0244F E4174803 0 5 BASE 432 ST R0 VPP,VPBLOCK save the newly acquired block 433 * \ / 02450 DC40285A 434 CALLNP DROPCA remove extra console area 435 * \ / 02451 EC095420 5 ZBM 436 STZ VPP,VPCNTL/VPCNTLSRF clear the zero page request 02452 60974803 2 5 BASE 437 LD R2 VPP,VPBLOCK get the new MS address 02453 61C94E30 7 5 ZBM 438 LD R7 VPP,VPCNTL/VPMAIFLD save maintenance field 02454 DC402533 439 CALLNP MSSHUTDOWN shut down user to wait for page 440 * \ / 441 442 ********************************************************************************** 443 * * 444 * The user may be inserted into the MSWAIT queue with * 445 * the MSQIN having been unlocked because no other CPU may * 446 * have a existing request for this block. * 447 * * 448 ********************************************************************************** 449 450 * \ / 451 PLOCK MSQINLOCK call to lock the mass storage input queue 02455 0CC00000 451 IOFF 02456 D1C01F16 451 SETT MSQINLOCK 02457 FE0C2459 451 JNE MA(2+DISPW MA 0) 02458 DC40308B 451 CALLNP LOCKWAIT 02459 61128000 4 2 REG 452 LD R4 R2 and the 'actual' ms address (same) 0245A 61440003 5 IMM 453 LD R5 1*MSQZPAGE+1*MSQSNEWAD request type 0245B E5CB7430 7 5 CBM 454 ST R7 R5/MSQMAIFLD and combine the two 0245C DC003936 455 CALL MSREADREQ call for a MS transfer 0245D 40534000 5 REG 456 PARVL R5 indicate nature of request 457 PUNLOCK MSQINLOCK call to release the mass storage input queue 0245E EC001F16 457 STZ MSQINLOCK 0245F 0C800000 457 ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 371 (PFPROC) F 22 Page Fault Processor - ZEROPAGE Routine 02460 FE0E28B7 458 JMP DISPATCH look for a new user 459 * --- 460 461 ********************************************************************************** 462 * * 463 * Here, we ran out of disk space. The poor user will * 464 * get an error. * 465 * * 466 ********************************************************************************** 467 00002461 468 NODISKSPC LABEL 02461 DC402596 469 CALLNP DELSWAP restore space used totals 02462 DC40285A 470 CALLNP DROPCA remove the extra console area 02463 60840872 2 IMM 471 LD R2 UINTVMFIDS+VERYBAD error code 00002464 472 PUTERROR LABEL 02464 60C0045E 3 473 LD R3 FNDVPFPN block number 02465 DC403589 474 CALLNP UERRSET place the error 02466 FE0E28B7 475 JMP DISPATCH and all done 476 * --- 477 00002467 478 LIMEXCEED LABEL 02467 60920000 2 0 REG 479 LD R2 R0 put error code into R2 02468 7C840800 2 IMM 480 IOR R2 VERYBAD error must not be put off 02469 FE0E2464 481 JMP PUTERROR share code 482 * --- 483 484 END ZEROPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 372 (PFPROC) F 22 Page Fault Processor - OWNCOPY Routine 487 488 ********************************************************************************** 489 * * 490 * Routine to give a user his own copy of a page that he * 491 * already has read/only. * 492 * * 493 * R5 => VPP for page (after equivalencing) * 494 * FNDVPFPN = page number of original fault * 495 * FNDVPLPSA = ptr to PSA of process owning page * 496 * JMP OWNCOPY * 497 * * 498 * Exit to DISPATCH. * 499 * * 500 * Actions: * 501 * 1. Check for trouble-makers. * 502 * 2. Get new disk block number to give as own copy. * 503 * 3. Remove PAL for read-only page, if any. * 504 * 4. Remove PAL from original owner of page, if any. * 505 * 5. Shut down the user and tell MSPROC to perform an address switch. * 506 * * 507 * Stack required = 19 * 508 * 4 + max ( ADDSWAP (1), DISCARDPAL (4), DMOTINDPAL (2), * 509 * DROPCA (3), GETFREEBLK (15), GRABCA (4), * 510 * LOCKWAIT (0), MSREADREQ (1), MSSHUTDOWN (14), * 511 * TESTTRUBL (13), UERRSET (1), UNLOPAL (0) ) * 512 * * 513 ********************************************************************************** 514 515 BLOCK OWNCOPY routine 516 ENTRY OWNCOPY 517 518 BEGFRAME2 00178800 6 BASE 519 SAVEAREA BSS 2 save area for FNDVPFPN and FNDVPLPSA 00178802 6 BASE 520 SAVEUPC BSS 1 save area for UPC pointer 00178803 6 BASE 521 SAVEOBLK BSS 1 save area for old block number 522 ENDFRAME 523 0000246A 524 OWNCOPY LABEL 0246A EC1F8004 6 STAK 525 STZ PUSH allocate a stack frame 526 527 ********************************************************************************** 528 * * 529 * We must check for system overload before we have * 530 * altered the lists controlling memory. If the user is a * 531 * troublemaker and is put in jail, we must be able to restart * 532 * him and have him reappear at this point in the page fault * 533 * processor with exactly the same situation reflected by his * 534 * PSA and lists. This way, we need not store all sorts of * 535 * bizarre information to ensure a correct restart. * 536 * Note that this call to TESTTRUBL may take pages away * 537 * from us (either VASP or WSX), including possibly the page * 538 * that we faulted on. * 539 * * 540 ********************************************************************************** 541 0246B DC402BF3 542 CALLNP TESTTRUBL check for system overload 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 373 (PFPROC) F 22 Page Fault Processor - OWNCOPY Routine 0246C 60174803 0 5 BASE 543 LD R0 VPP,VPBLOCK find corresponding MS address 0246D E4178803 0 6 BASE 544 ST R0 SP,SAVEOBLK save for later use 545 * \ / 546 547 ********************************************************************************** 548 * * 549 * Request a free MS block ( from the ADT ) We fetch a * 550 * free console area and swap it with the current one so that * 551 * we can get another page fault. * 552 * * 553 ********************************************************************************** 554 0246E DC40257E 555 CALLNP ADDSWAP do accounting for the MS space 0246F FE0E24BA 556 JMP LIMEXCEED return for limit error 557 * \ / 02470 DC00284A 558 CALL GRABCA 02471 40000406 559 PARL IVTPAGE 560 * \ / 02472 6000045E 0 561 LD R0 FNDVPFPN get the page number that we were looking for 02473 6040045D 1 562 LD R1 FNDVPLPSA and the PSA where we found it 02474 E6178800 016 BASE 563 ST2 R0 SP,SAVEAREA save info required to find page owner 02475 60000461 0 564 LD R0 FNDVPUPC get pointer to owners UPC 02476 E4178802 0 6 BASE 565 ST R0 SP,SAVEUPC save this also 02477 60085F13 0 1 ZBM 566 LD R0 R1,PSUSERLIMP get the users ULB 02478 60480081 1 0 ZBM 567 LD R1 R0,ULDRIVE get this users volume for swapping pages 02479 DC003654 568 CALL GETFREEBLK call for a MS block 0247A 4144000B IMM 569 PARV FBITSYS indicate the new block type 0247B 40524000 1 REG 570 PARVL R1 specify volume to be used 0247C 62978800 236 BASE 571 LD2 R2 SP,SAVEAREA retrieve FINDVP info from the stack 0247D E480045E 2 572 ST R2 FNDVPFPN save back the page number 0247E E4C0045D 3 573 ST R3 FNDVPLPSA and PSA pointer 0247F FE0424B5 574 JGT NODISKSPC out of storage 02480 E4174803 0 5 BASE 575 ST R0 VPP,VPBLOCK save the newly acquired block 02481 60978802 2 6 BASE 576 LD R2 SP,SAVEUPC recover pointer to owners UPC 02482 E4800461 2 577 ST R2 FNDVPUPC save back in correct location 02483 EC095F12 5 ZBM 578 STZ VPP,VPERAD user default error address for swapping pages 02484 6004000B 0 IMM 579 LD R0 FBITSYS load code that sez system use 02485 E0095072 0 5 ZBM 580 EXCH R0 VPP,VPFBINEW change type and retrieve old type 02486 E4094272 0 5 ZBM 581 ST R0 VPP,VPFBIOLD save expected old type for error check 02487 EC095F11 5 ZBM 582 STZ VPP,VPFCB indicate not part of lun 02488 6047FFFA 1 IMM 583 LD R1 NOT (VPCNTLRO+VPCNTLOC) read only and own copy bits 02489 F8494E80 1 5 ZBM 584 ANDM R1 VPP,VPCNTL remove bits from VPAGE element 585 0248A DC40285A 586 CALLNP DROPCA give back the console area in use 587 * \ / 588 589 ********************************************************************************** 590 * * 591 * We will take away the access that this user currently * 592 * has and put in a mass storage request for the desired page * 593 * with the right kind of access. * 594 * Note that if the page should happen to be locked, the * 595 * new one will be also, and the old PAL will be unlocked by * 596 * virtue of being destroyed. * 597 * Find the PAL, unload the page file, and discard the * 598 * PAL. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 374 (PFPROC) F 22 Page Fault Processor - OWNCOPY Routine 599 * * 600 ********************************************************************************** 601 0248B 60C00414 3 602 LD R3 CPCUPC get the current pointer 0248C 6000045E 0 603 LD R0 FNDVPFPN get the virtual page number 0248D 6056C80F 1 3 BASE 604 LD R1 R3,UPCVASP R1 => first element 0248E 3896C80F 2 3 BASE 605 LEA R2 R3,UPCVASP R2 => root of the list 0248F 48164000 0 1 CACH 606 RLSRCH R0 R1,PAVPN find the element for this 02490 FE0C24A5 607 JNE PFWTTX not found means it has aged out 02491 60085F10 0 1 ZBM 608 LD R0 R1,PALINK get pointer to what's after found 02492 E4089F10 0 2 ZBM 609 ST R0 R2,PALINK remove this element 02493 61124000 4 1 REG 610 LD PAL R1 PAL => found element 02494 DC402623 611 CALLNP UNLOPAL call to unload the page file location 02495 DC402E15 612 CALLNP DISCARDPAL get rid of the PAL 02496 60C00412 3 613 LD R3 CPPSA get the current PSA pointer 02497 D048C0F2 3 ZBM 614 DEC R3,PSWSSIZE indicate working set just shrunk 615 * \ / 616 617 ********************************************************************************** 618 * * 619 * See if this page is an indirect VP reference and, if * 620 * so, we must remove the old block from the working set of * 621 * the real pages owner over/under process. * 622 * * 623 ********************************************************************************** 624 625 * R3 => PSA, VPP => VPAGE, SP 626 627 * \ / 02498 60C00461 3 628 LD R3 FNDVPUPC copy the owners UPC pointer 02499 FAC224A6 3 629 JEQZ R3 NOTINDIRCT jump if not indirect page 0249A 60174004 0 5 CACH 630 LD R0 VPP,VPVPN get the virtual page number 0249B 6056C80F 1 3 BASE 631 LD R1 R3,UPCVASP R1 => first element 0249C 3896C80F 2 3 BASE 632 LEA R2 R3,UPCVASP R2 => root of the list 0249D 48164000 0 1 CACH 633 RLSRCH R0 R1,PAVPN find the element for this 0249E FE0C24A5 634 JNE PFWTTX not found means it has aged out 0249F 60085F10 0 1 ZBM 635 LD R0 R1,PALINK get pointer to what's after found 024A0 E4089F10 0 2 ZBM 636 ST R0 R2,PALINK remove this element 024A1 61124000 4 1 REG 637 LD PAL R1 PAL => found element 024A2 DC402E15 638 CALLNP DISCARDPAL remove it from the working set 024A3 60C00412 3 639 LD R3 CPPSA get the current PSA pointer 024A4 D048C0F2 3 ZBM 640 DEC R3,PSWSSIZE indicate working set just shrunk 000024A5 641 PFWTTX LABEL 024A5 DC403165 642 CALLNP DMOTINDPAL move all PAL's for indirect pages to WSX 000024A6 643 NOTINDIRCT LABEL 644 * \ / 645 646 * VPP=>VPAGE, SP 647 648 * \ / 649 ********************************************************************************** 650 * * 651 * Note that we have already ensured that this user is * 652 * not a troublemaker. We must not call TESTTRUBL here, since * 653 * it would not be possible to restart the user correctly if * 654 * he were put in jail. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 375 (PFPROC) F 22 Page Fault Processor - OWNCOPY Routine 655 * The user may be shut down with MSQIN unlocked. The * 656 * mass storage queuer can not find a duplicate because a free * 657 * block is being requested. * 658 * * 659 ********************************************************************************** 660 661 * \ / 024A6 60974803 2 5 BASE 662 LD R2 VPP,VPBLOCK fetch new MS address 024A7 61C94E30 7 5 ZBM 663 LD R7 VPP,VPCNTL/VPMAIFLD maintenance field 024A8 DC402533 664 CALLNP MSSHUTDOWN shut down user to wait for page 665 666 * SP, R7=maintenance bits 667 668 PLOCK MSQINLOCK call to lock the mass storage input queue 024A9 0CC00000 668 IOFF 024AA D1C01F16 668 SETT MSQINLOCK 024AB FE0C24AD 668 JNE MA(2+DISPW MA 0) 024AC DC40308B 668 CALLNP LOCKWAIT 024AD 61178803 4 6 BASE 669 LD R4 SP,SAVEOBLK copy parameter (actual (or old) MS address) 024AE 61440001 5 IMM 670 LD R5 1*MSQSNEWAD request type 024AF E5CB7430 7 5 CBM 671 ST R7 R5/MSQMAIFLD and combine the two 024B0 DC003936 672 CALL MSREADREQ call for a MS transfer 024B1 40534000 5 REG 673 PARVL R5 indicate nature of request 674 PUNLOCK MSQINLOCK call to release the mass storage input queue 024B2 EC001F16 674 STZ MSQINLOCK 024B3 0C800000 674 ION 024B4 FE0E28B7 675 JMP DISPATCH look for someone to run 676 * --- 677 000024B5 678 NODISKSPC LABEL 024B5 DC40285A 679 CALLNP DROPCA remove the extra console area 024B6 60840872 2 IMM 680 LD R2 UINTVMFIDS+VERYBAD error code: insufficient disk space 000024B7 681 PUTERROR LABEL 024B7 60C0045E 3 682 LD R3 FNDVPFPN error parm: page number 024B8 DC403589 683 CALLNP UERRSET set the error 024B9 FE0E28B7 684 JMP DISPATCH and all done 685 * --- 000024BA 686 LIMEXCEED LABEL 024BA 60920000 2 0 REG 687 LD R2 R0 put error code into R2 024BB 7C840800 2 IMM 688 IOR R2 VERYBAD error must not be put off 024BC FE0E24B7 689 JMP PUTERROR share code 690 * --- 691 692 END OWNCOPY routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 376 (PFPROC) F 22 Page Fault Processor - PROTECTED Routine 695 696 ********************************************************************************** 697 * * 698 * Routine to handle access to a user excluded page. * 699 * It's easy: We just give the poor slob an error. * 700 * * 701 * FNDVPFPN = page number of original fault * 702 * JMP PROTECTED * 703 * * 704 * Exits to DISPATCH. * 705 * Stack required = 1. * 706 * 0 + max ( UERRSET (1) ) * 707 * * 708 ********************************************************************************** 709 710 BLOCK PROTECTED routine 711 ENTRY PROTECTED 712 000024BD 713 PROTECTED LABEL 024BD 60840874 2 IMM 714 LD R2 UINTMPV+VERYBAD memory protect violation 024BE 60C0045E 3 715 LD R3 FNDVPFPN param is the page number 024BF DC403589 716 CALLNP UERRSET give the guy the error 024C0 FE0E28B7 717 JMP DISPATCH return to user to process error 718 * --- 719 720 END PROTECTED routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 377 (PFPROC) F 22 Page Fault Processor - NORMALPAGE Routine 723 724 ********************************************************************************** 725 * * 726 * Routine to handle a normal page request (i.e., not * 727 * zero page or own copy). We proceed as follows: * 728 * * 729 * 1. Try to find the page resident. * 730 * 2. Otherwise, shut the user down and tell MSPROC that * 731 * we need the page. * 732 * * 733 * R5 => VPP element (after equivalencing) * 734 * FNDVPFPN = original page number * 735 * JMP NORMALPAGE * 736 * * 737 * Exits to DISPATCH. * 738 * * 739 * Stack required = 15. * 740 * 0 + max ( FINDRESPAG (15), MSREADREQ (1), MSSHUTDOWN (14), * 741 * TESTTRUBL (13) ) * 742 * * 743 ********************************************************************************** 744 745 BLOCK NORMALPAGE routine 746 ENTRY NORMALPAGE 747 000024C1 748 NORMALPAGE LABEL 024C1 DC402BF3 749 CALLNP TESTTRUBL check for any troublemakers 024C2 DC4024ED 750 CALLNP FINDRESPAG check if the page is still resident 024C3 FE0E28B7 751 JMP DISPATCH yes, we found it 752 * \ / 753 754 ********************************************************************************** 755 * * 756 * The desired page is unavailable. We put in a request * 757 * for this page and move this user into the MSWAIT queue. * 758 * * 759 ********************************************************************************** 760 761 * VPP =>VPAGE, SP 762 * lists locked: MSQIN 763 024C4 60974803 2 5 BASE 764 LD R2 VPP,VPBLOCK fetch the old MS address 024C5 61C94E30 7 5 ZBM 765 LD R7 VPP,VPCNTL/VPMAIFLD maintenance field 024C6 DC402533 766 CALLNP MSSHUTDOWN shut down user to wait for page 024C7 61128000 4 2 REG 767 LD R4 R2 re-fetch MS address 024C8 61440000 5 IMM 768 LD R5 0 request type, normal 024C9 E5CB7430 7 5 CBM 769 ST R7 R5/MSQMAIFLD and combine the two 024CA DC003936 770 CALL MSREADREQ call for a MS transfer 024CB 40534000 5 REG 771 PARVL R5 indicate nature of request 772 PUNLOCK MSQINLOCK release MS input queue 024CC EC001F16 772 STZ MSQINLOCK 024CD 0C800000 772 ION 024CE FE0E28B7 773 JMP DISPATCH go to pick up a new user 774 * --- 775 776 END NORMALPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 378 (PFPROC) F 22 Page Fault Processor - NOREADPAGE routine 779 780 ********************************************************************************** 781 * * 782 * Routine to handle a no read page request (i.e., if * 783 * resident, give to user, otherwise, supply zeropage). We * 784 * proceed as follows: * 785 * * 786 * 1. Try to find the page resident. * 787 * 2. Otherwise, shut the user down and tell MSPROC that * 788 * we need a zero page. * 789 * * 790 * R5 => VPP element (after equivalencing) * 791 * FNDVPFPN = original page number * 792 * JMP NOREADPAGE * 793 * * 794 * Exits to DISPATCH. * 795 * * 796 * Stack required = 15. * 797 * 0 + max ( FINDRESPAGE (15), MSREADREQ (1), MSSHUTDOWN (14), * 798 * TESTTRUBL (13) ) * 799 * * 800 ********************************************************************************** 801 802 BLOCK NOREADPAGE 803 ENTRY NOREADPAGE 804 000024CF 805 NOREADPAGE LABEL 024CF DC402BF3 806 CALLNP TESTTRUBL check for troublemakers 024D0 EC095420 5 ZBM 807 STZ VPP,VPCNTL/VPCNTLSRF clear the request field 024D1 DC4024ED 808 CALLNP FINDRESPAG check if page is still resident 024D2 FE0E28B7 809 JMP DISPATCH yes, it was resident 810 * \ / 811 812 ********************************************************************************** 813 * * 814 * The desired page seems to be unavailable. We put in a * 815 * request for this page and move this user into the MSWAIT * 816 * queue. * 817 * * 818 ********************************************************************************** 819 820 * VPP =>VPAGE, SP 821 * lists locked: MSQIN 822 024D3 60974803 2 5 BASE 823 LD R2 VPP,VPBLOCK get the new MS address 024D4 61C94E30 7 5 ZBM 824 LD R7 VPP,VPCNTL/VPMAIFLD maintenance field 024D5 DC402533 825 CALLNP MSSHUTDOWN shut down user to wait for page 024D6 61128000 4 2 REG 826 LD R4 R2 and the 'actual' ms address (same) 024D7 61440003 5 IMM 827 LD R5 1*MSQZPAGE+1*MSQSNEWAD indicate nature of request 024D8 E5CB7430 7 5 CBM 828 ST R7 R5/MSQMAIFLD and combine the two 024D9 DC003936 829 CALL MSREADREQ call for a MS transfer 024DA 40534000 5 REG 830 PARVL R5 indicate nature of request 831 PUNLOCK MSQINLOCK call to release the MS input queue 024DB EC001F16 831 STZ MSQINLOCK 024DC 0C800000 831 ION 024DD FE0E28B7 832 JMP DISPATCH look for a new user 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 379 (PFPROC) F 22 Page Fault Processor - NOREADPAGE routine 833 * --- 834 835 END NOREADPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 380 (PFPROC) F 22 Page Fault Processor - SRCHWSX routine 838 839 ********************************************************************************** 840 * * 841 * This routine only searches the working set extension * 842 * list to see if the page is resident. If so we reuse the * 843 * PAL, otherwise we must look elsewhere for the page, in the * 844 * hopes that the page may still be resident. Call: * 845 * * 846 * PPL * 847 * R5 => VPP * 848 * FNDVPFPN = original page # * 849 * FNDVPUPC = indirect VP UPC, if any * 850 * CALLNP SRCHWSX * 851 * JMP * 852 * * 853 * * 854 * Eats R0:R3. PAL ptr returned in R3. * 855 * Stack required = 9 * 856 * 1 + max ( REUSEPAL (8) ) * 857 * * 858 ********************************************************************************** 859 860 BLOCK SRCHWSX routine 861 ENTRY SRCHWSX 862 863 BEGFRAME 864 ENDFRAME 865 024DE DD5F8001 6 STAK 866 SRCHWSX ENTRNP PUSH 024DF 60800414 2 867 LD R2 CPCUPC get the current UPC pointer 024E0 38D68810 3 2 BASE 868 LEA R3 R2,UPCWSX point to the root of WSX list 024E1 60968810 2 2 BASE 869 LD R2 R2,UPCWSX point to first element of WSX 024E2 49168803 4 2 BASE 870 RLSRCH PPL R2,PAPPLPTR look for a matching PAL 024E3 FE0C24EC 871 JNE PFNOTWSX jump if not found in WSX 872 * \ / 873 874 * The page is in the working-set extension list. Use it. 875 876 * \ / 024E4 60089F10 0 2 ZBM 877 LD R0 R2,PALINK get pointer to stuff after 024E5 E408DF10 0 3 ZBM 878 ST R0 R3,PALINK remove found element from list 024E6 60D28000 3 2 REG 879 LD R3 R2 R3 => unlinked PAL 880 * \ / 881 882 * R3 => PAL, PPL, VPP, SP 883 884 * \ / 024E7 DC002643 885 CALL REUSEPAL set up to reuse this PAL 024E8 41400461 886 PARV FNDVPUPC pass indirect VP UPC 024E9 4140045E 887 PARV FNDVPFPN actual page number 024EA 40400412 888 PARVL CPPSA pointer to PSA 889 * \ / 890 000024EB 891 TAKEOFF LABEL 024EB 5D1F8001 6 STAK 892 LEAVE POP and go run this guy 893 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 381 (PFPROC) F 22 Page Fault Processor - SRCHWSX routine 894 000024EC 895 PFNOTWSX LABEL 024EC FBE024EB 7 896 IRJ R7 TAKEOFF the page is not in the WSX list 897 * --- 898 899 END SRCHWSX routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 382 (PFPROC) F 22 Page Fault Processor - FINDRESPAG routine 902 903 ********************************************************************************** 904 * * 905 * This routine will look to see if the block is resident * 906 * at this time. We will lock all lists where the page might * 907 * be in order to prevent another processor from moving a page * 908 * around our search. These locks always take place in the * 909 * same order to prevent deadlock. This order is: * 910 * * 911 * MSQIN * 912 * any SQ * 913 * PPAGE * 914 * PPIDLE * 915 * MSQOUT * 916 * * 917 * If the page is found we will make a PAL for the page * 918 * and allow the user to continue on his way. However if the * 919 * page is not found, or is being force written, then we must * 920 * shut the user down and request the page from the disk * 921 * driver. (This subroutine should really call BLKREADIN). * 922 * Call: * 923 * R5 => VPP * 924 * CALLNP FINDRESPAG * 925 * JMP * 926 * * 927 * * 928 * Eats R0:R4. * 929 * Stack required = 15 * 930 * 1 + max ( LOCKWAIT (0), LOPFPAL (0), MAKEPAL (8), * 931 * MSSHUTDOWN (14), SRCHWSX (9) ) * 932 * * 933 ********************************************************************************** 934 935 BLOCK FINDRESPAG routine 936 ENTRY FINDRESPAG 937 938 BEGFRAME 939 ENDFRAME 940 941 024ED DD5F8001 6 STAK 942 FINDRESPAG ENTRNP PUSH 024EE 60D74803 3 5 BASE 943 LD R3 VPP,VPBLOCK retrieve the block number 024EF 608AF460 2 3 CBM 944 LD R2 R3/PPHASHFLD leave lower bits for hash code 945 946 * R2 = hash code, R3 = block number, VPP, SP 947 948 PLOCK MSQINLOCK call to lock the mass storage input queue 024F0 0CC00000 948 IOFF 024F1 D1C01F16 948 SETT MSQINLOCK 024F2 FE0C24F4 948 JNE MA(2+DISPW MA 0) 024F3 DC40308B 948 CALLNP LOCKWAIT 949 PLOCK PPAGELOCK(R2) call to lock the appropriate PPAGELIST head 024F4 0CC00000 949 IOFF 024F5 D1E41E21 2 949 SETT PPAGELOCK(R2) 024F6 FE0C24F8 949 JNE MA(2+DISPW MA 0) 024F7 DC40308B 949 CALLNP LOCKWAIT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 383 (PFPROC) F 22 Page Fault Processor - FINDRESPAG routine 950 PLOCK PPIDLOCK call to lock the idle list 024F8 0CC00000 950 IOFF 024F9 D1C01DD9 950 SETT PPIDLOCK 024FA FE0C24FC 950 JNE MA(2+DISPW MA 0) 024FB DC40308B 950 CALLNP LOCKWAIT 024FC 61241E61 4 2 951 LD PPL PPAGELIST(R2) make pointer to first element 024FD 3CD70801 3 4 BASE 952 LSRCH R3 PPL,PPBLOCK look for the proper block 024FE FE0C250F 953 JNE PFNISHARD jump if not present in page list 954 PUNLOCK PPIDLOCK call to release the idle list 024FF EC001DD9 954 STZ PPIDLOCK 02500 0C800000 954 ION 955 * \ / 956 957 ********************************************************************************** 958 * * 959 * The desired page was found in the PPAGE list. Check * 960 * the PPL to see if this is a page being forcewritten. If it * 961 * is, we shut the user down to await completion of the force * 962 * write operation. This is done so that we may ensure that a * 963 * write is actually done before continuing a process. We * 964 * also check whether the physical page in memory is bad * 965 * (memory error). If so, we shut down the user until * 966 * recovery is complete. * 967 * * 968 ********************************************************************************** 969 970 * \ / 971 * R2 = hash code, R3 = block number, PPL, VPP, SP 972 * lists locked: MSQIN, PPAGE 973 02501 60090612 0 4 ZBM 974 LD R0 PPL,PPFWIP check the forcewrite flag 02502 7C090812 0 4 ZBM 975 IOR R0 PPL,PPMEMERR check the memory error flag 02503 FA02250A 0 976 JEQZ R0 PFNFW jump if no difficulty 977 PUNLOCK PPAGELOCK(R2) release the appropriate PPAGELIST head 02504 EC241E21 2 977 STZ PPAGELOCK(R2) 02505 0C800000 977 ION 02506 DC402533 978 CALLNP MSSHUTDOWN shut down this user 979 PUNLOCK MSQINLOCK release the mass storage input queue 02507 EC001F16 979 STZ MSQINLOCK 02508 0C800000 979 ION 02509 FE0E252C 980 JMP HAPPYEXIT go run a different user 981 * --- 982 0000250A 983 PFNFW LABEL 984 PUNLOCK MSQINLOCK call to release the mass storage input queue 0250A EC001F16 984 STZ MSQINLOCK 0250B 0C800000 984 ION 0250C DC4024DE 985 CALLNP SRCHWSX see if a PAL already exists 0250D FE0E2527 986 JMP FOUNDWSX jump if found 0250E FE0E2523 987 JMP HAVEPAGE otherwise, go build a PAL 988 * --- 989 990 ********************************************************************************** 991 * * 992 * The page was not in the page list. Check the list of * 993 * idle pages before we give up. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 384 (PFPROC) F 22 Page Fault Processor - FINDRESPAG routine 994 * * 995 ********************************************************************************** 996 997 * R2 = hash value, R3 = block number, VPP, SP 998 * lists locked: PPAGE, PPIDLE, MSQIN 999 0000250F 1000 PFNISHARD LABEL 0250F 608AF650 2 3 CBM 1001 LD R2 R3/IDLHASHFLD make index to proper list 02510 60241DDD 0 2 1002 LD R0 PPUSDIDLE(R2) get head element of idle list 02511 38641DDD 1 2 1003 LEA R1 PPUSDIDLE(R2) the root of the list 02512 48D60801 3 0 BASE 1004 RLSRCH R3 R0,PPBLOCK look for our block 02513 FE0C252D 1005 JNE PFNIDLE jump if not in idle list 1006 1007 * entry found in the idle page list 1008 1009 PUNLOCK MSQINLOCK call to release the mass storage input queue 02514 EC001F16 1009 STZ MSQINLOCK 02515 0C800000 1009 ION 02516 61081F10 4 0 ZBM 1010 LD PPL R0,PPLINK get pointer to what follows 02517 E5085F10 4 1 ZBM 1011 ST PPL R1,PPLINK remove this element from the queue 02518 FB32251A 4 1012 JNZA PPL PFIDJE check for removing end element from list 02519 E4641DFD 1 2 1013 ST R1 PPENDIDLE(R2) yes, we did, fix up the end pointer 1014 * \ / 1015 0000251A 1016 PFIDJE LABEL 0251A 61120000 4 0 REG 1017 LD PPL R0 PPL => found element 0251B D0401DDA 1018 DEC PPIDLCOUNT one less idle page 1019 PUNLOCK PPIDLOCK call to release the idle list 0251C EC001DD9 1019 STZ PPIDLOCK 0251D 0C800000 1019 ION 0251E 608AF460 2 3 CBM 1020 LD R2 R3/PPHASHFLD restore the proper index value 0251F 38641E61 1 2 1021 LEA R1 PPAGELIST(R2) => proper list head 02520 60085F10 0 1 ZBM 1022 LD R0 R1,PPLINK get forward pointer 02521 E4091F10 0 4 ZBM 1023 ST R0 PPL,PPLINK make this element point to list 02522 E5085F10 4 1 ZBM 1024 ST PPL R1,PPLINK set new forward pointer 1025 * \ / 1026 1027 * R3 = block number, PPL, VPP, SP 1028 * lists locked: PPAGE 1029 00002523 1030 HAVEPAGE LABEL 02523 DC002631 1031 CALL MAKEPAL make a PAL for the user 02524 41400461 1032 PARV FNDVPUPC pass indirect VP UPC 02525 4140045E 1033 PARV FNDVPFPN his page number 02526 40400412 1034 PARVL CPPSA his PSA pointer 00002527 1035 FOUNDWSX LABEL 02527 60893461 2 4 ZBM 1036 LD R2 PPL,PPBLOCK/PPHASHFLD recover the hash code 1037 PUNLOCK PPAGELOCK(R2) unlock the PPAGE list 02528 EC241E21 2 1037 STZ PPAGELOCK(R2) 02529 0C800000 1037 ION 0252A 6112C000 4 3 REG 1038 LD PAL R3 move PAL pointer to right register 0252B DC40262D 1039 CALLNP LOPFPAL load it into the page file 1040 * \ / 1041 0000252C 1042 HAPPYEXIT LABEL 0252C 5D1F8001 6 STAK 1043 LEAVE POP and go run this guy 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 385 (PFPROC) F 22 Page Fault Processor - FINDRESPAG routine 1044 * --- 1045 1046 * R3 = block number, VPP, SP 1047 * lists locked: PPAGE, PPIDLE, MSQIN 1048 0000252D 1049 PFNIDLE LABEL 0252D 608AF460 2 3 CBM 1050 LD R2 R3/PPHASHFLD restore the proper index 1051 PUNLOCK PPAGELOCK(R2) call to release the appropriate PPAGELIST head 0252E EC241E21 2 1051 STZ PPAGELOCK(R2) 0252F 0C800000 1051 ION 1052 PUNLOCK PPIDLOCK call to release the idle list 02530 EC001DD9 1052 STZ PPIDLOCK 02531 0C800000 1052 ION 02532 FBE0252C 7 1053 IRJ R7 HAPPYEXIT advance to skip return 1054 * --- 1055 1056 END FINDRESPAG routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 386 (PFPROC) F 22 Page Fault Processor - MSSHUTDOWN routine 1059 1060 ********************************************************************************** 1061 * * 1062 * Routine to shut down a user into the MSWAIT queue. We * 1063 * will also add a little bit to his counter of CPU time used, * 1064 * so that people who do lots of disk requests and use no CPU * 1065 * time won't drive the system wild. (The CPU time used * 1066 * counter is used only for CPU scheduling.) * 1067 * * 1068 * R5 => VPP element * 1069 * FNDVPFPN = original page number * 1070 * CALLNP MSSHUTDOWN * 1071 * * 1072 * Eats R0:R1, R3:R4. * 1073 * Stack required = 14. * 1074 * 2 + max ( SHUTDOWN (12) ) * 1075 * * 1076 ********************************************************************************** 1077 1078 BLOCK MSSHUTDOWN subroutine 1079 ENTRY MSSHUTDOWN 1080 1081 BEGFRAME 00178801 6 BASE 1082 SAVER2 BSS 1 place to save Register 2 1083 ENDFRAME 1084 02533 DD5F8002 6 STAK 1085 MSSHUTDOWN ENTRNP PUSH 02534 E4978801 2 6 BASE 1086 ST R2 SP,SAVER2 into safe hiding 02535 60400412 1 1087 LD R1 CPPSA R1 -> PSA of user 02536 6000254D 0 1088 LD R0 TSMSEQUIV CPU time charged per disk xfer 02537 9808410A 0 1 ZBM 1089 ADDM R0 R1,PSSUMCPU add it in 1090 02538 60C41DAB 3 IMM 1091 LD R3 ADR SQMSWAIT R3 -> scheduler queue 02539 6040045E 1 1092 LD R1 FNDVPFPN R1 = parm2 (page number) 0253A DC002B58 1093 CALL SHUTDOWN shut him down 0253B 40574803 5 BASE 1094 PARVL VPP,VPBLOCK parm1 (disk block number) 0253C 60978801 2 6 BASE 1095 LD R2 SP,SAVER2 back to normal 0253D 5D1F8002 6 STAK 1096 LEAVE POP return to caller 1097 * --- 1098 1099 END MSSHUTDOWN subroutine 1100 1101 1102 END PFPROCESS Page Fault Processor - Main Block 48 INPUT CONSTANTS system constants 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 387 (CONSTANTS) F 23 Resident Operating System Constants 3 4 ********************************************************************************** 5 * * 6 * CONSTANTS DEFINITIONS * 7 * * 8 ********************************************************************************** 9 10 11 ********************************************************************************** 12 * DISKBOOT allocates resident pages for the operating system off * 13 * of a single MCU. This would cause undo burden on this MCU if there * 14 * were others to share the load. The INITIAL code, after creating * 15 * PPLs for all the MCUs, redistributes a few of the more heavily used * 16 * OS pages to the other MCUs. Beginning with the RESIDENT page, the * 17 * number of pages that are redistributed is set by MONSPREAD. * 18 ********************************************************************************** 19 0253E 00000008 20 MONSPREAD VFD 8 number of monitor pages to distribute 21 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 388 (CONSTANTS) F 23 Resident Operating System Constants 23 24 ********************************************************************************** 25 * * 26 * MEMORY SCHEDULING CONSTANTS * 27 * These constants determine the characteristics of the * 28 * memory scheduling system. If the algorithms work anything * 29 * like expected, the system performance will be relatively * 30 * insensitive to variations in these parameters. * 31 * See the scheduler for more discussion of the algorithms. * 32 * * 33 ********************************************************************************** 34 35 ********************************************************************************** 36 * * 37 * MMAGE * 38 * Pages younger than this will not be removed from the * 39 * users working set. They may only be removed by TESTTRUBL * 40 * (usually only when making a user a troublemaker). * 41 * In pragmatic terms, we are ensuring that no program * 42 * is ever forced to run with a working set below the * 43 * threshold where useful work is accomplished. Of course, * 44 * not every program is the same, but this number was picked * 45 * to represent a typical job (P. Dennings graphs were used * 46 * as an aid). * 47 * If this number is decreased, a process will more * 48 * readily lose pages. Thrashing may set in more easily * 49 * because pages will be removed from a working set before * 50 * enough 'evidence' has accumulated to indicate that they * 51 * have truly left the working set. We will be able to * 52 * pack in more processes, but not without a heightened * 53 * possibility of thrashing. * 54 * If this number is increased, a process will hold * 55 * more tightly onto pages. The possibility of thrashing * 56 * will be reduced, but pages will stay in a users working * 57 * set much longer after they are no longer being used, and * 58 * users will more readily be made troublemakers (in order * 59 * to acquire enough free pages). * 60 * * 61 ********************************************************************************** 62 0253F 00000007 63 MMAGE VFD 7 no page younger than this will be 64 * removed from a users working set 65 * by the normal scheduling code 66 67 ********************************************************************************** 68 * * 69 * MMAGEINC/MMAGEINCD * 70 * If the system has more memory than is being actively * 71 * used, we shouldn't need to remove pages from users working * 72 * sets so readily (although we still keep track of just how * 73 * old these pages are). * 74 * This constant is used to determine the additional time * 75 * that a page is allowed to spend in a users working set given * 76 * that there exist unused pages. * 77 * If this number is decreased, the equilibrium will be * 78 * toward more idle pages and a shorter lifetime in a users * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 389 (CONSTANTS) F 23 Resident Operating System Constants 79 * working set. This may cause a users working set to be smaller * 80 * than it needs to be, with a consequent increase in the number * 81 * of pages faults (though not necessarily swaps, because the * 82 * idle pages are recovered from main memory when needed). * 83 * If this number is increased, there will be fewer * 84 * idle pages and pages will remain in a users working set * 85 * longer. This will allow more pages to remain in users * 86 * working sets thereby decreasing the number of page * 87 * faults. However, this causes the pool of idle pages to * 88 * shrink. If it becomes too small, pages that are not * 89 * normally placed into the working set extension list * 90 * (the system uses simplifying assumptions about pages * 91 * unlikely to be used again soon) will pass through the * 92 * idle list too quickly and be needlessly swapped. Also, if * 93 * this number is increased too much, an increase in page * 94 * demand, such as a process activation will deplete the * 95 * pool of idle pages with the effects that 1) the pages can * 96 * not be gotten away from processes holding them fast * 97 * enough to prevent the new process from running out, and * 98 * 2) the processes checked first will be harshly depleted * 99 * to fill the idle list, whereas subsequently scheduled * 100 * processes won't be under the same urgency. * 101 * * 102 ********************************************************************************** 103 02540 0000001E 104 MMAGEINC VFD 30 numerator 02541 00000010 105 MMAGEINCD VFD 16 and denominator 106 * of multiplier for amount added to 107 * MMAGE for each available idle 108 * page or 4 dirty idle pages. 02542 0000015E 109 MMAXWSX VFD 350 maximum working set size 110 111 ********************************************************************************** 112 * * 113 * MMIDLETTMIN * 114 * This parameter controls the troublemaker algorithm * 115 * invocation. If the number of idle pages is above this * 116 * number (plus users priority) trouble maker checking is * 117 * skipped. A higher number makes the system keep a * 118 * higher number of idle pages. * 119 * Note that "idle" pages are not necessarily an unused * 120 * resource. They provide a holding buffer for pages that don't * 121 * otherwise stay in users working sets due to the systems * 122 * simplifying assumptions. * 123 * * 124 ********************************************************************************** 125 02543 00000008 126 MMIDLETTMIN VFD 8 cutoff for test-trouble processing 127 128 ********************************************************************************** 129 * * 130 * MMIDLABSMIN * 131 * This parameter is the minimum number of idle pages * 132 * that the scheduler will allow. If there are fewer idle * 133 * pages than this, any user calling TESTTROUBLE (i.e. adding * 134 * to his working set) will be shutdown as a troublemaker * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 390 (CONSTANTS) F 23 Resident Operating System Constants 135 * (in the SIZEWAIT queue). * 136 * This minimum number of pages serves two purposes.. * 137 * 1) certain system functions require an available idle * 138 * page. Currently, such known system functions are * 139 * power up recovery processing and calls from the * 140 * GETMEM routines. * 141 * 2) a minimum size holding buffer for recently used, but * 142 * not held in WSX lists, pages. * 143 * * 144 ********************************************************************************** 145 02544 00000004 146 MMIDLABSMIN VFD 4 minimum allowed idle list size 147 148 ********************************************************************************** 149 * * 150 * MMIDLSPEED * 151 * This parameter is used to control the aging rate of * 152 * pages in the working sets of suspended users. * 153 * Note that the values from the SDPARM array are used * 154 * to pre-age all pages in the working set of a user being * 155 * suspended. That removes pages as early as possible * 156 * when a user is going to wait for a while. We don't * 157 * take all of the pages because of the possibility that * 158 * the suspension is for a short wait, such as for terminal * 159 * I/O. This parameter (MMIDLSPEED) is used to cause * 160 * additional aging so that any remaining pages will age * 161 * out if the user fails to leave the suspended queue * 162 * in a timely manner. * 163 * If this parameter is made smaller, pages will age * 164 * more slowly. When the user leaves suspension, he will * 165 * get better response and cause fewer swaps because of the * 166 * greater likelihood of finding his pages. However, these * 167 * pages FOR SURE are not being used by this user, so we * 168 * strongly desire to make them available to reduce page * 169 * contention elsewhere. * 170 * If this parameter is made larger, pages will age * 171 * more rapidly and leave the working set of a suspended * 172 * user sooner. As the parameter gets larger, an interactive * 173 * user will lose his working set unless he responds * 174 * correspondingly faster. * 175 * A special note concerning the MSWAIT queue... it * 176 * must be aged for the following reasons: * 177 * 1) To prevent deadlocking with no idle pages for * 178 * the reads, but everyone suspended in MSWAIT * 179 * waiting for a read. (This is extremely unlikely * 180 * in the current system). * 181 * 2) To ensure that a user waiting for a disk that * 182 * is no longer ready will not hold other pages * 183 * forever. * 184 * However, it must not be aged nearly so often as the * 185 * other queues. If it were, a user could have essentially * 186 * all of his pages removed while waiting for one more. * 187 * This is likely only when the read queue gets excessively * 188 * long, but it causes an unpleasant phenomonon known as * 189 * convoying. * 190 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 391 (CONSTANTS) F 23 Resident Operating System Constants 191 * * 192 ********************************************************************************** 193 02545 00000004 194 MMIDLSPEED VFD 4 number of units added to page 195 * ages each tick by WHICHHUNT 196 197 ********************************************************************************** 198 * * 199 * PRRATIO * 200 * This parameter is used to control the magnitude of the * 201 * help given to higher priority users. * 202 * Priorities are not completely implemented!! * 203 * * 204 ********************************************************************************** 205 00000014 ABS 206 PRRATIO EQU 20 priority ratio constant 02546 00000014 207 MMPRRATIO VFD PRRATIO each increment in user priority 208 * is equivalent to this many 'points' 209 210 ********************************************************************************** 211 * * 212 * MMLOCKPARM * 213 * Each time that a process locks a resource such as * 214 * a directory or an ADT, PSLOCKCNTR is incremented. We * 215 * try to avoid setting those guys troublemaker by using * 216 * this multiplier to remove a little badness from the * 217 * troublemaker calculation. * 218 * * 219 ********************************************************************************** 220 02547 FFFFFFFD 221 MMLOCKPARM VFD -60/PRRATIO we allow this many points for 222 * each critical region that this user 223 * has locked (later multiplied by MMPRRATIO) 224 02548 0000000C 225 MMHYSPARM VFD 12 the current running user looks 226 * this much worse than any other 227 * to avoid repeated finger pointing 228 229 ********************************************************************************** 230 * * 231 * CPU Time Scheduling Variables * 232 * The CPU time management involves a single queue of * 233 * runnable processes. This queue is formed in numerical * 234 * order by a "queue insertion value". The basic idea is * 235 * that the more CPU time that a user has been receiving, * 236 * the longer he waits in the runnable queue. This means * 237 * that heavily I/O bound jobs aren't required to go * 238 * through the whole queue for each I/O operation. * 239 * The "queue insertion values" range from 256 to * 240 * 1024. * 241 * * 242 ********************************************************************************** 243 244 ********************************************************************************** 245 * * 246 * TSAGEVAL * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 392 (CONSTANTS) F 23 Resident Operating System Constants 247 * The clock scheduling interrupt (TICK) causes this * 248 * much to be subtracted from the SQPARM word of everybody * 249 * in the runnable queue. This prevents starvation of any * 250 * process by a series of other processes always jumping * 251 * in ahead of it. * 252 * A larger value here causes more of a disturbing * 253 * influence on every tick interrupt, whereas too small * 254 * a value means that a process may have to wait inordinate * 255 * amounts of time to get a single quantum. * 256 * * 257 ********************************************************************************** 258 02549 00000014 259 TSAGEVAL VFD 20 SQPARM ages this much on each TICK interrupt 260 261 ********************************************************************************** 262 * * 263 * TSHISTLOSS * 264 * This factor is used on every TICK interrupt to reduce * 265 * the PSSUMCPU and PSSUMSDT values by a factor so that, 1) * 266 * They may be contained within reasonable sized fields, and * 267 * 2) So that older history fades away. * 268 * This value is in terms of 1/256 so that it can be an * 269 * integer. The theoretical range is from 0 to 255. However, * 270 * values that are too small cause the history to be forgotten * 271 * rather suddenly at the tick interrupt. Therefore, any value * 272 * under about 64 (really 1/4) is probably too small. * 273 * Values that are too large cause the past history to * 274 * remain to plague a new pattern of activity. Additionally, * 275 * for any value greater than or equal to 256 (really 1), the * 276 * numbers in PSSUMCPU and PSSUMSDT can grow without bound. * 277 * For PSSUMSDT, it might be possible for it to grow even larger * 278 * (like when someone comes out of a four-hour terminal wait). * 279 * Therefore, PSSUMSDT is explicitly checked for overflow and * 280 * set to the maximum possible value. * 281 * For values less than 256, the upper bound of PSSUMCPU * 282 * is 256 / (256-n) * TickTime. Since PSSUMCPU occupies * 283 * a 16-bit field, we must have 256 / (256-n) * 2000 < 2^16. * 284 * This implies that n < 250. * 285 * The allowable range of values, then, is * 286 * 64 <= TSHISTLOSS <= 249. * 287 * * 288 ********************************************************************************** 289 0254A 000000C8 290 TSHISTLOSS VFD 200 controls ratio of history to current data 291 * in the PSSUMCPU and PSSUMSDT variables. 292 293 ********************************************************************************** 294 * * 295 * TSPRIORVAL * 296 * This factor controls how much weight the priority * 297 * field has in runnable queue insertion point calculations. * 298 * This number must be upper bounded to control the maximum * 299 * possible queue insertion values. * 300 * * 301 ********************************************************************************** 302 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 393 (CONSTANTS) F 23 Resident Operating System Constants 0254B 00000040 303 TSPRIORVAL VFD 64 value of each priority level 304 * in runnable queue insertion value calculations 305 306 ********************************************************************************** 307 * * 308 * TSBASEVAL * 309 * This minimum queue insertion value is provided to * 310 * aid in starvation prevention. * 311 * * 312 ********************************************************************************** 313 0254C 00000100 314 TSBASEVAL VFD 256 minimum value for queue insert 315 316 ********************************************************************************** 317 * * 318 * TSMSEQUIV * 319 * Each time a process requests a MS transfer, we make * 320 * that equivalent to TSMSEQUIV msec of CPU time in PSSUMCPU. * 321 * This allows us to give heavy MS users a little lower * 322 * priority than we give to heavy users of direct I/O devices. * 323 * * 324 ********************************************************************************** 325 0254D 00000014 326 TSMSEQUIV VFD 20 each MS transfer equiv to this many MSEC 327 328 ********************************************************************************** 329 * * 330 * TSQUANMIN * 331 * The quantum calculation starts from this base. * 332 * * 333 ********************************************************************************** 334 0254E 00000064 335 TSQUANMIN VFD 100 smallest quantum 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 394 (CONSTANTS) F 23 Resident Operating System Constants 337 338 ********************************************************************************** 339 * * 340 * Useful constants reside here * 341 * * 342 ********************************************************************************** 343 0254F 00FFFFFF 344 MSBLKMASK VFD ONEBITS/MSBLKFIELD mask for a disk address 02550 003E8000 345 MAXSRAF VFD CCBMAXPAGE*CPP last char +1 allowable in small RAF 346 * values for the extensions and account names of 347 * the privileged accounts on the system 02551 E79DF200 348 DOTBTI PAK6 !!! ".!!!" our division 02552 EDE07C00 349 DOTAMPER PAK6 &&& proprietary account 02553 6FA664B3 350 HARDSYS PAK12 HARDWARE HARDWARE.SYS account name 02555 B6740200 351 DOTSYS PAK6 SYS ".SYS" owners division 02556 8E26E777 352 RADMANAGER PAK12 MANAGER the project/division/system top dog 02558 46954340 353 ALLVOLUMES PAK12 ALL! wildcard for all volume names 0255B 0036EE80 354 ONEHOUR2 VFD 0,MSECSH milliseconds in an hour 0000255B 355 ONEHOUR EQU ONEHOUR2(1) same for single word 0255C 05265C00 356 ONEDAY VFD MSECSD length of a day, in milliseconds 0255D 00000080 357 MAXRESRCE VFD 128 maximum number of RCEs per file 358 0000255E 359 BITTAB LABEL 0255E 00000001 360 BIT31 VFD 000000001 0255F 00000002 361 BIT30 VFD 000000002 02560 00000004 362 BIT29 VFD 000000004 02561 00000008 363 BIT28 VFD 000000008 02562 00000010 364 BIT27 VFD 000000010 02563 00000020 365 BIT26 VFD 000000020 02564 00000040 366 BIT25 VFD 000000040 02565 00000080 367 BIT24 VFD 000000080 02566 00000100 368 BIT23 VFD 000000100 02567 00000200 369 BIT22 VFD 000000200 02568 00000400 370 BIT21 VFD 000000400 02569 00000800 371 BIT20 VFD 000000800 0256A 00001000 372 BIT19 VFD 000001000 0256B 00002000 373 BIT18 VFD 000002000 0256C 00004000 374 BIT17 VFD 000004000 0256D 00008000 375 BIT16 VFD 000008000 0256E 00010000 376 BIT15 VFD 000010000 0256F 00020000 377 BIT14 VFD 000020000 02570 00040000 378 BIT13 VFD 000040000 02571 00080000 379 BIT12 VFD 000080000 02572 00100000 380 BIT11 VFD 000100000 02573 00200000 381 BIT10 VFD 000200000 02574 00400000 382 BIT09 VFD 000400000 02575 00800000 383 BIT08 VFD 000800000 02576 01000000 384 BIT07 VFD 001000000 02577 02000000 385 BIT06 VFD 002000000 02578 04000000 386 BIT05 VFD 004000000 02579 08000000 387 BIT04 VFD 008000000 0257A 10000000 388 BIT03 VFD 010000000 0257B 20000000 389 BIT02 VFD 020000000 0257C 40000000 390 BIT01 VFD 040000000 0257D 80000000 391 BIT00 VFD 080000000 49 INPUT PFPUTIL utilities for page fault processor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 395 (PFPUTIL) F 24 Page Fault Processor - Utility routines 3 ********************************************************************************** 4 * * 5 * This routine is to be called whenever a swapping page * 6 * is being added to the users control. It checks to ensure * 7 * that the session disk limit and disk limit totals will not * 8 * be exceeded. However, control mode will get his requests. * 9 * Call: * 10 * * 11 * CALLNP ADDSWAP * 12 * * 13 * * 14 * * 15 * Eats R0:R2. * 16 * Stack required = 1 * 17 * * 18 ********************************************************************************** 19 20 BLOCK ADDSWAP subroutine 21 ENTRY ADDSWAP 22 23 BEGFRAME 24 ENDFRAME 25 0257E DD5F8001 6 STAK 26 ADDSWAP ENTRNP PUSH 0257F 60800412 2 27 LD R2 CPPSA current user PSA ptr 02580 60000414 0 28 LD R0 CPCUPC get current UPC pointer 02581 5C080610 0 ZBM 29 CMZ R0,UPCNTLMODE is he running control mode? 02582 FE0C258B 30 JNE DOADD jump if control mode, he gets his swaps 02583 60168812 0 2 BASE 31 LD R0 R2,PSSESUSD get current session used 02584 68168813 0 2 BASE 32 UCPR R0 R2,PSSESLIM compare against limit 02585 FE062592 33 JGE SESSOVER (if its = now, it will be over) 02586 60489F13 1 2 ZBM 34 LD R1 R2,PSUSERLIMP get pointer to ULB 02587 6008518E 0 1 ZBM 35 LD R0 R1,ULDSKUSD get current disk space total 02588 1816480F 0 1 BASE 36 ADD R0 R1,ULSCRDSK add in the scratch total 02589 6808618D 0 1 ZBM 37 UCPR R0 R1,ULDSKLIM compare against limit 0258A FE062594 38 JGE ACCTOVER (if it's = now, it will be over) 39 * \ / 40 0000258B 41 DOADD LABEL 0258B BC168812 0 2 BASE 42 INCL R0 R2,PSSESUSD update session used 0258C 54168814 0 2 BASE 43 MAX R0 R2,PSSESMAX set the high water mark 0258D E4168814 0 2 BASE 44 ST R0 R2,PSSESMAX 0258E 60489F13 1 2 ZBM 45 LD R1 R2,PSUSERLIMP get ULB ptr 0258F D016480F 1 BASE 46 INC R1,ULSCRDSK and update the scratch total 02590 19C40001 7 IMM 47 ADD R7 1 skip error return 48 * \ / 49 00002591 50 XITSWAP LABEL 02591 5D1F8001 6 STAK 51 LEAVE POP 52 * --- 53 00002592 54 SESSOVER LABEL 02592 600400C5 0 IMM 55 LD R0 XREQERESDL exceeded session disk limit 02593 FE0E2591 56 JMP XITSWAP return error 57 * --- 58 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 396 (PFPUTIL) F 24 Page Fault Processor - Utility routines 00002594 59 ACCTOVER LABEL 02594 60040087 0 IMM 60 LD R0 XREQERDSKL exceeded account disk limit 02595 FE0E2591 61 JMP XITSWAP return error 62 * --- 63 64 END ADDSWAP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 397 (PFPUTIL) F 24 Page Fault Processor - Utility routines 66 67 ********************************************************************************** 68 * * 69 * Routine to return space to user when a swapping page * 70 * is freed. Call: * 71 * * 72 * CALLNP DELSWAP * 73 * * 74 * Eats R0. * 75 * Stack required = 1 * 76 * * 77 ********************************************************************************** 78 79 BLOCK DELSWAP subroutine 80 ENTRY DELSWAP 81 82 BEGFRAME 83 ENDFRAME 84 02596 DD5F8001 6 STAK 85 DELSWAP ENTRNP PUSH 02597 60000412 0 86 LD R0 CPPSA 02598 D0560812 0 BASE 87 DEC R0,PSSESUSD count down total session space 02599 FE06259B 88 JGE NOTNEG jump if still positive 0259A D0160812 0 BASE 89 INC R0,PSSESUSD put back to zero or positive 0000259B 90 NOTNEG LABEL 0259B 60081F13 0 0 ZBM 91 LD R0 R0,PSUSERLIMP get pointer to ULB 0259C D056080F 0 BASE 92 DEC R0,ULSCRDSK count down scratch used 0259D FE06259F 93 JGE NOTNEGA jump if still positive 0259E EC16080F 0 BASE 94 STZ R0,ULSCRDSK put back to zero or positive 0000259F 95 NOTNEGA LABEL 0259F 5D1F8001 6 STAK 96 LEAVE POP 97 * --- 98 99 END DELSWAP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 398 (PFPUTIL) F 24 Page File Manipulation Routines 102 103 BLOCK Page File Manipulation Routines 104 ENTRY LOPFPAL to load a single page file element 105 ENTRY MAKEPAL make a PAL for a page 106 ENTRY MAPINFBI map in FBI block for PPL 107 ENTRY MAPINMEM mapin user free storage lists 108 ENTRY MAPOUTFBI map out FBI block for PPL 109 ENTRY MAPOUTMEM mapout user free storage lists 110 ENTRY PFAGEWSX distribute age to WSX list 111 ENTRY PFEMPTY unload page file without aging 112 ENTRY PFLOAD to load the entire page file 113 ENTRY PFUNLOAD to unload entire page file 114 ENTRY PFUPCAGE apply aging values to all UPCs 115 ENTRY REUSEPAL reuse PAL from working set extension 116 ENTRY UNLOPAL to unload a single page file element 117 118 ********************************************************************************** 119 * * 120 * This block contains several routines to manipulate * 121 * PALs and page file entries. These routines are called by * 122 * both the page-fault handler and the scheduler. * 123 * * 124 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 399 (PFPUTIL) F 24 Page File Manipulation Routines 126 127 ********************************************************************************** 128 * * 129 * Unload the Page File * 130 * Routine to unload the page file and window pages. * 131 * Updates all page ages. * 132 * * 133 * * 134 * CALLNP PFUNLOAD * 135 * * 136 * Eats:R0:R1, R3:R4. * 137 * Stack required = 2 * 138 * 1 + max ( PFUPCAGE (1) ) * 139 * * 140 ********************************************************************************** 141 142 BLOCK PFEMPTY & PFUNLOAD subroutine 143 ENTRY PFEMPTY 144 ENTRY PFUNLOAD 145 146 BEGFRAME 147 ENDFRAME 148 025A0 DD5F8001 6 STAK 149 PFUNLOAD ENTRNP PUSH 025A1 60040001 0 IMM 150 LD R0 1 get aging value to apply 025A2 DC4025B6 151 CALLNP PFUPCAGE and apply it to all UPCs 025A3 60000414 0 152 LD R0 CPCUPC get current UPC pointer 025A4 D04800F6 0 ZBM 153 DEC R0,UPXAGEVASP and remove aging value from current VASP 025A5 FE0E25A8 154 JMP PFUNLOSHR now, go unload current PF 155 * --- 156 157 ********************************************************************************** 158 * * 159 * Empty the Page File * 160 * Routine to unload the page file while changing between * 161 * under processes. Updates only the age of referenced pages. * 162 * The UNLOPAL code is duplicated here to save time and temps. * 163 * Call: * 164 * interrupts must be off! * 165 * CALLNP PFEMPTY * 166 * * 167 * Eats R0, R3:R4. * 168 * Stack required = 1 * 169 * * 170 ********************************************************************************** 171 025A6 DD5F8001 6 STAK 172 PFEMPTY ENTRNP PUSH 025A7 60000414 0 173 LD R0 CPCUPC get pointer to current UPC 000025A8 174 PFUNLOSHR LABEL entry for PFUNLOAD 025A8 D00800F4 0 ZBM 175 INC R0,UPCMAGEV increment maximum PAL age in VASP list 025A9 D00800F5 0 ZBM 176 INC R0,UPCMAGEW increment maximum PAL age in WSX list 025AA 6116080F 4 0 BASE 177 LD PAL R0,UPCVASP get pointer to current VASP list 025AB 81C10000 4 178 LUPF PAL scan the VASP list unloading the page file 179 ********************** 180 * Temporarily leave this code in case we have to go back to it. 10/29/84 025AC FE0E25B5 181 JMP PFEMNOPA jump around old code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 400 (PFPUTIL) F 24 Page File Manipulation Routines 182 * --- 183 025AD FB3025B5 4 184 JZA PAL PFEMNOPA jump if VASP list empty 000025AE 185 PFEMNXTP LABEL 025AE 60D70000 3 4 CACH 186 LD PFPTR PAL,PAVPN get page number 025AF 80D2C000 3 REG 187 PFRC PFPTR unload page file 025B0 F2DE25B4 3 188 JBF PFPTR/PFREFBIT PFEMNOREF jump if page not referenced 025B1 F2DC25B3 3 189 JBF PFPTR/PFALTBIT PFEMNOALT jump if page not altered 025B2 EDC91C12 4 ZBM 190 STW PAL,PAMODIFIED set page modified flag 000025B3 191 PFEMNOALT LABEL 025B3 EC0900E2 4 ZBM 192 STZ PAL,PAGEAGE set page age to zero 000025B4 193 PFEMNOREF LABEL 025B4 FB3625AE 4 194 LJNA PAL PFEMNXTP loop through VASP list 195 * \ / 000025B5 196 PFEMNOPA LABEL 197 ********************** 198 025B5 5D1F8001 6 STAK 199 LEAVE POP 200 * --- 201 202 END PFEMPTY & PFUNLOAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 401 (PFPUTIL) F 24 Page File Manipulation Routines 204 205 ********************************************************************************** 206 * * 207 * PFUPCAGE * 208 * This routine takes a given aging value and distributes * 209 * it to all of the UPCs. This is as good as distributing it * 210 * to each PAL, and a whole lot faster. Call: * 211 * * 212 * R0 = aging value * 213 * R5 => PSA * 214 * CALLNP PFUPCAGE * 215 * * 216 * Eats R1, PAL * 217 * Stack required = 1 * 218 * * 219 ********************************************************************************** 220 221 BLOCK Age distributer 222 ENTRY PFUPCAGE age distributer 223 224 BEGFRAME 225 ENDFRAME 226 025B6 DD5F8001 6 STAK 227 PFUPCAGE ENTRNP PUSH 025B7 61095F15 4 5 ZBM 228 LD R4 R5,PSPROCLIST get pointer to list of UPCs 229 * \ / 230 000025B8 231 PFUPCABIGL LABEL 025B8 60530000 1 4 REG 232 LD R1 R4 place UPC pointer in save place 025B9 980840F6 0 1 ZBM 233 ADDM R0 R1,UPXAGEVASP add to this vasp list age 025BA 980840F7 0 1 ZBM 234 ADDM R0 R1,UPXAGEWSX and to WSX list age 025BB 61085F10 4 1 ZBM 235 LD R4 R1,UPCSONPTR any children to take care of? 025BC FB3225B8 4 236 JNZA R4 PFUPCABIGL jump if there are 237 * \ / 238 000025BD 239 PFUPCABRO LABEL 025BD 61085F16 4 1 ZBM 240 LD R4 R1,UPCBROPTR get any brother we might have 025BE FB3225B8 4 241 JNZA R4 PFUPCABIGL do a number on them also 025BF 60485F17 1 1 ZBM 242 LD R1 R1,UPCDADPTR move up to the immediate overprocess 025C0 FA7225BD 1 243 JNZA R1 PFUPCABRO jump if more UPCs to update 244 * \ / 245 025C1 5D1F8001 6 STAK 246 LEAVE POP done here, return 247 * --- 248 249 END of age distributer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 402 (PFPUTIL) F 24 Page File Manipulation Routines 251 252 ********************************************************************************** 253 * * 254 * Load the Page File * 255 * Routine to load the page file. Enter with the PSA * 256 * pointer in register R5. * 257 * * 258 * * 259 * R5 => PSA * 260 * CALLNP PFLOAD * 261 * * 262 * Eats R0:R1, R3:R4. * 263 * Stack required = 3 * 264 * 0 + max ( MAPINMEM (3), PFAGEVASP (0) ) * 265 * * 266 ********************************************************************************** 267 268 BLOCK PFLOAD subroutine 269 ENTRY PFLOAD 270 025C2 DD400451 271 PFLOAD ENTRNP VMTSSLA 025C3 DC0025EB 272 CALL MAPINMEM map in user's free storage lists 025C4 40534000 5 REG 273 PARVL R5 pointer to the PSA 025C5 DC4025CF 274 CALLNP PFAGEVASP apply any saved aging to PALs 025C6 61094116 4 5 ZBM 275 LD R4 R5,PSCURRPROC get pointer to current UPC 025C7 6117080F 4 4 BASE 276 LD PAL R4,UPCVASP get pointer to memory chain 277 025C8 81810000 4 278 LLPF PAL scan the VASP list loading the page file 279 ********************** 280 * Temporarily leave this code in case we have to go back to it. 10/29/84 025C9 FE0E25CE 281 JMP LOPFNOPA jump around old code 282 * --- 283 025CA FB3025CE 4 284 JZA PAL LOPFNOPA jump if no pages 000025CB 285 LOPFLP LABEL 025CB 60D70000 3 4 CACH 286 LD PFPTR PAL,PAVPN set up page file index 025CC 00D70801 4 BASE 287 LDPF PAL,PAPMVALUE load up this PF location 025CD FB3625CB 4 288 LJNA PAL LOPFLP follow the entire chain 000025CE 289 LOPFNOPA LABEL all pages loaded 290 ********************** 291 025CE 5D000451 292 LEAVE VMTSSLA return 293 * --- 294 295 END PFLOAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 403 (PFPUTIL) F 24 Page File Manipulation Routines 297 298 ********************************************************************************** 299 * * 300 * Age VASP list * 301 * This routine takes the page aging value saved in the * 302 * current UPC and applies it to the individual PALs. This must * 303 * be done so that the new ages in the PALs are kept up to date. * 304 * We normally do this when we load the page file, because there * 305 * is more than one unloader routine. Call: * 306 * * 307 * (interrupts should be off!) * 308 * CALLNP PFAGEVASP * 309 * * 310 * Eats R0:R1, R3. * 311 * Stack required = 0 * 312 * * 313 ********************************************************************************** 314 315 BLOCK PFAGEVASP subroutine 316 ENTRY PFAGEVASP 317 025CF DD400452 318 PFAGEVASP ENTRNP VMTSSLB 025D0 60400414 1 319 LD R1 CPCUPC get current UPC pointer 025D1 600840F6 0 1 ZBM 320 LD R0 R1,UPXAGEVASP pick up the saved aging 025D2 FA0225DC 0 321 JEQZ R0 PFLAGE test for trivial update 025D3 60D6480F 3 1 BASE 322 LD R3 R1,UPCVASP get pointer to VASP list 025D4 EC124000 1 REG 323 STZ R1 initial max age value 025D5 FAF025D9 3 324 JZA R3 PFANVP jump if empty VASP 000025D6 325 PFAVLP LABEL 025D6 9808C0E2 0 3 ZBM 326 ADDM R0 R3,PAGEAGE increase the page age 025D7 5448C0E2 1 3 ZBM 327 MAX R1 R3,PAGEAGE looking for the maximum age 025D8 FAF625D6 3 328 LJNA R3 PFAVLP scan the entire list 329 * \ / 000025D9 330 PFANVP LABEL 025D9 60000414 0 331 LD R0 CPCUPC get back the UPC pointer 025DA E44800F4 1 0 ZBM 332 ST R1 R0,UPCMAGEV this is the maximum PAL age 025DB EC0800F6 0 ZBM 333 STZ R0,UPXAGEVASP now clear out the already used value 000025DC 334 PFLAGE LABEL 025DC 5D000452 335 LEAVE VMTSSLB return to caller 336 * --- 337 338 END PFAGEVASP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 404 (PFPUTIL) F 24 Page File Manipulation Routines 340 341 ********************************************************************************** 342 * * 343 * Age Working Set List * 344 * This routine takes the page aging value saved in the * 345 * current UPC and applies it to the individual PALs in the WSX * 346 * list. This is done each time a new entry is added to the * 347 * WSX list, so that the page ages are kept properly up to date. * 348 * Call: * 349 * (interrupts must be off!) * 350 * CALLNP PFAGEWSX * 351 * * 352 * Eats R0:R1. * 353 * Stack required = 0 * 354 * * 355 ********************************************************************************** 356 357 BLOCK PFAGEWSX subroutine 358 ENTRY PFAGEWSX 359 025DD DD400452 360 PFAGEWSX ENTRNP VMTSSLB 025DE 60400414 1 361 LD R1 CPCUPC get current UPC pointer 025DF 600840F7 0 1 ZBM 362 LD R0 R1,UPXAGEWSX pick up the saved aging 025E0 FA0225EA 0 363 JEQZ R0 PFWSXIT test for trivial update 025E1 60D64810 3 1 BASE 364 LD R3 R1,UPCWSX get pointer to PAL in WSX list 025E2 EC124000 1 REG 365 STZ R1 initial maximum age value 025E3 FAF025E7 3 366 JZA R3 PFWSXNOPAL jump if empty WSX 367 * \ / 368 000025E4 369 PFWSXLP LABEL 025E4 9808C0E2 0 3 ZBM 370 ADDM R0 R3,PAGEAGE increase the page age 025E5 5448C0E2 1 3 ZBM 371 MAX R1 R3,PAGEAGE look for the maximum page age 025E6 FAF625E4 3 372 LJNA R3 PFWSXLP scan the entire list 373 * \ / 374 000025E7 375 PFWSXNOPAL LABEL 025E7 60000414 0 376 LD R0 CPCUPC get pointer to current UPC 025E8 E44800F5 1 0 ZBM 377 ST R1 R0,UPCMAGEW max PAL age in WSX list 025E9 EC0800F7 0 ZBM 378 STZ R0,UPXAGEWSX now clear out the already used value 379 * \ / 380 000025EA 381 PFWSXIT LABEL 025EA 5D000452 382 LEAVE VMTSSLB return to caller 383 * --- 384 385 END PFAGEWSX subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 405 (PFPUTIL) F 24 Page File Manipulation Routines 387 388 ********************************************************************************** 389 * * 390 * Routine to map in the memory containing the users free * 391 * storage lists. The page map values are kept in the PSA, so * 392 * the PSA pointer is passed as a parameter. Note if the PSA * 393 * pointer is bogus we zap CMAPPSA to indicate that there was * 394 * no one to map in. Call: * 395 * * 396 * * 397 * CALL MAPINMEM * 398 * PARVL * 399 * * 400 * Eats R0:R1. * 401 * Stack required = 3 * 402 * * 403 ********************************************************************************** 404 405 BLOCK MAPINMEM subroutine 406 ENTRY MAPINMEM 407 408 BEGFRAME 00178801 6 BASE 409 SAVEREGS BSS 2 save area for R2 and R3 410 ENDFRAME 411 025EB DD1F8003 6 STAK 412 MAPINMEM ENTR PUSH 025EC C0520000 0 REG 413 STPVL R0 current user process status area 025ED E4000413 0 414 ST R0 CMAPPSA set this PSA as the one being mapped 025EE FA0225FB 0 415 JEQZ R0 RETURN if null, get out now! 025EF E6978801 236 BASE 416 ST2 R2 SP,SAVEREGS stuff some registers here temporarily 417 418 * loop to LDPF each value from PSMAPVALS 025F0 60440003 1 IMM 419 LD R1 MAXMAPVALS-1 initialize our counter 000025F1 420 MAPINLOOP LABEL 025F1 5C1C081B 01 BASE 421 CMZ R0,PSMAPVALS(R1) anything here to map in? 025F2 FE0225F5 422 JEQ SKIPMAPIN jump if no value to map 025F3 60D650FC 3 1 REG 423 LD PFPTR PNUSERMEM+R1 corresponding user page number 025F4 00DC081B 01 BASE 424 LDPF R0,PSMAPVALS(R1) page is now available to the CPU 000025F5 425 SKIPMAPIN LABEL 025F5 FA6625F1 1 426 JDR R1 MAPINLOOP back for more 427 * \ / 428 429 * save copies elsewhere, too 025F6 3816081B 0 0 BASE 430 LEA R0 R0,PSMAPVALS generate pointer to page map values 025F7 3880041A 2 431 LEA R2 UMAPVALS save these on the CPU page 025F8 60440010 1 IMM 432 LD R1 MAXMAPVALS*CPW convert the length to characters 025F9 FE400000 433 CMOVE save them for crashdump (in diskboot) 025FA 62978801 236 BASE 434 LD2 R2 SP,SAVEREGS restore values of the registers 435 * \ / 436 000025FB 437 RETURN LABEL 025FB 5D1F8003 6 STAK 438 LEAVE POP back to the caller 439 * --- 440 441 END MAPINMEM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 406 (PFPUTIL) F 24 Page File Manipulation Routines 443 444 ********************************************************************************** 445 * * 446 * This routine unloads the page file where the user free * 447 * storage list is mapped. This routine ensures that the page * 448 * file is illegal to reference for bug catching. It's not * 449 * strictly needed, because a MAPINMEM will overlay the values * 450 * in the page map. If this routine is ever trashed be sure * 451 * that the MAPINMEM routine stores illegal to reference in * 452 * page file locations that are unused. * 453 * Call: * 454 * CALLNP MAPOUTMEM * 455 * * 456 * Eats R0:R1, R3. * 457 * Stack required = 1 * 458 * * 459 ********************************************************************************** 460 461 BLOCK MAPOUTMEM subroutine 462 ENTRY MAPOUTMEM 463 464 BEGFRAME 465 ENDFRAME 466 025FC DD5F8001 6 STAK 467 MAPOUTMEM ENTRNP PUSH 025FD 0CC00000 468 IOFF we can not be interrupted! 025FE 60040003 0 IMM 469 LD R0 MAXMAPVALS-1 initialize our counter 025FF 60C400FC 3 IMM 470 LD PFPTR PNUSERMEM start at the bottom and work up 471 * \ / 472 00002600 473 MAPOUTLOOP LABEL 02600 80D24000 1 REG 474 PFRC R1 zap that page file location 02601 18C40001 3 IMM 475 ADD PFPTR 1 move up one page file location 02602 FA262600 0 476 JDR R0 MAPOUTLOOP jump if more to do 477 * \ / 478 02603 EC000413 479 STZ CMAPPSA zap the mapped PSA pointer 02604 0C800000 480 ION restore interrupts 02605 5D1F8001 6 STAK 481 LEAVE POP return 482 * --- 483 484 END MAPOUTMEM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 407 (PFPUTIL) F 24 Page File Manipulation Routines 486 487 ********************************************************************************** 488 * * 489 * MAPINFBI. This routine maps into PPLWINDOW the * 490 * resident page containing the FBI for the specified PPL. It * 491 * turns off and leaves the interrupts off because they must * 492 * be off when using PPLWINDOW. We halt if the PPLWINDOW is * 493 * already (still) mapped when we get here. Each user is * 494 * responsible for calling MAPOUTFBI to unmap the window after * 495 * use. There is a special case concerning dualwrite. Because * 496 * the secondary PPLs FBI is in system storage MAPINFBI and is * 497 * placed right after the FBI, we just hand back the address. * 498 * * 499 * Call: CALL MAPINFBI * 500 * PARVL * 501 * FBI, IOFF> * 502 * * 503 * Eats R0, Sets R1. * 504 * Stack required = 2 * 505 * * 506 ********************************************************************************** 507 508 BLOCK MAPINFBI subroutine 509 ENTRY MAPINFBI 510 511 BEGFRAME 00178801 6 BASE 512 SAVEPFPTR BSS 1 a must-use register 513 ENDFRAME 514 02606 DD1F8002 6 STAK 515 MAPINFBI ENTR PUSH 02607 C0520000 0 REG 516 STPVL R0 get PPL address 02608 E4D78801 3 6 BASE 517 ST PFPTR SP,SAVEPFPTR save this reg 02609 60C400FB 3 IMM 518 LD PFPTR PNPPLWNDO get virtual page number for PPL FBIs 0260A 80924000 1 REG 519 PFRD R1 read the page file contents 0260B 6440261A 1 520 CPR R1 ILLTOREF this must be illegal to reference! 0260C FE02260E 521 JEQ FBINOTMAP jump if nothing currently mapped here 0260D 0093001A 522 STOP STOPS001A check MFBILAST to see where last called 523 * --- 524 0000260E 525 FBINOTMAP LABEL 0260E 0CC00000 526 IOFF interrupts off! 0260F 5C081810 0 ZBM 527 CMZ R0,DUALWPPL is this a dualwrite PPL 02610 FE0C2618 528 JNE FAKEMAPIN if so, fake the mapping process 02611 604804A0 1 0 ZBM 529 LD R1 R0,PPFBIDISP get disp for later 02612 60080C62 0 0 ZBM 530 LD R0 R0,PPFBIBLK get our index into PPLPFMAP 531 * LD PFPTR PNPPLWNDO get virtual page number for PPL FBIs 02613 00E01C80 0 532 LDPF PPLPFMAP(R0) get reloc for our block 02614 3863EC00 1 1 533 LEA R1 PPLWINDOW(R1) get address of FBI 534 * \ / 535 00002615 536 SHAREMFBI LABEL 02615 60D78801 3 6 BASE 537 LD PFPTR SP,SAVEPFPTR restore this reg 02616 E5C00465 7 538 ST R7 MFBILAST save our return address 02617 5D1F8002 6 STAK 539 LEAVE POP return with interrupts off 540 * --- 541 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 408 (PFPUTIL) F 24 Page File Manipulation Routines 00002618 542 FAKEMAPIN LABEL 02618 38560804 1 0 BASE 543 LEA R1 R0,PPFBFBI generate FBI address 02619 FE0E2615 544 JMP SHAREMFBI jump to share code 545 * --- 546 0261A 00060000 547 ILLTOREF VFD PFNOREFVAL PF contents for illegal to reference 548 549 END MAPINFBI subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 409 (PFPUTIL) F 24 Page File Manipulation Routines 551 552 ********************************************************************************** 553 * * 554 * MAPOUTFBI. Unmap the virtual page we use to access * 555 * FBIs from PPLs. Turn interrupts back on. * 556 * * 557 * Call: * 558 * CALLNP MAPOUTFBI * 559 * * 560 * * 561 * Registers Used: None * 562 * Stack Required: 2 * 563 * * 564 ********************************************************************************** 565 566 BLOCK MAPOUTFBI subroutine 567 ENTRY MAPOUTFBI 568 569 BEGFRAME 00178801 6 BASE 570 KEEPPFPTR BSS 1 store for needed register 571 ENDFRAME 572 0261B DD5F8002 6 STAK 573 MAPOUTFBI ENTRNP PUSH 0261C E4D78801 3 6 BASE 574 ST PFPTR SP,KEEPPFPTR save a register 0261D 60C400FB 3 IMM 575 LD PFPTR PNPPLWNDO virtual page number to clear 0261E 80D2C000 3 REG 576 PFRC PFPTR clear it out 0261F E5C00466 7 577 ST R7 MOFBILAST save address where called from 02620 0C800000 578 ION bump counter up one 02621 60D78801 3 6 BASE 579 LD PFPTR SP,KEEPPFPTR restore register 02622 5D1F8002 6 STAK 580 LEAVE POP return, interrupts up one 581 * --- 582 583 END MAPOUTFBI subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 410 (PFPUTIL) F 24 Page File Manipulation Routines 585 586 ********************************************************************************** 587 * * 588 * Unload the Page File for a Given PAL * 589 * This code is entered with register PAL pointing to a * 590 * page access element (PAL). * 591 * The page file location for this element is unloaded. * 592 * The page age is either incremented if the page was not * 593 * referenced, or cleared if the page was referenced. The * 594 * modified bit is set if the page was modified. Both read * 595 * only and modified means that the page is actually excluded * 596 * and that it could not have been modified or successfully * 597 * referenced. * 598 * Illegal access pages should not come here (there * 599 * should not be a PAL). * 600 * * 601 * (interrupts off!) * 602 * PAL => PAL for page to unload * 603 * CALLNP UNLOPAL * 604 * * 605 * Eats PFPTR. * 606 * Stack required = 0 * 607 * * 608 ********************************************************************************** 609 610 BLOCK UNLOPAL subroutine 611 ENTRY UNLOPAL 612 02623 DD400451 613 UNLOPAL ENTRNP VMTSSLA 02624 60D70000 3 4 CACH 614 LD PFPTR PAL,PAVPN set up page file pointer 02625 80D2C000 3 REG 615 PFRC PFPTR read out the location, destroy index 02626 F2DE262B 3 616 JBF PFPTR/PFREFBIT UNLONOREF jump if not even referenced 02627 F2DC2629 3 617 JBF PFPTR/PFALTBIT UNLONOALT page not altered, skip setting bit 02628 EDC91C12 4 ZBM 618 STW PAL,PAMODIFIED indicate dirty page 00002629 619 UNLONOALT LABEL 02629 EC0900E2 4 ZBM 620 STZ PAL,PAGEAGE accessed, set age to zero 0262A 5D000451 621 LEAVE VMTSSLA return 622 * --- 623 0000262B 624 UNLONOREF LABEL 0262B D00900E2 4 ZBM 625 INC PAL,PAGEAGE age page by one unit 0262C 5D000451 626 LEAVE VMTSSLA return 627 * --- 628 629 END UNLOPAL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 411 (PFPUTIL) F 24 Page File Manipulation Routines 631 632 ********************************************************************************** 633 * * 634 * Load the Page File for a Given PAL * 635 * This code is entered with register PAL pointing to a * 636 * page access element. The page file for this element is * 637 * loaded. * 638 * * 639 * (interrupts off!) * 640 * PAL => PAL for page * 641 * CALLNP LOPFPAL * 642 * * 643 * Eats PFPTR. * 644 * Stack required = 0 * 645 * * 646 ********************************************************************************** 647 648 BLOCK LOPFPAL subroutine 649 ENTRY LOPFPAL 650 0262D DD400451 651 LOPFPAL ENTRNP VMTSSLA 0262E 60D70000 3 4 CACH 652 LD PFPTR PAL,PAVPN set up page file index 0262F 00D70801 4 BASE 653 LDPF PAL,PAPMVALUE load up this PF location 02630 5D000451 654 LEAVE VMTSSLA return 655 * --- 656 657 END LOPFPAL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 412 (PFPUTIL) F 24 Page File Manipulation Routines 659 660 ********************************************************************************** 661 * * 662 * Routine to make a PAL and link it into a user's * 663 * working set. This routine will do all necessary error * 664 * checking and logging. There are two different calls: * 665 * * 666 * To create a new PAL: * 667 * R5 => VPP element * 668 * R4 => PPL element * 669 * interrupts off! * 670 * CALL MAKEPAL * 671 * PARV indirect VP UPC * 672 * PARV virtual page number * 673 * PARVL address of PSA * 674 * * 675 * To reuse a PAL from the working-set extension: * 676 * R5 => VPP element * 677 * R4 => PPL element * 678 * R3 => already unlinked PAL element * 679 * interrupts off! * 680 * CALL REUSEPAL * 681 * PARV indirect VP UPC * 682 * PARV virtual page number * 683 * PARVL address of PSA * 684 * * 685 * Eats R0:R2, Sets R3 <= PAL. * 686 * Stack required = 8 * 687 * 3 + max ( FBICHECK (5), PGETMEM (0), UERRSETY (1) ) * 688 * * 689 ********************************************************************************** 690 691 BLOCK MAKEPAL and REUSEPAL subroutines 692 ENTRY MAKEPAL 693 ENTRY REUSEPAL 694 695 BEGFRAME 00178801 6 BASE 696 PSAPTR BSS 1 address of PSA to receive page 00178008 6 CACH 697 PAGENUM BSSB 8 virtual page number for page 00099112 6 ZBM 698 PAGEUPC BSSB ADDRESS indirect VP UPC 699 ENDFRAME 700 02631 DD1F8003 6 STAK 701 MAKEPAL ENTR PUSH 02632 C1499112 6 ZBM 702 STPV SP,PAGEUPC 02633 C1578008 6 CACH 703 STPV SP,PAGENUM 02634 C0578801 6 BASE 704 STPVL SP,PSAPTR 705 02635 60578801 1 6 BASE 706 LD R1 SP,PSAPTR R1 -> PSA 02636 D00840F2 1 ZBM 707 INC R1,PSWSSIZE say working set is getting bigger 02637 D0170802 4 BASE 708 INC PPL,PPBUSYWORD say PPL is being used once more 709 02638 DC002F0A 710 CALL PGETMEM get space for a new PAL 02639 40440002 IMM 711 PARVL PALOG 0263A 60D20000 3 0 REG 712 LD R3 R0 R3 -> new PAL 0263B EC16C800 3 BASE 713 STZ R3,PAWORDA clean it up 0263C EC16C802 3 BASE 714 STZ R3,PAWORDC 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 413 (PFPUTIL) F 24 Page File Manipulation Routines 0263D E516C803 4 3 BASE 715 ST PPL R3,PAPPLPTR set PPL pointer 0263E 60170803 0 4 BASE 716 LD R0 PPL,PPPMVALUE and the page map value 0263F E416C801 0 3 BASE 717 ST R0 R3,PAPMVALUE 02640 60178008 0 6 CACH 718 LD R0 SP,PAGENUM 02641 E416C000 0 3 CACH 719 ST R0 R3,PAVPN set page number for PAL 02642 FE0E2647 720 JMP COMMON 721 * --- 722 02643 DD1F8003 6 STAK 723 REUSEPAL ENTR PUSH 02644 C1499112 6 ZBM 724 STPV SP,PAGEUPC 02645 C156C000 3 CACH 725 STPV R3,PAVPN 02646 C0578801 6 BASE 726 STPVL SP,PSAPTR 727 * \ / 728 00002647 729 COMMON LABEL 02647 60095F11 0 5 ZBM 730 LD R0 VPP,VPFCB pickup FCB of responsible file 02648 E408DF12 0 3 ZBM 731 ST R0 R3,PAFCB set FCB address, if any 02649 5C099112 6 ZBM 732 CMZ SP,PAGEUPC check if indirect VP reference 0264A ED88D010 3 ZBM 733 STLNE R3,PAINDVP store indirect VP flag 0264B 60095A10 0 5 ZBM 734 LD R0 VPP,VPCNTL/VPCNTLLKB 0264C E408D210 0 3 ZBM 735 ST R0 R3,PALOCK set lock bit 0264D 60095C10 0 5 ZBM 736 LD R0 VPP,VPCNTL/VPCNTLROB 0264E E408DA11 0 3 ZBM 737 ST R0 R3,PAPMVALUE/PFROBIT set read/only bit 0264F 60094E30 0 5 ZBM 738 LD R0 VPP,VPCNTL/VPMAIFLD get maintenance bits 02650 E408D430 0 3 ZBM 739 ST R0 R3,PAMAIFLD 02651 60578801 1 6 BASE 740 LD R1 SP,PSAPTR 02652 60884116 2 1 ZBM 741 LD R2 R1,PSCURRPROC get current UPC pointer 02653 6016880F 0 2 BASE 742 LD R0 R2,UPCVASP 02654 E408DF10 0 3 ZBM 743 ST R0 R3,PALINK 02655 E4D6880F 3 2 BASE 744 ST R3 R2,UPCVASP put new element on front of VASP list 745 02656 DC40413F 746 CALLNP FBICHECK check (and possibly convert) FBI 02657 FA82265E 2 747 JEQZ R2 NOERROR jump if guy doesn't get a memory error 748 * \ / 749 02658 E4C99112 3 6 ZBM 750 ST R3 SP,PAGEUPC save PAL 02659 60D6C000 3 3 CACH 751 LD R3 R3,PAVPN get the page number 0265A E1578801 5 6 BASE 752 EXCH R5 SP,PSAPTR get PSA pointer, save R5 0265B DC4035B5 753 CALLNP UERRSETY give error to process 0265C E1578801 5 6 BASE 754 EXCH R5 SP,PSAPTR restore R5, PSAPTR 0265D 60C99112 3 6 ZBM 755 LD R3 SP,PAGEUPC restore PAL pointer 756 0000265E 757 NOERROR LABEL 0265E 5D1F8003 6 STAK 758 LEAVE POP 759 * --- 760 761 END MAKEPAL and REUSEPAL subroutines 762 763 764 END Page File Manipulation Routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 414 (PFPUTIL) F 24 Find Virtual Page Element 767 768 ********************************************************************************** 769 * * 770 * FINDVP. This routine searches the virtual memory list * 771 * of the current UPC of the selected PSA for the specified * 772 * page. If the element found is an indirect page element * 773 * (refers to a different page in a different process) then * 774 * the indicated page is searched for. Pointed to processes * 775 * are looked for in the tree of under processes because we * 776 * may not look at another session. * 777 * The page pointed to may again point off somewhere so * 778 * this routine may search for a while to find the final * 779 * virtual page element that refers to a real page. If a * 780 * pointed to process does not exist or is execute-only, then * 781 * the indirect virtual page element is taken out of the * 782 * original UPC's VM list and we return saying that the VM * 783 * element was not found. * 784 * Also, for now, we can't point to process zero * 785 * (ourself). If this is ever fixed, a loop problem will * 786 * exist. * 787 * This routine is called with the interrupts off and * 788 * without the chance of a page fault. It uses variables on * 789 * the CPUPAGE and they contain the original PSA looked at, * 790 * the PSA that finally contained the VM element, the root of * 791 * the VM list that the VM element was finally found in, and * 792 * other interesting results. Call: * 793 * * 794 * IOFF interrupts off!!! * 795 * LD R0 page number * 796 * LD R1 * 797 * CALLNP FINDVP * 798 * JMP not found (VPP = 0) * 799 * ST VPP => final VP element * 800 * * 801 * Sets the following global variables: * 802 * FNDVPLPSA (last PSA) => PSA where VP element was eventually found * 803 * FNDVPFPN (first page num) page num originally looked for * 804 * FNDVPPN (page num) page number searched for most recently * 805 * FNDVPVMR (virtual mem root) => root of VP list containing found element * 806 * FNDVPUPC (last UPC ) => UPC where VP element was found, 0 if direct * 807 * * 808 * Eats R0:R2, Sets R5 <= VPP. * 809 * Stack required = 4 * 810 * 4 + max ( FCFREEMEM (0), UNLOPAL (0) ) * 811 * * 812 ********************************************************************************** 813 814 BLOCK FINDVP subroutine 815 ENTRY FINDVP find a virtual page element 816 817 BEGFRAME 00178801 6 BASE 818 FINDVPPSA BSS 1 pointer to original PSA 00178802 6 BASE 819 HIDEOUT BSS 2 place to stuff R3 and R4 820 ENDFRAME 821 0265F DD5F8004 6 STAK 822 FINDVP ENTRNP PUSH 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 415 (PFPUTIL) F 24 Find Virtual Page Element 02660 E440045D 1 823 ST R1 FNDVPLPSA set "last" PSA (owner of final VP element) 02661 E4578801 1 6 BASE 824 ST R1 SP,FINDVPPSA set original PSA address 02662 E400045E 0 825 ST R0 FNDVPFPN set original page number 02663 E400045F 0 826 ST R0 FNDVPPN and page number currently looking for 02664 EC000461 827 STZ FNDVPUPC clear UPC pointer 02665 60484116 1 1 ZBM 828 LD R1 R1,PSCURRPROC get pointer to current UPC 829 * \ / 830 831 ********************************************************************************** 832 * * 833 * Search the VP list of the current UPC. * 834 * * 835 ********************************************************************************** 836 837 * \ / 00002666 838 FNDVPSRCH LABEL 02666 3956480E 5 1 BASE 839 LEA VPP R1,UPCWVMLIST generate root of the window list 02667 F6302669 0 840 JBT R0/MONBIT FNDSWL jump if we are to search window list 02668 3956480D 5 1 BASE 841 LEA VPP R1,UPCVMLIST generate root of the list 00002669 842 FNDSWL LABEL 02669 E5400460 5 843 ST VPP FNDVPVMR save same for the caller 0266A 61574800 5 5 BASE 844 LD VPP VPP,0 advance to the first actual element 0266B 3C174004 0 5 CACH 845 LSRCH R0 VPP,VPVPN search for the element 0266C FE0C269E 846 JNE NOTFNDRTN if not there, return the error 0266D 5C095011 5 ZBM 847 CMZ VPP,VPINDRCT is this an indirect element? 0266E FE0226A0 848 JEQ ENTRYFND jump if not -- the end is here 849 * \ / 850 851 ********************************************************************************** 852 * * 853 * The search has resulted in finding an indirect * 854 * element. We check the underprocess serial number in order * 855 * to find the correct underprogram that this element points * 856 * to. Because each underprogram has a unique serial number * 857 * there is no way that indirect VP elements can point to * 858 * underprograms that they were not intended to point to. * 859 * If a user does a URMAPINAS to process 0 (that is, * 860 * pointing one of his pages to another of his pages) it * 861 * doesn't work, because the URMAPINAS request forbids this. * 862 * * 863 ********************************************************************************** 864 865 * \ / 0266F 60094083 0 5 ZBM 866 LD R0 VPP,VPINDPN get the pointed to page number 02670 E400045F 0 867 ST R0 FNDVPPN save as the page number to look for next 02671 6000045D 0 868 LD R0 FNDVPLPSA pointer to the PSA 02672 60081F15 0 0 ZBM 869 LD R0 R0,PSPROCLIST pointer to the whole underprocess list 02673 60895373 2 5 ZBM 870 LD R2 VPP,VPUPCSERL get the UPC serial number 871 * \ / 872 00002674 873 FNDVPLOOP LABEL 02674 60520000 1 0 REG 874 LD R1 R0 move pointer to a safe register 02675 64885371 2 1 ZBM 875 CPR R2 R1,UPCSERNM found the UPC we were looking for 02676 FE0226A1 876 JEQ FNDINDPROC found the next UPC to search 02677 60085F10 0 1 ZBM 877 LD R0 R1,UPCSONPTR check if any processes below us 02678 FA322674 0 878 JNZA R0 FNDVPLOOP see if this one matches 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 416 (PFPUTIL) F 24 Find Virtual Page Element 879 * \ / 880 00002679 881 FNDVPBRO LABEL 02679 60085F16 0 1 ZBM 882 LD R0 R1,UPCBROPTR get our brother if he exists 0267A FA322674 0 883 JNZA R0 FNDVPLOOP see if our brother matches 0267B 60485F17 1 1 ZBM 884 LD R1 R1,UPCDADPTR move up in the process tree 0267C FA722679 1 885 JNZA R1 FNDVPBRO if zero then we are done 886 * \ / 887 888 ********************************************************************************** 889 * * 890 * No such process. We remove the indirect pointer from * 891 * the caller's memory list and return a not found status. * 892 * This will clean up mappings left if for some reason the * 893 * pointed to process goes away ( actually, most often under * 894 * programs that get zapped ). * 895 * * 896 ********************************************************************************** 897 898 * \ / 0267D 6000045E 0 899 LD R0 FNDVPFPN set the original page number searched for 0267E E400045F 0 900 ST R0 FNDVPPN set up as if no searching was done 0267F 60578801 1 6 BASE 901 LD R1 SP,FINDVPPSA get the original PSA searched 02680 E440045D 1 902 ST R1 FNDVPLPSA 02681 EC000461 903 STZ FNDVPUPC clear => UPC for indirect reference 904 * \ / 905 02682 60484116 1 1 ZBM 906 LD R1 R1,PSCURRPROC get pointer to current UPC 02683 3896480E 2 1 BASE 907 LEA R2 R1,UPCWVMLIST => root of the window list 02684 F6302686 0 908 JBT R0/MONBIT FNDRMSWL jump if looking in window list 02685 3896480D 2 1 BASE 909 LEA R2 R1,UPCVMLIST => root of the list 00002686 910 FNDRMSWL LABEL 02686 60568400 1 2 @R 911 LD R1 @R2 => first element of the list 02687 48164004 0 1 CACH 912 RLSRCH R0 R1,VPVPN find the offending element 02688 FE0C26A4 913 JNE LOSTVPP it was there on the last search 914 * R2 => element before, R1 => indirect element 02689 60085F10 0 1 ZBM 915 LD R0 R1,VPLINK unlink the element that... 0268A E4089F10 0 2 ZBM 916 ST R0 R2,VPLINK ...points to nothing 0268B DC002F8F 917 CALL VFREEMEM free the offending element 0268C 41440002 IMM 918 PARV VPLOG indicate its length 0268D 40524000 1 REG 919 PARVL R1 920 * Remove the PAL if the thing is mapped in. 0268E E6D78802 346 BASE 921 ST2 R3 SP,HIDEOUT save these register values 0268F 60978801 2 6 BASE 922 LD R2 SP,FINDVPPSA get pointer to users PSA 02690 60888116 2 2 ZBM 923 LD R2 R2,PSCURRPROC get current UPC pointer 02691 6116880F 4 2 BASE 924 LD PAL R2,UPCVASP make PAL point to users VASP list 02692 6000045F 0 925 LD R0 FNDVPPN get the page number specified 02693 48170000 0 4 CACH 926 RLSRCH R0 PAL,PAVPN see if the page is in the PAL list 02694 FE0C269D 927 JNE NOTMAPPED if not we don't work 928 * R0 <= page number, R2 <= UPC, PAL <= PA element, R5 <= previous PA element 02695 DC402623 929 CALLNP UNLOPAL unmap the page from page file 02696 60091F10 0 4 ZBM 930 LD R0 PAL,PALINK get forward link to rest of list 02697 E4095F10 0 5 ZBM 931 ST R0 R5,PALINK remove element from the PA list 02698 EC091F10 4 ZBM 932 STZ PAL,PALINK clear the forward pointer in our element 933 * Now place the PAL into the working set extension list 02699 38168810 0 2 BASE 934 LEA R0 R2,UPCWSX get ptr to WSX 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 417 (PFPUTIL) F 24 Find Virtual Page Element 0269A 60440000 1 IMM 935 LD R1 0 get a null forward pointer 0269B 3C481F10 1 0 ZBM 936 LSRCH R1 R0,PALINK look for the end of the list 0269C E5081F10 4 0 ZBM 937 ST PAL R0,PALINK hook new element onto the list 938 * \ / 939 0000269D 940 NOTMAPPED LABEL 0269D 62D78802 346 BASE 941 LD2 R3 SP,HIDEOUT restore registers 942 * \ / 943 944 ********************************************************************************** 945 * * 946 * The VP element could not be found for one reason or * 947 * another. Store zero in the VPP register pointer and do not * 948 * advance the return address. * 949 * * 950 ********************************************************************************** 951 952 * \ / 0000269E 953 NOTFNDRTN LABEL 0269E 61440000 5 IMM 954 LD VPP 0 no VPP found 0000269F 955 FNDEXIT LABEL 0269F 5D1F8004 6 STAK 956 LEAVE POP return 957 * --- 958 959 ********************************************************************************** 960 * * 961 * Good entry has been found, VPP points to it. Make good return. * 962 * * 963 ********************************************************************************** 964 000026A0 965 ENTRYFND LABEL 026A0 FBE0269F 7 966 IRJ R7 FNDEXIT advance the return address 967 * --- 968 969 ********************************************************************************** 970 * * 971 * After encountering an indirect VP element we attempted * 972 * and succeeded in finding the next UPC to search for another * 973 * VP element. First we initialize some local CPU variables * 974 * and then back to the search. * 975 * * 976 ********************************************************************************** 977 000026A1 978 FNDINDPROC LABEL 026A1 E4400461 1 979 ST R1 FNDVPUPC store the UPC pointer 026A2 6000045F 0 980 LD R0 FNDVPPN get the page number to look for 026A3 FE0E2666 981 JMP FNDVPSRCH see if we can find this VP element 982 * --- 983 984 ********************************************************************************** 985 * * 986 * This error occurs when the page that we originally * 987 * looked for has disappeared. Possible causes are temp * 988 * sharing (if this routine is getting interrupted out of and * 989 * the FNDVPxxx locations are getting used by someone else * 990 * [power fail???]), or there is a way for another processor * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 418 (PFPUTIL) F 24 Find Virtual Page Element 991 * to mangle the VM list of a process that is running. Good * 992 * luck finding the problem. * 993 * * 994 ********************************************************************************** 995 000026A4 996 LOSTVPP LABEL 026A4 00130010 997 HALT HALTS0010 VM list changed out from under us 998 * --- 999 1000 END FINDVP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 419 (PFPUTIL) F 24 Find out whether MS block is resident 1003 1004 ********************************************************************************** 1005 * * 1006 * BLKREADIN. Function to say whether copy of specified * 1007 * MS block already exists in physical memory. Leaves * 1008 * MSQINLOCK locked if the block was not spotted in either the * 1009 * list of active pages or in the list of unused, dirty, * 1010 * pages. * 1011 * * 1012 * Call: * 1013 * LD R4 * 1014 * CALLNP BLKREADIN * 1015 * JMP * 1016 * * 1017 * * 1018 * Eats R0:R1 * 1019 * Stack required = 1 * 1020 * 0 + max ( LOCKWAIT (0) ) * 1021 * * 1022 ********************************************************************************** 1023 1024 BLOCK BLKREADIN subroutine 1025 ENTRY BLKREADIN 1026 1027 BEGFRAME 1028 ENDFRAME 1029 026A5 DD5F8001 6 STAK 1030 BLKREADIN ENTRNP PUSH 026A6 604B3460 1 4 CBM 1031 LD R1 R4/PPHASHFLD get index part 1032 PLOCK MSQINLOCK 026A7 0CC00000 1032 IOFF 026A8 D1C01F16 1032 SETT MSQINLOCK 026A9 FE0C26AB 1032 JNE MA(2+DISPW MA 0) 026AA DC40308B 1032 CALLNP LOCKWAIT 1033 PLOCK PPAGELOCK(R1) 026AB 0CC00000 1033 IOFF 026AC D1E21E21 1 1033 SETT PPAGELOCK(R1) 026AD FE0C26AF 1033 JNE MA(2+DISPW MA 0) 026AE DC40308B 1033 CALLNP LOCKWAIT 1034 PLOCK PPIDLOCK 026AF 0CC00000 1034 IOFF 026B0 D1C01DD9 1034 SETT PPIDLOCK 026B1 FE0C26B3 1034 JNE MA(2+DISPW MA 0) 026B2 DC40308B 1034 CALLNP LOCKWAIT 026B3 60221E61 0 1 1035 LD R0 PPAGELIST(R1) 026B4 3D160801 4 0 BASE 1036 LSRCH R4 R0,PPBLOCK scan down in-use pages 026B5 FE0C26BD 1037 JNE NOTDONEYET keep looking 1038 * \ / 1039 1040 * found the page, clean up and leave 1041 * R1 has hash field 000026B6 1042 FOUNDRES LABEL 1043 PUNLOCK PPIDLOCK 026B6 EC001DD9 1043 STZ PPIDLOCK 026B7 0C800000 1043 ION 1044 PUNLOCK PPAGELOCK(R1) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 420 (PFPUTIL) F 24 Find out whether MS block is resident 026B8 EC221E21 1 1044 STZ PPAGELOCK(R1) 026B9 0C800000 1044 ION 1045 PUNLOCK MSQINLOCK 026BA EC001F16 1045 STZ MSQINLOCK 026BB 0C800000 1045 ION 000026BC 1046 NOWHERE LABEL 026BC 5D1F8001 6 STAK 1047 LEAVE POP return to caller 1048 * --- 1049 1050 * not found in use, try idle list 000026BD 1051 NOTDONEYET LABEL 026BD 600B3650 0 4 CBM 1052 LD R0 R4/IDLHASHFLD make index to proper list 026BE 60201DDD 0 0 1053 LD R0 PPUSDIDLE(R0) try unused, but read, pages 026BF 3D160801 4 0 BASE 1054 LSRCH R4 R0,PPBLOCK scan them 026C0 FE0226B6 1055 JEQ FOUNDRES jump if success 1056 PUNLOCK PPIDLOCK 026C1 EC001DD9 1056 STZ PPIDLOCK 026C2 0C800000 1056 ION 1057 PUNLOCK PPAGELOCK(R1) 026C3 EC221E21 1 1057 STZ PPAGELOCK(R1) 026C4 0C800000 1057 ION 026C5 FBE026BC 7 1058 IRJ R7 NOWHERE do skip, leave MSQINLOCK locked, IOFF 1059 * --- 1060 1061 END BLKREADIN subroutine 50 INPUT PARITYERROR parity error interrupt handler 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 421 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 3 4 BLOCK Memory Error Interrupt Routine 5 6 ENTRY PARITYERR 7 8 ********************************************************************************** 9 * * 10 * This routine is the memory parity error interrupt handler. * 11 * On entry the hardware has set up the registers as follows: * 12 * R2 = reason * 13 * 0 = no response, instruction fetch * 14 * 1 = abnormal data, instruction fetch * 15 * 2 = no response, operand fetch * 16 * 3 = abnormal data, operand fetch * 17 * 4 = no response, interrupt poll * 18 * 5 = abnormal data, interrupt poll * 19 * R3 = 18-bit virtual address (if R2 is 0, 1, 2, or 3) * 20 * offending slot number (if R2 is 4 or 5) * 21 * R4 = console area of offending routine * 22 * * 23 * The following actions are possible: * 24 * * 25 * If the error is a memory failure in read-only resident operating * 26 * system code, the bad word is re-constructed using checksums generated * 27 * at boot time. The system continues operation normally. * 28 * * 29 * If the error is a memory failure in pageable memory, then the * 30 * page is marked as unusable and then removed from the working sets * 31 * of all processes using that page. If the page is clean, the system * 32 * will continue normally. If the page is dirty, then the system will * 33 * continue, but any process that attempts to reference that page will * 34 * receive a virtual memory failure interrupt. Note that we cannot remove * 35 * any PAL's that are locked. If the process that suffered the parity * 36 * error has the page locked, we will give him a virtual memory failure * 37 * error. If any other user has the page locked, we will not disturb the * 38 * PAL, and hope that he finishes using the page without tripping over * 39 * the bad word (if he does trip over it, he will get an error, too). * 40 * * 41 * If the error is a memory failure elsewhere (such as in read/write * 42 * operating system tables), the system will halt. * 43 * * 44 * If the error is an abnormal data response from a device other * 45 * than memory, the system will halt. In the future, we may want to * 46 * add code to the device drivers to recover from this situation. * 47 * This halt is coded with the slot and channel number in the right * 48 * two digits displayed. The channel number will be meaningless if * 49 * the device is not a PPU. * 50 * * 51 * If the error is a "no response" error, then we will do a WRU * 52 * to determine whether the device is still alive. If it is dead, the * 53 * system will halt. If it is still alive, the error will be deemed * 54 * to be a fluke, and the system will attempt to continue. However, * 55 * if we get a second such flakey error within one second of the first, * 56 * the system will halt. This halt is coded with the slot and channel * 57 * number in the right two digits displayed. The channel number will * 58 * be meaningless if the device is not a PPU. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 422 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 59 * * 60 * The following halts are possible: * 61 * * 62 * M00C0 - another parity error occurred while processing a parity error * 63 * H00C1 - meaningless code in R2 on parity error interrupt * 64 * H0Dsc - a bus device has died (will not answer "who are you") * 65 * H00C3 - a bus device is very flakey (two errors within one second) * 66 * H0Csc - abnormal data from a device other than memory * 67 * M00C5 - parity error in operating system tables * 68 * M00C6 - uncorrectable parity error in resident system. * 69 * M00C7 - parity error in resident system before checksums were generated * 70 * S00Cx - various system errors that should never happen * 71 * * 72 * Stack required = 20 * 73 * 6 + max ( ERRORLOG (3), FREEZE (14), LOCKWAIT (0), * 74 * MAPINMEM (3), MAPOUTMEM (1), REMOVEALL (8), * 75 * UERRSET (1), UNFREEZE (1), * 76 * * 77 ********************************************************************************** 78 79 BLOCK PARITYERR routine 80 ENTRY PARITYERR 81 82 * Highest stack frame in interrupt handler 83 84 BEGFRAME2 00178800 6 BASE 85 MERRWORDA BSS 1 first word of error log info 00098040 6 ZBM 86 MERRCODE EQU MERRWORDA/BITS 0:3 reason code (from R2) 00000000 ABS 87 MERRNRIF EQU 0 no response, instruction fetch 00000001 ABS 88 MERRABIF EQU 1 abnormal data, instruction fetch 00000002 ABS 89 MERRNROF EQU 2 no response, operand fetch 00000003 ABS 90 MERRABOF EQU 3 abnormal data, operand fetch 00000004 ABS 91 MERRNRIP EQU 4 no response, interrupt poll 00000005 ABS 92 MERRABIP EQU 5 abnormal data, interrupt poll 00000005 ABS 93 MERRCODEMAX EQU 5 max value for this field 00098610 6 ZBM 94 MERRABDATA EQU MERRCODE/BIT 31 1 => abnormal data, 0 => no response 00098840 6 ZBM 95 MERRACTION EQU MERRWORDA/BITS 4:7 action taken for error: 00000000 ABS 96 MERRFLUKE EQU 0 fluke: interrupt ignored 00000001 ABS 97 MERRFIX EQU 1 data reconstructed from cksum 00000002 ABS 98 MERRPAGE EQU 2 page marked bad 00099180 6 ZBM 99 MERRVADR EQU MERRWORDA/BITS 8:31 18-bit virtual address 00178801 6 BASE 100 MERRPFILE BSS 1 page file for error location 00178802 6 BASE 101 MERRBLOCK BSS 1 block number for this page 00178803 6 BASE 102 MERRPPL BSS 1 PPL pointer for bad page 00178804 6 BASE 103 MERRCAR BSS 1 console area register of interrupted rtn 00178805 6 BASE 104 TEMP BSS 1 105 ENDFRAME 106 107 * R2=reason (see box), R3=where (see box), R4= old console area 108 000026C6 109 PARITYERR LABEL 110 SETSP set stack pointer 026C6 81538000 6 REG 110 STCAR SP 026C7 6197880D 6 6 BASE 110 LD SP SP,CASTACKPTR 026C8 61979020 6 6 REG 110 LD SP SP+(2 POWER STAKLOG) 026C9 EC1F8006 6 STAK 111 STZ PUSH allocate stack frame 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 423 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 026CA D1C00462 112 SETT MEMERRFLAG say we are processing error 026CB FE0C26CD 113 JNE FLAGOK jump if not already set 026CC 000D00C0 114 HALT HALTM00C0 memory error in memory error routine 115 * --- 116 000026CD 117 FLAGOK LABEL 026CD 68840005 2 IMM 118 UCPR R2 MERRCODEMAX see if code is reasonable 026CE FE0A26D0 119 JLE CODEOK jump if so 026CF 000800C1 120 HALT HALTH00C1 meaningless interrupt code on mem error 121 * --- 122 000026D0 123 CODEOK LABEL 026D0 E4898040 2 6 ZBM 124 ST R2 SP,MERRCODE save the error code 026D1 E4C99180 3 6 ZBM 125 ST R3 SP,MERRVADR save virtual address 026D2 EC178802 6 BASE 126 STZ SP,MERRBLOCK say no block number known 026D3 E5178804 4 6 BASE 127 ST R4 SP,MERRCAR save old CAR 026D4 64840004 2 IMM 128 CPR R2 MERRNRIP is this error on interrupt poll? 026D5 FE06274E 129 JGE INTPOLL jump if interrupt poll problem 026D6 60CADC80 3 3 CBM 130 LD PFPTR R3/PAGEFIELD get 8-bit virtual page number 026D7 80978801 6 BASE 131 PFRD SP,MERRPFILE get the page file value 026D8 60498841 1 6 ZBM 132 LD R1 SP,MERRPFILE/PFSLOT get slot number of device 133 * \ / 134 135 ********************************************************************************** 136 * * 137 * MCUs will respond with bad data in the second word of * 138 * a double word transfer after receiving a WRU(0). This problem * 139 * turns up in systems that have CPU4s and MCUs. The work around * 140 * is to instead of doing a WRU(0) to do a read to location 0, then * 141 * pick up the slot type from SLOTTABLE. This can be done by * 142 * replacing the LDFB BUSCWRU with LDFB BUSCREAD, then picking * 143 * the slottype out of the SLOTTABLE. The original instructions * 144 * are preceded by 2 stars (**). The replaced instructions have * 145 * 2 stars in their comment field. * 146 * * 147 ********************************************************************************** 148 149 * \ / 150 ** LDFB BUSCWRU get WRU response 026D9 0C024000 IMM 151 LDFB BUSCREAD ** perform a data read 026DA FE1226E8 152 JCS SLOTDEAD jump if no response to WRU 026DB FE1626E8 153 JOS SLOTDEAD jump if abnormal response to WRU 154 * \ / normal response in R0 155 156 ********************************************************************************** 157 * * 158 * Now, we know that the bus device is alive. * 159 * R0 = normal response * 160 *** R0 = WRU response. * 161 * * 162 ********************************************************************************** 163 164 * \ / 026DC 5C098610 6 ZBM 165 CMZ SP,MERRABDATA is this problem abnormal data? 026DD FE02274F 166 JEQ FLUKE jump if problem was no response 167 ** LD R0 R0/WRU0TYPE get slot device type 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 424 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 026DE 60221ECE 0 1 168 LD R0 SLOTTABLE(R1) ** pick up the slot info 026DF 600A0030 0 0 CBM 169 LD R0 R0/BITS 0:2 ** extract the type 026E0 64040001 0 IMM 170 CPR R0 SLTTMEM is it a memory? 026E1 FE0226EE 171 JEQ MEMSLOT jump if it is 172 * \ / 173 174 ********************************************************************************** 175 * * 176 * We arrive at this halt when we have an abnormal data * 177 * interrupt and the VRA device denies being an MCU when we * 178 * poll it. This means one of several things: * 179 * 1) An I/O driver has attempted to talk to a * 180 * controller that will not respond. * 181 * 2) The offending process did a load to a * 182 * PPU or SSU that is outside of the range * 183 * where such an operation is legal. * 184 * 3) We got an abnormal data from an SSU or PPU * 185 * in error (hardware problem). * 186 * 4) A memory failed to properly answer the WRU * 187 * that we just tried. * 188 * * 189 * When we arrive here: * 190 * R0 = type code extracted from the WRU response. * 191 * R1 = the slot number that we blame. * 192 * ... the reason, where, and CA are on the stack at * 193 * SP,MERRCODE, SP,MERRVADR, and SP,MERRCAR, respectively. * 194 * R4 => CA for offending process. * 195 * * 196 ********************************************************************************** 197 198 * \ / 026E2 614A7880 5 1 CBM 199 LD R5 R1/BITS 28:3 get slot number into next up hex digit 026E3 1949B021 5 6 ZBM 200 ADD R5 SP,MERRPFILE/PPUCHAN pick up the channel number 026E4 194026E7 5 201 ADD R5 CHALTPROTO turn info into a halt command 026E5 5D534000 5 REG 202 XCT R5 stop and display error 203 * HALT HALTS0Csc abnormal data from non-memory device 026E6 FE0E274F 204 JMP FLUKE where to go to retry operation 205 * --- 206 026E7 00080C00 207 CHALTPROTO HALT HALTH0CSC abnormal data from non-memory device 208 * SC is offending slot/channel if PPU 209 * note that the PC at halt time is 210 * actually at the XCT instruction. 211 212 ********************************************************************************** 213 * * 214 * Dead Slot * 215 * We come here when our LDFB failed to get any response. * 216 * This is serious stuff. * 217 * R1 = slot number (slot number also in HALT code) * 218 * ... the reason, where, and CA are on the stack at * 219 * SP,MERRCODE, SP,MERRVADR, and SP,MERRCAR, respectively. * 220 * R4 => CA for offending process * 221 * * 222 ********************************************************************************** 223 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 425 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 000026E8 224 SLOTDEAD LABEL bus device has died 026E8 614A7880 5 1 CBM 225 LD R5 R1/BITS 28:3 get slot number into next up hex digit 026E9 1949B021 5 6 ZBM 226 ADD R5 SP,MERRPFILE/PPUCHAN pick up the channel number 026EA 194026ED 5 227 ADD R5 DHALTPROTO turn info into a halt command 026EB 5D534000 5 REG 228 XCT R5 stop and display error 229 * HALT HALTH0DSC no response from bus device 026EC FE0E274F 230 JMP FLUKE where to go to retry 231 * --- 232 026ED 00080D00 233 DHALTPROTO HALT HALTH0DSC no response from bus device 234 * SC is offending slot/channel if PPU 235 * note that the PC at halt time is 236 * actually at the XCT instruction. 237 238 ********************************************************************************** 239 * * 240 * Now, we have an abnormal data response from a memory. * 241 * (This means a parity error.) We will fetch the word and see * 242 * if this is for real. * 243 * * 244 ********************************************************************************** 245 000026EE 246 MEMSLOT LABEL 026EE 60824000 2 IMM 247 LD R2 BUSCREAD build read command in R2 026EF 6009A8C1 0 6 ZBM 248 LD R0 SP,MERRPFILE/PFPAGENUM 026F0 E40A94C0 0 2 CBM 249 ST R0 R2/FLDABSPG save page number 026F1 6009ACA0 0 6 ZBM 250 LD R0 SP,MERRVADR/DISPFIELD 026F2 E40AACA0 0 2 CBM 251 ST R0 R2/DISPFIELD save offset in page 026F3 0C128000 2 REG 252 LDFB R2 issue a read command 026F4 FE1226E8 253 JCS SLOTDEAD jump if no response 026F5 FE14274F 254 JOC FLUKE jump if good data 255 * \ / abnormal response (parity error is repeatable) 256 257 ********************************************************************************** 258 * * 259 * Now, we know that the error is for real. Decide what * 260 * to do about it. * 261 * * 262 ********************************************************************************** 263 264 * \ / 026F6 64C40080 3 IMM 265 CPR PFPTR MONPF 026F7 FE082721 266 JLT BADPAGE jump if a user page 026F8 64C40082 3 IMM 267 CPR PFPTR PNWNDO1 026F9 FE082700 268 JLT NOHOPE jump if below window 1 026FA 64C40085 3 IMM 269 CPR PFPTR PNWNDO4 026FB FE082721 270 JLT BADPAGE jump if a window 026FC 64C40089 3 IMM 271 CPR PFPTR MONPF+(RESIDENT/FLDPAGE) 026FD FE082700 272 JLT NOHOPE jump if below resident 026FE 64C400AB 3 IMM 273 CPR PFPTR MONPF+(ENDOFRES/FLDPAGE) 026FF FE0A2701 274 JLE FIXRES jump if read/only resident 275 * \ / 276 277 ********************************************************************************** 278 * * 279 * In the original system design, provision was made for * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 426 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 280 * parts of the operating system to be virtual. This feature * 281 * was never implemented due to certain difficulties with * 282 * subroutine calls, locks, and the like. At the present time, * 283 * all system (except for the abandoned start-up code) is * 284 * considered to be resident, and all addresses beyond ENDOFRES * 285 * are now table space. * 286 * Here are the two instructions that were provided to * 287 * properly classify the virtual parts of the system. * 288 * * 289 * CPR PFPTR MONPF+(ENDOFSYS/FLDPAGE) * 290 * JLE BADPAGE jump if virtual system * 291 * * 292 ********************************************************************************** 293 294 * \ / 02700 000D00C5 295 NOHOPE HALT HALTM00C5 parity error in OS tables 296 * --- 297 298 ********************************************************************************** 299 * * 300 * Here, we have an error in the resident nucleus. We will * 301 * correct it using checksums that were generated at boot time. * 302 * The only tricky thing is that we will map the page into address * 303 * zero, since the mapping at its usual address is read/only. * 304 * * 305 ********************************************************************************** 306 00002701 307 FIXRES LABEL 02701 5C001C6B 308 CMZ BOOTFLAG check for still in bootstrap 02702 FE022704 309 JEQ FIXRES1 jump if checksums exist 00002703 310 NOFIXRES LABEL 02703 000D00C7 311 HALT HALTM00C7 error while boot in progress 312 * --- 313 00002704 314 FIXRES1 LABEL 02704 60001CF6 0 315 LD R0 FLAGS get the dispatcher flags word 02705 F63C2703 0 316 JBT R0/BIT FLCHKSUM NOFIXRES jump if checksum words are bad 317 PLOCK MEMCHKLOCK exclude other CPU's 02706 0CC00000 317 IOFF 02707 D1C01CC9 317 SETT MEMCHKLOCK 02708 FE0C270A 317 JNE MA(2+DISPW MA 0) 02709 DC40308B 317 CALLNP LOCKWAIT 0270A 60C40080 3 IMM 318 LD PFPTR MONPF 0270B 80D78805 6 BASE 319 PFRC SP,TEMP save old page file value 0270C 60178801 0 6 BASE 320 LD R0 SP,MERRPFILE get page map value of page in error 0270D 28020008 0 IMM 321 BSUB R0 1*PFROBIT remove the read-only bit 0270E 00D20000 0 REG 322 LDPF R0 map the page into address zero 0270F 6089ACA0 2 6 ZBM 323 LD R2 SP,MERRVADR/DISPFIELD R2 = failing address location 02710 D1568800 2 BASE 324 STMW R2,0 set all bits of bad word to one 02711 D0168800 2 BASE 325 INC R2,0 verify, then set all bits to zero 02712 5C168800 2 BASE 326 CMZ R2,0 see if it worked 02713 FE022715 327 JEQ FIXRES2 jump if all is ok 02714 000D00C6 328 HALT HALTM00C6 uncorrectable error in resident system 329 * --- 330 00002715 331 FIXRES2 LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 427 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 02715 60499E70 1 6 ZBM 332 LD R1 SP,MERRVADR/FLDPAGE page number, without high bit 02716 60621CC1 1 1 333 LD R1 MEMCKSUM(R1-RESIDENT/FLDPAGE) checksum value 02717 600403FF 0 IMM 334 LD R0 WPP-1 loop index 00002718 335 CKSUMLOOP LABEL 02718 74560800 1 0 BASE 336 XOR R1 R0,0 calculate XOR of all words 02719 FA262718 0 337 JDR R0 CKSUMLOOP do all words in page 0271A E4568800 1 2 BASE 338 ST R1 R2,0 save correct value in word 0271B 00D78805 6 BASE 339 LDPF SP,TEMP restore page file location 340 PUNLOCK MEMCHKLOCK allow other CPU's 0271C EC001CC9 340 STZ MEMCHKLOCK 0271D 0C800000 340 ION 0271E 60040001 0 IMM 341 LD R0 MERRFIX 0271F E4098840 0 6 ZBM 342 ST R0 SP,MERRACTION say we fixed it 02720 FE0E2751 343 JMP FLUKE1 but treat like fluke 344 * --- 345 346 ********************************************************************************** 347 * * 348 * Here, we have a parity error on a pageable page. We will * 349 * remove that page from everybody's working set. But first, scan * 350 * the current process's VASP list to find the block number, then * 351 * find the PPL and mark the page as bad. When we call DISCARDPAL * 352 * for the last PAL, the DONEPPL routine will notice that the page * 353 * is bad and quarantine it. * 354 * * 355 ********************************************************************************** 356 00002721 357 BADPAGE LABEL 02721 EC178804 6 BASE 358 STZ SP,MERRCAR make sure we will exit to dispatcher 02722 60000414 0 359 LD R0 CPCUPC R0 -> current UPC 02723 6116080F 4 0 BASE 360 LD PAL R0,UPCVASP PAL -> working set list 02724 3CD70000 3 4 CACH 361 LSRCH PFPTR PAL,PAVPN find our PAL 02725 FE022727 362 JEQ BADPAGE1 jump if found 02726 001300C8 363 HALT HALTS00C8 PAL not found (R3 = virtual page number) 364 * --- 365 00002727 366 BADPAGE1 LABEL 02727 5C091210 4 ZBM 367 CMZ PAL,PALOCK is the PAL locked? 02728 FE02272B 368 JEQ NOTLOCKED jump if not 02729 60840870 2 IMM 369 LD R2 UINTVMFPE+VERYBAD else get error code 370 * R3 = page number 0272A DC403589 371 CALLNP UERRSET and give the user an error 0000272B 372 NOTLOCKED LABEL 0272B 61170803 4 4 BASE 373 LD PPL PAL,PAPPLPTR pick up PPL pointer 0272C E5178803 4 6 BASE 374 ST PPL SP,MERRPPL and save for later use 0272D 60570801 1 4 BASE 375 LD R1 PPL,PPBLOCK pick up disk block address 0272E E4578802 1 6 BASE 376 ST R1 SP,MERRBLOCK save it 377 SETTBIT PPL,PPMEMERR flag this page as bad 0272F 60021000 0 IMM 377 LD R0 1*BIT(((PPL,PPMEMERR) DISP (PPL,0))/BITS 0:4) 02730 FC170802 0 4 BASE 377 IORM R0 PPL,(((PPL,PPMEMERR) DISP (PPL,0))/BITS 15:31) 378 * \ / 379 02731 DC402D79 380 CALLNP FREEZE freeze the system 02732 61001EB1 4 381 LD PCB PCONTROL PCB -> first process in system 382 * \ / 383 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 428 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 00002733 384 PROCLOOP LABEL 02733 E5178805 4 6 BASE 385 ST PCB SP,TEMP save this reg 02734 61491F13 5 4 ZBM 386 LD R5 PCB,PCPSADRS R5 -> PSA for this process 02735 DC0025EB 387 CALL MAPINMEM map in this user virtual free storage 02736 40534000 5 REG 388 PARVL R5 pointer to the PSA 02737 61178803 4 6 BASE 389 LD R4 SP,MERRPPL address of PPL for bad page 02738 60895F15 2 5 ZBM 390 LD R2 R5,PSPROCLIST get pointer to list of UPC's 391 * \ / 392 00002739 393 MPEUPCLP LABEL 02739 60D28000 3 2 REG 394 LD R3 R2 move pointer to appropriate register 0273A DC002766 395 CALL REMOVEALL remove all guilty PAL's 0273B 4016C80F 3 BASE 396 PARL R3,UPCVASP from VASP list 0273C DC002766 397 CALL REMOVEALL 0273D 4016C810 3 BASE 398 PARL R3,UPCWSX from WSX list 399 * \ / 400 0273E 6088DF10 2 3 ZBM 401 LD R2 R3,UPCSONPTR get our the son pointer 0273F FAB22739 2 402 JNZA R2 MPEUPCLP jump to process son UPC 403 * \ / 404 00002740 405 MPEBROLP LABEL 02740 6088DF16 2 3 ZBM 406 LD R2 R3,UPCBROPTR get pointer to brother process 02741 FAB22739 2 407 JNZA R2 MPEUPCLP jump to process brother UPC 408 * \ / 409 02742 60C8DF17 3 3 ZBM 410 LD R3 R3,UPCDADPTR move up to our overprocess 02743 FAF22740 3 411 JNZA R3 MPEBROLP see if any brother process to check 412 * \ / 413 02744 61178805 4 6 BASE 414 LD PCB SP,TEMP restore PCB pointer 02745 61091F14 4 4 ZBM 415 LD PCB PCB,PCNXTCB point to next PCB 02746 FB322733 4 416 JNZA PCB PROCLOOP jump if more processes exist 417 * \ / the page is probably quarantined now 418 02747 DC402D95 419 CALLNP UNFREEZE unfreeze the system 02748 DC4025FC 420 CALLNP MAPOUTMEM unmap the last guy processed 02749 DC0025EB 421 CALL MAPINMEM remap interrupted session, if any 0274A 40400412 422 PARVL CPPSA process status area 0274B 60040002 0 IMM 423 LD R0 MERRPAGE 0274C E4098840 0 6 ZBM 424 ST R0 SP,MERRACTION say we retired a page 0274D FE0E275C 425 JMP LOGERR and go log it 426 * --- 427 0000274E 428 INTPOLL LABEL error on interrupt poll 0274E E4D78801 3 6 BASE 429 ST R3 SP,MERRPFILE save slot number as page file 430 * \ / 431 0000274F 432 FLUKE LABEL flakey type error 0274F 60040000 0 IMM 433 LD R0 MERRFLUKE 02750 E4098840 0 6 ZBM 434 ST R0 SP,MERRACTION claim we had a fluke 435 * \ / 436 437 ********************************************************************************** 438 * * 439 * Here, we have what should be a non-repeatable error. See * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 429 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 440 * if the same one has occurred recently. If so, things are getting * 441 * sick and we should halt. Otherwise continue. * 442 * * 443 ********************************************************************************** 444 445 * \ / 00002751 446 FLUKE1 LABEL 02751 60178801 0 6 BASE 447 LD R0 SP,MERRPFILE get page file of error 02752 2802000E 0 IMM 448 BSUB R0 1*PFROBIT+1*PFALTBIT+1*PFREFBIT 02753 E0001CF2 0 449 EXCH R0 MPEPFILE swap with previous one 02754 62401EE5 12 450 LD2 R1 FDATE get current time (close enough) 02755 E2401CF3 12 451 EXCH2 R1 MPEDATE swap with previous one 02756 64001CF2 0 452 CPR R0 MPEPFILE same error as previous? 02757 FE0C275C 453 JNE LOGERR jump if not 02758 32401CF3 12 454 RSB2 R1 MPEDATE R1,R2 = time since last error 02759 664403E8 12 IMM 455 CPR2 R1 1*MSECSS within previous second? 0275A FE04275C 456 JGT LOGERR jump if not 0275B 000800C3 457 HALT HALTH00C3 bus device is very flakey 458 * --- 459 460 ********************************************************************************** 461 * * 462 * Here, we have done any necessary recovery. Log the error * 463 * and return. * 464 * * 465 ********************************************************************************** 466 0000275C 467 LOGERR LABEL 0275C 61538000 5 6 REG 468 LD R5 SP 0275D DC005048 469 CALL ERRORLOG 0275E 41440E19 IMM 470 PARV ERLCMPE memory parity error 0275F 41574800 5 BASE 471 PARV R5,MERRWORDA code, action, virt adr 02760 41574801 5 BASE 472 PARV R5,MERRPFILE page file value 02761 40574802 5 BASE 473 PARVL R5,MERRBLOCK block number 474 * \ / 475 476 ********************************************************************************** 477 * * 478 * Time to return. If MERRCAR is non-zero, we return via LDCA. * 479 * Else we jump to the dispatcher. * 480 * * 481 ********************************************************************************** 482 483 * \ / 02762 EC000462 484 STZ MEMERRFLAG no longer processing memory error 02763 5C178804 6 BASE 485 CMZ SP,MERRCAR 02764 FE0228B7 486 JEQ DISPATCH jump if no active process 02765 01178804 6 BASE 487 LDCA SP,MERRCAR else return to interrupted place 488 * --- 489 490 END PARITYERR routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 430 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 492 493 ********************************************************************************** 494 * * 495 * REMOVEALL * 496 * Routine to remove all PAL's for a particular page from * 497 * a PAL list. * 498 * Call: * 499 * SP = stack pointer * 500 * PPL * 501 * R5 -> PSA of process owning list * 502 * CALL REMOVEALL * 503 * PARL head of list (R5,PSVASP for example) * 504 * * 505 * Eats R0:R2. * 506 * Stack required = 8. * 507 * 4 + max ( DISCARDPAL (4) ) * 508 * * 509 ********************************************************************************** 510 511 BLOCK REMOVEALL subroutine 512 ENTRY REMOVEALL 513 514 BEGFRAME 00178801 6 BASE 515 REMLIST BSS 1 list header 00178802 6 BASE 516 REMR3R4 BSS 2 for saving R3 & R4 00178803 6 BASE 517 REMPPL EQU REMR3R4(1) address of relevent PPL 518 ENDFRAME 519 02766 DD1F8004 6 STAK 520 REMOVEALL ENTR PUSH 02767 C0178801 6 BASE 521 STPL SP,REMLIST save pointer to list head 02768 E6D78802 346 BASE 522 ST2 R3 SP,REMR3R4 save R3 and R4 523 00002769 524 LOOP LABEL 02769 60178803 0 6 BASE 525 LD R0 SP,REMPPL PPL pointer 0276A 61178C01 4 6 FPVR 526 LD PAL @(SP,REMLIST) PAL -> first PAL 0000276B 527 SEARCH LABEL 0276B 3C170803 0 4 BASE 528 LSRCH R0 PAL,PAPPLPTR find interesting PAL 0276C FE0C2778 529 JNE RETURN jump if none 0276D 5C091210 4 ZBM 530 CMZ PAL,PALOCK is PAL locked? 0276E FE022771 531 JEQ FOUND jump if not 0276F FB36276B 4 532 LJNA PAL SEARCH else ignore it and find next one 02770 FE0E2778 533 JMP RETURN jump if no more pages 534 * --- 535 00002771 536 FOUND LABEL PAL -> page to remove 02771 60178801 0 6 BASE 537 LD R0 SP,REMLIST R0 -> list header 02772 3D081F10 4 0 ZBM 538 LSRCH PAL R0,PALINK find previous element 02773 60491F10 1 4 ZBM 539 LD R1 PAL,PALINK 02774 E4481F10 1 0 ZBM 540 ST R1 R0,PALINK unlink the element 02775 D04940F2 5 ZBM 541 DEC R5,PSWSSIZE correct the working set size 02776 DC402E15 542 CALLNP DISCARDPAL discard this PAL 02777 FE0E2769 543 JMP LOOP and try another 544 * --- 545 00002778 546 RETURN LABEL 02778 62D78802 346 BASE 547 LD2 R3 SP,REMR3R4 restore registers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 431 (PARITYERROR) F 25 Memory Parity Error Interrupt Handler 02779 5D1F8004 6 STAK 548 LEAVE POP 549 * --- 550 551 END REMOVEALL subroutine 552 553 554 END Memory Error Interrupt Routine 51 INPUT POWERDOWN power down handler 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 432 (POWERDOWN) F 26 Power fail routine 3 4 BLOCK Power Fail Shutdown and Restart Routines 5 ENTRY POWERFAIL power fail interrupt handler 6 ENTRY POWERUP power up routine 7 ENTRY POWERUP2 power up reinitializer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 433 (POWERDOWN) F 26 Power fail routine 9 10 ********************************************************************************** 11 * * 12 * This routine is provided to get the volatile registers * 13 * of each CPU saved. When we arrive here, the CA already * 14 * contains all of the console registers. However, the page * 15 * file referenced/altered bits are not yet saved. If the * 16 * SHDEQUE routine is too slow for the job, all that is needed * 17 * is to save the altered bits. * 18 * After each CPU has finished, it sets a flag to indicate * 19 * to the power up routine that this was successfully completed. * 20 * The CPU then hangs on a WAIT instruction (a HALT or STOP would * 21 * stop all of the other CPUs). * 22 * * 23 * On entry: * 24 * R2 = 1 if power fail, 2 if temp fault * 25 * R4 => previous CCA * 26 * * 27 * Stack required = 3. * 28 * 0 + max ( LOCKWAIT (0), SETRUNNING (2), SHDEQUE (3) ) * 29 * * 30 ********************************************************************************** 31 32 BLOCK POWERFAIL routine 33 ENTRY POWERFAIL entry for power fail interrupt 34 0000277A 35 POWERFAIL LABEL 36 SETSP 0277A 81538000 6 REG 36 STCAR SP 0277B 6197880D 6 6 BASE 36 LD SP SP,CASTACKPTR 0277C 61979020 6 6 REG 36 LD SP SP+(2 POWER STAKLOG) 0277D 61D30000 7 4 REG 37 LD R7 R4 copy the console area pointer 38 * of the interrupted process 0277E 61400412 5 39 LD R5 CPPSA get the current PSA pointer 0277F FB422787 5 40 JEQZ R5 NOUSER take easy path out if no one loaded up 41 PLOCK SQLOCKS(NQRUNNING) lock the queue 02780 0CC00000 41 IOFF 02781 D1C01DBA 41 SETT SQLOCKS(NQRUNNING) 02782 FE0C2784 41 JNE MA(2+DISPW MA 0) 02783 DC40308B 41 CALLNP LOCKWAIT 02784 DC402BBD 42 CALLNP SHDEQUE unload page file and remove user from queue 02785 61095F12 4 5 ZBM 43 LD R4 R5,PSPROCCB get pointer to PCB 02786 DC402B99 44 CALLNP SETRUNNING put user back where we will find him 00002787 45 NOUSER LABEL 02787 E5C0044E 7 46 ST R7 POWERFLAG indicate that we successfully completed 00002788 47 REWAIT LABEL 02788 00420008 IMM 48 WAIT WAITCOUNT stop here on power fail 02789 FE0E2788 49 JMP REWAIT in case we fall out (no MCLR) 50 * --- 51 52 BSS 5 room for patches such as re-enable power up interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 434 (POWERDOWN) F 26 Power fail routine 54 55 ********************************************************************************** 56 * * 57 * POWERUP - Power-fail restart routine * 58 * * 59 * This routine runs at power-fail restart time. It receives * 60 * control from the skeleton routine on page zero (which initializes * 61 * the page file then jumps to POWERUP). * 62 * * 63 * If POWERFLAG is zero or negative, then the power-fail * 64 * shutdown routine never completed, and we must halt. Otherwise, * 65 * POWERFLAG is the address of the interrupted routine's console area. * 66 * * 67 * If the power-fail interrupt enable bit is on in the interrupted * 68 * routine's MSR, then it is a system routine that explicitly * 69 * requested power fail interrupts, and we must return to it so * 70 * that it can clean itself up before we re-initialize the system. * 71 * Such a routine leaves the desired restart location in POWERUPLOC. * 72 * We go to that location, leaving in POWERUPLOC the address where * 73 * it got interrupted. We expect the routine to finish and go to * 74 * DISPATCH. In this case, we get to POWERUP2 after the interrupted * 75 * routine returns to DISPATCH. * 76 * * 77 * If the power-fail interrupt enable bit is not on in the * 78 * interrupted routine's MSR, we exit directly to POWERUP2 to * 79 * re-initialize the system. * 80 * * 81 ********************************************************************************** 82 83 BLOCK POWERUP routine 84 ENTRY POWERUP 85 0000278F 86 POWERUP LABEL 0278F 6100044E 4 87 LD R4 POWERFLAG R4 => interrupted CA 02790 FB042792 4 88 JGTZ R4 OK jump if shutdown worked 02791 00021001 89 HALT HALTB1001 power-fail shutdown failed 90 * --- 91 00002792 92 OK LABEL 93 CLRTBIT R4,CAMSR/MSRPFINTEB clear PF int. enable in interrupted routine 02792 60040800 0 IMM 93 LD R0 1*BIT(((R4,CAMSR/MSRPFINTEB) DISP (R4,0))/BITS 0:4) 02793 A8170801 0 4 BASE 93 BRSBM R0 R4,(((R4,CAMSR/MSRPFINTEB) DISP (R4,0))/BITS 15:31) 02794 FE022799 94 JEQ POWERUP2 jump if PF int. was not enabled 02795 6000044F 0 95 LD R0 POWERUPLOC else get restart location 02796 E0091F10 0 4 ZBM 96 EXCH R0 R4,CAPC put it into the CA 02797 E4000450 0 97 ST R0 POWERRTNPC store old PC 02798 01130000 4 REG 98 LDCA R4 and go to interrupted routine 99 * --- 100 101 END POWERUP routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 435 (POWERDOWN) F 26 Power fail routine 103 104 ********************************************************************************** 105 * * 106 * POWERUP2 - Initialize System after Power Failure. * 107 * * 108 * Note that when calls are made to ACCOUNT and ERRORLOG to log * 109 * the power failure, the time has not been updated. Once these * 110 * routines have been called, SSU_RESET actually updates the clock * 111 * in memory at which time the power up records are created with * 112 * the correct time. Exits to DISPATCH. * 113 * * 114 * Stack required = 16. * 115 * 0 + max ( ACCOUNT (2), ACCTQUE (3), DEADMAN (16), * 116 * ERRORLOG (3), RECONFIG (16), SSU_RESET (5), * 117 * TIMEKILL (2) ) * 118 * * 119 ********************************************************************************** 120 121 BLOCK POWERUP2 routine 122 ENTRY POWERUP2 123 00002799 124 POWERUP2 LABEL 02799 0144041E IMM 125 LDCAR ADR PCONSOLE set our CAR 0279A 6184044D 6 IMM 126 LD SP ADR RESSTAK set our SP 127 0279B EC00044F 128 STZ POWERUPLOC clear interrupt address 0279C BC001CF9 0 129 INCL R0 CPUCOUNT2 count live CPU's 0279D FA2227BB 0 130 DRJ R0 OTHERWAY jump if we are not the first one 131 0279E DC005048 132 CALL ERRORLOG log the power failure 0279F 41440633 IMM 133 PARV ERLCPWFAIL power failure 027A0 40040000 IMM 134 PARL 0 dummy 135 027A1 DC00505F 136 CALL ACCOUNT log the power failure in the system 137 * managers accounting log file 027A2 41440008 IMM 138 PARV APTPWRFAIL type code 027A3 4144001C IMM 139 PARV AFRSHORT length of record 027A4 40440003 IMM 140 PARVL 3 log in master accounts 027A5 DC405025 141 CALLNP ACCTQUE send it to the queue 142 027A6 DC4044C9 143 CALLNP SSU_RESET reset the SSU (makes time correct) 144 027A7 61001EF3 4 145 LD TMR DEADMANTMR get deadman timer element SN 027A8 DC404517 146 CALLNP TIMEKILL kill the deadman timer 027A9 FEC00000 147 NOP 0 (ignore skip return) 148 027AA DC005048 149 CALL ERRORLOG log the power up 027AB 41440434 IMM 150 PARV ERLCPWRUP power up restart 027AC 40440000 IMM 151 PARVL 0 dummy 152 027AD DC00505F 153 CALL ACCOUNT put into accounting file 027AE 41440009 IMM 154 PARV APTPWRUP type code 027AF 4144001C IMM 155 PARV AFRSHORT length of record 027B0 40440003 IMM 156 PARVL 3 log in master accounts 027B1 DC405025 157 CALLNP ACCTQUE send it to the queue as is 158 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 436 (POWERDOWN) F 26 Power fail routine 027B2 DC4027C1 159 CALLNP RECONFIG reconfigure the system 027B3 60040800 0 IMM 160 LD R0 1*BIT FLPCPU bit sez reload CPU microcode patches 027B4 FC001CF6 0 161 IORM R0 FLAGS set it in FLAGS word 162 163 * Wait for the other CPU's to finish their restart routines. 164 000027B5 165 WAIT1 LABEL 027B5 60001CF9 0 166 LD R0 CPUCOUNT2 number of CPU's restarted 027B6 64001CF7 0 167 CPR R0 CPUCOUNT check against the expected number 027B7 FE0827B5 168 JLT WAIT1 jump if not there yet 169 027B8 EC001CF9 170 STZ CPUCOUNT2 let the other CPU's go 171 027B9 DC404E5E 172 CALLNP DEADMAN restart the deadman routine 027BA FE0E27BD 173 JMP FINISH then clean up mapping and leave 174 * --- 175 176 * Other CPU's come here. Wait for the first one to do 177 * its thing. 178 000027BB 179 OTHERWAY LABEL 027BB 5C001CF9 180 CMZ CPUCOUNT2 can we go yet? 027BC FE0C27BB 181 JNE OTHERWAY jump if not 182 * \ / 183 000027BD 184 FINISH LABEL 027BD EC00044E 185 STZ POWERFLAG say restart no longer in progress 027BE 60C40080 3 IMM 186 LD PFPTR PNPAGEZERO 027BF 80D20000 0 REG 187 PFRC R0 unmap the boot page 027C0 FE0E28B7 188 JMP DISPATCH then all done 189 * --- 190 191 END POWERUP2 routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 437 (POWERDOWN) F 26 Power fail routine 193 194 ********************************************************************************** 195 * * 196 * RECONFIG - Reconfigure the system. * 197 * Make sure that it has all of the boards that it should, and * 198 * reset all of the device controllers. * 199 * Call: * 200 * CALLNP RECONFIG * 201 * * 202 * Eats R0:R5. * 203 * Stack required = 16. * 204 * 2 + max ( CONFIGDISK (10), CONFIGCIA (14), CONFIGLPC (13), * 205 * CONFIGMTC (9) ) * 206 * * 207 ********************************************************************************** 208 209 BLOCK RECONFIG subroutine 210 ENTRY RECONFIG 211 212 BEGFRAME 00178004 6 CACH 213 SLOTNUM BSSC 1 slot number looking at 00178005 6 CACH 214 CHANNUM BSSC 1 channel number looking at 215 ENDFRAME 216 027C1 DD5F8002 6 STAK 217 RECONFIG ENTRNP PUSH 027C2 6144000F 5 IMM 218 LD R5 NUMSLOTS-1 start at highest slot number 219 * \ / 220 000027C3 221 SLOTLOOP LABEL 027C3 60134000 0 5 REG 222 LD R0 R5 copy current slot number 027C4 1C040010 0 IMM 223 MUL R0 WRUIMAX R0 = index into WRU table 027C5 61200200 4 0 224 LD R4 WRUINFO/WRU0(R0) R4 = current WRU0 response 027C6 60EA1ECE 3 5 225 LD R3 SLOTTABLE(R5) R3 = slot table entry 027C7 600AC030 0 3 CBM 226 LD R0 R3/SLOTTYPE R0 = type of board originally here 027C8 640B0040 0 4 CBM 227 CPR R0 R4/WRU0TYPE is it the same? 027C9 FE0227CF 228 JEQ ISSAME jump if so 027CA 64040003 0 IMM 229 CPR R0 SLTTPPU should a PPU be here? 027CB FE0C27CE 230 JNE BADSLOT error if not 027CC 5C0B0040 4 CBM 231 CMZ R4/WRU0TYPE is the slot now empty? 027CD FE0227D1 232 JEQ HAVEPPU jump if so - PPU's can disappear 233 * \ / 234 027CE 00021004 235 BADSLOT HALT HALTB1004 VRA board missing at power up time 236 * --- 237 000027CF 238 ISSAME LABEL 027CF 64040003 0 IMM 239 CPR R0 SLTTPPU is this a PPU? 027D0 FE0C27E7 240 JNE NEXTSLOT jump if not - no initialization needed 241 * \ / 242 000027D1 243 HAVEPPU LABEL 027D1 61040003 4 IMM 244 LD R4 PPUCHANS-1 start at highest channel number 245 * \ / 246 000027D2 247 CHANLOOP LABEL 027D2 602A1ECE 0 5 248 LD R0 SLOTTABLE(R5) R0 -> PPU control element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 438 (POWERDOWN) F 26 Power fail routine 027D3 605C2004 1 04 BASE 249 LD R1 R0,PPUCNTLPTR(R4) R1 = controller description 027D4 608A4080 2 1 CBM 250 LD R2 R1/DEVTYPE R2 = device type 027D5 60A427E9 2 2 251 LD R2 RESETTAB(R2) R2 -> reset routine 027D6 FAB027E2 2 252 JZA R2 NEXTCHAN jump if no reset routine 027D7 60040000 0 IMM 253 LD R0 0 prepare prototype 027D8 E54A0840 5 0 CBM 254 ST R5 R0/PFSLOT put slot number in 027D9 E50A3020 4 0 CBM 255 ST R4 R0/PPUCHAN and channel number 027DA 60C40086 3 IMM 256 LD PFPTR PNCIX 027DB 00D20000 0 REG 257 LDPF R0 make CIX point to the device 027DC E5178005 4 6 CACH 258 ST R4 SP,CHANNUM save channel number 027DD E5578004 5 6 CACH 259 ST R5 SP,SLOTNUM save slot number 027DE DC168400 2 @R 260 CALL @R2 reconfigure the device 027DF 404A5F10 1 CBM 261 PARVL R1/DEVPTR the pointer to control element 027E0 61178005 4 6 CACH 262 LD R4 SP,CHANNUM restore channel number 027E1 61578004 5 6 CACH 263 LD R5 SP,SLOTNUM restore slot number 264 * \ / 265 000027E2 266 NEXTCHAN LABEL 027E2 FB2627D2 4 267 JDR R4 CHANLOOP do all channels on PPU 027E3 602A1ECE 0 5 268 LD R0 SLOTTABLE(R5) get PPU element 027E4 5C160801 0 BASE 269 CMZ R0,PPUOPMSGID PPU msg there? 027E5 FE0C27E7 270 JNE NEXTSLOT jump if PPU funky (preserve msdid) 027E6 D1560801 0 BASE 271 STMW R0,PPUOPMSGID claim PPU is off for DEADMAN 272 * \ / 273 000027E7 274 NEXTSLOT LABEL 027E7 FB6627C3 5 275 JDR R5 SLOTLOOP do all slots 276 * \ / 277 027E8 5D1F8002 6 STAK 278 LEAVE POP then all done 279 * --- 280 000027E9 281 RESETTAB LABEL 027E9 00000000 282 VFD 0 00 - empty slot 027EA 000027F9 283 ADR CONFIGDISK 01 - mass storage controller 027EB 00002809 284 ADR CONFIGLPC 02 - line printer controller 027EC 00000000 285 VFD 0 03 - not used 027ED 00000000 286 VFD 0 04 - not used 027EE 00000000 287 VFD 0 05 - not used 027EF 00000000 288 VFD 0 06 - not used 027F0 00000000 289 VFD 0 07 - not used 027F1 00002819 290 ADR CONFIGCIA 08 - communications controller 027F2 00002823 291 ADR CONFIGMTC 09 - magnetic tape controller 027F3 00002823 292 ADR CONFIGMTC 0A - cartridge tape controller 027F4 00002823 293 ADR CONFIGMTC 0B - video tape controller 027F5 000027F9 294 ADR CONFIGDISK 0C - SCSI disk controller 027F6 00000000 295 VFD 0 0D - not used 027F7 00000000 296 VFD 0 0E - not used 027F8 00000000 297 VFD 0 0F - not used 298 299 END RECONFIG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 439 (POWERDOWN) F 26 Power fail routine 301 302 ********************************************************************************** 303 * * 304 * CONFIGDISK. Reconfigure a BFD. * 305 * Call: * 306 * CALL CONFIGDISK * 307 * PARVL pointer to MCT element * 308 * * 309 * Eats R0:R5. * 310 * Stack required = 10. * 311 * 2 + max ( LOCKWAIT (0), MS_RESET (8) ) * 312 * * 313 ********************************************************************************** 314 315 BLOCK CONFIGDISK routine 316 ENTRY CONFIGDISK 317 318 BEGFRAME 00178801 6 BASE 319 MCTPNTR BSS 1 pointer to the MCT element 320 ENDFRAME 321 027F9 DD1F8002 6 STAK 322 CONFIGDISK ENTR PUSH 027FA C0578801 6 BASE 323 STPVL SP,MCTPNTR 324 027FB 61578801 5 6 BASE 325 LD R5 SP,MCTPNTR R5 => MCT element 326 PLOCK (R5,MCTELOCK) lock the controller 027FC 0CC00000 326 IOFF 027FD D1D74803 5 BASE 326 SETT (R5,MCTELOCK) 027FE FE0C2800 326 JNE MA(2+DISPW MA 0) 027FF DC40308B 326 CALLNP LOCKWAIT 02800 60040000 0 IMM 327 LD R0 0 claim PPU is dead 02801 DC4039A9 328 CALLNP MS_RESET reset the controller 02802 FEC00000 329 NOP 0 ignore skip return 330 02803 61578801 5 6 BASE 331 LD R5 SP,MCTPNTR R5 => MCT element 332 SETTBIT R5,MCTTIMEOUT set the timeout bit 02804 60021000 0 IMM 332 LD R0 1*BIT(((R5,MCTTIMEOUT) DISP (R5,0))/BITS 0:4) 02805 FC174804 0 5 BASE 332 IORM R0 R5,(((R5,MCTTIMEOUT) DISP (R5,0))/BITS 15:31) 333 PUNLOCK (R5,MCTELOCK) unlock the controller 02806 EC174803 5 BASE 333 STZ (R5,MCTELOCK) 02807 0C800000 333 ION 334 02808 5D1F8002 6 STAK 335 LEAVE POP 336 * --- 337 338 END CONFIGDISK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 440 (POWERDOWN) F 26 Power fail routine 340 341 ********************************************************************************** 342 * * 343 * CONFIGLPC. Reconfigure a LPC. * 344 * Call: * 345 * CALL CONFIGLPC * 346 * PARVL pointer to LPC element * 347 * * 348 * Eats R0:R5. * 349 * Stack required = 13. * 350 * 2 + max ( LOCKWAIT (0), LPCRESET (11) ) * 351 * * 352 ********************************************************************************** 353 354 BLOCK CONFIGLPC routine 355 ENTRY CONFIGLPC 356 357 BEGFRAME 00178801 6 BASE 358 LPCPNTR BSS 1 pointer to the LPC element 359 ENDFRAME 360 02809 DD1F8002 6 STAK 361 CONFIGLPC ENTR PUSH 0280A C0578801 6 BASE 362 STPVL SP,LPCPNTR 363 0280B 61578801 5 6 BASE 364 LD R5 SP,LPCPNTR R5 => LPC element 365 PLOCK (R5,LPCELOCK) lock the controller 0280C 0CC00000 365 IOFF 0280D D1D74805 5 BASE 365 SETT (R5,LPCELOCK) 0280E FE0C2810 365 JNE MA(2+DISPW MA 0) 0280F DC40308B 365 CALLNP LOCKWAIT 02810 60040000 0 IMM 366 LD R0 0 claim PPU is dead 02811 DC404DA8 367 CALLNP LPCRESET reset the controller 02812 FEC00000 368 NOP 0 ignore skip return 369 02813 61578801 5 6 BASE 370 LD R5 SP,LPCPNTR R5 => LPC element 371 SETTBIT R5,LPCTIMEOUT set the timeout bit 02814 60030000 0 IMM 371 LD R0 1*BIT(((R5,LPCTIMEOUT) DISP (R5,0))/BITS 0:4) 02815 FC174807 0 5 BASE 371 IORM R0 R5,(((R5,LPCTIMEOUT) DISP (R5,0))/BITS 15:31) 372 PUNLOCK (R5,LPCELOCK) unlock the controller 02816 EC174805 5 BASE 372 STZ (R5,LPCELOCK) 02817 0C800000 372 ION 373 02818 5D1F8002 6 STAK 374 LEAVE POP 375 * --- 376 377 END CONFIGLPC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 441 (POWERDOWN) F 26 Power fail routine 379 380 ********************************************************************************** 381 * * 382 * CONFIGCIA. Reconfigure a CIA. * 383 * Call: * 384 * CALL CONFIGCIA * 385 * PARVL pointer to COM element * 386 * * 387 * Eats R0:R5. * 388 * Stack required = 14. * 389 * 2 + max ( CIA_RESET (12) ) * 390 * * 391 ********************************************************************************** 392 393 BLOCK CONFIGCIA routine 394 ENTRY CONFIGCIA 395 396 BEGFRAME 00178801 6 BASE 397 COMPNTR BSS 1 pointer to the COM element 398 ENDFRAME 399 02819 DD1F8002 6 STAK 400 CONFIGCIA ENTR PUSH 0281A C0578801 6 BASE 401 STPVL SP,COMPNTR 402 0281B 61578801 5 6 BASE 403 LD R5 SP,COMPNTR R5 => COM element 0281C 60040000 0 IMM 404 LD R0 0 claim PPU is dead 0281D DC40494C 405 CALLNP CIA_RESET reset the controller 0281E FEC00000 406 NOP 0 ignore skip return 407 0281F 61578801 5 6 BASE 408 LD R5 SP,COMPNTR R5 => COM element 409 SETTBIT R5,COMTIMEOUT set the timeout bit 02820 60028000 0 IMM 409 LD R0 1*BIT(((R5,COMTIMEOUT) DISP (R5,0))/BITS 0:4) 02821 FC174805 0 5 BASE 409 IORM R0 R5,(((R5,COMTIMEOUT) DISP (R5,0))/BITS 15:31) 410 02822 5D1F8002 6 STAK 411 LEAVE POP 412 * --- 413 414 END CONFIGCIA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 442 (POWERDOWN) F 26 Power fail routine 416 417 ********************************************************************************** 418 * * 419 * CONFIGMTC. Reconfigure a MTC. * 420 * Call: * 421 * CALL CONFIGMTC * 422 * PARVL pointer to MTC element * 423 * * 424 * Eats R0:R5. * 425 * Stack required = 9. * 426 * 2 + max ( LOCKWAIT (0), MT_RESET (7) ) * 427 * * 428 ********************************************************************************** 429 430 BLOCK CONFIGMTC routine 431 ENTRY CONFIGMTC 432 433 BEGFRAME 00178801 6 BASE 434 MTCPNTR BSS 1 pointer to the MTC element 435 ENDFRAME 436 02823 DD1F8002 6 STAK 437 CONFIGMTC ENTR PUSH 02824 C0578801 6 BASE 438 STPVL SP,MTCPNTR 439 02825 61578801 5 6 BASE 440 LD R5 SP,MTCPNTR R5 => MTC element 441 PLOCK (R5,MTCELOCK) lock the controller 02826 0CC00000 441 IOFF 02827 D1D74803 5 BASE 441 SETT (R5,MTCELOCK) 02828 FE0C282A 441 JNE MA(2+DISPW MA 0) 02829 DC40308B 441 CALLNP LOCKWAIT 0282A 60040000 0 IMM 442 LD R0 0 claim PPU is dead 0282B DC4041CB 443 CALLNP MT_RESET reset the controller 0282C FEC00000 444 NOP 0 ignore skip return 445 0282D 61578801 5 6 BASE 446 LD R5 SP,MTCPNTR R5 => MTC element 0282E EC174804 5 BASE 447 STZ R5,MTCTIMEOUT clear timeout counter 448 PUNLOCK (R5,MTCELOCK) unlock the controller 0282F EC174803 5 BASE 448 STZ (R5,MTCELOCK) 02830 0C800000 448 ION 449 02831 5D1F8002 6 STAK 450 LEAVE POP 451 * --- 452 453 END CONFIGMTC subroutine 454 455 END Power Fail Shutdown and Restart Routines 456 457 END POWERFAIL routine 52 INPUT STACKER console area and stack manager 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 443 (STACKER) F 27 Stack and Console Area Managers 3 BLOCK Stack and Console Area Managers 4 5 ENTRY BUILDCA create a new CA + Stack 6 ENTRY FREECA destroy a CA + Stack 7 ENTRY GRABCA attach CA to current process 8 ENTRY DROPCA detach CA from current process 9 ENTRY GETSTACK allocate a stack 10 ENTRY FREESTACK free a stack 11 ENTRY STAKLOG log size of CA stacks 12 ENTRY STACKIDENT identifying word at bottom of all stacks 13 00000005 ABS 14 STAKLOG EQU 5 CA's come with 32-word stacks 15 02832 5354414B 16 STACKIDENT TEXT "STAK" this word occurs at bottom of all stacks 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 444 (STACKER) F 27 Stack and Console Area Managers 18 19 ********************************************************************************** 20 * * 21 * BUILDCA - Build New Console Area with Stack. * 22 * * 23 * This routine will allocate a new console area with an * 24 * attached stack and initialize them. * 25 * * 26 * CALLNP BUILDCA * 27 * ST R0 => new CA * 28 * * 29 * Eats R0:R1. * 30 * Stack required = 2. * 31 * 2 + max ( SGETMEM (0) ) * 32 * * 33 ********************************************************************************** 34 35 BLOCK BUILDCA subroutine 36 ENTRY BUILDCA 37 38 BEGFRAME 00178801 6 BASE 39 STACKPTR BSS 1 address of associated stack 40 ENDFRAME 41 02833 DD5F8002 6 STAK 42 BUILDCA ENTRNP PUSH 02834 DC002ED0 43 CALL SGETMEM get a stack 02835 40440005 IMM 44 PARVL STAKLOG indicate its length 02836 60402832 1 45 LD R1 STACKIDENT get the "STAK" marker 02837 E4560800 1 0 BASE 46 ST R1 R0,0 set stack identifier 02838 E4178801 0 6 BASE 47 ST R0 SP,STACKPTR save pointer to stack 02839 DC002ED0 48 CALL SGETMEM get a console area 0283A 40440004 IMM 49 PARVL CALOG indicate its length 0283B 60578801 1 6 BASE 50 LD R1 SP,STACKPTR pick up the saved stack pointer 0283C E456080D 1 0 BASE 51 ST R1 R0,CASTACKPTR and make CA point to stack 0283D 5D1F8002 6 STAK 52 LEAVE POP return 53 * ---- 54 55 END BUILDCA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 445 (STACKER) F 27 Stack and Console Area Managers 57 58 ********************************************************************************** 59 * * 60 * FREECA - Free Console Area with Stack * 61 * * 62 * This routine will free a console area and the * 63 * associated stack. * 64 * * 65 * CALL FREECA * 66 * PARVL => CA * 67 * * 68 * Eats R0:R1. * 69 * Stack required = 2. * 70 * 2 + max ( SFREEMEM (0) ) * 71 * * 72 ********************************************************************************** 73 74 BLOCK FREECA subroutine 75 ENTRY FREECA 76 77 BEGFRAME 00178801 6 BASE 78 STACKPTR BSS 1 address of CA's stack 79 ENDFRAME 80 0283E DD1F8002 6 STAK 81 FREECA ENTR PUSH 0283F C0524000 1 REG 82 STPVL R1 R1 -> the CA 02840 6016480D 0 1 BASE 83 LD R0 R1,CASTACKPTR R0 -> the stack 02841 E4178801 0 6 BASE 84 ST R0 SP,STACKPTR save it 02842 DC002F5D 85 CALL SFREEMEM free the console area 02843 41440004 IMM 86 PARV CALOG indicate its length 02844 40524000 1 REG 87 PARVL R1 and address 02845 60578801 1 6 BASE 88 LD R1 SP,STACKPTR R1 -> the stack 02846 DC002F5D 89 CALL SFREEMEM free the stack 02847 41440005 IMM 90 PARV STAKLOG indicate its length 02848 40524000 1 REG 91 PARVL R1 and address 02849 5D1F8002 6 STAK 92 LEAVE POP and all done 93 * ---- 94 95 END FREECA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 446 (STACKER) F 27 Stack and Console Area Managers 97 98 ********************************************************************************** 99 * * 100 * GRABCA - Grab a console area. * 101 * * 102 * This routine will grab a console area from the * 103 * Interrupt Vector Table and attach it to the current * 104 * process. We pick up and replace the CA from the IVT * 105 * because the CPU has already loaded that address into * 106 * its CAR. * 107 * An interrupt routine must call GRABCA before allowing * 108 * any other interrupts (including page faults) to occur. * 109 * * 110 * CALL GRABCA * 111 * PARL * 112 * * 113 * Eats R0:R1. * 114 * Stack required = 4. * 115 * 2 + max ( BUILDCA (2) ) * 116 * * 117 ********************************************************************************** 118 119 BLOCK GRABCA subroutine 120 ENTRY GRABCA 121 122 BEGFRAME 00178801 6 BASE 123 IVTLOC BSS 1 pointer to CA ptr in IVT 124 ENDFRAME 125 0284A DD1F8002 6 STAK 126 GRABCA ENTR PUSH 0284B C0178801 6 BASE 127 STPL SP,IVTLOC save ptr to ptr to CA 0284C 60400412 1 128 LD R1 CPPSA R1 -> our PSA 0284D 60040000 0 IMM 129 LD R0 0 make a nil pointer 0284E E000044D 0 130 EXCH R0 CPXTRACA R0 -> extra CA, clear extra CA ptr 0284F FA322852 0 131 JNZA R0 HAVECA jump if we got one 02850 DC402833 132 CALLNP BUILDCA else get a fresh one 02851 60400412 1 133 LD R1 CPPSA restore ptr to PSA 00002852 134 HAVECA LABEL 02852 E0178C01 0 6 FPVR 135 EXCH R0 @(SP,IVTLOC) R0 -> our CA, put new one into IVT 02853 60485F10 1 1 ZBM 136 LD R1 R1,PSCACHN R1 -> pointer CA list 02854 E456080C 1 0 BASE 137 ST R1 R0,CALINK store pointer into new CA 02855 EE16080A 0 BASE 138 STZ2 R0,CAINTADR clear interrupt address and int mask 02856 60400412 1 139 LD R1 CPPSA R1 -> pointer to PSA 02857 E0085F10 0 1 ZBM 140 EXCH R0 R1,PSCACHN PSA -> new CA,R0 -> old CA 02858 E4085F11 0 1 ZBM 141 ST R0 R1,PSCACHNP1 set pointer to old one 02859 5D1F8002 6 STAK 142 LEAVE POP all done 143 * ---- 144 145 END GRABCA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 447 (STACKER) F 27 Stack and Console Area Managers 147 148 ********************************************************************************** 149 * * 150 * DROPCA - Release current console area * 151 * * 152 * This routine will remove the current console area from * 153 * the process's console area chain. * 154 * After calling this routine, no further interrupts are * 155 * allowed until changing the hardware Console Area Register. * 156 * The console area being dropped invariably ends up as * 157 * the process's extra console area. This means that you can * 158 * continue to use the stack in the console area until the * 159 * next process-switch or return from interrupt. * 160 * * 161 * CALLNP DROPCA * 162 * * 163 * Eats R0:R1. * 164 * Stack required = 3. * 165 * 1 + max ( FREECA (2) ) * 166 * * 167 ********************************************************************************** 168 169 BLOCK DROPCA subroutine 170 ENTRY DROPCA 171 172 BEGFRAME 173 ENDFRAME 174 0285A DD5F8001 6 STAK 175 DROPCA ENTRNP PUSH 0285B 60400412 1 176 LD R1 CPPSA R1 -> current PSA 0285C 60085F11 0 1 ZBM 177 LD R0 R1,PSCACHNP1 R0 -> previous CA 0285D 6016080C 0 0 BASE 178 LD R0 R0,CALINK R0 -> second previous 0285E E0085F11 0 1 ZBM 179 EXCH R0 R1,PSCACHNP1 set PSCACHNP1, R0 -> previous CA 0285F E0085F10 0 1 ZBM 180 EXCH R0 R1,PSCACHN set PSCACHN, R0 -> one to get rid of 02860 60560C0D 1 0 FPVR 181 LD R1 @(R0,CASTACKPTR) get bottom word of stack 02861 64402832 1 182 CPR R1 STACKIDENT has it been clobbered? 02862 FE0C2869 183 JNE BADSTACK jump if so 02863 60400412 1 184 LD R1 CPPSA R1 -> PSA again 02864 E000044D 0 185 EXCH R0 CPXTRACA save old CA as extra, get previous extra 02865 FA302868 0 186 JZA R0 RETURN jump if none 02866 DC00283E 187 CALL FREECA else free the old one 02867 40520000 0 REG 188 PARVL R0 189 * \ / 190 00002868 191 RETURN LABEL 02868 5D1F8001 6 STAK 192 LEAVE POP all done 193 * ---- 194 02869 00130090 195 BADSTACK HALT HALTS0090 stack overflow 196 * --- 197 198 END DROPCA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 448 (STACKER) F 27 Stack and Console Area Managers 200 201 ********************************************************************************** 202 * * 203 * GETSTACK - Acquire a stack. * 204 * * 205 * This routine will allocate a stack, and set SP to point * 206 * to the top of it (last word plus 1). The parameter is the * 207 * number of words of stack required. The actual number of * 208 * words given back is the next larger power of 2, less one. * 209 * (The "less one" is for an identifying word.) * 210 * * 211 * You do not need a stack to call this routine. * 212 * * 213 * CALL GETSTACK * 214 * PARVL * 215 * * 216 * Eats R0:R3, Sets SP. * 217 * Stack required = 0. * 218 * 0 + max ( SGETMEM (0) ) * 219 * * 220 ********************************************************************************** 221 222 BLOCK GETSTACK subroutine 223 ENTRY GETSTACK 224 0286A DD12C000 3 REG 225 GETSTACK ENTR R3 0286B C0520000 0 REG 226 STPVL R0 R0 = requested size 0286C 5C520000 0 REG 227 HIB R0 0286D 30040020 0 IMM 228 RSB R0 32 R0 = log (size + 1) 0286E 60A0255E 2 0 229 LD R2 BITTAB(R0) R2 = size of block 0286F DC002ED0 230 CALL SGETMEM get storage for stack 02870 40520000 0 REG 231 PARVL R0 02871 60402832 1 232 LD R1 STACKIDENT get identifying word for stack 02872 E4560800 1 0 BASE 233 ST R1 R0,0 put at bottom of stack 02873 399C1000 6 02 BASE 234 LEA SP R0,0(R2) point SP at end of stack 02874 5D12C000 3 REG 235 LEAVE R3 236 * ---- 237 238 END GETSTACK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 449 (STACKER) F 27 Stack and Console Area Managers 240 241 ********************************************************************************** 242 * * 243 * FREESTACK - Free a stack * 244 * * 245 * This routine will free a stack that was acquired by * 246 * GETSTACK. If the identifier at the end of the stack * 247 * has been clobbered, we will halt. (This means that * 248 * the caller overflowed his stack.) * 249 * * 250 * CALL FREESTACK * 251 * PARVL STACKSIZE * 252 * * 253 * Eats R0:R2. * 254 * Stack required = 0. * 255 * 0 + max ( SFREEMEM (0) ) * 256 * * 257 ********************************************************************************** 258 259 BLOCK FREESTACK subroutine 260 ENTRY FREESTACK 261 02875 DD128000 2 REG 262 FREESTACK ENTR R2 02876 C0520000 0 REG 263 STPVL R0 R0 = requested size 02877 5C520000 0 REG 264 HIB R0 02878 30040020 0 IMM 265 RSB R0 32 R0 = log (size + 1) 02879 60520000 1 0 REG 266 LD R1 R0 R1 = log (size + 1) 0287A 7022255E 0 1 267 LDN R0 BITTAB(R1) R0 = -(size of block) 0287B 11840001 6 IMM 268 SUB SP 1 0287C 79920000 6 0 REG 269 AND SP R0 SP=>bottom of stack 0287D 60178800 0 6 BASE 270 LD R0 SP,0 get bottom word 0287E 64002832 0 271 CPR R0 STACKIDENT is it good? 0287F FE0C2884 272 JNE HALT jump if not 02880 DC002F5D 273 CALL SFREEMEM else free the stack 02881 41524000 1 REG 274 PARV R1 log size 02882 40538000 6 REG 275 PARVL SP address 02883 5D128000 2 REG 276 LEAVE R2 all done 277 * ---- 278 02884 00130091 279 HALT HALT HALTS0091 OS stack overflow 280 * --- 281 282 END FREESTACK subroutine 283 284 285 286 END Stack and Console Area Managers 53 INPUT DISPATCH queue manager and dispatcher 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 450 (DISPATCH) F 28 Dispatcher 3 4 DISPATCHER BLOCK 5 6 ENTRY DISPATCH routine to get new user 7 ENTRY FLACCTNG start the accounting process 8 ENTRY FLADT start the ADT process 9 ENTRY FLCHKSUM re-checksum the resident nucleous 10 ENTRY FLDISMNT dismount maintenance mounted volumes 11 ENTRY FLERRLOG start the error log process 12 ENTRY FLFREEFL start the free file process 13 ENTRY FLFREEZE tell system to cool it 14 ENTRY FLFSX to calculate bit for free storage expansion 15 ENTRY FLMONITOR to capture CPU for monitoring 16 ENTRY FLMSPROC to calculate bit for mass storage request 17 ENTRY FLMTPROC to calculate bit for mag tape request 18 ENTRY FLPCPU to calculate bit for CPU patching process 19 ENTRY FLSTOPCPU to stop a CPU 20 ENTRY FSXPAND free storage expansion/contraction routine 21 ENTRY GETTRAPPER subroutine to find user interrupt trapper 22 ENTRY INTMASKB user intmask bit number table 23 ENTRY INTASSOCB user int code PSA/UPC association 24 ENTRY LASTINTC last code in INTMASKB 25 ENTRY STARTUP routine used at system startup 26 27 ********************************************************************************** 28 * * 29 * Each processor comes here from the code in INITIAL. * 30 * We unload the page file location that we used for the * 31 * INITIAL code (since we're done with it forever). Since * 32 * a PPL has already been created for the physical memory * 33 * that INITIAL is in, the page can now be used for * 34 * anything as soon as we start the system by jumping to * 35 * DISPATCH. We also set the bit in AVPAGES to indicate * 36 * that this virtual page may be used for free storage. * 37 * We only want to set this bit once (in case it is used * 38 * real quick) and only after all CPUs are through with * 39 * the INITIAL code. We use CPUINIT to keep count of * 40 * how many CPUs are on the INITIAL page. When this reaches * 41 * zero, the page is available. * 42 * At this point in time, the only runnable * 43 * process is the initial PROCESS, and the dispatcher * 44 * will immediately run it. * 45 * * 46 ********************************************************************************** 47 00002885 48 STARTUP LABEL 02885 60C40088 3 IMM 49 LD PFPTR PNINITPAGE initializer page can go 02886 80D20000 0 REG 50 PFRC R0 clear out page file entry 02887 D0401CFA 51 DEC CPUINIT we are now off of initial page 02888 FE0428B7 52 JGT DISPATCH off to dispatch if not last 53 PLOCK MEMLOCK get lock of memory lists 02889 0CC00000 53 IOFF 0288A D1C01C6C 53 SETT MEMLOCK 0288B FE0C288D 53 JNE MA(2+DISPW MA 0) 0288C DC40308B 53 CALLNP LOCKWAIT 0288D EDF61CC6 3 @ 54 STW @PAVPAGES(PFPTR) say initial page is available 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 451 (DISPATCH) F 28 Dispatcher 55 PUNLOCK MEMLOCK release memory lists 0288E EC001C6C 55 STZ MEMLOCK 0288F 0C800000 55 ION 56 * \ / 57 02890 FE0E28B7 58 JMP DISPATCH off we go 59 * --- 60 61 ********************************************************************************** 62 * There is no user ready to run, waste time. * 63 ********************************************************************************** 64 00002891 65 THINKIDLE LABEL 66 PUNLOCK SQLOCKS(NQRUNNABLE) release the scheduler runnable queue 02891 EC001DBB 66 STZ SQLOCKS(NQRUNNABLE) 02892 0C800000 66 ION 02893 5C001D0C 67 CMZ SLEEPFLAG are we trying to get asleep? 02894 FE0228A9 68 JEQ WAIT4WORK if not check for work 02895 FE08289D 69 JLT CRUNCH check to see if to stop no matter what 70 * \ / 71 72 ********************************************************************************** 73 * * 74 * We think we should be trying to terminate system operation. * 75 * We check to see if volumes are present (thus checking for * 76 * logged on users and busy files) and if the IO devices * 77 * are finished. If both are safe we halt. * 78 * * 79 ********************************************************************************** 80 81 * \ / 02896 60001EB0 0 82 LD R0 PCCOUNT number of processes still running 02897 7C001F18 0 83 IOR R0 DISKRBUSY are the disks still reading? 02898 7C001F19 0 84 IOR R0 DISKWBUSY are the disks still writing? 02899 7C001F05 0 85 IOR R0 TERMWBUSY wait until output done 0289A 7C001D92 0 86 IOR R0 ERRLOGLIST any error elements need writing 0289B 7C001D9A 0 87 IOR R0 APLIST any accounting entries need writing 0289C FA0C28A9 0 88 JNEZ R0 WAIT4WORK jump if can't sleep yet 0000289D 89 CRUNCH LABEL 0289D 0CC00000 90 IOFF prevent further happenings 0289E 60C40086 3 IMM 91 LD PFPTR PNCIX get page number for I/O window 0289F 00C01EDE 92 LDPF CLOCKPF get access to the SSU 028A0 620028A6 01 93 LD2 R0 SLEEPMES get the left 8 characters of FP display 028A1 E400180A 0 94 ST R0 CIX(SSUDISP03) tell the world we're down 028A2 E440180B 1 95 ST R1 CIX(SSUDISP47) 028A3 600028A8 0 96 LD R0 SLEEPMES(2) 028A4 E400180C 0 97 ST R0 CIX(SSUDISP89) 028A5 003FFFFF 98 HALT NOHALTCODE halt, leaving ZZZs displayed 99 * --- 100 000028A6 101 SLEEPMES LABEL 028A6 5A5A5A5A 102 TEXTZ "ZZZZZZ... " 103 104 ********************************************************************************** 105 * * 106 * We have nothing to do so we wait for work. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 452 (DISPATCH) F 28 Dispatcher 107 * We stop at the WAIT instruction to wait for an interrupt to * 108 * cause us to queue up work. * 109 * * 110 ********************************************************************************** 111 000028A9 112 WAIT4WORK LABEL 028A9 59C4F000 IMM 113 IORMSR INTSON turn on the interrupts 028AA 60401EF0 1 114 LD R1 TIMESERIAL get the current timer queue serial pointer 028AB 00420008 IMM 115 WAIT WAITCOUNT wait for an interrupt 116 * \ / fell out of WAIT instruction 117 118 ********************************************************************************** 119 * * 120 * If we come here because the wait instruction timed out, * 121 * we want to check to see if interrupts are happening at all. * 122 * In a multiple CPU system, all interrupts may have gone to a * 123 * different CPU, so we check to see if the clock is being used. * 124 * * 125 ********************************************************************************** 126 127 * \ / 128 PLOCK TIMERLOCK lock the timer queue 028AC 0CC00000 128 IOFF 028AD D1C01EF1 128 SETT TIMERLOCK 028AE FE0C28B0 128 JNE MA(2+DISPW MA 0) 028AF DC40308B 128 CALLNP LOCKWAIT 028B0 64401EF0 1 129 CPR R1 TIMESERIAL see if the clock is living 028B1 FE0C28B5 130 JNE SKIPSSURST if so, skip the reset 028B2 D0001EF0 131 INC TIMESERIAL ensure that only one CPU finds this 028B3 60040008 0 IMM 132 LD R0 1*BIT FLSSURST it looks as if no timer queue interrupts 028B4 FC001CF6 0 133 IORM R0 FLAGS so do a SSU reset 000028B5 134 SKIPSSURST LABEL 135 PUNLOCK TIMERLOCK release this queue 028B5 EC001EF1 135 STZ TIMERLOCK 028B6 0C800000 135 ION 136 * \ / 137 138 ********************************************************************************** 139 * * 140 * DISPATCH * 141 * The dispatcher controls the actual assignment of * 142 * processors to processes. Actually, each processor * 143 * executes this code to assign itself to a new * 144 * process. We make this work by making most interrupt * 145 * returns go through the dispatcher. While here, * 146 * the processor determines what task should be * 147 * executed next. * 148 * When we get here, we load a local console area * 149 * pointer and allow interrupts. This allows interrupt * 150 * processing to get started before we do the dispatch * 151 * task. Since the dispatch task would have been * 152 * redone at the completion of another interrupt, * 153 * this slightly reduces the number of times * 154 * that we go through the dispatch code. Power fail * 155 * interrupts may also occur at this point, so no * 156 * further checking is needed to ensure their * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 453 (DISPATCH) F 28 Dispatcher 157 * recognition. * 158 * We then check for system level tasks that need * 159 * execution (the FLAGS word). If no such task is * 160 * required, we check to see if the current process is * 161 * healthy. If it is okay, we return to its execution. If * 162 * it has errors queued against it, we take appropriate * 163 * action. If no current process exists, we pick the next * 164 * available process. * 165 * * 166 * stack required = 15 * 167 * 0 + max ( ACCOUNT (2), ACCTALIAS (4), ACCTPSA (2), * 168 * ACCTQUE (3), ACCTULB (1), BLDPROCESS (2), * 169 * CHECKNOINT (2), CHKINTCODE (4), CLRMEMTRAP (1), * 170 * DELINKUERR (1), DOACCTNG (3), DOADT (3), * 171 * DODISMNT (3), DOERRLOG (3), DOFREEFL (3), * 172 * DROPCA (3), ERRORLOG (3), FCGETMEM (0), * 173 * FREEZEWAIT (12), FSXPAND (2), GETTRAPPER (3), * 174 * GRABCA (4), LOCKWAIT (0), MAPINMEM (3), * 175 * MONITRPROC (15), MOVETRMGX (5), MSPROC (6), * 176 * MTPROC (5), OVPDOWNONE (11), OVPUPONE (11), * 177 * PFLOAD (3), SETMEMTRAP (1), SETRUNNING (2), * 178 * SFREEMEM (0), SGETMEM (0), SHUTDOWN (12), * 179 * SHUTRUN (11), SRCHPSNM (3), SSU_RESET (5), * 180 * TESTTRUBL (13), TIMESET (2), UERRSET (1) ) * 181 * * 182 ********************************************************************************** 183 184 * \ / 000028B7 185 DISPATCH LABEL this is the dispatcher entry 028B7 0144041E IMM 186 LDCAR ADR PCONSOLE load up a good console area pointer 028B8 59C4F000 IMM 187 IORMSR ONEBITS/MSRINTCNT*MSRINTCNT allow interrupts, including power fail. 188 * we can't just reload the MSR since 189 * we would lose interrupts from 190 * other processors. 028B9 FEC00000 191 NOP 0 ** allow time for external event interrupt 028BA 0CC00000 192 IOFF interrupts off for the remainder of our work 028BB 5C00044E 193 CMZ POWERFLAG power-fail restart in progress? 028BC FE0C2799 194 JNE POWERUP2 jump if so 028BD 6184044D 6 IMM 195 LD SP ADR RESSTAK set up the stack pointer 028BE 5C401CF6 196 HIB FLAGS check for stuff to do 028BF F23428F5 0 197 JBF R0/BIT 26 PROCFL jump if work has been requested 028C0 61400412 5 198 LD R5 CPPSA load the current users PSA pointer 028C1 FB7228EF 5 199 JNZA R5 DISPLIT fall through if no current user 200 * \ / 201 028C2 60841DAA 2 IMM 202 LD R2 ADR SQRUNNABLE set up for RLJNA 203 PLOCK SQLOCKS(NQRUNNABLE) 028C3 0CC00000 203 IOFF 028C4 D1C01DBB 203 SETT SQLOCKS(NQRUNNABLE) 028C5 FE0C28C7 203 JNE MA(2+DISPW MA 0) 028C6 DC40308B 203 CALLNP LOCKWAIT 028C7 60401DAA 1 204 LD R1 SQRUNNABLE get the root of the list 028C8 FA702891 1 205 JZA R1 THINKIDLE jump if nothing to do 000028C9 206 TRYAGAIN LABEL 028C9 61485F13 5 1 ZBM 207 LD R5 R1,PCPSADRS R5 -> PSA 028CA 60094043 0 5 ZBM 208 LD R0 R5,PSOURCPU pick up the desired CPU 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 454 (DISPATCH) F 28 Dispatcher 028CB FA0228D0 0 209 JEQZ R0 PROCOK if none specified, then we are ok 028CC 64000415 0 210 CPR R0 OURSLOT do they want us? 028CD FE0228D0 211 JEQ PROCOK if so, then run them 028CE FA7A28C9 12 212 RLJNA R1 TRYAGAIN go around again 028CF FE0E2891 213 JMP THINKIDLE could not find a process for us to run 214 * --- 215 000028D0 216 PROCOK LABEL 028D0 60085F10 0 1 ZBM 217 LD R0 R1,PCQLINK get link to remainder of list 028D1 E4089F10 0 2 ZBM 218 ST R0 R2,PCQLINK remove our element from the list 219 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 028D2 EC001DBB 219 STZ SQLOCKS(NQRUNNABLE) 028D3 0C800000 219 ION 220 * set up PCB information for new queue 028D4 60000415 0 221 LD R0 OURSLOT get our CPU slot number 028D5 E4164801 0 1 BASE 222 ST R0 R1,PCQPARM save as our parm 028D6 60040000 0 IMM 223 LD R0 NQRUNNING get new queue number 028D7 E4085260 0 1 ZBM 224 ST R0 R1,PCQUEUE set our new queue number 225 226 PLOCK SQLOCKS(NQRUNNING) lock the list of running processes 028D8 0CC00000 226 IOFF 028D9 D1C01DBA 226 SETT SQLOCKS(NQRUNNING) 028DA FE0C28DC 226 JNE MA(2+DISPW MA 0) 028DB DC40308B 226 CALLNP LOCKWAIT 028DC 60001DA9 0 227 LD R0 SQRUNNING get pointer to head of list 028DD E4085F10 0 1 ZBM 228 ST R0 R1,PCQLINK put existing queue behind us 028DE E4401DA9 1 229 ST R1 SQRUNNING put us at head of queue 230 PUNLOCK SQLOCKS(NQRUNNING) unlock the queue 028DF EC001DBA 230 STZ SQLOCKS(NQRUNNING) 028E0 0C800000 230 ION 231 028E1 60094116 0 5 ZBM 232 LD R0 R5,PSCURRPROC get current UPC pointer for this user 028E2 E4000414 0 233 ST R0 CPCUPC assign as current UPC for this CPU 028E3 E5400412 5 234 ST R5 CPPSA indicate new current user 028E4 D0001D0B 235 INC BUSYCPUS indicate that another CPU is running 028E5 DC4025C2 236 CALLNP PFLOAD load up this users page file 028E6 6000254E 0 237 LD R0 TSQUANMIN get minimum quantum value 028E7 180940F2 0 5 ZBM 238 ADD R0 R5,PSWSSIZE give bigger guys longer quanta 028E8 E409410B 0 5 ZBM 239 ST R0 R5,PSLASTQUAN and save for billing 028E9 DC0044F8 240 CALL TIMESET set up the quantum for the user 028EA 4309410B 5 ZBM 241 PAR2 R5,PSLASTQUAN pass the time interval 028EB 41400415 242 PARV OURSLOT indicate which processor 028EC 41002B4D 243 PAR SETSWITCH routine to end a quantum 028ED 40534000 5 REG 244 PARVL R5 parm is debugging aid 028EE E517480F 4 5 BASE 245 ST TMR R5,PSQUANTPTR save for eventual TIMEKILL 246 000028EF 247 DISPLIT LABEL 028EF 6089575D 2 5 ZBM 248 LD R2 R5,PSUERROR/RTUERRORZ check for session errors 028F0 FA8C2970 2 249 JNEZ R2 DOPSAERR jump if one exists 000028F1 250 TRYUPC LABEL 028F1 61000414 4 251 LD R4 CPCUPC get current underprocess 028F2 6089175B 2 4 ZBM 252 LD R2 R4,UPCUERROR/RTUERRORZ check for process errors 028F3 FA8C2973 2 253 JNEZ R2 DOUPCERR jump if one exists 000028F4 254 REDISP LABEL 028F4 01095F10 5 ZBM 255 LDCA R5,PSCACHN run this user 256 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 455 (DISPATCH) F 28 Dispatcher 257 000028F5 258 PROCFL LABEL 028F5 FA02292A 0 259 JEQZ R0 DOFREEZE handle freeze request 028F6 70520000 1 0 REG 260 LDN R1 R0 get -( the bit number ) 028F7 6062257D 1 1 261 LD R1 BITTAB(31)(R1) get a clearing mask 028F8 A8401CF6 1 262 BRSBM R1 FLAGS clear the bit that got us here 028F9 FE0228B7 263 JEQ DISPATCH jump back if someone else got it 028FA 5CA028FB 0 264 LDPC FLAGJTB(R0) go visit the proper routine 265 * --- 266 000028FB 267 FLAGJTB LABEL 268 BASE 028FB 0000292A 269 FLFREEZE ADR DOFREEZE freeze system - must be flag number zero 028FC 000028B7 270 ADR DISPATCH improper bit, no corresponding routine 028FD 000028B7 271 ADR DISPATCH improper bit, no corresponding routine 028FE 000028B7 272 ADR DISPATCH improper bit, no corresponding routine 028FF 000028B7 273 ADR DISPATCH improper bit, no corresponding routine 02900 000028B7 274 ADR DISPATCH improper bit, no corresponding routine 02901 000028B7 275 ADR DISPATCH improper bit, no corresponding routine 02902 000028B7 276 ADR DISPATCH improper bit, no corresponding routine 02903 000028B7 277 ADR DISPATCH improper bit, no corresponding routine 02904 000028B7 278 ADR DISPATCH improper bit, no corresponding routine 02905 000028B7 279 ADR DISPATCH improper bit, no corresponding routine 02906 000028B7 280 ADR DISPATCH improper bit, no corresponding routine 02907 000028B7 281 ADR DISPATCH improper bit, no corresponding routine 02908 000028B7 282 ADR DISPATCH improper bit, no corresponding routine 02909 000028B7 283 ADR DISPATCH improper bit, no corresponding routine 0290A 000028B7 284 ADR DISPATCH improper bit, no corresponding routine 0290B 000028B7 285 ADR DISPATCH improper bit, no corresponding routine 0290C 000028B7 286 ADR DISPATCH improper bit, no corresponding routine 0290D 000028B7 287 ADR DISPATCH improper bit, no corresponding routine 0290E 00002953 288 FLSTOPCPU ADR DOSTOPCPU stop a CPU from running 0290F 00002931 289 FLPCPU ADR DOCPUPATCH reload CPU microcode patches 02910 00002AFB 290 FLDISMNT ADR DODISMNT dismount maintenance mounted volume 02911 00002AFD 291 FLACCTNG ADR DOACCTNG start the accounting process 02912 00002AFF 292 FLFREEFL ADR DOFREEFL start the free file process 02913 00002B02 293 FLADT ADR DOADT start the ADT process 02914 00002B04 294 FLERRLOG ADR DOERRLOG start the error log process 02915 00004184 295 FLMTPROC ADR MTPROC start MT/CT 02916 00002928 296 FLMONITOR ADR DOMONITOR start the histogram data gatherer 02917 0000292C 297 FLSSURST ADR DOSSURST no clock - reset SSU 02918 0000291B 298 FLFSX ADR DOFSX adjust free storage expansion/contraction 02919 0000291D 299 FLCHKSUM ADR DOCHKSUM re-calculate the resident system checksums 0291A 0000396B 300 FLMSPROC ADR MSPROC start the mass storage driver 301 DRCT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 456 (DISPATCH) F 28 Dispatcher 303 304 ********************************************************************************** 305 * * 306 * FREE STORAGE EXPANSION/CONTRACTION * 307 * The free storage routines have added or used a * 308 * whole page of free storage. We come here to adjust * 309 * the number of whole pages by moving them into or from * 310 * the idle page list. * 311 * * 312 ********************************************************************************** 313 0000291B 314 DOFSX LABEL 0291B DC402B0E 315 CALLNP FSXPAND adjust pages on the wholepage list 0291C FE0E28B7 316 JMP DISPATCH 317 * --- 318 319 ********************************************************************************** 320 * * 321 * Regenerate checksums of the resident system for memory * 322 * error recovery. * 323 * * 324 ********************************************************************************** 325 0000291D 326 DOCHKSUM LABEL 0291D 60842400 2 IMM 327 LD R2 RESIDENT get address of first page 328 * \ / 329 0000291E 330 CKSUMLOOP1 LABEL 0291E 60040000 0 IMM 331 LD R0 0 initialize checksum 0291F 604403FF 1 IMM 332 LD R1 WPP-1 loop index 333 * \ / 334 00002920 335 CKSUMLOOP2 LABEL 02920 741C8800 0 21 BASE 336 XOR R0 R2,0(R1) xor in the next word 02921 FA662920 1 337 JDR R1 CKSUMLOOP2 generate a checksum in R0 02922 604A9E70 1 2 CBM 338 LD R1 R2/FLDPAGE R1 = page number 02923 E4221CC1 0 1 339 ST R0 MEMCKSUM(R1-RESIDENT/FLDPAGE) save checksum for this page 02924 18840400 2 IMM 340 ADD R2 WPP advance to next whole page 02925 6484AD51 2 IMM 341 CPR R2 ENDOFRES are we done with the resident system? 02926 FE08291E 342 JLT CKSUMLOOP1 jump if another page to do 02927 FE0E28B7 343 JMP DISPATCH else go do some useful work 344 * --- 345 346 ********************************************************************************** 347 * * 348 * Routine to set up the performance monitoring process. * 349 * * 350 ********************************************************************************** 351 00002928 352 DOMONITOR LABEL 02928 DC403870 353 CALLNP MONITRPROC call for performance monitor 02929 FE0E28B7 354 JMP DISPATCH 355 * --- 356 357 ********************************************************************************** 358 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 457 (DISPATCH) F 28 Dispatcher 359 * Someone wants to freeze the system so that he can * 360 * do all sorts of strange and wonderous things without * 361 * worrying about locks. Wait for him to finish perpetrating * 362 * his dastardly deeds. * 363 * * 364 ********************************************************************************** 365 0000292A 366 DOFREEZE LABEL 0292A DC402D9A 367 CALLNP FREEZEWAIT call routine to do the wait 0292B FE0E28B7 368 JMP DISPATCH holiday's over, go back to work 369 * --- 370 371 ********************************************************************************** 372 * * 373 * The clock doesn't seem to be interrupting. Do * 374 * a reset on the SSU and hope for the best. * 375 * * 376 ********************************************************************************** 377 0000292C 378 DOSSURST LABEL 0292C DC005048 379 CALL ERRORLOG call for an error log entry 0292D 41440611 IMM 380 PARV ERLCSSUTO indicate what kind of error 0292E 40401EDE 381 PARVL CLOCKPF indicate where the device is 0292F DC4044C9 382 CALLNP SSU_RESET call for re-initialization of SSU 02930 FE0E28B7 383 JMP DISPATCH 384 * --- 385 386 ********************************************************************************** 387 * * 388 * Power up happened (or we just booted). Set up * 389 * processes to load CPU microcode patches. * 390 * * 391 ********************************************************************************** 392 00002931 393 DOCPUPATCH LABEL 02931 5C001DA1 394 CMZ PATCHLIST any patches out there? 02932 FE0228B7 395 JEQ DISPATCH skip this if not 396 * \ / 397 02933 61401CF7 5 398 LD R5 CPUCOUNT number of CPUs to do 00002934 399 DOCPULOOP LABEL 02934 602A1CFA 0 5 400 LD R0 CPUSLOTS(R5-1) get a cpu slot number 02935 60201ECE 0 0 401 LD R0 SLOTTABLE(R0) get its WRU0 info 02936 604A1040 1 0 CBM 402 LD R1 R0/WRU0CPUSUB get the CPU type subcode 02937 64440001 1 IMM 403 CPR R1 CPU4 is this a CPU4? 02938 FE0C294F 404 JNE DOCPULEND go to the loop's end if not 02939 600A3080 0 0 CBM 405 LD R0 R0/WRU0MREV pick up the revision of this CPU's u-code 0293A 60401DA1 1 406 LD R1 PATCHLIST point to the list of patches 0293B 3C164000 0 1 CACH 407 LSRCH R0 R1,CPUPREV look for the right revision level 0293C FE0C294F 408 JNE DOCPULEND no patches for this CPU 409 * \ / 410 0293D DC0035D2 411 CALL BLDPROCESS build a process to load this CPU's u-code 0293E 4144F1F0 IMM 412 PARV MONMSR MSR for process 0293F 43401DA2 413 PARV2 CPUPROCNAM name of the process 02940 414452B5 IMM 414 PARV ADR PATCHPROC PC to start process at 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 458 (DISPATCH) F 28 Dispatcher 02941 40440001 IMM 415 PARVL 1 this is a system process 416 02942 EDD70801 4 BASE 417 STW R4,PCQPARM give it a very low QIV 02943 EDC91A13 4 ZBM 418 STW R4,PCSPECPROC say we are a special process 02944 602A1CFA 0 5 419 LD R0 CPUSLOTS(R5-1) get our slot number 02945 E408C043 0 3 ZBM 420 ST R0 R3,PSOURCPU so the right CPU runs us 421 422 * We link this process on the head of the runnable queue so that it 423 * will be the first process to run on the designated CPU. 424 PLOCK SQLOCKS(NQRUNNABLE) 02946 0CC00000 424 IOFF 02947 D1C01DBB 424 SETT SQLOCKS(NQRUNNABLE) 02948 FE0C294A 424 JNE MA(2+DISPW MA 0) 02949 DC40308B 424 CALLNP LOCKWAIT 0294A 60001DAA 0 425 LD R0 SQRUNNABLE get first element in runnable queue 0294B E4091F10 0 4 ZBM 426 ST R0 R4,PCQLINK link onto us 0294C E5001DAA 4 427 ST R4 SQRUNNABLE put us on the head of the queue 428 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 0294D EC001DBB 428 STZ SQLOCKS(NQRUNNABLE) 0294E 0C800000 428 ION 0000294F 429 DOCPULEND LABEL 0294F FB622934 5 430 DRJ R5 DOCPULOOP do this for each CPU 431 * \ / 02950 DC0025EB 432 CALL MAPINMEM re-map original caller, if any 02951 40400412 433 PARVL CPPSA pointer to his PSA 02952 FE0E28B7 434 JMP DISPATCH 435 * --- 436 437 ********************************************************************************** 438 * * 439 * A user wants to try running the system with one less * 440 * CPU. Build a process to take a CPU out of service. * 441 * * 442 ********************************************************************************** 443 00002953 444 DOSTOPCPU LABEL 445 PLOCK IDLECPULCK 02953 0CC00000 445 IOFF 02954 D1C01DA4 445 SETT IDLECPULCK 02955 FE0C2957 445 JNE MA(2+DISPW MA 0) 02956 DC40308B 445 CALLNP LOCKWAIT 02957 61401DA5 5 446 LD R5 IDLECPULST R5 -> list of idle CPUs 02958 60040001 0 IMM 447 LD R0 1 what we will look for 02959 3C095010 0 5 ZBM 448 LSRCH R0 R5,ICNOTBUILT scan for an unbuilt CPU stop process 0295A FE0C2968 449 JNE ALLBUILT jump if they have all been built 0295B EC095010 5 ZBM 450 STZ R5,ICNOTBUILT say we have built this process 451 PUNLOCK IDLECPULCK 0295C EC001DA4 451 STZ IDLECPULCK 0295D 0C800000 451 ION 0295E DC0035D2 452 CALL BLDPROCESS build a process 0295F 4144F1F0 IMM 453 PARV MONMSR make it a monitor process 02960 43401DA7 454 PARV2 IDLENAME 02961 414452CC IMM 455 PARV ADR REMOVECPU where it should start 02962 40440001 IMM 456 PARVL 1 system process 02963 EDC91A13 4 ZBM 457 STW R4,PCSPECPROC say we are a special process 02964 60094840 0 5 ZBM 458 LD R0 R5,ICSLOT pick up the slot number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 459 (DISPATCH) F 28 Dispatcher 02965 E408C043 0 3 ZBM 459 ST R0 R3,PSOURCPU put in the PSA 02966 DC402B99 460 CALLNP SETRUNNING into the runnable queue 02967 FE0E2953 461 JMP DOSTOPCPU see if there is another CPU to stop 462 * --- 463 00002968 464 ALLBUILT LABEL 465 PUNLOCK IDLECPULCK 02968 EC001DA4 465 STZ IDLECPULCK 02969 0C800000 465 ION 0296A DC0025EB 466 CALL MAPINMEM re-map original caller, if any 0296B 40400412 467 PARVL CPPSA pointer to his PSA 0296C FE0E28B7 468 JMP DISPATCH 469 * --- 470 471 ********************************************************************************** 472 * Routine called at the end of a users quantum. We * 473 * call TESTTRUBL here to ensure that users who have all * 474 * of their working set resident (and therefore are never * 475 * taking a trip through the page fault processor) will * 476 * be made troublemaker if needed. We switch * 477 * this process out using SHUTRUN. This is done * 478 * even if there is no other user ready to run so that * 479 * page ages can be properly kept (among other things). * 480 * must come here with the interrupts off * 481 ********************************************************************************** 482 0000296D 483 SWITCH LABEL 0296D DC402BF3 484 CALLNP TESTTRUBL check for this guy a trouble maker 0296E DC402B88 485 CALLNP SHUTRUN shutdown this user and place back in runnable queue 0296F FE0E28B7 486 JMP DISPATCH done with this job 487 * --- 488 489 ********************************************************************************** 490 * An execution error has occurred. We classify the error * 491 * and set up the process to run the appropriate error handler * 492 * (either back to the user error handler, or to Control Mode). * 493 ********************************************************************************** 494 00002970 495 DOPSAERR LABEL 02970 F69A296D 2 496 JBT R2/RTSWITCHB SWITCH jump for process switch 02971 3917480D 4 5 BASE 497 LEA R4 R5,PSUERROR address of session error root 02972 FE0E2974 498 JMP DOUERR jump in 499 * --- 500 00002973 501 DOUPCERR LABEL 02973 3917080B 4 4 BASE 502 LEA R4 R4,UPCUERROR address of process error root 503 * \ / 504 00002974 505 DOUERR LABEL 02974 60C00414 3 506 LD R3 CPCUPC locate current underprocess 507 PLOCK R5,PSLOCK get access to the PSA lists 02975 0CC00000 507 IOFF 02976 D1D7480C 5 BASE 507 SETT R5,PSLOCK 02977 FE0C2979 507 JNE MA(2+DISPW MA 0) 02978 DC40308B 507 CALLNP LOCKWAIT 02979 60495F10 1 5 ZBM 508 LD R1 R5,PSCACHN get console area pointer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 460 (DISPATCH) F 28 Dispatcher 0297A 5C087611 1 ZBM 509 CMZ R1,CAMSR/MSRIRELOCB is the requester running in monitor state? 0297B FE0229AF 510 JEQ DPRUER jump if error was a user program 0297C F29C2A22 2 511 JBF R2/RTVERYBADB CANTTOUCH back if unable to disturb this process 512 * \ / 513 514 ********************************************************************************** 515 * The error is "verybad" and within the monitor. That * 516 * means virtual memory failure (UINTVMFPE, UINTVMFDE, * 517 * UINTVMFIDS, or UINTMPV). Return to the window error * 518 * routine or to the error routine indicated. If no recovery * 519 * is specified, all we can do is halt. * 520 ********************************************************************************** 521 522 * \ / 0297D 60040001 0 IMM 523 LD R0 1 flag for very bad 0297E 61491F10 5 4 ZBM 524 LD R5 R4,0/FLDADRS => first element 0297F 3C094210 0 5 ZBM 525 LSRCH R0 R5,UERVERYBAD find a very bad error 02980 FE0C29A1 526 JNE NONEVB not found, sweep under rug 02981 DC402AA9 527 CALLNP DELINKUERR excise it 02982 60800412 2 528 LD R2 CPPSA R2 => PSA 529 PUNLOCK R2,PSLOCK no more access to the PSA 02983 EC16880C 2 BASE 529 STZ R2,PSLOCK 02984 0C800000 529 ION 02985 61C89F10 7 2 ZBM 530 LD R7 R2,PSCACHN get pointer to registers 02986 EDC9F011 7 ZBM 531 STW R7,CAMSR/MSRSRELOCB restore store relocation to monitor space 02987 EDC9F211 7 ZBM 532 STW R7,CAMSR/MSRFRELOCB restore fetch relocation to monitor space 02988 EDC9F411 7 ZBM 533 STW R7,CAMSR/MSRPRELOCB restore pointer relocation to monitor space 02989 60C400FB 3 IMM 534 LD PFPTR PNPPLWNDO page map loc where FBI for page is kept 0298A 80D20000 0 REG 535 PFRC R0 unmap that window 0298B 600946A0 0 5 ZBM 536 LD R0 R5,UERCODE get the error code 0298C E417C802 0 7 BASE 537 ST R0 R7,CAR0 error handler finds it in R0 0298D 60174801 0 5 BASE 538 LD R0 R5,UERPARAM the extra parameter (page number) 0298E E417C803 0 7 BASE 539 ST R0 R7,CAR1 is found in R1 540 * \ / 541 542 ********************************************************************************** 543 * Errors that go to monitor routines (ones with verybad * 544 * set) are only virtual memory failure. The extra param is * 545 * the virtual address. We here check to see if it's a window. * 546 * If so, we zap to window error address else we go to the * 547 * general failure address. * 548 ********************************************************************************** 549 550 * R0 = page number (error param) 0298F 60C00414 3 551 LD R3 CPCUPC current process 02990 6096C80E 2 3 BASE 552 LD R2 R3,UPCWVMLIST get pointer to window VM list 02991 F6302993 0 553 JBT R0/MONBIT DISPMVP jump if we should search the window list 02992 6096C80D 2 3 BASE 554 LD R2 R3,UPCVMLIST get pointer to VM list 00002993 555 DISPMVP LABEL 02993 3C168004 0 2 CACH 556 LSRCH R0 R2,VPVPN look for this page 02994 FE0C2999 557 JNE DNOPG jump if page is not mapped 02995 60089F12 0 2 ZBM 558 LD R0 R2,VPERAD get the window error address 02996 FA32299B 0 559 JNZA R0 DSETINTAD fall thru if no window recovery specified 02997 6017C803 0 7 BASE 560 LD R0 R7,CAR1 if the page was monitor . . . 02998 F63029A6 0 561 JBT R0/MONBIT DNOERRADR . . . we can only stop 00002999 562 DNOPG LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 461 (DISPATCH) F 28 Dispatcher 02999 6017C80A 0 7 BASE 563 LD R0 R7,CAINTADR not a window, use general error vector address 0299A FA3029A6 0 564 JZA R0 DNOERRADR jump off to die if no error address specified 0000299B 565 DSETINTAD LABEL 0299B E409DF10 0 7 ZBM 566 ST R0 R7,CAPC that's where we restart 0299C DC002F5D 567 CALL UFREEMEM free the error block 0299D 41440001 IMM 568 PARV UERLOG indicate its length 0299E 40534000 5 REG 569 PARVL R5 and its address 0299F 61400412 5 570 LD R5 CPPSA get pointer to current PSA 029A0 FE0E28F4 571 JMP REDISP go run this process 572 * --- 573 574 ********************************************************************************** 575 * Root says we should find a very bad element, but * 576 * we didn't. Clear up, and try again. * 577 ********************************************************************************** 578 000029A1 579 NONEVB LABEL 029A1 EC091C10 4 ZBM 580 STZ R4,0/RTVERYBADB say no more 029A2 61400412 5 581 LD R5 CPPSA get session 582 PUNLOCK R5,PSLOCK release PSA 029A3 EC17480C 5 BASE 582 STZ R5,PSLOCK 029A4 0C800000 582 ION 029A5 FE0E28EF 583 JMP DISPLIT try again 584 * --- 585 586 ********************************************************************************** 587 * We arrive at this halt whenever the VERYBAD bit was * 588 * set on a user error occurring in monitor code, and the * 589 * process turns out to have no error recovery address. * 590 * The most likely cause is that we had a mass storage error * 591 * while reading a section of the monitor. This is bad news. * 592 ********************************************************************************** 593 000029A6 594 DNOERRADR LABEL 029A6 00080021 595 HALT HALTH0021 mass storage error on required page 596 * --- R7 -> console area, CAR0=error code 597 * CAR1=virtual page number 598 599 ********************************************************************************** 600 * * 601 * The session is being stopped. Put it on SQSTOPWAIT, * 602 * then try to dispatch a different session. * 603 * * 604 ********************************************************************************** 605 000029A7 606 STOPSESS LABEL 029A7 EC09581D 5 ZBM 607 STZ R5,PSUERROR/RTSTOPB clear stop bit for this session 608 PUNLOCK R5,PSLOCK release the lock 029A8 EC17480C 5 BASE 608 STZ R5,PSLOCK 029A9 0C800000 608 ION 029AA 60440000 1 IMM 609 LD R1 0 no parameters for this 029AB 60C41DB8 3 IMM 610 LD R3 ADR SQSTOPWAIT indicate which queue 029AC DC002B58 611 CALL SHUTDOWN shut down the session 029AD 40440000 IMM 612 PARVL 0 no parameter 029AE FE0E28B7 613 JMP DISPATCH see if we can run something else 614 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 462 (DISPATCH) F 28 Dispatcher 615 616 ********************************************************************************** 617 * * 618 * A reason to interrupt a user process is found. * 619 * * 620 ********************************************************************************** 621 622 * R2 = Z part of root word, R3 = CPCUPC, R4 => root word 000029AF 623 DPRUER LABEL 029AF F69829A7 2 624 JBT R2/RTSTOPB STOPSESS session stop requested 029B0 F6962A0B 2 625 JBT R2/RTVMFISRB OUTOFVA jump if to int for user space shortage 029B1 614A9F10 5 2 CBM 626 LD R5 R2/FLDADRS => first element 029B2 F29C29B6 2 627 JBF R2/RTVERYBADB FIRSTERROR jump if nothing major 029B3 60040001 0 IMM 628 LD R0 1 flag for very bad 029B4 3C094210 0 5 ZBM 629 LSRCH R0 R5,UERVERYBAD find a very bad error 029B5 FE0C29A1 630 JNE NONEVB not found, forget 631 * \ / 632 633 * We have an error to look at. 000029B6 634 FIRSTERROR LABEL 029B6 600946A0 0 5 ZBM 635 LD R0 R5,UERCODE get error 029B7 64040025 0 IMM 636 CPR R0 UINTTIMINT timer interrupt? 029B8 FE0C29BA 637 JNE FINDTRAP if not, no special treatment 029B9 EC16C80C 3 BASE 638 STZ R3,UPCINTTIME prevent further time ints 639 * \ / 640 641 * Big decisions! Who wants/gets the interrupt? 000029BA 642 FINDTRAP LABEL 029BA 60800414 2 643 LD R2 CPCUPC pass UPC address 029BB DC002AB3 644 CALL GETTRAPPER anyone out there? 029BC 414946A0 5 ZBM 645 PARV R5,UERCODE pass error code 029BD 40574801 5 BASE 646 PARVL R5,UERPARAM pass error subcode 029BE FE0E2A16 647 JMP NOTRAPS no one wants interrupt 648 * \ / 649 650 ********************************************************************************** 651 * * 652 * UPC in R2 wants interrupt for error. If it is the current * 653 * underprocess, we must ensure that the TCG/TCS in the console * 654 * terminal are set up correctly. If R2 is not the current * 655 * underprocess, we must switch to it. * 656 * * 657 ********************************************************************************** 658 659 * \ / 029BF DC402AA9 660 CALLNP DELINKUERR remove element from list 029C0 60000412 0 661 LD R0 CPPSA session 662 PUNLOCK R0,PSLOCK allow access to error lists 029C1 EC16080C 0 BASE 662 STZ R0,PSLOCK 029C2 0C800000 662 ION 029C3 0140040C 663 LDCAR IVTXREQ new CAR 029C4 DC00284A 664 CALL GRABCA new CA 029C5 4000040C 665 PARL IVTXREQ from XREQ stock 029C6 60089F12 0 2 ZBM 666 LD R0 R2,UPCCONSOLE new guys registers 029C7 64800414 2 667 CPR R2 CPCUPC is trapper the current process? 029C8 FE0229CE 668 JEQ TOCURR if so, no process switch required 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 463 (DISPATCH) F 28 Dispatcher 029C9 EC08001B 0 ZBM 669 STZ R0,CAINTENABL turn off his ints 029CA DC003330 670 CALL OVPDOWNONE make R2 into CPCUPC, R3 has old 029CB 40528000 2 REG 671 PARVL R2 pass UPC address 029CC FEC00000 672 NOP 0 how could we miss? 029CD FE0E29D4 673 JMP GIVEINT sock it to him 674 * --- 675 676 * int to CPCUPC (in R2), ensure TCG/TCS 677 * R0 = trappers CA, R3 = errant UPC, R5 = error element 000029CE 678 TOCURR LABEL 029CE EC08001B 0 ZBM 679 STZ R0,CAINTENABL turn off his ints 029CF 61D2C000 7 3 REG 680 LD R7 R3 copy UPC to safe reg 029D0 60D6080B 3 0 BASE 681 LD R3 R0,CAINTMASK for call 029D1 DC40343C 682 CALLNP CHECKNOINT dump regenerable errors now to be held off 029D2 60D3C000 3 7 REG 683 LD R3 R7 restore reg 029D3 DC40337E 684 CALLNP MOVETRMGX play with absio 685 * \ / 686 687 ********************************************************************************** 688 * * 689 * Give CPCUPC an interrupt. A section of this is executed * 690 * in a "virtual" environment to allow page faults trying * 691 * to get to the user's interrupt register buffer. * 692 * * 693 ********************************************************************************** 694 695 * \ / 696 * R3 => errant UPC, R5 => error element 000029D4 697 GIVEINT LABEL 029D4 60574801 1 5 BASE 698 LD R1 R5,UERPARAM get subcode 029D5 FA4229DA 1 699 JEQZ R1 GETVIRTUAL no subcode, no check 029D6 DC0034EA 700 CALL CHKINTCODE maybe convert subcode 029D7 41400412 701 PARV CPPSA pass session 029D8 404946A0 5 ZBM 702 PARVL R5,UERCODE and interrupt code 029D9 E4574801 1 5 BASE 703 ST R1 R5,UERPARAM save away real subcode 000029DA 704 GETVIRTUAL LABEL 029DA 59C4F000 IMM 705 IORMSR INTSON turn on the interrupts 706 SETSP set our stack pointer 029DB 81538000 6 REG 706 STCAR SP 029DC 6197880D 6 6 BASE 706 LD SP SP,CASTACKPTR 029DD 61979020 6 6 REG 706 LD SP SP+(2 POWER STAKLOG) 029DE 61C8D371 7 3 ZBM 707 LD R7 R3,UPCSERNM PSN of errant 029DF 60C00412 3 708 LD R3 CPPSA session 029E0 60C8DF11 3 3 ZBM 709 LD R3 R3,PSCACHNP1 => registers of error handling UPC 029E1 6116C80A 4 3 BASE 710 LD R4 R3,CAINTADR => interrupt vector 029E2 DC005BCF 711 CALL SETMEMTRAP enable recovery from bad user error 029E3 40002A01 712 PARL UERRBMEM pass recovery address 029E4 5C08F611 3 ZBM 713 CMZ R3,CAMSR/MSRIRELOCB is UPC in monitor code? 029E5 FE0C29E7 714 JNE MONZA jump if so 029E6 59840040 IMM 715 CLBMSR MSRFRELOC select user space for data fetch 000029E7 716 MONZA LABEL 717 * \ / 718 719 * First instructions to access user memory, could get 720 * memory hardware error (e.g. bad parity), but not 721 * UINTVMIDS or limit errors since page should already 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 464 (DISPATCH) F 28 Dispatcher 722 * have a disk block (from the CODE file). 029E7 60570801 1 4 BASE 723 LD R1 R4,1 R1=new PC 029E8 60891F10 2 4 ZBM 724 LD R2 R4,0/FLDADRS R2=>place for the registers 029E9 59C40040 IMM 725 IORMSR MSRFRELOC restore monitor data fetch 029EA E048DF10 1 3 ZBM 726 EXCH R1 R3,CAPC exchange old PC with new 727 * CMZ R3,CAMSR/MSRIRELOCB again check relocation 029EB FE0C29ED 728 JNE MONTVERNIN jump if UPC in monitor 029EC 59840080 IMM 729 CLBMSR MSRSRELOC select user space data store 000029ED 730 MONTVERNIN LABEL 731 * \ / 732 733 * Look out! First instructions that touch user's buffer page. 029ED E4568808 1 2 BASE 734 ST R1 R2,DISPPC save the old PC in user's memory 029EE 6048C0F0 1 3 ZBM 735 LD R1 R3,CAPSR get user's status 029EF 6008C081 0 3 ZBM 736 LD R0 R3,CAMSR/MSRRSTRT get the instruction restart code 029F0 E40A4080 0 1 CBM 737 ST R0 R1/CH0 save it with the PSR 029F1 E4568809 1 2 BASE 738 ST R1 R2,DISPPSR save the PSR in the user's memory 029F2 60440020 1 IMM 739 LD R1 8*CPW there are 8 general registers 029F3 3816C802 0 3 BASE 740 LEA R0 R3,CAR0 make source address 029F4 FE400000 741 CMOVE move the registers into the user's memory 029F5 59C40080 IMM 742 IORMSR MSRSRELOC back to monitor storing 029F6 DC405BD4 743 CALLNP CLRMEMTRAP relinquish error handling 029F7 EC08C0F0 3 ZBM 744 STZ R3,CAPSR no PSR bits in interrupt routine 029F8 E5D6C803 7 3 BASE 745 ST R7 R3,CAR1 R1 := errant underprocess PSN 029F9 600946A0 0 5 ZBM 746 LD R0 R5,UERCODE fetch interrupt code 029FA E416C804 0 3 BASE 747 ST R0 R3,CAR2 R2 := error code 029FB 60574801 1 5 BASE 748 LD R1 R5,UERPARAM fetch interrupt subcode 029FC E456C805 1 3 BASE 749 ST R1 R3,CAR3 R3 := error parameter 000029FD 750 GOAWAY LABEL 029FD DC002F5D 751 CALL UFREEMEM free the error element 029FE 41440001 IMM 752 PARV UERLOG pass size 029FF 40534000 5 REG 753 PARVL R5 pass address 02A00 FE0E38DF 754 JMP XREQRTNX go run the user, no inc PC 755 * --- 756 757 ********************************************************************************** 758 * * 759 * Memory error handler for our virtual code (GETVIRTUAL). The * 760 * user's memory went bad while we tried to copy his regs to * 761 * his int buffer (memory protect, limit exceed, or full disk). * 762 * The original error will be lost (may well get regenerated * 763 * later on, tho). We must now post a new error. Since we just * 764 * turned off CAINTENABL in CPCUPC, the error (a serious one) * 765 * will PASSUP to an overprocess. Slight problem is that this * 766 * will be hard for the user to figure out, especially since * 767 * our present fellow will probably not get his ints turned back * 768 * on (not unreasonable, since the virt page for his reg buffer * 769 * is screwed up). Anyway, post the new error, free the old * 770 * element, and go try again. Once burned, twice shy. * 771 * * 772 * To make OUR life easier, tho, we halt right now if the * 773 * process has no overprocess. Otherwise the error would just * 774 * go straight to a C1200, where we would have lost all this * 775 * nice information. R0 = code, R1 = subcode for memory error, * 776 * R5 -> original UER element, R3 -> PSCACHNP1 = CM's CA with * 777 * mods up to mem error, R2 -> PSCACHN = our CA in GETVIRTUAL * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 465 (DISPATCH) F 28 Dispatcher 778 * (CAPC may have been set to interrupt handler. If so, * 779 * original could still be in CAR1 of PSCACHN). Of course, * 780 * CM's interrupt buffer is probably still inaccessible, and * 781 * wouldn't have any current info in it anyway. * 782 * * 783 ********************************************************************************** 784 785 * R0 = memory error code, R1 = subcode, R3 -> CPPSA,PSCACHNP1 (the CM CA). 00002A01 786 UERRBMEM LABEL 02A01 60800412 2 787 LD R2 CPPSA PSA of user 02A02 5C089214 2 ZBM 788 CMZ R2,PSCNTLMODE are we in Control Mode? 02A03 FE022A06 789 JEQ PASSON if not, error will take 02A04 60889F10 2 2 ZBM 790 LD R2 R2,PSCACHN R2 -> our CA in GETVIRTUAL 02A05 00031202 791 HALT HALTC1202 error giving int to CM 792 * --- 793 00002A06 794 PASSON LABEL 02A06 62940000 2301 PAIR 795 LD2 R2 PAIR R0 move the error codes 02A07 7C840800 2 IMM 796 IOR R2 VERYBAD mark as disasterous 02A08 DC405BD4 797 CALLNP CLRMEMTRAP relinquish error handling 02A09 DC403589 798 CALLNP UERRSET set the error in the list 02A0A FE0E29FD 799 JMP GOAWAY finish out 800 * --- 801 802 ********************************************************************************** 803 * * 804 * User previously caused attempt to acquire more free storage in * 805 * USERMEM area than was available. We now create and process an * 806 * error element for the problem. This error is to go straight to CM. * 807 * We get here the first time through DISPATCH after the illfated * 808 * memory fetch. This is the only time he gets the interrupt, even * 809 * though he'll probably remain low for many subsequent DISPATCHes * 810 * (i.e. this interrupt indicates the crossing of the threshold, not * 811 * the current low memory state). * 812 * * 813 * This error is processed before we look for "very bad" errors. * 814 * * 815 ********************************************************************************** 816 00002A0B 817 OUTOFVA LABEL 02A0B EC09561D 5 ZBM 818 STZ R5,PSUERROR/RTVMFISRB remove indication of problem 02A0C DC002ED0 819 CALL UGETMEM get a UERR element from SYSTEM memory 02A0D 40440001 IMM 820 PARVL UERLOG log size 02A0E 60441073 1 IMM 821 LD R1 UINTVMFISR+CMERR error to go to CM 02A0F E44800D0 1 0 ZBM 822 ST R1 R0,UERCODEZ save it 02A10 EC160801 0 BASE 823 STZ R0,UERPARAM no subcode 02A11 60495F1D 1 5 ZBM 824 LD R1 R5,PSUERROR/FLDADRS get current list 02A12 E4481F10 1 0 ZBM 825 ST R1 R0,UERLINK tack after us 02A13 E4095F1D 0 5 ZBM 826 ST R0 R5,PSUERROR/FLDADRS set new root 02A14 61520000 5 0 REG 827 LD R5 R0 move pointer to good register 02A15 FE0E29B6 828 JMP FIRSTERROR rejoin code, w/o checking for other errors 829 * --- 830 831 ********************************************************************************** 832 * * 833 * No UPC is specifically trapping the error. If R2 = 0, the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 466 (DISPATCH) F 28 Dispatcher 834 * error is untrappable or is not being trapped. The error goes * 835 * to CM if it is a CM type error ... otherwise it goes to the * 836 * debugger or overprocess. If R2 <> 0, it is the UPC of the * 837 * underprocess that would receive the error, except that it has * 838 * interrupts in general disabled. If it looks like a pretty * 839 * serious error, we give it to the debugger or overprocess as an * 840 * XREQ error. Otherwise, we "hold off" by leaving the element in * 841 * the list for later (this should not happen very much, because * 842 * we don't UERRSET unless we think the guy wants the error at the * 843 * moment). * 844 * We can never give an error to a process that is already in * 845 * an interrupt routine (because the new interrupt would write * 846 * over the interrupt buffer). This is even true of Control Mode. * 847 * It's a little tricky though, because CM receives (traps!) * 848 * the "untrappable" (no IMR bit) errors. We let the CAINTENABL * 849 * bit tell us whether CM is already in an interrupt. If it's * 850 * "off", mild errors are held off, serious errors cause a C1200 * 851 * (PASSUP to nobody). * 852 * * 853 ********************************************************************************** 854 855 * R2 = trapping UPC or 0, R3 = errant UPC 856 * R4 => root, R5 => UER element 00002A16 857 NOTRAPS LABEL 02A16 600946A0 0 5 ZBM 858 LD R0 R5,UERCODE get code 02A17 64040018 0 IMM 859 CPR R0 UINTINST instruction failure of any kind? 02A18 FE0A2A29 860 JLE PASSUP they have to be done 02A19 5C094210 5 ZBM 861 CMZ R5,UERVERYBAD urgent error? 02A1A FE0C2A29 862 JNE PASSUP if so, give it higher 02A1B 6008DF12 0 3 ZBM 863 LD R0 R3,UPCCONSOLE get current CA 02A1C 5C08001B 0 ZBM 864 CMZ R0,CAINTENABL interrupts off? 02A1D EC520000 0 REG 865 STLEQ R0 save answer 02A1E 7808C610 0 3 ZBM 866 AND R0 R3,UPCNTLMODE combine with CM flag 02A1F FA0C2A21 0 867 JNEZ R0 HOLDOFF jump if CM can't process a CMERR now 02A20 FAB02A29 2 868 JZA R2 PASSUP can give error higher if no traps at all 00002A21 869 HOLDOFF LABEL 02A21 FB7629BA 5 870 LJNA R5 FINDTRAP try next error in list 871 * \ / 872 873 * no errors we can give from this list, 874 * try other list if we haven't already 00002A22 875 CANTTOUCH LABEL 02A22 61400412 5 876 LD R5 CPPSA => session 877 PUNLOCK R5,PSLOCK allow access 02A23 EC17480C 5 BASE 877 STZ R5,PSLOCK 02A24 0C800000 877 ION 02A25 3817480D 0 5 BASE 878 LEA R0 R5,PSUERROR => session error root word 02A26 64130000 0 4 REG 879 CPR R0 R4 what we've been using? 02A27 FE0228F1 880 JEQ TRYUPC if so, move to other list 02A28 FE0E28F4 881 JMP REDISP else, give session a go 882 * --- 883 884 ********************************************************************************** 885 * * 886 * Error is to go up the tree. Special CM type errors go right * 887 * up to CM. All others go to the debugger (if any) or to the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 467 (DISPATCH) F 28 Dispatcher 888 * immediate overprocess. The error appears as an XREQ error to * 889 * the URPGO or URPSTEP that got the errant process going the * 890 * last time. Note: CM errors go to CM as an interrupt if CM * 891 * is the current process, otherwise they go as XREQ errors. * 892 * * 893 * A debugger can "re-generate" errors in an underprocess * 894 * using URSENDERR, to let the normal error handling by the * 895 * overprocess take place. Regenerated errors have a flag * 896 * (UERCSKIPDB) to ensure they are not also picked up by the * 897 * debugger! Also, since these errors must skip the debugger * 898 * in the event that the debugger is also the immediate over- * 899 * process, a debugger UPC has an identifying flag (UPCIMDEBUG). * 900 * A simple PSN compare is no good since there may be more than * 901 * one debugger. What a kludge! * 902 * * 903 * * 904 ********************************************************************************** 905 906 * R4 => root, R5 => UER element 00002A29 907 PASSUP LABEL 02A29 DC402AA9 908 CALLNP DELINKUERR loosen tethers on element 02A2A 60000412 0 909 LD R0 CPPSA get session 910 PUNLOCK R0,PSLOCK release grip 02A2B EC16080C 0 BASE 910 STZ R0,PSLOCK 02A2C 0C800000 910 ION 02A2D 0140040C 911 LDCAR IVTXREQ new CAR 02A2E DC00284A 912 CALL GRABCA new CA 02A2F 4000040C 913 PARL IVTXREQ from XREQ stock 02A30 5C094010 5 ZBM 914 CMZ R5,UERCODEZ/CMERRB error to go to CM? 02A31 FE0C2A4F 915 JNE PASS2CM jump if so 916 * \ / 917 02A32 6008DF12 0 3 ZBM 918 LD R0 R3,UPCCONSOLE => current's console area 02A33 EC082C11 0 ZBM 919 STZ R0,CAMSR/MSRTRACEIB kill traces 02A34 5C094410 5 ZBM 920 CMZ R5,UERCSKIPDB error to bypass debugger? 02A35 FE0C2A38 921 JNE INVISPROC jump if so 02A36 6048D378 1 3 ZBM 922 LD R1 R3,UPCERRPSN get debugger PSN 02A37 FA722A60 1 923 JNZA R1 PASS2PROC and give error to him 924 * \ / 925 926 * Either the error is to skip debuggers, or UPCERRPSN = 0, 927 * or no UPC actually exists with UPCERRPSN. Use first 928 * overprocess w/o UPCIMDEBUG set. 00002A38 929 INVISPROC LABEL 02A38 DC40331B 930 CALLNP OVPUPONE make UPCDADPTR into CPCUPC 02A39 FE0E2A70 931 JMP UERRCMMK jump if none such 02A3A 60000414 0 932 LD R0 CPCUPC underprocess 02A3B 5C080E11 0 ZBM 933 CMZ R0,UPCIMDBUG is this a debugger? 02A3C FE0C2A38 934 JNE INVISPROC debuggers invisible on way up 935 * \ / 936 937 ********************************************************************************** 938 * * 939 * We have moved up to the correct overprocess, now * 940 * in CPCUPC. Give an error to the XREQ. * 941 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 468 (DISPATCH) F 28 Dispatcher 942 ********************************************************************************** 943 944 * \ / 945 * R3 => errant UPC, R5 => error element 00002A3D 946 GIVEXREQER LABEL 02A3D 60000412 0 947 LD R0 CPPSA session 02A3E 61081F11 4 0 ZBM 948 LD R4 R0,PSCACHNP1 get registers of error taker 02A3F 600946A0 0 5 ZBM 949 LD R0 R5,UERCODE get code back 02A40 E4170802 0 4 BASE 950 ST R0 R4,CAR0 R0 := error code 02A41 60574801 1 5 BASE 951 LD R1 R5,UERPARAM error subcode 02A42 DC0034EA 952 CALL CHKINTCODE possibly convert it 02A43 41400412 953 PARV CPPSA pass session 02A44 404946A0 5 ZBM 954 PARVL R5,UERCODE pass error code 02A45 E4570803 1 4 BASE 955 ST R1 R4,CAR1 R1 := error subcode 02A46 6008D371 0 3 ZBM 956 LD R0 R3,UPCSERNM more info for trapper 02A47 E4170804 0 4 BASE 957 ST R0 R4,CAR2 R2 := errant underprocess PSN 02A48 D0091F10 4 ZBM 958 INC R4,CAPC bump his PC past XREQ 00002A49 959 UERECOVER LABEL 02A49 DC002F5D 960 CALL UFREEMEM free up the error element 02A4A 41440001 IMM 961 PARV UERLOG pass log size 02A4B 40534000 5 REG 962 PARVL R5 pass address 02A4C DC40285A 963 CALLNP DROPCA make new CPCUPC CA the PSCACHN 02A4D 61400412 5 964 LD R5 CPPSA get session 02A4E FE0E28F4 965 JMP REDISP give it a go 966 * --- 967 968 * error is a CM special 00002A4F 969 PASS2CM LABEL 02A4F 60800412 2 970 LD R2 CPPSA get session 02A50 60889F15 2 2 ZBM 971 LD R2 R2,PSPROCLIST => CM's UPC 02A51 60089F12 0 2 ZBM 972 LD R0 R2,UPCCONSOLE => CA 02A52 64800414 2 973 CPR R2 CPCUPC is CM running? 02A53 FE0229CE 974 JEQ TOCURR if so, give as interrupt 02A54 DC003330 975 CALL OVPDOWNONE else, just go there 02A55 40528000 2 REG 976 PARVL R2 pass UPC address 02A56 FEC00000 977 NOP 0 how could we miss? 02A57 FE0E2A3D 978 JMP GIVEXREQER give as XREQ error 979 * --- 980 981 ********************************************************************************** 982 * * 983 * No over program, and not an initial entry. * 984 * Check to see if control mode failure * 985 * * 986 ********************************************************************************** 987 00002A58 988 UERRNINIT LABEL 02A58 60000414 0 989 LD R0 CPCUPC get pointer to current UPC 02A59 5C080610 0 ZBM 990 CMZ R0,UPCNTLMODE are we in control mode already? 02A5A FE022A5F 991 JEQ UERRNCM jump if not 02A5B 60000412 0 992 LD R0 CPPSA get pointer to PSA 02A5C 60881F11 2 0 ZBM 993 LD R2 R0,PSCACHNP1 point R2 to the registers 994 * \ / 995 996 ********************************************************************************** 997 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 469 (DISPATCH) F 28 Dispatcher 998 * We come here for serious problems affecting control mode. * 999 * R0 points to the users PSA, R1 contains the error code that * 1000 * we were trying to inflict, and R2 points to the console * 1001 * area for control mode. * 1002 * The major types of things that seem to come here are the * 1003 * following... * 1004 * 1) virtual memory failure. Check for out of disk space. * 1005 * Check for memory parity errors. Check for read errors * 1006 * in the file System.!!!:Cm.Code (or ExpCm, or OldCm). * 1007 * 2) a user may have found a bug in CM. Examine the registers * 1008 * and the relevant code in CM to see if this is the case. * 1009 * * 1010 * In order to restart the system, you must be able to fix * 1011 * the registers (pointed to by R2) so that control mode will not * 1012 * encounter a repeat of the problem. If this is possible, you * 1013 * may continue from here (GO). * 1014 * Please note that a crashdump will quite often not contain * 1015 * enough information to see what control mode was doing, since * 1016 * the virtual memory of CM will not be dumped. * 1017 * * 1018 ********************************************************************************** 1019 1020 * \ / 02A5D 00031200 1021 HALT HALTC1200 stop with code in R1 1022 * \ / 02A5E FE0E2A49 1023 JMP UERECOVER ignore error 1024 * --- 1025 1026 ********************************************************************************** 1027 * * 1028 * Not a control mode error, so it must be the failure of * 1029 * a system support process. For now, do nothing intelligent, * 1030 * but someday do a log, restart, and recover. * 1031 * * 1032 ********************************************************************************** 1033 00002A5F 1034 UERRNCM LABEL 02A5F 00031201 1035 HALT HALTC1201 stop with code in R1 1036 * --- 1037 1038 ********************************************************************************** 1039 * * 1040 * We have a condition where we need to pass this error to * 1041 * someone other than our immediate overprocess. We have the * 1042 * process serial number of the process to pass control to. * 1043 * Our search starts at the very top to make sure we check * 1044 * every possible UPC. If we don't find the process to pass * 1045 * the error we clear the UPCERRPSN field and pass the error * 1046 * to our immediate overprocess. * 1047 * * 1048 ********************************************************************************** 1049 00002A60 1050 PASS2PROC LABEL 02A60 60800412 2 1051 LD R2 CPPSA pointer to the current PSA 02A61 DC008805 1052 CALL SRCHPSNM look for the process to pass the error up to 02A62 41524000 1 REG 1053 PARV R1 process serial number we need to find 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 470 (DISPATCH) F 28 Dispatcher 02A63 40489F15 2 ZBM 1054 PARVL R2,PSPROCLIST start at the top 02A64 6012C000 0 3 REG 1055 LD R0 R3 make room in R3 02A65 60C00414 3 1056 LD R3 CPCUPC restore R3 02A66 FA302A6B 0 1057 JZA R0 CLRERRPROC clear the error process serial number field 02A67 DC003330 1058 CALL OVPDOWNONE move up in the process tree 02A68 40520000 0 REG 1059 PARVL R0 pass UPC address from search 02A69 FEC00000 1060 NOP 0 how can we miss? 02A6A FE0E2A3D 1061 JMP GIVEXREQER found the guy to take care of matters 1062 * --- 1063 00002A6B 1064 CLRERRPROC LABEL 02A6B 60000414 0 1065 LD R0 CPCUPC get the current UPC pointer 02A6C EC081378 0 ZBM 1066 STZ R0,UPCERRPSN our error handler has disappeared 02A6D FE0E2A38 1067 JMP INVISPROC move to another overprocess 1068 * --- 1069 1070 ********************************************************************************** 1071 * * 1072 * An error is being passed to a higher program level and that * 1073 * upper level does not exist. If the reason entry is for the * 1074 * initial job creation, then we place a control mode in its * 1075 * place. * 1076 * Break (and possibly other errors such as operator * 1077 * termination) may come here if CM hasn't had a chance to * 1078 * set up trap processing yet (the first few milliseconds * 1079 * after it is created). * 1080 * Anything else is an error. * 1081 * * 1082 ********************************************************************************** 1083 02A6E 53413FF9 1084 RADCM PAK12 CONTROL_MODE 1085 00002A70 1086 UERRCMMK LABEL 02A70 604946A0 1 5 ZBM 1087 LD R1 R5,UERCODE get the code for the error 02A71 64440020 1 IMM 1088 CPR R1 UINTBREAK check for a break request 02A72 FE022A49 1089 JEQ UERECOVER jump if CM hasn't yet set up trap processing 02A73 6444007F 1 IMM 1090 CPR R1 UINTLOGIN check for initial entry 02A74 FE0C2A58 1091 JNE UERRNINIT jump if not 1092 * \ / 1093 1094 * make a copy of the control mode virtual memory list 02A75 60C01ECC 3 1095 LD R3 CMODEVP points to CM virtual memory list 02A76 61040000 4 IMM 1096 LD R4 0 R4 will point to the list we build 00002A77 1097 UERRCMVPP LABEL 02A77 DC002F0A 1098 CALL VGETMEM fetch a new VP element 02A78 40440002 IMM 1099 PARVL VPLOG indicate its length 1100 02A79 60840003 2 IMM 1101 LD R2 VPAGELNTH-1 get length of element 00002A7A 1102 UERRCMVP LABEL 02A7A 605CD000 1 32 BASE 1103 LD R1 R3,0(R2) get the original data 02A7B E45C1000 1 02 BASE 1104 ST R1 R0,0(R2) build a copy of the VM element 02A7C FAA62A7A 2 1105 JDR R2 UERRCMVP loop for its length 1106 * \ / 1107 02A7D E5081F10 4 0 ZBM 1108 ST R4 R0,VPLINK place it at the end of the created list 02A7E 61120000 4 0 REG 1109 LD R4 R0 we now point to this element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 471 (DISPATCH) F 28 Dispatcher 02A7F FAF62A77 3 1110 LJNA R3 UERRCMVPP traverse original list until all copied 1111 * \ / 1112 02A80 60000414 0 1113 LD R0 CPCUPC get the current UPC pointer 02A81 E516080D 4 0 BASE 1114 ST R4 R0,UPCVMLIST the list we built is the VM list 1115 1116 * set process name and CM identifier 02A82 62402A6E 12 1117 LD2 R1 RADCM name of Control Mode 02A83 E6560809 120 BASE 1118 ST2 R1 R0,UPCPROCNM set initial process name 02A84 EDC80610 0 ZBM 1119 STW R0,UPCNTLMODE say we are in Control Mode 1120 1121 * flag session as "in Control Mode" 02A85 60C00412 3 1122 LD R3 CPPSA get pointer to PSA 02A86 EDC8D214 3 ZBM 1123 STW R3,PSCNTLMODE non-virtual CM semaphore 1124 1125 * set up the console area from CCB prototype 02A87 6088DF11 2 3 ZBM 1126 LD R2 R3,PSCACHNP1 get pointer to CA 02A88 60001ECD 0 1127 LD R0 CMODECA get prototype CA for CM 02A89 60481F10 1 0 ZBM 1128 LD R1 R0,CAPC get address of control mode start 02A8A 10440001 1 IMM 1129 SUB R1 1 account for XREQRETURN increment 02A8B E4489F10 1 2 ZBM 1130 ST R1 R2,CAPC set start address 1131 02A8C 38160802 0 0 BASE 1132 LEA R0 R0,CAR0 get first of user registers 02A8D 60440028 1 IMM 1133 LD R1 CANUMUREGS*CPW get total size thereof 02A8E 38968802 2 2 BASE 1134 LEA R2 R2,CAR0 get destination in fetal CMs CA 02A8F FE400000 1135 CMOVE transfer our knowledge 1136 1137 * log the logon, if appropriate 02A90 6108DF13 4 3 ZBM 1138 LD ULB R3,PSUSERLIMP ULB => logged on account 02A91 65001EAE 4 1139 CPR ULB SYSTEMULB are we logged on 02A92 FE022AA2 1140 JEQ NOTLOGGED jump if not 02A93 604949C1 1 5 ZBM 1141 LD R1 R5,UERPARAM/CMENTRYCD get entry code 02A94 64440004 1 IMM 1142 CPR R1 CMCONCP concurrent process creation? 02A95 FE022AA4 1143 JEQ ACCTCONC jump if so 1144 * \ / 02A96 DC00505F 1145 CALL ACCOUNT log the logon 02A97 41440002 IMM 1146 PARV APTON type code 02A98 41440028 IMM 1147 PARV AFRSIZE long record size 02A99 40491A57 4 ZBM 1148 PARVL ULB,ULLOGSPOT place to give logging info to 1149 * \ / 1150 00002A9A 1151 JOINLOGON LABEL 02A9A 60800412 2 1152 LD R2 CPPSA R2 -> PSA of current process 02A9B DC405C0D 1153 CALLNP ACCTPSA put this info into record 02A9C DC405C1E 1154 CALLNP ACCTULB in goes the ULB stuff 02A9D DC405025 1155 CALLNP ACCTQUE send it to be queued 1156 * \ / 1157 02A9E 60000412 0 1158 LD R0 CPPSA process status area 02A9F 61081F14 4 0 ZBM 1159 LD ULB R0,PSDFLTDIR ULB => alias account 02AA0 DC005C2A 1160 CALL ACCTALIAS log the alias 02AA1 40440004 IMM 1161 PARVL APTALIAS type code 1162 * \ / 1163 00002AA2 1164 NOTLOGGED LABEL 02AA2 60C00414 3 1165 LD R3 CPCUPC get "UPC having error" 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 472 (DISPATCH) F 28 Dispatcher 02AA3 FE0E2A3D 1166 JMP GIVEXREQER set Control Mode going 1167 * --- 1168 00002AA4 1169 ACCTCONC LABEL 02AA4 DC00505F 1170 CALL ACCOUNT log the logon 02AA5 4144000A IMM 1171 PARV APTCONCP type code 02AA6 4144001C IMM 1172 PARV AFRSHORT short record size 02AA7 40491A57 4 ZBM 1173 PARVL ULB,ULLOGSPOT place to give logging info to 02AA8 FE0E2A9A 1174 JMP JOINLOGON 1175 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 473 (DISPATCH) F 28 Dispatcher 1177 1178 ********************************************************************************** 1179 * * 1180 * DELINKUERR. Remove the given error element from the * 1181 * list of the specified root. Resets RTVERYBADB, as * 1182 * necessary. * 1183 * * 1184 * Call: CPPSA locked! * 1185 * LD R4 * 1186 * LD R5 * 1187 * CALLNP DELINKUERR * 1188 * * 1189 * Eats R0,R1 * 1190 * Stack Usage = 1 * 1191 * * 1192 ********************************************************************************** 1193 1194 BLOCK DELINKUERR subroutine 1195 1196 ENTRY DELINKUERR 1197 1198 BEGFRAME 1199 ENDFRAME 1200 02AA9 DD5F8001 6 STAK 1201 DELINKUERR ENTRNP PUSH 02AAA 60130000 0 4 REG 1202 LD R0 R4 copy of root address 02AAB 3D481F10 5 0 ZBM 1203 LSRCH R5 R0,UERLINK find previous 02AAC 60495F10 1 5 ZBM 1204 LD R1 R5,UERLINK => next 02AAD E4481F10 1 0 ZBM 1205 ST R1 R0,UERLINK delink 02AAE 60091F10 0 4 ZBM 1206 LD R0 R4,0/FLDADRS => first element 02AAF 60440001 1 IMM 1207 LD R1 1 flag for bad 02AB0 3C480210 1 0 ZBM 1208 LSRCH R1 R0,UERVERYBAD look for evil 02AB1 EC491C10 4 ZBM 1209 STLEQ R4,0/RTVERYBADB save answer 02AB2 5D1F8001 6 STAK 1210 LEAVE POP return 1211 * --- 1212 1213 END DELINKUERR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 474 (DISPATCH) F 28 Dispatcher 1215 1216 ********************************************************************************** 1217 * * 1218 * * 1219 * GETTRAPPER. This routine scans the given UPC and up * 1220 * through its parents to find the first UPC, if any, that * 1221 * is interested in the specified error (i.e. has * 1222 * the corresponding IMR bit turned on). Since the status * 1223 * of "unit interrupt enable" on the absolute I/O terminal * 1224 * can vary from underprocess to underprocess, we must * 1225 * check the controlling UPCNETINTE bit if the error is * 1226 * from such a unit. * 1227 * * 1228 * There are 3 possibilities: * 1229 * * 1230 * 1) No one is trapping the error, or the error * 1231 * is untrappable. * 1232 * 2) A UPC is trapping the error, but has * 1233 * interrupts in general disabled. * 1234 * 3) A UPC is trapping the error, and has * 1235 * interrupts in general enabled. * 1236 * * 1237 * In case 1, we return 0, take normal return. * 1238 * In case 2, we return the trapper's UPC, take the * 1239 * normal return. * 1240 * In case 3, we return the trapper's UPC, take the * 1241 * skip return. * 1242 * * 1243 * Call: LD R2 * 1244 * CALLNP GETTRAPPER * 1245 * PARV error code * 1246 * PARVL subcode * 1247 * JMP * 1248 * * 1249 * * 1250 * Eats R0:R1 * 1251 * Sets R2 * 1252 * Stack usage = 3 * 1253 * * 1254 ********************************************************************************** 1255 1256 BLOCK GETTRAPPER subroutine 1257 1258 ENTRY GETTRAPPER 1259 1260 BEGFRAME 00000010 BYTE 1261 IBIT EQU BIT 0 whether to check unit interrupt enable 00000210 BYTE 1262 UBIT EQU BIT 1 whether to check for unit existence 00178801 6 BASE 1263 ECODE BSS 1 code for error 00178802 6 BASE 1264 SCODE BSS 1 subcode for error 1265 ENDFRAME 1266 02AB3 DD1F8003 6 STAK 1267 GETTRAPPER ENTR PUSH 02AB4 C1578801 6 BASE 1268 STPV SP,ECODE save error code 02AB5 C0578802 6 BASE 1269 STPVL SP,SCODE save subcode 02AB6 60178801 0 6 BASE 1270 LD R0 SP,ECODE get the error code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 475 (DISPATCH) F 28 Dispatcher 02AB7 68040080 0 IMM 1271 UCPR R0 LASTINTC is it in range? 02AB8 FE062ADF 1272 JGE ZRETURN jump if not 02AB9 60702AF5 1 0 @ 1273 LD R1 @INTMASKB(R0) R1 = IMR bit number (see below box) 02ABA FA422ADF 1 1274 JEQZ R1 ZRETURN jump if untrappable 1275 * \ / 1276 1277 ********************************************************************************** 1278 * * 1279 * See whether to check unit int enable. SCCONPTR points to bit array * 1280 * indexed by UINT code yielding whether interrupt subcode is an FCB * 1281 * address (which we convert to unit number). We use it to decide * 1282 * whether int enable applies to the UINT in R0. Not all "unit * 1283 * interrupts" are controlled by int enable (namely, UINTTDISC and * 1284 * UINTCHAIN). The check is valid, however, since we have already * 1285 * ensured that R0 is not a code that can be trapped (with the above * 1286 * @INTMASKB(R0) check). The implication, therefore, is that all * 1287 * trappable ints with an FCB for a subcode are controllable by the * 1288 * unit interrupt enable flag. If this ever changes, the cheap check * 1289 * below will have to be reworked. * 1290 * * 1291 ********************************************************************************** 1292 1293 * \ / 02ABB EC0BC020 7 CBM 1294 STZ R7/(IBIT+UBIT) clear checking flags 02ABC 5C3034E9 0 @ 1295 CMZ @SCCONPTR(R0) cheap check for FCB subcode 02ABD FE022AC8 1296 JEQ LOOKHERE jump if not unit interrupt 02ABE 60178802 0 6 BASE 1297 LD R0 SP,SCODE get FCB address 02ABF 5C082015 0 ZBM 1298 CMZ R0,FCABSIO absolute I/O unit? 02AC0 EC4BC210 7 CBM 1299 STLEQ R7/UBIT save answer 02AC1 FE022AC8 1300 JEQ LOOKHERE jump if not 02AC2 60082665 0 0 ZBM 1301 LD R0 R0,FCHTYPE get type 02AC3 64040007 0 IMM 1302 CPR R0 HTYPETERM terminal I/O? 02AC4 EC4BC010 7 CBM 1303 STLEQ R7/IBIT 1 sez check, 0 sez don't 02AC5 FE0E2AC8 1304 JMP LOOKHERE start looking 1305 * --- 1306 1307 * loop to find an interested UPC 00002AC6 1308 LOOKLOOP LABEL 02AC6 60889F17 2 2 ZBM 1309 LD R2 R2,UPCDADPTR get next one up 02AC7 FAB02AE0 2 1310 JZA R2 RETURN jump if no more to check 1311 * \ / 1312 00002AC8 1313 LOOKHERE LABEL 02AC8 60089F12 0 2 ZBM 1314 LD R0 R2,UPCCONSOLE => console area 02AC9 5C16080A 0 BASE 1315 CMZ R0,CAINTADR have a vector yet? 02ACA FE022AC6 1316 JEQ LOOKLOOP jump if not 02ACB 3808001B 0 0 ZBM 1317 LEA R0 R0,CAINTMASK/BIT 0 R0 => enable bit array 02ACC 5C1A0C00 01 @R 1318 CMZ @R0(R1) type enabled? 02ACD FE022AC6 1319 JEQ LOOKLOOP jump if not 02ACE F7C22AD5 7 1320 JBT R7/UBIT MUSTHAVEIT jump to check for unit 02ACF F3C02AD2 7 1321 JBF R7/IBIT AFTERCK skip INTE check 02AD0 5C089011 2 ZBM 1322 CMZ R2,UPCNETINTE ints allowed on abs I/O? 02AD1 FE022AC6 1323 JEQ LOOKLOOP jump if not 1324 * \ / 1325 1326 * R2 has trapping UPC 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 476 (DISPATCH) F 28 Dispatcher 00002AD2 1327 AFTERCK LABEL 02AD2 5C160400 0 @R 1328 CMZ @R0 interrupts enabled? 02AD3 FE022AE0 1329 JEQ RETURN jump if errors held off for now 1330 * \ / 1331 02AD4 FBE02AE0 7 1332 IRJ R7 RETURN take skip 1333 * --- 1334 1335 ********************************************************************************** 1336 * Error is for a logical unit (FCB address in ECODE). Make * 1337 * sure the UPC in R2 can see this FCB (else, unit is local * 1338 * to another process). We already know FCB is not FCABSIO, * 1339 * so our "found" logic jumps right to AFTERCK without looking * 1340 * at IBIT. * 1341 ********************************************************************************** 1342 00002AD5 1343 MUSTHAVEIT LABEL 02AD5 E0178802 0 6 BASE 1344 EXCH R0 SP,SCODE save pointer, get FCB address 02AD6 60489F15 1 2 ZBM 1345 LD R1 R2,UPCUNITS get local UCE list 02AD7 3C085F11 0 1 ZBM 1346 LSRCH R0 R1,UCEFCB scan it 02AD8 FE022ADD 1347 JEQ HAVEIT jump if found as local unit 02AD9 60400413 1 1348 LD R1 CMAPPSA else, get session 02ADA 60486316 1 1 ZBM 1349 LD R1 R1,PSUNITS to get global UCE list 02ADB 3C085F11 0 1 ZBM 1350 LSRCH R0 R1,UCEFCB scan it 02ADC FE0C2AC6 1351 JNE LOOKLOOP jump if unit inaccessible 00002ADD 1352 HAVEIT LABEL 02ADD 60178802 0 6 BASE 1353 LD R0 SP,SCODE restore pointer 02ADE FE0E2AD2 1354 JMP AFTERCK check other things 1355 * --- 1356 00002ADF 1357 ZRETURN LABEL 02ADF 60840000 2 IMM 1358 LD R2 0 say no UPC at all 00002AE0 1359 RETURN LABEL 02AE0 5D1F8003 6 STAK 1360 LEAVE POP 1361 * --- 1362 END GETTRAPPER subroutine 1363 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 477 (DISPATCH) F 28 Dispatcher 1365 1366 ********************************************************************************** 1367 * * 1368 * Table of bit numbers in the interrupt arming register as * 1369 * indexed by the error code. ZAP (zero) means that the error * 1370 * always is processed. Good for values 0:07F. * 1371 * * 1372 ********************************************************************************** 1373 00000000 ABS 1374 ZAP EQU 0 02AE0 00000000 1375 INTMASKBT VFD 5:ZAP 000 - illegal code, pass up 02AE0 00000001 1376 VFDB 5:CAIMINST 001 - undefined opcode 02AE0 00000001 1377 VFDB 5:CAIMINST 002 - undefined address mode 02AE0 00000001 1378 VFDB 5:CAIMINST 003 - illegal addr. mode for store 02AE0 00000001 1379 VFDB 5:CAIMINST 004 - undefined addr. mode in pointer 02AE0 00000001 1380 VFDB 5:CAIMINST 005 - unassigned error code 02AE1 00000001 1381 VFDB 5:CAIMINST 006 - illegal addr. mode for instruction 02AE1 00000001 1382 VFDB 5:CAIMINST 007 - execute target illegal 02AE1 00000002 1383 VFDB 5:CAIMCALL 008 - CALL/ENTR mismatch 02AE1 00000002 1384 VFDB 5:CAIMCALL 009 - PAR/STP mismatch 02AE1 00000000 1385 VFDB 5:ZAP 00A - ION/IOFF overflow/underflow 02AE1 00000001 1386 VFDB 5:CAIMINST 00B - unimplemented instruction 02AE2 00000004 1387 VFDB 5:CAIMCKBDS 00C - check bounds failure 02AE2 00000003 1388 VFDB 5:CAIMARITH 00D - undefined number or illegal data type 02AE2 00000001 1389 VFDB 5:CAIMINST 00E - stack overflow 02AE2 00000003 1390 VFDB 5:CAIMARITH 00F - decimal overflow 02AE2 00000003 1391 VFDB 5:CAIMARITH 010 - arithmetic overflow 02AE2 00000003 1392 VFDB 5:CAIMARITH 011 - divide by zero 02AE2 00000003 1393 VFDB 5:CAIMARITH 012 - fixing overflow positive 02AE3 00000003 1394 VFDB 5:CAIMARITH 013 - fixing overflow negative 02AE3 00000003 1395 VFDB 5:CAIMARITH 014 - floating overflow negative 02AE3 00000003 1396 VFDB 5:CAIMARITH 015 - floating underflow negative 02AE3 00000003 1397 VFDB 5:CAIMARITH 016 - floating overflow positive 02AE3 00000003 1398 VFDB 5:CAIMARITH 017 - floating underflow positive 02AE3 00000003 1399 VFDB 5:CAIMARITH 018 - reference to undefined number 02AE5 00000000 1400 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 019-01F 02AE5 00000009 1401 VFDB 5:CAIMBREAK,ZAP,CAIMNETERM,CAIMNEPATH 020-023 02AE6 0000000D 1402 VFDB 5:ZAP,CAIMTIME,CAIMMSG,CAIMABORT 024-027 02AE7 00000000 1403 VFDB 5:CAIMGUNIT,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 028-02F 02AE8 00000000 1404 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 030-037 02AEA 00000000 1405 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 038-03F 02AEB 00000000 1406 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 040-047 02AEC 00000000 1407 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 048-04F 02AED 00000000 1408 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 050-057 02AEF 00000000 1409 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 058-05F 02AF0 00000000 1410 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 060-067 02AF1 00000000 1411 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 068-06F 02AF2 00000000 1412 VFDB 5:CAIMVMF,CAIMVMF,CAIMVMF,ZAP 070-073 02AF2 00000000 1413 VFDB 5:CAIMMPV,ZAP,ZAP,ZAP 074-077 02AF4 00000000 1414 VFDB 5:ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP,ZAP 078-07F 1415 BSS 0 00000080 ABS 1416 LASTINTC EQU 080 codes above this are all ZAP 1417 02AF5 01482AE1 1418 INTMASKB PTR INTMASKBT pointer to above table 1419 1420 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 478 (DISPATCH) F 28 Dispatcher 1421 * * 1422 * Table of booleans indicating the association of interrupt * 1423 * codes with either the PSA or the UPC, indexed by error code. * 1424 * 0 means interrupt goes on session, 1 means interrupt goes * 1425 * on process. Good for values 0:07F * 1426 * * 1427 ********************************************************************************** 1428 00000000 ABS 1429 SINT EQU 0 sez error belongs on PSA 00000001 ABS 1430 PINT EQU 1 sez error belongs on UPC 1431 02AF5 00000001 1432 INTASSOCBT VFDB SINT,PINT,PINT,PINT,PINT,SINT,PINT,PINT 000:007 02AF5 00000001 1433 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 008:00F 02AF5 00000001 1434 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 010:017 02AF6 00000001 1435 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 018:01F 02AF6 00000000 1436 VFDB SINT,SINT,SINT,SINT,SINT,SINT,SINT,SINT 020:027 02AF6 00000001 1437 VFDB SINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 028:02F 02AF6 00000001 1438 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 030:037 02AF7 00000001 1439 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 038:03F 02AF7 00000001 1440 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 040:047 02AF7 00000001 1441 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 048:04F 02AF7 00000001 1442 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 050:057 02AF8 00000001 1443 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 058:05F 02AF8 00000001 1444 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 060:067 02AF8 00000001 1445 VFDB PINT,PINT,PINT,PINT,PINT,PINT,PINT,PINT 068:06F 02AF8 00000001 1446 VFDB PINT,PINT,PINT,PINT,PINT,SINT,PINT,PINT 070:077 02AF9 00000000 1447 VFDB PINT,PINT,SINT,PINT,PINT,SINT,PINT,SINT 078:07F 02AFA 00482AF6 1448 INTASSOCB PTR INTASSOCBT mouse pointer to table 1449 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 479 (DISPATCH) F 28 Dispatcher 1451 1452 ********************************************************************************** 1453 * * 1454 * This is where the system process are started. * 1455 * Only one process at a time is started because it takes * 1456 * much less code to do it this way. Basically we call * 1457 * BLDPROCESS to begin, from there the process consumes its * 1458 * respective list of elements (see COREDEFS). All the system * 1459 * processes run until no more work is required of them. * 1460 * * 1461 ********************************************************************************** 1462 00002AFB 1463 DODISMNT LABEL 02AFB 61441D8A 5 IMM 1464 LD R5 ADR DMNTLOCK pointer to the accounting control block 02AFC FE0E2B05 1465 JMP STARTPROC go share some code 1466 * --- 1467 00002AFD 1468 DOACCTNG LABEL 02AFD 61441D99 5 IMM 1469 LD R5 ADR APLOCK pointer to the accounting control block 02AFE FE0E2B05 1470 JMP STARTPROC go share some code 1471 * --- 1472 00002AFF 1473 DOFREEFL LABEL 02AFF D0001D82 1474 INC FFPROCS count another free file process created 02B00 61441D7A 5 IMM 1475 LD R5 ADR FFLOCK pointer to the free filer control block 02B01 FE0E2B05 1476 JMP STARTPROC go share some code 1477 * --- 1478 00002B02 1479 DOADT LABEL 02B02 61441D83 5 IMM 1480 LD R5 ADR PADTLOCK pointer to the ADT control block 02B03 FE0E2B05 1481 JMP STARTPROC go share some code 1482 * --- 1483 00002B04 1484 DOERRLOG LABEL 02B04 61441D91 5 IMM 1485 LD R5 ADR ERRLOGLOCK pointer to the error log control block 1486 * \ / 1487 00002B05 1488 STARTPROC LABEL 02B05 DC0035D2 1489 CALL BLDPROCESS build the process 02B06 4144F1F0 IMM 1490 PARV MONMSR initial MSR value 02B07 43574803 5 BASE 1491 PARV2 R5,FFCPCNAME name of the process 02B08 41574805 5 BASE 1492 PARV R5,FFCPCPC the initial PC value 02B09 40440001 IMM 1493 PARVL 1 indicate a system process 02B0A DC402B99 1494 CALLNP SETRUNNING put it in the runnable queue 1495 * Interrupts had better be off here! 02B0B DC0025EB 1496 CALL MAPINMEM re-map original caller, if any 02B0C 40400412 1497 PARVL CPPSA pointer to his PSA 02B0D FE0E28B7 1498 JMP DISPATCH off to run the next guy 1499 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 480 (DISPATCH) F 28 Dispatcher 1501 1502 ********************************************************************************** 1503 * * 1504 * This routine is called to rebalance the number of * 1505 * pages on the wholepage list. The number of pages we * 1506 * need/release is determined by the FSXCOUNT word. If * 1507 * negative we get pages from the idle list, if positive * 1508 * we return pages to the idle list. BEWARE deadlocks!!! * 1509 * This routine may need to lock the idle list lock * 1510 * (PPIDLOCK). * 1511 * * 1512 * Eats R0:R1, PPL * 1513 * Stack required = 2 * 1514 * 1 + max ( GETIDLE (1), LOCKWAIT (0), PUTIDLE (1) ). * 1515 * * 1516 ********************************************************************************** 1517 1518 BLOCK FSXPAND subroutine 1519 ENTRY FSXPAND 1520 1521 BEGFRAME 1522 ENDFRAME 1523 02B0E DD5F8001 6 STAK 1524 FSXPAND ENTRNP PUSH 1525 * \ / 1526 00002B0F 1527 ADJUSTFSX LABEL 02B0F 5C001C7A 1528 CMZ FSXCOUNT examine the excess count 02B10 FE022B2E 1529 JEQ ADJUSTTAKE jump if on target 02B11 FE082B20 1530 JLT FSXGETIDLE jump if deficient 1531 * \ / 1532 1533 ********************************************************************************** 1534 * * 1535 * We have more pages in the wholepage list than we really * 1536 * need. What we do is take the PPLs off the WHOLEPAGE list and * 1537 * place them onto the PPIDLE list. * 1538 * * 1539 ********************************************************************************** 1540 1541 * \ / 02B12 5C001C79 1542 CMZ WHOLEPAGE check if any pages to free 02B13 FE022B2E 1543 JEQ ADJUSTTAKE jump if someone else got to them 1544 PLOCK WPAGELOCK grab lock to the free storage lists 02B14 0CC00000 1544 IOFF 02B15 D1C01C78 1544 SETT WPAGELOCK 02B16 FE0C2B18 1544 JNE MA(2+DISPW MA 0) 02B17 DC40308B 1544 CALLNP LOCKWAIT 02B18 61001C79 4 1545 LD PPL WHOLEPAGE head pointer of the WHOLEPAGE list 02B19 60091F10 0 4 ZBM 1546 LD R0 PPL,PPLINK get the next PPL in the list 02B1A E4001C79 0 1547 ST R0 WHOLEPAGE remove this one from the list 1548 PUNLOCK WPAGELOCK release lock to the free storage lists 02B1B EC001C78 1548 STZ WPAGELOCK 02B1C 0C800000 1548 ION 02B1D D0401C7A 1549 DEC FSXCOUNT say we removed one page 02B1E DC402D51 1550 CALLNP PUTIDLE put free storage idle page onto idle list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 481 (DISPATCH) F 28 Dispatcher 02B1F FE0E2B0F 1551 JMP ADJUSTFSX back to check for more adjustment 1552 * --- 1553 1554 ********************************************************************************** 1555 * * 1556 * We need more pages in the WHOLEPAGE list. What we do * 1557 * is get one from the IDLE page list and place it onto the * 1558 * WHOLEPAGE list. The free storage managers will use it as * 1559 * needed. * 1560 * If no idle page is available, we just go away. The * 1561 * goody that frees up idle pages checks FSXCOUNT and makes * 1562 * sure that we will run when an idle page becomes available. * 1563 * * 1564 ********************************************************************************** 1565 00002B20 1566 FSXGETIDLE LABEL 02B20 DC402D1C 1567 CALLNP GETIDLE call for an idle page 02B21 FE0E2B32 1568 JMP FSXDONE no more idle pages left 1569 PLOCK WPAGELOCK lock the whole page list 02B22 0CC00000 1569 IOFF 02B23 D1C01C78 1569 SETT WPAGELOCK 02B24 FE0C2B26 1569 JNE MA(2+DISPW MA 0) 02B25 DC40308B 1569 CALLNP LOCKWAIT 02B26 EC170801 4 BASE 1570 STZ PPL,PPBLOCK indicate nothing here anymore 02B27 60001C79 0 1571 LD R0 WHOLEPAGE head pointer to the free whole page list 02B28 E4091F10 0 4 ZBM 1572 ST R0 PPL,PPLINK this guy now points to the first element 02B29 E5001C79 4 1573 ST PPL WHOLEPAGE presto, we are now the head element 1574 PUNLOCK WPAGELOCK release the whole page list 02B2A EC001C78 1574 STZ WPAGELOCK 02B2B 0C800000 1574 ION 02B2C D0001C7A 1575 INC FSXCOUNT indicate we just added a whole page 02B2D FE0E2B0F 1576 JMP ADJUSTFSX go check for further developments 1577 * --- 1578 1579 * Free space expansion is done. See if pages should be taken 1580 * out of service. 00002B2E 1581 ADJUSTTAKE LABEL 02B2E 60001EA3 0 1582 LD R0 TAKENUM how many pages should be out of service 02B2F 64001EA4 0 1583 CPR R0 TAKECOUNT see if that many has been taken 02B30 FE082B33 1584 JLT GIVEBACK to many have been taken, return some 02B31 FE042B3F 1585 JGT TAKEMORE need more pages removed 00002B32 1586 FSXDONE LABEL 00002B32 1587 TAKEDONE LABEL 02B32 5D1F8001 6 STAK 1588 LEAVE POP a job well done 1589 * --- 1590 1591 ********************************************************************************** 1592 * * 1593 * More pages are taken out of service than is desired. * 1594 * Return some of them back to active service. * 1595 * * 1596 ********************************************************************************** 1597 00002B33 1598 GIVEBACK LABEL 1599 PLOCK TAKELOCK grab lock to take list 02B33 0CC00000 1599 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 482 (DISPATCH) F 28 Dispatcher 02B34 D1C01EA1 1599 SETT TAKELOCK 02B35 FE0C2B37 1599 JNE MA(2+DISPW MA 0) 02B36 DC40308B 1599 CALLNP LOCKWAIT 02B37 61001EA2 4 1600 LD PPL TAKELIST head pointer of the TAKE list 02B38 60091F10 0 4 ZBM 1601 LD R0 PPL,PPLINK get the next PPL in the list 02B39 E4001EA2 0 1602 ST R0 TAKELIST remove this one from the list 1603 PUNLOCK TAKELOCK release lock 02B3A EC001EA1 1603 STZ TAKELOCK 02B3B 0C800000 1603 ION 02B3C D0401EA4 1604 DEC TAKECOUNT say we removed one page 02B3D DC402D51 1605 CALLNP PUTIDLE put free storage idle page onto idle list 02B3E FE0E2B2E 1606 JMP ADJUSTTAKE back to check for more adjustment 1607 * --- 1608 1609 ********************************************************************************** 1610 * * 1611 * We want to take some more pages out of system usage. * 1612 * We call GETIDLE to pick up pages and if there are not * 1613 * enough just go away. Next time an idle page is added * 1614 * things get set to return us to here. * 1615 * * 1616 ********************************************************************************** 1617 00002B3F 1618 TAKEMORE LABEL 02B3F DC402D1C 1619 CALLNP GETIDLE call for an idle page 02B40 FE0E2B32 1620 JMP TAKEDONE no more idle pages left 1621 PLOCK TAKELOCK 02B41 0CC00000 1621 IOFF 02B42 D1C01EA1 1621 SETT TAKELOCK 02B43 FE0C2B45 1621 JNE MA(2+DISPW MA 0) 02B44 DC40308B 1621 CALLNP LOCKWAIT 02B45 EC170801 4 BASE 1622 STZ PPL,PPBLOCK indicate nothing here anymore 02B46 60001EA2 0 1623 LD R0 TAKELIST head pointer to the free whole page list 02B47 E4091F10 0 4 ZBM 1624 ST R0 PPL,PPLINK this guy now points to the first element 02B48 E5001EA2 4 1625 ST PPL TAKELIST presto, we are now the head element 1626 PUNLOCK TAKELOCK release the whole page list 02B49 EC001EA1 1626 STZ TAKELOCK 02B4A 0C800000 1626 ION 02B4B D0001EA4 1627 INC TAKECOUNT indicate we just added a whole page 02B4C FE0E2B2E 1628 JMP ADJUSTTAKE go check for further developments 1629 * --- 1630 1631 END FSXPAND subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 483 (DISPATCH) F 28 Dispatcher 1633 1634 ********************************************************************************** 1635 * * 1636 * Routine that is called on a clock interrupt to set * 1637 * process switching. PSLOCK must be held since there are * 1638 * other fields in PSUERROR that are changed by other * 1639 * interrupt routines. * 1640 * * 1641 * CALLNP SETSWITCH * 1642 * * 1643 * Registers Used: R0:R1 * 1644 * Stack required = 1 * 1645 * 1 + max ( LOCKWAIT (0) ). * 1646 * * 1647 ********************************************************************************** 1648 1649 BLOCK SETSWITCH subroutine 1650 ENTRY SETSWITCH 1651 1652 BEGFRAME 1653 ENDFRAME 1654 02B4D DD5F8001 6 STAK 1655 SETSWITCH ENTRNP PUSH 02B4E 60400412 1 1656 LD R1 CPPSA get the current PSA pointer 02B4F FA702B57 1 1657 JZA R1 SETSWXIT if none, do nothing 1658 PLOCK R1,PSLOCK lock for PSUERROR field 02B50 0CC00000 1658 IOFF 02B51 D1D6480C 1 BASE 1658 SETT R1,PSLOCK 02B52 FE0C2B54 1658 JNE MA(2+DISPW MA 0) 02B53 DC40308B 1658 CALLNP LOCKWAIT 02B54 EDC85A1D 1 ZBM 1659 STW R1,PSUERROR/RTSWITCHB set switch bit in PSA 1660 PUNLOCK R1,PSLOCK release lock 02B55 EC16480C 1 BASE 1660 STZ R1,PSLOCK 02B56 0C800000 1660 ION 1661 * \ / 1662 00002B57 1663 SETSWXIT LABEL 02B57 5D1F8001 6 STAK 1664 LEAVE POP 1665 * --- 1666 1667 END SETSWITCH subroutine 1668 1669 END DISPATCHER 54 INPUT SCHED scheduling routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 484 (SCHED) F 29 Scheduler 3 4 BLOCK misc scheduling routines 5 6 ENTRY SETRUNNING routine to start a user 7 ENTRY SHACCT do the shutdown accounting of a process 8 ENTRY SHUTDOWN routine to turn off user, put in wait queue 9 ENTRY SHDEQUE turn off user, don't put anywhere 10 ENTRY SHUTRUN turn off user, but re-insert in SQRUNNABLE 11 ENTRY TICK one second tick 12 ENTRY TESTTRUBL to check for a trouble maker 13 14 15 ********************************************************************************** 16 * * 17 * MEMORY MANAGEMENT * 18 * Memory management is based on the idea that main * 19 * memory is merely a holding area (cache) for mass storage * 20 * blocks. This cache, if a given block is loaded, is used * 21 * exclusively for all access to that block, both read and * 22 * write. Any time that the cache is modified, the system * 23 * notes that the cache block must be re-written before the * 24 * cache page may be re-used. In order to make this work, a * 25 * number of rules must be followed. For example, every * 26 * allocated physical page of main memory must be an image of * 27 * an already assigned MS block. For example, if a user wants * 28 * a zeropage, both a MS block and a main memory block (page) * 29 * will be acquired. The main memory page will be set to * 30 * zeroes and marked as modified. The MS block will be held * 31 * for the swapping area for the memory page. The page fault * 32 * processor will ensure that all accesses will be to the main * 33 * memory page until the swap out has been done. * 34 * * 35 * If many processes are accessing the same MS address, * 36 * whether it is a part of a file or a system table, there * 37 * will be only one copy of the MS block in main memory and * 38 * all users will refer to it. In fact, it is very important * 39 * that there never be two resident copies of the same MS * 40 * block! This means, for example, that the sharing of * 41 * re-entrant code is automatic. (Data structures are locked * 42 * when necessary to avoid having more than one process trying * 43 * to update a common data area. This locking occurs at the * 44 * level of the data structure, not at the level of individual * 45 * blocks.) * 46 * * 47 * An "own copy" facility is provided to allow a normally * 48 * re-entrant page to contain pre-initialized variables. When * 49 * a user process attempts to modify a re-entrant page, we * 50 * check for 'own copy'. If 'own copy' is set, a copy of the * 51 * page is acquired. (We leave this work up to the mass * 52 * storage driver, which may copy the page already resident, * 53 * or reassign the physical page and its data if no other * 54 * process is using it. The mass storage driver gets this job * 55 * because it is also, in effect, the allocator of all idle * 56 * pages.) The copy of the page is set up (by changing PPBLOCK * 57 * and FBIDA) to swap to an MS block acquired as a swapping * 58 * (temporary) block. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 485 (SCHED) F 29 Scheduler 59 * * 60 * DEMAND PAGING * 61 * This system operates strictly on a demand paging * 62 * basis. That is, the only way in which a process may * 63 * request that a page not currently resident be made resident * 64 * is by actually accessing that page for a read or write. * 65 * The process is then suspended until the requested page * 66 * becomes available. * 67 * Allowing a process to specify pre-fetching was not * 68 * even considered due to the working set and multi-process * 69 * concepts governing the design of the system. However, * 70 * there may be some justification to pre-fetching for a user * 71 * just leaving the troublemaker queue. One must compare the * 72 * cost of multiple starts and trips through the page fault * 73 * processor (which ensure that the pages are read in exactly * 74 * the order in which they are needed, reads in only the pages * 75 * really needed, and gets the process running as soon as * 76 * possible) with the cost of just blindly loading the entire * 77 * working set (which avoids any problems with the process * 78 * spending large amounts of time in the MSWAIT queue while a * 79 * lot of memory is tied up in the already loaded pages). * 80 * * 81 * TABLE STRUCTURE - SYSTEM * 82 * The lists that control the allocation of main memory * 83 * are the following: * 84 * * 85 * system wide: idle page list (PPIDLE) * 86 * physical page list (PPAGELIST) * 87 * also, see the mass storage queues * 88 * and the FSPPLIST * 89 * * 90 * During system startup, each physical page of main * 91 * memory that is available for swapping has a physical page * 92 * element (PPL) generated which is placed on the idle list * 93 * when generated. That PPL is never destroyed and always * 94 * represents the same physical page. See the description of * 95 * the PPL. * 96 * * 97 * When a mass storage block is to be read in, the main * 98 * memory page represented by the PPL at the head of the idle * 99 * page list is selected. When the new MS block is read in, * 100 * the PPL indicates where in physical memory the incoming * 101 * data is to go, indicates where the incoming FBI is to go, * 102 * and receives any other information required to manage that * 103 * page as long as it is resident. The PPL is placed into the * 104 * PPAGELIST (The PPAGELIST consists of multiple lists to * 105 * reduce search time. The appropriate list head is chosen by * 106 * hashing on the MS block number) and remains there until it * 107 * is no longer in use. * 108 * * 109 * A PPL representing a clean page that no longer seems to * 110 * be in active use is returned to the idle page list (PPIDLE). * 111 * The physical page still contains a copy of the MS block * 112 * (unless this page represents a mass storage block being * 113 * returned to the pool of free blocks or one with a mass * 114 * storage error) and may be returned to active service (that * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 486 (SCHED) F 29 Scheduler 115 * is, re-entered in the PPAGELIST) if the block that it * 116 * contains is again requested. Otherwise, it will eventually * 117 * work its way to the beginning of the idle list (i.e. become * 118 * the oldest entry) and be used to receive a different MS * 119 * block. * 120 * * 121 * The idle page list (PPIDLE) is not allowed to hold * 122 * dirty (modified) pages. Therefore, if a dirty page is no * 123 * longer required, a Mass Storage Queue (MSQ) element is made * 124 * for that page and the MSQ element is placed into the * 125 * appropriate device's write queue. The page may not be moved * 126 * to PPIDLE until the write is done (the page is clean). * 127 * * 128 * In addition to appearing in PPIDLE or PPAGELIST, a PPL * 129 * for a page currently in the middle of a swap in may be held * 130 * by the mass storage driver. When required mass storage * 131 * transfers are completed, the PPL is deposited in PPIDLE (if * 132 * no user remains who has a request pending for that page) or * 133 * PPAGELIST. * 134 * * 135 * All system tables are built from a pool of available * 136 * space that is managed by the binary buddy system. The * 137 * largest blocks are half pages whole pages are fetched from * 138 * the idle list as needed. When a whole page is fetched, its * 139 * PPL is saved in a list called FSPPLIST. When FREEMEM * 140 * recombines a whole page, it finds its PPL in FSPPLIST and * 141 * returns it to the idle page list. * 142 * * 143 * TABLE STRUCTURE - PROCESS * 144 * The lists that control the allocation of main memory * 145 * are the following: * 146 * * 147 * each process: virtual memory list (UPCVMLIST) * 148 * virtual address space list (UPCVASP) * 149 * working set extension list (UPCWSX) * 150 * * 151 * Each process may use up to 128 virtual pages (plus * 152 * virtual monitor pages plus a few associated with XREQ * 153 * processing). As long as a virtual page has not been * 154 * specified or referenced, it is implicitly a zero page and * 155 * there are no process list elements associated with it. * 156 * Referencing an unspecified page causes a page fault and the * 157 * page fault processor adjusts the lists and puts in a MS * 158 * request for a zero page (a page containing all zero bits). * 159 * Pages may also be specified by explicitly mapping in a * 160 * specific MS block (such as from a code file). * 161 * * 162 * Whenever a page is specified, a virtual page element * 163 * is created. These elements contain control information and * 164 * specify the MS block whose image occupies the specified * 165 * virtual page. All of these elements are kept in the * 166 * virtual memory list pointed to by the UPCVMLIST word in the * 167 * Under Program Control block (UPC). These virtual page * 168 * elements remain until the process is destroyed or until a * 169 * request affecting one or more is encountered. This list, * 170 * then, always contains a map of the users entire current * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 487 (SCHED) F 29 Scheduler 171 * virtual address space. * 172 * * 173 * The UPCVMLIST accounts only for the pages in the users * 174 * virtual address space. A list of similar format, called the * 175 * MONVM list, contains the map of the entire monitor virtual * 176 * address space. This list is shared by all processes. * 177 * * 178 * When a physical page is made available to a process, a * 179 * page access element (PAL) is created and placed into the * 180 * processes virtual address space list (UPCVASP). PALs may * 181 * exist only for a page that is resident and consequently are * 182 * closely associated with a corresponding PPL (the * 183 * association is by MS block number. Hence the requirement * 184 * of only one resident copy of a MS block). Each PAL that is * 185 * created causes a use counter to be incremented in the * 186 * corresponding PPL (different processes may share a page or * 187 * one process may map in the same page multiple times, so a * 188 * counter is used). Destroying a PAL causes the use count in * 189 * the PPL to be decremented. If that use count goes to zero * 190 * and the page is clean, the PPL is moved to PPIDLE. If the * 191 * page was dirty, a write queue element is created for it * 192 * (also incrementing the use count) and the PPL remains in * 193 * the PPAGE list until the write has occurred. A PPL is not * 194 * returned to the idle list until all PALs and write queue * 195 * elements referring to it have been destroyed. * 196 * * 197 * When a process is to be run, its page map is loaded * 198 * from the information in the PALs of the UPCVASP list. When a * 199 * process is shut down, the page usage statistics are recorded * 200 * in the PALs as the page file is unloaded. Also, at the time * 201 * that a user is shut down, the scheduling routines will look * 202 * at this users page ages and the system load and decide * 203 * whether a page has fallen into disuse or not. Pages that * 204 * seem to have left the users working set will have their PALs * 205 * destroyed. * 206 * * 207 * Another possibility that we provide for is that of a * 208 * virtual page having different blocks successively mapped * 209 * into it. A PAL for a page not currently mapped may not * 210 * remain in UPCVASP because it would interfere with the page * 211 * file management. However, we don't want to destroy the PAL * 212 * since it is likely to be mapped back in relatively soon. * 213 * Therefore, we provide a list called the Working Set * 214 * Extension list (UPCWSX) to temporarily hold PALs. * 215 * * 216 * Note that a PAL in a working set extension list cannot * 217 * be used directly. However, its presence there prevents the * 218 * physical page from being discarded in the idle list. This * 219 * causes the pages comprising the working set for that process * 220 * to remain resident. For example, file pages may be quite * 221 * frequently mapped and unmapped from the users address space. * 222 * The UPCWSX supplies a holding buffer for those pages in * 223 * between the processes requests for them. The page fault * 224 * processor searches the UPCWSX list just before it looks in * 225 * the PPAGE list. If an already built PAL is discovered * 226 * there, it is moved into the VASP list (after adjusting the * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 488 (SCHED) F 29 Scheduler 227 * virtual page number, etc). * 228 * * 229 * During shutdown, the scheduler searches both the * 230 * UPCVASP and the UPCWSX lists to remove old PALs. The * 231 * scheduler searches the UPCWSX list first. The threshold * 232 * page age is then recalculated (but using the same formula) * 233 * and the UPCVASP list is searched. This helps preserve the * 234 * (probably) more valuable pages in the UPCVASP list. * 235 * * 236 * Some of the virtual system that moves PALs into the * 237 * UPCWSX list knows that the page has a low probability of * 238 * being used in the near future, but a sufficient probability * 239 * so that just grubbing the page is not justified. These * 240 * callers may insert the PALs pre-aged so that they will not * 241 * spend an excessive amount of time resident. * 242 * * 243 * MEMORY SCHEDULING ALGORITHMS * 244 * GENERAL * 245 * We wish to remove any pages that a user will not use * 246 * again in the near future. Ideally, we compare the cost of * 247 * occupying a page of physical memory until it is needed again * 248 * to the cost of retrieving the page from mass storage. * 249 * Unfortunately, without an operational crystal ball, we don't * 250 * know the future reference string of the processes. However, * 251 * there exists a strong positive correlation between the time * 252 * since last reference and the time to next reference. We * 253 * exploit this in our memory management algorithms with the * 254 * caveat that it is always possible to build pathological * 255 * reference strings. * 256 * * 257 * Our job of determining which physical page to re-use is * 258 * complicated by the possibility of many processes using the * 259 * same page. The only provision for extracting a particular * 260 * physical page is reserved for the parity error processor. * 261 * It involves freezing all of the CPUs, so it is not intended * 262 * for normal use. Instead of trying to identify which * 263 * physical page should be used next, scheduling proceeds from * 264 * the opposite direction. That is, a process is only allowed * 265 * to keep PALs for pages that the scheduler decides the * 266 * process is actually using. * 267 * * 268 * The scheduler makes every effort to destroy unneeded * 269 * PALs. This drives unused physical pages into the idle list. * 270 * Therefore, when the system runs out of idle pages, every * 271 * remaining page is actually in use to one extent or another. * 272 * * 273 * One fairly common (and poor) technique at this point * 274 * has been to further squeeze the active processes by taking * 275 * away still more pages from them. This is folly. The * 276 * scheduler already knows that each process needs all of the * 277 * pages that it has been left with. If any more are taken * 278 * away, they will be required again almost immediately. * 279 * * 280 * Instead, the schedulers action at this point is to pick * 281 * a user (some effort is made to pick the 'most offensive' * 282 * user), take ALL of his pages, and set that user aside for a * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 489 (SCHED) F 29 Scheduler 283 * length of time in the trouble maker queue (SQTROUBLE) where * 284 * he creates no further demand until released. This is * 285 * described in the section called 'trouble makers'. * 286 * * 287 * PARAMETERS * 288 * The scheduler memory management code uses several * 289 * parameters (MMparname). These parameters were determined in * 290 * a relatively objective manner by calculating ratios of * 291 * 'cost' for various operations. For example, the 'cost' of * 292 * leaving a trouble maker resident may be compared with the * 293 * 'cost' of swapping out all of his pages and later swapping * 294 * them back in. Each parameter definition is preceeded by a * 295 * description of how it was derived and the effects of * 296 * altering it. These parameters are not available for * 297 * alteration by the customers! Moderate variations in the * 298 * values of these parameters should have a low influence on * 299 * system operation. (A large effect would indicate a defect in * 300 * the scheduling algorithm). * 301 * * 302 * PAL MANAGEMENT * 303 * The age (time since last reference) of each PAL is * 304 * monitored. The units are 'number of times this process * 305 * switched'. That is, an unreferenced page will age by one * 306 * unit every time that its process is suspended and the page * 307 * file unloaded (such as for page fault, quantum completion, * 308 * and etc.). Notice that this measure is (to the first order) * 309 * independent of the number of users on the system. * 310 * * 311 * Two constants exist for determining when a PAL should * 312 * be destroyed. The first, MMAGE, is the youngest page that * 313 * will ever be removed from a users working set. This * 314 * minimum age is set to avoid thrashing by preventing the * 315 * scheduler from squeezing a process below the minimum * 316 * practical working set. If we run out of IDLE pages, we * 317 * must conclude that we are trying to run too many jobs. The * 318 * second, MMAGEINC/MMAGEINCD, is the additional age allowed * 319 * for each idle page available to the system. This allows * 320 * processes to occupy more physical memory when the demand is * 321 * low. We also allow some credit for dirty idle pages. * 322 * This age determination is done in a routine called * 323 * TAKEOLD. Any PAL with an excessive age is discarded. * 324 * At one time we used MMAGE without the increment iff we * 325 * discovered that there were users present in the SIZEWAIT * 326 * queue. This was found to have some serious problems. We * 327 * would release hundreds of pages when even one process had * 328 * been shut down as troublemaker, causing a severe hitch in * 329 * the operation of the scheduler. * 330 * * 331 * OTHER PAL AGING * 332 * When processes are entered into SQs all pages are aged * 333 * by an amount determined from the SDPARM array. This is so * 334 * that pages are captured as soon as possible when a process * 335 * STARTS its wait for a resource (terminal I/O, etc.). * 336 * All of the queues representing processes not actively * 337 * contending for memory are scanned periodicly and all pages * 338 * present are aged, with the older PALs being destroyed. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 490 (SCHED) F 29 Scheduler 339 * This aging is currently done every two seconds in a * 340 * routine called TICK. The WHICHHUNT routine is called for * 341 * each SQ. The aging value is called MMIDLSPEED. It is added * 342 * to the page ages of every page in the VASP and WSX lists. * 343 * Then the TAKEOLD routine is called to release any PALs that * 344 * have gotten too old. * 345 * The MSWAIT queue is an interesting special case. * 346 * Originally it was not aged, as it seemed counter-productive * 347 * to be removing pages from a user waiting for another page. * 348 * We discovered, however, that the system could deadlock with * 349 * no available pages for a disk read and every other page held * 350 * by a user in MSWAIT. So the MSWAIT queue was aged just like * 351 * any other queue. Then we discovered the convoy phenomenon... * 352 * 80 or more users would be waiting for MS transfers. While * 353 * waiting, all pages would be removed by WHICHHUNT. As soon * 354 * as their transfer came through, they would page fault on one * 355 * of the recently removed pages and return to the end of the * 356 * queue to repeat the cycle forever. The MSWAIT queue is now * 357 * aged at 1/15 the rate of the other queues to prevent this * 358 * problem. * 359 * We have now ensured in TESTTRUBL that we always have * 360 * sufficient IDLE pages, but we recognize that not ready disks * 361 * and other similar problems would always make some aging of * 362 * the MSWAIT queue desirable. * 363 * * 364 * PROCESS MANAGEMENT * 365 * Each process is controlled by a Process Control Block * 366 * (PCB). All PCBs are linked together in the PCONTROL list * 367 * with non-standard links. Additionally, PCBs may appear in * 368 * one of the Scheduler Queues (SQs) with normal links. A PCB * 369 * will appear in the SQRUNNABLE queue if it is waiting only * 370 * for a processor, a PCB will appear in SQMSWAIT if it is * 371 * waiting for a mass storage operation, etc. See the HEADPAGE * 372 * SQ definitions for further information. * 373 * The PCB for a process that is actually being run * 374 * appears in SQRUNNING. However, the CPU that is currently * 375 * running that process is presumed to have an implicit lock * 376 * over most of the variables in the PCB and PSA (and all * 377 * attached lists for that matter). Therefore, other CPUs * 378 * that are concerned with global scheduling operations must * 379 * be cautious in modifying these lists. It is the * 380 * responsibility of the CPU running the process to do all * 381 * updating of the lists in such a manner that the lists can * 382 * be searched at any time without encountering bad links. * 383 * This is so that other CPUs who have need of information do * 384 * not have to co-ordinate their operations with the active * 385 * CPU through locks. It is deemed an unnecessary overhead to * 386 * require locks just for the purpose of information * 387 * gathering. The UERRSET routines must always be able to get * 388 * to the error control word in the PSA. Therefore, PSLOCK * 389 * is provided to lock access for this purpose. * 390 * * 391 * TROUBLE MAKERS * 392 * The TESTTRUBL routine is called for every page fault * 393 * and quantum completion. It normally returns to the caller. * 394 * However, if the system has fewer idle pages than * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 491 (SCHED) F 29 Scheduler 395 * MMIDLETTMIN, then the user is evaluated at this time. Low * 396 * priority jobs are picked first in order to get background * 397 * jobs out of the way of interactive users. When the 'worst' * 398 * user is about to be suspended, his resources (especially * 399 * memory) are taken from him and he is sent to the * 400 * troublemaker queue (jail) where he remains for a while (not * 401 * competing for system resources). * 402 * * 403 * A user is sent to jail if: * 404 * 1) The system has fewer creditable idle pages than this * 405 * users PSPRIORITY value, and, * 406 * 2) He is deemed more offensive than any other * 407 * runnable user. (Special note: If there * 408 * are other RUNNING users, their offensiveness * 409 * cannot be readily calculated because of the * 410 * interlocking that would be required. We * 411 * therefore assume that any other RUNNING * 412 * process is less offensive that the one being * 413 * examined. This is not ideal, but acceptable. * 414 * Remember that this only happens when we run * 415 * out of idle pages.) * 416 * * 417 * A user is given 'points' for offensiveness as follows: * 418 * 1) One point for each page in his working set. * 419 * 2) One point for each page fault in the preceeding * 420 * 100 MS of his cpu time (running average). * 421 * 3) MMPRRATIO for each lower priority level (higher number) * 422 * 4) MMLOCKPARM (a negative parameter) for each * 423 * critical region that this process has locked. * 424 * 5) Points are deducted for the grace that was * 425 * assigned to aid in rehabilitation upon * 426 * release. * 427 * 6) A hysteresis factor to make the user just * 428 * suspended a worse offender (the bird in the * 429 * hand theory. Lets wipe out this guy now * 430 * rather than wait for someone with about * 431 * the same value. Also, another user, only * 432 * slightly worse, may improve so that he does * 433 * not get shut down either because he became * 434 * less of a trouble maker than this guy. This * 435 * would lead to a very unpleasant game of * 436 * ping-pong if not stopped in this manner.) * 437 * * 438 * A user being incarcerated has all of his pages removed * 439 * except any pages that are locked. We ensure that processes * 440 * never have so many pages locked that we'd be dangerously * 441 * hurt by having them held during a jail term. * 442 * A length of time is calculated based on his nuisance * 443 * value and he is placed into the trouble maker queue * 444 * (SQTROUBLE). When he is paroled, he is given a certain * 445 * amount of grace to allow him to recover his working set * 446 * without being branded a recidivist. This grace is a * 447 * function of his nuisance value at the time of his arrest * 448 * (bigger trouble makers [mafiosi] wait longer but are more * 449 * resistant to re-arrest). * 450 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 492 (SCHED) F 29 Scheduler 451 * LOCKING * 452 * On a uni-processor system, updating of some table * 453 * structures must be done with the interrupt system disabled * 454 * because the interrupt routine might also attempt to modify * 455 * the table structures. If this were allowed to happen, the * 456 * table could be completely trashed. Because this system may * 457 * contain multiple processors, locking of critical regions is * 458 * also necessary. This prevents one processor from * 459 * interfering with the table updates of another processor. * 460 * The critical region locks are all associated with the * 461 * access and altering of tables (lists). Because some updates * 462 * require co-ordinated updating of more than one table (list), * 463 * they require more than one lock to be set by that process. * 464 * This suggests the possibility of deadlocking (all processors * 465 * waiting for resources locked by another processor). Several * 466 * algorithms are available to either prevent or detect * 467 * deadlocking. Deadlock detection, in order to be useful, * 468 * must be coupled with a mechanism to back out one of the * 469 * processors. The potential complexity of this caused us to * 470 * not even consider it. Of the algorithms available for * 471 * deadlock prevention, most require extensive computations. * 472 * However, a very simple algorithm requires no calculation * 473 * at all. Deadlock may be prevented by ordering all resources * 474 * to be locked and ensuring that all processes needing * 475 * simultaneous access to more than one resource always acquire * 476 * all resources in the designated order. * 477 * The specified order for certain lists is: * 478 * MSQIN * 479 * any SQ (no process may have more than one locked) * 480 * any PPAGE list (no process may have more than one locked) * 481 * the PPIDLE list * 482 * MSQOUT * 483 * A list may be locked only if all lists following that * 484 * list in this ordering are not locked by the requesting * 485 * process. For example, MSQOUT must be unlocked when any * 486 * locking is tried, PPIDLE and MSQOUT must be unlocked when * 487 * any higher list is needed, etc. * 488 * For the most part, resources not mentioned in the * 489 * about ordering must not be held simultaneously with any * 490 * other resource. * 491 * A processor must never have interrupts enabled while * 492 * it has anything locked! The PLOCK, and PUNLOCK macros are * 493 * provided for locking and unlocking these lists and PLOCK has * 494 * an IOFF to disable the interrupts and PUNLOCK has a * 495 * corresponding ION to restore them. * 496 * Processes locking these lists are responsible for * 497 * avoiding page faults while the lists are locked! * 498 * PSAs are not explicitly locked: rather, the process * 499 * altering the PSA must be the only process holding a pointer * 500 * to that PSA. This is accomplished by just plain removing the * 501 * PCB and PSA pointers from everywhere except CPPSA (available * 502 * to only one CPU) and the PCONTROL list (very restricted * 503 * usage!). * 504 * The page fault processor, mass storage driver, and * 505 * similar routines that move pages from one list to another * 506 * must lock both lists while a physical page element is being * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 493 (SCHED) F 29 Scheduler 507 * moved. This is so that someone searching the lists for a * 508 * particular block will not have that block moved around its * 509 * search, thereby causing a spurious not-found condition. * 510 * An exception to this is a block number change that * 511 * moves a page between two PPAGE lists. The new block number * 512 * cannot be known to any other CPU at the time of a change, so * 513 * no conflict can result. (also, not more than one PPAGE list * 514 * may be simultaneously locked by a process) * 515 * * 516 * "VIRTUAL" CRITICAL REGIONS * 517 * Certain critical regions involve updating on mass * 518 * storage. These critical regions involve a queue where * 519 * users may be shut down if the resource is unavailable. * 520 * This means that a user waiting for this type of resource * 521 * waits quiescently. We try to avoid sending to jail users * 522 * with such resources locked. * 523 * * 524 * LOCKED PAGES * 525 * In order to implement the crashproofing strategies, * 526 * the memory manager allows the virtual system to lock pages * 527 * into resident memory. This is so that partially updated * 528 * tables such as directories don't get swapped back to the * 529 * volume: they would be total garbage in the case of a crash. * 530 * (An alternative is to request a free block and to swap the * 531 * partially updated table to that block. This was not deemed * 532 * reasonable: far better to allocate the system resources to * 533 * completing the update!) * 534 * In order to avoid system deadlock, no process may * 535 * have more than one page locked (except for direct I/O). * 536 * The system must prohibit direct I/O from locking more * 537 * pages than are available. * 538 * * 539 * CPU time scheduling algorithm * 540 * This algorithm attempts to separate the interactive * 541 * users, IOBOUND jobs, and similar short response jobs from * 542 * the real CPU hogs. Just like in memory management, we wish * 543 * for a crystal ball. Also, just like in memory management, * 544 * we survive with recent history only. * 545 * The idea is based on a single runnable queue that we * 546 * sort (that is, we insert each new user into his proper * 547 * sorted location) into order by "queue insertion value" * 548 * (QIV). The QIV is determined by using the ratio of CPU time * 549 * used (with an additional term for MS transfers) to total * 550 * time. This provides low values of QIV to interactive users * 551 * and the like, while a heavily CPU bound user gets a higher * 552 * QIV and therefore defers to those other jobs. We also * 553 * include a term in the QIV to represent the priority of the * 554 * process. * 555 * We prevent starvation by setting a minimum QIV or * 556 * TSBASEVAL for users being inserted into the queue. Once * 557 * in the queue, everyones QIV is decreased periodicly so * 558 * that they are ultimately guaranteed to run. * 559 * * 560 * IMPLEMENTATION * 561 * The following components of the algorithm are in * 562 * place: * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 494 (SCHED) F 29 Scheduler 563 * PFPROC Adds TSMSEQUIV to PSSUMCPU for each call to MSPROC. * 564 * DISPATCH Calculate the QUANTUM to be used for this user. * 565 * SHUTDOWN add the amount of quantum used to PSSUMCPU. Save current * 566 * time in PSSHUTTIME. * 567 * SETRUNNING Add the time difference between now and * 568 * PSSHUTTIME to PSSUMSDT. This tells us the length of * 569 * time that he spent in whatever wait queue he was in. * 570 * Note that the amount of time spent in SQRUNNABLE does * 571 * not enter into this algorithm, so to first order, it * 572 * will be independent of system load. Calculate QIV and * 573 * insert into the queue by order. * 574 * TICK For runnable queue, reduce each PSSUMCPU and PSSUMSDT * 575 * by the TSHISTLOST factor and subtract TSAGEVAL from every * 576 * SDPARM. * 577 * * 578 * Quantum Calculation * 579 * We should like to minimize the amount of wall clock * 580 * time that large users take in order to reduce the * 581 * time.memory product as much as possible. We therefore * 582 * lengthen out the quantum according to the users working * 583 * set size. * 584 * Therefore, once a large user is dispatched, he * 585 * will be run for a significant period of time. When * 586 * he is rescheduled, however, he will go clear to the * 587 * end of the runnable queue and he will have a high * 588 * QIV so that interactive users, even though scheduled * 589 * afterwards, will be run first. * 590 * * 591 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 495 (SCHED) F 29 Scheduler 593 594 ********************************************************************************** 595 * * 596 * SHUTDOWN. Routine to shut down a user and place him * 597 * in the appropriate scheduler queue. * 598 * The PCB is placed into the list at either the beginning * 599 * or end depending upon which queue it is being placed in. * 600 * * 601 * Call: The interrupts MUST be off * 602 * Only MSQIN may be locked when SHUTDOWN * 603 * is called * 604 * Assumes that the page file is still * 605 * loaded for this user * 606 * R3 points to the head word of the queue * 607 * R1 contains the PCQPARM2 * 608 * PSA pointer in CPPSA * 609 * SP = stack pointer * 610 * CALL SHUTDOWN * 611 * PARVL * 612 * OR * 613 * PAR2L NOT PARV2L since this * 614 * destroys PARM2 out of R1 * 615 * * 616 * Eats R0:R4. * 617 * Stack required = 12. * 618 * 3 + max ( LOCKWAIT (0), MAPINMEM (3), MAPOUTMEM (1), * 619 * PFUPCAGE (1), SHACCT (3), SHDEQUE (3), * 620 * TAKEPAGES (9) ) * 621 * * 622 ********************************************************************************** 623 624 BLOCK SHUTDOWN subroutine 625 ENTRY SHUTDOWN 626 627 BEGFRAME 00178801 6 BASE 628 SHUTR5SAV BSS 1 00178802 6 BASE 629 SHUTQSAV BSS 1 queue pointer save 630 ENDFRAME 631 02B58 DD1F8003 6 STAK 632 SHUTDOWN ENTR PUSH 02B59 E4178801 0 6 BASE 633 ST R0 SP,SHUTR5SAV save this register 634 PLOCK SQLOCKS(NQRUNNING) lock the running queue 02B5A 0CC00000 634 IOFF 02B5B D1C01DBA 634 SETT SQLOCKS(NQRUNNING) 02B5C FE0C2B5E 634 JNE MA(2+DISPW MA 0) 02B5D DC40308B 634 CALLNP LOCKWAIT 02B5E 60178801 0 6 BASE 635 LD R0 SP,SHUTR5SAV restore this register (has param) 02B5F E5578801 5 6 BASE 636 ST R5 SP,SHUTR5SAV save the callers R5 02B60 61400412 5 637 LD R5 CPPSA get a pointer to the PSA 02B61 60895F12 2 5 ZBM 638 LD R2 R5,PSPROCCB => process control block 02B62 F3CC2B65 7 639 JBF R7/STPDUBL NOTDUBL jump if single word PAR 02B63 C2568801 2 BASE 640 STPV2L R2,PCQPARM otherwise, save double parameter 02B64 FE0E2B66 641 JMP NOWSHUTHIM 642 * --- 643 00002B65 644 NOTDUBL LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 496 (SCHED) F 29 Scheduler 02B65 C0568801 2 BASE 645 STPVL R2,PCQPARM save the shutdown parameter 00002B66 646 NOWSHUTHIM LABEL 02B66 E4568000 1 2 CACH 647 ST R1 R2,PCQPARM2 save the secondary parameter 02B67 E4D78802 3 6 BASE 648 ST R3 SP,SHUTQSAV save the queue head pointer 02B68 10C41DA9 3 IMM 649 SUB R3 ADR SQBEGIN produce the queue number 02B69 E4C89260 3 2 ZBM 650 ST R3 R2,PCQUEUE indicate which queue we will be in 02B6A DC402BBD 651 CALLNP SHDEQUE call to switch out 02B6B DC0025EB 652 CALL MAPINMEM map in this users virtual free memory lists 02B6C 40534000 5 REG 653 PARVL R5 pointer to the PSA 02B6D 60089260 0 2 ZBM 654 LD R0 R2,PCQUEUE retrieve the number of the new queue 02B6E 60301DD6 0 0 @ 655 LD R0 @PSDPARM(R0) get the aging value 656 02B6F DC4025B6 657 CALLNP PFUPCAGE call to distribute aging to all UPCs 658 02B70 DC402C56 659 CALLNP TAKEPAGES take away unused pages 660 02B71 DC402BD4 661 CALLNP SHACCT do the shut down accounting 662 663 ********************************************************************************** 664 * * 665 * Important. For some queues, we must place the element at * 666 * the end in order to prevent starvation (e.g SQFILEWAIT, * 667 * SQDIRWAIT). We consult a bit array as to the particular queue. * 668 * * 669 ********************************************************************************** 670 02B72 DC4025FC 671 CALLNP MAPOUTMEM map out the users virtual memory 02B73 60D78802 3 6 BASE 672 LD R3 SP,SHUTQSAV retrieve the queue pointer 673 PLOCK R3,0(NQUEUES) call to lock the appropriate queue 02B74 0CC00000 673 IOFF 02B75 D1D6C811 3 BASE 673 SETT R3,0(NQUEUES) 02B76 FE0C2B78 673 JNE MA(2+DISPW MA 0) 02B77 DC40308B 673 CALLNP LOCKWAIT 02B78 60895F12 2 5 ZBM 674 LD R2 R5,PSPROCCB restore the PCB pointer 02B79 60089260 0 2 ZBM 675 LD R0 R2,PCQUEUE get queue # 02B7A 3856C800 1 3 BASE 676 LEA R1 R3,0 produce address of list head 02B7B 5C301DCB 0 @ 677 CMZ @SQAPPENDIT(R0) check whether to place new at end 02B7C FE022B85 678 JEQ INSERTIT jump if we can do less work than that 679 680 * add element to end of queue 02B7D EC089F10 2 ZBM 681 STZ R2,PCQLINK clear our elements forward pointer 02B7E 60040000 0 IMM 682 LD R0 0 a null forward link 02B7F 3C085F10 0 1 ZBM 683 LSRCH R0 R1,PCQLINK find the last element in the list 684 * \ / 685 00002B80 686 SHUTDONE LABEL 02B80 E4885F10 2 1 ZBM 687 ST R2 R1,PCQLINK link in our element 688 PUNLOCK R3,0(NQUEUES) call to unlock the appropriate queue 02B81 EC16C811 3 BASE 688 STZ R3,0(NQUEUES) 02B82 0C800000 688 ION 02B83 61578801 5 6 BASE 689 LD R5 SP,SHUTR5SAV restore R5 for the caller 02B84 5D1F8003 6 STAK 690 LEAVE POP 691 * --- 692 693 * add element at queue head 00002B85 694 INSERTIT LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 497 (SCHED) F 29 Scheduler 02B85 60085F10 0 1 ZBM 695 LD R0 R1,PCQLINK get address of first element 02B86 E4089F10 0 2 ZBM 696 ST R0 R2,PCQLINK tack list after us 02B87 FE0E2B80 697 JMP SHUTDONE 698 * --- 699 700 END SHUTDOWN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 498 (SCHED) F 29 Scheduler 702 703 ********************************************************************************** 704 * * 705 * SHUTRUN * 706 * This routine shuts down the current user and places * 707 * him into the runnable queue. SETRUNNING computes a QIV and * 708 * inserts the user into the list in order. This normally * 709 * causes the user to be inserted at an "appropriate" place in * 710 * the queue. Should a caller of SHUTRUN wish the guy to go * 711 * to the end, he can set the PSSUMSDT to 0 to make it look * 712 * like the guy has never been shut down before. We set * 713 * PSSHUTTIME right before calling SETRUNNING so that this * 714 * shutdown appears very short (0). * 715 * Call: * 716 * interrupts must be off. * 717 * only MSQIN may be locked. * 718 * assumes that the page file is still loaded for this user. * 719 * PSA pointer in CPPSA. * 720 * CALLNP SHUTRUN * 721 * * 722 * Eats R0:R2, PFPTR, PAL. * 723 * Stack required = 11. * 724 * 2 + max ( LOCKWAIT (0), MAPINMEM (3), MAPOUTMEM (1), * 725 * SETRUNNING (2), SHACCT (3), SHDEQUE (3), * 726 * TAKEPAGES (9) ) * 727 * * 728 ********************************************************************************** 729 730 BLOCK SHUTRUN subroutine 731 ENTRY SHUTRUN 732 733 BEGFRAME 00178801 6 BASE 734 SHRUNR5 BSS 1 stack save for R5 735 ENDFRAME 736 02B88 DD5F8002 6 STAK 737 SHUTRUN ENTRNP PUSH 738 PLOCK SQLOCKS(NQRUNNING) lock the running queue 02B89 0CC00000 738 IOFF 02B8A D1C01DBA 738 SETT SQLOCKS(NQRUNNING) 02B8B FE0C2B8D 738 JNE MA(2+DISPW MA 0) 02B8C DC40308B 738 CALLNP LOCKWAIT 02B8D E5578801 5 6 BASE 739 ST R5 SP,SHRUNR5 save callers R5 02B8E 61400412 5 740 LD R5 CPPSA get pointer to PSA 02B8F DC402BBD 741 CALLNP SHDEQUE unload this guy 02B90 DC0025EB 742 CALL MAPINMEM map in users virtual free storage lists 02B91 40534000 5 REG 743 PARVL R5 pointer to the PSA 744 * \ / all desired page aging is done in SHDEQUE 745 02B92 DC402C56 746 CALLNP TAKEPAGES take away unused pages 747 02B93 DC402BD4 748 CALLNP SHACCT call for the shut down accounting 749 02B94 DC4025FC 750 CALLNP MAPOUTMEM unmap users virtual free storage 02B95 61095F12 4 5 ZBM 751 LD R4 R5,PSPROCCB => PCB 02B96 DC402B99 752 CALLNP SETRUNNING now place him into the runnable queue 02B97 61578801 5 6 BASE 753 LD R5 SP,SHRUNR5 restore callers register 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 499 (SCHED) F 29 Scheduler 02B98 5D1F8002 6 STAK 754 LEAVE POP and return 755 * --- 756 757 END SHUTRUN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 500 (SCHED) F 29 Scheduler 759 760 ********************************************************************************** 761 * * 762 * SETRUNNING * 763 * Routine to place a user into the runnable queue. We * 764 * calculate his queue insertion value (QIV) and place him * 765 * into the runnable queue by order of PCQPARM and QIV. We * 766 * check the PSA to see whether we should put the guy on the * 767 * end of the queue. If the flag is on, we give the guy a * 768 * very high QIV in the hopes that he will gravitate there. * 769 * This could be done by the caller by setting the PSSUMSDT * 770 * value to 0 (saying the process has never suspended), but it * 771 * can take too long for this the value to reaccumulate * 772 * (especially if done often). * 773 * Call: * 774 * only MSQIN may be locked when we come here. * 775 * R4 => PCB * 776 * CALLNP SETRUNNING * 777 * * 778 * Eats R0:R2. * 779 * Stack required = 2. * 780 * 1 + max ( GETDATE (1), LOCKWAIT (0) ) * 781 * * 782 ********************************************************************************** 783 784 BLOCK SETRUNNING subroutine 785 ENTRY SETRUNNING 786 787 BEGFRAME 788 ENDFRAME 789 00000100 ABS 790 MAXQIV EQU 256 791 02B99 DD5F8001 6 STAK 792 SETRUNNING ENTRNP PUSH 02B9A 60040001 0 IMM 793 LD R0 NQRUNNABLE get number of queue 02B9B E4091260 0 4 ZBM 794 ST R0 PCB,PCQUEUE indicate what queue this user will be in 02B9C 60891F13 2 4 ZBM 795 LD R2 PCB,PCPSADRS get pointer to PSA 02B9D DC404549 796 CALLNP GETDATE get the current clock 02B9E 1056880E 1 2 BASE 797 SUB R1 R2,PSSHUTTIME find how long since he was shutdown 798 * this gives the amount of time 799 * that he spent waiting to be unsuspended 02B9F 1848A10A 1 2 ZBM 800 ADD R1 R2,PSSUMSDT so make total of shut down time 02BA0 5044FFFF 1 IMM 801 MIN R1 PSSUMMAX make sure we don't overflow 02BA1 E448A10A 1 2 ZBM 802 ST R1 R2,PSSUMSDT save it away 02BA2 60040100 0 IMM 803 LD R0 MAXQIV get biggest possible QIV 02BA3 D1889414 2 ZBM 804 CLRT R2,PSENDRUN test, clear end-queue flag 02BA4 FE0C2BAE 805 JNE SOCKHIM give out big QIV 02BA5 6008810A 0 2 ZBM 806 LD R0 R2,PSSUMCPU get the amount of CPU time 02BA6 18520000 1 0 REG 807 ADD R1 R0 make R1 contain total elapsed time 808 * (not counting time spent in SQRUNNABLE) 02BA7 54440001 1 IMM 809 MAX R1 1 avoid division by 0 02BA8 1C040100 0 IMM 810 MUL R0 MAXQIV make integer arithmetic work out 02BA9 14124000 0 1 REG 811 DIV R0 R1 find the ratio 02BAA 60489830 1 2 ZBM 812 LD R1 R2,PSPRIORITY get this users priority 02BAB 1C40254B 1 813 MUL R1 TSPRIORVAL and convert to QIV units 02BAC 18124000 0 1 REG 814 ADD R0 R1 combine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 501 (SCHED) F 29 Scheduler 02BAD 1800254C 0 815 ADD R0 TSBASEVAL and add the base to form QIV 00002BAE 816 SOCKHIM LABEL 02BAE E4170801 0 4 BASE 817 ST R0 PCB,PCQPARM save in the parameter field 818 PLOCK SQLOCKS(NQRUNNABLE) get access to the runnable queue 02BAF 0CC00000 818 IOFF 02BB0 D1C01DBB 818 SETT SQLOCKS(NQRUNNABLE) 02BB1 FE0C2BB3 818 JNE MA(2+DISPW MA 0) 02BB2 DC40308B 818 CALLNP LOCKWAIT 02BB3 60170801 0 4 BASE 819 LD R0 PCB,PCQPARM recover QIV 02BB4 60441DAA 1 IMM 820 LD R1 ADR SQRUNNABLE get pointer to list head 00002BB5 821 MOVEON LABEL 02BB5 FA782BB8 12 822 RLJZA R1 ENDOFLIST jump at end of list 02BB6 64164801 0 1 BASE 823 CPR R0 R1,PCQPARM compare against this elements QIV 02BB7 FE062BB5 824 JGE MOVEON move to next if not to proper point yet 00002BB8 825 ENDOFLIST LABEL 02BB8 E4491F10 1 4 ZBM 826 ST R1 PCB,PCQLINK put the forward link into our element 02BB9 E5089F10 4 2 ZBM 827 ST PCB R2,PCQLINK and make previous element point to us 828 PUNLOCK SQLOCKS(NQRUNNABLE) release the queue 02BBA EC001DBB 828 STZ SQLOCKS(NQRUNNABLE) 02BBB 0C800000 828 ION 02BBC 5D1F8001 6 STAK 829 LEAVE POP 830 * --- 831 832 END SETRUNNING subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 502 (SCHED) F 29 Scheduler 834 835 ********************************************************************************** 836 * * 837 * SHDEQUE * 838 * Unloads the page file and dequeues the PCB. * 839 * Call: * 840 * R5 => PSA * 841 * SQRUNNING queue locked * 842 * CALLNP SHDEQUE * 843 * We unlock SQRUNNING * 844 * R2 => PCB * 845 * * 846 * Eats R0:R4. * 847 * Stack required = 3. * 848 * 1 + max ( LOCKWAIT (0), MAPOUTMEM (1), PFUNLOAD (2) ) * 849 * * 850 ********************************************************************************** 851 852 BLOCK SHDEQUE subroutine 853 ENTRY SHDEQUE 854 855 BEGFRAME 856 ENDFRAME 857 02BBD DD5F8001 6 STAK 858 SHDEQUE ENTRNP PUSH 02BBE DC4025A0 859 CALLNP PFUNLOAD free up the page file 860 * and produce current page ages 02BBF 60895F12 2 5 ZBM 861 LD R2 R5,PSPROCCB get the PCB pointer 02BC0 60441DA9 1 IMM 862 LD R1 ADR SQRUNNING R1 -> front of queue 02BC1 3C885F10 2 1 ZBM 863 LSRCH R2 R1,PCQLINK find our predecessor in queue 02BC2 FE022BC4 864 JEQ FOUND jump if found 02BC3 00130040 865 HALT HALTS0040 PCB not found in running queue (shutdown) 866 * --- 867 00002BC4 868 FOUND LABEL 02BC4 60089F10 0 2 ZBM 869 LD R0 R2,PCQLINK R0 -> one after us 02BC5 E4085F10 0 1 ZBM 870 ST R0 R1,PCQLINK remove us from queue 871 PUNLOCK SQLOCKS(NQRUNNING) unlock the list 02BC6 EC001DBA 871 STZ SQLOCKS(NQRUNNING) 02BC7 0C800000 871 ION 872 PLOCK R5,PSLOCK lock for access to PSUERROR word 02BC8 0CC00000 872 IOFF 02BC9 D1D7480C 5 BASE 872 SETT R5,PSLOCK 02BCA FE0C2BCC 872 JNE MA(2+DISPW MA 0) 02BCB DC40308B 872 CALLNP LOCKWAIT 02BCC EC095A1D 5 ZBM 873 STZ R5,PSUERROR/RTSWITCHB clear switch bit 874 PUNLOCK R5,PSLOCK clear lock 02BCD EC17480C 5 BASE 874 STZ R5,PSLOCK 02BCE 0C800000 874 ION 02BCF DC4025FC 875 CALLNP MAPOUTMEM unmap virtual monitor tables for this user 02BD0 EC000412 876 STZ CPPSA indicate no PSA running 02BD1 EC000414 877 STZ CPCUPC indicate no current UPC for this CPU 02BD2 D0401D0B 878 DEC BUSYCPUS say this CPU no longer busy 02BD3 5D1F8001 6 STAK 879 LEAVE POP return 880 * --- 881 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 503 (SCHED) F 29 Scheduler 882 END SHDEQUE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 504 (SCHED) F 29 Scheduler 884 885 ********************************************************************************** 886 * * 887 * SHACCT * 888 * Does the accounting part of shutdown. * 889 * Call: * 890 * R5 => PSA * 891 * CALLNP SHACCT * 892 * * 893 * * 894 * Eats R0:R4. * 895 * Stack required = 3. * 896 * 1 + max ( GETDATE (1), TIMEKILL (2), UERRSETY (1) ) * 897 * * 898 ********************************************************************************** 899 900 BLOCK SHACCT subroutine 901 ENTRY SHACCT 902 903 BEGFRAME 904 ENDFRAME 905 02BD4 DD5F8001 6 STAK 906 SHACCT ENTRNP PUSH 907 * Account CPU time used and give error if limit exceeded 02BD5 6117480F 4 5 BASE 908 LD TMR R5,PSQUANTPTR 02BD6 DC404517 909 CALLNP TIMEKILL remove the end of quantum interrupt 02BD7 60840000 2 IMM 910 LD R2 0 RTN1 - element not found 02BD8 3089410B 2 5 ZBM 911 RSB R2 R5,PSLASTQUAN R2=quantum used 02BD9 9889410A 2 5 ZBM 912 ADDM R2 R5,PSSUMCPU accumulate CPU time used (for scheduling) 02BDA B8974810 2 5 BASE 913 ADDB R2 R5,PSTIMEUSED account the time used (for billing) 02BDB 68974811 2 5 BASE 914 UCPR R2 R5,PSTIMLIM over the limit? 02BDC FE0A2BF0 915 JLE SDTIMEOK jump if within time limit 02BDD 60094116 0 5 ZBM 916 LD R0 R5,PSCURRPROC get current UPC pointer 02BDE 5C080610 0 ZBM 917 CMZ R0,UPCNTLMODE is he running in control mode? 02BDF FE0C2BF0 918 JNE SDTIMEOK CM doesn't get cuts 02BE0 60095F12 0 5 ZBM 919 LD R0 R5,PSPROCCB get the PCB pointer 02BE1 5C081813 0 ZBM 920 CMZ R0,PCSYSPROC is this a system process? 02BE2 FE0C2BF0 921 JNE SDTIMEOK if so, no time outs. 02BE3 60840021 2 IMM 922 LD R2 UINTTIMCUT 02BE4 60C40000 3 IMM 923 LD R3 0 02BE5 DC4035B5 924 CALLNP UERRSETY tell the user his error 925 * \ / 926 927 ********************************************************************************** 928 * * 929 * So that one getting a time cut can programatically * 930 * recover and set another limit, we here give a little grace * 931 * by allowing one more second after a time cut. This is * 932 * usually used by a program monitor to recover from the error * 933 * and either continue the program (after the monitoring * 934 * sample has been taken) or stop the program and converse * 935 * with the user. * 936 * * 937 ********************************************************************************** 938 939 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 505 (SCHED) F 29 Scheduler 02BE6 60C95F13 3 5 ZBM 940 LD R3 R5,PSUSERLIMP R3=>ULB we are using 02BE7 6096C808 2 3 BASE 941 LD R2 R3,ULTIMLIM R2=account time limit 02BE8 FA882BEE 2 942 JLTZ R2 NOLIMACCT jump if the account has no limit 02BE9 1096C809 2 3 BASE 943 SUB R2 R3,ULTIMUSD R2=time available to account 02BEA 60574811 1 5 BASE 944 LD R1 R5,PSTIMLIM R1=time used so far in this session 02BEB 144403E8 1 IMM 945 DIV R1 MSECSS R1=time used in session in seconds 02BEC 64528000 1 2 REG 946 CPR R1 R2 is there more time left on the account? 02BED FE062BF0 947 JGE SDTIMEOK jump if no more time to give out 00002BEE 948 NOLIMACCT LABEL 02BEE 600403E8 0 IMM 949 LD R0 1*MSECSS give him one more second 02BEF 98174811 0 5 BASE 950 ADDM R0 R5,PSTIMLIM 951 * \ / 952 00002BF0 953 SDTIMEOK LABEL 02BF0 DC404549 954 CALLNP GETDATE get the current time 02BF1 E457480E 1 5 BASE 955 ST R1 R5,PSSHUTTIME and save to see how long he stays shut down 956 02BF2 5D1F8001 6 STAK 957 LEAVE POP return 958 * --- 959 960 END SHACCT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 506 (SCHED) F 29 Scheduler 962 963 ********************************************************************************** 964 * * 965 * TESTTRUBL * 966 * This routine may be entered when a user is about to be * 967 * suspended. It decreases any grace that the user might * 968 * have, then attempts to check for thrashing or impending * 969 * thrashing. We compare this users priority to the count of * 970 * idle pages less MMIDLETTMIN. We do nothing if this users * 971 * priority is smaller. This means that low priority (bigger * 972 * number!) users get turned off early so that background jobs * 973 * get out ot the way of interactive jobs as the system load * 974 * increases. If there is still sufficient memory available, * 975 * we exit immediately, otherwise, we calculate a badness * 976 * level for this user. We now check to see if the number of * 977 * idle pages has fallen below MMIDLABSMIN. If so, we * 978 * unconditionally shut down this user. This is to prevent * 979 * exhausting the idle page list. If we still have enough * 980 * idle pages, we compare this users badness level to all * 981 * other users in the runnable queue. If our guy is the * 982 * worst, we take away his pages and place him into the * 983 * trouble maker queue. If someone exists in the runnable * 984 * queue who is much worse, we let our current guy go. Also, * 985 * even if there is no one in the runnable queue, we will shut * 986 * down the current user if another CPU is running a process. * 987 * Callers should allow for testtrubl taking away pages. * 988 * The current version does not. * 989 * TESTTRUBL might not return to the caller, but can go * 990 * directly to the dispatcher. You'd better have your last * 991 * will and testament all in order before calling us. Abandon * 992 * all hope, ye who enter here. * 993 * Call with: * 994 * No lists locked! Interrupts off! * 995 * CPPSA => current process PSA * 996 * SP = stack pointer * 997 * CALLNP TESTTRUBL * 998 * * 999 * Eats R0:R4. * 1000 * Stack required = 13. * 1001 * 1 + max ( HOWBAD (1), LOCKWAIT (0), PFUPCAGE (1), * 1002 * SHUTDOWN (12), SHUTRUN (11) ) * 1003 * * 1004 ********************************************************************************** 1005 1006 BLOCK TESTTRUBL subroutine 1007 ENTRY TESTTRUBL 1008 1009 BEGFRAME 1010 ENDFRAME 1011 02BF3 DD5F8001 6 STAK 1012 TESTTRUBL ENTRNP PUSH 02BF4 60800412 2 1013 LD R2 CPPSA get the current PSA pointer 02BF5 5C168004 2 CACH 1014 CMZ R2,PSGRACE check for a zero grace 02BF6 FE022BF8 1015 JEQ HOWBGOK jump if grace exhausted 02BF7 D0568004 2 CACH 1016 DEC R2,PSGRACE reduce the amount of grace 00002BF8 1017 HOWBGOK LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 507 (SCHED) F 29 Scheduler 02BF8 60089830 0 2 ZBM 1018 LD R0 R2,PSPRIORITY fetch this users priority 02BF9 18002543 0 1019 ADD R0 MMIDLETTMIN ensure minimum number of idle pages 02BFA 18001F18 0 1020 ADD R0 DISKRBUSY reads are going to use idle pages 02BFB 64001DDA 0 1021 CPR R0 PPIDLCOUNT check for enough clean idle pages 02BFC FE082C1D 1022 JLT TESTTEXIT if more idle pages, no problem 1023 1024 * We are short of idle pages. We calculate this users 1025 * badness level. Even if we skip the comparison with other 1026 * system users and shut down this user directly, we need 1027 * the badness level to determine a sentence. 1028 1029 * current users PSA pointer in R2 02BFD DC402C2A 1030 CALLNP HOWBAD check to see how bad he is 02BFE 18002548 0 1031 ADD R0 MMHYSPARM add a hysteresis factor 02BFF 61120000 4 0 REG 1032 LD R4 R0 copy to a holding register 1033 1034 * We already know that we are running a little short 1035 * of memory. We have now calculated this users badness 1036 * level. Check to see if our memory shortage is to the 1037 * desperation stage. 1038 02C00 60001DDA 0 1039 LD R0 PPIDLCOUNT get number of idle pages 02C01 10001F18 0 1040 SUB R0 DISKRBUSY subtract the disk read count 02C02 64002544 0 1041 CPR R0 MMIDLABSMIN compare against absolute minimum allowed 02C03 FE0A2C11 1042 JLE TTRLOCKUP if too few, just do the shutdown 1043 1044 * Now check for a user who is a worse offender 1045 1046 PLOCK SQLOCKS(NQRUNNABLE) call to lock the runnable queue 02C04 0CC00000 1046 IOFF 02C05 D1C01DBB 1046 SETT SQLOCKS(NQRUNNABLE) 02C06 FE0C2C08 1046 JNE MA(2+DISPW MA 0) 02C07 DC40308B 1046 CALLNP LOCKWAIT 02C08 38401DAA 1 1047 LEA R1 SQRUNNABLE pointer to runnable queue 02C09 FA742C1E 1 1048 LJZA R1 TTRODD jump if no one in queue 00002C0A 1049 TTXAMLOP LABEL 02C0A 60885F13 2 1 ZBM 1050 LD R2 R1,PCPSADRS get PSA pointer 02C0B DC402C2A 1051 CALLNP HOWBAD see how bad this guy is 02C0C 64130000 0 4 REG 1052 CPR R0 R4 do the comparison 02C0D FE062C1B 1053 JGE TESTAEXIT jump if guy in runnable queue worse 02C0E FA762C0A 1 1054 LJNA R1 TTXAMLOP go examine the entire queue 1055 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 02C0F EC001DBB 1055 STZ SQLOCKS(NQRUNNABLE) 02C10 0C800000 1055 ION 1056 * \ / 1057 1058 ********************************************************************************** 1059 * Come here to turn off this guy. We adjust his trouble * 1060 * maker history data. * 1061 * The INC and ADDM instructions may overflow the fields * 1062 * available. This is tough. This means that the system is so * 1063 * loaded that the errors in these parameters will have a * 1064 * negligible effect on overall system performance. * 1065 ********************************************************************************** 1066 1067 * R4 = badness level 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 508 (SCHED) F 29 Scheduler 1068 * \ / 00002C11 1069 TTRLOCKUP LABEL 02C11 60800412 2 1070 LD R2 CPPSA get the current PSA pointer 02C12 60089830 0 2 ZBM 1071 LD R0 R2,PSPRIORITY get this users priority level 02C13 1C002546 0 1072 MUL R0 MMPRRATIO adjust by priority ratio 02C14 180880F2 0 2 ZBM 1073 ADD R0 R2,PSWSSIZE get number of pages 02C15 18089071 0 2 ZBM 1074 ADD R0 R2,PSPFFREQ add page fault frequency 1075 * this number represents the amount of 1076 * grace that we think that this user 1077 * needs to get going. 02C16 98168004 0 2 CACH 1078 ADDM R0 R2,PSGRACE assign grace for next try 1079 * \ / 1080 1081 ********************************************************************************** 1082 * Shutdown knows enough to rip off virtually all of * 1083 * this guys pages. * 1084 ********************************************************************************** 1085 1086 * \ / 02C17 60C41DB9 3 IMM 1087 LD R3 ADR SQTROUBLE pointer to queue head 02C18 DC002B58 1088 CALL SHUTDOWN turn off this guy 02C19 40530000 4 REG 1089 PARVL R4 length of sentence equivalent to 1090 * amount of trouble 02C1A FE0E28B7 1091 JMP DISPATCH exit directly to the dispatcher 1092 * --- sure hope we got some pages 1093 00002C1B 1094 TESTAEXIT LABEL 1095 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 02C1B EC001DBB 1095 STZ SQLOCKS(NQRUNNABLE) 02C1C 0C800000 1095 ION 00002C1D 1096 TESTTEXIT LABEL 02C1D 5D1F8001 6 STAK 1097 LEAVE POP return to the caller 1098 * --- 1099 1100 ********************************************************************************** 1101 * We arrive here with a user who has no runnable * 1102 * competition. If MSWAIT competition exists, we turn this * 1103 * guy off. If another CPU is running, we turn this guy off. * 1104 * Otherwise, we just turn him loose. * 1105 ********************************************************************************** 1106 00002C1E 1107 TTRODD LABEL 1108 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 02C1E EC001DBB 1108 STZ SQLOCKS(NQRUNNABLE) 02C1F 0C800000 1108 ION 02C20 5C001DAB 1109 CMZ SQMSWAIT check for users waiting for MS 02C21 FE0C2C11 1110 JNE TTRLOCKUP jump if so, lock up this guy 02C22 60001D0B 0 1111 LD R0 BUSYCPUS check for other CPUs 02C23 64040001 0 IMM 1112 CPR R0 1 check for just us 02C24 FE0C2C11 1113 JNE TTRLOCKUP some other CPU is accomplishing something, 1114 * let that CPU have priority 1115 * \ / 1116 1117 ********************************************************************************** 1118 * * 1119 * This is the only user on the system, but he is * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 509 (SCHED) F 29 Scheduler 1120 * encountering memory problems. We allow him to go back * 1121 * to running. If he keeps requesting pages, he will get * 1122 * shutdown when the number of idle pages hits MMIDLABSMIN. * 1123 * We don't let him go directly. Instead, we age some of * 1124 * his pages and send him through a shutdown to remove any * 1125 * pages that look even slightly unused. * 1126 * * 1127 ********************************************************************************** 1128 1129 * \ / 02C25 61400412 5 1130 LD R5 CPPSA get PSA pointer 02C26 60040008 0 IMM 1131 LD R0 8 get age value 02C27 DC4025B6 1132 CALLNP PFUPCAGE call to distribute aging to all UPCs 02C28 DC402B88 1133 CALLNP SHUTRUN requeue in runnable queue 02C29 FE0E28B7 1134 JMP DISPATCH and let the dispatcher run him 1135 * --- 1136 1137 END TESTTRUBL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 510 (SCHED) F 29 Scheduler 1139 1140 ********************************************************************************** 1141 * * 1142 * HOWBAD. * 1143 * This routine calculates the offensiveness of the user * 1144 * whose PSA pointer is in R2. Bigger numbers are more * 1145 * offensive. MMLOCKPARM is intended to be negative and PSGRACE * 1146 * is subtracted. Other items are positive. * 1147 * * 1148 * LD R2 => PSA * 1149 * CALLNP HOWBAD * 1150 * ST R0 offensiveness level * 1151 * * 1152 * Eats R0. * 1153 * Stack required = 1. * 1154 * * 1155 ********************************************************************************** 1156 1157 BLOCK HOWBAD subroutine 1158 ENTRY HOWBAD 1159 1160 BEGFRAME 1161 ENDFRAME 1162 02C2A DD5F8001 6 STAK 1163 HOWBAD ENTRNP PUSH 02C2B 60088230 0 2 ZBM 1164 LD R0 R2,PSLOCKCNTR get count of critical regions locked 02C2C 1C002547 0 1165 MUL R0 MMLOCKPARM scale up to size 02C2D 18089830 0 2 ZBM 1166 ADD R0 R2,PSPRIORITY check the users priority 02C2E 1C002546 0 1167 MUL R0 MMPRRATIO convert to page equivalent 02C2F 180880F2 0 2 ZBM 1168 ADD R0 R2,PSWSSIZE add actual working set size 02C30 18089071 0 2 ZBM 1169 ADD R0 R2,PSPFFREQ add the page fault frequency 02C31 10168004 0 2 CACH 1170 SUB R0 R2,PSGRACE allow for grace 02C32 54040000 0 IMM 1171 MAX R0 0 ensure negs don't go through 02C33 5D1F8001 6 STAK 1172 LEAVE POP exit 1173 * --- 1174 1175 END HOWBAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 511 (SCHED) F 29 Scheduler 1177 1178 ********************************************************************************** 1179 * * 1180 * TAKEOLD * 1181 * This search removes unused pages from a user who does * 1182 * not have the page file loaded. What we do is calculate two * 1183 * ages, one based on working set size and the second based on * 1184 * system resources, and from there we use the smallest value. * 1185 * The threshold age based on system resources is calculated * 1186 * as follows: (.25*+ * 1187 * )*MMAGEINC/MMAGEINCD+MMAGE- * 1188 * . The threshold age based on working set * 1189 * size is calculated as (MMAXWSX-)*2. It * 1190 * then removes any older PAL from the list it was given. * 1191 * Note also that the greatest PAL age for the given list is a * 1192 * passed parameter, this prevents unnecessary scans. * 1193 * Call: * 1194 * Interrupts off! * 1195 * Only MSQIN and an SQ may be locked * 1196 * R1 => pre-aging applied to this list * 1197 * R5 => PSA * 1198 * SP => stack pointer * 1199 * page file must be unloaded * 1200 * list pointer in PAL ( ADR WSX or ADR VASP ) * 1201 * CALL TAKEOLD * 1202 * PARL
* 1203 * * 1204 * Eats R0:R2, PAL. * 1205 * Stack required = 8. * 1206 * 4 + max ( DISCARDPAL(4) ) * 1207 * * 1208 ********************************************************************************** 1209 1210 BLOCK TAKEOLD subroutine 1211 ENTRY TAKEOLD 1212 1213 BEGFRAME 00178801 6 BASE 1214 TAKEPSA BSS 1 holds PSA pointer 00178802 6 BASE 1215 TAKEAGE BSS 1 age criteria value 00178803 6 BASE 1216 TAKER3 BSS 1 holds callers R3 1217 ENDFRAME 1218 02C34 DD1F8004 6 STAK 1219 TAKEOLD ENTR PUSH 02C35 C0128000 2 REG 1220 STPL R2 address of the max PAL age 1221 * \ / calculate threshold value 02C36 60001F19 0 1222 LD R0 DISKWBUSY load the count of pages on their way out 02C37 600A01E0 0 0 CBM 1223 LD R0 R0/BITS 0:29 credit one forth as available 02C38 18001DDA 0 1224 ADD R0 PPIDLCOUNT add in the count of available clean pages 02C39 1C002540 0 1225 MUL R0 MMAGEINC more lenient if more pages 02C3A 14002541 0 1226 DIV R0 MMAGEINCD allow for fractional values 02C3B 1800253F 0 1227 ADD R0 MMAGE and add in the minimum that we will take 02C3C 10124000 0 1 REG 1228 SUB R0 R1 allow for extra age 1229 * note that the allowable age 1230 * may now be negative! This 1231 * is acceptable and causes all 1232 * PALs to be removed. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 512 (SCHED) F 29 Scheduler 02C3D 60402542 1 1233 LD R1 MMAXWSX largest possible working set size 02C3E 104940F2 1 5 ZBM 1234 SUB R1 R5,PSWSSIZE subtract off current working set size 02C3F 500A4200 0 1 CBM 1235 MIN R0 R1/BITS 1:0 use lesser of two values 02C40 64168400 0 2 @R 1236 CPR R0 @R2 compare to the largest age 02C41 FE042C55 1237 JGT TAKEDONE jump if no PALs to discard 02C42 E4168400 0 2 @R 1238 ST R0 @R2 this age now becomes the max 02C43 E4178802 0 6 BASE 1239 ST R0 SP,TAKEAGE save away for later 02C44 E4D78803 3 6 BASE 1240 ST R3 SP,TAKER3 save callers register 02C45 E5578801 5 6 BASE 1241 ST R5 SP,TAKEPSA save PSA pointer 1242 * \ / 00002C46 1243 TADVANCE LABEL 02C46 FB382C53 45 1244 RLJZA PAL TAKEEXIT link to next, exit if done 00002C47 1245 TALOOK LABEL 02C47 640900E2 0 4 ZBM 1246 CPR R0 PAL,PAGEAGE check the age of this element 02C48 FE062C46 1247 JGE TADVANCE jump back if this element stays 02C49 5C091210 4 ZBM 1248 CMZ PAL,PALOCK check the locked bit 02C4A FE0C2C46 1249 JNE TADVANCE MUST not remove locked pages! 1250 * \ / remove this element 02C4B 60091F10 0 4 ZBM 1251 LD R0 PAL,PALINK get the continuing link 02C4C E4095F10 0 5 ZBM 1252 ST R0 R5,PALINK jumper list around this element 02C4D DC402E15 1253 CALLNP DISCARDPAL get rid of this PAL 02C4E 60178801 0 6 BASE 1254 LD R0 SP,TAKEPSA get PSA pointer for victim process 02C4F D04800F2 0 ZBM 1255 DEC R0,PSWSSIZE indicate working set just shrunk 02C50 61095F10 4 5 ZBM 1256 LD PAL R5,PALINK get pointer to next element 02C51 60178802 0 6 BASE 1257 LD R0 SP,TAKEAGE get back the age value 02C52 FB322C47 4 1258 JNZA PAL TALOOK jump back if good element 1259 * \ / end of list 00002C53 1260 TAKEEXIT LABEL 02C53 60D78803 3 6 BASE 1261 LD R3 SP,TAKER3 restore callers register 02C54 61578801 5 6 BASE 1262 LD R5 SP,TAKEPSA restore register 1263 * \ / 00002C55 1264 TAKEDONE LABEL 02C55 5D1F8004 6 STAK 1265 LEAVE POP return to caller 1266 * --- 1267 1268 END TAKEOLD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 513 (SCHED) F 29 Scheduler 1270 1271 ********************************************************************************** 1272 * * 1273 * This routine loops through all VASP and WSX lists * 1274 * for a user that's not running and takes unused pages. * 1275 * This calls TAKEOLD to perform the calculation for each * 1276 * list. We do the working set extension list first because * 1277 * it is less important to the process and pages freed up * 1278 * from it may increase the age allowed in the VASP list! * 1279 * Call: * 1280 * (Interrupts off!) * 1281 * Only MSQIN and an SQ can be locked * 1282 * R5 => PSA * 1283 * SP = stack pointer * 1284 * page file must be unloaded * 1285 * CALLNP TAKEPAGES * 1286 * * 1287 * Eats R0:R3, PAL. * 1288 * Stack required = 9. * 1289 * 1 + max ( TAKEOLD (8) ) * 1290 * * 1291 ********************************************************************************** 1292 1293 BLOCK TAKEPAGES subroutine 1294 ENTRY TAKEPAGES 1295 1296 BEGFRAME 1297 ENDFRAME 1298 02C56 DD5F8001 6 STAK 1299 TAKEPAGES ENTRNP PUSH 02C57 60895F15 2 5 ZBM 1300 LD R2 R5,PSPROCLIST get pointer to list of UPC's 00002C58 1301 TAKEWSXLP LABEL 02C58 60D28000 3 2 REG 1302 LD R3 R2 put UPC pointer in appropriate register 02C59 3916C810 4 3 BASE 1303 LEA PAL R3,UPCWSX get pointer to WSX list 02C5A 6048C0F7 1 3 ZBM 1304 LD R1 R3,UPXAGEWSX get extra age for WSX list 02C5B DC002C34 1305 CALL TAKEOLD try to take some pages 02C5C 4008C0F5 3 ZBM 1306 PARL R3,UPCMAGEW max age of PAL in WSX list 02C5D 6088DF10 2 3 ZBM 1307 LD R2 R3,UPCSONPTR any under process to rip off 02C5E FAB22C58 2 1308 JNZA R2 TAKEWSXLP attempt to get more pages 00002C5F 1309 TWSXBROLP LABEL 02C5F 6088DF16 2 3 ZBM 1310 LD R2 R3,UPCBROPTR any brother processes to check 02C60 FAB22C58 2 1311 JNZA R2 TAKEWSXLP jump if they exists 02C61 60C8DF17 3 3 ZBM 1312 LD R3 R3,UPCDADPTR get our immediate overprocess 02C62 FAF22C5F 3 1313 JNZA R3 TWSXBROLP if not zero then not finished 1314 * \ / 1315 02C63 60895F15 2 5 ZBM 1316 LD R2 R5,PSPROCLIST get pointer to list of UPC's 00002C64 1317 TAKEVASPLP LABEL 02C64 60D28000 3 2 REG 1318 LD R3 R2 move UPC pointer into register 3 02C65 3916C80F 4 3 BASE 1319 LEA PAL R3,UPCVASP get pointer to VASP list 02C66 6048C0F6 1 3 ZBM 1320 LD R1 R3,UPXAGEVASP get extra age for VASP list 02C67 DC002C34 1321 CALL TAKEOLD try to take some pages 02C68 4008C0F4 3 ZBM 1322 PARL R3,UPCMAGEV max age of PAL in VASP list 02C69 6088DF10 2 3 ZBM 1323 LD R2 R3,UPCSONPTR any under process to rip off 02C6A FAB22C64 2 1324 JNZA R2 TAKEVASPLP attempt to get more pages 00002C6B 1325 TVASPBROLP LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 514 (SCHED) F 29 Scheduler 02C6B 6088DF16 2 3 ZBM 1326 LD R2 R3,UPCBROPTR any brother processes to check 02C6C FAB22C64 2 1327 JNZA R2 TAKEVASPLP jump if they exists 02C6D 60C8DF17 3 3 ZBM 1328 LD R3 R3,UPCDADPTR get our immediate overprocess 02C6E FAF22C6B 3 1329 JNZA R3 TVASPBROLP if not zero then not finished 1330 * \ / 1331 02C6F 5D1F8001 6 STAK 1332 LEAVE POP 1333 * --- 1334 1335 END 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 515 (SCHED) F 29 Scheduler 1337 1338 ********************************************************************************** 1339 * * 1340 * WHICHHUNT * 1341 * Routine to clean up a single queue. It removes aged * 1342 * pages from the VASP and WSX lists of each user in the * 1343 * indicated queue. * 1344 * Call: * 1345 * SP = stack pointer * 1346 * CALLNP WHICHHUNT call to free up pages * 1347 * ADR
* 1348 * * 1349 * * 1350 * Eats R0:R5. * 1351 * Stack required = 10. * 1352 * 1 + max ( LOCKWAIT (0), MAPINMEM (3), MAPOUTMEM (1), * 1353 * PFUPCAGE (1), TAKEPAGES (9) ) * 1354 * * 1355 ********************************************************************************** 1356 1357 BLOCK WHICHHUNT subroutine 1358 ENTRY WHICHHUNT 1359 1360 BEGFRAME 1361 ENDFRAME 1362 02C70 DD5F8001 6 STAK 1363 WHICHHUNT ENTRNP PUSH 02C71 6157C800 5 7 BASE 1364 LD R5 R7,0 get the SQ head pointer 1365 PLOCK R5,0(NQUEUES) call to lock the appropriate queue 02C72 0CC00000 1365 IOFF 02C73 D1D74811 5 BASE 1365 SETT R5,0(NQUEUES) 02C74 FE0C2C76 1365 JNE MA(2+DISPW MA 0) 02C75 DC40308B 1365 CALLNP LOCKWAIT 02C76 FB742C8C 5 1366 LJZA R5 WHMLTQ jump out if no queue entries 1367 * \ / 1368 1369 * mark all PCBs as cleanable 00002C77 1370 WHMLXU LABEL 02C77 EDC95010 5 ZBM 1371 STW R5,PCQCLNMARK mark this PCB to be cleaned 02C78 FB762C77 5 1372 LJNA R5 WHMLXU scan on in the queue 1373 * \ / 1374 1375 * clean all cleanable PCBs 00002C79 1376 WHPNXU LABEL 02C79 6157C800 5 7 BASE 1377 LD R5 R7,0 retrieve the queue head pointer 1378 PUNLOCK R5,0(NQUEUES) call to unlock the lock array 02C7A EC174811 5 BASE 1378 STZ R5,0(NQUEUES) 02C7B 0C800000 1378 ION 1379 * \ / 1380 1381 * (leave queue unlocked for a bit so others can 1382 * [if they're fast] get in and we don't hog the queue) 02C7C 60440001 1 IMM 1383 LD R1 1 marker that we will look for 1384 1385 PLOCK R5,0(NQUEUES) call to lock the appropriate queue 02C7D 0CC00000 1385 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 516 (SCHED) F 29 Scheduler 02C7E D1D74811 5 BASE 1385 SETT R5,0(NQUEUES) 02C7F FE0C2C81 1385 JNE MA(2+DISPW MA 0) 02C80 DC40308B 1385 CALLNP LOCKWAIT 02C81 3C495010 1 5 ZBM 1386 LSRCH R1 R5,PCQCLNMARK look for a not yet cleaned user 02C82 FE0C2C8B 1387 JNE WHCLDONE jump if entire queue now cleaned 02C83 EC095010 5 ZBM 1388 STZ R5,PCQCLNMARK indicate user now cleaned 1389 02C84 61495F13 5 5 ZBM 1390 LD R5 R5,PCPSADRS fetch pointer to associated PSA 02C85 DC0025EB 1391 CALL MAPINMEM map in the users virtual free storage 02C86 40534000 5 REG 1392 PARVL R5 pointer to the PSA 02C87 60002545 0 1393 LD R0 MMIDLSPEED see how fast pages age 02C88 DC4025B6 1394 CALLNP PFUPCAGE call to distribute aging to all UPCs 1395 02C89 DC402C56 1396 CALLNP TAKEPAGES take away unused pages 02C8A FE0E2C79 1397 JMP WHPNXU go do another scan of the queue 1398 * --- 1399 00002C8B 1400 WHCLDONE LABEL done with entire queue 02C8B DC4025FC 1401 CALLNP MAPOUTMEM map out users free storage 1402 * \ / 1403 00002C8C 1404 WHMLTQ LABEL 02C8C 6157C800 5 7 BASE 1405 LD R5 R7,0 retrieve the queue head pointer 1406 PUNLOCK R5,0(NQUEUES) call to unlock the lock array 02C8D EC174811 5 BASE 1406 STZ R5,0(NQUEUES) 02C8E 0C800000 1406 ION 02C8F 19C40001 7 IMM 1407 ADD R7 1 advance return over the parameter 02C90 5D1F8001 6 STAK 1408 LEAVE POP go on home 1409 * --- 1410 1411 END WHICHHUNT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 517 (SCHED) F 29 Scheduler 1413 1414 ********************************************************************************** 1415 * * 1416 * TICK - SHORT INTERVAL TIME INTERRUPT CODE * 1417 * This code is to be activated at regular intervals * 1418 * (tentatively set at two seconds). It: * 1419 * 1) ages pages of users in inactive queues, * 1420 * 2) adjust the CPU scheduling variables in the runnable queue * 1421 * 3) examines the trouble maker queue and releases * 1422 * processes at the end of their jail term. * 1423 * Terms are normally fixed at the time of incarceration * 1424 * but may be reduced in the case of record harvests. * 1425 * 4) do I/O timeouts * 1426 * * 1427 * Eats R0:R3, PAL, R5. * 1428 * Stack required = 11. * 1429 * 1 + max ( FIXSKVARS (1), LOCKLIST (1), LOCKWAIT (0), * 1430 * MAPINMEM (3), SETRUNNING (2), TIMESET (2), * 1431 * UNLOCKLIST(1), WHICHHUNT (10) ) * 1432 * * 1433 ********************************************************************************** 1434 1435 BLOCK TICK subroutine 1436 ENTRY TICK 1437 1438 BEGFRAME 1439 ENDFRAME 1440 02C91 DD5F8001 6 STAK 1441 TICK ENTRNP PUSH 02C92 DC0044F8 1442 CALL TIMESET set up the next tick 02C93 434407D0 IMM 1443 PARV2 2*MSECSS pass time interval 02C94 41440000 IMM 1444 PARV 0 no particular CPU 02C95 41002C91 1445 PAR TICK code to process ticks 02C96 40440000 IMM 1446 PARVL 0 parameter is don't care 1447 1448 ********************************************************************************** 1449 * * 1450 * WHICH hunt begins here. * 1451 * The Grim Reaper * 1452 * Call the WHICHHUNT for all allowable queues. * 1453 * Note that since each call may free a few pages, * 1454 * thereby modifying the oldest age allowed, we do last the * 1455 * queues likely to contain the more valuable processes. * 1456 * All queues that may contain stopped processes with * 1457 * pages must be cleaned in order to avoid deadlocks ( no idle * 1458 * pages available, but no one able to free up what they have * 1459 * until they get a MS transfer ). This especially includes * 1460 * the MSWAIT queue. * 1461 * * 1462 ********************************************************************************** 1463 02C97 DC402C70 1464 CALLNP WHICHHUNT call for cleanup 02C98 00001DB8 1465 ADR SQSTOPWAIT all stopped processes 1466 02C99 DC402C70 1467 CALLNP WHICHHUNT call for cleanup of 02C9A 00001DB7 1468 ADR SQTIMEWAIT all processes waiting on timer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 518 (SCHED) F 29 Scheduler 1469 02C9B DC402C70 1470 CALLNP WHICHHUNT call for cleanup of 02C9C 00001DB1 1471 ADR SQFILEWAIT all processes waiting on files 1472 02C9D DC402C70 1473 CALLNP WHICHHUNT call for cleanup of 02C9E 00001DB0 1474 ADR SQLOCKWAIT all processes waiting on a .LOCK 1475 02C9F DC402C70 1476 CALLNP WHICHHUNT call for cleanup of 02CA0 00001DB4 1477 ADR SQUNITWAIT all processes waiting on a unit 1478 02CA1 DC402C70 1479 CALLNP WHICHHUNT call for cleanup of 02CA2 00001DB3 1480 ADR SQMSGWAIT all processes waiting on a message 1481 02CA3 DC402C70 1482 CALLNP WHICHHUNT call for cleanup of 02CA4 00001DB2 1483 ADR SQPATHWAIT all processes waiting on a .PATH 1484 02CA5 DC402C70 1485 CALLNP WHICHHUNT call for cleanup of 02CA6 00001DAC 1486 ADR SQDIOWAIT this queue 1487 02CA7 DC402C70 1488 CALLNP WHICHHUNT call for cleanup of 02CA8 00001DB5 1489 ADR SQTERMWAIT this queue 1490 02CA9 DC402C70 1491 CALLNP WHICHHUNT call for cleanup of 02CAA 00001DB6 1492 ADR SQTRMOWAIT this queue 1493 02CAB DC402C70 1494 CALLNP WHICHHUNT call for cleanup of 02CAC 00001DAD 1495 ADR SQDIRWAIT this queue 1496 02CAD DC402C70 1497 CALLNP WHICHHUNT call for cleanup of 02CAE 00001DAF 1498 ADR SQIDXWAIT this queue 1499 02CAF DC402C70 1500 CALLNP WHICHHUNT call for cleanup of 02CB0 00001DAE 1501 ADR SQADTWAIT this queue 1502 02CB1 D0401D13 1503 DEC TSMSAGE time to age pages in MSWAIT 02CB2 FE0C2CB7 1504 JNE NOAGEMS jump if not time 02CB3 DC402C70 1505 CALLNP WHICHHUNT call for cleanup of 02CB4 00001DAB 1506 ADR SQMSWAIT this queue 02CB5 6004000F 0 IMM 1507 LD R0 TSMSTIME time wait before aging MSWAIT queue 02CB6 E4001D13 0 1508 ST R0 TSMSAGE reset out counter 1509 * \ / 1510 00002CB7 1511 NOAGEMS LABEL 02CB7 0CC00000 1512 IOFF we can not be interrupt here 02CB8 DC0025EB 1513 CALL MAPINMEM map in the last guys virtual free storage lists 02CB9 40400412 1514 PARVL CPPSA PSA pointer, if any 02CBA 0C800000 1515 ION restore interrupts 1516 1517 ********************************************************************************** 1518 * Calculate the current load factor and combine it with * 1519 * the previous load factor to create a running average value. * 1520 ********************************************************************************** 1521 02CBB DC003096 1522 CALL LOCKLIST lock for scan of PCBs 02CBC 40001EB2 1523 PARL PCNTLLOCK 02CBD 61001EB1 4 1524 LD PCB PCONTROL get the list head 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 519 (SCHED) F 29 Scheduler 02CBE EC128000 2 REG 1525 STZ R2 initialize accumulator 02CBF FB302CC4 4 1526 JZA PCB LFDONE jump out if no more to scan 00002CC0 1527 LFLOOP LABEL 02CC0 60091260 0 4 ZBM 1528 LD R0 PCB,PCQUEUE get the queue number of this process 02CC1 18B02CFC 2 0 @ 1529 ADD R2 @LFWEIGHTS(R0) give it appropriate importance 02CC2 61091F14 4 4 ZBM 1530 LD PCB PCB,PCNXTCB get the (non-standard) forward pointer 02CC3 FB322CC0 4 1531 JNZA PCB LFLOOP go back to process all processes 00002CC4 1532 LFDONE LABEL 02CC4 DC0030A4 1533 CALL UNLOCKLIST release the list 02CC5 40001EB2 1534 PARL PCNTLLOCK 02CC6 1C802CF8 2 1535 MUL R2 LFNVS multiply by 'new' weight 02CC7 60401DD8 1 1536 LD R1 SCALEDLF get previous value 02CC8 EC120000 0 REG 1537 STZ R0 make double word 02CC9 1E002CF6 01 1538 MUL2 R0 LFOVS multiply by 'old' (decaying) weight 02CCA 18128000 0 2 REG 1539 ADD R0 R2 combine old and new 02CCB E4001DD8 0 1540 ST R0 SCALEDLF and save the newly found value 02CCC D00A0110 0 CBM 1541 INC R0/BITS 0:16 round it up 02CCD 600A0100 0 0 CBM 1542 LD R0 R0/BITS 0:15 extract integer part 02CCE E4001DD7 0 1543 ST R0 LOADFACT and save as real load factor 1544 * \ / 1545 1546 ********************************************************************************** 1547 * Adjust the CPU time scheduling variables in the * 1548 * running and runnable queues. * 1549 ********************************************************************************** 1550 02CCF 60C41DA9 3 IMM 1551 LD R3 ADR SQRUNNING => runnable queue 1552 PLOCK SQLOCKS(NQRUNNING) get access to the runnable queue 02CD0 0CC00000 1552 IOFF 02CD1 D1C01DBA 1552 SETT SQLOCKS(NQRUNNING) 02CD2 FE0C2CD4 1552 JNE MA(2+DISPW MA 0) 02CD3 DC40308B 1552 CALLNP LOCKWAIT 02CD4 DC402CFD 1553 CALLNP FIXSKVARS call to fix the run queue priority 1554 PUNLOCK SQLOCKS(NQRUNNING) release the queue 02CD5 EC001DBA 1554 STZ SQLOCKS(NQRUNNING) 02CD6 0C800000 1554 ION 1555 02CD7 60C41DAA 3 IMM 1556 LD R3 ADR SQRUNNABLE => runnable queue 1557 PLOCK SQLOCKS(NQRUNNABLE) get access to the runnable queue 02CD8 0CC00000 1557 IOFF 02CD9 D1C01DBB 1557 SETT SQLOCKS(NQRUNNABLE) 02CDA FE0C2CDC 1557 JNE MA(2+DISPW MA 0) 02CDB DC40308B 1557 CALLNP LOCKWAIT 02CDC DC402CFD 1558 CALLNP FIXSKVARS call to fix the run queue priority 1559 PUNLOCK SQLOCKS(NQRUNNABLE) release the queue 02CDD EC001DBB 1559 STZ SQLOCKS(NQRUNNABLE) 02CDE 0C800000 1559 ION 1560 1561 ********************************************************************************** 1562 * Scan the troublemaker queue. We look to see how many * 1563 * idle pages we have. If we have so few that the testtrouble * 1564 * routine is still shutting users down, we will just let the * 1565 * jailbirds rot. This has the effect of preventing the * 1566 * release of troublemakers into a known thrashing situation. * 1567 * Otherwise, the sentence remaining (PCQPARM) is decremented * 1568 * by half of the excess count. This has the effect of * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 520 (SCHED) F 29 Scheduler 1569 * rapidly removing troublemakers when a large number of idle * 1570 * pages have become available. * 1571 * A few interesting effects should be noted. When a * 1572 * very large user is shut down in SQTROUBLE, any dirty pages * 1573 * that he may have are queued up for write. They don't show * 1574 * up in the idle queue until the mass storage driver has had * 1575 * a chance to write them out. Therefore, the count of idle * 1576 * pages will not immediately jump to the higher value, which * 1577 * means that we don't start reducing his sentence immediately * 1578 * either. Just the effect that one may have wanted. * 1579 ********************************************************************************** 1580 1581 * \ / 02CDF 60C41DB9 3 IMM 1582 LD R3 ADR SQTROUBLE => to trouble maker PCB list 1583 PLOCK SQLOCKS(NQTROUBLE) call to lock the trouble maker queue 02CE0 0CC00000 1583 IOFF 02CE1 D1C01DCA 1583 SETT SQLOCKS(NQTROUBLE) 02CE2 FE0C2CE4 1583 JNE MA(2+DISPW MA 0) 02CE3 DC40308B 1583 CALLNP LOCKWAIT 02CE4 60001DDA 0 1584 LD R0 PPIDLCOUNT get idle page count 02CE5 10002543 0 1585 SUB R0 MMIDLETTMIN give no credit for minimum 02CE6 10001F18 0 1586 SUB R0 DISKRBUSY if system busy, let him rot longer 02CE7 54040001 0 IMM 1587 MAX R0 1 limit to positive 02CE8 600A01F0 0 0 CBM 1588 LD R0 R0/BITS 0:30 take half of excess count 00002CE9 1589 NEXTGUY LABEL 02CE9 FAF82CF3 34 1590 RLJZA R3 LISTEND jump at end of list 02CEA B016C801 0 3 BASE 1591 RSBM R0 R3,PCQPARM count down the length of sentence 02CEB FE042CE9 1592 JGT NEXTGUY jump if not down to zero yet 1593 * \ / 1594 1595 ********************************************************************************** 1596 * * 1597 * This user has served his sentence. We put him into * 1598 * the runnable queue and exit. Exitting directly avoids * 1599 * releasing two known troublemakers simultaneously. It also * 1600 * eases meeting the requirement that SQs may only be locked * 1601 * one at a time by a process. It also has the side effect of * 1602 * extending the sentence of users that we didn't get to on * 1603 * this scan. * 1604 * * 1605 ********************************************************************************** 1606 1607 * \ / 02CEC 6008DF10 0 3 ZBM 1608 LD R0 R3,PCQLINK load this guys forward pointer 02CED E4091F10 0 4 ZBM 1609 ST R0 R4,PCQLINK patch list around this guy 1610 PUNLOCK SQLOCKS(NQTROUBLE) call to release the trouble maker queue 02CEE EC001DCA 1610 STZ SQLOCKS(NQTROUBLE) 02CEF 0C800000 1610 ION 02CF0 6112C000 4 3 REG 1611 LD PCB R3 copy the PCB pointer 02CF1 DC402B99 1612 CALLNP SETRUNNING place this user into the running queue 02CF2 5D1F8001 6 STAK 1613 LEAVE POP 1614 * --- 1615 00002CF3 1616 LISTEND LABEL we have reached the end of the queue 1617 PUNLOCK SQLOCKS(NQTROUBLE) call to release the trouble maker queue 02CF3 EC001DCA 1617 STZ SQLOCKS(NQTROUBLE) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 521 (SCHED) F 29 Scheduler 02CF4 0C800000 1617 ION 02CF5 5D1F8001 6 STAK 1618 LEAVE POP 1619 * --- 1620 1621 * Constants used to compute the load factor. 02CF7 F3330000 1622 LFOVS VFD 0,0F3330000 scaled .95 02CF8 00000CCD 1623 LFNVS VFD 000000CCD scaled .05 02CF9 00000000 1624 LFWEIGHTAB VFDB 4:0,0A,0A,0,0A,0A,0A,0 table of weights 02CFA 00000000 1625 VFDB 4:0,0,0,0,0,0,0,0 02CFA 0000000A 1626 VFDB 4:0A 02CFC 01082CF9 1627 LFWEIGHTS PTR LFWEIGHTAB pointer to table 1628 1629 1630 END TICK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 522 (SCHED) F 29 Scheduler 1632 1633 ********************************************************************************** 1634 * * 1635 * FIXSKVARS * 1636 * This routine adjusts the scheduling values and * 1637 * increases the queue insertion value for each user in the * 1638 * indicated queue. * 1639 * Call: * 1640 * SP * 1641 * R3 => head of queue to be adjusted * 1642 * queue must be locked * 1643 * CALLNP FIXSKVARS * 1644 * * 1645 * * 1646 * Eats R0:R3. * 1647 * Stack required = 1. * 1648 * * 1649 ********************************************************************************** 1650 1651 BLOCK FIXSKVARS routine 1652 1653 ENTRY FIXSKVARS 1654 1655 BEGFRAME 1656 ENDFRAME 1657 02CFD DD5F8001 6 STAK 1658 FIXSKVARS ENTRNP PUSH 02CFE FAF42D0D 3 1659 LJZA R3 ENDCPUSC jump if at end of list 00002CFF 1660 PROCNEXT LABEL 02CFF 6088DF13 2 3 ZBM 1661 LD R2 R3,PCPSADRS get the PSA pointer 1662 02D00 6008810A 0 2 ZBM 1663 LD R0 R2,PSSUMCPU get the sum of the CPU time used recently 02D01 1C00254A 0 1664 MUL R0 TSHISTLOSS adjust by the aging factor 02D02 600A8180 0 2 CBM 1665 LD R0 R2/BITS 0:23 DIV 256 02D03 E408810A 0 2 ZBM 1666 ST R0 R2,PSSUMCPU and store back 1667 02D04 6008A10A 0 2 ZBM 1668 LD R0 R2,PSSUMSDT get the sum of the time spent shutdown 02D05 1C00254A 0 1669 MUL R0 TSHISTLOSS adjust by the aging factor 02D06 600A8180 0 2 CBM 1670 LD R0 R2/BITS 0:23 DIV 256 02D07 E408A10A 0 2 ZBM 1671 ST R0 R2,PSSUMSDT and store back 1672 02D08 70002549 0 1673 LDN R0 TSAGEVAL get the ageing value used to prevent starvation 02D09 9816C801 0 3 BASE 1674 ADDM R0 R3,PCQPARM reduce the QIV 02D0A FE062D0C 1675 JGE OKTOLINK jump if didn't count negative 02D0B EC16C801 3 BASE 1676 STZ R3,PCQPARM make stop at zero 00002D0C 1677 OKTOLINK LABEL 02D0C FAF62CFF 3 1678 LJNA R3 PROCNEXT go do next process 1679 * \ / 00002D0D 1680 ENDCPUSC LABEL 02D0D 5D1F8001 6 STAK 1681 LEAVE POP return to caller 1682 * --- 1683 1684 END of FIXSKVARS 1685 1686 1687 END misc scheduling routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 523 (PPLTWIDDLE) F 30 Scheduler 55 INPUT PPLTWIDDLE PPL manipulation routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 524 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 3 4 ********************************************************************************** 5 * * 6 * This block contains several routines for manipulating * 7 * the PPL lists. It will find pages on PPAGE or IDLE lists, * 8 * remove pages, and insert pages. * 9 * * 10 ********************************************************************************** 11 12 BLOCK PPL List Manipulation Routines 13 14 ENTRY FINDPPAGE Find a Page on the PPage List 15 ENTRY GETIDLE find any idle page 16 ENTRY GETIDLEPG Find Specific Idle Page 17 ENTRY PUTPPAGE Put a Page onto the PPage List 18 ENTRY PUTIDLE Put a Page onto the Idle List 19 ENTRY PUTIDLNL Put a Page onto the Idle List, don't lock PPIDLOCK 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 525 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 21 22 ********************************************************************************** 23 * * 24 * FINDPPAGE - Find a Page on the PPage List * 25 * * 26 * This routine will find a requested page on the PPage * 27 * list, and return a pointer to the PPL if it exists. * 28 * * 29 * CALL FINDPPAGE * 30 * PARVL block number * 31 * * 32 * * 33 * * 34 * Eats R0:R2, Sets PPL. * 35 * Stack required = 1. * 36 * 1 + max ( LOCKWAIT (0) ) * 37 * * 38 ********************************************************************************** 39 40 BLOCK FINDPPAGE subroutine 41 42 ENTRY FINDPPAGE 43 44 BEGFRAME 45 ENDFRAME 46 02D0E DD1F8001 6 STAK 47 FINDPPAGE ENTR PUSH 02D0F C0524000 1 REG 48 STPVL R1 R1 = block number 02D10 608A7460 2 1 CBM 49 LD R2 R1/PPHASHFLD get hash field 50 PLOCK PPAGELOCK(R2) lock the right PPage list 02D11 0CC00000 50 IOFF 02D12 D1E41E21 2 50 SETT PPAGELOCK(R2) 02D13 FE0C2D15 50 JNE MA(2+DISPW MA 0) 02D14 DC40308B 50 CALLNP LOCKWAIT 02D15 61241E61 4 2 51 LD PPL PPAGELIST(R2) PPL -> first one on list 02D16 3C570801 1 4 BASE 52 LSRCH R1 PPL,PPBLOCK find right one 02D17 FE022D1B 53 JEQ FOUND jump if found 54 PUNLOCK PPAGELOCK(R2) unlock the list if not found 02D18 EC241E21 2 54 STZ PPAGELOCK(R2) 02D19 0C800000 54 ION 55 * \ / 00002D1A 56 RETURN LABEL 02D1A 5D1F8001 6 STAK 57 LEAVE POP 58 * --- 59 00002D1B 60 FOUND LABEL 02D1B FBE02D1A 7 61 IRJ R7 RETURN page found, make skip return 62 * --- 63 64 END FINDPPAGE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 526 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 66 67 ********************************************************************************** 68 * * 69 * GETIDLE * 70 * Acquire an idle page. This routine will first attempt * 71 * to get a page from the clean idle list. If this list is * 72 * empty then we must get an idle page that already contains a * 73 * disk block. The so called 'unclean' IDLE lists are * 74 * searched in a round robin order as needed. * 75 * Call: * 76 * * 77 * CALLNP GETIDLE * 78 * * 79 * unlinked PPL for an available page> * 80 * * 81 * Eats R0:R1 Sets PPL. * 82 * Stack required = 1. * 83 * 1 + max ( LOCKWAIT (0) ) * 84 * * 85 ********************************************************************************** 86 87 BLOCK GETIDLE subroutine 88 89 ENTRY GETIDLE 90 91 BEGFRAME 92 ENDFRAME 93 02D1C DD5F8001 6 STAK 94 GETIDLE ENTRNP PUSH 95 PLOCK PPIDLOCK call to lock the idle page list 02D1D 0CC00000 95 IOFF 02D1E D1C01DD9 95 SETT PPIDLOCK 02D1F FE0C2D21 95 JNE MA(2+DISPW MA 0) 02D20 DC40308B 95 CALLNP LOCKWAIT 02D21 61001DDC 4 96 LD PPL PPCLNIDLE => idle page list head element 02D22 FB302D26 4 97 JZA PPL CHKUSDPPL if no clean PPLs, look at the used lists 02D23 60091F10 0 4 ZBM 98 LD R0 PPL,PPLINK get forward link in idle page list 02D24 E4001DDC 0 99 ST R0 PPCLNIDLE remove the current element from the list 02D25 FE0E2D38 100 JMP DECIDLCNT jump to adjust idle page count 101 * --- 102 00002D26 103 CHKUSDPPL LABEL 02D26 BC401DDB 1 104 INCL R1 PPLASTL get list to start searching 02D27 7844001F 1 IMM 105 AND R1 ONEBITS/IDLHASHFLD make count from 31 to 0 02D28 E4401DDB 1 106 ST R1 PPLASTL remember where we started 107 * \ / 108 00002D29 109 PPLOOP LABEL 02D29 61221DDD 4 1 110 LD PPL PPUSDIDLE(R1) get PPL from this list 02D2A FB322D33 4 111 JNZA PPL HAVEPPL looks like we have a live one 02D2B 18440001 1 IMM 112 ADD R1 1 increment our list index value 02D2C 7844001F 1 IMM 113 AND R1 ONEBITS/IDLHASHFLD make count from 31 to 0 02D2D 64401DDB 1 114 CPR R1 PPLASTL is this where we started? 02D2E FE0C2D29 115 JNE PPLOOP try another list if not 02D2F EC001DDA 116 STZ PPIDLCOUNT no idle pages left 117 * \ / give no-skip return 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 527 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 118 00002D30 119 RETURN0 LABEL 120 PUNLOCK PPIDLOCK call to release the idle page list 02D30 EC001DD9 120 STZ PPIDLOCK 02D31 0C800000 120 ION 02D32 5D1F8001 6 STAK 121 LEAVE POP return 122 * --- 123 00002D33 124 HAVEPPL LABEL 02D33 60091F10 0 4 ZBM 125 LD R0 PPL,PPLINK get pointer to remaining list 02D34 E4221DDD 0 1 126 ST R0 PPUSDIDLE(R1) and unlink us from the list 02D35 FA322D38 0 127 JNZA R0 DECIDLCNT jump if not the last one 02D36 38221DDD 0 1 128 LEA R0 PPUSDIDLE(R1) make a pointer to the head 02D37 E4221DFD 0 1 129 ST R0 PPENDIDLE(R1) adjust the end pointer 130 * \ / 131 00002D38 132 DECIDLCNT LABEL 02D38 D0401DDA 133 DEC PPIDLCOUNT decrease count of available pages 02D39 EC090052 4 ZBM 134 STZ PPL,PPCNTL ensure control bits cleared (insurance) 02D3A FBE02D30 7 135 IRJ R7 RETURN0 advance to success return 136 * --- 137 138 END GETIDLE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 528 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 140 141 ********************************************************************************** 142 * * 143 * * 144 * GETIDLEPG. * 145 * This routine will find and remove a specific page from * 146 * the idle page list. This routine locks the IDLE list. * 147 * Call: * 148 * CALL GETIDLEPG * 149 * PARVL block number * 150 * * 151 * * 152 * * 153 * Eats R0:R2, Sets PPL. * 154 * Stack required = 2. * 155 * 2 + max ( LOCKWAIT (0) ) * 156 * * 157 ********************************************************************************** 158 159 BLOCK GETIDLEPG subroutine 160 161 ENTRY GETIDLEPG 162 163 BEGFRAME 00178801 6 BASE 164 SAVEREG BSS 1 place to save a register 165 ENDFRAME 166 02D3B DD1F8002 6 STAK 167 GETIDLEPG ENTR PUSH 02D3C C0524000 1 REG 168 STPVL R1 R1 = block number 02D3D 608A7650 2 1 CBM 169 LD R2 R1/IDLHASHFLD generate list index 170 PLOCK PPIDLOCK lock the idle list 02D3E 0CC00000 170 IOFF 02D3F D1C01DD9 170 SETT PPIDLOCK 02D40 FE0C2D42 170 JNE MA(2+DISPW MA 0) 02D41 DC40308B 170 CALLNP LOCKWAIT 02D42 E5578801 5 6 BASE 171 ST R5 SP,SAVEREG need to save away this register 02D43 61241DDD 4 2 172 LD PPL PPUSDIDLE(R2) PPL -> first page on idle list 02D44 39641DDD 5 2 173 LEA R5 PPUSDIDLE(R2) address of the list head 02D45 48570801 1 4 BASE 174 RLSRCH R1 PPL,PPBLOCK find right page 02D46 FE0C2D4D 175 JNE RETURN jump if not found 02D47 60091F10 0 4 ZBM 176 LD R0 PPL,PPLINK get the PPL we point to 02D48 E4095F10 0 5 ZBM 177 ST R0 R5,PPLINK remove us from the list 02D49 FA322D4B 0 178 JNZA R0 NOTLAST jump if not removing the last PPL 02D4A E5641DFD 5 2 179 ST R5 PPENDIDLE(R2) do a fixup on the tail pointer 180 * \ / 181 00002D4B 182 NOTLAST LABEL 02D4B D0401DDA 183 DEC PPIDLCOUNT say one fewer idle page 02D4C 19C40001 7 IMM 184 ADD R7 1 skip return 185 * \ / 186 00002D4D 187 RETURN LABEL 02D4D 61578801 5 6 BASE 188 LD R5 SP,SAVEREG need to restore this register 189 PUNLOCK PPIDLOCK unlock the list 02D4E EC001DD9 189 STZ PPIDLOCK 02D4F 0C800000 189 ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 529 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 02D50 5D1F8002 6 STAK 190 LEAVE POP 191 * --- 192 193 END GETIDLEPG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 530 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 195 196 ********************************************************************************** 197 * * 198 * PUTIDLE. * 199 * This routine will put a page onto one of the idle page * 200 * lists. If the PPBLOCK field is zero, it will go onto the * 201 * head of the PPCLNIDLE list. If the field is not zero it * 202 * will be place on the appropriate PPIDLE list. Which list * 203 * depends on the hash value defined by IDLEHASHFLD (see * 204 * COREDEFS). If the lists were empty prior to putting this * 205 * element on, then we set the dispatcher flags for MSPROC and * 206 * free storage expansion, since either of these may have been * 207 * waiting on idle pages. A second entry to this routine * 208 * exists for those callers who already have PPIDLOCK held. * 209 * Call: * 210 * LD PPL => PPL for page * 211 * CALLNP PUTIDLE * 212 * * 213 * Eats R0:R1. * 214 * Stack required = 1. * 215 * 1 + max ( LOCKWAIT (0) ) * 216 * * 217 ********************************************************************************** 218 219 BLOCK PUTIDLE subroutine 220 221 ENTRY PUTIDLE 222 ENTRY PUTIDLNL 223 224 BEGFRAME 225 ENDFRAME 226 02D51 DD5F8001 6 STAK 227 PUTIDLE ENTRNP PUSH 228 PLOCK PPIDLOCK lock the idle list 02D52 0CC00000 228 IOFF 02D53 D1C01DD9 228 SETT PPIDLOCK 02D54 FE0C2D56 228 JNE MA(2+DISPW MA 0) 02D55 DC40308B 228 CALLNP LOCKWAIT 229 * \ / 230 00002D56 231 SHAREIDLE LABEL 02D56 6005FFFF 0 IMM 232 LD R0 ONEBITS/FLDADRS mask to clean out busy count 02D57 A8170802 0 4 BASE 233 BRSBM R0 PPL,PPBUSYWORD clear the busy count 02D58 60170801 0 4 BASE 234 LD R0 PPL,PPBLOCK get the disk address 02D59 FA0C2D5E 0 235 JNEZ R0 HAVEDATA jump if something in this block 02D5A 60001DDC 0 236 LD R0 PPCLNIDLE get pointer to list of clean pages 02D5B E4091F10 0 4 ZBM 237 ST R0 PPL,PPLINK add this one in 02D5C E5001DDC 4 238 ST PPL PPCLNIDLE this one head of the list 02D5D FE0E2D63 239 JMP PUTDONE jump for finishing touches 240 * --- 241 00002D5E 242 HAVEDATA LABEL 02D5E EC091F10 4 ZBM 243 STZ PPL,PPLINK clear link field 02D5F 604A3650 1 0 CBM 244 LD R1 R0/IDLHASHFLD get the list index 02D60 60221DFD 0 1 245 LD R0 PPENDIDLE(R1) get last PPL in this list 02D61 E5081F10 4 0 ZBM 246 ST PPL R0,PPLINK place this PPL in the rear 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 531 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 02D62 E5221DFD 4 1 247 ST PPL PPENDIDLE(R1) this one is new tail 248 * \ / 249 00002D63 250 PUTDONE LABEL 02D63 BC401DDA 1 251 INCL R1 PPIDLCOUNT one more idle page 252 PUNLOCK PPIDLOCK unlock the list 02D64 EC001DD9 252 STZ PPIDLOCK 02D65 0C800000 252 ION 253 02D66 FA622D69 1 254 DRJ R1 RETURN jump if list was not empty 02D67 60040005 0 IMM 255 LD R0 1*BIT FLMSPROC+1*BIT FLFSX 02D68 FC001CF6 0 256 IORM R0 FLAGS set flags for storage expand & msproc 257 * \ / 258 00002D69 259 RETURN LABEL 02D69 5D1F8001 6 STAK 260 LEAVE POP 261 * --- 262 263 ********************************************************************************** 264 * * 265 * PUTIDLNL. * 266 * This routine will put a page onto one of the idle page * 267 * lists. The following version of the call requires PPIDLOCK * 268 * to be acquired before the call. * 269 * Call: * 270 * LD PPL => PPL for page * 271 * * 272 * CALLNP PUTIDLNL * 273 * * 274 ********************************************************************************** 275 02D6A DD5F8001 6 STAK 276 PUTIDLNL ENTRNP PUSH 02D6B FE0E2D56 277 JMP SHAREIDLE jump to share some code 278 * --- 279 280 END PUTIDLE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 532 (PPLTWIDDLE) F 30 PPL List Manipulation Routines 282 283 ********************************************************************************** 284 * * 285 * PUTPPAGE. * 286 * This routine will put a PPL onto the appropriate * 287 * PPage list. PPBLOCK and PPBUSYWORD must be correct. * 288 * Call: * 289 * LD PPL => PPL for page * 290 * CALLNP PUTPPAGE * 291 * * 292 * Eats R0:R2. * 293 * Stack required = 1. * 294 * 1 + max ( LOCKWAIT (0) ) * 295 * * 296 ********************************************************************************** 297 298 BLOCK PUTPPAGE subroutine 299 300 ENTRY PUTPPAGE 301 302 BEGFRAME 303 ENDFRAME 304 02D6C DD5F8001 6 STAK 305 PUTPPAGE ENTRNP PUSH 02D6D 60893461 2 4 ZBM 306 LD R2 PPL,PPBLOCK/PPHASHFLD get hash value for block 307 PLOCK PPAGELOCK(R2) lock the list 02D6E 0CC00000 307 IOFF 02D6F D1E41E21 2 307 SETT PPAGELOCK(R2) 02D70 FE0C2D72 307 JNE MA(2+DISPW MA 0) 02D71 DC40308B 307 CALLNP LOCKWAIT 02D72 60241E61 0 2 308 LD R0 PPAGELIST(R2) get pointer to head of list 02D73 E4091F10 0 4 ZBM 309 ST R0 PPL,PPLINK put current list after us 02D74 E5241E61 4 2 310 ST PPL PPAGELIST(R2) put us at head of list 311 PUNLOCK PPAGELOCK(R2) unlock the list 02D75 EC241E21 2 311 STZ PPAGELOCK(R2) 02D76 0C800000 311 ION 02D77 5D1F8001 6 STAK 312 LEAVE POP 313 * --- 314 315 END PUTPPAGE subroutine 316 317 318 END PPL List Manipulation Routines 56 INPUT FREEZER routines to cool the system 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 533 (FREEZER) F 31 FREEZER - System Freeze and Unfreeze Routines 3 4 FREEZER BLOCK System Freeze Routines 5 6 ENTRY FREEZE freeze the system 7 ENTRY UNFREEZE unfreeze the system 8 ENTRY FREEZEWAIT wait for someone else to unfreeze 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 534 (FREEZER) F 31 FREEZER - System Freeze and Unfreeze Routines 10 11 ********************************************************************************** 12 * * 13 * FREEZE * 14 * Call FREEZE when you need to do something strange to the * 15 * system, and there is no lock to protect what you need to do. * 16 * When FREEZE returns, all other CPU's in the system are idling, * 17 * waiting for you to call UNFREEZE. Also, all active processes * 18 * (including the one on the CPU that called FREEZE) are shut down. * 19 * This is so that: * 20 * 1) Every process is on some SQ, so they are easy to find. * 21 * 2) All of the page files are unloaded, so you can play with * 22 * people's VASP lists without much hassle. * 23 * 3) Processes are not charged for the time that they are frozen * 24 * by someone else. * 25 * * 26 * When FREEZE returns, the interrupts are off, and you MUST NOT * 27 * (under penalty of hanging) fault, or do anything else that might * 28 * cause the dispatcher to be entered. * 29 * Call: * 30 * NO LOCKS HELD! * 31 * SP = stack pointer * 32 * CALLNP FREEZE * 33 * * 34 * Eats R0:R3. * 35 * Stack required = 14. * 36 * 2 + max ( FREEZEWAIT (12), LOCKWAIT (0), SHUTRUN (11) ) * 37 * * 38 ********************************************************************************** 39 40 BLOCK FREEZE subroutine 41 ENTRY FREEZE 42 43 BEGFRAME 00178801 6 BASE 44 FREEZER4 BSS 1 temp for register save 45 ENDFRAME 46 02D78 00030004 47 IAPRPROTO VFD BUSCWRITE+CPUCOFFSET+CPUIAPR IAPR command 48 02D79 DD5F8002 6 STAK 49 FREEZE ENTRNP PUSH 02D7A E5178801 4 6 BASE 50 ST R4 SP,FREEZER4 save some registers 02D7B 0CC00000 51 IOFF 52 00002D7C 53 FREEZELOOP LABEL 02D7C 60030000 0 IMM 54 LD R0 1*BIT FLFREEZE get the freeze bit 02D7D FC001CF6 0 55 IORM R0 FLAGS set in dispatcher flags 02D7E FE0C2D81 56 JNE MYTURN jump if not already set 02D7F DC402D9A 57 CALLNP FREEZEWAIT some else is freezing -- 58 * let him go first 02D80 FE0E2D7C 59 JMP FREEZELOOP try again when he is done 60 * --- 61 00002D81 62 MYTURN LABEL 02D81 60000412 0 63 LD R0 CPPSA R0 -> my PSA, if any 02D82 FA302D84 0 64 JZA R0 TELLOTHERS jump if none 02D83 DC402B88 65 CALLNP SHUTRUN suspend process back on runnable queue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 535 (FREEZER) F 31 FREEZER - System Freeze and Unfreeze Routines 66 * \ / 67 68 ********************************************************************************** 69 * * 70 * Interrupt all other processors so that they will go through * 71 * the dispatcher and notice that they should freeze. * 72 * * 73 ********************************************************************************** 74 75 * \ / 00002D84 76 TELLOTHERS LABEL 02D84 60801CF7 2 77 LD R2 CPUCOUNT get number of CPU's 00002D85 78 TELLONE LABEL 02D85 60641CFA 1 2 79 LD R1 CPUSLOTS(R2-1) get a CPU slot number 02D86 64400415 1 80 CPR R1 OURSLOT is it us? 02D87 FE022D8F 81 JEQ TELLNEXT skip if yes 82 PLOCK CPUCOMLOCK reserve this critical region 02D88 0CC00000 82 IOFF 02D89 D1C01CF5 82 SETT CPUCOMLOCK 02D8A FE0C2D8C 82 JNE MA(2+DISPW MA 0) 02D8B DC40308B 82 CALLNP LOCKWAIT 02D8C 0C402D78 83 STTB IAPRPROTO else send him an IAPR 84 PUNLOCK CPUCOMLOCK release the critical region 02D8D EC001CF5 84 STZ CPUCOMLOCK 02D8E 0C800000 84 ION 00002D8F 85 TELLNEXT LABEL 02D8F FAA22D85 2 86 DRJ R2 TELLONE loop through all CPU's 87 * \ / 88 89 ********************************************************************************** 90 * * 91 * Wait for all other CPU's to freeze. * 92 * * 93 ********************************************************************************** 94 95 * \ / 00002D90 96 WAIT4OTHER LABEL 02D90 60001CF8 0 97 LD R0 CPUCOUNT1 number of unfrozen CPU's 02D91 64040001 0 IMM 98 CPR R0 1 02D92 FE042D90 99 JGT WAIT4OTHER jump if more than us 100 * \ / 02D93 61178801 4 6 BASE 101 LD R4 FREEZER4 restore some registers 02D94 5D1F8002 6 STAK 102 LEAVE POP return 103 * --- (many are cold, but few are frozen) 104 105 END FREEZE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 536 (FREEZER) F 31 FREEZER - System Freeze and Unfreeze Routines 107 108 ********************************************************************************** 109 * * 110 * UNFREEZE * 111 * Routine to undo the effect of FREEZE, and let the system run again. * 112 * Call: * 113 * SP = stack pointer * 114 * CALLNP UNFREEZE * 115 * * 116 * Eats R0. * 117 * Stack required = 1. * 118 * * 119 ********************************************************************************** 120 121 BLOCK UNFREEZE subroutine 122 ENTRY UNFREEZE 123 124 BEGFRAME 125 ENDFRAME 126 02D95 DD5F8001 6 STAK 127 UNFREEZE ENTRNP PUSH 02D96 60030000 0 IMM 128 LD R0 1*BIT FLFREEZE 02D97 A8001CF6 0 129 BRSBM R0 FLAGS turn off the freeze flag 02D98 0C800000 130 ION undo IOFF in FREEZE 02D99 5D1F8001 6 STAK 131 LEAVE POP 132 * --- 133 134 END UNFREEZE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 537 (FREEZER) F 31 FREEZER - System Freeze and Unfreeze Routines 136 137 ********************************************************************************** 138 * * 139 * FREEZEWAIT * 140 * Routine to idle while some other CPU has the system frozen. * 141 * We are called by the dispatcher (normal case) or by FREEZE (when * 142 * two CPU's simultaneously try to freeze the system). Call: * 143 * Interrupts off, no locks held * 144 * SP = stack pointer * 145 * CALLNP FREEZEWAIT * 146 * * 147 * Eats R0:R4. * 148 * Stack required = 12. * 149 * 1 + max ( SHUTRUN (11) ) * 150 * * 151 ********************************************************************************** 152 153 BLOCK FREEZEWAIT subroutine 154 ENTRY FREEZEWAIT 155 156 BEGFRAME 157 ENDFRAME 158 02D9A DD5F8001 6 STAK 159 FREEZEWAIT ENTRNP PUSH 02D9B 60000412 0 160 LD R0 CPPSA get current PSA, if any 02D9C FA302D9E 0 161 JZA R0 NOSHUTDOWN skip shutdown in no PSA 02D9D DC402B88 162 CALLNP SHUTRUN put back onto SQRUNNABLE 163 * \ / 00002D9E 164 NOSHUTDOWN LABEL 02D9E D0401CF8 165 DEC CPUCOUNT1 say we are idling 02D9F 60041CF6 0 IMM 166 LD R0 ADR FLAGS 00002DA0 167 WAITLOOP LABEL 02DA0 5C080010 0 ZBM 168 CMZ R0,0/BIT FLFREEZE are we still frozen? 02DA1 FE0C2DA0 169 JNE WAITLOOP jump if yes 170 * \ / 02DA2 D0001CF8 171 INC CPUCOUNT1 say we are no longer frozen 02DA3 59840400 IMM 172 CLBMSR 1*MSRIAPRB clear IAPR pending 02DA4 5D1F8001 6 STAK 173 LEAVE POP and return 174 * --- 175 176 END FREEZEWAIT subroutine 177 178 179 END FREEZER System Freeze Routines 57 INPUT LIQUID PSA destroyer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 538 (LIQUID) F 32 Liquidate a process 3 4 LIQUID BLOCK discard routines 5 6 ENTRY DISCARDPAL to discard a single PAL 7 ENTRY LIQUIDATE destroy a PSA 8 ENTRY LIQUIDINIT destroy initial process 9 ENTRY PAGEREADY a page has become ready 10 ENTRY QDISK to queue up a disk transfer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 539 (LIQUID) F 32 Liquidate a process 12 13 ********************************************************************************** 14 * * 15 * Routine to destroy the current PSA. It assumes the following * 16 * things have been done: * 17 * - user limit block has been released * 18 * - over-process VP list is empty * 19 * - lunlist is empty * 20 * * 21 * JMP LIQUIDATE * 22 * * 23 * * 24 * Stack required = 7. * 25 * 0 + max ( CPUPFLOAD (0), DISCARDPAL (4), FCFREEMEM (0), * 26 * FREECA (2), FREEMEMPAGE (1), GRUBPAGE (7), * 27 * LOCKLIST (1), LOCKWAIT (0), MAPINMEM (3), * 28 * PUTIDLE (1), SFREEMEM (0), SHACCT (3), * 29 * SHDEQUE (3), UNLOCKLIST (1) ) * 30 * * 31 ********************************************************************************** 32 33 BLOCK LIQUIDATE routine 34 ENTRY LIQUIDATE 35 ENTRY LIQUIDINIT 36 37 ********************************************************************************** 38 * * 39 * Special entry for finishing up INITPROC and freeing its * 40 * page. * 41 * * 42 * PPL -> INITPROC's final PPL * 43 * PFPTR = INITPROC's final page number * 44 * JMP LIQUIDINIT * 45 * * 46 ********************************************************************************** 47 00002DA5 48 LIQUIDINIT LABEL 02DA5 0CC00000 49 IOFF no interrupts while doing this 02DA6 DC002FCB 50 CALL CPUPFLOAD unload for all CPUs 02DA7 41440000 IMM 51 PARV 0 sez to exclude page 02DA8 4052C000 3 REG 52 PARVL PFPTR pass PF location 02DA9 6184044D 6 IMM 53 LD SP ADR RESSTAK need a stack for PUTIDLE 02DAA DC402D51 54 CALLNP PUTIDLE give up INITPROC page 02DAB EDF61CC6 3 @ 55 STW @PAVPAGES(PFPTR) make page available for free storage 56 00002DAC 57 LIQUIDATE LABEL 02DAC 0CC00000 58 IOFF no interrupts while doing this 02DAD 0144041E IMM 59 LDCAR ADR PCONSOLE 02DAE 6184044D 6 IMM 60 LD SP ADR RESSTAK 02DAF 61400412 5 61 LD R5 CPPSA R5 -> our PSA 02DB0 61094116 4 5 ZBM 62 LD R4 R5,PSCURRPROC get current UPC pointer 63 * \ / 64 65 ********************************************************************************** 66 * Release the VP list. Grubpage also gets rid of the * 67 * page access elements in the PSVASP list. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 540 (LIQUID) F 32 Liquidate a process 68 * We run this loop for both the window list and the regular * 69 * VM list. * 70 ********************************************************************************** 71 72 * \ / 00002DB1 73 DOVMLIST LABEL 02DB1 60D7080D 3 4 BASE 74 LD R3 R4,UPCVMLIST => first element in the VPAGE list 02DB2 FAF02DB6 3 75 JZA R3 DOWVMLIST jump if the list is now empty 02DB3 6016C004 0 3 CACH 76 LD R0 R3,VPVPN get the virtual page number 02DB4 DC4030E4 77 CALLNP GRUBPAGE get rid of this page 02DB5 FE0E2DB1 78 JMP DOVMLIST back to do another element 79 * --- 80 81 * \ / 00002DB6 82 DOWVMLIST LABEL 02DB6 60D7080E 3 4 BASE 83 LD R3 R4,UPCWVMLIST => first element in the window VP list 02DB7 FAF02DBB 3 84 JZA R3 VMLISTDN jump if the list is now empty 02DB8 6016C004 0 3 CACH 85 LD R0 R3,VPVPN get the virtual page number 02DB9 DC4030E4 86 CALLNP GRUBPAGE get rid of this page 02DBA FE0E2DB1 87 JMP DOVMLIST back to do another element 88 * --- 89 90 ********************************************************************************** 91 * * 92 * Release the remainder of the VASP list. Since we have * 93 * grubbed all user pages, what remains here are the monitor * 94 * pages. * 95 * We call SHACCT primarily to kill the quantum interrupt * 96 * request so that it doesn't come back to haunt the chunk of * 97 * free storage that contained the PSA. While SHACCT performs * 98 * other, yet extraneous, tasks we still use it for the sake * 99 * of generality. * 100 * * 101 ********************************************************************************** 102 00002DBB 103 VMLISTDN LABEL 104 PLOCK SQLOCKS(NQRUNNING) lock the running queue 02DBB 0CC00000 104 IOFF 02DBC D1C01DBA 104 SETT SQLOCKS(NQRUNNING) 02DBD FE0C2DBF 104 JNE MA(2+DISPW MA 0) 02DBE DC40308B 104 CALLNP LOCKWAIT 02DBF DC402BBD 105 CALLNP SHDEQUE unload PF and remove PCB from queue 02DC0 DC0025EB 106 CALL MAPINMEM re-map users virtual free storage lists 02DC1 40534000 5 REG 107 PARVL R5 pointer to the PSA 02DC2 DC402BD4 108 CALLNP SHACCT kill timer quantum, etc. 02DC3 61C94116 7 5 ZBM 109 LD R7 R5,PSCURRPROC get current UPC pointer 110 * \ / 00002DC4 111 DOVASPLIST LABEL 02DC4 6117C80F 4 7 BASE 112 LD PAL R7,UPCVASP => first element in the VASP list 02DC5 FB302DCA 4 113 JZA PAL VASPLISTDN jump if list is now empty 02DC6 60091F10 0 4 ZBM 114 LD R0 PAL,PALINK get the link to the rest of the list 02DC7 E417C80F 0 7 BASE 115 ST R0 R7,UPCVASP remove us from the list 02DC8 DC402E15 116 CALLNP DISCARDPAL get rid of this page 02DC9 FE0E2DC4 117 JMP DOVASPLIST back to do another element 118 * --- 119 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 541 (LIQUID) F 32 Liquidate a process 120 ********************************************************************************** 121 * Release the working set extension list. It may have * 122 * all sorts of leftovers in it. * 123 ********************************************************************************** 124 00002DCA 125 VASPLISTDN LABEL 00002DCA 126 DOWSXLIST LABEL 02DCA 6117C810 4 7 BASE 127 LD PAL R7,UPCWSX => first element in the WSX list 02DCB FB302DD0 4 128 JZA PAL WSXLISTDN jump if list is now empty 02DCC 60091F10 0 4 ZBM 129 LD R0 PAL,PALINK get the link to the rest of the list 02DCD E417C810 0 7 BASE 130 ST R0 R7,UPCWSX remove us from the list 02DCE DC402E15 131 CALLNP DISCARDPAL get rid of this page 02DCF FE0E2DCA 132 JMP DOWSXLIST back to do another element 133 * --- 134 135 * Release PCB associated herewith 136 00002DD0 137 WSXLISTDN LABEL 02DD0 DC003096 138 CALL LOCKLIST grab the PCB list 02DD1 40001EB2 139 PARL PCNTLLOCK 02DD2 61001EB1 4 140 LD PCB PCONTROL load pointer to first element 02DD3 60440000 1 IMM 141 LD R1 0 indicate at beginning of list 02DD4 FE0E2DD9 142 JMP FINDPCBX enter loop 143 * --- 144 00002DD5 145 FINDPCB LABEL 02DD5 60530000 1 4 REG 146 LD R1 PCB copy the current element pointer 02DD6 61085F14 4 1 ZBM 147 LD PCB R1,PCNXTCB advance down the (non-standard) list 02DD7 FB322DD9 4 148 JNZA PCB FINDPCBX jump if another element in list 02DD8 00130030 149 HALT HALTS0030 no PCB found for this process 150 * --- 151 00002DD9 152 FINDPCBX LABEL 02DD9 65491F13 5 4 ZBM 153 CPR R5 PCB,PCPSADRS is this our element? 02DDA FE0C2DD5 154 JNE FINDPCB jump if more looking needed 02DDB 60091F14 0 4 ZBM 155 LD R0 PCB,PCNXTCB 02DDC FA422DDF 1 156 JEQZ R1 FNDPCBFRST jump if our PCB first in list 02DDD E4085F14 0 1 ZBM 157 ST R0 R1,PCNXTCB unlink our element 02DDE FE0E2DE0 158 JMP FNDPCBNFST 159 * --- 160 00002DDF 161 FNDPCBFRST LABEL 02DDF E4001EB1 0 162 ST R0 PCONTROL our PCB was first, remove from list 00002DE0 163 FNDPCBNFST LABEL 02DE0 D0401EB0 164 DEC PCCOUNT count one removal 02DE1 600900C3 0 4 ZBM 165 LD R0 PCB,PCPROCNUM get process # 02DE2 EDF01EB3 0 @ 166 STW @PPCNUMARR(R0) say # is available 02DE3 DC0030A4 167 CALL UNLOCKLIST release this list 02DE4 40001EB2 168 PARL PCNTLLOCK 02DE5 DC002F5D 169 CALL SFREEMEM destroy this PCB 02DE6 41440003 IMM 170 PARV PCBLOG 02DE7 40530000 4 REG 171 PARVL PCB 172 * \ / 173 174 ********************************************************************************** 175 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 542 (LIQUID) F 32 Liquidate a process 176 * Wait for transient lookers to go away. * 177 * * 178 ********************************************************************************** 179 180 * \ / 00002DE8 181 WAIT4LOK LABEL 02DE8 5C17480C 5 BASE 182 CMZ R5,PSLOCK wait for him to be done 02DE9 FE0C2DE8 183 JNE WAIT4LOK busy wait 184 * \ / 185 186 ********************************************************************************** 187 * Here we return the console areas to free storage. * 188 ********************************************************************************** 189 190 * \ / 00002DEA 191 CAZOTLOOP LABEL 02DEA 60095F10 0 5 ZBM 192 LD R0 R5,PSCACHN get head pointer 02DEB 6056080C 1 0 BASE 193 LD R1 R0,CALINK get pointer to second in chain 02DEC FA702DF1 1 194 JZA R1 DOLASTCA jump if R0 => last CA 02DED E4495F10 1 5 ZBM 195 ST R1 R5,PSCACHN delink head 02DEE DC00283E 196 CALL FREECA free old head and stack 02DEF 40520000 0 REG 197 PARVL R0 pass address 02DF0 FE0E2DEA 198 JMP CAZOTLOOP continue 199 * --- 200 201 ********************************************************************************** 202 * * 203 * This last console area does NOT have a stack associated * 204 * with it. The console area was created in BLDPROCESS and its * 205 * only purpose in life was to initialize registers and status * 206 * registers for a virgin process. Once this process suspends * 207 * execution for the first and any subsequent times a new console * 208 * area with stack is acquired. * 209 * * 210 ********************************************************************************** 211 00002DF1 212 DOLASTCA LABEL 02DF1 DC002F5D 213 CALL SFREEMEM free just the CA memory 02DF2 41440004 IMM 214 PARV CALOG pass size 02DF3 40495F10 5 ZBM 215 PARVL R5,PSCACHN and location 216 217 * Remove any leftover error elements. No lock needed because PCB unlinked. 00002DF4 218 ZOTUERROR LABEL 02DF4 60C95F1D 3 5 ZBM 219 LD R3 R5,PSUERROR/FLDADRS get the error list pointer 02DF5 FAF02DFC 3 220 JZA R3 NOMOREERR jump if no more in list 02DF6 6008DF10 0 3 ZBM 221 LD R0 R3,UERLINK get link to the next error element 02DF7 E4095F1D 0 5 ZBM 222 ST R0 R5,PSUERROR/FLDADRS remove this one from list 02DF8 DC002F5D 223 CALL UFREEMEM call to release memory 02DF9 41440001 IMM 224 PARV UERLOG indicate the blocks length 02DFA 4052C000 3 REG 225 PARVL R3 and address 02DFB FE0E2DF4 226 JMP ZOTUERROR jump to try for another 227 * --- 228 00002DFC 229 NOMOREERR LABEL 230 * \ / 231 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 543 (LIQUID) F 32 Liquidate a process 232 ********************************************************************************** 233 * * 234 * Remove the program control block that should be in * 235 * the PSA for the program that was running in this process * 236 * and asked to do a VANISH. To keep the system on its * 237 * toes, we go to the trouble of checking to make sure that * 238 * the UPC block that we are freeing is indeed the one and * 239 * only UPC block on this PSA. * 240 * * 241 ********************************************************************************** 242 243 * \ / 02DFC 60C94116 3 5 ZBM 244 LD R3 R5,PSCURRPROC get pointer to current block 02DFD FAF22DFF 3 245 JNZA R3 YESCURR there should be one, so jump 02DFE 00130031 246 HALT HALTS0031 someone flushed our PCB 247 * --- 248 00002DFF 249 YESCURR LABEL 02DFF 64C95F15 3 5 ZBM 250 CPR R3 R5,PSPROCLIST are we on the top? 02E00 FE022E02 251 JEQ YESONTOP yes, CM is the one doing it 02E01 00130032 252 HALT HALTS0032 multiple levels flushing? 253 * --- 254 00002E02 255 YESONTOP LABEL 02E02 5C08DF10 3 ZBM 256 CMZ R3,UPCSONPTR are we the only level? 02E03 FE022E05 257 JEQ FLUSHUERRS is so, zap us 02E04 00130033 258 HALT HALTS0033 VANISH request with under levels 259 * --- 260 00002E05 261 FLUSHUERRS LABEL 02E05 6088DF1B 2 3 ZBM 262 LD R2 R3,UPCUERROR/FLDADRS get the error list pointer 02E06 FAB02E0D 2 263 JZA R2 FREEUPC jump if no more in list 02E07 60089F10 0 2 ZBM 264 LD R0 R2,UERLINK get link to the next error element 02E08 E408DF1B 0 3 ZBM 265 ST R0 R3,UPCUERROR/FLDADRS remove this one from list 02E09 DC002F5D 266 CALL UFREEMEM call to release memory 02E0A 41440001 IMM 267 PARV UERLOG indicate the blocks length 02E0B 40528000 2 REG 268 PARVL R2 and address 02E0C FE0E2E05 269 JMP FLUSHUERRS jump to try for another 270 * --- 271 00002E0D 272 FREEUPC LABEL 02E0D DC002F8F 273 CALL UPCFREEMEM call to release the block 02E0E 41440005 IMM 274 PARV UPCLOG indicate its length 02E0F 40494116 5 ZBM 275 PARVL R5,PSCURRPROC and address 276 * \ / 277 278 ********************************************************************************** 279 * * 280 * Discard the PSA. * 281 * There must be no other lists attached to the PSA at this point. * 282 * Since this process is about to go away we can also free the users free * 283 * memory lists. We unmap the page and return the page back to the idle * 284 * page list. * 285 * * 286 ********************************************************************************** 287 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 544 (LIQUID) F 32 Liquidate a process 288 * \ / 02E10 DC402FEA 289 CALLNP FREEMEMPAGE release the free storage lists page 290 * At this point all of the users virtual free storage lists should have 291 * been returned to the system. No attempt is made to make sure that 292 * all elements have been properly freed. No doubt that there should 293 * be. 02E11 DC002F5D 294 CALL UFREEMEM call to free up a block of free storage 02E12 41440005 IMM 295 PARV PSLOG this long 02E13 40534000 5 REG 296 PARVL R5 at this location 02E14 FE0E28B7 297 JMP DISPATCH go run some user 298 * --- 299 300 END LIQUIDATE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 545 (LIQUID) F 32 Liquidate a process 302 303 ********************************************************************************** 304 * * 305 * DISCARDPAL (should auld acquaintance be forgot?) * 306 * Routine to dispose of an unlinked Page Access eLement. * 307 * If the page has been modified, it remains in the PPAGE list * 308 * and has a write queue element produced for it. The write * 309 * queue element will be placed into the write queue for the * 310 * appropriate MS unit. It is the callers responsibility to * 311 * decrement PSWSSIZE, because we don't have a PSA pointer. * 312 * This routine shares code with DONEPPL. * 313 * Call with: * 314 * page file unloaded! * 315 * no lists locked except MSQIN and an SQ * 316 * SP = stack pointer * 317 * CALLNP DISCARDPAL PAL => unlinked page access element * 318 * * 319 * Eats R0:R3, PAL. * 320 * Stack required = 4. * 321 * 1 + max ( DISMOUNT (3), FCFREEMEM (0), LOCKWAIT (0), * 322 * MSREADREQ (1), PUTADT (3), PUTIDLNL (1), * 323 * QDISK (1), SGETMEM (0) ) * 324 * * 325 ********************************************************************************** 326 327 BLOCK DISCARDPAL and DONEPPL subroutines 328 ENTRY DISCARDPAL 329 ENTRY DONEPPL 330 331 BEGFRAME 332 ENDFRAME 333 02E15 DD5F8001 6 STAK 334 DISCARDPAL ENTRNP PUSH 02E16 60D70803 3 4 BASE 335 LD R3 PAL,PAPPLPTR pick up PPL pointer 336 337 * R3 => PPAGE element, PAL 338 02E17 5C091C12 4 ZBM 339 CMZ PAL,PAMODIFIED did this user alter the page? 02E18 ED8AC010 3 CBM 340 STLNE R3/BIT 0 save in R3/bit 0 02E19 DC002F8F 341 CALL PFREEMEM discard the old PAL 02E1A 41440002 IMM 342 PARV PALOG indicate the block size 02E1B 40530000 4 REG 343 PARVL PAL and block address 02E1C 610ADF10 4 3 CBM 344 LD PPL R3/FLDADRS copy the PPAGE element pointer 02E1D FE0E2E1F 345 JMP DONEPPLJ enter the PPL destroyer 346 * --- 347 348 ********************************************************************************** 349 * * 350 * DONEPPL * 351 * This routine is called when a use count is to be removed * 352 * from a PPL. The cleanliness of the page is checked and a * 353 * write queue element is made if needed. Otherwise, the use * 354 * count is decremented and the PPL moved to the idle list if * 355 * the use count went to zero. * 356 * Call: * 357 * R3/BIT 0 = * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 546 (LIQUID) F 32 Liquidate a process 358 * PPL => PPAGE element * 359 * CALLNP DONEPPL * 360 * * 361 * Eats R0:R3, PPL. * 362 * Stack required = 4. * 363 * 1 + max ( DISMOUNT (3), FCFREEMEM (0), LOCKWAIT (0), * 364 * MSREADREQ (1), PUTADT (3), PUTIDLNL (1), * 365 * QDISK (1), SGETMEM (0) ) * 366 * * 367 ********************************************************************************** 368 02E1E DD5F8001 6 STAK 369 DONEPPL ENTRNP PUSH 00002E1F 370 DONEPPLJ LABEL R3/BIT 0 contains the modified bit 02E1F F2C02E2A 3 371 JBF R3/BIT 0 WHNPMOD jump if not a modified page 372 * \ / 373 374 ********************************************************************************** 375 * * 376 * We retain the busy count caused by the now defunct PAL, * 377 * because we are building a write queue element (which also * 378 * causes the busy count to be incremented). * 379 * * 380 ********************************************************************************** 381 02E20 DC002ED0 382 CALL SGETMEM call for a piece of memory 02E21 40440002 IMM 383 PARVL MSQLOG indicate its length 02E22 EC160800 0 BASE 384 STZ R0,MSQWORDA clear forward pointer and type field 02E23 EC160803 0 BASE 385 STZ R0,MSQXPTR indicate not dual write 02E24 E5160802 4 0 BASE 386 ST PPL R0,MSQPPPTR save the PPL pointer 02E25 60D20000 3 0 REG 387 LD R3 R0 make a copy of the pointer 02E26 60170801 0 4 BASE 388 LD R0 PPL,PPBLOCK get disk address 02E27 E416C801 0 3 BASE 389 ST R0 R3,MSQBLOCK and place into MSQ element 02E28 DC402E70 390 CALLNP QDISK call to queue up the disk transfer 02E29 5D1F8001 6 STAK 391 LEAVE POP write now assured, exit 392 * --- 393 394 ********************************************************************************** 395 * * 396 * We come here for a clean PPL. We check to see if it * 397 * is still in use. * 398 * * 399 ********************************************************************************** 400 00002E2A 401 WHNPMOD LABEL 02E2A 60893461 2 4 ZBM 402 LD R2 PPL,PPBLOCK/PPHASHFLD load the PPAGELIST hash value 403 PLOCK PPAGELOCK(R2) call to lock the appropriate PPAGELIST head 02E2B 0CC00000 403 IOFF 02E2C D1E41E21 2 403 SETT PPAGELOCK(R2) 02E2D FE0C2E2F 403 JNE MA(2+DISPW MA 0) 02E2E DC40308B 403 CALLNP LOCKWAIT 02E2F 6007FFFF 0 IMM 404 LD R0 -1 02E30 B8170802 0 4 BASE 405 ADDB R0 PPL,PPBUSYWORD decrease the use count 02E31 FA302E37 0 406 JZA R0 DONEPPLE jump if no longer in use 02E32 F21E2E34 0 407 JBF R0/PPBSYHIBIT DISCNTOK jump if the count is OK 02E33 00130035 408 HALT HALTS0035 somebody counted down busy too many times 409 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 547 (LIQUID) F 32 Liquidate a process 410 00002E34 411 DISCNTOK LABEL 412 PUNLOCK PPAGELOCK(R2) release the appropriate PPAGE head 02E34 EC241E21 2 412 STZ PPAGELOCK(R2) 02E35 0C800000 412 ION 02E36 5D1F8001 6 STAK 413 LEAVE POP return 414 * --- 415 416 ********************************************************************************** 417 * * 418 * We come here for an unused and clean PPL. We move the * 419 * PPL to the end of the appropriate idle list. We pick up the * 420 * hash code from R2 because PPBLOCK may have been destroyed to * 421 * indicate that nothing usable remains in this page. * 422 * Come here with: * 423 * appropriate PPAGELIST locked * 424 * interrupts off * 425 * R2 = PPHASHFLD * 426 * PPL => PPAGE element * 427 * SP = stack pointer * 428 * unlocks PPAGELIST * 429 * * 430 ********************************************************************************** 431 00002E37 432 DONEPPLE LABEL entry from DISCARDPAL 02E37 38641E61 1 2 433 LEA R1 PPAGELIST(R2) get pointer to list head 02E38 3D085F10 4 1 ZBM 434 LSRCH PPL R1,PPLINK see who points to us 02E39 FE022E3B 435 JEQ GOODLINK jump if a good link found 02E3A 00130037 436 HALT HALTS0037 stop if we aren't in the list 437 * --- 438 00002E3B 439 GOODLINK LABEL 02E3B 60091F10 0 4 ZBM 440 LD R0 PPL,PPLINK load this elements forward pointer 02E3C E4085F10 0 1 ZBM 441 ST R0 R1,PPLINK remove this element from the list 02E3D 5C090812 4 ZBM 442 CMZ PPL,PPMEMERR check for a memory error 02E3E FE0C2E59 443 JNE BADPAGE jump if page of memory is bad 444 PLOCK PPIDLOCK call to lock the idle page list 02E3F 0CC00000 444 IOFF 02E40 D1C01DD9 444 SETT PPIDLOCK 02E41 FE0C2E43 444 JNE MA(2+DISPW MA 0) 02E42 DC40308B 444 CALLNP LOCKWAIT 445 PUNLOCK PPAGELOCK(R2) call to unlock the appropriate PPAGE list 02E43 EC241E21 2 445 STZ PPAGELOCK(R2) 02E44 0C800000 445 ION 446 * \ / 447 448 ********************************************************************************** 449 * * 450 * See if this block should go into the ADT. Newly * 451 * freed blocks must be destroyed on mass storage before * 452 * they may be re-assigned. This ensures that the MS * 453 * structures retain the crashproofing characteristics * 454 * designed in. The destruction must make the block * 455 * into a free block (preferred) or a swapping block * 456 * (which are not included in any legitimate MS structure). * 457 * The PPUTADT bit, if set, indicates that this is such * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 548 (LIQUID) F 32 Liquidate a process 458 * a block. When we get here, the write has been accomplished * 459 * and we should place this block into the ADT list. * 460 * Furthermore, the page fault processor assumes that * 461 * a free MS block cannot be found resident. This is not * 462 * a hardship, since we will never read in a free block * 463 * anyway (they are always referenced as a zeropage first). * 464 * Therefore, at this point, we indicate in the PPL that * 465 * there is nothing occupying the physical page. * 466 * * 467 ********************************************************************************** 468 469 * \ / 02E45 5C090412 4 ZBM 470 CMZ PPL,PPPUTADT check for a free block 02E46 FE022E53 471 JEQ NOTADT jump if not to go to ADT 472 * \ / 473 474 ********************************************************************************** 475 * * 476 * Check for a disk error. We wish to avoid putting these * 477 * blocks into the ADT list, but we must remember to decrement * 478 * the volume busy count. * 479 * * 480 ********************************************************************************** 481 482 * \ / 02E47 5C090212 4 ZBM 483 CMZ PPL,PPDISKERR check to see if this is a bad block 02E48 FE022E50 484 JEQ OKAYTOFREE jump if it's okay 02E49 60C90081 3 4 ZBM 485 LD R3 PPL,PPBLOCK/VOLFIELD get the volume number 02E4A 60E61F22 3 3 486 LD R3 VOLNTABLE(R3) and convert to VOLN pointer 02E4B D056C815 3 BASE 487 DEC R3,VOLNBUSY decrement the volume busy 02E4C FE0C2E55 488 JNE BADBLOKP jump if volume busy, share bad block proc. 02E4D DC005034 489 CALL DISMOUNT clean up any potential leftovers 02E4E 4052C000 3 REG 490 PARVL R3 pass VOLN address 02E4F FE0E2E55 491 JMP BADBLOKP and process as for bad block 492 * --- 493 494 ********************************************************************************** 495 * * 496 * This section calls the PUTADT routine to start a * 497 * process that is capable of handling suspension during * 498 * calls to PUTFREEBLK. * 499 * * 500 ********************************************************************************** 501 00002E50 502 OKAYTOFREE LABEL 02E50 DC00502C 503 CALL PUTADT call to create a queue element 02E51 40570801 4 BASE 504 PARVL PPL,PPBLOCK pass the now free block number 02E52 FE0E2E55 505 JMP BADBLOKP and clear the block number and control bits 506 * --- 507 508 ********************************************************************************** 509 * * 510 * Check to see if this page had a mass storage error. * 511 * If so, we indicate that no MS block is present in this * 512 * physical page. * 513 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 549 (LIQUID) F 32 Liquidate a process 514 ********************************************************************************** 515 00002E53 516 NOTADT LABEL 02E53 5C090212 4 ZBM 517 CMZ PPL,PPDISKERR check to see if this is a bad block 02E54 FE022E57 518 JEQ NODISKERR jump if good 00002E55 519 BADBLOKP LABEL 02E55 EC170801 4 BASE 520 STZ PPL,PPBLOCK indicate no good data in this page 02E56 EC090052 4 ZBM 521 STZ PPL,PPCNTL clear out the control bits 00002E57 522 NODISKERR LABEL 523 * \ / 524 525 ********************************************************************************** 526 * * 527 * Here the PPL is completely free from any ties (PALs). If * 528 * it was a free block an element has been made so the ADT manager * 529 * will be called at the dispatchers convenience. What we have * 530 * left to do is place the PPL into the appropriate list. NOTE * 531 * that the following routine unlocks the idle page list. * 532 * * 533 ********************************************************************************** 534 535 * PPIDLOCK locked 536 * \ / 02E57 DC402D6A 537 CALLNP PUTIDLNL find a home for the PPL 02E58 5D1F8001 6 STAK 538 LEAVE POP return to caller 539 * --- 540 541 ********************************************************************************** 542 * * 543 * We come here when we are done with a page containing a * 544 * memory parity error. We put the page onto the PPERRLIST * 545 * so that it will never be used again, then we create a MSREADQ * 546 * entry in case anybody is waiting to get access to the data * 547 * that was on the page. * 548 * * 549 ********************************************************************************** 550 00002E59 551 BADPAGE LABEL 552 PUNLOCK PPAGELOCK(R2) unlock the PPAGE list 02E59 EC241E21 2 552 STZ PPAGELOCK(R2) 02E5A 0C800000 552 ION 553 PLOCK PPERRLOCK lock the error page list 02E5B 0CC00000 553 IOFF 02E5C D1C01E1E 553 SETT PPERRLOCK 02E5D FE0C2E5F 553 JNE MA(2+DISPW MA 0) 02E5E DC40308B 553 CALLNP LOCKWAIT 02E5F 60001E1F 0 554 LD R0 PPERRLIST get the list pointer 02E60 E4091F10 0 4 ZBM 555 ST R0 PPL,PPLINK put existing list behind new element 02E61 E5001E1F 4 556 ST PPL PPERRLIST put new page at head of list 02E62 D0001E20 557 INC PPERRCOUNT count it 558 PUNLOCK PPERRLOCK unlock the list 02E63 EC001E1E 558 STZ PPERRLOCK 02E64 0C800000 558 ION 559 PLOCK MSQINLOCK lock so we can call MSREADREQ 02E65 0CC00000 559 IOFF 02E66 D1C01F16 559 SETT MSQINLOCK 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 550 (LIQUID) F 32 Liquidate a process 02E67 FE0C2E69 559 JNE MA(2+DISPW MA 0) 02E68 DC40308B 559 CALLNP LOCKWAIT 02E69 60970801 2 4 BASE 560 LD R2 PPL,PPBLOCK get the block number 02E6A 61170801 4 4 BASE 561 LD R4 PPL,PPBLOCK ...for the call 02E6B DC003936 562 CALL MSREADREQ put in request for the block from MS 02E6C 40440000 IMM 563 PARVL 0 pass type of request 564 *** this may need to be changed! 565 PUNLOCK MSQINLOCK release the list 02E6D EC001F16 565 STZ MSQINLOCK 02E6E 0C800000 565 ION 02E6F 5D1F8001 6 STAK 566 LEAVE POP return 567 * --- 568 569 END DISCARDPAL and DONEPPL subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 551 (LIQUID) F 32 Liquidate a process 571 572 ********************************************************************************** 573 * * 574 * QDISK * 575 * Routine to place a mass storage write element onto the * 576 * mass storage write queue. We check to see if the * 577 * block which we are about to queue up for a write is already in * 578 * the write queue. If it is, we just discard the MSQ * 579 * element and return. This prevents having dozens * 580 * (or even two) writes queued up for the same page. We may * 581 * remove the extra busy count from the PPL because we know that * 582 * it can not go to zero (since there is another write queue * 583 * element and we still have the write queue locked). * 584 * Note that we cannot avoid the requested write if the existing * 585 * write is now represented by the element at the head of the * 586 * write queue. This is because the disk driver may already have * 587 * gotten it written, but just not gotten the completion interrupt * 588 * and removed the entry. * 589 * Call: * 590 * PPBUSYWORD already incremented for this element * 591 * R3 => MSQ element * 592 * PPL * 593 * CALLNP QDISK put element into write queue * 594 * * 595 * * 596 * Eats R0:R1, and maybe R3. * 597 * Stack required = 1 * 598 * 1 + max ( LOCKWAIT (0), PFREEMEM (0) ) * 599 * * 600 ********************************************************************************** 601 602 BLOCK 603 ENTRY QDISK to place MSQ into disk write queue 604 605 BEGFRAME 606 ENDFRAME 607 02E70 DD5F8001 6 STAK 608 QDISK ENTRNP PUSH 609 PLOCK MSQOUTLOCK call to lock the mass storage output queues 02E71 0CC00000 609 IOFF 02E72 D1C01F17 609 SETT MSQOUTLOCK 02E73 FE0C2E75 609 JNE MA(2+DISPW MA 0) 02E74 DC40308B 609 CALLNP LOCKWAIT 02E75 60090081 0 4 ZBM 610 LD R0 PPL,PPBLOCK/VOLFIELD get the volume number 02E76 60201F22 0 0 611 LD R0 VOLNTABLE(R0) R0 => VOLN element 02E77 60560817 1 0 BASE 612 LD R1 R0,VOLNWRITEQ get initial pointer from the list 02E78 FA722E7D 1 613 JNZA R1 LISTNOTMT jump if the list is not empty 02E79 E4D60817 3 0 BASE 614 ST R3 R0,VOLNWRITEQ put this new element into the list 02E7A 60040001 0 IMM 615 LD R0 1*BIT FLMSPROC get the appropriate bit 02E7B FC001CF6 0 616 IORM R0 FLAGS indicate to the dispatcher to run MS proc 02E7C FE0E2E84 617 JMP UPCOUNTERS now go and add to counters 618 * --- 619 00002E7D 620 LISTNOTMT LABEL there is at least one entry in write q 02E7D 60085F10 0 1 ZBM 621 LD R0 R1,MSQLINK get pointer to second element 02E7E FA322E81 0 622 JNZA R0 DODUPCHECK jump if list long enough to do checking 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 552 (LIQUID) F 32 Liquidate a process 623 * \ / first element does not count, since it may 624 * be already essentially written out. 02E7F E4C85F10 3 1 ZBM 625 ST R3 R1,MSQLINK put this element right behind first 02E80 FE0E2E84 626 JMP UPCOUNTERS now go and add to counters 627 * --- 628 00002E81 629 DODUPCHECK LABEL list is long enough to check 02E81 49160802 4 0 BASE 630 RLSRCH PPL R0,MSQPPPTR look for another pointer to this PPL 02E82 FE022E88 631 JEQ RELGO if another write already in queue, skip this one 02E83 E4C85F10 3 1 ZBM 632 ST R3 R1,MSQLINK hook on our new element 633 * the forward link is already cleared 00002E84 634 UPCOUNTERS LABEL 02E84 D0001F19 635 INC DISKWBUSY indicate another write scheduled 636 PUNLOCK MSQOUTLOCK call to release the mass storage output queues 02E85 EC001F17 636 STZ MSQOUTLOCK 02E86 0C800000 636 ION 02E87 5D1F8001 6 STAK 637 LEAVE POP return to caller 638 * --- 639 640 ********************************************************************************** 641 * * 642 * We found that a write for the current page is already * 643 * in the write queue. Remove the count corresponding to this * 644 * write queue element. We may do this because the write queue * 645 * is still locked with at least one other write queue element * 646 * for this page. We feel free to remove the dualwrite element * 647 * (if one exists), since dualwrite pairings are constant. We * 648 * then release the list and give back the space for the MSQ. * 649 * * 650 ********************************************************************************** 651 00002E88 652 RELGO LABEL 02E88 D0570802 4 BASE 653 DEC PPL,PPBUSYWORD decrement busy count 654 PUNLOCK MSQOUTLOCK release mass storage output queue 02E89 EC001F17 654 STZ MSQOUTLOCK 02E8A 0C800000 654 ION 02E8B 5C16C803 3 BASE 655 CMZ R3,MSQXPTR check for a dual write control element 02E8C FE022E90 656 JEQ RELNOXTRA exit if none 02E8D DC002F5D 657 CALL SFREEMEM free up the secondary write control element 02E8E 41440004 IMM 658 PARV (PPLNTH+FBILNTH) LOG 2 indicate size of PPL and FBI 02E8F 4056C803 3 BASE 659 PARVL R3,MSQXPTR and address 00002E90 660 RELNOXTRA LABEL 02E90 DC002F5D 661 CALL SFREEMEM call to return the space 02E91 41440002 IMM 662 PARV MSQLOG indicate its size 02E92 4052C000 3 REG 663 PARVL R3 and address 02E93 5D1F8001 6 STAK 664 LEAVE POP return 665 * --- 666 667 END of Qdisk routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 553 (LIQUID) F 32 Liquidate a process 669 670 ********************************************************************************** 671 * * 672 * A mass storage request relating to the given MS block * 673 * has completed. Release all processes in SQMSWAIT for this * 674 * block. Nothing more is done is the request did not involve * 675 * a physical memory page (i.e. PPL = 0). * 676 * If a PPL is involved, it is in the PPAGE list. Prior * 677 * to release, users awaiting the block receive a PAL for the * 678 * corresponding VP element. If no such user exists, the PPL * 679 * is discarded to the idle list with DONEPPL (it was the * 680 * object of an idle page write, or the operator killed the * 681 * user who requested the block, etc). * 682 * We should enter here with PPBUSYWORD including a * 683 * count for the caller. * 684 * Call: * 685 * SP = stack pointer * 686 * PPL => PPL (0 if none) * 687 * interrupts off! * 688 * CALL PAGEREADY * 689 * PARVL * 690 * * 691 * * 692 * Eats R0:R5. * 693 * Stack required = 11 * 694 * 3 + max ( DONEPPL (4), FINDVP (4), FSXPAND (2), * 695 * LOCKWAIT (0), MAKEPAL (8), MAPINMEM (3), * 696 * MAPOUTMEM (1), SETRUNNING (2) ) * 697 * * 698 ********************************************************************************** 699 700 BLOCK PAGEREADY subroutine 701 702 ENTRY PAGEREADY called when a block has been handled 703 704 BEGFRAME 00178801 6 BASE 705 PCBPTR BSS 1 holds pointer to PCB 00178802 6 BASE 706 PAGENUM BSS 1 holds disk address 707 ENDFRAME 708 02E94 DD1F8003 6 STAK 709 PAGEREADY ENTR PUSH 02E95 C0578802 6 BASE 710 STPVL SP,PAGENUM get block number 02E96 FB302E99 4 711 JZA PPL PAGEAGAIN jump if no PPL pointer 02E97 5C090812 4 ZBM 712 CMZ PPL,PPMEMERR does this page have a memory error? 02E98 FE0C2EC8 713 JNE SRCHFML1 if so, don't give it to anyone 714 * \ / 715 00002E99 716 PAGEAGAIN LABEL 717 PLOCK SQLOCKS(NQMSWAIT) call to lock the scheduler mass storage wait 02E99 0CC00000 717 IOFF 02E9A D1C01DBC 717 SETT SQLOCKS(NQMSWAIT) 02E9B FE0C2E9D 717 JNE MA(2+DISPW MA 0) 02E9C DC40308B 717 CALLNP LOCKWAIT 02E9D 60178802 0 6 BASE 718 LD R0 SP,PAGENUM get the block number 02E9E 60801DAB 2 719 LD R2 SQMSWAIT pointer to the first queue element 02E9F 60C41DAB 3 IMM 720 LD R3 ADR SQMSWAIT pointer to the head pointer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 554 (LIQUID) F 32 Liquidate a process 02EA0 48168801 0 2 BASE 721 RLSRCH R0 R2,PCQPARM look for any interested users 02EA1 FE0C2EC5 722 JNE SRCHFML jump if none left 723 * \ / 724 725 ********************************************************************************** 726 * * 727 * There was a user queued up for this block. Remove him * 728 * from the MSWAIT queue and place him into the RUNNABLE queue. * 729 * * 730 ********************************************************************************** 731 732 * \ / 02EA2 60089F10 0 2 ZBM 733 LD R0 R2,PCQLINK get the link to the next PCB in MSWAIT 02EA3 E408DF10 0 3 ZBM 734 ST R0 R3,PCQLINK remove this element from MSWAIT queue 735 PUNLOCK SQLOCKS(NQMSWAIT) call to release scheduler mass storage wait 02EA4 EC001DBC 735 STZ SQLOCKS(NQMSWAIT) 02EA5 0C800000 735 ION 736 * \ / 02EA6 E4978801 2 6 BASE 737 ST R2 SP,PCBPTR save PCB pointer 02EA7 FB302EBE 4 738 JZA PPL PAGEDONE jump if no PPL pointer 02EA8 DC0025EB 739 CALL MAPINMEM map in this users memory 02EA9 40489F13 2 ZBM 740 PARVL R2,PCPSADRS pointer to the PSA 02EAA 60D28000 3 2 REG 741 LD R3 R2 save PCB pointer through FINDVP 02EAB 6048DF13 1 3 ZBM 742 LD R1 R3,PCPSADRS get pointer to PSA 02EAC 6016C000 0 3 CACH 743 LD R0 R3,PCQPARM2 fetch the users page number 744 * search for the VP element 02EAD DC40265F 745 CALLNP FINDVP find the VP element 02EAE FE0E2EB1 746 JMP TRYMONVP jump if not found 02EAF 60400461 1 747 LD R1 FNDVPUPC get UPC of indirect VP reference 02EB0 FE0E2EB6 748 JMP HAVEVP jump if found 749 * --- 750 00002EB1 751 TRYMONVP LABEL 02EB1 61401ECB 5 752 LD VPP MONVM get head of monitor page list 02EB2 6016C000 0 3 CACH 753 LD R0 R3,PCQPARM2 get the page number requested 02EB3 3C174004 0 5 CACH 754 LSRCH R0 VPP,VPVPN search monitor VP list 02EB4 FE0C2EBE 755 JNE PAGEDONE if not found, don't create a PAL 02EB5 60440000 1 IMM 756 LD R1 0 indicate that this is not an indirect VP reference 757 * \ / 758 00002EB6 759 HAVEVP LABEL 02EB6 DC002631 760 CALL MAKEPAL create PAL for page 02EB7 41524000 1 REG 761 PARV R1 pass indirect VP UPC 02EB8 4156C000 3 CACH 762 PARV R3,PCQPARM2 indicate page number 02EB9 4048DF13 3 ZBM 763 PARVL R3,PCPSADRS pass PSA pointer 764 * \ / 765 CLRTBIT PPL,PPMODIFIED test and clear PPL modified bit 02EBA 60030000 0 IMM 765 LD R0 1*BIT(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 0:4) 02EBB A8170802 0 4 BASE 765 BRSBM R0 PPL,(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 15:31) 02EBC FE022EBE 766 JEQ PAGEDONE jump if already clear 02EBD EDC8DC12 3 ZBM 767 STW R3,PAMODIFIED transfer modified bit to new victim 768 * \ / 769 00002EBE 770 PAGEDONE LABEL 02EBE E1178801 4 6 BASE 771 EXCH R4 SP,PCBPTR set PCB pointer, save R4 02EBF DC402B99 772 CALLNP SETRUNNING put this user into SQRUNNABLE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 555 (LIQUID) F 32 Liquidate a process 02EC0 5C001C7A 773 CMZ FSXCOUNT check the count of pages available 02EC1 FE062EC3 774 JGE FSXNOTLOW still plenty in the wholepage list 02EC2 DC402B0E 775 CALLNP FSXPAND looks like we have used a few, replenish 776 * \ / 777 00002EC3 778 FSXNOTLOW LABEL 02EC3 61178801 4 6 BASE 779 LD R4 SP,PCBPTR restore R4 02EC4 FE0E2E99 780 JMP PAGEAGAIN look for other interested users 781 * --- 782 783 ********************************************************************************** 784 * * 785 * All users requesting this page have been taken care of. * 786 * The PPL should include a busy count of one for the caller. * 787 * We remove this count, and call DONEPPL if no other user * 788 * is referencing this page. Note that if a user had previously * 789 * been running then we must restore his free storage pointers. * 790 * * 791 ********************************************************************************** 792 00002EC5 793 SRCHFML LABEL 02EC5 DC4025FC 794 CALLNP MAPOUTMEM unmap user's memory 795 PUNLOCK SQLOCKS(NQMSWAIT) call to release the scheduler mass storage 02EC6 EC001DBC 795 STZ SQLOCKS(NQMSWAIT) 02EC7 0C800000 795 ION 796 * \ / 797 00002EC8 798 SRCHFML1 LABEL 02EC8 FB302ECD 4 799 JZA PPL PAGEXIT just leave if no PPL 800 * \ / 801 802 ********************************************************************************** 803 * * 804 * Call to remove the use count attributable to the * 805 * old MSQ element. * 806 * * 807 ********************************************************************************** 808 809 * \ / PPHASHFLD, PPL => PPAGE element 810 02EC9 70C90012 3 4 ZBM 811 LDN R3 PPL,PPMODIFIED get the modified bit (everywhere in R3) 812 CLRTBIT PPL,PPMODIFIED remove indication of modification 02ECA 60030000 0 IMM 812 LD R0 1*BIT(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 0:4) 02ECB A8170802 0 4 BASE 812 BRSBM R0 PPL,(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 15:31) 02ECC DC402E1E 813 CALLNP DONEPPL call to discard the page 814 * \ / 815 00002ECD 816 PAGEXIT LABEL 02ECD DC0025EB 817 CALL MAPINMEM call to mapin user free storage pointers 02ECE 40400412 818 PARVL CPPSA pointer to his process status area 02ECF 5D1F8003 6 STAK 819 LEAVE POP return to the caller 820 * --- 821 822 END PAGEREADY subroutine 823 824 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 556 (LIQUID) F 32 Liquidate a process 825 END LIQUID discard routines 58 INPUT GETFREEMEM free memory managers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 557 (GETFREEMEM) F 33 Resident Free Space Managers 3 4 GETFREEMEM BLOCK free memory management routines 5 6 ENTRY FCFREEMEM free virtual free storage (FCB's) 7 ENTRY FCGETMEM fetch virtual free storage (FCB's) 8 ENTRY PFREEMEM free virtual free storage (PAL's) 9 ENTRY PGETMEM fetch virtual free storage (PAL's) 10 ENTRY SFREEMEM free system free storage 11 ENTRY SGETMEM fetch a piece of system free storage 12 ENTRY UCFREEMEM free virtual free storage (UCE's) 13 ENTRY UCGETMEM fetch virtual free storage (UCE's) 14 ENTRY UFREEMEM free user free storage 15 ENTRY UGETMEM fetch a piece of user free storage 16 ENTRY UPCFREEMEM free virtual free storage (UPC's) 17 ENTRY UPCGETMEM fetch virtual free storage (UPC's) 18 ENTRY USERGETMEM fetch virtual free storage (generic) 19 ENTRY VFREEMEM free virtual free storage (VPP's) 20 ENTRY VGETMEM fetch virtual free storage (VPP's) 21 ENTRY GETMEMPAGE get user memory page 22 ENTRY FREEMEMPAGE free user memory page 23 ENTRY GETMAD fetch available monitor page number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 558 (GETFREEMEM) F 33 Resident Free Space Managers 25 26 ********************************************************************************** 27 * * 28 * UGETMEM/SGETMEM * 29 * User/system get memory. This routine gets a block of free * 30 * memory and returns the address in R0. If unable to acquire a page, * 31 * we halt. Note that this routine and routines that it calls must * 32 * NOT use the stack/stack pointer in any way, shape or form. * 33 * The parameter may not be passed from R1. * 34 * Call: * 35 * Eats R1 before parameters are passed * 36 * CALL SGETMEM/UGETMEM * 37 * PARVL LOG 2 * 38 * ST R0
* 39 * * 40 * Eats R1, Sets R0. * 41 * Stack required = 0. * 42 * 0 + Max ( CPUPFLOAD (0), GETMAD (0), GETWHOLEPG (0), * 43 * LOCKWAIT (0) ) * 44 * * 45 ********************************************************************************** 46 47 BLOCK SGETMEM/UGETMEM subroutines 48 ENTRY SGETMEM 49 ENTRY UGETMEM 50 51 00002ED0 52 UGETMEM LABEL 02ED0 DD124000 1 REG 53 SGETMEM ENTR R1 02ED1 0CC00000 54 IOFF disallow any interrupts 02ED2 E4400457 1 55 ST R1 GETMR7 save away callers R7 02ED3 E6800453 23 56 ST2 R2 GETMR2 save registers R2 and R3 02ED4 C0524000 1 REG 57 STPVL R1 log of the block size in R1 58 * \ / 59 60 PLOCK MEMLOCK get access to free storage lists 02ED5 0CC00000 60 IOFF 02ED6 D1C01C6C 60 SETT MEMLOCK 02ED7 FE0C2ED9 60 JNE MA(2+DISPW MA 0) 02ED8 DC40308B 60 CALLNP LOCKWAIT 02ED9 6844000A 1 IMM 61 UCPR R1 MEMLISTMAX how close to a page is the request 02EDA FE082EDE 62 JLT SIZEOK if smaller, no special checking 02EDB FE042F09 63 JGT ILSIZEHALT if larger, something is broken 02EDC D1528000 2 REG 64 STMW R2 indicate a whole page is requested 02EDD FE0E2EEE 65 JMP GMNDPAGE off to get that page 66 * --- 67 00002EDE 68 SIZEOK LABEL 02EDE 60221C6D 0 1 69 LD R0 MEMLIST(R1) get root of this size 02EDF FA302EE9 0 70 JZA R0 GMSHUFFL jump if nothing there 02EE0 60960800 2 0 BASE 71 LD R2 R0,0 02EE1 E4A21C6D 2 1 72 ST R2 MEMLIST(R1) remove the block from free usage 73 * \ / 74 00002EE2 75 GMBYEBYE LABEL 02EE2 EC160800 0 BASE 76 STZ R0,0 zap what pointer was there 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 559 (GETFREEMEM) F 33 Resident Free Space Managers 02EE3 60400457 1 77 LD R1 GETMR7 restore callers R7 02EE4 62800453 23 78 LD2 R2 GETMR2 restore the used registers 79 PUNLOCK MEMLOCK release access to free storage lists 02EE5 EC001C6C 79 STZ MEMLOCK 02EE6 0C800000 79 ION 02EE7 0C800000 80 ION restore interrupts 02EE8 5D124000 1 REG 81 LEAVE R1 return to user 82 * --- 83 84 ********************************************************************************** 85 * * 86 * We must shuffle up the lists to get freeness from larger freeness * 87 * * 88 ********************************************************************************** 89 00002EE9 90 GMSHUFFL LABEL 02EE9 60840000 2 IMM 91 LD R2 0 this counter will tell which level we're on 00002EEA 92 GMSHUFUP LABEL 02EEA 18840001 2 IMM 93 ADD R2 1 remember we moved up one level 02EEB 18440001 1 IMM 94 ADD R1 1 try the next higher block size 02EEC 6444000A 1 IMM 95 CPR R1 MEMLISTMAX are we at the top? 02EED FE082EFC 96 JLT GETNOPAGE jump if current size less than a page 97 * \ / 98 99 ********************************************************************************** 100 * * 101 * We are now requesting a full page, the process is to get one from * 102 * the wholepage list. Find an available virtual address and map the page * 103 * into ALL CPU's page files. * 104 * * 105 ********************************************************************************** 106 107 * \ / 00002EEE 108 GMNDPAGE LABEL 02EEE E6400455 12 109 ST2 R1 GETMREGS we need to save these counter values 02EEF DC403031 110 CALLNP GETWHOLEPG get a page from the whole page list 02EF0 FE0E2F08 111 JMP NOMEMPAGE jump if completely out of free space 02EF1 DC40301D 112 CALLNP GETMAD get an available virtual address 02EF2 DC002FCB 113 CALL CPUPFLOAD load up all the CPU's page files 02EF3 41520000 0 REG 114 PARV R0 pass the PM value 02EF4 4052C000 3 REG 115 PARVL PFPTR and pass the monitor virtual page number 02EF5 608AD400 2 3 CBM 116 LD R2 R3*PAGEFIELD produce virtual address 02EF6 600A9F10 0 2 CBM 117 LD R0 R2/FLDADRS copy the address to save it 02EF7 60441000 1 IMM 118 LD R1 CPP number of characters per page 02EF8 FE580000 119 CFILL 000 zap the whole thing 02EF9 62400455 12 120 LD2 R1 GETMREGS restore these valuable registers 02EFA FA882EE2 2 121 JLTZ R2 GMBYEBYE if request for a page, all done here 02EFB FE0E2F00 122 JMP GMSHUFDN adjust to the size we need 123 * --- 124 00002EFC 125 GETNOPAGE LABEL 02EFC 60221C6D 0 1 126 LD R0 MEMLIST(R1) get the pointer for this level 02EFD FA302EEA 0 127 JZA R0 GMSHUFUP jump if none here either 02EFE 60D60800 3 0 BASE 128 LD R3 R0,0 02EFF E4E21C6D 3 1 129 ST R3 MEMLIST(R1) remove the found memory 130 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 560 (GETFREEMEM) F 33 Resident Free Space Managers 131 00002F00 132 GMSHUFDN LABEL 02F00 1847FFFF 1 IMM 133 ADD R1 -1 move down with our free block 02F01 7422255E 0 1 134 XOR R0 BITTAB(R1) form half free block address 02F02 60E21C6D 3 1 135 LD R3 MEMLIST(R1) get current list end marker 02F03 E4D60800 3 0 BASE 136 ST R3 R0,0 and mark new list end 02F04 E4221C6D 0 1 137 ST R0 MEMLIST(R1) free half of the block 02F05 7422255E 0 1 138 XOR R0 BITTAB(R1) restore block address 02F06 FAA22F00 2 139 DRJ R2 GMSHUFDN jump if not to our size yet 02F07 FE0E2EE2 140 JMP GMBYEBYE leave this routine 141 * --- 142 143 ********************************************************************************** 144 * * 145 * No Storage Available. The FSXCOUNT word has been crying to the * 146 * system that pages were needed for free storage. The scheduler seems * 147 * to have been unable to respond fast enough to prevent completely * 148 * running out. This is most likely caused by a tight loop which includes * 149 * a request for free storage. * 150 * * 151 ********************************************************************************** 152 00002F08 153 NOMEMPAGE LABEL 02F08 00130080 154 HALT HALTS0080 no free storage available 155 * --- 156 157 ********************************************************************************** 158 * * 159 * Request for a piece of storage larger then a page. Someone * 160 * is not playing by the rules. * 161 * * 162 ********************************************************************************** 163 00002F09 164 ILSIZEHALT LABEL 02F09 00130083 165 HALT HALTS0083 request for bigger than a page 166 * --- 167 168 END SGETMEM and UGETMEM subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 561 (GETFREEMEM) F 33 Resident Free Space Managers 170 171 ********************************************************************************** 172 * * 173 * USERGETMEM/VGETMEM/FCGETMEM/UCGETMEM/UPCGETMEM/PGETMEM. * 174 * Get user a chunk of memory. This routine gets a block of * 175 * virtual free memory and returns the address in R0. If we are * 176 * unable to satisfy the request there are two possibilities, 1) * 177 * we ran out physical memory in which case we halt, or 2) the * 178 * user has used up his allocated virtual free storage, in which * 179 * case we also halt. We can do some recovery the first time the * 180 * user exceeds his storage allocation: When the session was * 181 * built, a chunk of its virtual storage was set aside. We now * 182 * free that chunk (temporarily satisfying the user), but then * 183 * give him an interrupt that can only be handled by Control Mode. * 184 * CM will limit what the user can do until we say everything's * 185 * OK again (i.e. until we have enough memory to reserve another * 186 * chunk). If the user exceeds his limit while we have no reserve, * 187 * we have no choice but to halt. * 188 * Currently we give the user four pages of monitor virtual * 189 * memory for some of his free storage needs. When each user is * 190 * to be run we map his physical memory into the same virtual * 191 * address space. The requirements for physical memory increases * 192 * with system load but the limiting factor, monitor virtual * 193 * address space, we are attempting to conserve. * 194 * The parameter may not be passed in R1. * 195 * Call: * 196 * eats R1 before passing parameters * 197 * CALL USERGETMEM/VGETMEM/FCGETMEM/UCGETMEM/UPCGETMEM/PGETMEM * 198 * PARVL LOG 2 * 199 * ST R0
* 200 * * 201 * Eats R1, Sets R0. * 202 * Stack required = 0. * 203 * 0 + Max ( GETVPAGE (0), GETWHOLEPG (0), LOCKWAIT (0) ) * 204 * * 205 ********************************************************************************** 206 207 BLOCK USERGETMEM/VGETMEM/FCGETMEM/UCGETMEM/UPCGETMEM/PGETMEM routine 208 ENTRY USERGETMEM 209 ENTRY FCGETMEM 210 ENTRY PGETMEM 211 ENTRY UCGETMEM 212 ENTRY UPCGETMEM 213 ENTRY VGETMEM 214 00002F0A 215 USERGETMEM LABEL 00002F0A 216 FCGETMEM LABEL 00002F0A 217 PGETMEM LABEL 00002F0A 218 UCGETMEM LABEL 00002F0A 219 UPCGETMEM LABEL 02F0A DD124000 1 REG 220 VGETMEM ENTR R1 02F0B 0CC00000 221 IOFF CPU can not be interrupted 02F0C E4400457 1 222 ST R1 GETMR7 save away callers R7 02F0D E6800453 23 223 ST2 R2 GETMR2 scratch registers, save original contents 02F0E C0524000 1 REG 224 STPVL R1 log of the block size 225 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 562 (GETFREEMEM) F 33 Resident Free Space Managers 226 227 * check for proper mapping 00002F0F 228 USERGM2 LABEL 02F0F 6001F00E 0 229 LD R0 UMEMPSA PSA owner of this memory list 02F10 64000413 0 230 CPR R0 CMAPPSA is this the one mapped in? 02F11 FE022F13 231 JEQ RIGHTGUY giving memory to the right guy? 02F12 00130086 232 HALT HALTS0086 wrong mapping while getting user memory 233 * --- 234 00002F13 235 RIGHTGUY LABEL 236 PLOCK UMEMLOCK get access to user's free storage lists 02F13 0CC00000 236 IOFF 02F14 D1C1F00F 236 SETT UMEMLOCK 02F15 FE0C2F17 236 JNE MA(2+DISPW MA 0) 02F16 DC40308B 236 CALLNP LOCKWAIT 02F17 6844000A 1 IMM 237 UCPR R1 MEMLISTMAX how close to a page is the request? 02F18 FE082F1C 238 JLT SIZEOK if smaller, no special checking 02F19 FE042F5C 239 JGT BADSIZEHALT if larger, someone is broken 02F1A D1528000 2 REG 240 STMW R2 indicate a whole page is requested 02F1B FE0E2F2C 241 JMP NEEDPAGE off to get that page 242 * --- 243 00002F1C 244 SIZEOK LABEL 02F1C 6023F000 0 1 245 LD R0 USERMEM(R1) get root of this size 02F1D FA302F27 0 246 JZA R0 VMSHUFFL jump if nothing there 02F1E 60960800 2 0 BASE 247 LD R2 R0,0 02F1F E4A3F000 2 1 248 ST R2 USERMEM(R1) remove the block from free usage 249 * \ / 250 00002F20 251 VMBYEBYE LABEL 02F20 EC160800 0 BASE 252 STZ R0,0 zap what pointer was there 02F21 60400457 1 253 LD R1 GETMR7 restore the contents 02F22 62800453 23 254 LD2 R2 GETMR2 restore the used registers 255 PUNLOCK UMEMLOCK release access to free storage lists 02F23 EC01F00F 255 STZ UMEMLOCK 02F24 0C800000 255 ION 02F25 0C800000 256 ION allow interrupts to the CPU 02F26 5D124000 1 REG 257 LEAVE R1 return to user 258 * --- 259 260 ********************************************************************************** 261 * * 262 * We must shuffle up the lists to get freeness from larger freeness * 263 * * 264 ********************************************************************************** 265 00002F27 266 VMSHUFFL LABEL 02F27 60840000 2 IMM 267 LD R2 0 this counter will tell which level we're on 00002F28 268 VMSHUFUP LABEL 02F28 18840001 2 IMM 269 ADD R2 1 remember we moved up one level 02F29 18440001 1 IMM 270 ADD R1 1 try the next higher block size 02F2A 6444000A 1 IMM 271 CPR R1 MEMLISTMAX are we at the top? 02F2B FE082F3B 272 JLT NOPAGEYET jump if current size less than a page 273 * \ / 274 275 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 563 (GETFREEMEM) F 33 Resident Free Space Managers 276 * * 277 * We are now requesting a full page. We proceed as * 278 * follows: first we check if the user has used up all his * 279 * virtual pages available for free storage use. If not we * 280 * then get a page from the whole page list, making sure that * 281 * we lock MEMLIST. Then we load the page file with the page * 282 * map value and store that value into the users PSA for later * 283 * use. * 284 * * 285 ********************************************************************************** 286 287 * \ / 00002F2C 288 NEEDPAGE LABEL 02F2C E6400455 12 289 ST2 R1 GETMREGS we need to save these counter values 02F2D DC403027 290 CALLNP GETVPAGE get virtual page for a user, if any 02F2E FE0E2F47 291 JMP UEXCDLIM user exceeded his limit 02F2F DC403031 292 CALLNP GETWHOLEPG get an available physical page 02F30 FE0E2F5B 293 JMP NOMEMPAGE jump if completely out of free space 294 * \ / 295 296 ********************************************************************************** 297 * R0 = page map value returned by GETWHOLEPG, * 298 * R2 = index into PSMAPVALS set by GETVPAGE, * 299 * R3 = virtual page number set by GETVPAGE * 300 ********************************************************************************** 301 02F31 60400413 1 302 LD R1 CMAPPSA need to store away the PM value 02F32 E41C501B 0 12 BASE 303 ST R0 R1,PSMAPVALS(R2) that should do it 02F33 00D20000 0 REG 304 LDPF R0 allow the CPU to get at it 02F34 608AD400 2 3 CBM 305 LD R2 R3*PAGEFIELD produce virtual address 02F35 600A9F10 0 2 CBM 306 LD R0 R2/FLDADRS copy the address to save it 02F36 60441000 1 IMM 307 LD R1 CPP number of characters per page 02F37 FE580000 308 CFILL 000 zap the whole thing 02F38 62400455 12 309 LD2 R1 GETMREGS restore these valuable registers 02F39 FA882F20 2 310 JLTZ R2 VMBYEBYE if request for a page, all done here 02F3A FE0E2F3F 311 JMP VMSHUFDN adjust to the size we need 312 * --- 313 00002F3B 314 NOPAGEYET LABEL 02F3B 6023F000 0 1 315 LD R0 USERMEM(R1) get the pointer for this level 02F3C FA302F28 0 316 JZA R0 VMSHUFUP jump if none here either 02F3D 60D60800 3 0 BASE 317 LD R3 R0,0 02F3E E4E3F000 3 1 318 ST R3 USERMEM(R1) remove the found memory 319 * \ / 320 00002F3F 321 VMSHUFDN LABEL 02F3F 1847FFFF 1 IMM 322 ADD R1 -1 move down with our free block 02F40 7422255E 0 1 323 XOR R0 BITTAB(R1) form half free block address 02F41 60E3F000 3 1 324 LD R3 USERMEM(R1) get current list end marker 02F42 E4D60800 3 0 BASE 325 ST R3 R0,0 and mark new list end 02F43 E423F000 0 1 326 ST R0 USERMEM(R1) free half of the block 02F44 7422255E 0 1 327 XOR R0 BITTAB(R1) restore block address 02F45 FAA22F3F 2 328 DRJ R2 VMSHUFDN jump if not to our size yet 02F46 FE0E2F20 329 JMP VMBYEBYE leave this routine 330 * --- 331 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 564 (GETFREEMEM) F 33 Resident Free Space Managers 332 ********************************************************************************** 333 * * 334 * A user has asked for more free storage than we can give him. * 335 *Let him die gracefully by giving him the space we reserved in * 336 *UMEMXTRA. We hope that this will be enough to get him back to * 337 *the dispatcher and handle the error we send to CM (UINTVMFISR). * 338 *CM is to then disallow operations that might use up more space * 339 *(e.g. underprocess creation, opening files, etc.). We reach the * 340 *halt if we didn't free enough to get the process back to the * 341 *dispatcher (look for loops or a series of GETMEMs), or if we get * 342 *back to CM, but enough operations (most likely page faults) slip * 343 *through the cracks to exceed the XALOG chunk. Note that the * 344 *user gets to keep the space he needs to get to the dispatcher * 345 *(we don't want him to fail), so this reduces the amount that he * 346 *can use afterwards. * 347 * * 348 ********************************************************************************** 349 00002F47 350 UEXCDLIM LABEL 02F47 6041F00D 1 351 LD R1 UMEMXTRA see if we still have leeway 02F48 FA722F4A 1 352 JNZA R1 HAVEXA jump if so 02F49 0013008B 353 HALT HALTS008B else, user out of virtual free storage 354 * --- 355 356 * phew! We have some space to give him 00002F4A 357 HAVEXA LABEL 02F4A EC01F00D 358 STZ UMEMXTRA say area no longer available 02F4B 6001F007 0 359 LD R0 USERMEM(XALOG) "free" the reserved area 02F4C E4164800 0 1 BASE 360 ST R0 R1,0 by tacking (empty) list onto us 02F4D E441F007 1 361 ST R1 USERMEM(XALOG) and putting new head on 362 PUNLOCK UMEMLOCK avoid deadlock 02F4E EC01F00F 362 STZ UMEMLOCK 02F4F 0C800000 362 ION 363 364 * cripple the user 02F50 60400413 1 365 LD R1 CMAPPSA get users session 366 PLOCK R1,PSLOCK get access to PSA 02F51 0CC00000 366 IOFF 02F52 D1D6480C 1 BASE 366 SETT R1,PSLOCK 02F53 FE0C2F55 366 JNE MA(2+DISPW MA 0) 02F54 DC40308B 366 CALLNP LOCKWAIT 02F55 EDC8561D 1 ZBM 367 STW R1,PSUERROR/RTVMFISRB say there's a no memory 368 PUNLOCK R1,PSLOCK release access to PSA 02F56 EC16480C 1 BASE 368 STZ R1,PSLOCK 02F57 0C800000 368 ION 369 370 * retry the current request for space 02F58 6044000A 1 IMM 371 LD R1 MEMLISTMAX calculate requested size 02F59 10400456 1 372 SUB R1 GETMREGS(1) as max - difference 02F5A FE0E2F0F 373 JMP USERGM2 try again 374 * --- 375 376 ********************************************************************************** 377 * * 378 * We are totally out of free storage, crash and burn. * 379 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 565 (GETFREEMEM) F 33 Resident Free Space Managers 380 ********************************************************************************** 381 00002F5B 382 NOMEMPAGE LABEL 02F5B 0013008C 383 HALT HALTS008C out of free storage 384 * --- 385 386 387 ********************************************************************************** 388 * * 389 * Request for a piece of storage larger then a page. Someone * 390 * is not playing by the rules. * 391 * * 392 ********************************************************************************** 393 00002F5C 394 BADSIZEHALT LABEL 02F5C 00130088 395 HALT HALTS0088 request for bigger than a page 396 * --- 397 398 END VGETMEM/FCGETMEM/UCGETMEM/UPCGETMEM/PGETMEM routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 566 (GETFREEMEM) F 33 Resident Free Space Managers 400 401 ********************************************************************************** 402 * * 403 * UFREEMEM/SFREEMEM. * 404 * User/system free memory. This routine simply returns * 405 * a free block of memory to the system. If we happen to * 406 * recombine a whole page, then we place the page on the * 407 * wholepage list and alert the dispatcher that an extra * 408 * page is available for other uses. * 409 * Note that this routine and all routines that it may * 410 * call must NOT use the stack/stack pointer in any way, * 411 * shape or form since some callers do not have a stack. * 412 * Warning! Do not attempt to receive parameters in * 413 * registers due to the ENTRS. It will cause problems!!! * 414 * Call: * 415 * CALL SFREEMEM/UFREEMEM * 416 * PARV LOG 2 * 417 * PARVL
* 418 * Note: neither parameter may be in R0. * 419 * * 420 * Eats R0:R1. * 421 * Stack required = 0. * 422 * 0 + max ( CPUPFLOAD (0), LOCKWAIT (0), OVERLAPCK (0), * 423 * PUTWHOLEPG (0) ) * 424 * * 425 ********************************************************************************** 426 427 BLOCK SFREEMEM/UFREEMEM subroutine 428 ENTRY SFREEMEM 429 ENTRY UFREEMEM 430 00002F5D 431 UFREEMEM LABEL 02F5D DD920000 0 REG 432 SFREEMEM ENTRS R0 02F5E 5C17C802 7 BASE 433 CMZ R7,2 take page faults now (KLUDGE!!!) 02F5F 0CC00000 434 IOFF disallow any interrupts 02F60 E4000457 0 435 ST R0 FREMR7 save the callers R7 02F61 DCD3C000 7 REG 436 EXPCS R7 back to get the parameters 02F62 C1400454 437 STPV FREMR3 fetch the size of block 02F63 C0400453 438 STPVL FREMR2 get the block address 439 * \ / 440 02F64 E2800453 23 441 EXCH2 R2 FREMR2 R2 = address, R3 = log size 02F65 7885FFFF 2 IMM 442 AND R2 ONEBITS/FLDADRS remove extraneous garbage 443 PLOCK MEMLOCK get access to free storage lists 02F66 0CC00000 443 IOFF 02F67 D1C01C6C 443 SETT MEMLOCK 02F68 FE0C2F6A 443 JNE MA(2+DISPW MA 0) 02F69 DC40308B 443 CALLNP LOCKWAIT 02F6A FE0E2F6D 444 JMP FREEM00 default to no checking 445 * NOP the previous instruction to run the overlap memory checker 02F6B DC003045 446 CALL OVERLAPCK check for freeing illegal pieces of memory 02F6C 40441C6D IMM 447 PARVL ADR MEMLIST pointer to the memory list 448 * \ / 449 00002F6D 450 FREEM00 LABEL 02F6D EC168800 2 BASE 451 STZ R2,0 remove extraneous pointers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 567 (GETFREEMEM) F 33 Resident Free Space Managers 02F6E 38261C6D 0 3 452 LEA R0 MEMLIST(R3) load effective address of list head 02F6F 68C4000A 3 IMM 453 UCPR R3 MEMLISTMAX are we all the way up to a page? 02F70 FE082F87 454 JLT FREEM10 jump if not 02F71 FE042F8E 455 JGT ILSIZFREED caller attempted to free piece larger than page 456 * \ / 457 458 ********************************************************************************** 459 * * 460 * Whole pages have no buddies so we are through with the recombining * 461 * algorithm. What we need to do is place the page onto the whole page * 462 * list and make sure that no CPU's can access it, we therefore unmap * 463 * the page from ALL the CPU's. Sometimes life is tough all over. * 464 * * 465 ********************************************************************************** 466 467 * \ / 02F72 608A9C80 2 2 CBM 468 LD R2 R2/PAGEFIELD pick up the virtual page number 02F73 7C840080 2 IMM 469 IOR R2 MONPF make it a monitor page number 02F74 60D28000 3 2 REG 470 LD PFPTR R2 put the pointer into the right register 02F75 80D2C000 3 REG 471 PFRC R3 we need the page map value in R3 02F76 EC0ADC20 3 CBM 472 STZ R3/(PFALTBIT+PFREFBIT) be sure we find it 02F77 EDF41CC6 2 @ 473 STW @PAVPAGES(R2) indicate this page is now available 02F78 DC002FCB 474 CALL CPUPFLOAD request to unload all page files 02F79 41440000 IMM 475 PARV 0 flag indicating unloading request 02F7A 40528000 2 REG 476 PARVL R2 virtual page number to unload 02F7B DC403074 477 CALLNP PUTWHOLEPG put page into the whole page list 02F7C FE0E2F81 478 JMP FREMDONE finished with this guy 479 * --- 480 00002F7D 481 FREEM05 LABEL 02F7D 74A6255E 2 3 482 XOR R2 BITTAB(R3) restore address of block 02F7E 60560800 1 0 BASE 483 LD R1 R0,0 get ptr to remainder of list 02F7F E4568800 1 2 BASE 484 ST R1 R2,0 place behind this element 02F80 E4960800 2 0 BASE 485 ST R2 R0,0 insert us into the list 486 * \ / 487 00002F81 488 FREMDONE LABEL 02F81 60000457 0 489 LD R0 FREMR7 restore the callers R7 02F82 62800453 23 490 LD2 R2 FREMR2 restore these registers before leaving 491 PUNLOCK MEMLOCK release access to free storage lists 02F83 EC001C6C 491 STZ MEMLOCK 02F84 0C800000 491 ION 02F85 0C800000 492 ION restore interrupt capabilities 02F86 5D120000 0 REG 493 LEAVE R0 return to caller 494 * --- 495 496 ********************************************************************************** 497 * * 498 * Search the list for this blocks buddy and combine if * 499 * found. At one time, this recombination was done with an * 500 * LSRCH and new entries were added to the head of the list. * 501 * However, the technique that we are now using produces * 502 * ordered lists which work much better. This is because new * 503 * requests are always assigned from the lowest address. * 504 * Therefore, all unused space tends to be at the higher * 505 * addresses and it has a much better chance of getting * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 568 (GETFREEMEM) F 33 Resident Free Space Managers 506 * recombined into larger blocks. The ordered lists * 507 * therefore stay much shorter and this more than * 508 * compensates for the slower insertion speed. Also, in a * 509 * system whose load has decreased considerably, the excess * 510 * free storage will tend to gather where it is isolated * 511 * until its buddy comes along. This improves considerably * 512 * the ability of the system to recover whole pages. * 513 * Note that these lists are terminated by a word which has * 514 * zeros in the link field (a legal list terminator) but has a * 515 * high bit on. This is so that the search for a buddy * 516 * (via RLSHLE) will never fall off the end of the list, but * 517 * will stop at the insertion point, even if the insertion * 518 * point is at the end of the list. * 519 * * 520 * R0 -> list header, R2 -> block, R3 = log size * 521 * * 522 ********************************************************************************** 523 00002F87 524 FREEM10 LABEL 02F87 74A6255E 2 3 525 XOR R2 BITTAB(R3) calculate address of buddy 02F88 4C960800 2 0 BASE 526 RLSHLE R2 R0,0 find buddy in list 02F89 FE0C2F7D 527 JNE FREEM05 jump if past possible buddy 02F8A 60968800 2 2 BASE 528 LD R2 R2,0 get buddys ptr to the remainder of his list 02F8B E0960800 2 0 BASE 529 EXCH R2 R0,0 remove the buddy from the list 530 * (and get back pointer to him!) 02F8C 28A6255E 2 3 531 BSUB R2 BITTAB(R3) make address of next larger block 02F8D FAE02F6D 3 532 IRJ R3 FREEM00 move to next higher level 533 * --- 534 535 ********************************************************************************** 536 * * 537 * The caller tried to free a piece of storage larger than * 538 * a page. This is a bad screw up. * 539 * * 540 ********************************************************************************** 541 00002F8E 542 ILSIZFREED LABEL 02F8E 00130084 543 HALT HALTS0084 freeing piece larger than a page 544 * --- 545 546 END SFREEMEM/UFREEMEM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 569 (GETFREEMEM) F 33 Resident Free Space Managers 548 549 ********************************************************************************** 550 * * 551 * VFREEMEM/FCFREEMEM/UCFREEMEM/UPCFREEMEM/PFREEMEM * 552 * Give back user/system free memory. This routine * 553 * simply returns a block of free memory to the system. If * 554 * we happen to recombine a whole page, then we place that * 555 * page on the wholepage list and alert the dispatcher that * 556 * an extra page is available for other uses. If we happen * 557 * to give back a whole page then we clear the PM value in * 558 * the PSA, if we can't find it then something screwed up * 559 * and we halt. To clean up the last of the users free * 560 * storage all that should be necessary is to free the * 561 * first 16 words of usermem. * 562 * Call: * 563 * CALL VFREEMEM/FCFREEMEM/UCFREEMEM/UPCFREEMEM/PFREEMEM * 564 * PARV LOG 2 * 565 * PARVL
* 566 * Note: neither parameter may be in R0. * 567 * * 568 * Eats R0:R1. * 569 * Stack required = 0. * 570 * 0 + max ( CLEARVPAGE (0), LOCKWAIT (0), OVERLAPCK (0), * 571 * PUTWHOLEPG (0) ) * 572 * * 573 ********************************************************************************** 574 575 BLOCK VFREEMEM/FCFREEMEM/UCFREEMEM/UPCFREEMEM/PFREEMEM subroutine 576 ENTRY FCFREEMEM 577 ENTRY PFREEMEM 578 ENTRY UCFREEMEM 579 ENTRY UPCFREEMEM 580 ENTRY VFREEMEM 581 00002F8F 582 FCFREEMEM LABEL 00002F8F 583 PFREEMEM LABEL 00002F8F 584 UCFREEMEM LABEL 00002F8F 585 UPCFREEMEM LABEL 02F8F DD920000 0 REG 586 VFREEMEM ENTRS R0 02F90 5C17C802 7 BASE 587 CMZ R7,2 take page faults now (KLUDGE!!!) 02F91 0CC00000 588 IOFF disallow any interrupts 02F92 E4000457 0 589 ST R0 FREMR7 save the callers R7 02F93 DCD3C000 7 REG 590 EXPCS R7 back to get the parameters 02F94 C1400454 591 STPV FREMR3 fetch the size of block 02F95 C0400453 592 STPVL FREMR2 get the block address 593 * \ / 594 595 * check for proper mapping 02F96 6001F00E 0 596 LD R0 UMEMPSA PSA owner of this memory list 02F97 64000413 0 597 CPR R0 CMAPPSA is this the one mapped in? 02F98 FE022F9A 598 JEQ RIGHTGUY freeing memory to the right guy 02F99 00130087 599 HALT HALTS0087 wrong mapping while freeing user memory 600 * --- 601 00002F9A 602 RIGHTGUY LABEL 02F9A E2800453 23 603 EXCH2 R2 FREMR2 R2 = address, R3 = log size 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 570 (GETFREEMEM) F 33 Resident Free Space Managers 02F9B 7885FFFF 2 IMM 604 AND R2 ONEBITS/FLDADRS remove extraneous garbage 605 PLOCK UMEMLOCK get access to free storage lists 02F9C 0CC00000 605 IOFF 02F9D D1C1F00F 605 SETT UMEMLOCK 02F9E FE0C2FA0 605 JNE MA(2+DISPW MA 0) 02F9F DC40308B 605 CALLNP LOCKWAIT 02FA0 FE0E2FA3 606 JMP VFREEM00 default to no checking 607 * NOP the previous instruction to run the overlap memory checker 02FA1 DC003045 608 CALL OVERLAPCK check for freeing illegal pieces of memory 02FA2 4045F000 IMM 609 PARVL ADR USERMEM pointer to memory lists 610 * \ / 611 00002FA3 612 VFREEM00 LABEL 02FA3 EC168800 2 BASE 613 STZ R2,0 remove extraneous pointers 02FA4 3827F000 0 3 614 LEA R0 USERMEM(R3) load effective address of list head 02FA5 68C4000A 3 IMM 615 UCPR R3 MEMLISTMAX are we all the way up to a page? 02FA6 FE082FBA 616 JLT VFREEM10 jump if not 02FA7 FE042FC1 617 JGT BADSIZFREED caller attempted to free piece larger than page 618 * \ / 619 620 ********************************************************************************** 621 * * 622 * Whole pages have no buddies so we are through with the recombining * 623 * algorithm. What we need to do is place the page onto the whole page * 624 * list and make sure that no CPU's can access it. We therefore unmap * 625 * the page from ALL the CPU's. Sometimes life is tough all over. * 626 * * 627 ********************************************************************************** 628 629 * \ / 02FA8 608A9C80 2 2 CBM 630 LD R2 R2/PAGEFIELD pick up the virtual page number 02FA9 7C840080 2 IMM 631 IOR R2 MONPF make it a monitor page number 02FAA 60D28000 3 2 REG 632 LD PFPTR R2 put the pointer into the right register 02FAB 80D2C000 3 REG 633 PFRC R3 put the page file value in R3 02FAC EC0ADC20 3 CBM 634 STZ R3/(PFALTBIT+PFREFBIT) make sure we find it 02FAD DC403074 635 CALLNP PUTWHOLEPG put page into the whole page list 02FAE DC402FC2 636 CALLNP CLEARVPAGE clear the PM value from the PSA 02FAF FE0E2FB4 637 JMP VFREMDONE finished with this guy 638 * --- 639 00002FB0 640 VFREEM05 LABEL 02FB0 74A6255E 2 3 641 XOR R2 BITTAB(R3) restore address of block 02FB1 60560800 1 0 BASE 642 LD R1 R0,0 get ptr to remainder of list 02FB2 E4568800 1 2 BASE 643 ST R1 R2,0 place behind this element 02FB3 E4960800 2 0 BASE 644 ST R2 R0,0 insert us into the list 645 * \ / 646 00002FB4 647 VFREMDONE LABEL 02FB4 60000457 0 648 LD R0 FREMR7 restore the callers R7 02FB5 62800453 23 649 LD2 R2 FREMR2 restore these registers before leaving 650 PUNLOCK UMEMLOCK release access to free storage lists 02FB6 EC01F00F 650 STZ UMEMLOCK 02FB7 0C800000 650 ION 02FB8 0C800000 651 ION restore interrupt capabilities 02FB9 5D120000 0 REG 652 LEAVE R0 return to caller 653 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 571 (GETFREEMEM) F 33 Resident Free Space Managers 654 655 ********************************************************************************** 656 * * 657 * Search the list for this blocks buddy and combine if * 658 * found. At one time, this recombination was done with an * 659 * LSRCH and new entries were added to the head of the list. * 660 * However, the technique that we are now using produces * 661 * ordered lists which work much better. This is because new * 662 * requests are always assigned from the lowest address. * 663 * Therefore, all unused space tends to be at the higher * 664 * addresses and it has a much better chance of getting * 665 * recombined into larger blocks. The ordered lists * 666 * therefore stay much shorter and this more than * 667 * compensates for the slower insertion speed. Also, in a * 668 * system whose load has decreased considerably, the excess * 669 * free storage will tend to gather where it is isolated * 670 * until its buddy comes along. This improves considerably * 671 * the ability of the system to recover whole pages. * 672 * Note that these lists are terminated by a word which has * 673 * zeros in the link field (a legal list terminator) but has a * 674 * high bit on. This is so that the search for a buddy * 675 * (via RLSHLE) will never fall off the end of the list, but * 676 * will stop at the insertion point, even if the insertion * 677 * point is at the end of the list. * 678 * * 679 * R0 -> list header, R2 -> block, R3 = log size * 680 * * 681 ********************************************************************************** 682 00002FBA 683 VFREEM10 LABEL 02FBA 74A6255E 2 3 684 XOR R2 BITTAB(R3) calculate address of buddy 02FBB 4C960800 2 0 BASE 685 RLSHLE R2 R0,0 find buddy in list 02FBC FE0C2FB0 686 JNE VFREEM05 jump if past possible buddy 02FBD 60968800 2 2 BASE 687 LD R2 R2,0 get buddys ptr to the remainder of his list 02FBE E0960800 2 0 BASE 688 EXCH R2 R0,0 remove the buddy from the list 689 * (and get back pointer to him!) 02FBF 28A6255E 2 3 690 BSUB R2 BITTAB(R3) make address of next larger block 02FC0 FAE02FA3 3 691 IRJ R3 VFREEM00 move to next higher level 692 * --- 693 694 ********************************************************************************** 695 * * 696 * The caller tried to free a piece of storage larger than * 697 * a page. This is a bad screw up. * 698 * * 699 ********************************************************************************** 700 00002FC1 701 BADSIZFREED LABEL 02FC1 00130089 702 HALT HALTS0089 freeing piece larger than a page 703 * --- 704 705 END VFREEMEM/FCFREEMEM/UCFREEMEM/UPCFREEMEM/PFREEMEM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 572 (GETFREEMEM) F 33 Resident Free Space Managers 707 708 ********************************************************************************** 709 * * 710 * This routine is called to clear a page map value out of * 711 * the PSA mapvalues. The page map value to be cleared is in R3, and * 712 * it is assumed that the value has been unloaded from the page file. * 713 * The reason we do this is so the value is not accidentally mapped * 714 * back into the page file. * 715 * Call: * 716 * R3 := page map value looking for * 717 * * 718 * CALL CLEARVPAGE * 719 * * 720 * Eats R0:R1, R3. * 721 * Stack required = 0. * 722 * * 723 ********************************************************************************** 724 725 BLOCK CLEARVPAGE routine 726 ENTRY CLEARVPAGE 727 02FC2 DD400459 728 CLEARVPAGE ENTRNP MEMVARPC 02FC3 60400413 1 729 LD R1 CMAPPSA pointer to the currently mapped PSA 02FC4 60040003 0 IMM 730 LD R0 MAXMAPVALS-1 our index/counter 731 * \ / 732 00002FC5 733 CLRVPLOOP LABEL 02FC5 64DC401B 3 10 BASE 734 CPR R3 R1,PSMAPVALS(R0) is this the one we are looking for? 02FC6 FE022FC9 735 JEQ FOUND yes, we have found it 02FC7 FA262FC5 0 736 JDR R0 CLRVPLOOP see if more to look at 02FC8 0013008A 737 HALT HALTS008A can not find PM value 738 * --- 739 00002FC9 740 FOUND LABEL 02FC9 EC1C401B 10 BASE 741 STZ R1,PSMAPVALS(R0) no longer in existence 02FCA 5D000459 742 LEAVE MEMVARPC 743 * --- 744 745 END CLEARVPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 573 (GETFREEMEM) F 33 Resident Free Space Managers 747 748 ********************************************************************************** 749 * * 750 * Routine to store a pmvalue into all CPUs and into the page 0 * 751 * page map. Note that the page map value for monitor virtual page 0 * 752 * is restored upon exit. * 753 * Call: * 754 * * 755 * CALL CPUPFLOAD * 756 * PARV * 757 * PARVL * 758 * * 759 * Eats R0:R2. * 760 * Stack required = 0. * 761 * 0 + max ( LOCKWAIT (0) ) * 762 * * 763 ********************************************************************************** 764 765 BLOCK CPUPFLOAD routine 766 ENTRY CPUPFLOAD 767 02FCB DD000459 768 CPUPFLOAD ENTR MEMVARPC 02FCC C140045C 769 STPV MEMVAREG2 this gets the PM value 02FCD C0528000 2 REG 770 STPVL R2 and this is the virtual page number 02FCE E2C0045B 34 771 EXCH2 R3 MEMVAREG1 store away R3 and R4 772 * R2 <= virtual page number, R4 <= PM value 773 * \ / 774 02FCF 60C40080 3 IMM 775 LD PFPTR MONPF+0 get page number for monitor page zero 02FD0 80800458 776 PFRD MEMVAR1 save away the page map value 02FD1 00C01CC7 777 LDPF PAGEZERO map in the power fail stuff 02FD2 E5240300 4 2 778 ST R4 PFMAP(-MONPF)(R2) store new value there 02FD3 FB0C2FD5 4 779 JNEZ R4 NOTUNLOAD jump if loading 02FD4 61002FE9 4 780 LD R4 PFILLREF load illegal to reference PF contents 00002FD5 781 NOTUNLOAD LABEL 02FD5 60C50000 3 IMM 782 LD R3 STOREPF get a command to hit the page file 02FD6 18D28000 3 2 REG 783 ADD R3 R2 add in the page number 02FD7 6044000F 1 IMM 784 LD R1 NUMSLOTS-1 get counter for slots 785 * \ / 786 00002FD8 787 THEPFLOOP LABEL 02FD8 60220370 0 1 788 LD R0 IBSLOTS(R1) check each slot in turn 02FD9 600A0040 0 0 CBM 789 LD R0 R0/WRU0TYPE isolate the type 02FDA 64040002 0 IMM 790 CPR R0 SLTTCPU check for a CPU 02FDB FE0C2FE4 791 JNE LOOPEND jump if not a CPU 792 PLOCK CPUCOMLOCK prevent collisions 02FDC 0CC00000 792 IOFF 02FDD D1C01CF5 792 SETT CPUCOMLOCK 02FDE FE0C2FE0 792 JNE MA(2+DISPW MA 0) 02FDF DC40308B 792 CALLNP LOCKWAIT 02FE0 60130000 0 4 REG 793 LD R0 R4 get the page file contents to store 02FE1 0C52C000 3 REG 794 STTB R3 do it to it 795 PUNLOCK CPUCOMLOCK 02FE2 EC001CF5 795 STZ CPUCOMLOCK 02FE3 0C800000 795 ION 00002FE4 796 LOOPEND LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 574 (GETFREEMEM) F 33 Resident Free Space Managers 02FE4 FA662FD8 1 797 JDR R1 THEPFLOOP scan all slots 798 * \ / 799 02FE5 60C40080 3 IMM 800 LD PFPTR MONPF+0 get page 0 page number 02FE6 00C00458 801 LDPF MEMVAR1 and restore the original contents 02FE7 62C0045B 34 802 LD2 R3 MEMVAREG1 back to original condition 02FE8 5D000459 803 LEAVE MEMVARPC return to caller 804 * --- 805 02FE9 00060000 806 PFILLREF VFD 1*PFROBIT+1*PFALTBIT in PF, this sez illegal to reference 00010000 ABS 807 STOREPF EQU BUSCWRITE+CPUPFOFSET command to write into CPUs PF 808 809 END CPUPFLOAD routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 575 (GETFREEMEM) F 33 Resident Free Space Managers 811 812 ********************************************************************************** 813 * * 814 * This routine returns the page that a user has been using * 815 * for his free storage lists. The page is put directly into the * 816 * idle page list. Also the entries in the PSA are checked to make * 817 * sure that all the pages this user has used are properly returned, * 818 * if not we halt. Oh yes, the page file location pointing to this * 819 * page is marked illegal to reference in case anybody has any bright * 820 * ideas. * 821 * Call: * 822 * * 823 * CALLNP FREEMEMPAGE * 824 * * 825 * Eats R0:R3. * 826 * Stack required = 1. * 827 * 0 + max ( CLEARVPAGE (0), LOCKWAIT (0), PUTIDLE (0) ) * 828 * * 829 ********************************************************************************** 830 831 BLOCK FREEMEMPAGE routine 832 ENTRY FREEMEMPAGE 833 02FEA DD40045A 834 FREEMEMPAGE ENTRNP MEMVARPC2 02FEB E500045B 4 835 ST R4 MEMVAREG1 save away this register 02FEC 60C400FC 3 IMM 836 LD PFPTR PNUSERMEM page file pointer 02FED 80D2C000 3 REG 837 PFRC R3 mark that location as illegal to reference 02FEE EC0ADC20 3 CBM 838 STZ R3/(PFALTBIT+PFREFBIT) zero this field just in case 839 PLOCK WPAGELOCK gain access to the free storage PPL lists 02FEF 0CC00000 839 IOFF 02FF0 D1C01C78 839 SETT WPAGELOCK 02FF1 FE0C2FF3 839 JNE MA(2+DISPW MA 0) 02FF2 DC40308B 839 CALLNP LOCKWAIT 02FF3 60001C77 0 840 LD R0 FSPPLIST pointer to the first PPL 02FF4 38401C77 1 841 LEA R1 FSPPLIST in essence, this is his predecessor 02FF5 48D60803 3 0 BASE 842 RLSRCH R3 R0,PPPMVALUE look for this PPL in the list 02FF6 FE022FF8 843 JEQ FOUND no problem if he is there 02FF7 0013008F 844 HALT HALTS008F but we halt if he is gone 845 * --- 846 00002FF8 847 FOUND LABEL 02FF8 61081F10 4 0 ZBM 848 LD R4 R0,PPLINK pointer to the following PPL 02FF9 E5085F10 4 1 ZBM 849 ST R4 R1,PPLINK this unlinks us from the list 850 PUNLOCK WPAGELOCK so we may release the list 02FFA EC001C78 850 STZ WPAGELOCK 02FFB 0C800000 850 ION 02FFC 61120000 4 0 REG 851 LD PPL R0 put the pointer into the right register 02FFD DC402D51 852 CALLNP PUTIDLE return the PPL to the idle list 853 * R3 <- page map value to clear, set by the PFRC instruction 02FFE DC402FC2 854 CALLNP CLEARVPAGE clear the page map value from the PSA 02FFF EC000413 855 STZ CMAPPSA no one is mapped in here 03000 6100045B 4 856 LD R4 MEMVAREG1 restore the contents of this register 03001 5D00045A 857 LEAVE MEMVARPC2 return back to the caller 858 * --- 859 860 END FREEMEMPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 576 (GETFREEMEM) F 33 Resident Free Space Managers 862 863 ********************************************************************************** 864 * * 865 * This routine gets a page for the user if he has not exceeded * 866 * his limit and maps the page into the page file. It also makes an * 867 * entry into the PSA. This is the guy that must get a page to set * 868 * up the users resident free storage lists. Note that this routine * 869 * gets its page directly from the idle list, so we better not run * 870 * out. The parameter we pass is stored directly into CMAPPSA so that * 871 * the routines we call can use this value when needed. * 872 * Call: * 873 * * 874 * CALL GETMEMPAGE * 875 * PARVL * 876 * ST R0 * 877 * * 878 * Eats R1:R2, Sets R0. * 879 * Stack required = 1. * 880 * 0 + max ( GETIDLE (1), GETVPAGE (0), LOCKWAIT (0) ) * 881 * * 882 ********************************************************************************** 883 884 BLOCK GETMEMPAGE routine 885 ENTRY GETMEMPAGE 886 03002 DD00045A 887 GETMEMPAGE ENTR MEMVARPC2 03003 C0400413 888 STPVL CMAPPSA put PSA pointer here 03004 E500045B 4 889 ST R4 MEMVAREG1 save away this register 03005 DC403027 890 CALLNP GETVPAGE request for virtual address 03006 0013008D 891 HALT HALTS008D couldn't even give the guy one page 03007 DC402D1C 892 CALLNP GETIDLE request for an idle page 03008 0013008E 893 HALT HALTS008E system ran out of PPLs 894 PLOCK WPAGELOCK get access to the FSPPLIST list 03009 0CC00000 894 IOFF 0300A D1C01C78 894 SETT WPAGELOCK 0300B FE0C300D 894 JNE MA(2+DISPW MA 0) 0300C DC40308B 894 CALLNP LOCKWAIT 0300D EC170801 4 BASE 895 STZ PPL,PPBLOCK indicate nothing here anymore 0300E 60001C77 0 896 LD R0 FSPPLIST get the head honcho 0300F E4091F10 0 4 ZBM 897 ST R0 PPL,PPLINK put him behind the new PPL 03010 E5001C77 4 898 ST PPL FSPPLIST he is now the head cheese 899 PUNLOCK WPAGELOCK done with the list for now 03011 EC001C78 899 STZ WPAGELOCK 03012 0C800000 899 ION 03013 60170803 0 4 BASE 900 LD R0 PPL,PPPMVALUE get the identifying page map value 03014 60400413 1 901 LD R1 CMAPPSA pointer to the current process 902 * R2 <- index into PSA mapvalues, set from GETVPAGE 03015 E41C501B 0 12 BASE 903 ST R0 R1,PSMAPVALS(R2) put this value in the PSA 03016 00D20000 0 REG 904 LDPF R0 let this CPU have access to it 03017 608AD400 2 3 CBM 905 LD R2 R3*PAGEFIELD shift page number into page field 03018 600A9F10 0 2 CBM 906 LD R0 R2/FLDADRS put the address into R0 03019 60441000 1 IMM 907 LD R1 CPP number of characters per page 0301A FE580000 908 CFILL 000 zero the whole page 0301B 6100045B 4 909 LD R4 MEMVAREG1 restore R4 0301C 5D00045A 910 LEAVE MEMVARPC2 return back to the caller 911 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 577 (GETFREEMEM) F 33 Resident Free Space Managers 912 913 END GETMEMPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 578 (GETFREEMEM) F 33 Resident Free Space Managers 915 916 ********************************************************************************** 917 * * 918 * This routine fetches the next available virtual monitor * 919 * page number, and returns the virtual page number in R3. If * 920 * no monitor page numbers are available this routine will halt. * 921 * Call: * 922 * MEMLOCK * 923 * CALLNP GETMAD * 924 * ST R3 * 925 * * 926 * Sets R3. * 927 * Stack required = 0. * 928 * * 929 ********************************************************************************** 930 931 BLOCK GETMAD routine 932 ENTRY GETMAD 933 0301D DD400459 934 GETMAD ENTRNP MEMVARPC 0301E 60C40088 3 IMM 935 LD PFPTR PNINITPAGE starting page number 0000301F 936 FGTPNLP LABEL 0301F 5C361CC6 3 @ 937 CMZ @PAVPAGES(PFPTR) check on this page 03020 FE0C3022 938 JNE FGTHVNUM jump if this now good page number 03021 FAE0301F 3 939 IRJ PFPTR FGTPNLP up to next page and go back 940 * --- may wish overflow check! 941 00003022 942 FGTHVNUM LABEL 03022 64C40100 3 IMM 943 CPR PFPTR MONPF+NPS check against the max memory page 03023 FE063026 944 JGE MEMORYGONE jump if no more address space 03024 EC361CC6 3 @ 945 STZ @PAVPAGES(PFPTR) indicate this address used 03025 5D000459 946 LEAVE MEMVARPC return to caller 947 * --- 948 949 ********************************************************************************** 950 * * 951 * All of monitor virtual memory space has been used up * 952 * * 953 ********************************************************************************** 954 00003026 955 MEMORYGONE LABEL 03026 00130023 956 HALT HALTS0023 no more monitor memory 957 * --- 958 959 END GETMAD routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 579 (GETFREEMEM) F 33 Resident Free Space Managers 961 962 ********************************************************************************** 963 * * 964 * This routine fetches the next available virtual monitor * 965 * page number that the user is allowed to use for free storage. * 966 * Be sure that virtual pages returned by this routine are not * 967 * available to the system, PAVPAGES value set to zero (currently * 968 * we use only four). * 969 * Note that this routine returns R2 as an index into the PSMAPVALS * 970 * in the PSA, this is used by some of the code so don't screw it up. * 971 * Call: * 972 * * 973 * CALLNP GETVPAGE * 974 * JMP * 975 * ST R2 * 976 * ST R3 * 977 * * 978 * Eats R1. Sets R2, R3. * 979 * Stack required = 0. * 980 * * 981 ********************************************************************************** 982 983 BLOCK GETVPAGE routine 984 ENTRY GETVPAGE 985 03027 DD400459 986 GETVPAGE ENTRNP MEMVARPC 03028 60400413 1 987 LD R1 CMAPPSA get pointer to the currently mapped PSA 03029 6087FFFC 2 IMM 988 LD R2 -MAXMAPVALS our index/counter 0000302A 989 GETVPLOOP LABEL 0302A 5C1C501F 12 BASE 990 CMZ R1,PSMAPVALS(MAXMAPVALS)(R2) is this virtual address available? 0302B FE02302E 991 JEQ FOUND success, give back the good news 0302C FAA0302A 2 992 IRJ R2 GETVPLOOP if not, try for the next one 993 * \ / 994 995 * no free pages available! 0000302D 996 RETURN LABEL 0302D 5D000459 997 LEAVE MEMVARPC back to the caller 998 * --- 999 1000 * a free page exists, set return values 0000302E 1001 FOUND LABEL 0302E 18840004 2 IMM 1002 ADD R2 MAXMAPVALS do a fixup on our index 0302F 60D690FC 3 2 REG 1003 LD R3 PNUSERMEM+R2 give corresponding PF page number 03030 FBE0302D 7 1004 IRJ R7 RETURN have a good return 1005 * --- 1006 1007 END GETVPAGE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 580 (GETFREEMEM) F 33 Resident Free Space Managers 1009 1010 ********************************************************************************** 1011 * * 1012 * GETWHOLEPG. This routine simply picks up a PPL from the WHOLEPAGE * 1013 * list and puts it into the FSPPLIST, while returning the page map * 1014 * value in R0, simple huh!!! * 1015 * Call: * 1016 * * 1017 * CALLNP GETWHOLEPG * 1018 * JMP * 1019 * ST R0 * 1020 * * 1021 * Eats R1, Sets R0. * 1022 * Stack required = 0. * 1023 * 0 + max ( LOCKWAIT (0) ) * 1024 * * 1025 ********************************************************************************** 1026 1027 BLOCK GETWHOLEPG routine 1028 ENTRY GETWHOLEPG 1029 03031 DD400459 1030 GETWHOLEPG ENTRNP MEMVARPC 1031 PLOCK WPAGELOCK lock the whole page list 03032 0CC00000 1031 IOFF 03033 D1C01C78 1031 SETT WPAGELOCK 03034 FE0C3036 1031 JNE MA(2+DISPW MA 0) 03035 DC40308B 1031 CALLNP LOCKWAIT 03036 60401C79 1 1032 LD R1 WHOLEPAGE pointer to the available whole pages 03037 FA703042 1 1033 JZA R1 RETURN sorry, but out of luck 03038 60085F10 0 1 ZBM 1034 LD R0 R1,PPLINK next PPL in the list 03039 E4001C79 0 1035 ST R0 WHOLEPAGE PPL is now removed from the WHOLEPAGE list 0303A 60001C77 0 1036 LD R0 FSPPLIST list of mapped free storage pages 0303B E4085F10 0 1 ZBM 1037 ST R0 R1,PPLINK this PPL is now in use 0303C E4401C77 1 1038 ST R1 FSPPLIST from one list to another 0303D 60164803 0 1 BASE 1039 LD R0 R1,PPPMVALUE most important, we need the page map value 0303E D0401C7A 1040 DEC FSXCOUNT indicate we used up another page 0303F 60440004 1 IMM 1041 LD R1 1*BIT FLFSX indicate the wholepage list shrunk 03040 FC401CF6 1 1042 IORM R1 FLAGS let the dispatcher know 03041 19C40001 7 IMM 1043 ADD R7 1 fix up a good return 1044 * \ / 1045 00003042 1046 RETURN LABEL 1047 PUNLOCK WPAGELOCK release the whole page list 03042 EC001C78 1047 STZ WPAGELOCK 03043 0C800000 1047 ION 03044 5D000459 1048 LEAVE MEMVARPC we are through for now 1049 * --- 1050 1051 END GETWHOLEPG routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 581 (GETFREEMEM) F 33 Resident Free Space Managers 1053 1054 ********************************************************************************** 1055 * * 1056 * This is the OVERLAPCK routine. This code verifies that the block * 1057 * that we are freeing is legal, i.e., that enough low order bits of * 1058 * the address are zero, and that the block does not overlap any already * 1059 * free block. * 1060 * Call: * 1061 * R2 := address to check * 1062 * R3 := blocksize LOG 2 * 1063 * * 1064 * CALL OVERLAPCK * 1065 * PARVL
* 1066 * * 1067 * Eats R0:R1. * 1068 * Stack required = 0. * 1069 * * 1070 ********************************************************************************** 1071 1072 BLOCK OVERLAPCK routine 1073 ENTRY OVERLAPCK 1074 03045 DD000459 1075 OVERLAPCK ENTR MEMVARPC 03046 E7000455 45 1076 ST2 R4 FREMR4 save R4 03047 C0534000 5 REG 1077 STPVL R5 pointer to the memory lists 03048 6066255E 1 3 1078 LD R1 BITTAB(R3) 03049 10440001 1 IMM 1079 SUB R1 1 low order R3 bits of R1 are 1s 0304A 78528000 1 2 REG 1080 AND R1 R2 R1 = low order bits of address 0304B FA4C305C 1 1081 JNEZ R1 FREMHALT1 die if low-order bits non-zero 0304C 5D66305E 3 1082 XCT FREMLDTAB(R3) R1 := address shifted R3 bits right 1083 * \ / 1084 1085 ********************************************************************************** 1086 * * 1087 * Search each list of blocks whose size is less than or equal to * 1088 * the block that we have, looking for one whose address is the same as * 1089 * ours if you ignore the low-order R3 bits. If we find such a block, * 1090 * we die. * 1091 * * 1092 ********************************************************************************** 1093 1094 * \ / 0304D 6112C000 4 3 REG 1095 LD R4 R3 copy the size 0000304E 1096 FREM105 LABEL 0304E 381D6000 0 54 BASE 1097 LEA R0 R5,0(R4) start of R4th list 0304F 5D663069 3 1098 XCT FREMLSTAB(R3) search ignoring R3 low bits 03050 FE02305D 1099 JEQ FREMHALT2 die if found 03051 FB26304E 4 1100 JDR R4 FREM105 and same for each smaller list 03052 6116D001 4 3 REG 1101 LD R4 R3+1 start with first size larger 1102 * \ / 1103 1104 ********************************************************************************** 1105 * * 1106 * Now, search each list of larger blocks, ignoring one more address * 1107 * bit for each size. * 1108 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 582 (GETFREEMEM) F 33 Resident Free Space Managers 1109 ********************************************************************************** 1110 1111 * \ / 00003053 1112 FREM110 LABEL 03053 6504000A 4 IMM 1113 CPR R4 MEMLISTMAX are we at the largest one? 03054 FE06305A 1114 JGE FREM120 jump if beyond largest 03055 604A41F0 1 1 CBM 1115 LD R1 R1/BITS 0:30 shift R1 right 1 03056 381D6000 0 54 BASE 1116 LEA R0 R5,0(R4) start of R4th list 03057 5D683069 4 1117 XCT FREMLSTAB(R4) search ignoring R4 low bits 03058 FE02305D 1118 JEQ FREMHALT2 die if found 03059 FB203053 4 1119 IRJ R4 FREM110 and same for each larger list 1120 * --- 1121 0000305A 1122 FREM120 LABEL 0305A 63000455 45 1123 LD2 R4 FREMR4 restore R4 and R5 0305B 5D000459 1124 LEAVE MEMVARPC back to mainline code 1125 * --- 1126 1127 ********************************************************************************** 1128 * * 1129 * This halt is if someone tried to free a block on the wrong boundary. * 1130 * R2 = address, R3 = size LOG 2. * 1131 * * 1132 ********************************************************************************** 1133 0000305C 1134 FREMHALT1 LABEL 0305C 00130081 1135 HALT HALTS0081 illegal block freed (low order bits) 1136 * --- 1137 1138 ********************************************************************************** 1139 * * 1140 * This halt is if someone tried to free a block that overlaps an * 1141 * already free one. R2 = address, R3 = size log 2. For the already * 1142 * free one, R0 = address, R4 = size log 2. * 1143 * * 1144 ********************************************************************************** 1145 0000305D 1146 FREMHALT2 LABEL 0305D 00130082 1147 HALT HALTS0082 illegal block freed (high order bits) 1148 * --- 1149 1150 ********************************************************************************** 1151 * * 1152 * The following table of instructions is the object of an indexed * 1153 * XCT instruction. The purpose is to load R1 with an address shifted to * 1154 * the right. * 1155 * * 1156 ********************************************************************************** 1157 0000305E 1158 FREMLDTAB LABEL 0305E 604A9F10 1 2 CBM 1159 LD R1 R2/BITS 15:31 shift 0 bits 0305F 604A9F00 1 2 CBM 1160 LD R1 R2/BITS 15:30 shift 1 bit 03060 604A9EF0 1 2 CBM 1161 LD R1 R2/BITS 15:29 shift 2 bits 03061 604A9EE0 1 2 CBM 1162 LD R1 R2/BITS 15:28 shift 3 bits 03062 604A9ED0 1 2 CBM 1163 LD R1 R2/BITS 15:27 shift 4 bits 03063 604A9EC0 1 2 CBM 1164 LD R1 R2/BITS 15:26 shift 5 bits 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 583 (GETFREEMEM) F 33 Resident Free Space Managers 03064 604A9EB0 1 2 CBM 1165 LD R1 R2/BITS 15:25 shift 6 bits 03065 604A9EA0 1 2 CBM 1166 LD R1 R2/BITS 15:24 shift 7 bits 03066 604A9E90 1 2 CBM 1167 LD R1 R2/BITS 15:23 shift 8 bits 03067 604A9E80 1 2 CBM 1168 LD R1 R2/BITS 15:22 shift 9 bits 03068 604A9E70 1 2 CBM 1169 LD R1 R2/BITS 15:21 shift 10 bits 1170 1171 ********************************************************************************** 1172 * * 1173 * The following table is the object of an indexed XCT instruction. * 1174 * The purpose is to search the list begining at R0 for an element whose * 1175 * address (with the low order bits dropped) matches the value in R1. * 1176 * * 1177 ********************************************************************************** 1178 00003069 1179 FREMLSTAB LABEL 03069 3C481F10 1 0 ZBM 1180 LSRCH R1 R0,0/BITS 15:31 drop 0 bits 0306A 3C481F00 1 0 ZBM 1181 LSRCH R1 R0,0/BITS 15:30 drop 1 bit 0306B 3C481EF0 1 0 ZBM 1182 LSRCH R1 R0,0/BITS 15:29 drop 2 bits 0306C 3C481EE0 1 0 ZBM 1183 LSRCH R1 R0,0/BITS 15:28 drop 3 bits 0306D 3C481ED0 1 0 ZBM 1184 LSRCH R1 R0,0/BITS 15:27 drop 4 bits 0306E 3C481EC0 1 0 ZBM 1185 LSRCH R1 R0,0/BITS 15:26 drop 5 bits 0306F 3C481EB0 1 0 ZBM 1186 LSRCH R1 R0,0/BITS 15:25 drop 6 bits 03070 3C481EA0 1 0 ZBM 1187 LSRCH R1 R0,0/BITS 15:24 drop 7 bits 03071 3C481E90 1 0 ZBM 1188 LSRCH R1 R0,0/BITS 15:23 drop 8 bits 03072 3C481E80 1 0 ZBM 1189 LSRCH R1 R0,0/BITS 15:22 drop 9 bits 03073 3C481E70 1 0 ZBM 1190 LSRCH R1 R0,0/BITS 15:21 drop 10 bits 1191 1192 END OVERLAPCK routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 584 (GETFREEMEM) F 33 Resident Free Space Managers 1194 1195 ********************************************************************************** 1196 * * 1197 * PUTWHOLEPG. This routine is called to return a page to the * 1198 * whole page list, from there the dispatcher has the responsibility * 1199 * to put it into the idle page list. This routine is called with * 1200 * the page map value in R3, that way we can find the proper PPL. * 1201 * If the corresponding PPL is not found we halt, since we are the * 1202 * only ones that can move a PPL from the FSPPLIST. * 1203 * Call: * 1204 * R3 := pointer to page file entry to free * 1205 * * 1206 * CALLNP PUTWHOLEPG * 1207 * * 1208 * Eats R0:R1. * 1209 * Stack required = 0. * 1210 * 0 + max ( LOCKWAIT (0) ) * 1211 * * 1212 ********************************************************************************** 1213 1214 BLOCK PUTWHOLEPG routine 1215 ENTRY PUTWHOLEPG 1216 03074 DD400459 1217 PUTWHOLEPG ENTRNP MEMVARPC place onto the CPU page 1218 PLOCK WPAGELOCK lock the whole page list 03075 0CC00000 1218 IOFF 03076 D1C01C78 1218 SETT WPAGELOCK 03077 FE0C3079 1218 JNE MA(2+DISPW MA 0) 03078 DC40308B 1218 CALLNP LOCKWAIT 03079 60001C77 0 1219 LD R0 FSPPLIST address of the in use PPL's 0307A 38401C77 1 1220 LEA R1 FSPPLIST pointer to the head word 0307B 48D60803 3 0 BASE 1221 RLSRCH R3 R0,PPPMVALUE search for the PPL 0307C FE02307E 1222 JEQ FOUND looks like we found the one we wanted 0307D 00130022 1223 HALT HALTS0022 PPL somehow got freed up 1224 * --- 1225 0000307E 1226 FOUND LABEL 0307E E480045B 2 1227 ST R2 MEMVAREG1 put this register in a safe place 0307F 60881F10 2 0 ZBM 1228 LD R2 R0,PPLINK get the next PPL in the list 03080 E4885F10 2 1 ZBM 1229 ST R2 R1,PPLINK remove the PPL from the FSPPLIST 03081 60401C79 1 1230 LD R1 WHOLEPAGE head pointer of the whole page list 03082 E4481F10 1 0 ZBM 1231 ST R1 R0,PPLINK PPL points to the first one in the list 03083 E4001C79 0 1232 ST R0 WHOLEPAGE we now become the first one in the list 03084 6080045B 2 1233 LD R2 MEMVAREG1 restore this registers contents 1234 PUNLOCK WPAGELOCK unlock the whole page list 03085 EC001C78 1234 STZ WPAGELOCK 03086 0C800000 1234 ION 03087 D0001C7A 1235 INC FSXCOUNT indicate the whole page list grew 03088 60440004 1 IMM 1236 LD R1 1*BIT FLFSX we need to balance the whole page list 03089 FC401CF6 1 1237 IORM R1 FLAGS let the dispatcher in on it 0308A 5D000459 1238 LEAVE MEMVARPC back to where we were called from 1239 * --- 1240 1241 END PUTWHOLEPG routine 1242 1243 END GETFREEMEM free memory management routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 585 (LISTLOCK) F 34 Resident Free Space Managers 59 INPUT LISTLOCK list lockers and misc utility 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 586 (LISTLOCK) F 34 List Locking Utilities 3 4 BLOCK List Locking Utilities 5 6 ENTRY DYNMON monitor lock spins 7 ENTRY LOCKLIST routine to lock a list for modification 8 ENTRY LOCKWAIT list lock macro subroutine 9 ENTRY SRCHLIST routine to lock a list for searching 10 ENTRY UNLOCKLIST inverse of LOCKLIST 11 ENTRY UNSRCHLIST inverse of SRCHLIST 12 ENTRY ZEROIT this zeros things 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 587 (LISTLOCK) F 34 List Locking Utilities 14 15 ********************************************************************************** 16 * * 17 * LOCKWAIT. This routine is carefully constructed to * 18 * be used with the PLOCK macro. It relys heavily on the * 19 * internal structure of the macro, so excercise caution. * 20 * * 21 * Eats R0. * 22 * Stack required = 0. * 23 * 0 + max ( DYNMON (0) ) * 24 * * 25 ********************************************************************************** 26 27 BLOCK LOCKWAIT subroutine 28 ENTRY LOCKWAIT 29 0308B DD520000 0 REG 30 LOCKWAIT ENTRNP R0 0308C DC4030BC 31 CALLNP DYNMON monitor dynamic waits 0308D 0C800000 32 ION restore interrupts to their previous state 0308E 11C40004 7 IMM 33 SUB R7 4 back up the return address 0308F 5D120000 0 REG 34 LEAVE R0 then start the macro over 35 * --- 36 37 END LOCKWAIT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 588 (LISTLOCK) F 34 List Locking Utilities 39 40 ********************************************************************************** 41 * * 42 * ZEROIT * 43 * This routine zeros a continuous field of words of a specified * 44 * length. Return address is placed on the stack. * 45 * * 46 * CALL ZEROIT * 47 * PAR area to clear * 48 * PARVL number of words to clear * 49 * * 50 * Eats R0:R1. * 51 * Stack required = 1. * 52 * * 53 ********************************************************************************** 54 55 BLOCK ZEROIT subroutine 56 ENTRY ZEROIT 57 58 BEGFRAME 59 ENDFRAME 60 03090 DD1F8001 6 STAK 61 ZEROIT ENTR PUSH 03091 C1124000 1 REG 62 STP R1 03092 C0561001 0 REG 63 STPVL R0+1 R0=length-1 00003093 64 ZEROITLP LABEL 03093 EC1C4000 10 BASE 65 STZ R1,0(R0) zero a word 03094 FA263093 0 66 JDR R0 ZEROITLP 03095 5D1F8001 6 STAK 67 LEAVE POP 68 * --- 69 70 END ZEROIT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 589 (LISTLOCK) F 34 List Locking Utilities 72 73 74 ********************************************************************************** 75 * * 76 * Routines to control the access to certain lists * 77 * and disk tables. They do the interlock trip and maybe loop * 78 * or queue. * 79 * * 80 ********************************************************************************** 81 82 ********************************************************************************** 83 * * 84 * Routine to lock a list for modification. * 85 * SP = stack pointer * 86 * CALL LOCKLIST * 87 * PARL * 88 * LOCKLIST sets bit 0 of the list lock word, and waits until * 89 * it gets the list for modification, then it waits until all * 90 * processes are done searching the list (indicated by the count * 91 * of searchers in the low part of the word). * 92 * Returns with the interrupts off. * 93 * * 94 * Eats R0:R1. * 95 * Stack required = 1. * 96 * 1 + max ( DYNMON (0) ) * 97 * * 98 ********************************************************************************** 99 100 BLOCK LOCKLIST subroutine 101 ENTRY LOCKLIST 102 103 BEGFRAME 104 ENDFRAME 105 03096 DD1F8001 6 STAK 106 LOCKLIST ENTR PUSH 03097 C0124000 1 REG 107 STPL R1 save the list pointer 00003098 108 LOCKLIST1 LABEL 03098 60030000 0 IMM 109 LD R0 LOCKBIT get the bit which locks the list 03099 0CC00000 110 IOFF turn off the interrupts 0309A FC164800 0 1 BASE 111 IORM R0 R1,0 try to grab the list 0309B FE0C309F 112 JNE LOCKLIST2 jump if we got the lock 0309C DC4030BC 113 CALLNP DYNMON monitor dynamic wait 0309D 0C800000 114 ION allow interrupts while waiting 0309E FE0E3098 115 JMP LOCKLIST1 go back to try again 116 * --- 117 0000309F 118 LOCKLIST2 LABEL 0309F 64164800 0 1 BASE 119 CPR R0 R1,0 see if lockbit is unique 030A0 FE0230A3 120 JEQ LOCKLIST3 jump if it is, we have desired access 030A1 DC4030BC 121 CALLNP DYNMON else monitor waits 030A2 FE0E309F 122 JMP LOCKLIST2 and try again 123 * --- 124 000030A3 125 LOCKLIST3 LABEL 030A3 5D1F8001 6 STAK 126 LEAVE POP return to caller 127 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 590 (LISTLOCK) F 34 List Locking Utilities 128 129 END LOCKLIST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 591 (LISTLOCK) F 34 List Locking Utilities 131 132 ********************************************************************************** 133 * * 134 * Routine to unlock a list held for modification. Undoes * 135 * LOCKLIST. * 136 * SP = stack pointer * 137 * CALL UNLOCKLIST * 138 * PARL * 139 * Turns on the interrupts. * 140 * * 141 * Eats R0:R1. * 142 * Stack required = 1. * 143 * * 144 ********************************************************************************** 145 146 BLOCK UNLOCKLIST subroutine 147 ENTRY UNLOCKLIST 148 149 BEGFRAME 150 ENDFRAME 151 030A4 DD1F8001 6 STAK 152 UNLOCKLIST ENTR PUSH 030A5 C0124000 1 REG 153 STPL R1 save the list pointer 030A6 60030000 0 IMM 154 LD R0 LOCKBIT get the bit used for modify locking 030A7 A8164800 0 1 BASE 155 BRSBM R0 R1,0 remove this bit from the word 030A8 0C800000 156 ION restore the interrupts 030A9 5D1F8001 6 STAK 157 LEAVE POP return to caller 158 * --- 159 160 END UNLOCKLIST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 592 (LISTLOCK) F 34 List Locking Utilities 162 163 ********************************************************************************** 164 * * 165 * Routine to set a list to search. * 166 * SP = stack pointer * 167 * CALL SRCHLIST * 168 * PARL * 169 * Disables the interrupts. * 170 * * 171 * Eats R0. * 172 * Stack required = 1. * 173 * 1 + max ( DYNMON (0) ) * 174 * * 175 ********************************************************************************** 176 177 BLOCK SRCHLIST subroutine 178 ENTRY SRCHLIST 179 180 BEGFRAME 181 ENDFRAME 182 030AA DD1F8001 6 STAK 183 SRCHLIST ENTR PUSH 030AB C0120000 0 REG 184 STPL R0 save the lock word address 030AC 0CC00000 185 IOFF turn off the interrupts 000030AD 186 SRCHLIST1 LABEL 030AD D0160800 0 BASE 187 INC R0,0 count up the search busy count 030AE FE0630B6 188 JGE SRCHLIST3 jump if list not being modified 030AF D0560800 0 BASE 189 DEC R0,0 remove our count 000030B0 190 SRCHLIST2 LABEL 030B0 DC4030BC 191 CALLNP DYNMON monitor dynamic waits 030B1 0C800000 192 ION allow interrupts, if any 030B2 0CC00000 193 IOFF ... but not for long 030B3 5C160800 0 BASE 194 CMZ R0,0 is list still being modified? 030B4 FE0630AD 195 JGE SRCHLIST1 jump if not 030B5 FE0E30B0 196 JMP SRCHLIST2 jump to wait some more 197 * --- 198 000030B6 199 SRCHLIST3 LABEL 030B6 5D1F8001 6 STAK 200 LEAVE POP return 201 * --- 202 203 END SRCHLIST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 593 (LISTLOCK) F 34 List Locking Utilities 205 206 ********************************************************************************** 207 * * 208 * Routine to say that we're done searching. Inverse of * 209 * SRCHLIST. * 210 * SP = stack pointer * 211 * CALL UNSRCHLIST * 212 * PARL * 213 * Enables the interrupts. * 214 * * 215 * Eats R0. * 216 * Stack required = 1. * 217 * * 218 ********************************************************************************** 219 220 BLOCK UNSRCHLIST subroutine 221 ENTRY UNSRCHLIST 222 223 BEGFRAME 224 ENDFRAME 225 030B7 DD1F8001 6 STAK 226 UNSRCHLIST ENTR PUSH 030B8 C0120000 0 REG 227 STPL R0 save the lock word address 030B9 D0560800 0 BASE 228 DEC R0,0 remove our count 030BA 0C800000 229 ION restore interrupts 030BB 5D1F8001 6 STAK 230 LEAVE POP return to caller 231 * --- 232 233 END UNSRCHLIST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 594 (LISTLOCK) F 34 List Locking Utilities 235 236 ********************************************************************************** 237 * * 238 * Routine to monitor dynamic wait time. We will increment * 239 * the dynamic wait counter, and we will record who was trying * 240 * to wait ( if there is a buffer for this recording ). Call: * 241 * R7 = callers return address * 242 * CALLNP DYNMON * 243 * * 244 * Stack required = 0. * 245 * * 246 ********************************************************************************** 247 248 BLOCK DYNMON subroutine 249 ENTRY DYNMON 250 030BC DD400463 251 DYNMON ENTRNP DYNLINK 030BD D0001D0E 252 INC DYNWAIT advance the global counter 030BE 5C001D14 253 CMZ DYNBLOCK are we monitoring the PC? 030BF FE0230C7 254 JEQ DYNRET jump if not 030C0 E4000464 0 255 ST R0 DYNTEMP save this register 030C1 601030C8 0 @ 256 LD R0 @DYNLINKPTR get bucket number in which to accumulate count 030C2 10040100 0 IMM 257 SUB R0 DYNBASE no interest in addresses below 030C3 500403FF 0 IMM 258 MIN R0 DYNMAX-1 avoid numbers off end of monitor 030C4 54040001 0 IMM 259 MAX R0 1 and page 0 numbers 030C5 D0301D14 0 @ 260 INC @DYNBLOCK(R0) increment the counter 030C6 60000464 0 261 LD R0 DYNTEMP restore register 000030C7 262 DYNRET LABEL 030C7 5D000463 263 LEAVE DYNLINK return 264 * --- 265 030C8 7B080463 266 DYNLINKPTR PTR DYNLINK/DYNBITS bits from PC to monitor 267 268 END DYNMON subroutine 269 270 271 END List Locking Utilities 60 INPUT WINDOW XREQ virtual window handlers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 595 (WINDOW) F 35 Resident User Window Routines 3 4 BLOCK user page table managers 5 ENTRY CHKWNDOS check for windows 6 ENTRY CREATEVP create a VP element 7 ENTRY DMOTEPAGE move PAL to WS list 8 ENTRY DMOTEWNDO1 move wndo1 PAL to WS list 9 ENTRY DMOTEWNDO2 (you can see the pattern by now) 10 ENTRY DMOTEWNDO3 11 ENTRY DMOTINDPAL move PAL's for indirect pages to WSX 12 ENTRY DUALWRITE accomplish write to two spots 13 ENTRY FINDPAL to find and remove a PAL 14 ENTRY FORCEWRW1 force write of window 1 15 ENTRY FORCEWRW2 force write of window 2 16 ENTRY FORCEWRW3 force write of window 3 17 ENTRY GRUBPAGE release a virtual page 18 ENTRY GRUBVPEL release virtual page element and page 19 ENTRY GRUBWNDO1 release grip on window 1 20 ENTRY GRUBWNDO2 release grip on window 2 21 ENTRY GRUBWNDO3 release grip on window 3 22 ENTRY LOCKPAGE lock an already mapped page 23 ENTRY RSTRWNDO restore window saved by SAVEWNDOx 24 ENTRY SAVEWNDO1 save the state of a window 25 ENTRY SAVEWNDO2 save the state of a window 26 ENTRY SAVEWNDO3 save the state of a window 27 ENTRY SETERRPG set error address for a page 28 ENTRY SETERRW1 set error address for window 1 29 ENTRY SETERRW2 set error address for window 2 30 ENTRY SETERRW3 set error address for window 3 31 ENTRY SETMODIFW1 set modified and clear locked 32 ENTRY SETMODIFW2 set modified and clear locked 33 ENTRY SETMODIFW3 set modified and clear locked 34 ENTRY SETWNDO1 set up window 1 for block access 35 ENTRY SETWNDO2 set up window 2 for block access 36 ENTRY SETWNDO3 set up window 3 for block access 37 ENTRY SETWNDOX set up window in R0 for block access 38 ENTRY SETPAGEX set up virt. page in R0 for block access 39 ENTRY ULKPAGE unlock a page (allow it to swap) 40 ENTRY ULKWNDO1 allow window 1 to be swapped 41 ENTRY ULKWNDO2 allow window 2 to be swapped 42 ENTRY ULKWNDO3 allow window 3 to be swapped 43 ENTRY VASPCLNALL to remove pages from a specified unit 44 ENTRY VOLFORGET to eliminate pages from a specified volume 45 ENTRY WSXCLNALL to remove specified PAL's from all WSX lists 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 596 (WINDOW) F 35 Resident User Window Routines 47 48 ********************************************************************************** 49 * * 50 * CREATEVP * 51 * Routine to create a VPAGE element and return a pointer * 52 * to it. This routine is intended for use by the XREQ * 53 * routines that add pages to the virtual memory ( FRMAPIN and * 54 * FRCREATEUP ). A memory entry for that page must not * 55 * already exist. * 56 * Call: * 57 * CALL CREATEVP call for new page * 58 * note: eats R0 and R1 before requesting parameters * 59 * PARV * 60 * PARV * 61 * PARV * 62 * PARV * 63 * PARVL * 64 * returns with R1 => the VP element. * 65 * * 66 * Eats R0. * 67 * Stack required = 2. * 68 * 1 + max ( FCGETMEM (0), ZEROIT (1) ) * 69 * * 70 ********************************************************************************** 71 72 BLOCK CREATEVP subroutine 73 ENTRY CREATEVP 74 75 BEGFRAME 76 ENDFRAME 77 030C9 DD9F8001 6 STAK 78 CREATEVP ENTRS PUSH 030CA DC002F0A 79 CALL VGETMEM get memory for the element 030CB 40440002 IMM 80 PARVL VPLOG indicate its size 030CC 60520000 1 0 REG 81 LD R1 R0 make a copy of the pointer 030CD DC003090 82 CALL ZEROIT call to clear the element 030CE 41164800 1 BASE 83 PAR R1,0 indicate its location 030CF 40440004 IMM 84 PARVL 2 POWER VPLOG and its length 030D0 DCD3C000 7 REG 85 EXPCS R7 go get the parameters 030D1 C1564004 1 CACH 86 STPV R1,VPVPN the virtual page number 030D2 C1564803 1 BASE 87 STPV R1,VPBLOCK the MS block number 030D3 C14842E2 1 ZBM 88 STPV R1,VPFBITYPE the type of block expected 030D4 C1485F11 1 ZBM 89 STPV R1,VPFCB address of FCB associated with this page 030D5 C0484E80 1 ZBM 90 STPVL R1,VPCNTL misc. control bits 030D6 5D1F8001 6 STAK 91 LEAVE POP return 92 * --- 93 94 END CREATEVP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 597 (WINDOW) F 35 Resident User Window Routines 96 97 ********************************************************************************** 98 * * 99 * GRUBPAGE * 100 * Routine to completely discombooberate a page. This * 101 * routine is called when we believe that this block is * 102 * unlikely to be referenced again in the near future. It * 103 * avoids waiting for pages to age enough to get ripped off. * 104 * The VMLIST element is destroyed, the page access element is * 105 * clobbered and the MS block is freed if the block type was * 106 * for swap. Note that the disk space must be accounted for * 107 * when we destroy the VPAGE element corresponding to a * 108 * swapping page because that is the only record that the * 109 * system has of the MS block assignment. The PPAGE element * 110 * is moved to the idle list if this was the only user of the * 111 * page. The effect on an indirect VP element is just to * 112 * remove the VP element and any page access element referring * 113 * to it and this does not affect the memory of the one being * 114 * pointed to. * 115 * * 116 * SP => return address stack * 117 * LD R0 * 118 * CALLNP GRUBPAGE * 119 * * 120 * Eats R0:R3. * 121 * Stack required = 7. * 122 * 3 + max ( DELSWAP (1), DISCARDPAL (4), FINDPAL (1), * 123 * LOCKWAIT (0), PFAGEWSX (0), PUTADT (3), * 124 * VFREEMEM (0) ) * 125 * * 126 ********************************************************************************** 127 128 ********************************************************************************** 129 * * 130 * GRUBVPEL * 131 * Routine accepts a pointer to an unlinked VP element. * 132 * Free's the block if it is a swapping type and returns the * 133 * VP element to free storage. The PAL is removed from the * 134 * VASP or WSX list pointed to in the specified UPC block. * 135 * Note: This cannot be used for the currently running UPC. * 136 * The disk space is accounted for when this routine destroys * 137 * the VPAGE element corresponding to a swapping page because * 138 * that is the only record the system keeps of the MS block * 139 * assignment. * 140 * * 141 * SP => stack * 142 * R2 => VP element * 143 * R4 => UPC block * 144 * CALLNP GRUBVPEL * 145 * * 146 * Eats R0:R3. * 147 * Stack required = 7. See GRUBPAGE. * 148 * * 149 ********************************************************************************** 150 151 BLOCK GRUBxxxx and DMOTExxxx subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 598 (WINDOW) F 35 Resident User Window Routines 152 ENTRY GRUBVPEL 153 ENTRY GRUBPAGE 154 ENTRY GRUBWNDO1 155 ENTRY GRUBWNDO2 156 ENTRY GRUBWNDO3 157 ENTRY DMOTEPAGE 158 ENTRY DMOTEWNDO1 159 ENTRY DMOTEWNDO2 160 ENTRY DMOTEWNDO3 161 162 BEGFRAME 00178801 6 BASE 163 GRUBPAGET BSS 1 R4 save 00178802 6 BASE 164 GRUBPAGPTR BSS 1 holds pointer to VP element 165 ENDFRAME 166 00000010 BYTE 167 DMOTEFLAG EQU BIT 0 bit in R7, if on, don't discard PAL 168 030D7 DD5F8003 6 STAK 169 GRUBVPEL ENTRNP PUSH 030D8 E5178801 4 6 BASE 170 ST R4 SP,GRUBPAGET save this bothersome register 030D9 E4978802 2 6 BASE 171 ST R2 SP,GRUBPAGPTR save the VP element pointer 030DA 60D68004 3 2 CACH 172 LD R3 R2,VPVPN get page number 030DB 3857080F 1 4 BASE 173 LEA R1 R4,UPCVASP pick up pointer to list head 030DC 0CC00000 174 IOFF interrupts off 030DD 6017080F 0 4 BASE 175 LD R0 R4,UPCVASP and pick up pointer to first element 030DE 48D60000 3 0 CACH 176 RLSRCH R3 R0,PAVPN see if this block is in VASP list 030DF FE0C3104 177 JNE GRUBVPWSX try WSX list 030E0 61120000 4 0 REG 178 LD PAL R0 copy address of found PAL 030E1 60091F10 0 4 ZBM 179 LD R0 PAL,PALINK load forward pointer from element to be removed 030E2 E4085F10 0 1 ZBM 180 ST R0 R1,PALINK remove element from list 030E3 FE0E30F6 181 JMP GRUBDUMP go check if swapping page 182 * --- 183 030E4 DD5F8003 6 STAK 184 GRUBPAGE ENTRNP PUSH 030E5 60D20000 3 0 REG 185 LD R3 R0 copy the page number 000030E6 186 GRUBPENTER LABEL 030E6 EC0BC010 7 CBM 187 STZ R7/DMOTEFLAG indicate to discard PAL 000030E7 188 DMOTEENTR LABEL 189 030E7 60000414 0 190 LD R0 CPCUPC get the current UPC pointer 030E8 3896080E 2 0 BASE 191 LEA R2 R0,UPCWVMLIST get effective address of list head 030E9 6056080E 1 0 BASE 192 LD R1 R0,UPCWVMLIST pointer to first element in window VP list 030EA F6F030ED 3 193 JBT R3/MONBIT GBSWL jump if search is in window list 030EB 3896080D 2 0 BASE 194 LEA R2 R0,UPCVMLIST get effective address of list head 030EC 6056080D 1 0 BASE 195 LD R1 R0,UPCVMLIST pointer to first element in virtual memory list 000030ED 196 GBSWL LABEL 030ED 48D64004 3 1 CACH 197 RLSRCH R3 R1,VPVPN search for the specified element 030EE FE0C314F 198 JNE GRUBPNFR jump if not found 030EF E5178801 4 6 BASE 199 ST R4 SP,GRUBPAGET save this bothersome register 030F0 60085F10 0 1 ZBM 200 LD R0 R1,VPLINK load forward pointer from victim element 030F1 E4089F10 0 2 ZBM 201 ST R0 R2,VPLINK remove victim from the list 030F2 E4578802 1 6 BASE 202 ST R1 SP,GRUBPAGPTR save the VP element pointer 030F3 60924000 2 1 REG 203 LD R2 R1 copy VP element pointer 030F4 DC40330C 204 CALLNP FINDPAL search VASP for the page access element 030F5 FE0E3101 205 JMP GRUBNOPAL no such PAL (already swapped out) 206 * \ / 207 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 599 (WINDOW) F 35 Resident User Window Routines 208 * R2 = VPAGE element, PAL => PAL, IOFF = 1 209 210 ********************************************************************************** 211 * * 212 * Check to see if discarding a swapping page. Please * 213 * note the special case where the VP element is an indirect * 214 * element: these elements were initialized with 0 in the * 215 * FBITYPE field, so they don't look like swapping pages * 216 * (which would be a disaster). * 217 * If this is a swapping page, we clear its dirty bit so * 218 * that it won't get written out, since its contents are being * 219 * forgotten. * 220 * * 221 ********************************************************************************** 222 223 * \ / 000030F6 224 GRUBDUMP LABEL 030F6 60C882E2 3 2 ZBM 225 LD R3 R2,VPFBITYPE get the block type 030F7 64C4000B 3 IMM 226 CPR R3 FBITSYS compare to swapping type 030F8 FE0C30FB 227 JNE LEAVEDIRT jump if not swapping page 030F9 EC091C12 4 ZBM 228 STZ PAL,PAMODIFIED fake like page never dirtied 030FA EC0BC010 7 CBM 229 STZ R7/DMOTEFLAG always discard this PAL 000030FB 230 LEAVEDIRT LABEL 231 030FB F7C03111 7 232 JBT R7/DMOTEFLAG GRUBPGDMOT jump if demoting page to WSX 030FC DC402E15 233 CALLNP DISCARDPAL we're done with the page for good 030FD 60400412 1 234 LD R1 CPPSA get the current PSA pointer 030FE D04840F2 1 ZBM 235 DEC R1,PSWSSIZE indicate that the working set shrunk 030FF 60978802 2 6 BASE 236 LD R2 SP,GRUBPAGPTR retrieve pointer to old VP element 03100 FE0E3119 237 JMP GRUBRISHAR go handle the page 238 * --- 239 240 ********************************************************************************** 241 * * 242 * We didn't find the page in the VASP list. Look in the * 243 * working set extension so that we really get rid of unused * 244 * pages. * 245 * * 246 ********************************************************************************** 247 00003101 248 GRUBNOPAL LABEL 03101 F7C0311A 7 249 JBT R7/DMOTEFLAG GRUBBYEVP don't look in WSX if we are 250 * demoting an element (avoid fancy NOP) 03102 0CC00000 251 IOFF turn off interrupts 03103 61000414 4 252 LD R4 CPCUPC get the current UPC pointer 253 00003104 254 GRUBVPWSX LABEL 03104 60170810 0 4 BASE 255 LD R0 R4,UPCWSX get pointer to first element 03105 FA303119 0 256 JZA R0 GRUBRISHAR continue if no WSX list 03106 38570810 1 4 BASE 257 LEA R1 R4,UPCWSX get pointer to list head 03107 60D68803 3 2 BASE 258 LD R3 R2,VPBLOCK get the block number being discarded 00003108 259 GRUBDOMORE LABEL 03108 61160803 4 0 BASE 260 LD R4 R0,PAPPLPTR pick up this elements PPL pointer 03109 64D70801 3 4 BASE 261 CPR R3 R4,PPBLOCK does it contain the block of interest? 0310A FE02310D 262 JEQ GRUBELFND jump if so 0310B FA3A3108 01 263 RLJNA R0 GRUBDOMORE scan through the list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 600 (WINDOW) F 35 Resident User Window Routines 0310C FE0E3119 264 JMP GRUBRISHAR jump out without finding any 265 * --- 0000310D 266 GRUBELFND LABEL 0310D 61120000 4 0 REG 267 LD PAL R0 copy pointer to found element 0310E 60091F10 0 4 ZBM 268 LD R0 PAL,PALINK load forward pointer from element to be removed 0310F E4085F10 0 1 ZBM 269 ST R0 R1,PALINK remove element from list 03110 FE0E30F6 270 JMP GRUBDUMP go check if swapping page 271 * --- 272 273 ********************************************************************************** 274 * * 275 * This page is not being completely freed, but is only * 276 * being demoted into the working set extension list. Here we * 277 * link it into the WSX list and then free the VP element. * 278 * Note that UPCXAGEVASP is 0 when we get so that it need * 279 * not be added to the PAL age. Also, note that UPCMAGEW is * 280 * unlikely to be affected by this PAL, so we save time by * 281 * "forgetting" to update it. * 282 * * 283 ********************************************************************************** 284 00003111 285 GRUBPGDMOT LABEL 286 * this unlock is so that DMOTE may be 287 * called with pages still locked. 03111 EC091210 4 ZBM 288 STZ PAL,PALOCK unlock the page 03112 DC4025DD 289 CALLNP PFAGEWSX distribute age into WSX list 03113 60400414 1 290 LD R1 CPCUPC get the current UPC pointer 03114 60164810 0 1 BASE 291 LD R0 R1,UPCWSX get pointer to existing list 03115 E4091F10 0 4 ZBM 292 ST R0 PAL,PALINK link existing list after us 03116 E5164810 4 1 BASE 293 ST PAL R1,UPCWSX and make us new list head 03117 0C800000 294 ION restore interrupts 03118 FE0E314A 295 JMP GRUBDOVP go finish up 296 * --- 297 298 ********************************************************************************** 299 * * 300 * Okay, we have taken care of the lists attached to the * 301 * PSA and properly disposed of the PPAGE element. Now check * 302 * to see if the page that we are discarding has no roots. * 303 * That is, is this page strictly a swapping page? Please * 304 * note the special case where the VP element is an indirect * 305 * element: these elements were initialized with 0 in the * 306 * FBITYPE field, so they don't look like swapping pages * 307 * (which would be a disaster). If it is a swapping page, we * 308 * must return it to the ADT. * 309 * * 310 ********************************************************************************** 311 00003119 312 GRUBRISHAR LABEL 03119 0C800000 313 ION restore interrupts 0000311A 314 GRUBBYEVP LABEL 0311A 60C882E2 3 2 ZBM 315 LD R3 R2,VPFBITYPE get the type of this block 0311B 64C4000B 3 IMM 316 CPR R3 FBITSYS check for system swapping 0311C FE0C314A 317 JNE GRUBDOVP jump if not 318 * \ / 0311D 60D68803 3 2 BASE 319 LD R3 R2,VPBLOCK get the block number in question 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 601 (WINDOW) F 35 Resident User Window Routines 0311E 608AF460 2 3 CBM 320 LD R2 R3/PPHASHFLD get its hash function 321 PLOCK PPAGELOCK(R2) lock the appropriate PPAGELIST 0311F 0CC00000 321 IOFF 03120 D1E41E21 2 321 SETT PPAGELOCK(R2) 03121 FE0C3123 321 JNE MA(2+DISPW MA 0) 03122 DC40308B 321 CALLNP LOCKWAIT 03123 60641E61 1 2 322 LD R1 PPAGELIST(R2) get the appropriate head pointer 03124 3CD64801 3 1 BASE 323 LSRCH R3 R1,PPBLOCK look for the PPL for this block 03125 FE0C312E 324 JNE NOTINCORE1 jump if not found 325 SETTBIT R1,PPPUTADT set the bit indicating to go to ADT 03126 60024000 0 IMM 325 LD R0 1*BIT(((R1,PPPUTADT) DISP (R1,0))/BITS 0:4) 03127 FC164802 0 1 BASE 325 IORM R0 R1,(((R1,PPPUTADT) DISP (R1,0))/BITS 15:31) 03128 60084081 0 1 ZBM 326 LD R0 R1,PPBLOCK/VOLFIELD volume number for this PPL 03129 60201F22 0 0 327 LD R0 VOLNTABLE(R0) get access to the VOLN element 0312A D0160815 0 BASE 328 INC R0,VOLNBUSY make volume busy for the ADT element to be created 329 PUNLOCK PPAGELOCK(R2) release the list 0312B EC241E21 2 329 STZ PPAGELOCK(R2) 0312C 0C800000 329 ION 0312D FE0E3149 330 JMP FREESWAPPG free space taken care of, finish off VP 331 * --- 332 0000312E 333 NOTINCORE1 LABEL block not found in busy PPLs 334 PLOCK PPIDLOCK lock the idle list 0312E 0CC00000 334 IOFF 0312F D1C01DD9 334 SETT PPIDLOCK 03130 FE0C3132 334 JNE MA(2+DISPW MA 0) 03131 DC40308B 334 CALLNP LOCKWAIT 335 PUNLOCK PPAGELOCK(R2) release the PPAGE list 03132 EC241E21 2 335 STZ PPAGELOCK(R2) 03133 0C800000 335 ION 03134 608AF650 2 3 CBM 336 LD R2 R3/IDLHASHFLD pick up hash value 03135 60241DDD 0 2 337 LD R0 PPUSDIDLE(R2) get the list head 03136 38641DDD 1 2 338 LEA R1 PPUSDIDLE(R2) get address list head 03137 48D60801 3 0 BASE 339 RLSRCH R3 R0,PPBLOCK look down it for the block 03138 FE0C3142 340 JNE NOTINCORE2 jump if block not resident at all 03139 61120000 4 0 REG 341 LD PPL R0 place the PPL pointer in this register 0313A 60091F10 0 4 ZBM 342 LD R0 PPL,PPLINK get the pointer from this element 0313B E4085F10 0 1 ZBM 343 ST R0 R1,PPLINK and remove us from the list 0313C FA32313E 0 344 JNZA R0 SKIPENDFIX if not null, don't fixup end pointer 0313D E4641DFD 1 2 345 ST R1 PPENDIDLE(R2) adjust the end pointer appropriately 346 * \ / 347 0000313E 348 SKIPENDFIX LABEL 0313E EC170801 4 BASE 349 STZ PPL,PPBLOCK destroy block number to prevent later duplicates 0313F 60001DDC 0 350 LD R0 PPCLNIDLE get pointer to head of list 03140 E4091F10 0 4 ZBM 351 ST R0 PPL,PPLINK put us in front of the list 03141 E5001DDC 4 352 ST PPL PPCLNIDLE we are now the new head honcho 353 * \ / 354 00003142 355 NOTINCORE2 LABEL 356 PUNLOCK PPIDLOCK release the idle list 03142 EC001DD9 356 STZ PPIDLOCK 03143 0C800000 356 ION 03144 600AC080 0 3 CBM 357 LD R0 R3/VOLFIELD get the volume number 03145 60201F22 0 0 358 LD R0 VOLNTABLE(R0) get pointer to the VOLN element 03146 D0160815 0 BASE 359 INC R0,VOLNBUSY busy volume for ADT element to be created 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 602 (WINDOW) F 35 Resident User Window Routines 03147 DC00502C 360 CALL PUTADT call to give back the block 03148 4052C000 3 REG 361 PARVL R3 pass the block number 362 * \ / 363 00003149 364 FREESWAPPG LABEL 03149 DC402596 365 CALLNP DELSWAP indicate the space returned 366 * \ / 367 0000314A 368 GRUBDOVP LABEL 0314A 60978802 2 6 BASE 369 LD R2 SP,GRUBPAGPTR retrieve the pointer to the old VP element 0314B DC002F8F 370 CALL VFREEMEM free this block of memory 0314C 41440002 IMM 371 PARV VPLOG indicate its length 0314D 40528000 2 REG 372 PARVL R2 and memory address 0314E 61178801 4 6 BASE 373 LD R4 SP,GRUBPAGET restore this register 0000314F 374 GRUBPNFR LABEL 0314F 5D1F8003 6 STAK 375 LEAVE POP 376 * --- 377 378 ********************************************************************************** 379 * * 380 * GRUBWNDOx * 381 * Specifies that the specified window will probably not * 382 * be used for a long time and thus need not be aged normally * 383 * but may be removed from the working set now. Note that * 384 * windows are not checked to see if they are swapping pages. * 385 * * 386 * SP => return address stack * 387 * CALLNP GRUBWNDOx * 388 * * 389 * Eats R0:R3. * 390 * Stack required = 7. See GRUBPAGE. * 391 * * 392 ********************************************************************************** 393 03150 DD5F8003 6 STAK 394 GRUBWNDO1 ENTRNP PUSH 03151 60C40082 3 IMM 395 LD R3 PNWNDO1 produce the page number 03152 FE0E30E6 396 JMP GRUBPENTER go share general code 397 * --- 398 03153 DD5F8003 6 STAK 399 GRUBWNDO2 ENTRNP PUSH 03154 60C40083 3 IMM 400 LD R3 PNWNDO2 produce the page number 03155 FE0E30E6 401 JMP GRUBPENTER go share general code 402 * --- 403 03156 DD5F8003 6 STAK 404 GRUBWNDO3 ENTRNP PUSH 03157 60C40084 3 IMM 405 LD R3 PNWNDO3 produce the page number 03158 FE0E30E6 406 JMP GRUBPENTER go share general code 407 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 603 (WINDOW) F 35 Resident User Window Routines 409 410 ********************************************************************************** 411 * * 412 * DMOTEPAGE * 413 * This routine will remove the VP element for the * 414 * specified page and then cause the PAL, if it exists, in the * 415 * VASP list to be demoted into the working set extension * 416 * list. If the page is a swapping page, though, it is * 417 * 'grubbed'. The lock bit is cleared when the PAL is moved * 418 * into the WSX list, so this routine may be called with * 419 * locked pages. * 420 * DMOTEPAGE is used when the page being removed from the * 421 * active working set may be used shortly and its main feature * 422 * is that if a modified page is 'grubbed', it is queued for * 423 * disk write. Demoting instead will delay this write until * 424 * the user is done with the program or I/O device. * 425 * Call: * 426 * SP => stack * 427 * LD R3 * 428 * CALLNP DMOTEPAGE * 429 * * 430 * Eats R0:R3. * 431 * Stack required = 7. See GRUBPAGE. * 432 * * 433 ********************************************************************************** 434 03159 DD5F8003 6 STAK 435 DMOTEPAGE ENTRNP PUSH 0000315A 436 DMOTESHARE LABEL 0315A EDCBC010 7 CBM 437 STW R7/DMOTEFLAG set flag saying only demoting 0315B FE0E30E7 438 JMP DMOTEENTR share a lot of code with GRUBPAGE 439 * --- 440 441 * Usually demote windows 0315C DD5F8003 6 STAK 442 DMOTEWNDO1 ENTRNP PUSH 0315D 60C40082 3 IMM 443 LD R3 PNWNDO1 page to do it to 0315E FE0E315A 444 JMP DMOTESHARE 445 * --- 446 0315F DD5F8003 6 STAK 447 DMOTEWNDO2 ENTRNP PUSH 03160 60C40083 3 IMM 448 LD R3 PNWNDO2 page to do it to 03161 FE0E315A 449 JMP DMOTESHARE 450 * --- 451 03162 DD5F8003 6 STAK 452 DMOTEWNDO3 ENTRNP PUSH 03163 60C40084 3 IMM 453 LD R3 PNWNDO3 page to do it to 03164 FE0E315A 454 JMP DMOTESHARE 455 * --- 456 457 END GRUBxxxx and DMOTExxxx subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 604 (WINDOW) F 35 Resident User Window Routines 459 460 ********************************************************************************** 461 * * 462 * DMOTINDPAL - discard indirect PAL's * 463 * This routine searches the VASP list for indirect PAL's * 464 * and moves any that are found to the WSX list. * 465 * Call: * 466 * CALLNP DMOTINDPAL * 467 * * 468 * Eats R0:R3. * 469 * Stack required = 2. * 470 * 2 + max ( UNLOPAL (0) ) * 471 * * 472 ********************************************************************************** 473 474 BLOCK DMOTINDPAL - discard indirect PAL's 475 ENTRY DMOTINDPAL 476 477 BEGFRAME 00178801 6 BASE 478 SAVER4 BSS 1 location for saving R4 479 ENDFRAME 480 03165 DD5F8002 6 STAK 481 DMOTINDPAL ENTRNP PUSH 03166 E5178801 4 6 BASE 482 ST PAL SP,SAVER4 save R4 03167 60000414 0 483 LD R0 CPCUPC get current UPC 03168 3896080F 2 0 BASE 484 LEA R2 R0,UPCVASP get pointer to head of VASP list 03169 0CC00000 485 IOFF 0316A 6056080F 1 0 BASE 486 LD R1 R0,UPCVASP get pointer to first VASP list entry 487 * \ / 488 0000316B 489 INDPALLOOP LABEL 0316B 60C40001 3 IMM 490 LD R3 1 get set flag 0316C 48C85010 3 1 ZBM 491 RLSRCH R3 R1,PAINDVP search for indirect pages 0316D FE0C3177 492 JNE NOINDPAL none found - exit 0316E 61124000 4 1 REG 493 LD PAL R1 set up PAL pointer for unloading PF 0316F DC402623 494 CALLNP UNLOPAL unload page file for this PAL 03170 60C85F10 3 1 ZBM 495 LD R3 R1,PALINK get forward link of PAL to be moved 03171 E4C89F10 3 2 ZBM 496 ST R3 R2,PALINK save in previous PAL - now unlinked 03172 60D60810 3 0 BASE 497 LD R3 R0,UPCWSX get address of first WSX element 03173 E4C85F10 3 1 ZBM 498 ST R3 R1,PALINK save as forward pointer of new element 03174 E4560810 1 0 BASE 499 ST R1 R0,UPCWSX save pointer to new element in head of list 03175 60489F10 1 2 ZBM 500 LD R1 R2,PALINK set up pointer for next search 03176 FE0E316B 501 JMP INDPALLOOP repeat until no indirect pages left 502 * --- 503 00003177 504 NOINDPAL LABEL 03177 0C800000 505 ION 03178 61178801 4 6 BASE 506 LD PAL SP,SAVER4 restore R4 03179 5D1F8002 6 STAK 507 LEAVE POP 508 * --- 509 510 END DMOTINDPAL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 605 (WINDOW) F 35 Resident User Window Routines 512 513 ********************************************************************************** 514 * * 515 * CHKWNDOS * 516 * This routine is used to check that no windows are in * 517 * the VM list. If a window is found, a STOP will be * 518 * executed. A restart (GO) from the STOP will cause * 519 * DMOTEWNDOs to be called and execution will continue. * 520 * Call: * 521 * CALLNP CHKWNDOS * 522 * * 523 * Eats R0:R3. * 524 * Stack required = 8. * 525 * 1 + max ( DMOTEWNDOx (7) ) * 526 * * 527 ********************************************************************************** 528 529 BLOCK CHKWNDOS subroutine 530 ENTRY CHKWNDOS 531 532 BEGFRAME 533 ENDFRAME 534 0317A DD5F8001 6 STAK 535 CHKWNDOS ENTRNP PUSH 0317B 0CC00000 536 IOFF prevent interference with list search 0317C 60400414 1 537 LD R1 CPCUPC get pointer to UPC 0317D 6096480E 2 1 BASE 538 LD R2 R1,UPCWVMLIST get pointer to 'window' VM list 0317E 60C40041 3 IMM 539 LD R3 PNWNDO12 get number to match window 1 or 2 0317F 3CC88071 3 2 ZBM 540 LSRCH R3 R2,VPVPN/PASIGBITS see if in VM list 03180 FE0C3188 541 JNE NOWNDOS jump if not found 03181 60168004 0 2 CACH 542 LD R0 R2,VPVPN get the page number 03182 F63E3185 0 543 JBT R0/BIT 31 ITSWINDOW2 03183 00930064 544 STOP STOPS0064 stop if window 1 mapped 03184 FE0E3186 545 JMP CONTINUE keep moving 546 * --- 547 00003185 548 ITSWINDOW2 LABEL 03185 00930065 549 STOP STOPS0065 stop if window 2 mapped 00003186 550 CONTINUE LABEL 03186 DC40315C 551 CALLNP DMOTEWNDO1 demote the window to the WSX list 03187 DC40315F 552 CALLNP DMOTEWNDO2 demote the window to the WSX list 00003188 553 NOWNDOS LABEL 03188 0C800000 554 ION restore interrupts 03189 5D1F8001 6 STAK 555 LEAVE POP return 556 * --- 557 558 END of CHKWNDOS 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 606 (WINDOW) F 35 Resident User Window Routines 560 561 ********************************************************************************** 562 * * 563 * SETERRWx * 564 * These routines change the error jump address for the * 565 * specified window or page. Nothing really fancy is done. * 566 * Call: * 567 * LD R0
* 568 * CALLNP SETERRWx * 569 * or * 570 * LD R0
* 571 * LD R1 * 572 * CALLNP SETERRPG * 573 * * 574 * Eats R1:R2. * 575 * Stack required = 1 * 576 * * 577 ********************************************************************************** 578 579 BLOCK SETERRWx/SETERRPG subroutines 580 ENTRY SETERRPG 581 ENTRY SETERRW1 582 ENTRY SETERRW2 583 ENTRY SETERRW3 584 585 BEGFRAME 586 ENDFRAME 587 0318A DD5F8001 6 STAK 588 SETERRW3 ENTRNP PUSH 0318B 60440084 1 IMM 589 LD R1 PNWNDO3 produce the page number 0318C FE0E3197 590 JMP SERRWEN go share code 591 * --- 592 0318D DD5F8001 6 STAK 593 SETERRW2 ENTRNP PUSH 0318E 60440083 1 IMM 594 LD R1 PNWNDO2 produce the page number 0318F FE0E3197 595 JMP SERRWEN go share code 596 * --- 597 03190 DD5F8001 6 STAK 598 SETERRW1 ENTRNP PUSH 03191 60440082 1 IMM 599 LD R1 PNWNDO1 produce the page number 03192 FE0E3197 600 JMP SERRWEN go share code 601 * --- 602 03193 DD5F8001 6 STAK 603 SETERRPG ENTRNP PUSH 03194 60800414 2 604 LD R2 CPCUPC get the current UPC pointer 03195 6096880D 2 2 BASE 605 LD R2 R2,UPCVMLIST get root of user pages virtual memory list 03196 F2703199 1 606 JBF R1/MONBIT SERRSNL jump to search normal list 607 * \ / 608 00003197 609 SERRWEN LABEL 03197 60800414 2 610 LD R2 CPCUPC get the current UPC pointer 03198 6096880E 2 2 BASE 611 LD R2 R2,UPCWVMLIST get pointer to window VM list 612 * \ / 613 00003199 614 SERRSNL LABEL 03199 3C568004 1 2 CACH 615 LSRCH R1 R2,VPVPN look for the specified page 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 607 (WINDOW) F 35 Resident User Window Routines 0319A FE0C319C 616 JNE SETERRWXIT if not found, fake innocence 0319B E4089F12 0 2 ZBM 617 ST R0 R2,VPERAD set the error address 618 * \ / 619 0000319C 620 SETERRWXIT LABEL 0319C 5D1F8001 6 STAK 621 LEAVE POP return to caller 622 * --- 623 624 END SETERRWx/SETERRPG subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 608 (WINDOW) F 35 Resident User Window Routines 626 627 ********************************************************************************** 628 * * 629 * FORCEWRWx * 630 * Causes the specified window to be forced to the disk * 631 * now. The specified page must be mapped in the VM list. * 632 * The page need not be locked. The primary difference * 633 * between this routine and GRUBWNDOx is that this routine * 634 * sets the PPFWIP bit to ensure that any new accesses to * 635 * this page will wait for the write completion. This * 636 * routine also leaves the VPP element intact in case another * 637 * reference to the page must be made, normally this would * 638 * only be done to force a wait for the write. * 639 * We search for the PAL. We destroy it if we find it, * 640 * leaving the busy count in the corresponding PPL. If we do * 641 * not find the PAL, we just leave, since that means that it * 642 * has already been removed from the VASP list. If it was * 643 * dirtied, it will have already been queued up for write. If * 644 * the data was not dirtied, but the FBI was altered, it would * 645 * have remained locked until either now, or until a * 646 * SETMODIFWx marked it as dirty. We don't worry about the * 647 * possibility of the PAL being in the WSX list, since it * 648 * shouldn't have gotten there if we were also asked to * 649 * forcewrite it. * 650 * We set the PPFWIP bit in this PPL so that any new * 651 * accesses to this page will wait for the write to complete. * 652 * There is still a busy count of 1 associated with the PAL that * 653 * we found (and destroyed). We make up a write queue element * 654 * and call QDISK to check for duplicates and queue it up for * 655 * write. Call: * 656 * * 657 * SP => return address stack * 658 * CALLNP FORCEWRWx * 659 * R3 return the MS address of the block being written * 660 * * 661 * Registers Used: R0:R3. * 662 * Stack Required: 5. * 663 * 3 + max ( FINDPAL (1), MAPINFBI (2), MAPOUTFBI (2), * 664 * PFREEMEM (0), QDISK (1), SGETMEM (0) ) * 665 * * 666 ********************************************************************************** 667 668 BLOCK FORCEWRWx and DUALWRITE subroutines 669 ENTRY FORCEWRW1 670 ENTRY FORCEWRW2 671 ENTRY FORCEWRW3 672 ENTRY DUALWRITE 673 674 BEGFRAME 00178801 6 BASE 675 FORCEWRB BSS 1 register save 676 BSSB 8 filler 00099182 6 ZBM 677 FORCEWRX BSSB MSBLKLOG MS address of secondary block for DUALWRITE 678 ENDFRAME 679 0319D DD5F8003 6 STAK 680 FORCEWRW1 ENTRNP PUSH 0319E 60C40082 3 IMM 681 LD R3 PNWNDO1 produce the page number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 609 (WINDOW) F 35 Resident User Window Routines 0319F FE0E31A9 682 JMP FORCEN go share general code 683 * --- 684 031A0 DD5F8003 6 STAK 685 FORCEWRW2 ENTRNP PUSH 031A1 60C40083 3 IMM 686 LD R3 PNWNDO2 produce the page number 031A2 FE0E31A9 687 JMP FORCEN go share general code 688 * --- 689 031A3 DD5F8003 6 STAK 690 FORCEWRW3 ENTRNP PUSH 031A4 60C40084 3 IMM 691 LD R3 PNWNDO3 produce the page number 031A5 FE0E31A9 692 JMP FORCEN go share general code 693 * --- 694 695 ********************************************************************************** 696 * * 697 * DUALWRITE * 698 * Routine to set up for a write of the same physical * 699 * page to two different MS blocks. We create a duplicate of * 700 * the PPL to hold the information about the extra transfer. * 701 * Call: * 702 * * 703 * SP => return address stack * 704 * R3 = virtual page number * 705 * CALL DUALWRITE * 706 * PARVL * 707 * * 708 * R3 = MS address of (primary) block written * 709 * * 710 * Eats R0:R3. * 711 * Stack required = 5. See FORCEWRWx. * 712 * * 713 ********************************************************************************** 714 031A6 DD1F8003 6 STAK 715 DUALWRITE ENTR PUSH 031A7 C0499182 6 ZBM 716 STPVL SP,FORCEWRX save the extra block number 031A8 FE0E31AA 717 JMP FORCEDNTRY go enter forcewrite 718 * --- 719 000031A9 720 FORCEN LABEL 031A9 EC099182 6 ZBM 721 STZ SP,FORCEWRX indicate not DUALWRITE 722 * \ / 000031AA 723 FORCEDNTRY LABEL entry for DUALWRITE 031AA 0CC00000 724 IOFF turn off the interrupts 031AB E5178801 4 6 BASE 725 ST R4 SP,FORCEWRB save this register 031AC DC40330C 726 CALLNP FINDPAL look for a PAL 031AD FE0E31DB 727 JMP FORCNEXIT none found, just quietly leave 031AE DC002ED0 728 CALL SGETMEM get a block of memory 031AF 40440002 IMM 729 PARVL MSQLOG this long 031B0 60D20000 3 0 REG 730 LD R3 R0 copy the pointer 031B1 EC16C800 3 BASE 731 STZ R3,MSQWORDA clear the forward pointer and cntl field 031B2 EC16C803 3 BASE 732 STZ R3,MSQXPTR indicate no PPL for DUALWRITE (yet) 031B3 60091430 0 4 ZBM 733 LD R0 PAL,PAMAIFLD get maintenance bits 031B4 E408D230 0 3 ZBM 734 ST R0 R3,MSQTYPE/MSQMAIFLD and set into the control field 031B5 60970803 2 4 BASE 735 LD R2 PAL,PAPPLPTR get pointer to PPL 031B6 E496C802 2 3 BASE 736 ST R2 R3,MSQPPPTR set pointer to actual PPAGE element 031B7 60168801 0 2 BASE 737 LD R0 R2,PPBLOCK get disk address 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 610 (WINDOW) F 35 Resident User Window Routines 031B8 E416C801 0 3 BASE 738 ST R0 R3,MSQBLOCK and set into the MSQ element 031B9 DC002F8F 739 CALL PFREEMEM call to discard the PAL 031BA 41440002 IMM 740 PARV PALOG indicate its length 031BB 40530000 4 REG 741 PARVL PAL and address 031BC 60000412 0 742 LD R0 CPPSA get the current PSA pointer 031BD D04800F2 0 ZBM 743 DEC R0,PSWSSIZE indicate that the working set has shrunk 031BE 0C800000 744 ION restore the interrupts (matches FINDPAL) 031BF 61128000 4 2 REG 745 LD PPL R2 copy PPL pointer to normal register 746 * PPBUSYWORD is already counted for the now removed PAL 747 SETTBIT PPL,PPFWIP indicate force write in progress 031C0 60022000 0 IMM 747 LD R0 1*BIT(((PPL,PPFWIP) DISP (PPL,0))/BITS 0:4) 031C1 FC170802 0 4 BASE 747 IORM R0 PPL,(((PPL,PPFWIP) DISP (PPL,0))/BITS 15:31) 748 749 * PPL => PPL 750 031C2 60899182 2 6 ZBM 751 LD R2 SP,FORCEWRX load the secondary block number (if DUALWRITE) 031C3 FA8231D6 2 752 JEQZ R2 FORNODUAL jump if regular forcewrite 753 * \ / 754 755 ********************************************************************************** 756 * * 757 * DUALWRITE * 758 * Set up the secondary PPL to control the second write. To * 759 * prevent the likelyhood of a DA mismatch we build a whole new * 760 * PPL and FBI. The only oddity is that MAPINFBI must know the * 761 * difference. This is determined by the DUALWPPL bit. Currently, * 762 * the only block that is dualwritten is the security block. * 763 * * 764 ********************************************************************************** 765 766 * \ / 031C4 DC002ED0 767 CALL SGETMEM get a chunk for PPL-FBI 031C5 40440004 IMM 768 PARVL PPFBLOG pass the size 031C6 E416C803 0 3 BASE 769 ST R0 R3,MSQXPTR save pointer to extra PPL 031C7 60920000 2 0 REG 770 LD R2 R0 copy as destination for CMOVE 031C8 60130000 0 4 REG 771 LD R0 PPL orig PPL is source 031C9 60440010 1 IMM 772 LD R1 PPLNTH*CPW indicate length of copy 031CA DA880800 2 01 773 MOVE R2,R0,R1 make a copy of the old PPL 031CB DC002606 774 CALL MAPINFBI get access to FBI, IOFF 031CC 40530000 4 REG 775 PARVL PPL pass PPL address 031CD 60124000 0 1 REG 776 LD R0 R1 establish a source address 031CE 6044002C 1 IMM 777 LD R1 FBILNTH*CPW number of characters to copy 031CF DA880800 2 01 778 MOVE R2,R0,R1 031D0 DC40261B 779 CALLNP MAPOUTFBI free up window and ION 031D1 60099182 0 6 ZBM 780 LD R0 SP,FORCEWRX get secondary block address 031D2 6056C803 1 3 BASE 781 LD R1 R3,MSQXPTR pointer to new PPL-FBI 031D3 E4085181 0 1 ZBM 782 ST R0 R1,PPBLOCK/MSBLKFIELD fix up PPL disk address 031D4 EDC85810 1 ZBM 783 STW R1,DUALWPPL indicate this is a dualwrite PPL 031D5 E4085185 0 1 ZBM 784 ST R0 R1,PPFBFBI/FBIDA fix up this disk address 785 * \ / 786 000031D6 787 FORNODUAL LABEL 788 * R3 => MSQ element, PPL 031D6 DC402E70 789 CALLNP QDISK place MS write queue element 031D7 60D70801 3 4 BASE 790 LD R3 PPL,PPBLOCK pick up block number being written 000031D8 791 FORCEXIT LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 611 (WINDOW) F 35 Resident User Window Routines 031D8 0C800000 792 ION restore the interrupts 031D9 61178801 4 6 BASE 793 LD R4 SP,FORCEWRB restore this register 031DA 5D1F8003 6 STAK 794 LEAVE POP 795 * --- 796 000031DB 797 FORCNEXIT LABEL 031DB 5C099182 6 ZBM 798 CMZ SP,FORCEWRX check for a DUALWRITE 031DC FE0231D8 799 JEQ FORCEXIT jump if not 031DD 00130062 800 HALT HALTS0062 attempted DUALWRITE of unlocked page 801 * --- 802 803 END FORCEWRWx and DUALWRITE subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 612 (WINDOW) F 35 Resident User Window Routines 805 806 ********************************************************************************** 807 * * 808 * LOCKPAGE * 809 * Routine to lock a specified page. * 810 * Call: * 811 * LD R0 * 812 * CALLNP LOCKPAGE * 813 * * 814 * Eats R0:R1. * 815 * Stack required = 1 * 816 * * 817 ********************************************************************************** 818 819 BLOCK LOCKPAGE subroutine 820 ENTRY LOCKPAGE 821 822 BEGFRAME 823 ENDFRAME 824 031DE DD5F8001 6 STAK 825 LOCKPAGE ENTRNP PUSH 031DF 60400414 1 826 LD R1 CPCUPC get pointer to current UPC 031E0 6056480E 1 1 BASE 827 LD R1 R1,UPCWVMLIST get pointer to window virtual memory list 031E1 F63031E4 0 828 JBT R0/MONBIT LKSWL jump if search in window list 031E2 60400414 1 829 LD R1 CPCUPC get UPC back 031E3 6056480D 1 1 BASE 830 LD R1 R1,UPCVMLIST get pointer to virtual memory list 000031E4 831 LKSWL LABEL 031E4 3C164004 0 1 CACH 832 LSRCH R0 R1,VPVPN look for this page specifier 031E5 FE0C31EE 833 JNE LCKPNH no such page, return anyway 031E6 EDC85A10 1 ZBM 834 STW R1,VPCNTL/VPCNTLLKB set the lock bit 031E7 60400414 1 835 LD R1 CPCUPC get the current UPC pointer 031E8 0CC00000 836 IOFF interrupts off 031E9 6056480F 1 1 BASE 837 LD R1 R1,UPCVASP get pointer to VASP list 031EA 3C164000 0 1 CACH 838 LSRCH R0 R1,PAVPN look for the page resident 031EB FE0C31EF 839 JNE LCKFIP jump if not present now 031EC EDC85210 1 ZBM 840 STW R1,PALOCK set the lock bit 031ED 0C800000 841 ION turn the interrupts back on 000031EE 842 LCKPNH LABEL 031EE 5D1F8001 6 STAK 843 LEAVE POP return 844 * --- 845 000031EF 846 LCKFIP LABEL page not in, force it in 031EF 0C800000 847 ION turn the interrupts back on 848 * Note that R1 = 0 after LSRCH failure 031F0 E40A5C80 0 1 CBM 849 ST R0 R1/PAGEFIELD make a memory address 031F1 F63031F3 0 850 JBT R0/MONBIT LCKMMEM jump if monitor memory 031F2 59840040 IMM 851 CLBMSR MSRFRELOC otherwise, set user relocation 000031F3 852 LCKMMEM LABEL 031F3 5C164800 1 BASE 853 CMZ R1,0 reference the page to force it in 031F4 59C40040 IMM 854 IORMSR MSRFRELOC restore normal relocation 855 * since the lock bit was set in the 856 * VPAGE element, the page is now locked 031F5 5D1F8001 6 STAK 857 LEAVE POP so return 858 * --- 859 860 END LOCKPAGE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 613 (WINDOW) F 35 Resident User Window Routines 862 863 ********************************************************************************** 864 * * 865 * SETWNDOx * 866 * Leaves R4 through R7 unchanged. If the VPAGE control * 867 * bits say to lock the page in core, then on return, R2 = ADR * 868 * of FBI for that page and R3 => PPL. * 869 * If setwindow is called with a page still mapped, the * 870 * VP element is re-used. The PAL for any page previously * 871 * occupying this window is unlocked and moved to the WSX * 872 * list. When we enter here, the window must not already * 873 * contain a swapping block since it will not be properly * 874 * freed. * 875 * Returns with window x set up, and (except for R2 as * 876 * mentioned above) R0 through R3 and condition bits mangled. * 877 * The routine SETWNDOX is the same except that the page * 878 * number for the window is passed in R0. SETWNDO must only be * 879 * used for windows 1 through 3 (i.e. the ones that would * 880 * reside in the UPCWVMLIST). SETPAGEX does this pages in the * 881 * user side of page file. * 882 * Call: * 883 * CALL SETWNDOx (SP contains the stack pointer) * 884 * - or - * 885 * CALL SETPAGEx (SP contains the stack pointer) * 886 * R0, R1, R2, R3 are eaten before the * 887 * parameters are requested! * 888 * The caller must not alter R2 during * 889 * the parameter passing. * 890 * PARV * 891 * PARV * 892 * PAR * 893 * PARV * 894 * PARVL * 895 * if locked: PPLWINDOW mapped, * 896 * R2 => FBI, R3 => PPL, IOFF * 897 ** On arrival at the error routine: * 898 ** R0 = error code, R1 = page number, * 899 ** if locked, R2=>FBI (mapped, IOFF), R3=>PPL * 900 * * 901 * Eats R0:R3. * 902 * Stack required = 4. * 903 * 3 + max ( FINDPAL (1), LOCKWAIT (0), PFAGEWSX (0), * 904 * VGETMEM (0) ) * 905 * * 906 ********************************************************************************** 907 908 BLOCK SETWNDOx subroutines 909 ENTRY SETWNDO1 910 ENTRY SETWNDO2 911 ENTRY SETWNDO3 912 ENTRY SETWNDOX 913 ENTRY SETPAGEX 914 915 BEGFRAME 00178801 6 BASE 916 SETWNDOT BSS 1 R4 save 00178802 6 BASE 917 VMLISTADR BSS 1 address in UPC of VP list we use 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 614 (WINDOW) F 35 Resident User Window Routines 918 ENDFRAME 919 031F6 DD9F8003 6 STAK 920 SETPAGEX ENTRS PUSH 031F7 60D20000 3 0 REG 921 LD R3 R0 copy page number to correct register 031F8 60800414 2 922 LD R2 CPCUPC get the current process 031F9 3896880D 2 2 BASE 923 LEA R2 R2,UPCVMLIST get the non-window list 031FA EC0A8010 2 CBM 924 STZ R2/BIT 0 save type of reloc for fault 031FB FE0E320A 925 JMP SETWINDEX share code 926 * --- 927 031FC DD9F8003 6 STAK 928 SETWNDOX ENTRS PUSH 031FD 60D20000 3 0 REG 929 LD R3 R0 copy page number to correct register 031FE FE0E3207 930 JMP SETWINDEN share code 931 * --- 932 031FF DD9F8003 6 STAK 933 SETWNDO2 ENTRS PUSH 03200 60C40083 3 IMM 934 LD R3 PNWNDO2 get the page number 03201 FE0E3207 935 JMP SETWINDEN share code 936 * --- 937 03202 DD9F8003 6 STAK 938 SETWNDO3 ENTRS PUSH 03203 60C40084 3 IMM 939 LD R3 PNWNDO3 get the page number 03204 FE0E3207 940 JMP SETWINDEN share code 941 * --- 942 943 03205 DD9F8003 6 STAK 944 SETWNDO1 ENTRS PUSH 03206 60C40082 3 IMM 945 LD R3 PNWNDO1 produce page number 00003207 946 SETWINDEN LABEL entry for other windows 03207 60800414 2 947 LD R2 CPCUPC get current process 03208 3896880E 2 2 BASE 948 LEA R2 R2,UPCWVMLIST get window list 03209 EDCA8010 2 CBM 949 STW R2/BIT 0 save type of reloc for fault 0000320A 950 SETWINDEX LABEL 0320A E4978802 2 6 BASE 951 ST R2 SP,VMLISTADR save the list we use 0320B E5178801 4 6 BASE 952 ST R4 SP,SETWNDOT save this register 953 0320C 60968800 2 2 BASE 954 LD R2 R2,0 => head of appropriate VPAGE list 0320D 3CD68004 3 2 CACH 955 LSRCH R3 R2,VPVPN look for the window page 0320E FE0C3219 956 JNE SETNEWVP no VM list element, build one 957 0320F DC40330C 958 CALLNP FINDPAL search PSA for current status 03210 FE0E3222 959 JMP SETWNNO 960 * R2 => VPAGE, PAL => current PAL, move to UPCWSX 03211 EC091210 4 ZBM 961 STZ PAL,PALOCK clear out the lock bit 03212 DC4025DD 962 CALLNP PFAGEWSX distribute age to PALs in WSX list 03213 60400414 1 963 LD R1 CPCUPC get the current UPC pointer 03214 60164810 0 1 BASE 964 LD R0 R1,UPCWSX get pointer to head element 03215 E4091F10 0 4 ZBM 965 ST R0 PAL,PALINK hook the list behind us 03216 E5164810 4 1 BASE 966 ST PAL R1,UPCWSX we are now the head element 03217 0C800000 967 ION turn the interrupts back on (matches FINDPAL) 03218 FE0E3222 968 JMP SETWNNO done here, pick up parameters 969 * --- 970 00003219 971 SETNEWVP LABEL create a VM list element for this window 03219 DC002F0A 972 CALL VGETMEM fetch a piece of memory 0321A 40440002 IMM 973 PARVL VPLOG 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 615 (WINDOW) F 35 Resident User Window Routines 0321B E4D60004 3 0 CACH 974 ST R3 R0,VPVPN set the virtual page number 0321C EE160802 0 BASE 975 STZ2 R0,VPWORDC clear out these words 976 * Remember that the interrupts are on here. This 977 * is okay, since no interrupt processor (including 978 * page fault) alters this list. They may, however, 979 * search it, so make sure it's always clean. 0321D 60C99F12 3 6 ZBM 980 LD R3 SP,VMLISTADR/FLDADRS load address to UPC VM chain head 0321E 6056C400 1 3 @R 981 LD R1 @R3 get address of first element 0321F E4481F10 1 0 ZBM 982 ST R1 R0,VPLINK make this element point ahead 03220 E416C400 0 3 @R 983 ST R0 @R3 new element now head of list 03221 60920000 2 0 REG 984 LD R2 R0 copy pointer 985 * \ / 00003222 986 SETWNNO LABEL 987 * R2 => VPAGE element 03222 61178801 4 6 BASE 988 LD R4 SP,SETWNDOT restore this register for the caller 03223 DCD3C000 7 REG 989 EXPCS R7 pick up parameters 03224 C1488E80 2 ZBM 990 STPV R2,VPCNTL save control word 03225 C1489F11 2 ZBM 991 STPV R2,VPFCB save address of associated FCB 03226 C1089F12 2 ZBM 992 STP R2,VPERAD save error address 03227 C1568803 2 BASE 993 STPV R2,VPBLOCK save disk address 03228 C04882E2 2 ZBM 994 STPVL R2,VPFBITYPE save requested FBI type 03229 EC089011 2 ZBM 995 STZ R2,VPINDRCT windows are never indirect 0322A 5C089A10 2 ZBM 996 CMZ R2,VPCNTL/VPCNTLLKB checked for locked in memory 0322B FE023251 997 JEQ SETWNDOLV jump if not locked 998 * \ / 999 1000 ********************************************************************************** 1001 * * 1002 * The user has requested the page locked. We shuffle * 1003 * around the error address so that if a MS error occurs, we * 1004 * get control back and can fix the stack before returning to * 1005 * the callers error address. We then reference the page with * 1006 * a CMZ to cause a page fault and force the page in (before * 1007 * the fault, we clear the operand fetch relocation bit in the * 1008 * MSR, if the virtual page sits in user space). We may do * 1009 * this with the interrupts on because the lock bit is set in * 1010 * the VP element. This causes the PAL to be marked as * 1011 * locked, therefore, the occurrance of interrupts will not * 1012 * cause the page to go away or anything. It has to be this * 1013 * way, of course, because the user will be doing lots more * 1014 * work with the interrupts on. * 1015 * After we have come back with the page present, we * 1016 * search the PPAGE list to find the PPL, and by consequence, * 1017 * the FBI and we return the FBI address to the caller. * 1018 * * 1019 ********************************************************************************** 1020 1021 * \ / 0322C 60568004 1 2 CACH 1022 LD R1 R2,VPVPN get the virtual page number 0322D 604A7310 1 1 CBM 1023 LD R1 R1/BITS 25:9 generate the window address 0322E 60C43252 3 IMM 1024 LD R3 ADR SETWNDODE get MS error address 0322F E0C89F12 3 2 ZBM 1025 EXCH R3 R2,VPERAD a temporary exchange 1026 * in case this discovers a MS error 03230 5C098012 6 ZBM 1027 CMZ SP,VMLISTADR/BIT 0 are we not mon? 03231 FE0C3233 1028 JNE MONSIDE jump if no reloc needed 03232 59840040 IMM 1029 CLBMSR MSRFRELOC look on user side of page file 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 616 (WINDOW) F 35 Resident User Window Routines 00003233 1030 MONSIDE LABEL 03233 5C164800 1 BASE 1031 CMZ R1,0 force the page in ( page fault here ) 03234 59C40040 IMM 1032 IORMSR MSRFRELOC restore monitor fetches 1033 * \ / lucked out, we got the page 1034 00003235 1035 STFINDPPL LABEL 03235 E4C89F12 3 2 ZBM 1036 ST R3 R2,VPERAD restore callers error address 03236 E5178801 4 6 BASE 1037 ST R4 SP,SETWNDOT save this register 03237 61168803 4 2 BASE 1038 LD R4 R2,VPBLOCK get the block number 1039 1040 * look in the page list (note: R0 & R1 are not free herein) 1041 * (R0=possibly disk error code, R1=window address) 03238 60CB3460 3 4 CBM 1042 LD R3 R4/PPHASHFLD leave lower bits for hash code 03239 60920000 2 0 REG 1043 LD R2 R0 save reg from PLOCK 1044 PLOCK PPAGELOCK(R3) call to lock the appropriate PPAGELIST head 0323A 0CC00000 1044 IOFF 0323B D1E61E21 3 1044 SETT PPAGELOCK(R3) 0323C FE0C323E 1044 JNE MA(2+DISPW MA 0) 0323D DC40308B 1044 CALLNP LOCKWAIT 0323E 60128000 0 2 REG 1045 LD R0 R2 restore reg after PLOCK (R0 is out parameter) 0323F 60A61E61 2 3 1046 LD R2 PPAGELIST(R3) get pointer to first element 03240 3D168801 4 2 BASE 1047 LSRCH R4 R2,PPBLOCK look for the proper block 03241 FE023243 1048 JEQ SPGOKAY jump if block found 03242 00130063 1049 HALT HALTS0063 block not found in PPAGE list 1050 * --- 1051 00003243 1052 SPGOKAY LABEL 03243 61128000 4 2 REG 1053 LD R4 R2 save PPL address 03244 E4CB1260 3 4 CBM 1054 ST PFPTR R4/UPR15/PPHASHFLD save PPAGELOCK index 03245 60888C62 2 2 ZBM 1055 LD R2 R2,PPFBIBLK get index into PPLPFMAP 03246 60C400FB 3 IMM 1056 LD PFPTR PNPPLWNDO window to map FBI 03247 0CC00000 1057 IOFF interrupts off 03248 00E41C80 2 1058 LDPF PPLPFMAP(R2) map in the page containing FBI 03249 60CB1F10 3 4 CBM 1059 LD R3 R4/FLDADRS R3 => PPL 0324A 6088C4A0 2 3 ZBM 1060 LD R2 R3,PPFBIDISP get disp of FBI in page 0324B 38A5EC00 2 2 1061 LEA R2 PPLWINDOW(R2) R2 => FBI 0324C 610B1260 4 4 CBM 1062 LD R4 R4/UPR15/PPHASHFLD retrieve lock index 1063 PUNLOCK PPAGELOCK(R4) call to release the appropriate PPAGELIST head 0324D EC281E21 4 1063 STZ PPAGELOCK(R4) 0324E 0C800000 1063 ION 0324F 61178801 4 6 BASE 1064 LD R4 SP,SETWNDOT restore this register for the caller 03250 E5C00465 7 1065 ST R7 MFBILAST remember we mapped in the PPL window 1066 * R0=MS error code|0, R1=window addr, R2=>FBI, R3=>PPL 1067 * \ / 1068 00003251 1069 SETWNDOLV LABEL 03251 5D1F8003 6 STAK 1070 LEAVE POP leave this routine 1071 * --- 1072 1073 ********************************************************************************** 1074 * * 1075 * A mass storage error has occurred within the window * 1076 * routine. Set up so that we return to the users error * 1077 * location. Then go find the PPL so that the error routine * 1078 * has an FBI pointer also. * 1079 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 617 (WINDOW) F 35 Resident User Window Routines 1080 ********************************************************************************** 1081 00003252 1082 SETWNDODE LABEL 03252 59C40040 IMM 1083 IORMSR MSRFRELOC restore monitor fetches 03253 E4CBDF10 3 7 CBM 1084 ST R3 R7/FLDADRS set callers error address as our return 03254 64040072 0 IMM 1085 CPR R0 UINTVMFIDS is this user out of disk space? 03255 FE0C3235 1086 JNE STFINDPPL if not, go find the PPL 03256 E4C89F12 3 2 ZBM 1087 ST R3 R2,VPERAD restore the error address 03257 60840000 2 IMM 1088 LD R2 0 say no FBI since no block 03258 0CC00000 1089 IOFF to imitate the IOFF when mapping PPLWINDOW 03259 5D1F8003 6 STAK 1090 LEAVE POP 1091 * --- 1092 1093 END SETWNDOx subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 618 (WINDOW) F 35 Resident User Window Routines 1095 1096 ********************************************************************************** 1097 * * 1098 * SETMODIFWx * 1099 * Removes the lock bit of a window so that it may leave * 1100 * resident memory. Forces the modified bit to be set so that * 1101 * this page is rewritten. This guarantees that alterations * 1102 * to the FBI are recognized. * 1103 * Call: * 1104 * SP => contains stack pointer * 1105 * CALLNP SETMODIFWx * 1106 * * 1107 * Eats R0:R1. * 1108 * Stack required = 1 * 1109 * * 1110 ********************************************************************************** 1111 1112 BLOCK SETMODIFWx subroutines 1113 ENTRY SETMODIFW1 1114 ENTRY SETMODIFW2 1115 ENTRY SETMODIFW3 1116 1117 BEGFRAME 1118 ENDFRAME 1119 0325A DD5F8001 6 STAK 1120 SETMODIFW2 ENTRNP PUSH 0325B 60040083 0 IMM 1121 LD R0 PNWNDO2 get the page number 0325C FE0E3262 1122 JMP SETMODSHR share code 1123 * --- 1124 0325D DD5F8001 6 STAK 1125 SETMODIFW3 ENTRNP PUSH 0325E 60040084 0 IMM 1126 LD R0 PNWNDO3 get the page number 0325F FE0E3262 1127 JMP SETMODSHR share code 1128 * --- 1129 03260 DD5F8001 6 STAK 1130 SETMODIFW1 ENTRNP PUSH 03261 60040082 0 IMM 1131 LD R0 PNWNDO1 get the page number 00003262 1132 SETMODSHR LABEL 03262 60400414 1 1133 LD R1 CPCUPC get the current UPC pointer 03263 6056480E 1 1 BASE 1134 LD R1 R1,UPCWVMLIST get pointer to window VM list 03264 3C164004 0 1 CACH 1135 LSRCH R0 R1,VPVPN look for this page 03265 FE0C326F 1136 JNE SMDNLV no find is unlikely, 1137 * mostly from error routine cleanups 03266 EC085A10 1 ZBM 1138 STZ R1,VPCNTL/VPCNTLLKB unlock the page 03267 0CC00000 1139 IOFF turn off the interrupts 03268 60400414 1 1140 LD R1 CPCUPC get the current UPC pointer 03269 6056480F 1 1 BASE 1141 LD R1 R1,UPCVASP get pointer to VASP list 0326A 3C164000 0 1 CACH 1142 LSRCH R0 R1,PAVPN look for the proper page 0326B FE0C326E 1143 JNE SMDNH page not originally locked, ok 0326C EDC85C12 1 ZBM 1144 STW R1,PAMODIFIED in case only the FBI was modified 0326D EC085210 1 ZBM 1145 STZ R1,PALOCK clear this lock bit 0000326E 1146 SMDNH LABEL 0326E 0C800000 1147 ION turn the interrupts back on 0000326F 1148 SMDNLV LABEL 0326F 5D1F8001 6 STAK 1149 LEAVE POP 1150 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 619 (WINDOW) F 35 Resident User Window Routines 1151 1152 END SETMODIFWx subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 620 (WINDOW) F 35 Resident User Window Routines 1154 1155 ********************************************************************************** 1156 * * 1157 * UNLOCK WINDOW * 1158 * Removes the lock bit of a page so that it may leave * 1159 * resident memory. The VPAGE element may be absent. The * 1160 * page need not have been locked. ULKWNDOx are special * 1161 * entries provided for the windows. * 1162 * Call: * 1163 * LD R0 * 1164 * CALLNP ULKPAGE SP contains stack pointer * 1165 * returns with R1 => PAL * 1166 * * 1167 * Eats R0, Sets R1. * 1168 * Stack required = 1 * 1169 * * 1170 ********************************************************************************** 1171 1172 BLOCK ULKWNDOx and ULKPAGE subroutines 1173 ENTRY ULKWNDO1 1174 ENTRY ULKWNDO2 1175 ENTRY ULKWNDO3 1176 ENTRY ULKPAGE 1177 1178 BEGFRAME 1179 ENDFRAME 1180 03270 DD5F8001 6 STAK 1181 ULKWNDO2 ENTRNP PUSH 03271 60040083 0 IMM 1182 LD R0 PNWNDO2 get the page number 03272 FE0E327D 1183 JMP ULKWEN go share general code 1184 * --- 1185 03273 DD5F8001 6 STAK 1186 ULKWNDO3 ENTRNP PUSH 03274 60040084 0 IMM 1187 LD R0 PNWNDO3 get the page number 03275 FE0E327D 1188 JMP ULKWEN go share general code 1189 * --- 1190 03276 DD5F8001 6 STAK 1191 ULKWNDO1 ENTRNP PUSH 03277 60040082 0 IMM 1192 LD R0 PNWNDO1 produce page number 03278 FE0E327D 1193 JMP ULKWEN go share general code 1194 * --- 1195 03279 DD5F8001 6 STAK 1196 ULKPAGE ENTRNP PUSH 0327A 60400414 1 1197 LD R1 CPCUPC get the current UPC pointer 0327B 6056480D 1 1 BASE 1198 LD R1 R1,UPCVMLIST get pointer to VM list 0327C F230327F 0 1199 JBF R0/MONBIT ULKSNL jump to search normal list 0000327D 1200 ULKWEN LABEL 0327D 60400414 1 1201 LD R1 CPCUPC get the current UPC pointer 0327E 6056480E 1 1 BASE 1202 LD R1 R1,UPCWVMLIST get pointer to window VM list 0000327F 1203 ULKSNL LABEL 0327F 3C164004 0 1 CACH 1204 LSRCH R0 R1,VPVPN look for this page 03280 FE0C3289 1205 JNE ULPNLV no find is unlikely, 1206 * mostly from error routine cleanups 03281 EC085A10 1 ZBM 1207 STZ R1,VPCNTL/VPCNTLLKB unlock the page 03282 0CC00000 1208 IOFF interrupts off 03283 60400414 1 1209 LD R1 CPCUPC get the current UPC pointer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 621 (WINDOW) F 35 Resident User Window Routines 03284 6056480F 1 1 BASE 1210 LD R1 R1,UPCVASP get pointer to VASP list 03285 3C164000 0 1 CACH 1211 LSRCH R0 R1,PAVPN look for the proper page 03286 FE0C3288 1212 JNE ULPNH page not originally locked, ok 03287 EC085210 1 ZBM 1213 STZ R1,PALOCK clear this lock bit 00003288 1214 ULPNH LABEL 03288 0C800000 1215 ION interrupts back on 00003289 1216 ULPNLV LABEL 03289 5D1F8001 6 STAK 1217 LEAVE POP 1218 * --- 1219 1220 END ULKWNDOx and ULKPAGE subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 622 (WINDOW) F 35 Resident User Window Routines 1222 1223 ********************************************************************************** 1224 * * 1225 * SAVEWNDOx * 1226 * Save the mapping of the specified window so that * 1227 * RSTRWNDO can restore it. This things works by getting a * 1228 * piece of free storage and copying the window's VP element * 1229 * into it. The means that RSTRWNDO MUST be called after * 1230 * calling this routine (in order to claim the memory back). * 1231 * This routine must only be used for WNDO1 through * 1232 * WNDO3, since it only deals with the UPCWVMLIST). * 1233 * What is passed to this routine is a pointer to a * 1234 * location to place the pointer to the piece of memory. If * 1235 * no memory is fetched, zero is placed there so that RSTRWNDO * 1236 * will do nothing. * 1237 * Call: * 1238 * CALL SAVEWNDOx * 1239 * PARL address to save the pointer * 1240 * * 1241 * Eats R0:R3. * 1242 * Stack required = 2 * 1243 * 2 + max ( VGETMEM (0) ) * 1244 * * 1245 ********************************************************************************** 1246 1247 BLOCK Save Window routines 1248 ENTRY SAVEWNDO1 1249 ENTRY SAVEWNDO2 1250 ENTRY SAVEWNDO3 1251 1252 BEGFRAME 00178801 6 BASE 1253 PNTRPLACE BSS 1 pointer to pointer location 1254 ENDFRAME 1255 0328A DD1F8002 6 STAK 1256 SAVEWNDO1 ENTR PUSH 0328B 60440082 1 IMM 1257 LD R1 PNWNDO1 0328C FE0E3292 1258 JMP SAVWNDOSHR 1259 * --- 1260 0328D DD1F8002 6 STAK 1261 SAVEWNDO2 ENTR PUSH 0328E 60440083 1 IMM 1262 LD R1 PNWNDO2 0328F FE0E3292 1263 JMP SAVWNDOSHR 1264 * --- 1265 03290 DD1F8002 6 STAK 1266 SAVEWNDO3 ENTR PUSH 03291 60440084 1 IMM 1267 LD R1 PNWNDO3 1268 * \ / 1269 00003292 1270 SAVWNDOSHR LABEL 03292 C0178801 6 BASE 1271 STPL SP,PNTRPLACE place the pointer is to be 03293 EC178C01 6 FPVR 1272 STZ @(SP,PNTRPLACE) assume no state saved yet 03294 60C00414 3 1273 LD R3 CPCUPC 03295 60D6C80E 3 3 BASE 1274 LD R3 R3,UPCWVMLIST R3=>root of window VP list 03296 3C56C004 1 3 CACH 1275 LSRCH R1 R3,VPVPN find the VP element 03297 FE0C329F 1276 JNE NOWNDO jump if no such page 03298 DC002F0A 1277 CALL VGETMEM get storage for the state information 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 623 (WINDOW) F 35 Resident User Window Routines 03299 40440002 IMM 1278 PARVL VPLOG 0329A E4178C01 0 6 FPVR 1279 ST R0 @(SP,PNTRPLACE) return the pointer to the storage 0329B 60920000 2 0 REG 1280 LD R2 R0 where copying to 0329C 6012C000 0 3 REG 1281 LD R0 R3 where copying from 0329D 60440010 1 IMM 1282 LD R1 VPAGELNTH*CPW number of chars in a VP element 0329E DA880800 2 01 1283 MOVE R2,R0,R1 move the storage 1284 * \ / 1285 0000329F 1286 NOWNDO LABEL 0329F 5D1F8002 6 STAK 1287 LEAVE POP 1288 * --- 1289 1290 END of SAVEWNDOx 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 624 (WINDOW) F 35 Resident User Window Routines 1292 1293 ********************************************************************************** 1294 * * 1295 * RSTRWNDO * 1296 * This routine will restore the mapping of a window that * 1297 * was saved by SAVEWNDOx. If the location passed is zero, * 1298 * then nothing is done. Otherwise, the location passed is a * 1299 * pointer to the piece of memory where SAVEWNDOx saved the * 1300 * state of the window (we know which window because that was * 1301 * saved also). The particular window is than set up using * 1302 * SETWNDOx. * 1303 * This routine must only be used for WNDO1 through * 1304 * WNDO3, since it only deals with the UPCWVMLIST). * 1305 * Notice that, even though the lockedness of a window * 1306 * would be restored by these routines, the window could have * 1307 * been unlocked between the save and the restore. * 1308 * Call: * 1309 * CALL RSTRWNDO * 1310 * PARL location of zero or pointer to save block * 1311 * * 1312 * Eats R0:R3. * 1313 * Stack required = 7 * 1314 * 3 + max ( MAPOUTFBI (2), SETWNDOX (4), VFREEMEM (0) ) * 1315 * * 1316 ********************************************************************************** 1317 1318 BLOCK Restore Window routines 1319 ENTRY RSTRWNDO restore the state of a window 1320 1321 BEGFRAME 00178801 6 BASE 1322 PNTRPLACE BSS 1 pointer to memory block or zero 00178802 6 BASE 1323 R4SAVE BSS 1 1324 ENDFRAME 1325 032A0 DD1F8003 6 STAK 1326 RSTRWNDO ENTR PUSH 032A1 C0178801 6 BASE 1327 STPL SP,PNTRPLACE save pointer to pointer place 032A2 E5178802 4 6 BASE 1328 ST R4 SP,R4SAVE 032A3 61178C01 4 6 FPVR 1329 LD R4 @(SP,PNTRPLACE) get the pointer to the element 032A4 FB3032B4 4 1330 JZA R4 NOWNDO jump if nothing to restore 032A5 EC178C01 6 FPVR 1331 STZ @(SP,PNTRPLACE) remember the window is restored 032A6 E5178801 4 6 BASE 1332 ST R4 SP,PNTRPLACE remember location of block 032A7 60170004 0 4 CACH 1333 LD R0 R4,VPVPN get the page number 032A8 DC0031FC 1334 CALL SETWNDOX restore the window 032A9 41490E80 4 ZBM 1335 PARV R4,VPCNTL restore control information 032AA 41491F11 4 ZBM 1336 PARV R4,VPFCB address of FCB associated with this page 032AB 41091F12 4 ZBM 1337 PAR R4,VPERAD the error address for the page 032AC 41570803 4 BASE 1338 PARV R4,VPBLOCK the block for the page 032AD 404902E2 4 ZBM 1339 PARVL R4,VPFBITYPE the type of the page 032AE 5C091A10 4 ZBM 1340 CMZ R4,VPCNTL/VPCNTLLKB was this page locked 032AF FE0232B1 1341 JEQ RSTRNOMAP if not, no PPL window mapped in 032B0 DC40261B 1342 CALLNP MAPOUTFBI unmap the PPL window 1343 * \ / 1344 000032B1 1345 RSTRNOMAP LABEL 032B1 DC002F8F 1346 CALL VFREEMEM release the storage block 032B2 41440002 IMM 1347 PARV VPLOG 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 625 (WINDOW) F 35 Resident User Window Routines 032B3 40530000 4 REG 1348 PARVL R4 000032B4 1349 NOWNDO LABEL 032B4 61178802 4 6 BASE 1350 LD R4 SP,R4SAVE restore R4 032B5 5D1F8003 6 STAK 1351 LEAVE POP 1352 * --- 1353 1354 END of RSTRWNDO 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 626 (WINDOW) F 35 Resident User Window Routines 1356 1357 ********************************************************************************** 1358 * * 1359 * VOLFORGET * 1360 * Routine called to forget about pages in the idle list * 1361 * that belong to a given volume. This routine is provided so * 1362 * that when a disk unit goes off line, we forget what was on * 1363 * it, in case a different pack comes back up. * 1364 * Call: * 1365 * CALL VOLFORGET * 1366 * PARVL * 1367 * * 1368 * Eats R0:R2. * 1369 * Stack required = 3 * 1370 * 3 + max ( LOCKWAIT (0) ) * 1371 * * 1372 ********************************************************************************** 1373 1374 BLOCK VOLFORGET subroutine 1375 ENTRY VOLFORGET 1376 1377 BEGFRAME 00178801 6 BASE 1378 SAVEREGS BSS 2 place to save some registers 1379 ENDFRAME 1380 032B6 DD1F8003 6 STAK 1381 VOLFORGET ENTR PUSH 032B7 C0528000 2 REG 1382 STPVL R2 get the volume number 032B8 E6D78801 346 BASE 1383 ST2 R3 SP,SAVEREGS we need lots of registers 032B9 60C4001F 3 IMM 1384 LD R3 IDLETBSZ-1 number of lists we need to search 1385 PLOCK PPIDLOCK call to lock the idle list 032BA 0CC00000 1385 IOFF 032BB D1C01DD9 1385 SETT PPIDLOCK 032BC FE0C32BE 1385 JNE MA(2+DISPW MA 0) 032BD DC40308B 1385 CALLNP LOCKWAIT 1386 * \ / 1387 000032BE 1388 VOLFAGAIN LABEL 032BE 60261DDD 0 3 1389 LD R0 PPUSDIDLE(R3) get the pointer to the idle list 032BF 38661DDD 1 3 1390 LEA R1 PPUSDIDLE(R3) indicate where we started 1391 * \ / 1392 000032C0 1393 VOLFLOOP LABEL 032C0 48880081 2 0 ZBM 1394 RLSRCH R2 R0,PPBLOCK/VOLFIELD search on the volume 032C1 FE0C32CC 1395 JNE VOLFNXLST no more here try the next list 032C2 61081F10 4 0 ZBM 1396 LD R4 R0,PPLINK get the remainder of the list 032C3 E5085F10 4 1 ZBM 1397 ST R4 R1,PPLINK remove us from the list 032C4 FB3232C6 4 1398 JNZA R4 VOLFNLAST jump if more list to search 032C5 E4661DFD 1 3 1399 ST R1 PPENDIDLE(R3) adjust the end pointer 1400 * \ / 1401 000032C6 1402 VOLFNLAST LABEL 032C6 EC160801 0 BASE 1403 STZ R0,PPBLOCK nothing resides here any more 032C7 61001DDC 4 1404 LD R4 PPCLNIDLE pointer to 'clean' idle pages 032C8 E5081F10 4 0 ZBM 1405 ST R4 R0,PPLINK make us point to the list 032C9 E4001DDC 0 1406 ST R0 PPCLNIDLE put us in the list 032CA 60085F10 0 1 ZBM 1407 LD R0 R1,PPLINK get the place to start the search 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 627 (WINDOW) F 35 Resident User Window Routines 032CB FA3232C0 0 1408 JNZA R0 VOLFLOOP continue the search if anything left 1409 * \ / 1410 000032CC 1411 VOLFNXLST LABEL 032CC FAE632BE 3 1412 JDR R3 VOLFAGAIN jump to seach another list 1413 * \ / 1414 1415 PUNLOCK PPIDLOCK unlock the idle page list 032CD EC001DD9 1415 STZ PPIDLOCK 032CE 0C800000 1415 ION 032CF 62D78801 346 BASE 1416 LD2 R3 SP,SAVEREGS restore these registers 032D0 5D1F8003 6 STAK 1417 LEAVE POP return to caller 1418 * --- 1419 1420 END VOLFORGET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 628 (WINDOW) F 35 Resident User Window Routines 1422 1423 ********************************************************************************** 1424 * * 1425 * WSXCLEAN * 1426 * Routine to scan a WSX or VASP list and remove all * 1427 * pages that belong to a specified unit ( an FCB address of * 1428 * zero will clean out all pages ). * 1429 * The page file entry for a page will be unloaded iff * 1430 * this is a VASP list for the current UPC. Since this * 1431 * information is awkward to garner here, we have it passed in * 1432 * by the caller. * 1433 * Call: * 1434 * R3 = FCB address or 0 * 1435 * SP * 1436 * CALL WSXCLEAN * 1437 * PAR * 1438 * PARVL * 1439 * * 1440 * * 1441 * Eats R0:R2.. * 1442 * Stack required = 8 * 1443 * 4 + max ( DISCARDPAL (4), UNLOPAL (0) ) * 1444 * * 1445 ********************************************************************************** 1446 1447 BLOCK WSXCLEAN subroutine 1448 ENTRY WSXCLEAN 1449 1450 BEGFRAME 00178801 6 BASE 1451 WSXCLEANT BSS 1 temp for R4 save 00178802 6 BASE 1452 WSXCLEANF BSS 1 temp for FCB address 00178803 6 BASE 1453 WSXCLEANA BSS 1 ptr to address of first WSX element 1454 ENDFRAME 00000010 BYTE 1455 UNLOFLAG EQU BIT 0 bit in R7, 1 sez call UNLOPAL 1456 032D1 DD1F8004 6 STAK 1457 WSXCLEAN ENTR PUSH 032D2 C1178803 6 BASE 1458 STP SP,WSXCLEANA store pointer to WSX list 032D3 C04BC010 7 CBM 1459 STPVL R7/UNLOFLAG save current VASP marker 032D4 E5178801 4 6 BASE 1460 ST PAL SP,WSXCLEANT save R4 032D5 E4D78802 3 6 BASE 1461 ST R3 SP,WSXCLEANF save the FCB address 000032D6 1462 WSXCAGAIN LABEL 032D6 60578803 1 6 BASE 1463 LD R1 SP,WSXCLEANA get pointer to the WSX list 032D7 0CC00000 1464 IOFF interrupts off 000032D8 1465 WSXCLOOP LABEL 032D8 FA7832E7 12 1466 RLJZA R1 WSXCXIT jump at end of lists, no find this pass 032D9 FAC232DC 3 1467 JEQZ R3 DOANYWAY jump if to get all pages 032DA 64C85F12 3 1 ZBM 1468 CPR R3 R1,PAFCB this element wanted? 032DB FE0C32D8 1469 JNE WSXCLOOP jump back if not 000032DC 1470 DOANYWAY LABEL 032DC 60085F10 0 1 ZBM 1471 LD R0 R1,PALINK get the forward link from this element 032DD E4089F10 0 2 ZBM 1472 ST R0 R2,PALINK jumper the list around this element 032DE 61124000 4 1 REG 1473 LD PAL R1 copy the pointer 032DF F3C032E1 7 1474 JBF R7/UNLOFLAG NOUNLOAD jump if not current VASP 032E0 DC402623 1475 CALLNP UNLOPAL must be current VASP list, unload page file 000032E1 1476 NOUNLOAD LABEL 032E1 DC402E15 1477 CALLNP DISCARDPAL get rid of this element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 629 (WINDOW) F 35 Resident User Window Routines 032E2 60800412 2 1478 LD R2 CPPSA get the current PSA pointer 032E3 D04880F2 2 ZBM 1479 DEC R2,PSWSSIZE indicate that the working set shrunk 032E4 0C800000 1480 ION turn on interrupts for a moment 032E5 60D78802 3 6 BASE 1481 LD R3 SP,WSXCLEANF restore the FCB address 032E6 FE0E32D6 1482 JMP WSXCAGAIN we've removed an element, look for more 1483 * --- 1484 000032E7 1485 WSXCXIT LABEL 032E7 0C800000 1486 ION interrupts back on 032E8 61178801 4 6 BASE 1487 LD PAL SP,WSXCLEANT restore R4 032E9 5D1F8004 6 STAK 1488 LEAVE POP return all better 1489 * --- 1490 1491 END WSXCLEAN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 630 (WINDOW) F 35 Resident User Window Routines 1493 1494 ********************************************************************************** 1495 * * 1496 * WSXCLNALL * 1497 * This routine cleans all working set extensions. It * 1498 * loops through all the WSX lists for a user, removing all * 1499 * pages that belong to a specified unit (an FCB address of * 1500 * zero will remove all pages). * 1501 * Call: * 1502 * R3 = FCB address or zero * 1503 * SP = stack pointer * 1504 * CALLNP WSXCLNALL * 1505 * * 1506 * * 1507 * Eats R0:R2. * 1508 * Stack required = 10 * 1509 * 2 + max ( WSXCLEAN (8) ) * 1510 * * 1511 ********************************************************************************** 1512 1513 BLOCK WSXCLNALL subroutine 1514 ENTRY WSXCLNALL 1515 1516 BEGFRAME 00178801 6 BASE 1517 WSXCLNT BSS 1 temp for saving R4 1518 ENDFRAME 1519 032EA DD5F8002 6 STAK 1520 WSXCLNALL ENTRNP PUSH 032EB E5178801 4 6 BASE 1521 ST R4 SP,WSXCLNT save R4 032EC 60000412 0 1522 LD R0 CPPSA get PSA pointer 032ED 60881F15 2 0 ZBM 1523 LD R2 R0,PSPROCLIST get pointer to list of UPC's 1524 * \ / 1525 000032EE 1526 WSXCLNLP LABEL 032EE 61128000 4 2 REG 1527 LD R4 R2 place this address in a safe place 032EF DC0032D1 1528 CALL WSXCLEAN clean out this list 032F0 41170810 4 BASE 1529 PAR R4,UPCWSX point at this WSX list 032F1 40440000 IMM 1530 PARVL 0 indicate never the current VASP 032F2 60891F10 2 4 ZBM 1531 LD R2 R4,UPCSONPTR see if any children to clean up 032F3 FAB232EE 2 1532 JNZA R2 WSXCLNLP jump if there are underprocesses 1533 * \ / 1534 000032F4 1535 WSXCLNBROS LABEL 032F4 60891F16 2 4 ZBM 1536 LD R2 R4,UPCBROPTR check if any brothers to clean 032F5 FAB232EE 2 1537 JNZA R2 WSXCLNLP jump if other processes exists 032F6 61091F17 4 4 ZBM 1538 LD R4 R4,UPCDADPTR move up one level, check if more 032F7 FB3232F4 4 1539 JNZA R4 WSXCLNBROS go clean up the brothers 1540 * \ / 1541 032F8 61178801 4 6 BASE 1542 LD R4 SP,WSXCLNT restore R4 032F9 5D1F8002 6 STAK 1543 LEAVE POP return 1544 * --- 1545 1546 END of WSXCLNALL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 631 (WINDOW) F 35 Resident User Window Routines 1548 1549 ********************************************************************************** 1550 * * 1551 * VASPCLNALL * 1552 * This routine cleans all of the VASP lists. It loops * 1553 * through all the VASP lists for a user, removing all pages * 1554 * that belong to a specified unit (an FCB address of zero * 1555 * will remove all pages). * 1556 * Call: * 1557 * R3 = FCB address or zero * 1558 * SP = stack pointer * 1559 * CALLNP VASPCLNALL * 1560 * * 1561 * * 1562 * Eats R0:R2. * 1563 * Stack required = 10 * 1564 * 2 + max ( WSXCLEAN (8) ) * 1565 * * 1566 ********************************************************************************** 1567 1568 BLOCK VASPCLNALL subroutine 1569 ENTRY VASPCLNALL 1570 1571 BEGFRAME 00178801 6 BASE 1572 VASPCLNT BSS 1 temp for saving R4 1573 ENDFRAME 1574 032FA DD5F8002 6 STAK 1575 VASPCLNALL ENTRNP PUSH 032FB E5178801 4 6 BASE 1576 ST R4 SP,VASPCLNT save R4 032FC 60000412 0 1577 LD R0 CPPSA get PSA pointer 032FD 60881F15 2 0 ZBM 1578 LD R2 R0,PSPROCLIST get pointer to list of UPC's 1579 * \ / 1580 000032FE 1581 VASPCLNLP LABEL 032FE 61128000 4 2 REG 1582 LD R4 R2 place address in a safe register 032FF DC0032D1 1583 CALL WSXCLEAN clean out this list 03300 4117080F 4 BASE 1584 PAR R4,UPCVASP point at this VASP list 03301 65000414 4 1585 CPR R4 CPCUPC check for current UPC 03302 EC520000 0 REG 1586 STLEQ R0 R0 get 0 iff not current UPC 03303 40520000 0 REG 1587 PARVL R0 pass 0 if not current VASP, 1 if it is 03304 60891F10 2 4 ZBM 1588 LD R2 R4,UPCSONPTR check if any children to clean 03305 FAB232FE 2 1589 JNZA R2 VASPCLNLP loop through all UPC's 1590 * \ / 1591 00003306 1592 VASPCLNBROS LABEL 03306 60891F16 2 4 ZBM 1593 LD R2 R4,UPCBROPTR see if any brothers to clean 03307 FAB232FE 2 1594 JNZA R2 VASPCLNLP jump if others still exist 03308 61091F17 4 4 ZBM 1595 LD R4 R4,UPCDADPTR move up one level, check if more 03309 FB323306 4 1596 JNZA R4 VASPCLNBROS need to check this sub-tree 1597 * \ / 1598 0330A 61178801 4 6 BASE 1599 LD R4 SP,VASPCLNT restore R4 0330B 5D1F8002 6 STAK 1600 LEAVE POP return 1601 * --- 1602 1603 END of VASPCLNALL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 632 (WINDOW) F 35 Resident User Window Routines 1605 1606 ********************************************************************************** 1607 * * 1608 * FINDPAL * 1609 * Given a virtual page number in R3, search the VASP * 1610 * list for the PAL, unmap it, and remove it from the list. * 1611 * Call: * 1612 * * 1613 * R3 => VPN * 1614 * SP * 1615 * CALLNP FINDPAL * 1616 * no PAL * 1617 * PAL => PAL, now unlinked, ints off * 1618 * * 1619 * Eats R0:R1, PFPTR iff found, Sets PAL. * 1620 * Stack required = 1 * 1621 * 1 + max ( UNLOPAL (0) ) * 1622 * * 1623 ********************************************************************************** 1624 1625 BLOCK FINDPAL subroutine 1626 ENTRY FINDPAL 1627 1628 BEGFRAME 1629 ENDFRAME 1630 0330C DD5F8001 6 STAK 1631 FINDPAL ENTRNP PUSH 1632 1633 * R3=VPN, SP=>stack 1634 0330D 60000414 0 1635 LD R0 CPCUPC load the current UPC pointer 0330E 3856080F 1 0 BASE 1636 LEA R1 R0,UPCVASP get head of VASP list 0330F 0CC00000 1637 IOFF interrupts off 03310 6016080F 0 0 BASE 1638 LD R0 R0,UPCVASP get ptr to first element 03311 48D60000 3 0 CACH 1639 RLSRCH R3 R0,PAVPN search for the specified page 03312 FE0C3319 1640 JNE FINDPEXIT jump if not in VASP 03313 19C40001 7 IMM 1641 ADD R7 1 advance return address 03314 61120000 4 0 REG 1642 LD PAL R0 move pointer to PAL into PAL 1643 * \ / 03315 60091F10 0 4 ZBM 1644 LD R0 PAL,PALINK get our forward pointer 03316 E4085F10 0 1 ZBM 1645 ST R0 R1,PALINK remove pointer to us and repair list 03317 DC402623 1646 CALLNP UNLOPAL unload the page file 03318 5D1F8001 6 STAK 1647 LEAVE POP return 1648 * --- 1649 00003319 1650 FINDPEXIT LABEL 03319 0C800000 1651 ION interrupts back on if not found 0331A 5D1F8001 6 STAK 1652 LEAVE POP 1653 * --- 1654 1655 END FINDPAL subroutine 1656 1657 1658 END user page table managers 61 INPUT PROCINOUT routines to handle processes 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 633 (PROCINOUT) F 36 Session ins and outs 3 4 BLOCK goodies to move sessions around 5 6 ENTRY CHECKEVENT see if an event has happened 7 ENTRY CHECKNOINT remove interrupt element if no longer selected 8 ENTRY CHECKUINT check for selected event interrupts 9 ENTRY CHKINTCODE check interrupt code for subcode conversion 10 ENTRY DQUEONE to remove one user from a queue 11 ENTRY DQUETHIS remove a specific session from the queue 12 ENTRY ELSRCHER remove error element 13 ENTRY FINDTERMCB locate sessions absolute terminal 14 ENTRY FINDUCE locate a UCE for a given FCB 15 ENTRY GIVEUINT routine to post user events 16 ENTRY MOVETRMGP call RESETTCG, call CALCTERMC if necessary 17 ENTRY MOVETRMGX find console TCB, call MOVETRMGP on it 18 ENTRY OVPDESTROY destroy an overprogram 19 ENTRY OVPDOWNONE move session state down one program 20 ENTRY OVPUPONE move session state up one program 21 ENTRY RESETTCG install correct TCG/TCA in TCB 22 ENTRY ROUST get a session out of wait 23 ENTRY SCCONPTR pointer to bit table of unit type UER codes 24 ENTRY SUSPENDCAL suspend the caller 25 ENTRY SUSPENDFRQ suspend a file request 26 ENTRY SUSPENDME to shut down a session 27 ENTRY UERRSET sic an error on a user 28 ENTRY UERRSETY another, different calling sequence 29 ENTRY USERTIMINT give user a time interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 634 (PROCINOUT) F 36 Session ins and outs 31 32 ********************************************************************************** 33 * * 34 * OVPUPONE * 35 * Over program up one. Moves the session state from * 36 * the current program to the one above. * 37 * Call: * 38 * LD SP => stack * 39 * CALLNP OVPUPONE * 40 * JMP * 41 * * 42 * Eats R0:R2, R4. * 43 * Stack required = 11 * 44 * 4 + max ( CHECKUINT (5), OVPPICKUP (3), OVPPUTDOWN (7), * 45 * PFLOAD (3) ) * 46 * * 47 ********************************************************************************** 48 49 BLOCK OVPUPONE subroutine 50 ENTRY OVPUPONE 51 52 BEGFRAME 00178801 6 BASE 53 OVPUPLAST BSS 1 => UPC for above 00178802 6 BASE 54 TEMPR3 BSS 1 temp for saving R3 00178803 6 BASE 55 TEMPR5 BSS 1 temp for saving R5 56 ENDFRAME 57 0331B DD5F8004 6 STAK 58 OVPUPONE ENTRNP PUSH 0331C 60000414 0 59 LD R0 CPCUPC the current process 0331D 60081F17 0 0 ZBM 60 LD R0 R0,UPCDADPTR move to the next higher level 0331E FA30332F 0 61 JZA R0 OVPUPONEX nothing to move up to 0331F E4D78802 3 6 BASE 62 ST R3 SP,TEMPR3 save away register 3 03320 E5578803 5 6 BASE 63 ST R5 SP,TEMPR5 save away register 5 03321 E4178801 0 6 BASE 64 ST R0 SP,OVPUPLAST save the pointer to him 65 * \ / 66 03322 0CC00000 67 IOFF disable the interrupts for the move 03323 DC403344 68 CALLNP OVPPICKUP pickup current status 03324 61400412 5 69 LD R5 CPPSA current session 03325 60178801 0 6 BASE 70 LD R0 SP,OVPUPLAST pointer to the one going to 03326 DC40334B 71 CALLNP OVPPUTDOWN place this as the next program 03327 DC4025C2 72 CALLNP PFLOAD load page file 03328 0C800000 73 ION restore the interrupt system 74 * \ / 75 03329 60C95F11 3 5 ZBM 76 LD R3 R5,PSCACHNP1 => CA of new process 0332A 60D6C80B 3 3 BASE 77 LD R3 R3,CAINTMASK mask of allowable interrupts 0332B DC4033C2 78 CALLNP CHECKUINT see if an interrupt event is to happen 0332C 19C40001 7 IMM 79 ADD R7 1 advance return address to success return 0332D 60D78802 3 6 BASE 80 LD R3 SP,TEMPR3 restore register 3 0332E 61578803 5 6 BASE 81 LD R5 SP,TEMPR5 restore register 5 82 * \ / 83 0000332F 84 OVPUPONEX LABEL 0332F 5D1F8004 6 STAK 85 LEAVE POP return 86 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 635 (PROCINOUT) F 36 Session ins and outs 87 88 END OVPUPONE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 636 (PROCINOUT) F 36 Session ins and outs 90 91 ********************************************************************************** 92 * * 93 * OVPDOWNONE * 94 * Over program down. Moves the session state from * 95 * the current program to the specified under process. * 96 * Call: * 97 * LD SP => stack * 98 * CALL OVPDOWNONE * 99 * PARVL * 100 * JMP * 101 * * 102 * Eats R0:R2,R4 * 103 * Stack required = 11 * 104 * 4 + max ( CHECKUINT (5), OVPPICKUP (3), OVPPUTDOWN (7), * 105 * PFLOAD (3) ) * 106 * * 107 ********************************************************************************** 108 109 BLOCK OVPDOWNONE subroutine 110 ENTRY OVPDOWNONE 111 112 BEGFRAME 00178801 6 BASE 113 TEMPR3 BSS 1 temp for saving R3 00178802 6 BASE 114 TEMPR5 BSS 1 temp for saving R5 00178803 6 BASE 115 OVPDNTMP BSS 1 save UPC to move down to 116 ENDFRAME 117 03330 DD1F8004 6 STAK 118 OVPDOWNONE ENTR PUSH 03331 C0520000 0 REG 119 STPVL R0 get the UPC address 03332 FA303343 0 120 JZA R0 OVPDNONEX jump if no process to move to 03333 E4178803 0 6 BASE 121 ST R0 SP,OVPDNTMP save the address away 03334 E4D78801 3 6 BASE 122 ST R3 SP,TEMPR3 save R3 03335 E5578802 5 6 BASE 123 ST R5 SP,TEMPR5 save R5 124 * \ / 125 03336 0CC00000 126 IOFF disable the interrupts for the move 03337 DC403344 127 CALLNP OVPPICKUP pickup the current state 03338 60178803 0 6 BASE 128 LD R0 SP,OVPDNTMP get back the UPC address 03339 61400412 5 129 LD R5 CPPSA get current PSA pointer 0333A DC40334B 130 CALLNP OVPPUTDOWN set up this programs status 0333B DC4025C2 131 CALLNP PFLOAD load page file 0333C 0C800000 132 ION restore the interrupt system 133 * \ / 134 0333D 60C95F11 3 5 ZBM 135 LD R3 R5,PSCACHNP1 => CA of new process 0333E 60D6C80B 3 3 BASE 136 LD R3 R3,CAINTMASK mask of allowable interrupts 0333F DC4033C2 137 CALLNP CHECKUINT see if a user interrupt is to happen 03340 19C40001 7 IMM 138 ADD R7 1 advance to successful return 03341 60D78801 3 6 BASE 139 LD R3 SP,TEMPR3 restore R3 03342 61578802 5 6 BASE 140 LD R5 SP,TEMPR5 restore R5 141 * \ / 142 00003343 143 OVPDNONEX LABEL 03343 5D1F8004 6 STAK 144 LEAVE POP return 145 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 637 (PROCINOUT) F 36 Session ins and outs 146 147 END OVPDOWNONE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 638 (PROCINOUT) F 36 Session ins and outs 149 150 ********************************************************************************** 151 * * 152 * OVPPICKUP * 153 * Over program pickup. Cleans up the current program * 154 * in the stack prior to the setting up of a different program. * 155 * Call: * 156 * LD SP => stack * 157 * CALLNP OVPPICKUP * 158 * * 159 * Eats R0:R4. * 160 * Stack required = 3. * 161 * 1 + max ( CHECKNOINT (2), DMOTINDPAL (2), PFEMPTY (2) ) * 162 * * 163 ********************************************************************************** 164 165 BLOCK OVPPICKUP subroutine 166 ENTRY OVPPICKUP 167 168 BEGFRAME 169 ENDFRAME 170 03344 DD5F8001 6 STAK 171 OVPPICKUP ENTRNP PUSH 172 * Note: CHKWNDOS is called to remove any pages that might still 173 * be mapped into the windows. The system is slowly being 174 * fixed to not leave any mapped when we get here, but it's 175 * not 100% yet. 176 * It is redundant in many cases to call CHKWNDOS here, so we NOP 177 * and let the XREQRETURN code do it instead. 03345 FEC00000 178 NOP 0 leave room to patch in following instruction 179 * CALLNP CHKWNDOS check if windows are in VM list 03346 DC403165 180 CALLNP DMOTINDPAL move all indirect pages to WSX list 03347 DC4025A6 181 CALLNP PFEMPTY empty the page file 03348 60C7FFFF 3 IMM 182 LD R3 -1 for safety, flush all regenerable errors ... 03349 DC40343C 183 CALLNP CHECKNOINT ... from session (no leftovers) 0334A 5D1F8001 6 STAK 184 LEAVE POP return 185 * --- 186 187 END OVPPICKUP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 639 (PROCINOUT) F 36 Session ins and outs 189 190 ********************************************************************************** 191 * * 192 * OVPPUTDOWN * 193 * Over program put down. Passed to us is the address * 194 * of the new UPC. This routine sets up the variables needed * 195 * for the new program to run. * 196 * Call: * 197 * LD SP => stack * 198 * LD R0 => UPC block to load * 199 * LD R5 => PSA * 200 * CALLNP OVPPUTDOWN * 201 * * 202 * Eats R0:R3. * 203 * Stack required = 7 * 204 * 2 + max ( MOVETRMGX (5) ) * 205 * * 206 ********************************************************************************** 207 208 BLOCK OVPPUTDOWN subroutine 209 ENTRY OVPPUTDOWN 210 211 BEGFRAME 00178801 6 BASE 212 SAVER4 BSS 1 register save location 213 ENDFRAME 214 0334B DD5F8002 6 STAK 215 OVPPUTDOWN ENTRNP PUSH 0334C E4094116 0 5 ZBM 216 ST R0 R5,PSCURRPROC this one is now current 0334D E4000414 0 217 ST R0 CPCUPC save as current UPC for this CPU 0334E 60480610 1 0 ZBM 218 LD R1 R0,UPCNTLMODE get virtual control mode semaphore 0334F E4495214 1 5 ZBM 219 ST R1 R5,PSCNTLMODE and make non-virtual 03350 60895F10 2 5 ZBM 220 LD R2 R5,PSCACHN get the current console area pointer 03351 60481F12 1 0 ZBM 221 LD R1 R0,UPCCONSOLE ptr to one down 03352 E4495F11 1 5 ZBM 222 ST R1 R5,PSCACHNP1 store in PSA 03353 E456880C 1 2 BASE 223 ST R1 R2,CALINK fix CA links 03354 E5178801 4 6 BASE 224 ST TCB SP,SAVER4 save this register 03355 DC40337E 225 CALLNP MOVETRMGX shuffle TCG/TCS 03356 61178801 4 6 BASE 226 LD TCB SP,SAVER4 restore register 03357 5D1F8002 6 STAK 227 LEAVE POP return 228 * --- 229 230 END OVPPUTDOWN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 640 (PROCINOUT) F 36 Session ins and outs 232 233 ********************************************************************************** 234 * * 235 * RESETTCG. Install a TCG and TCA based on the currently * 236 * eligible trapper. Return a flag saying whether the * 237 * input buffer ought to be rescanned for terminators. This * 238 * is to ensure that the CIA driver has the right terminating * 239 * character group to scan the input stream for terminators. * 240 * The return flag is 0 if the change is trivial (i.e. * 241 * UPCTERMGRP=TCTERMGRP and they are 0 or 1), no-zero otherwise. * 242 * This is only required for the absolute I/O .TERM. * 243 * * 244 * Call: R4 => TCB (locked) * 245 * CALLNP RESETTCG * 246 * R0 0 -> no scan required * 247 * not 0 -> scan is appropriate * 248 * * 249 * Eats R0:R3. * 250 * Stack required = 1 * 251 * * 252 ********************************************************************************** 253 254 BLOCK RESETTCG subroutine 255 ENTRY RESETTCG 256 257 BEGFRAME 258 ENDFRAME 259 03358 DD5F8001 6 STAK 260 RESETTCG ENTRNP PUSH 03359 60800414 2 261 LD R2 CPCUPC get current program 0335A EDC91615 4 ZBM 262 STW TCB,TCINTTCG say for now there is trapper 0000335B 263 LOOKHERE LABEL 0335B 60089F12 0 2 ZBM 264 LD R0 R2,UPCCONSOLE => console area 0335C 5C16080A 0 BASE 265 CMZ R0,CAINTADR vector address set up? 0335D ED924000 1 REG 266 STLNE R1 save answer 0335E 7848101B 1 0 ZBM 267 AND R1 R0,CAINTMASK/BIT CAIMNETERM NE term enabled? 0335F 78489011 1 2 ZBM 268 AND R1 R2,UPCNETINTE ints on for console unit? 03360 FA4C3364 1 269 JNEZ R1 LOOKSGOOD if all, R2 is a likely candidate 270 271 * follow up chain of overprocesses 03361 60889F17 2 2 ZBM 272 LD R2 R2,UPCDADPTR else, get next UPC up 03362 FAB2335B 2 273 JNZA R2 LOOKHERE jump if someone to check 274 * \ / 275 276 * no more overprocesses means no one is trapping 03363 FE0E3366 277 JMP USECURRENT use CPCUPC 278 * --- 279 280 ********************************************************************************** 281 * * 282 * R2 points to a UPC that is set up for trapping. Use it * 283 * unless it is currently "holding off" (else use CPCUPC). * 284 * * 285 ********************************************************************************** 286 00003364 287 LOOKSGOOD LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 641 (PROCINOUT) F 36 Session ins and outs 03364 5C16080B 0 BASE 288 CMZ R0,CAINTMASK ints enabled? 03365 FE083368 289 JLT GOTUPC jump if so 290 * \ / 291 292 ********************************************************************************** 293 * * 294 * No one at or above CPCUPC is currently getting interrupts. Use * 295 * CPCUPC TCG/TCS, and indicate it is for reading (TCRDRTCG=1) and * 296 * not for trapping (TCINTTCG=0). * 297 * * 298 ********************************************************************************** 299 300 * \ / 00003366 301 USECURRENT LABEL 03366 60800414 2 302 LD R2 CPCUPC current process 03367 EC091615 4 ZBM 303 STZ TCB,TCINTTCG indicate no trappers 304 * \ / 305 306 * R2 => UPC to use for TCG/TCS 00003368 307 GOTUPC LABEL 03368 64800414 2 308 CPR R2 CPCUPC trapper also reader? 03369 EC491815 4 ZBM 309 STLEQ TCB,TCRDRTCG whether TCG matches reader's 0336A 60488041 1 2 ZBM 310 LD R1 R2,UPCTERMGRP get the current term group ptr 0336B EDCBC010 7 CBM 311 STW R7/BIT 0 say check is needed 0336C 6449083D 1 4 ZBM 312 CPR R1 TCB,TCTERMGRP old and new the same? 0336D FE0C3370 313 JNE DONECHECK jump if not 0336E 64440001 1 IMM 314 CPR R1 TCTERMGRP1 were they normal, too? 0336F EC8BC010 7 CBM 315 STLGT R7/BIT 0 remember answer 316 * \ / 317 318 * move TCG and TCS 00003370 319 DONECHECK LABEL 03370 E449083D 1 4 ZBM 320 ST R1 TCB,TCTERMGRP store new into the TCB 03371 60489011 1 2 ZBM 321 LD R1 R2,UPCNETINTE get unit term int enable bit 03372 E4491E18 1 4 ZBM 322 ST R1 TCB,TCINTE copy it into the TCB 03373 38168812 0 2 BASE 323 LEA R0 R2,UPCTERMA get address of UPC term array 03374 60440020 1 IMM 324 LD R1 (256/WORDLNTH)*CPW get size to move 03375 3897080F 2 4 BASE 325 LEA R2 TCB,TCTERMA get destination address in TCB 03376 FE400000 326 CMOVE move new term group into TCB 03377 600BC010 0 7 CBM 327 LD R0 R7/BIT 0 1 sez CALCTERMC is appropriate 03378 5D1F8001 6 STAK 328 LEAVE POP back to caller 329 * --- 330 331 END RESETTCG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 642 (PROCINOUT) F 36 Session ins and outs 333 334 ********************************************************************************** 335 * * 336 * MOVETRMGP. Reset the TCG and TCS in the given TCB, rescan * 337 * the input buffer for terminators if it is indicated. This is * 338 * only required for the absoute I/O .TERM. Leaves TCB locked on * 339 * return. * 340 * Call: * 341 * R4 => TCB (locked) * 342 * CALLNP MOVETRMGP * 343 * * 344 * Eats R0:R3. * 345 * Stack required = 3 * 346 * 1 + max ( CALCTERMC (2), RESETTCG (1) ) * 347 * * 348 ********************************************************************************** 349 350 BLOCK MOVETRMGP subroutine 351 ENTRY MOVETRMGP 352 353 BEGFRAME 354 ENDFRAME 355 03379 DD5F8001 6 STAK 356 MOVETRMGP ENTRNP PUSH 0337A DC403358 357 CALLNP RESETTCG install appropriate TCG/TCS 0337B FA02337D 0 358 JEQZ R0 JUSTGO jump if no scan required 0337C DC404CA6 359 CALLNP CALCTERMC find any terminators 0000337D 360 JUSTGO LABEL 0337D 5D1F8001 6 STAK 361 LEAVE POP return to caller 362 * --- 363 364 END MOVETRMGP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 643 (PROCINOUT) F 36 Session ins and outs 366 367 ********************************************************************************** 368 * * 369 * MOVETRMGX. Locate session's console terminal and call * 370 * MOVETRMGP on it. * 371 * * 372 * Call: CALLNP MOVETRMGX * 373 * R4 => TCB (unlocked) * 374 * * 375 * Eats R0:R2, R4. * 376 * Sets R4 * 377 * Stack required = 5 * 378 * 1 + max ( FINDTERMCB (1), LOCKWAIT (0), MOVETRMGP (3) ) * 379 * * 380 ********************************************************************************** 381 382 BLOCK MOVETRMGX subroutine 383 ENTRY MOVETRMGX 384 385 BEGFRAME 00178801 6 BASE 386 SAVER3 BSS 1 a safe spot 387 ENDFRAME 388 0337E DD5F8002 6 STAK 389 MOVETRMGX ENTRNP PUSH 0337F E4D78801 3 6 BASE 390 ST R3 SP,SAVER3 save a reg 03380 DC0035C5 391 CALL FINDTERMCB get TCB for console term 03381 40400412 392 PARVL CPPSA current session 03382 61124000 4 1 REG 393 LD TCB R1 put in a normal place 03383 FB30338B 4 394 JZA TCB NOMOVE jump if none such 395 PLOCK TCB,TCLOCK lock it 03384 0CC00000 395 IOFF 03385 D1D70818 4 BASE 395 SETT TCB,TCLOCK 03386 FE0C3388 395 JNE MA(2+DISPW MA 0) 03387 DC40308B 395 CALLNP LOCKWAIT 03388 DC403379 396 CALLNP MOVETRMGP shuffle TCG/TCS 397 PUNLOCK TCB,TCLOCK unlock it 03389 EC170818 4 BASE 397 STZ TCB,TCLOCK 0338A 0C800000 397 ION 0000338B 398 NOMOVE LABEL 0338B 60D78801 3 6 BASE 399 LD R3 SP,SAVER3 restore a reg 0338C 5D1F8002 6 STAK 400 LEAVE POP return to caller 401 * --- 402 403 END MOVETRMGX subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 644 (PROCINOUT) F 36 Session ins and outs 405 406 ********************************************************************************** 407 * * 408 * OVPDESTROY. This routine takes an unlinked UPC block * 409 * pointed to by R3 and destroys it and its contents. The * 410 * console area is freed, the memory is freed, and the UPC * 411 * block itself is returned. Note that PALs in the VASP * 412 * list are gone but the working set extension list may not * 413 * be empty. * 414 * * 415 * LD R3 => UPC block * 416 * CALLNP OVPDESTROY * 417 * * 418 * Registers Used: R0:R3 * 419 * * 420 * Stack Required: 14 * 421 * 3 + max ( DISCARDPAL (4), DMOTINDPAL (2), FREEULB (11), * 422 * GRUBVPEL (7), SFREEMEM (0), TIMEKILL (2), * 423 * UFREEMEM (0), UPCFREEMEM (0) ) * 424 * * 425 ********************************************************************************** 426 427 BLOCK OVPDESTROY subroutine 428 ENTRY OVPDESTROY 429 430 BEGFRAME 00178801 6 BASE 431 OVPDSTRYPT BSS2 1 pointer to UPC element 00178802 6 BASE 432 OVPDSTRYSV EQU OVPDSTRYPT(1) place to save R4 433 ENDFRAME 434 0338D DD5F8003 6 STAK 435 OVPDESTROY ENTRNP PUSH 0338E E6D78801 346 BASE 436 ST2 R3 SP,OVPDSTRYPT save pointer and R4 0338F 6116C811 4 3 BASE 437 LD R4 R3,UPCTIMESER get serial number of time interrupt 03390 FB303393 4 438 JZA R4 NOUPCTIME jump if none 03391 DC404517 439 CALLNP TIMEKILL kill the time interrupt 03392 FEC00000 440 NOP 0 not found return 00003393 441 NOUPCTIME LABEL 03393 61178801 4 6 BASE 442 LD R4 SP,OVPDSTRYPT R4 -> our UPC block 443 444 * dump user error list 00003394 445 OVPDRUERLP LABEL 03394 6057080B 1 4 BASE 446 LD R1 R4,UPCUERROR first UPC UER element 03395 FA70339C 1 447 JZA R1 OVPDRVMLP jump if no such 03396 60885F10 2 1 ZBM 448 LD R2 R1,UERLINK get next one 03397 E497080B 2 4 BASE 449 ST R2 R4,UPCUERROR save it 03398 DC002F5D 450 CALL UFREEMEM dump it 03399 41440001 IMM 451 PARV UERLOG size 0339A 40524000 1 REG 452 PARVL R1 address 0339B FE0E3394 453 JMP OVPDRUERLP try more 454 * --- 455 0000339C 456 OVPDRVMLP LABEL 0339C 6097080D 2 4 BASE 457 LD R2 R4,UPCVMLIST get an element from list 0339D FAB033A2 2 458 JZA R2 OVPDRWVMLP jump if none 0339E 60089F10 0 2 ZBM 459 LD R0 R2,VPLINK get pointer to next element in list 0339F E417080D 0 4 BASE 460 ST R0 R4,UPCVMLIST unlink this VP element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 645 (PROCINOUT) F 36 Session ins and outs 033A0 DC4030D7 461 CALLNP GRUBVPEL release the use of the page 033A1 FE0E339C 462 JMP OVPDRVMLP try for another element 463 * --- 464 000033A2 465 OVPDRWVMLP LABEL 033A2 6097080E 2 4 BASE 466 LD R2 R4,UPCWVMLIST get an element from list 033A3 FAB033A8 2 467 JZA R2 OVPDRVMDN jump if none 033A4 60089F10 0 2 ZBM 468 LD R0 R2,VPLINK get pointer to next element in list 033A5 E417080E 0 4 BASE 469 ST R0 R4,UPCWVMLIST unlink this VP element 033A6 DC4030D7 470 CALLNP GRUBVPEL release the use of the page 033A7 FE0E33A2 471 JMP OVPDRWVMLP try for another element 472 * --- 473 000033A8 474 OVPDRVMDN LABEL 033A8 5C17080F 4 BASE 475 CMZ R4,UPCVASP check the VASP list 033A9 FE0233AB 476 JEQ OVVASPDN jump if VASP list is empty 033AA 001300D1 477 HALT HALTS00D1 UPCs VASP not empty after cleaning VMLIST 478 * --- 479 000033AB 480 OVVASPDN LABEL 000033AB 481 OVWSXLIST LABEL 033AB 60D78801 3 6 BASE 482 LD R3 SP,OVPDSTRYPT get pointer to UPC block 033AC 6116C810 4 3 BASE 483 LD PAL R3,UPCWSX get pointer to WSX list 033AD FB3033B4 4 484 JZA PAL OVWSXDN jump if WSX list empty 033AE 60091F10 0 4 ZBM 485 LD R0 PAL,PALINK get link to next element 033AF E416C810 0 3 BASE 486 ST R0 R3,UPCWSX remove element from list 033B0 DC402E15 487 CALLNP DISCARDPAL release PAL 033B1 60800412 2 488 LD R2 CPPSA get PSA pointer 033B2 D04880F2 2 ZBM 489 DEC R2,PSWSSIZE decrement working set size 033B3 FE0E33AB 490 JMP OVWSXLIST loop through WSX list 491 * --- 492 000033B4 493 OVWSXDN LABEL 033B4 61178801 4 6 BASE 494 LD R4 SP,OVPDSTRYPT R4 -> UPC block 033B5 DC002F5D 495 CALL SFREEMEM return the console area 033B6 41440004 IMM 496 PARV CALOG indicate its length 033B7 40491F12 4 ZBM 497 PARVL R4,UPCCONSOLE and location 033B8 61178801 4 6 BASE 498 LD ULB SP,OVPDSTRYPT fetch up the pointer 033B9 61091F13 4 4 ZBM 499 LD ULB ULB,UPCPRIVULB get the ptr of privileges 033BA DC405526 500 CALLNP FREEULB and release this one 033BB 61178801 4 6 BASE 501 LD R4 SP,OVPDSTRYPT and pick up the pointer again 033BC DC002F8F 502 CALL UPCFREEMEM release the UPC block 033BD 41440005 IMM 503 PARV UPCLOG indicate the length 033BE 40530000 4 REG 504 PARVL R4 and location 033BF DC403165 505 CALLNP DMOTINDPAL move all indirect pages to WSX list 033C0 61178802 4 6 BASE 506 LD R4 SP,OVPDSTRYSV restore R4 033C1 5D1F8003 6 STAK 507 LEAVE POP return 508 * --- 509 510 END OVPDESTROY subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 646 (PROCINOUT) F 36 Session ins and outs 512 513 BLOCK Interrupt Checkers 514 ENTRY CHECKUINT 515 ENTRY CHECKEVENT 516 ENTRY CHECKNOINT 517 518 ********************************************************************************** 519 * * 520 * CHECKUINT. This routine checks the selected user interrupts and * 521 * if the device dependent ones are enabled it searches for the device * 522 * and sees if an interrupt is supposed to happen now. Normally devices * 523 * post their interrupts but they might not get posted for a particular * 524 * program if it is moving in and out of a debugger or a file system * 525 * handler or if the interrupt enable bits are just being turned on or * 526 * off. * 527 * Call: * 528 * * 529 * CPPSA => this CPUs pointer to current PSA * 530 * CPCUPC => this CPUs pointer to current UPC * 531 * R3 = mask of ints to check * 532 * CALLNP CHECKUINT * 533 * * 534 * Eats R0:R3. * 535 * Stack required = 5 * 536 * 2 + max ( FINDPATH (1), FINDTERM (1), GETTRAPPER (3), * 537 * UERRSET (1) ) * 538 * * 539 ********************************************************************************** 540 541 BLOCK CHECKUINT and CHECKEVENT subroutines 542 ENTRY CHECKUINT 543 ENTRY CHECKEVENT 544 545 BEGFRAME 00178801 6 BASE 546 CHKINTF BSS 1 save for the interrupt mask 547 ENDFRAME 548 00000010 BYTE 549 NOPOST EQU BIT 0 bit in R7 saying to not post int 550 033C2 DD5F8002 6 STAK 551 CHECKUINT ENTRNP PUSH 033C3 EC0BC010 7 CBM 552 STZ R7/NOPOST we are to post the interrupt 000033C4 553 CHKUINTSHR LABEL 033C4 E4D78801 3 6 BASE 554 ST R3 SP,CHKINTF save the int mask 033C5 F2D033D5 3 555 JBF R3/BIT CAIMNETERM NOTNETERM2 jump if not waiting for term 556 557 ********************************************************************************** 558 * * 559 * Search for non-empty terminals. We avoid the potentially * 560 * lengthy GETTRAPPER when FCABSIO = 1, since this FCB's * 561 * TCB already told us enough to know that someone is trapping * 562 * (TCINTTCG=1 on FCABSIO means someone's CAINTADR <> 0, and * 563 * CAINTMASK bit 0 = 1, bit CAIMNETERM = 1). * 564 * * 565 ********************************************************************************** 566 033C6 60C00412 3 567 LD R3 CPPSA get session 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 647 (PROCINOUT) F 36 Session ins and outs 033C7 38C8DF17 3 3 ZBM 568 LEA R3 R3,PSFCBLIST => unit list head 000033C8 569 TERMSCAN LABEL 033C8 DC403416 570 CALLNP FINDTERM try our luck! 033C9 FAF033D4 3 571 JZA R3 NOTNETERM1 jump if none 033CA F7C03402 7 572 JBT R7/NOPOST TERMPOST jump if not giving int 573 * \ / 574 033CB 5C08E015 3 ZBM 575 CMZ R3,FCABSIO is it the main thing? 033CC FE0C33D2 576 JNE POSTNETERM jump if so 033CD 60800414 2 577 LD R2 CPCUPC pass starting UPC 033CE DC002AB3 578 CALL GETTRAPPER see if anyone cares 033CF 41440022 IMM 579 PARV UINTNETERM pass int code 033D0 4052C000 3 REG 580 PARVL R3 pass int subcode 033D1 FE0E33C8 581 JMP TERMSCAN jump if no one cares 582 * \ / 583 584 * found someone, R3 => FCB 000033D2 585 POSTNETERM LABEL 033D2 60840022 2 IMM 586 LD R2 UINTNETERM code for int 033D3 DC403589 587 CALLNP UERRSET post the error 588 * \ / 589 590 ********************************************************************************** 591 * * 592 * Search for readable paths, starting with the local units. * 593 * * 594 ********************************************************************************** 595 596 * \ / 000033D4 597 NOTNETERM1 LABEL 033D4 60D78801 3 6 BASE 598 LD R3 SP,CHKINTF restore the int mask 000033D5 599 NOTNETERM2 LABEL 033D5 F2D233E3 3 600 JBF R3/BIT CAIMNEPATH NOTNEPATH2 jump if not doing PATH ints 601 * \ / 602 033D6 60C00412 3 603 LD R3 CPPSA get session 033D7 38C8DF17 3 3 ZBM 604 LEA R3 R3,PSFCBLIST => unit list head 000033D8 605 PATHSCAN LABEL 033D8 DC403427 606 CALLNP FINDPATH try our luck! 033D9 FAF033E2 3 607 JZA R3 NOTNEPATH1 jump if none 033DA F7C03405 7 608 JBT R7/NOPOST PATHPOST just checking? 609 * \ / 610 033DB 60800414 2 611 LD R2 CPCUPC pass starting UPC 033DC DC002AB3 612 CALL GETTRAPPER see if anyone cares 033DD 41440023 IMM 613 PARV UINTNEPATH pass int code 033DE 4052C000 3 REG 614 PARVL R3 pass int subcode 033DF FE0E33D8 615 JMP PATHSCAN jump if no one cares 616 * \ / 617 618 * found someone, R3 => FCB 033E0 60840023 2 IMM 619 LD R2 UINTNEPATH code for int 033E1 DC403589 620 CALLNP UERRSET post the error 621 * \ / 622 623 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 648 (PROCINOUT) F 36 Session ins and outs 624 * * 625 * Check to see if there are any messages pending for this user. * 626 * * 627 ********************************************************************************** 628 629 * \ / 000033E2 630 NOTNEPATH1 LABEL 033E2 60D78801 3 6 BASE 631 LD R3 SP,CHKINTF restore the interrupt mask 000033E3 632 NOTNEPATH2 LABEL 033E3 F2D633EC 3 633 JBF R3/BIT CAIMMSG NOTMSG jump if message ints not happening 033E4 60800412 2 634 LD R2 CPPSA fetch our current PSA address 033E5 6016881A 0 2 BASE 635 LD R0 R2,PSMSGLIST R0=>root of message list 033E6 FA3033EC 0 636 JZA R0 NOTMSG jump if no messages pending 033E7 60840026 2 IMM 637 LD R2 UINTMSG code for message int 033E8 60C82101 3 0 ZBM 638 LD R3 R0,MQECLASS param is class of message 033E9 F7C0340B 7 639 JBT R7/NOPOST MSGPOST jump if to not post, just return 033EA DC403589 640 CALLNP UERRSET post the error in the program 033EB 60D78801 3 6 BASE 641 LD R3 SP,CHKINTF restore the mask 642 * \ / 643 644 ********************************************************************************** 645 * * 646 * Check to see if there are any gift units waiting. * 647 * * 648 ********************************************************************************** 649 650 * \ / 000033EC 651 NOTMSG LABEL 033EC F2DC33F5 3 652 JBF R3/BIT CAIMGUNIT NOTUNIT jump if unit interrupts not enabled 033ED 60800412 2 653 LD R2 CPPSA fetch our current PSA address 033EE 60168809 0 2 BASE 654 LD R0 R2,PSGIFTUNIT get pointer to list of them 033EF FA3033F5 0 655 JZA R0 NOTUNIT jump if none here 033F0 60840028 2 IMM 656 LD R2 UINTGUNIT post a unit given interrupt 033F1 60D6080E 3 0 BASE 657 LD R3 R0,FCJCXH giver's session number is parameter 033F2 F7C0340E 7 658 JBT R7/NOPOST UNITPOST jump if not to post it 033F3 DC403589 659 CALLNP UERRSET post the unit given interrupt 033F4 60D78801 3 6 BASE 660 LD R3 SP,CHKINTF restore mask 661 * \ / 662 663 ********************************************************************************** 664 * * 665 * Check to see if a time interrupt should be given to this process. * 666 * * 667 ********************************************************************************** 668 669 * \ / 000033F5 670 NOTUNIT LABEL 033F5 F2D43400 3 671 JBF R3/BIT CAIMTIME NOTTIME jump if time ints not enabled 033F6 60800414 2 672 LD R2 CPCUPC get pointer to current UPC 033F7 6016880C 0 2 BASE 673 LD R0 R2,UPCINTTIME get the time for the interrupt 033F8 FA023400 0 674 JEQZ R0 NOTTIME jump if time not set 033F9 10001EE6 0 675 SUB R0 FDATE(1) R0 = (interrupt time) - (current time) 033FA FA043400 0 676 JGTZ R0 NOTTIME jump if not time yet 033FB EC16880C 2 BASE 677 STZ R2,UPCINTTIME allow no more ints for this 033FC 60840025 2 IMM 678 LD R2 UINTTIMINT post a time interrupt 033FD 60C40000 3 IMM 679 LD R3 0 no parameter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 649 (PROCINOUT) F 36 Session ins and outs 033FE F7C03408 7 680 JBT R7/NOPOST TIMEPOST jump if not to post the interrupt 033FF DC403589 681 CALLNP UERRSET post the time interrupt 682 * \ / 683 00003400 684 NOTTIME LABEL 03400 60040000 0 IMM 685 LD R0 0 zero return for CHECKEVENT 00003401 686 BYE LABEL 03401 5D1F8002 6 STAK 687 LEAVE POP return 688 * --- 689 690 * Terminal event to happen 00003402 691 TERMPOST LABEL 03402 60840022 2 IMM 692 LD R2 UINTNETERM code for int 03403 60020100 0 IMM 693 LD R0 1*BIT CAIMNETERM R0 = int mask bit for the event 03404 FE0E3401 694 JMP BYE exit 695 * --- 696 697 * PATH event to happen 00003405 698 PATHPOST LABEL 03405 60840023 2 IMM 699 LD R2 UINTNEPATH code for int 03406 60020080 0 IMM 700 LD R0 1*BIT CAIMNEPATH R0 = int mask bit for the event 03407 FE0E3401 701 JMP BYE exit 702 * --- 703 704 * Time event to happen 00003408 705 TIMEPOST LABEL 03408 60840025 2 IMM 706 LD R2 UINTTIMINT code for int 03409 60020040 0 IMM 707 LD R0 1*BIT CAIMTIME R0 = int mask bit for the event 0340A FE0E3401 708 JMP BYE exit 709 * --- 710 711 * Message event to happen 0000340B 712 MSGPOST LABEL 0340B 60840026 2 IMM 713 LD R2 UINTMSG code for int 0340C 60020020 0 IMM 714 LD R0 1*BIT CAIMMSG R0 = int mask bit for the event 0340D FE0E3401 715 JMP BYE exit 716 * --- 717 718 * Unit received event to happen 0000340E 719 UNITPOST LABEL 0340E 60840028 2 IMM 720 LD R2 UINTGUNIT code for int 0340F 60020004 0 IMM 721 LD R0 1*BIT CAIMGUNIT R0 = int mask bit for the event 03410 FE0E3401 722 JMP BYE exit 723 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 650 (PROCINOUT) F 36 Session ins and outs 725 726 ********************************************************************************** 727 * * 728 * CHECKEVENT. Routine that examines the events specified in the * 729 * passed mask word and returns information on whether any of these * 730 * events are ready to happen and, if so, where. Call is: * 731 * * 732 * SP => stack top * 733 * CALL CHECKEVENT * 734 * PARVL CA interrupt mask bits for events * 735 * ST R0 int mask corresponding to found event (zero if none) * 736 * ST R2 int code to be given * 737 * ST R3 parameter for int code * 738 * * 739 * Eats R0:R3. * 740 * Stack required = 5, See CHECKUINT. * 741 * * 742 ********************************************************************************** 743 03411 DD1F8002 6 STAK 744 CHECKEVENT ENTR PUSH 03412 C052C000 3 REG 745 STPVL R3 R3 = events to check 03413 EDCBC010 7 CBM 746 STW R7/NOPOST don't give the ints -- tell me 03414 60800412 2 747 LD R2 CPPSA session 03415 FE0E33C4 748 JMP CHKUINTSHR share the looker code 749 * --- 750 751 END CHECKUINT and CHECKEVENT routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 651 (PROCINOUT) F 36 Session ins and outs 753 754 ********************************************************************************** 755 * * 756 * FINDTERM. This routine locates the first terminal unit on the * 757 * specified FCB list for which an interrupt is pending. It * 758 * checks that the TCB has interrupts enabled and that it indi- * 759 * cates the presence of a complete record. This does not mean * 760 * that anyone is actually trapping it, though, if the unit is * 761 * not the absolute input. * 762 * * 763 * Call: R3 => FCB list head pointer * 764 * CALLNP FINDTERM * 765 * * 766 * * 767 * Sets R3 => FCB for NE terminal or 0 * 768 * Eats R0:R1 * 769 * Stack usage: 1 * 770 * * 771 ********************************************************************************** 772 773 BLOCK FINDTERM 774 ENTRY FINDTERM 775 776 BEGFRAME 777 ENDFRAME 778 03416 DD5F8001 6 STAK 779 FINDTERM ENTRNP PUSH 03417 60440007 1 IMM 780 LD R1 HTYPETERM get type code for terminal 00003418 781 NEXTFCB LABEL 03418 FAF43426 3 782 LJZA R3 ALLOVER get first FCB, jump if none 03419 3C48E665 1 3 ZBM 783 LSRCH R1 R3,FCHTYPE find a terminal 0341A FE0C3426 784 JNE ALLOVER jump if no terminals 0341B 60040007 0 IMM 785 LD R0 FSACSNDA code for unwanted access 0341C 6408D835 0 3 ZBM 786 CPR R0 R3,FCACCESS must have access to terminal 0341D FE023418 787 JEQ NEXTFCB jump if not, loop 0341E 6008DF16 0 3 ZBM 788 LD R0 R3,FCDCBPTR get the TCB 789 * \ / 790 791 * R0 => TCB (maybe) 0341F FA303418 0 792 JZA R0 NEXTFCB jump if fake terminal 03420 5C16080E 0 BASE 793 CMZ R0,TCTERMLOC record here? 03421 FE023418 794 JEQ NEXTFCB jump if not, loop 03422 5C081E18 0 ZBM 795 CMZ R0,TCINTE interrupts enabled? 03423 FE023418 796 JEQ NEXTFCB jump if not, loop 03424 5C081615 0 ZBM 797 CMZ R0,TCINTTCG TCG/TCS for a trapper? 03425 FE023418 798 JEQ NEXTFCB if so, success! 799 * \ / 800 00003426 801 ALLOVER LABEL 03426 5D1F8001 6 STAK 802 LEAVE POP return 803 * --- 804 805 END FINDTERM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 652 (PROCINOUT) F 36 Session ins and outs 807 808 ********************************************************************************** 809 * * 810 * FINDPATH. This routine locates the first path logical unit for * 811 * which an interrupt is pending for the current session. FINDPATH * 812 * checks that the current session is the reader of the path, that * 813 * interrupts are enabled on the path, and that the path is non-empty. * 814 * Note that if the list is empty the content of R0 is left unchanged * 815 * (i.e. the non-address part is not cleared). * 816 * * 817 * Call: R3 => FCB list head pointer * 818 * CALLNP FINDPATH * 819 * * 820 * * 821 * Sets R3 => FCB for NE path or 0 * 822 * Eats R0:R2 * 823 * Stack usage: 1 * 824 * * 825 ********************************************************************************** 826 827 BLOCK FINDPATH subroutine 828 ENTRY FINDPATH 829 830 BEGFRAME 831 ENDFRAME 832 03427 DD5F8001 6 STAK 833 FINDPATH ENTRNP PUSH 03428 60800412 2 834 LD R2 CPPSA get the current session 03429 60889F12 2 2 ZBM 835 LD R2 R2,PSPROCCB get its PCB 836 0342A 60440004 1 IMM 837 LD R1 HTYPEPATH get type code for path 0000342B 838 NEXTFCB LABEL 0342B FAF4343B 3 839 LJZA R3 ALLOVER get first FCB, jump if none 0342C 3C48E665 1 3 ZBM 840 LSRCH R1 R3,FCHTYPE find a path 0342D FE0C343B 841 JNE ALLOVER jump if no paths 0342E 6008DF16 0 3 ZBM 842 LD R0 R3,FCDCBPTR get the control block 843 * \ / 844 845 * R0 => path control block 0342F 64880112 2 0 ZBM 846 CPR R2 R0,PTHREADER are we the reader? 03430 FE0C342B 847 JNE NEXTFCB jump if we can't get int 03431 5C08DC15 3 ZBM 848 CMZ R3,FCACCESS/FSACSNWB is this the reading unit? 03432 FE02342B 849 JEQ NEXTFCB jump if we can't read from here 03433 5C080411 0 ZBM 850 CMZ R0,PTHINTE are ints enabled? 03434 FE02342B 851 JEQ NEXTFCB jump if we can't get int 03435 5C081F11 0 ZBM 852 CMZ R0,PTHQUE record here? 03436 FE0C343B 853 JNE ALLOVER success! 03437 5C080211 0 ZBM 854 CMZ R0,PTHUSED has the PATH ever been used 03438 FE02342B 855 JEQ NEXTFCB jump if not 03439 5C160806 0 BASE 856 CMZ R0,PTHWRTRS are there any writer left 0343A FE0C342B 857 JNE NEXTFCB if not, need to give EOD interrupt 858 * \ / 859 0000343B 860 ALLOVER LABEL 0343B 5D1F8001 6 STAK 861 LEAVE POP return 862 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 653 (PROCINOUT) F 36 Session ins and outs 863 864 END FINDPATH subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 654 (PROCINOUT) F 36 Session ins and outs 866 867 ********************************************************************************** 868 * * 869 * CHECKNOINT. This routine REMOVES elements from the * 870 * users error lists for interrupts whose bit are ON in the * 871 * given mask (same format as CAINTMASK). We actually only * 872 * check a selected few: i.e. "errors" that are actually * 873 * event notifications that can be regenerated by a call to * 874 * CHECKUINT. * 875 * * 876 * Call: LD SP => top of stack * 877 * LD R3 bit mask for ints to check * 878 * CALLNP CHECKNOINT * 879 * * 880 * Eats R0:R2. * 881 * Stack required = 2 * 882 * 1 + max ( ELSRCHER (1), LOCKWAIT (0) ) * 883 * * 884 ********************************************************************************** 885 886 BLOCK CHECKNOINT subroutine 887 ENTRY CHECKNOINT 888 889 BEGFRAME 890 ENDFRAME 891 0343C DD5F8001 6 STAK 892 CHECKNOINT ENTRNP PUSH 0343D 60800412 2 893 LD R2 CPPSA get the current PSA pointer 894 PLOCK R2,PSLOCK get access to the PSA 0343E 0CC00000 894 IOFF 0343F D1D6880C 2 BASE 894 SETT R2,PSLOCK 03440 FE0C3442 894 JNE MA(2+DISPW MA 0) 03441 DC40308B 894 CALLNP LOCKWAIT 03442 5C089F1D 2 ZBM 895 CMZ R2,PSUERROR/FLDADRS check for any errors in list 03443 FE023454 896 JEQ EMPTYERLIS jump if empty 897 * \ / 898 899 * Non-empty .PATH 03444 F2D23447 3 900 JBF R3/BIT CAIMNEPATH NOTPATH jump if to leave non-empty path 03445 60040023 0 IMM 901 LD R0 UINTNEPATH get user interrupt code for non-empty path 03446 DC4034F6 902 CALLNP ELSRCHER find and remove any such interrupt 00003447 903 NOTPATH LABEL 904 * \ / 905 906 * Non-empty .TERM 03447 F2D0344A 3 907 JBF R3/BIT CAIMNETERM NOTTERM jump if to leave non-empty terminal 03448 60040022 0 IMM 908 LD R0 UINTNETERM get user interrupt code for terminal input 03449 DC4034F6 909 CALLNP ELSRCHER find and remove any such interrupt 0000344A 910 NOTTERM LABEL 911 * \ / 912 913 * Intersession messages 0344A F2D6344D 3 914 JBF R3/BIT CAIMMSG NOTMSG jump if to leave message interrupt 0344B 60040026 0 IMM 915 LD R0 UINTMSG get user interrupt code for message receipt 0344C DC4034F6 916 CALLNP ELSRCHER find and remove any such interrupt 0000344D 917 NOTMSG LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 655 (PROCINOUT) F 36 Session ins and outs 918 * \ / 919 920 * Logical unit transfer 0344D F2DC3450 3 921 JBF R3/BIT CAIMGUNIT NOTUNIT jump if to leave unit interrupts 0344E 60040028 0 IMM 922 LD R0 UINTGUNIT get user interrupt code for unit receipt 0344F DC4034F6 923 CALLNP ELSRCHER find and remove any such interrupt 00003450 924 NOTUNIT LABEL 925 * \ / 926 927 * Timer interrupts 03450 F2D43453 3 928 JBF R3/BIT CAIMTIME NOTTIME jump if to leave timer interrupt 03451 60040025 0 IMM 929 LD R0 UINTTIMINT get user interrupt code for timer up 03452 DC4034F6 930 CALLNP ELSRCHER find and remove any such interrupt 00003453 931 NOTTIME LABEL 932 933 * All done, re-allow access to PSA 03453 60800412 2 934 LD R2 CPPSA get the current PSA pointer 00003454 935 EMPTYERLIS LABEL 936 PUNLOCK R2,PSLOCK release PSA for others 03454 EC16880C 2 BASE 936 STZ R2,PSLOCK 03455 0C800000 936 ION 03456 5D1F8001 6 STAK 937 LEAVE POP return 938 * --- 939 940 END CHECKNOINT subroutine 941 942 END Interrupt Checkers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 656 (PROCINOUT) F 36 Session ins and outs 944 945 ********************************************************************************** 946 * * 947 * GIVEUINT. This routine shuffles through the tables of the * 948 * mentioned session to decode how to inform him of the requested event. * 949 * The events so posted are non-empty terminal, non-empty path, and * 950 * clock advance. In general, if the session is waiting on the event * 951 * then that session is set going. If he is timing and waiting for that * 952 * event, then the timing is completed and he is told of the event. If * 953 * those aren't satisfied, then if the event interrupt is enabled then * 954 * the interrupt is posted. If all that fails, the event is lost. * 955 * Call for this routine is: * 956 * * 957 * SP => stack top * 958 * CALL GIVEUINT * 959 * PARV pointer to PCB who gets the event * 960 * PARV[2] value of PCQPARM if he is waiting for event * 961 * PARV[2] mask for PCQPARM before comparing with value above * 962 * PARV queue number that session is in if waiting for event * 963 * PARV interrupt enable bit (like CAINTMASK) * 964 * PARV device interrupt enable bit (e.g., TCINTE) * 965 * PARV interrupt code (e.g., UINTBREAK) * 966 * PARVL interrupt sub code (e.g., unit number) * 967 * * 968 * Eats R0:R3 before passing parms. * 969 * Stack required = 8 * 970 * 4 + max ( CHKINTCODE (4), GETTRAPPER (3), LOCKWAIT (0), * 971 * MAPINMEM (3), SETRUNNING (2), UERRSETY (1) ) * 972 * * 973 * INTERNAL NOTES: * 974 * This routine does a bunch of stuff while fetching parms, * 975 * in an attempt not to use a huge amount of stack space. The * 976 * thing to remember is that before doing a STPV, the value of * 977 * the parameter is in R0 (or R0R1 if double-word). "STPV R0" * 978 * will put the old parm (or garbage if R0 has been modified) * 979 * into R0, then get the next parm, leaving it in R0. * 980 * * 981 ********************************************************************************** 982 983 BLOCK GIVEUINT subroutine 984 ENTRY GIVEUINT 985 986 BEGFRAME 00098011 6 ZBM 987 WAITING BSSB 1 session is waiting for event 00098211 6 ZBM 988 INTENABLE BSSB 1 device interrupt enable flag 00178005 6 CACH 989 INTCODE BSSC 1 interrupt code 00178802 6 BASE 990 INTSUBCODE BSS 1 interrupt subcode 00178803 6 BASE 991 INTMASK BSS 1 mask bit for enabling interrupt 992 ENDFRAME 993 03457 DD1F8004 6 STAK 994 GIVEUINT ENTR PUSH 03458 60CA1F10 3 0 CBM 995 LD R3 R0/FLDADRS R3 -> PCB (first parm) 03459 FAF034E2 3 996 JZA R3 NOPCB jump if no session 0345A 6088DF13 2 3 ZBM 997 LD R2 R3,PCPSADRS R2 -> PSA address 998 PLOCK R2,EVENTLOCK to coordinate with URDELAY 0345B 0CC00000 998 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 657 (PROCINOUT) F 36 Session ins and outs 0345C D1D68808 2 BASE 998 SETT R2,EVENTLOCK 0345D FE0C345F 998 JNE MA(2+DISPW MA 0) 0345E DC40308B 998 CALLNP LOCKWAIT 999 * \ / 1000 * Find the queue that this session is in, and lock it 1001 * so that things don't change out from under us. 1002 * \ / 0000345F 1003 LOCKQUEUE LABEL 0345F 6088D260 2 3 ZBM 1004 LD R2 R3,PCQUEUE get current queue number 1005 PLOCK SQLOCKS(R2) lock that queue 03460 0CC00000 1005 IOFF 03461 D1E41DBA 2 1005 SETT SQLOCKS(R2) 03462 FE0C3464 1005 JNE MA(2+DISPW MA 0) 03463 DC40308B 1005 CALLNP LOCKWAIT 03464 38241DA9 0 2 1006 LEA R0 SQBEGIN(R2) R0 -> queue header 03465 3CC81F10 3 0 ZBM 1007 LSRCH R3 R0,PCQLINK find our predecessor 03466 FE02346E 1008 JEQ GOTQUEUE jump if we are in this queue 1009 PUNLOCK SQLOCKS(R2) else we moved, so try again 03467 EC241DBA 2 1009 STZ SQLOCKS(R2) 03468 0C800000 1009 ION 1010 * \ / 1011 1012 ********************************************************************************** 1013 * * 1014 * We come through here if we could not find the session in * 1015 * the queue that he said that he was in. * 1016 * This means that another CPU is actively messing with this session. * 1017 * We will therefore loop around and try again. But first, we must * 1018 * waste a little bit of time, so that there will be enough time between * 1019 * the PUNLOCK above and the PLOCK that we are about to do. The other * 1020 * guy is probably spinning on that lock waiting for us to let it go, * 1021 * but if we re-grab it very quickly he might never notice that we had * 1022 * let the lock go. (Yes, Virginia, this can happen. It DID happen * 1023 * in version A8103.) * 1024 * * 1025 * System debuggers take note: An endless loop here means that * 1026 * someone has a pointer that is not a real PCB pointer or that the * 1027 * PCB is not present in the queue that PCQUEUE indicates. * 1028 * Look for list screwups. * 1029 * * 1030 ********************************************************************************** 1031 1032 * \ / 03469 60440002 1 IMM 1033 LD R1 2 index for two trips through LOCKWAIT 0346A 10440001 1 IMM 1034 SUB R1 1 decrement counter 0346B FA48345F 1 1035 JLTZ R1 LOCKQUEUE jump if wait is done 0346C 0CC00000 1036 IOFF (undone by LOCKWAIT) 0346D DC40308B 1037 CALLNP LOCKWAIT waste some time, returns to "SUB R1" above 1038 * --- 1039 0000346E 1040 GOTQUEUE LABEL 0346E C1520000 0 REG 1041 STPV R0 consume parm -- next is value for PCQPARM 0346F F3CC3476 7 1042 JBF R7/STPDUBL NOTDUBL jump if single-word parm 03470 C3578801 6 BASE 1043 STPV2 SP,1 save double-word value, set up next parm 03471 7A16C801 013 BASE 1044 AND2 R0 R3,PCQPARM mask the actual PCQPARM value 03472 66178801 016 BASE 1045 CPR2 R0 SP,1 compare against expected value 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 658 (PROCINOUT) F 36 Session ins and outs 03473 EC498011 6 ZBM 1046 STLEQ SP,WAITING remember whether it matches 03474 C3520000 0 REG 1047 STPV2 R0 consume parm - get next (queue number) 03475 FE0E347B 1048 JMP AFTERMASK 1049 * --- 1050 00003476 1051 NOTDUBL LABEL 03476 C1578801 6 BASE 1052 STPV SP,1 save value, get next parm (mask) 03477 7816C801 0 3 BASE 1053 AND R0 R3,PCQPARM mask the actual PCQPARM value 03478 64178801 0 6 BASE 1054 CPR R0 SP,1 does it match? 03479 EC498011 6 ZBM 1055 STLEQ SP,WAITING remember our answer 0347A C1520000 0 REG 1056 STPV R0 consume parm - get next (queue number) 1057 * \ / 1058 0000347B 1059 AFTERMASK LABEL 0347B 6408D260 0 3 ZBM 1060 CPR R0 R3,PCQUEUE are we in right queue to be waiting? 0347C EC520000 0 REG 1061 STLEQ R0 R0 = 1 if yes, 0 if no 0347D F8098011 0 6 ZBM 1062 ANDM R0 SP,WAITING if not, can't be waiting for event 0347E C1520000 0 REG 1063 STPV R0 consume queue number 1064 0347F C1578803 6 BASE 1065 STPV SP,INTMASK save interrupt mask 03480 C1498211 6 ZBM 1066 STPV SP,INTENABLE save device interrupt enable bit 03481 C1578005 6 CACH 1067 STPV SP,INTCODE save interrupt code 03482 C0578802 6 BASE 1068 STPVL SP,INTSUBCODE save interrupt subcode 1069 03483 5C098011 6 ZBM 1070 CMZ SP,WAITING is he waiting for the event? 03484 FE0C34CF 1071 JNE UNLKFIRST if so, just make him run 03485 6008D260 0 3 ZBM 1072 LD R0 R3,PCQUEUE get his queue number 03486 6404000E 0 IMM 1073 CPR R0 NQTIMEWAIT is he in timewait? 03487 FE0C34A1 1074 JNE NOTTIMEWT jump if not 03488 6016C801 0 3 BASE 1075 LD R0 R3,PCQPARM get events he's waiting for 03489 78178803 0 6 BASE 1076 AND R0 SP,INTMASK is he waiting for us? 0348A FA0234A1 0 1077 JEQZ R0 NOTTIMEWT jump if not 1078 * \ / 1079 * The session is in a time wait that is satisfyable by 1080 * this event. Put the interrupt codes into his registers 1081 * and make him run. 1082 * \ / 0348B 6088DF13 2 3 ZBM 1083 LD R2 R3,PCPSADRS R2 -> PSA 1084 PUNLOCK R2,EVENTLOCK release lock 0348C EC168808 2 BASE 1084 STZ R2,EVENTLOCK 0348D 0C800000 1084 ION 0348E DC0025EB 1085 CALL MAPINMEM map in this guys virtual monitor memory 0348F 40528000 2 REG 1086 PARVL R2 pointer to the PSA 03490 60889F10 2 2 ZBM 1087 LD R2 R2,PSCACHN R2 -> his console area 03491 60178005 0 6 CACH 1088 LD R0 SP,INTCODE interrupt code 03492 E0168804 0 2 BASE 1089 EXCH R0 R2,CAR2 place it in users R2, get wait mask 03493 5C0A1010 0 CBM 1090 CMZ R0/BIT CAIMNETERM was looking for nonempty .TERM? 03494 FE023498 1091 JEQ INCPC jump if not 03495 60040143 0 IMM 1092 LD R0 URDELAYR get different XREQ (finish delay) 03496 E4168802 0 2 BASE 1093 ST R0 R2,CAR0 make user execute it 03497 FE0E3499 1094 JMP NOINCPC don't skip UREQ instruction 1095 * --- 1096 00003498 1097 INCPC LABEL 03498 D0089F10 2 ZBM 1098 INC R2,CAPC step him past the XREQ 00003499 1099 NOINCPC LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 659 (PROCINOUT) F 36 Session ins and outs 03499 60578802 1 6 BASE 1100 LD R1 SP,INTSUBCODE interrupt subcode 0349A DC0034EA 1101 CALL CHKINTCODE convert subcode 0349B 4148DF13 3 ZBM 1102 PARV R3,PCPSADRS pass the PSA 0349C 40568804 2 BASE 1103 PARVL R2,CAR2 pass the interrupt code 0349D E4568805 1 2 BASE 1104 ST R1 R2,CAR3 put it into his R3 0349E DC0025EB 1105 CALL MAPINMEM re-map original caller 0349F 40400412 1106 PARVL CPPSA pointer to the PSA 034A0 FE0E34D2 1107 JMP MAKERUN and make him run 1108 * --- 1109 1110 ********************************************************************************** 1111 * * 1112 * See whether it is appropriate to give this session * 1113 * an interrupt to notify him of the event. We scan * 1114 * up the process tree to see if anyone is trapping * 1115 * the condition. If so, we give the error unless * 1116 * Control Mode is the trapper and the condition is * 1117 * UINTBREAK not on FCABSIO. Otherwise, we ignore * 1118 * the condition for now unless it is UINTBREAK. * 1119 * UINTBREAK can not be regenerated later on, so we * 1120 * have to leave it. * 1121 * * 1122 ********************************************************************************** 1123 000034A1 1124 NOTTIMEWT LABEL 034A1 5C098211 6 ZBM 1125 CMZ SP,INTENABLE does this device cause interrupts? 034A2 FE0234C8 1126 JEQ NOINT if not, don't give interrupt 1127 * \ / 1128 034A3 E5578803 5 6 BASE 1129 ST R5 SP,INTMASK save useful register 034A4 6148DF13 5 3 ZBM 1130 LD R5 R3,PCPSADRS R5 -> PSA for user 034A5 DC0025EB 1131 CALL MAPINMEM get access to other session 034A6 40534000 5 REG 1132 PARVL R5 pass PSA address 034A7 60178005 0 6 CACH 1133 LD R0 SP,INTCODE interrupt code 034A8 60D78802 3 6 BASE 1134 LD R3 SP,INTSUBCODE interrupt subcode 034A9 60894116 2 5 ZBM 1135 LD R2 R5,PSCURRPROC starting UPC 034AA DC002AB3 1136 CALL GETTRAPPER find some interest? 034AB 41520000 0 REG 1137 PARV R0 pass code 034AC 4052C000 3 REG 1138 PARVL R3 pass subcode 034AD FE0E34C1 1139 JMP NOTRP jump if no trappers 1140 * \ / 1141 034AE 64895F15 2 5 ZBM 1142 CPR R2 R5,PSPROCLIST CM trap? 034AF FE0C34B5 1143 JNE SENDITX jump if not 034B0 60978005 2 6 CACH 1144 LD R2 SP,INTCODE get code 034B1 64840020 2 IMM 1145 CPR R2 UINTBREAK break interrupt? 034B2 FE0C34B6 1146 JNE SENDIT jump if not 034B3 5C08E015 3 ZBM 1147 CMZ R3,FCABSIO for absolute input? 034B4 FE0234C4 1148 JEQ NOINTUM jump if not 1149 * \ / 1150 1151 * post an interrupt for the condition 000034B5 1152 SENDITX LABEL 034B5 60978005 2 6 CACH 1153 LD R2 SP,INTCODE get code 000034B6 1154 SENDIT LABEL 034B6 DC4035B5 1155 CALLNP UERRSETY queue the interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 660 (PROCINOUT) F 36 Session ins and outs 1156 PUNLOCK R5,EVENTLOCK release lock 034B7 EC174808 5 BASE 1156 STZ R5,EVENTLOCK 034B8 0C800000 1156 ION 034B9 DC0025EB 1157 CALL MAPINMEM remap CPPSA 034BA 40400412 1158 PARVL CPPSA pass session 034BB 60C95F12 3 5 ZBM 1159 LD R3 R5,PSPROCCB restore pointer to PCB 034BC 61578803 5 6 BASE 1160 LD R5 SP,INTMASK restore R5 034BD 6008D260 0 3 ZBM 1161 LD R0 R3,PCQUEUE get queue number he is in 034BE 5C303572 0 @ 1162 CMZ @ROUSTQUES(R0) is user roustable? 034BF FE0C34D2 1163 JNE MAKERUN if so, make him run 034C0 FE0E34CB 1164 JMP RELQUEUE else, no get interrupt 1165 * --- 1166 1167 * don't let break go unnoticed 000034C1 1168 NOTRP LABEL 034C1 60978005 2 6 CACH 1169 LD R2 SP,INTCODE get code 034C2 64840020 2 IMM 1170 CPR R2 UINTBREAK break interrupt? 034C3 FE0234B6 1171 JEQ SENDIT jump if so 1172 * \ / 1173 1174 * don't give an interrupt 000034C4 1175 NOINTUM LABEL 034C4 DC0025EB 1176 CALL MAPINMEM remap CPPSA 034C5 40400412 1177 PARVL CPPSA pass session 034C6 60C95F12 3 5 ZBM 1178 LD R3 R5,PSPROCCB restore pointer to PCB 034C7 61578803 5 6 BASE 1179 LD R5 SP,INTMASK restore R5 000034C8 1180 NOINT LABEL 034C8 6088DF13 2 3 ZBM 1181 LD R2 R3,PCPSADRS PSA pointer 1182 PUNLOCK R2,EVENTLOCK 034C9 EC168808 2 BASE 1182 STZ R2,EVENTLOCK 034CA 0C800000 1182 ION 000034CB 1183 RELQUEUE LABEL 034CB 6008D260 0 3 ZBM 1184 LD R0 R3,PCQUEUE get queue user is in 1185 PUNLOCK SQLOCKS(R0) release the queue 034CC EC201DBA 0 1185 STZ SQLOCKS(R0) 034CD 0C800000 1185 ION 034CE FE0E34E4 1186 JMP RETURN and all done 1187 * --- 1188 1189 * Here, we make the session run. We have already diddled 1190 * him as necessary (like giving him an error). 1191 000034CF 1192 UNLKFIRST LABEL 034CF 6088DF13 2 3 ZBM 1193 LD R2 R3,PCPSADRS PSA address 1194 PUNLOCK R2,EVENTLOCK release lock 034D0 EC168808 2 BASE 1194 STZ R2,EVENTLOCK 034D1 0C800000 1194 ION 1195 * \ / 000034D2 1196 MAKERUN LABEL 034D2 0CC00000 1197 IOFF protect transfer between queues 034D3 6088D260 2 3 ZBM 1198 LD R2 R3,PCQUEUE get the queue he's in 034D4 38241DA9 0 2 1199 LEA R0 SQBEGIN(R2) R0 -> head of his queue 034D5 3CC81F10 3 0 ZBM 1200 LSRCH R3 R0,PCQLINK find previous one in queue 034D6 FE0234D8 1201 JEQ GOTPREV jump if found 034D7 001300D0 1202 HALT HALTS00D0 PCB not found on SQ 1203 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 661 (PROCINOUT) F 36 Session ins and outs 1204 000034D8 1205 GOTPREV LABEL 034D8 6048DF10 1 3 ZBM 1206 LD R1 R3,PCQLINK R1 -> following one 034D9 E4481F10 1 0 ZBM 1207 ST R1 R0,PCQLINK remove us from queue 1208 PUNLOCK SQLOCKS(R2) unlock the queue 034DA EC241DBA 2 1208 STZ SQLOCKS(R2) 034DB 0C800000 1208 ION 034DC E5178803 4 6 BASE 1209 ST PCB SP,INTMASK save a useful register 034DD 6112C000 4 3 REG 1210 LD PCB R3 PCB -> our session 034DE DC402B99 1211 CALLNP SETRUNNING make him runnable 034DF 61178803 4 6 BASE 1212 LD PCB SP,INTMASK restore this register 034E0 0C800000 1213 ION allow interrupts again 034E1 FE0E34E4 1214 JMP RETURN and all done 1215 * --- 1216 1217 * Here, we don't have a session to which to consider 1218 * giving an interrupt. So we throw away any remaining 1219 * parameters and go away happily. 1220 000034E2 1221 NOPCB LABEL 034E2 DCD3C000 7 REG 1222 EXPCS R7 go get another parameter 034E3 F7C834E2 7 1223 JBT R7/STPNLAST NOPCB repeat until we have the last one 1224 * \ / 1225 000034E4 1226 RETURN LABEL 034E4 5D1F8004 6 STAK 1227 LEAVE POP return to caller 1228 * --- 1229 1230 END GIVEUINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 662 (PROCINOUT) F 36 Session ins and outs 1232 1233 ********************************************************************************** 1234 * * 1235 * CHKINTCODE. This subroutine is passed an interrupt * 1236 * code, an interrupt subcode, and a PSA address. The subcodes * 1237 * of some interrupts are actually FCB addresses even though * 1238 * the user will eventually see them as unit numbers. The * 1239 * subcode is converted at the very last minute before being * 1240 * handed to the user. This subroutine determines whether the * 1241 * given subcode must be converted. If it does, the conversion * 1242 * is made by checking the unit list for the current underprocess * 1243 * of the given PSA. If the unit is not available to that * 1244 * underprocess (unit has been closed, or is local to another * 1245 * underprocess) the value 0 is returned instead of a unit number. * 1246 * R1 is returned unchanged if the subcode is not an FCB address. * 1247 * * 1248 * Call: * 1249 * R1 = interrupt subcode * 1250 * CALL CHKINTCODE * 1251 * PARV * 1252 * PARVL * 1253 * * 1254 * * 1255 * Sets R1 * 1256 * Eats R0 * 1257 * Stack usage: 4 * 1258 * 2 + FINDUCE (2) * 1259 * * 1260 ********************************************************************************** 1261 1262 BLOCK CHKINTCODE subroutine 1263 ENTRY CHKINTCODE 1264 ENTRY SCCONPTR 1265 034E5 00000000 1266 SCCONTYP VFD 0 034E6 B8000000 1267 VFD 1*(BIT BREAK)+1*(BIT NETERM)+1*(BIT NEPATH)+1*(BIT DISC) 034E7 00000000 1268 VFD 0 034E8 00000010 1269 VFD 1*(BIT CHAIN) 00000000 ABS 1270 BREAK EQU UINTBREAK-WORDLNTH 00000002 ABS 1271 NETERM EQU UINTNETERM-WORDLNTH 00000003 ABS 1272 NEPATH EQU UINTNEPATH-WORDLNTH 00000004 ABS 1273 DISC EQU UINTTDISC-WORDLNTH 0000001B ABS 1274 CHAIN EQU UINTCHAIN-(3*WORDLNTH) 034E9 004834E5 1275 SCCONPTR PTR SCCONTYP/BIT 0 1276 1277 BEGFRAME 00178801 6 BASE 1278 THEPSA BSS 1 1279 ENDFRAME 1280 034EA DD1F8002 6 STAK 1281 CHKINTCODE ENTR PUSH 034EB C1578801 6 BASE 1282 STPV SP,THEPSA save PSA address 034EC C0520000 0 REG 1283 STPVL R0 save the interrupt code 1284 034ED 5C3034E9 0 @ 1285 CMZ @SCCONPTR(R0) need we convert subcode? 034EE FE0234F5 1286 JEQ OKDOKE if not, don't 1287 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 663 (PROCINOUT) F 36 Session ins and outs 1288 1289 * R1 => FCB where interrupt occurred 034EF 60178801 0 6 BASE 1290 LD R0 SP,THEPSA retrieve the session 034F0 DC0035BB 1291 CALL FINDUCE find a UCE 034F1 40520000 0 REG 1292 PARVL R0 pass PSA address 034F2 60440000 1 IMM 1293 LD R1 0 always give a "unit number" 034F3 FA3034F5 0 1294 JZA R0 OKDOKE jump if unit not around for us 034F4 60480080 1 0 ZBM 1295 LD R1 R0,UCEUNIT get the unit number 1296 * \ / 1297 000034F5 1298 OKDOKE LABEL 034F5 5D1F8002 6 STAK 1299 LEAVE POP return 1300 * --- 1301 1302 END CHKINTCODE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 664 (PROCINOUT) F 36 Session ins and outs 1304 1305 ********************************************************************************** 1306 * * 1307 * ELSRCHER. This routine removes an error element * 1308 * corresponding to the specified user interrupt code from the * 1309 * list, if one exists. It does not remove the element if the * 1310 * element is being 'held'. N.B. This does not match up the * 1311 * subcodes, nor does it mess with the VERYBAD bits. Call: * 1312 * * 1313 * * 1314 * LD R0 => user interrupt code * 1315 * CALLNP ELSRCHER * 1316 * * 1317 * Registers Used: R0:R2 * 1318 * Stack Required: 1 * 1319 * 1 + max ( UFREEMEM (0) ) * 1320 * * 1321 ********************************************************************************** 1322 1323 BLOCK ELSRCHER subroutine 1324 ENTRY ELSRCHER 1325 1326 BEGFRAME 1327 ENDFRAME 1328 034F6 DD5F8001 6 STAK 1329 ELSRCHER ENTRNP PUSH 034F7 60800412 2 1330 LD R2 CPPSA get the current PSA pointer 034F8 3896880D 2 2 BASE 1331 LEA R2 R2,PSUERROR => PSA error root word 034F9 5C302AFA 0 @ 1332 CMZ @INTASSOCB(R0) session type error? 034FA FE0234FD 1333 JEQ HAVEROOT jump if so 034FB 60800414 2 1334 LD R2 CPCUPC get current underprocess 034FC 3896880B 2 2 BASE 1335 LEA R2 R2,UPCUERROR => UPC error root word 000034FD 1336 HAVEROOT LABEL 034FD 60489F10 1 2 ZBM 1337 LD R1 R2,UERLINK find head of error element list 034FE 480846A0 0 1 ZBM 1338 RLSRCH R0 R1,UERCODE find element containing specified user error code 034FF FE0C3505 1339 JNE NOSCHLMNT jump if no element of specified type exists 03500 60085F10 0 1 ZBM 1340 LD R0 R1,UERLINK get link to next element 03501 E4089F10 0 2 ZBM 1341 ST R0 R2,UERLINK remove the element that we found 03502 DC002F5D 1342 CALL UFREEMEM dump the error element 03503 41440001 IMM 1343 PARV UERLOG indicate its length 03504 40524000 1 REG 1344 PARVL R1 and address 00003505 1345 NOSCHLMNT LABEL 03505 5D1F8001 6 STAK 1346 LEAVE POP return 1347 * --- 1348 1349 END ELSRCHER subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 665 (PROCINOUT) F 36 Session ins and outs 1351 1352 ********************************************************************************** 1353 * * 1354 * USERTIMINT * 1355 * This routine is called when a user time-interrupt request * 1356 * has expired. Attempt to give him an interrupt. NOTE: He might * 1357 * be running a different program than the one that requested the * 1358 * interrupt. In this case, we do nothing. If he ever restarts * 1359 * the program that requested the interrupt, we will give him the * 1360 * the interrupt at that time. * 1361 * * 1362 * LD R3 => PSA * 1363 * CALLNP USERTIMINT * 1364 * * 1365 * Eats R0:R5. * 1366 * Stack required = 9 * 1367 * 1 + max ( GETDATE (1), GIVEUINT (8), MAPINMEM (3) ) * 1368 * * 1369 ********************************************************************************** 1370 1371 BLOCK USERTIMINT subroutine 1372 ENTRY USERTIMINT 1373 1374 BEGFRAME 1375 ENDFRAME 1376 03506 DD5F8001 6 STAK 1377 USERTIMINT ENTRNP PUSH 03507 6152C000 5 3 REG 1378 LD R5 R3 R5 -> PSA of user 03508 DC0025EB 1379 CALL MAPINMEM map in this guys memory 03509 40534000 5 REG 1380 PARVL R5 pointer to the PSA 0350A 60C94116 3 5 ZBM 1381 LD R3 R5,PSCURRPROC get pointer to current UPC 0350B 5C16C80C 3 BASE 1382 CMZ R3,UPCINTTIME did this guy request an interrupt? 0350C FE023519 1383 JEQ RETURN jump if not 0350D DC404549 1384 CALLNP GETDATE get current time 0350E 1056C80C 1 3 BASE 1385 SUB R1 R3,UPCINTTIME R1 = (current time) - (interrupt time) 0350F FA483519 1 1386 JLTZ R1 RETURN jump if not time yet 03510 DC003457 1387 CALL GIVEUINT else give him an interrupt 03511 41495F12 5 ZBM 1388 PARV R5,PSPROCCB PCB of user 03512 41440001 IMM 1389 PARV 1 value of PCQPARM if waiting (can't) 03513 41440000 IMM 1390 PARV 0 mask of PCQPARM if waiting (can't) 03514 4147FFFF IMM 1391 PARV -1 queue number if waiting (can't) 03515 41420040 IMM 1392 PARV 1*BIT CAIMTIME interrupt mask bit 03516 41440001 IMM 1393 PARV 1 device interrupt enable bit 03517 41440025 IMM 1394 PARV UINTTIMINT interrupt code 03518 40440000 IMM 1395 PARVL 0 interrupt subcode 1396 * \ / 1397 00003519 1398 RETURN LABEL 03519 DC0025EB 1399 CALL MAPINMEM re-map original caller memory lists 0351A 40400412 1400 PARVL CPPSA PSA address if any 0351B 5D1F8001 6 STAK 1401 LEAVE POP return 1402 * --- 1403 1404 END USERTIMINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 666 (PROCINOUT) F 36 Session ins and outs 1406 1407 ********************************************************************************** 1408 * * 1409 * SUSPENDME * 1410 * Routine to suspend the current session and have it * 1411 * restart in the same state as it was in when suspended. * 1412 * LD R2 (optional) * 1413 * CALL SUSPENDME * 1414 * PAR * 1415 * PARV(2) * 1416 * PAR * 1417 * PARL * 1418 * Note that R0, and R1 are chewed on before * 1419 * parameters are passed. All registers except R0 will * 1420 * be restored on restart. * 1421 * Note: This routine does the equivalent of an ION * 1422 * before going to the restart address. This is usually * 1423 * what you want since some resource is being unlocked by * 1424 * the last parameter. * 1425 * * 1426 * There is a problem with page faults occurring while * 1427 * the parameters are being passed. The CMZ near the beginning * 1428 * hopefully fixes the problem, but if it gets you, the * 1429 * problem is that you cannot get a fault with PCONSOLE * 1430 * as your console area. The problem can manifest itself * 1431 * as nearly anything. * 1432 * * 1433 ********************************************************************************** 1434 1435 BLOCK SUSPENDME, SHARESUSP routines 1436 ENTRY SUSPENDME 1437 ENTRY SHARESUSP 1438 1439 BEGFRAME 00178801 6 BASE 1440 PARM BSS 2 shutdown parameter 00178803 6 BASE 1441 LIST BSS 1 scheduler queue pointer 1442 ENDFRAME 1443 0351C DD920000 0 REG 1444 SUSPENDME ENTRS R0 0351D 0CC00000 1445 IOFF turn off the interrupts 0351E 5C17C804 7 BASE 1446 CMZ R7,4 have any page faults 0351F 0184041E IMM 1447 SCR ADR PCONSOLE store away the registers 1448 * and get new CCAR 03520 60400412 1 1449 LD R1 CPPSA get the current PSA pointer 03521 60485F10 1 1 ZBM 1450 LD R1 R1,PSCACHN get the CA chain pointer 03522 E4164809 0 1 BASE 1451 ST R0 R1,CAR7 save the callers R7 from 1452 * this non-standard location 03523 DCD3C000 7 REG 1453 EXPCS R7 go fetch the parameters 03524 D0086041 1 ZBM 1454 INC R1,CAMSR/MSRINTCNT restore int state from before my IOFF 03525 D0086041 1 ZBM 1455 INC R1,CAMSR/MSRINTCNT restore from lock on unlock parameter 03526 C1085F10 1 ZBM 1456 STP R1,CAPC set the restart address 00003527 1457 SHARESUSP LABEL 03527 61840449 6 IMM 1458 LD SP ADR RESSTAK(-ZZ!LEN) get a stack area 03528 F7CC3536 7 1459 JBT R7/STPDUBL DOUBLSTP check for double word parm 03529 C1578801 6 BASE 1460 STPV SP,PARM get the shutdown parameter 0352A EC178802 6 BASE 1461 STZ SP,PARM(1) make second parm word zero for single 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 667 (PROCINOUT) F 36 Session ins and outs 0000352B 1462 DOUBLGOT LABEL 0352B C1178803 6 BASE 1463 STP SP,LIST get the suspend list pointer 0352C C013C000 7 REG 1464 STPL R7 save the lock field pointer 0352D 60D78803 3 6 BASE 1465 LD R3 SP,LIST copy the suspend list pointer 0352E 64C41DAA 3 IMM 1466 CPR R3 ADR SQRUNNABLE is this guy going back to runnable? 0352F FE023538 1467 JEQ DOSHUTRUN jump if so, must make special call 03530 60138000 0 6 REG 1468 LD R0 SP make a copy of the stack pointer 03531 60528000 1 2 REG 1469 LD R1 R2 copy the optional secondary parameter 03532 DC002B58 1470 CALL SHUTDOWN call the suspend queuer 03533 42160801 0 BASE 1471 PAR2L R0,PARM pass the release parameter 03534 D057C400 7 @R 1472 DEC @R7 release the lock 03535 FE0E28B7 1473 JMP DISPATCH go run someone else 1474 * --- 1475 00003536 1476 DOUBLSTP LABEL 03536 C3578801 6 BASE 1477 STPV2 SP,PARM save a double word parm in R1, R2 03537 FE0E352B 1478 JMP DOUBLGOT and re-enter main line 1479 * --- 1480 00003538 1481 DOSHUTRUN LABEL 03538 DC402B88 1482 CALLNP SHUTRUN call to put user back into the runnable queue 03539 D057C400 7 @R 1483 DEC @R7 release the lock 0353A FE0E28B7 1484 JMP DISPATCH go run someone else 1485 * --- 1486 1487 END SUSPENDME, SHARESUSP routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 668 (PROCINOUT) F 36 Session ins and outs 1489 1490 ********************************************************************************** 1491 * * 1492 * SUSPENDCAL. Routine that may be called by an XREQ * 1493 * processor that suspends the caller in the specified queue * 1494 * in such a way that on restart the XREQ would be re-executed. * 1495 * This causes users to be suspended in a "clean" fashion so * 1496 * that timeouts, breaks, and such like don't have to extricate * 1497 * the user from the middle of an XREQ processor to do the * 1498 * interrupt. * 1499 * Call: * 1500 * LD R2 (optional) * 1501 * CALL SUSPENDCAL * 1502 * PARV(2) * 1503 * PAR * 1504 * PARL * 1505 ** --- * 1506 * The routine never returns and the state of the XREQ * 1507 * processor that called is lost. * 1508 * NOTE: The routine destroys R0 and R1 * 1509 * before fetching the parameters. * 1510 * * 1511 ********************************************************************************** 1512 1513 BLOCK SUSPENDCAL, SUSPCALSH routines 1514 ENTRY SUSPENDCAL 1515 ENTRY SUSPCALSH 1516 0353B DD920000 0 REG 1517 SUSPENDCAL ENTRS R0 loose the callers R7 0000353C 1518 SUSPCALSH LABEL 0353C 0CC00000 1519 IOFF 0353D 5C17C803 7 BASE 1520 CMZ R7,3 take page faults now 0353E DC40285A 1521 CALLNP DROPCA drop current console area 0353F DCD3C000 7 REG 1522 EXPCS R7 fetch the parameters 03540 FE0E3527 1523 JMP SHARESUSP share code to suspend 1524 * --- 1525 1526 END SUSPENDCAL, SUSPCALSH routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 669 (PROCINOUT) F 36 Session ins and outs 1528 1529 ********************************************************************************** 1530 * * 1531 * SUSPENDFRQ. Suspend a FREQ. This routine will suspend * 1532 * a FREQ as specified in the request code that was in R0 of the * 1533 * requester. R0 of the requester is examined for XRFLDSUSP * 1534 * and the operations done are: * 1535 * XRFLDSUSP OPERATION * 1536 * --------- --------- * 1537 * 0 The requesting FREQ is suspended with the * 1538 * PC and address space pointing at the * 1539 * requester (see comments on SUSPENDCAL). * 1540 * 1 The requester is supposed to * 1541 * give an error because suspension was not * 1542 * allowed. * 1543 * 2 unused, same as 1 * 1544 * 3 unused, same as 1 * 1545 * * 1546 * Invocation is: * 1547 * LD R2 (optional) * 1548 * CALL SUSPENDFRQ * 1549 * PARV(2) * 1550 * PAR * 1551 * PARL * 1552 * * 1553 * The routine destroys R0 and R1 before accepting * 1554 * the parameters. If the routine returns, R0 thru R2 have * 1555 * been mangled and the lock has NOT been unlocked. * 1556 * Stack required = 1 * 1557 * * 1558 ********************************************************************************** 1559 1560 BLOCK SUSPENDFRQ routine 1561 ENTRY SUSPENDFRQ 1562 1563 BEGFRAME 1564 ENDFRAME 1565 03541 DD9F8001 6 STAK 1566 SUSPENDFRQ ENTRS PUSH 03542 60400412 1 1567 LD R1 CPPSA get the current PSA pointer 03543 60485F11 1 1 ZBM 1568 LD R1 R1,PSCACHNP1 R1 => requesters console area 03544 60485E22 1 1 ZBM 1569 LD R1 R1,CAR0/XRFLDSUSP R1 = suspension control number 03545 5CA23546 1 1570 LDPC SPNDFRQTAB(R1) go to appropriate processing 1571 * --- 1572 00003546 1573 SPNDFRQTAB LABEL 03546 0000353C 1574 VFD ADR SUSPCALSH 0 - suspend the FREQ 03547 0000354A 1575 VFD ADR NOSUSPEND 1 - do not suspend 03548 0000354A 1576 VFD ADR NOSUSPEND 2 - unused 03549 0000354A 1577 VFD ADR NOSUSPEND 3 - unused 1578 1579 ********************************************************************************** 1580 * * 1581 * This request is not to be suspended. * 1582 * We return to our caller with the resource still * 1583 * locked in case he wants to try something funny. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 670 (PROCINOUT) F 36 Session ins and outs 1584 * The user request should just get the error 'could * 1585 * not suspend'. * 1586 * * 1587 ********************************************************************************** 1588 0000354A 1589 NOSUSPEND LABEL 0354A DCD3C000 7 REG 1590 EXPCS R7 pick up the parameters 0354B DCD3C000 7 REG 1591 EXPCS R7 throw away (may be single or double) 0354C C1120000 0 REG 1592 STP R0 throw away queue information 0354D C0120000 0 REG 1593 STPL R0 get address of unlocking item 0354E 5D1F8001 6 STAK 1594 LEAVE POP return to caller 1595 * --- 1596 1597 END SUSPENDFRQ routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 671 (PROCINOUT) F 36 Session ins and outs 1599 1600 ********************************************************************************** 1601 * * 1602 * DQUEONE * 1603 * Resident routine to dequeue one person in the specified * 1604 * queue for the specified reason and set him running. * 1605 * Call: * 1606 * * 1607 * CALL DQUEONE SP => return address stack * 1608 * eats R1 during parameter passing. * 1609 * callers rely on R3 and up * 1610 * PAR * 1611 * PARVL * 1612 * returns with R0 # 0 if someone unqueued * 1613 * and zero if nothing set going. * 1614 * * 1615 * Eats R0:R2. * 1616 * Stack required = 4 * 1617 * 2 + max ( LOCKWAIT (0), SETRUNNING (2) ) * 1618 * * 1619 ********************************************************************************** 1620 1621 BLOCK DQUEONE subroutine 1622 ENTRY DQUEONE 1623 1624 BEGFRAME 00178801 6 BASE 1625 DQUEONET BSS 1 save for R4 1626 ENDFRAME 1627 0354F DD1F8002 6 STAK 1628 DQUEONE ENTR PUSH 03550 C1124000 1 REG 1629 STP R1 save the queue pointer 03551 C0528000 2 REG 1630 STPVL R2 acquire the parameter 03552 E5178801 4 6 BASE 1631 ST R4 SP,DQUEONET save R4 03553 39164811 4 1 BASE 1632 LEA R4 R1,0(NQUEUES) make pointer to queue lock word 1633 PLOCK @R4 call to lock the appropriate SQ 03554 0CC00000 1633 IOFF 03555 D1D70400 4 @R 1633 SETT @R4 03556 FE0C3558 1633 JNE MA(2+DISPW MA 0) 03557 DC40308B 1633 CALLNP LOCKWAIT 03558 60124000 0 1 REG 1634 LD R0 R1 copy the queue pointer 00003559 1635 DQUEONEL LABEL 03559 FA383565 01 1636 RLJZA R0 DQUEONENF advance through list and jump if end 0355A 64960801 2 0 BASE 1637 CPR R2 R0,PCQPARM does the parameter match 0355B FE0C3559 1638 JNE DQUEONEL jump back if not 1639 * \ / 1640 * the one we're looking for is found, delink it from 1641 * the list and set it running. 1642 0355C 60881F10 2 0 ZBM 1643 LD R2 R0,PCQLINK load the pointer out of this element 0355D E4885F10 2 1 ZBM 1644 ST R2 R1,PCQLINK delink the element that we found 1645 PUNLOCK @R4 call to release the SQ 0355E EC170400 4 @R 1645 STZ @R4 0355F 0C800000 1645 ION 03560 61120000 4 0 REG 1646 LD PCB R0 copy this PCB pointer 03561 DC402B99 1647 CALLNP SETRUNNING set this session going 03562 60040001 0 IMM 1648 LD R0 1 return flag indicating someone unqueued 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 672 (PROCINOUT) F 36 Session ins and outs 00003563 1649 DQUEONEXIT LABEL 03563 61178801 4 6 BASE 1650 LD R4 SP,DQUEONET restore R4 03564 5D1F8002 6 STAK 1651 LEAVE POP return 1652 * --- 1653 1654 * The entry was not found in the list - unlock the list 1655 * and just return. 1656 00003565 1657 DQUEONENF LABEL 1658 PUNLOCK @R4 call to release the SQ 03565 EC170400 4 @R 1658 STZ @R4 03566 0C800000 1658 ION 03567 60040000 0 IMM 1659 LD R0 0 return flag indicating no one unqueued 03568 FE0E3563 1660 JMP DQUEONEXIT finish housekeeping 1661 * --- 1662 1663 END DQUEONE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 673 (PROCINOUT) F 36 Session ins and outs 1665 1666 ********************************************************************************** 1667 * * 1668 * ROUST. Routine that puts a user into the runnable * 1669 * queue if he is in either terminal wait, path wait, or * 1670 * lock wait. This is used when trying to evict a session * 1671 * or get a programs attention (terminal break). * 1672 * Call: * 1673 * LD R3 => PCB * 1674 * CALLNP ROUST * 1675 * * 1676 * Eats R0:R3. * 1677 * Stack required = 4 * 1678 * 1 + max ( DQUETHIS (3) ) * 1679 * * 1680 ********************************************************************************** 1681 1682 BLOCK ROUST subroutine 1683 ENTRY ROUST 1684 ENTRY ROUSTQUES (bits for roustable queues) 1685 1686 BEGFRAME 1687 ENDFRAME 1688 03569 DD5F8001 6 STAK 1689 ROUST ENTRNP PUSH 0000356A 1690 ROUSTAGAIN LABEL 0356A 6008D260 0 3 ZBM 1691 LD R0 R3,PCQUEUE get the queue this fellow is in 0356B 5C303572 0 @ 1692 CMZ @ROUSTQUES(R0) do we roust from this queue? 0356C FE023570 1693 JEQ ROUSTLEAVE jump if not to touch 0356D DC003573 1694 CALL DQUETHIS set this fellow running 0356E 40201DA9 0 1695 PARL SQBEGIN(R0) pass head of assumed queue 0356F FA02356A 0 1696 JEQZ R0 ROUSTAGAIN if he moved, try to roust again 00003570 1697 ROUSTLEAVE LABEL 03570 5D1F8001 6 STAK 1698 LEAVE POP return 1699 * --- 1700 01700000 ABS 1701 ROUSTQUE1 EQU (1*BIT NQMSGWAIT)+(1*BIT NQPATHWAIT)+(1*BIT NQLOCKWAIT)+(1*BIT NQUNITWAIT) 00828000 ABS 1702 ROUSTQUE2 EQU (1*BIT NQTIMEWAIT)+(1*BIT NQTROUBLE)+(1*BIT NQFILEWAIT) 000C0000 ABS 1703 ROUSTQUE3 EQU (1*BIT NQTERMWAIT)+(1*BIT NQTRMOWAIT) 03571 01FE8000 1704 ROUSTQUET VFD ROUSTQUE1+ROUSTQUE2+ROUSTQUE3 03572 00483571 1705 ROUSTQUES PTR ROUSTQUET/BIT 0 1706 1707 END ROUST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 674 (PROCINOUT) F 36 Session ins and outs 1709 1710 ********************************************************************************** 1711 * * 1712 * DQUETHIS. Routine to set running a given session. * 1713 * Call: * 1714 * LD R3 => PCB * 1715 * CALL DQUETHIS * 1716 * PARL * 1717 * Returns R0=0 if nothing dequeued and non-zero if * 1718 * something dequeued. * 1719 * * 1720 * Eats R0:R2. * 1721 * Stack required = 3 * 1722 * 1 + max ( LOCKWAIT (0), SETRUNNING (2) ) * 1723 * * 1724 ********************************************************************************** 1725 1726 BLOCK DQUETHIS subroutine 1727 ENTRY DQUETHIS 1728 1729 BEGFRAME 1730 ENDFRAME 1731 03573 DD1F8001 6 STAK 1732 DQUETHIS ENTR PUSH 03574 C0128000 2 REG 1733 STPL R2 save the queue 03575 38568811 1 2 BASE 1734 LEA R1 R2,0(NQUEUES) R1 => queue lock word 1735 PLOCK @R1 call to lock the appropriate scheduler queue 03576 0CC00000 1735 IOFF 03577 D1D64400 1 @R 1735 SETT @R1 03578 FE0C357A 1735 JNE MA(2+DISPW MA 0) 03579 DC40308B 1735 CALLNP LOCKWAIT 1736 0357A 3CC89F10 3 2 ZBM 1737 LSRCH R3 R2,PCQLINK get the pointer to the one before 0357B FE0C3585 1738 JNE NOONE2Q jump if he's not there 0357C 6008DF10 0 3 ZBM 1739 LD R0 R3,PCQLINK get the link to the rest of the list 0357D E4089F10 0 2 ZBM 1740 ST R0 R2,PCQLINK remove us from the list 1741 PUNLOCK @R1 release the SQ 0357E EC164400 1 @R 1741 STZ @R1 0357F 0C800000 1741 ION 03580 E0D30000 3 4 REG 1742 EXCH R3 R4 move around some registers 03581 DC402B99 1743 CALLNP SETRUNNING set him into the runnable queue 03582 E0D30000 3 4 REG 1744 EXCH R3 R4 restore these registers 03583 60040001 0 IMM 1745 LD R0 1 indicate success 03584 5D1F8001 6 STAK 1746 LEAVE POP return 1747 * --- 1748 1749 * No one to dequeue 00003585 1750 NOONE2Q LABEL 1751 PUNLOCK @R1 release the SQ 03585 EC164400 1 @R 1751 STZ @R1 03586 0C800000 1751 ION 03587 60040000 0 IMM 1752 LD R0 0 indicate failure 03588 5D1F8001 6 STAK 1753 LEAVE POP return 1754 * --- 1755 1756 END DQUETHIS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 675 (PROCINOUT) F 36 Session ins and outs 1758 1759 ********************************************************************************** 1760 * * 1761 * UERRSET * 1762 * Routine to set an error on a user. Will put error onto * 1763 * the user's error list and return. It is assumed that the * 1764 * PSA user memory is mapped in if the error is UPC type. * 1765 * Frees the element if the error code is the same as that * 1766 * of an existing element. N.B. The subcodes are not checked, * 1767 * so a conflict may arise when the would-be duplicates are * 1768 * errors from different units. That is, an error from one * 1769 * unit being "held off" keeps any other units from posting * 1770 * the same error. Solution is to match subcodes before * 1771 * deciding ALREADYERR, but is this really desired? * 1772 * * 1773 * Call: * 1774 * * 1775 * SP = stack pointer * 1776 * CPPSA user memory mapped * 1777 * LD R2 * 1778 * LD R3 * 1779 * CALLNP UERRSET * 1780 * * 1781 * Eats R0:R3 * 1782 * Stack required = 1 * 1783 * 1 + max ( LOCKWAIT (0), UFREEMEM (0), UGETMEM (0) ) * 1784 * * 1785 ********************************************************************************** 1786 1787 BLOCK UERRSET and UERRSETY subroutines 1788 ENTRY UERRSET 1789 ENTRY UERRSETY 1790 1791 BEGFRAME 1792 ENDFRAME 1793 03589 DD5F8001 6 STAK 1794 UERRSET ENTRNP PUSH 0358A DC002ED0 1795 CALL UGETMEM get a chunk for error element 0358B 40440001 IMM 1796 PARVL UERLOG size 0358C E48800D0 2 0 ZBM 1797 ST R2 R0,UERCODEZ place code in block 0358D 60800412 2 1798 LD R2 CPPSA get pointer to the PSA 1799 * \ / 1800 1801 * start shared code 0000358E 1802 UERRSRTSHR LABEL entry from UERRSETY 0358E E4D60801 3 0 BASE 1803 ST R3 R0,UERPARAM place param in 0358F E4881F10 2 0 ZBM 1804 ST R2 R0,UERLINK save PSA for later 03590 60D20000 3 0 REG 1805 LD R3 R0 copy the block pointer 1806 1807 * determine correct list for error 1808 PLOCK R2,PSLOCK get access to the PSA 03591 0CC00000 1808 IOFF 03592 D1D6880C 2 BASE 1808 SETT R2,PSLOCK 03593 FE0C3595 1808 JNE MA(2+DISPW MA 0) 03594 DC40308B 1808 CALLNP LOCKWAIT 03595 6008C6A0 0 3 ZBM 1809 LD R0 R3,UERCODE get code (ignore flags) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 676 (PROCINOUT) F 36 Session ins and outs 03596 5C302AFA 0 @ 1810 CMZ @INTASSOCB(R0) PSA or UPC error? 03597 FE0235AC 1811 JEQ USEPSA jump if PSA error 03598 64800413 2 1812 CPR R2 CMAPPSA make safety check 03599 FE02359B 1813 JEQ PSAOK jump if correct mapping 0359A 001300D2 1814 HALT HALTS00D2 need to map R2 0000359B 1815 PSAOK LABEL 0359B 60888116 2 2 ZBM 1816 LD R2 R2,PSCURRPROC error is underprocess type 0359C 3896880B 2 2 BASE 1817 LEA R2 R2,UPCUERROR => UPC error root word 1818 * \ / 1819 1820 * R2 => correct list root word, is error a duplicate? 0000359D 1821 GOTROOT LABEL 0359D 6008C0D0 0 3 ZBM 1822 LD R0 R3,UERCODEZ code + flags 0359E F62835A3 0 1823 JBT R0/VERYBADB DOANYWAY horrific errors always go on 0359F 780403FF 0 IMM 1824 AND R0 (ONEBITS*CODEPART)/CODEPART take off extras 035A0 60489F10 1 2 ZBM 1825 LD R1 R2,UERLINK => first error element in list 035A1 3C0846A0 0 1 ZBM 1826 LSRCH R0 R1,UERCODE search for same error (w/o flags) 035A2 FE0235AE 1827 JEQ ALREADYERR don't duplicate normal errors 1828 * \ / 1829 1830 * Hey! We can do it! Put error on end of the list. 1831 * R2 => list root word, R3 => new error, and R3,UERLINK => PSA 000035A3 1832 DOANYWAY LABEL 035A3 6008C210 0 3 ZBM 1833 LD R0 R3,UERVERYBAD fetch the bit indicating serious error 035A4 FC089C10 0 2 ZBM 1834 IORM R0 R2,0/RTVERYBADB set in the root 035A5 60040000 0 IMM 1835 LD R0 0 search target 035A6 3C089F10 0 2 ZBM 1836 LSRCH R0 R2,UERLINK find nil link 035A7 E008DF10 0 3 ZBM 1837 EXCH R0 R3,UERLINK append to ours (R0 gets errant's PSA) 035A8 E4C89F10 3 2 ZBM 1838 ST R3 R2,UERLINK make new element the list end 1839 PUNLOCK R0,PSLOCK release the PSA 035A9 EC16080C 0 BASE 1839 STZ R0,PSLOCK 035AA 0C800000 1839 ION 000035AB 1840 RETURN LABEL 035AB 5D1F8001 6 STAK 1841 LEAVE POP return 1842 * --- 1843 1844 * error is session type 000035AC 1845 USEPSA LABEL 035AC 3896880D 2 2 BASE 1846 LEA R2 R2,PSUERROR => PSA error root word 035AD FE0E359D 1847 JMP GOTROOT get back into it 1848 * --- 1849 1850 * error is duplicate, don't use it 000035AE 1851 ALREADYERR LABEL return free storage 035AE 6088DF10 2 3 ZBM 1852 LD R2 R3,UERLINK => errant PSA 1853 PUNLOCK R2,PSLOCK release the PSA 035AF EC16880C 2 BASE 1853 STZ R2,PSLOCK 035B0 0C800000 1853 ION 035B1 DC002F5D 1854 CALL UFREEMEM release the element 035B2 41440001 IMM 1855 PARV UERLOG indicate elements length 035B3 4052C000 3 REG 1856 PARVL R3 and location 035B4 FE0E35AB 1857 JMP RETURN make joint exit 1858 * --- 1859 1860 ********************************************************************************** 1861 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 677 (PROCINOUT) F 36 Session ins and outs 1862 * Routine same as above except that R5 points to the * 1863 * PSA of the session that gets the error. It is assumed * 1864 * that the PSA user memory is mapped in if the error is * 1865 * a UPC type. Call: * 1866 * * 1867 * SP = stack pointer * 1868 * R5 PSA user memory mapped * 1869 * LD R5 * 1870 * LD R2 * 1871 * LD R3 * 1872 * CALLNP UERRSETY * 1873 * * 1874 * Eats R0:R3 * 1875 * Stack required = 1, See UERRSET. * 1876 * * 1877 ********************************************************************************** 1878 035B5 DD5F8001 6 STAK 1879 UERRSETY ENTRNP PUSH 035B6 DC002ED0 1880 CALL UGETMEM get an error block 035B7 40440001 IMM 1881 PARVL UERLOG this long 035B8 E48800D0 2 0 ZBM 1882 ST R2 R0,UERCODEZ place parameters into the error block 035B9 60934000 2 5 REG 1883 LD R2 R5 make a copy of the PSA pointer 035BA FE0E358E 1884 JMP UERRSRTSHR share the queueing code 1885 * --- 1886 1887 END UERRSET and UERRSETY subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 678 (PROCINOUT) F 36 Session ins and outs 1889 1890 ********************************************************************************** 1891 * * 1892 * FINDUCE. Routine to take an FCB pointer and return a * 1893 * UCE that corresponds. It checks the local unit list of the * 1894 * current underprocess and the global list of the given PSA. * 1895 * Note that equivalence units are implemented by having the * 1896 * UCEs point to a common FCB. Since the unit number is pulled * 1897 * from the first UCE which points to the specified FCB, this * 1898 * means that the number will be that of the most recently opened * 1899 * (and still existing) equivalence unit. * 1900 * Call: * 1901 * FCB ptr in R1 * 1902 * CALL FINDUCE * 1903 * PARVL * 1904 * * 1905 * * 1906 * Sets R0. * 1907 * Stack required = 2 * 1908 * * 1909 ********************************************************************************** 1910 1911 BLOCK FINDUCE 1912 1913 BEGFRAME 00178801 6 BASE 1914 PSADR BSS 1 passed PSA address 1915 ENDFRAME 1916 1917 ENTRY FINDUCE to get unit number 1918 035BB DD1F8002 6 STAK 1919 FINDUCE ENTR PUSH 035BC C0578801 6 BASE 1920 STPVL SP,PSADR remember the PSA! 035BD 60080116 0 0 ZBM 1921 LD R0 R0,PSCURRPROC get the current underprogram 035BE 60081F15 0 0 ZBM 1922 LD R0 R0,UPCUNITS get local unit list pointer 035BF 3C481F11 1 0 ZBM 1923 LSRCH R1 R0,UCEFCB look for the right unit 035C0 FE0235C4 1924 JEQ GOTUNIT jump if found in local list 035C1 60178801 0 6 BASE 1925 LD R0 SP,PSADR get the PSA address 035C2 60082316 0 0 ZBM 1926 LD R0 R0,PSUNITS get global unit list pointer 035C3 3C481F11 1 0 ZBM 1927 LSRCH R1 R0,UCEFCB look for the right unit 000035C4 1928 GOTUNIT LABEL 035C4 5D1F8002 6 STAK 1929 LEAVE POP return, UCE address in R0 1930 * --- 1931 1932 END FINDUCE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 679 (PROCINOUT) F 36 Session ins and outs 1934 1935 ********************************************************************************** 1936 * * 1937 * FINDTERMCB. Subroutine to return the terminal control block of * 1938 * the absolute IO terminal (if it exists) for the current session. * 1939 * * 1940 * Call: CALL FINDTERMCB * 1941 * PARVL * 1942 * TCB or 0> * 1943 * * 1944 * Eats: R0, sets R1 * 1945 * Stack Usage: 1 * 1946 * * 1947 ********************************************************************************** 1948 1949 BLOCK FINDTERMCB subroutine 1950 ENTRY FINDTERMCB 1951 1952 BEGFRAME 1953 ENDFRAME 1954 035C5 DD1F8001 6 STAK 1955 FINDTERMCB ENTR PUSH 035C6 C0520000 0 REG 1956 STPVL R0 get the PSA address 035C7 60081F17 0 0 ZBM 1957 LD R0 R0,PSFCBLIST R0 => logical unit list 035C8 60440001 1 IMM 1958 LD R1 1 we want absolute unit 035C9 3C482015 1 0 ZBM 1959 LSRCH R1 R0,FCABSIO find one 035CA FE0C35D0 1960 JNE NOTHERE sys proc or vanisher 035CB 60440007 1 IMM 1961 LD R1 HTYPETERM get code for terminal units 035CC 64482665 1 0 ZBM 1962 CPR R1 R0,FCHTYPE is that what we have? 035CD FE0C35D0 1963 JNE NOTHERE jump if not terminal (batch?) 035CE 60481F16 1 0 ZBM 1964 LD R1 R0,FCDCBPTR TCB or 0 000035CF 1965 FTCBEXIT LABEL 035CF 5D1F8001 6 STAK 1966 LEAVE POP goodbye 1967 * --- 1968 000035D0 1969 NOTHERE LABEL 035D0 60440000 1 IMM 1970 LD R1 0 say no find 035D1 FE0E35CF 1971 JMP FTCBEXIT say goodbye 1972 * --- 1973 1974 END FINDTERMCB subroutine 1975 1976 1977 END goodies to move sessions around 62 INPUT PSACOMEGO PSA creaters and destroyers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 680 (PSACOMEGO) F 37 Session makers and breakers 3 4 PSACOMEGO BLOCK PSA Makers and Breakers 5 6 ENTRY BLDPROCESS create a user session 7 ENTRY SETINITRUN setup created session to initial run 8 ENTRY BLKLIMCHK check for free storsage before session creation 9 ENTRY CREATEUCE create an initial UCE 10 11 ********************************************************************************** 12 * * 13 * BLDPROCESS. * 14 * Routine to create a virgin PSA. It is created zeroed except: * 15 * - PCB is pointed to and PCB points back * 16 * - a console area is added * 17 * - the console area is given the MSR and PC as passed * 18 * - the user limit block pointed to is !!!!!!!!!!!!.!!!!!! * 19 * - User free storage list are initialized. * 20 * The PSA is initialized first, then the PCB is created. * 21 * Some of the reasons for the creation order are: * 22 * 1) The PSA must be initialized before a PCB may point * 23 * to it. Otherwise, routines searching the PCB list * 24 * looking for a PSA meeting certain requirements may * 25 * use garbage pointers, etc. * 26 * 2) Several fields in the PCB may not be changed except * 27 * by read-modify-write operations because they share * 28 * a word with a locked field. PCPSADRS crosses a * 29 * word boundary, so it may not be updated while the * 30 * PCB is in the PCB list. * 31 * 3) The session number must be calculated and the PCB * 32 * inserted into the list while the PCB list is locked. * 33 * * 34 * CALL BLDPROCESS * 35 * PARV MSR bits for new session * 36 * PARV2 * 37 * PARV initial PC * 38 * PARVL * 39 * returns: R3 => new PSA (mapped in) * 40 * R4 => PCB associated with PSA * 41 * !!!! User virtual memory mapped in for NEW PSA !!!! * 42 * note that registers R0:R4 are mangled before the * 43 * parameters are passed. * 44 * * 45 * Eats R0:R2. * 46 * Stack required = 2 * 47 * 1 + max ( GETDATE (1), GETMEMPAGE (1), LOCKLIST (1), * 48 * SGETMEM (0), UNLOCKLIST (1), UPCGETMEM (0), * 49 * ZEROIT (1) ) * 50 * * 51 ********************************************************************************** 52 53 BLOCK BLDPROCESS subroutine 54 ENTRY BLDPROCESS 55 56 BEGFRAME 57 ENDFRAME 58 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 681 (PSACOMEGO) F 37 Session makers and breakers 035D2 DD9F8001 6 STAK 59 BLDPROCESS ENTRS PUSH 035D3 DC002ED0 60 CALL SGETMEM create the PSA 035D4 40440005 IMM 61 PARVL PSLOG 035D5 E412C000 0 3 REG 62 ST R0 R3 63 * \ / 64 65 ********************************************************************************** 66 * * 67 * The PCB may not point to the PSA until the PSA has been * 68 * initialized. This is because of session information * 69 * getting, etc. Also note that we are running with interrupts * 70 * off until the users free storage and associated pointers have * 71 * been initialized. * 72 * * 73 ********************************************************************************** 74 75 * \ / 035D6 DC003090 76 CALL ZEROIT initialize PSA 035D7 4116C800 3 BASE 77 PAR R3,0 address of new PSA 035D8 40440020 IMM 78 PARVL 2 POWER PSLOG length to zero 035D9 0CC00000 79 IOFF no interrupts allowed until finished 035DA E4C00458 3 80 ST R3 MEMVAR1 don't lose pointer to the PSA 035DB DC003002 81 CALL GETMEMPAGE get a page for the free memory lists 035DC 4052C000 3 REG 82 PARVL R3 pointer to newly created PSA 83 84 * This check is for debugging purposes only and may be removed 035DD 604A1C80 1 0 CBM 85 LD R1 R0/PAGEFIELD get the virtual page number 035DE 7C440080 1 IMM 86 IOR R1 MONPF convert to monitor page number 035DF 644400FC 1 IMM 87 CPR R1 PNUSERMEM if not first user virtual page, something is wrong 035E0 FE0235E2 88 JEQ GOODPN jump if page number is satisfactory 035E1 00130071 89 HALT HALTS0071 user memory list on wrong virtual page 90 * --- 91 000035E2 92 GOODPN LABEL 035E2 60400458 1 93 LD R1 MEMVAR1 get the PSA pointer back 035E3 E441F00E 1 94 ST R1 UMEMPSA indicate owner 035E4 60440009 1 IMM 95 LD R1 MEMLISTMAX-1 need to initialize all pointers 035E5 60802576 2 96 LD R2 BIT07 this is the initial value 000035E6 97 INITLOOP LABEL 035E6 E4A3F000 2 1 98 ST R2 USERMEM(R1) zap the usermem location 035E7 FA6635E6 1 99 JDR R1 INITLOOP back for more if not done 100 * \ / 101 035E8 18040400 0 IMM 102 ADD R0 WPP start at the end of the page 035E9 60440005 1 IMM 103 LD R1 ((WPP LOG 2)-(16 LOG 2))-1 initialize our counter 000035EA 104 IMEMLOOP LABEL 035EA 10222562 0 1 105 SUB R0 BITTAB(R1)(16 LOG 2) calculate available address 035EB 60A3F004 2 1 106 LD R2 USERMEM(R1)(16 LOG 2) get the current pointer there 035EC E423F004 0 1 107 ST R0 USERMEM(R1)(16 LOG 2) put it in the free memory lists 035ED E4960800 2 0 BASE 108 ST R2 R0,0 make new forward pointer 035EE FA6635EA 1 109 JDR R1 IMEMLOOP back up until we finish 110 * \ / 111 112 * Initialize UMEMXTRA from USERMEM(XALOG). Halt if we can't. 035EF 6041F007 1 113 LD R1 USERMEM(XALOG) get a piece of memory 035F0 FA7235F2 1 114 JNZA R1 HAVEXMEM jump if some available 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 682 (PSACOMEGO) F 37 Session makers and breakers 115 * \ / 116 035F1 00130072 117 HALT HALTS0072 unsable to acquire emergency user virtual memory 118 * --- 119 000035F2 120 HAVEXMEM LABEL 035F2 60002576 0 121 LD R0 BIT07 get empty link indicator 035F3 E0164800 0 1 BASE 122 EXCH R0 R1,0 get and empty forward link 035F4 E401F007 0 123 ST R0 USERMEM(XALOG) put remaining list back on 035F5 E441F00D 1 124 ST R1 UMEMXTRA put reserve area in special spot 125 035F6 60C00458 3 126 LD R3 MEMVAR1 restore pointer to the PSA 035F7 0C800000 127 ION that is all we need 035F8 DC002ED0 128 CALL SGETMEM get a console area 035F9 40440004 IMM 129 PARVL CALOG 035FA E408DF10 0 3 ZBM 130 ST R0 R3,PSCACHN 035FB DC003090 131 CALL ZEROIT initialize registers 035FC 41160800 0 BASE 132 PAR R0,0 pointer to console area 035FD 40440010 IMM 133 PARVL 2 POWER CALOG length to zero 134 035FE DC002F0A 135 CALL UPCGETMEM get a UPC block 035FF 40440005 IMM 136 PARVL UPCLOG indicate its length 03600 E408C116 0 3 ZBM 137 ST R0 R3,PSCURRPROC it is the current one 03601 E408DF15 0 3 ZBM 138 ST R0 R3,PSPROCLIST and the whole list 03602 E4130000 0 4 REG 139 ST R0 R4 save UPC pointer 03603 DC003090 140 CALL ZEROIT all zeros for safety 03604 41160800 0 BASE 141 PAR R0,0 indicate the address 03605 40440020 IMM 142 PARVL 2 POWER UPCLOG and size 143 03606 DCD3C000 7 REG 144 EXPCS R7 pick up parameters 03607 6088DF10 2 3 ZBM 145 LD R2 R3,PSCACHN 03608 E4891F12 2 4 ZBM 146 ST R2 R4,UPCCONSOLE save CA address in UPC 03609 C1568801 2 BASE 147 STPV R2,CAMSR set initial MSR 0360A C3570809 4 BASE 148 STPV2 R4,UPCPROCNM put program name into block 0360B C1489F10 2 ZBM 149 STPV R2,CAPC store initial PC 0360C C0528000 2 REG 150 STPVL R2 save system/user session flag 151 0360D 60001EAE 0 152 LD R0 SYSTEMULB 0360E E408DF13 0 3 ZBM 153 ST R0 R3,PSUSERLIMP use system limit area 0360F E408DF14 0 3 ZBM 154 ST R0 R3,PSDFLTDIR set the default dir info 03610 E4091F13 0 4 ZBM 155 ST R0 R4,UPCPRIVULB set the privileges 03611 6004000F 0 IMM 156 LD R0 FSPRIVNOT no access to system ULB 03612 E408C044 0 3 ZBM 157 ST R0 R3,PSDDIRPRIV aliased to 03613 600403E0 0 IMM 158 LD R0 UPDFLTREST get default restrictions 03614 E40900F0 0 4 ZBM 159 ST R0 R4,UPCPRIV set initial restrictions 03615 BC001D12 0 160 INCL R0 PROCSERNM get a new process serial number 03616 E4091371 0 4 ZBM 161 ST R0 R4,UPCSERNM and brand this UPC 03617 DC404549 162 CALLNP GETDATE get the current time 03618 E616C815 013 BASE 163 ST2 R0 R3,PSHELDATE save to keep port info legible 03619 600403E8 0 IMM 164 LD R0 1*1000 give him some time to get started 0361A E416C811 0 3 BASE 165 ST R0 R3,PSTIMLIM set into time limit word 0361B DC002ED0 166 CALL SGETMEM get a PCB for this session 0361C 40440003 IMM 167 PARVL PCBLOG 0361D E4130000 0 4 REG 168 ST R0 PCB 0361E DC003090 169 CALL ZEROIT initialize new PCB 0361F 41170800 4 BASE 170 PAR PCB,0 pointer to new PCB 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 683 (PSACOMEGO) F 37 Session makers and breakers 03620 40440008 IMM 171 PARVL 2 POWER PCBLOG length to zero 03621 E4C91F13 3 4 ZBM 172 ST R3 PCB,PCPSADRS now make PCB point to PSA 03622 E508DF12 4 3 ZBM 173 ST PCB R3,PSPROCCB store PCB pointer in PSA 03623 E4891813 2 4 ZBM 174 ST R2 PCB,PCSYSPROC indicate if system session 175 03624 DC003096 176 CALL LOCKLIST get access to PCB list 03625 40001EB2 177 PARL PCNTLLOCK 178 179 * search array for session number 180 * finds the lowest session number NOT in use 03626 70440010 1 IMM 181 LDN R1 PCNUMARRSZ load negative of array size 00003627 182 FINDSESSNM LABEL 03627 5C621EC4 1 183 HIB PCNUMARRAY(PCNUMARRSZ)(R1) check this word 03628 F234362B 0 184 JBF R0/BIT 26 THISWORD jump if a one bit found 03629 FA603627 1 185 IRJ R1 FINDSESSNM else, try next one 186 * \ / 187 188 * the words were all zero 0362A 00130070 189 HALT HALTS0070 no session numbers available 190 * --- 191 192 * we found a perfectly good session number 0000362B 193 THISWORD LABEL 0362B E44A2E40 1 0 CBM 194 ST R1 R0/BITS (27-(PCNUMARRSZ LOG 2)):26 add in word position 0362C EC301EB3 0 @ 195 STZ @PPCNUMARR(R0) say # is no longer available 0362D E40900C3 0 4 ZBM 196 ST R0 PCB,PCPROCNUM place new number in control block 0362E 60401EB1 1 197 LD R1 PCONTROL get first PCB in list 0362F E4491F14 1 4 ZBM 198 ST R1 PCB,PCNXTCB link list after us, too 03630 E5001EB1 4 199 ST PCB PCONTROL make us the new head 03631 D0001EB0 200 INC PCCOUNT indicate another session running 03632 DC0030A4 201 CALL UNLOCKLIST release grip on list 03633 40001EB2 202 PARL PCNTLLOCK 03634 5D1F8001 6 STAK 203 LEAVE POP return 204 * --- 205 206 END BLDPROCESS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 684 (PSACOMEGO) F 37 Session makers and breakers 208 209 ********************************************************************************** 210 * * 211 * CREATEUCE creates a new UCE element and initializes some of the * 212 * new element's fields. The unit number is set to the specified * 213 * value, the FCB address is set to the current FCB. * 214 * Call: * 215 * CALL CREATEUCE * 216 * PARV * 217 * PARVL * 218 * * 219 * Eats R1, returns R0 => new UCE. * 220 * Stack required = 2 * 221 * 2 + UCGETMEM (0) * 222 * * 223 ********************************************************************************** 224 225 BLOCK CREATEUCE subroutine 226 ENTRY CREATEUCE 227 228 BEGFRAME 00178801 6 BASE 229 CRUTEMP BSS 1 00098081 6 ZBM 230 UNO EQU CRUTEMP/CH0 00099F11 6 ZBM 231 FCBADDR EQU CRUTEMP/FLDADRS 232 ENDFRAME 233 03635 DD1F8002 6 STAK 234 CREATEUCE ENTR PUSH 03636 C1498081 6 ZBM 235 STPV SP,UNO save unit number 03637 C0499F11 6 ZBM 236 STPVL SP,FCBADDR save FCB address 03638 DC002F0A 237 CALL UCGETMEM get a chunk of memory 03639 40440001 IMM 238 PARVL UCELOG right size for UCE 0363A EE160800 0 BASE 239 STZ2 R0,0 zero the new thing 0363B 60498081 1 6 ZBM 240 LD R1 SP,UNO get the passed unit number 0363C E4480080 1 0 ZBM 241 ST R1 R0,UCEUNIT set unit number into UCE 0363D 60499F11 1 6 ZBM 242 LD R1 SP,FCBADDR get back the FCB address 0363E E4481F11 1 0 ZBM 243 ST R1 R0,UCEFCB associate FCB with UCE 0363F 5D1F8002 6 STAK 244 LEAVE POP return to caller 245 * --- 246 247 END CREATEUCE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 685 (PSACOMEGO) F 37 Session makers and breakers 249 250 ********************************************************************************** 251 * * 252 * SETINITRUN. Routine that adds an initial entry to * 253 * the PSA so that it will run control mode with initial * 254 * entry. * 255 * Call: * 256 * LD R3 => new PSA * 257 * CALL SETINITRUN * 258 * PARVL control mode entry value * 259 * * 260 * Eats R0:R2. * 261 * Stack required = 1 * 262 * 1 + max ( SGETMEM (0) ) * 263 * * 264 ********************************************************************************** 265 266 BLOCK SETINITRUN subroutine 267 ENTRY SETINITRUN 268 269 BEGFRAME 270 ENDFRAME 271 03640 DD1F8001 6 STAK 272 SETINITRUN ENTR PUSH 03641 C0528000 2 REG 273 STPVL R2 R2 = entry code 03642 DC002ED0 274 CALL SGETMEM get the error block 03643 40440001 IMM 275 PARVL UERLOG indicate length for UER block 03644 EE160800 0 BASE 276 STZ2 R0,0 clean out the block 03645 6044007F 1 IMM 277 LD R1 UINTLOGIN login code 03646 E44806A0 1 0 ZBM 278 ST R1 R0,UERCODE error code sez initial entry 03647 E4960801 2 0 BASE 279 ST R2 R0,UERPARAM param sez how to set up 03648 E408DF1D 0 3 ZBM 280 ST R0 R3,PSUERROR/FLDADRS add to PSA 03649 5D1F8001 6 STAK 281 LEAVE POP 282 * --- 283 284 END SETINITRUN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 686 (PSACOMEGO) F 37 Session makers and breakers 286 287 ********************************************************************************** 288 * * 289 * BLKLIMCHK. When Control Mode is initially entered it * 290 * most definitely requests some swapping pages. This routine * 291 * checks whether there seems to be enough free disk blocks * 292 * for Control Mode to proceed normally through the logon. * 293 * The threshold was chosen as the sum of the user swapping * 294 * threshold in GETFREEBLK (GFBSWAP=64) and a rough guess * 295 * of what CM itself needs. This ensures that at least a * 296 * minimum of user activity can occur. * 297 * * 298 * Call: LD ULB * 299 * CALLNP BLKLIMCHK * 300 * ST R0 * 301 * * 302 * Eats R0:R1. * 303 * Stack required = 1 * 304 * * 305 ********************************************************************************** 306 307 BLOCK BLKLIMCHK subroutine 308 ENTRY BLKLIMCHK 309 310 BEGFRAME 311 ENDFRAME 312 0364A DD5F8001 6 STAK 313 BLKLIMCHK ENTRNP PUSH 0364B 60090081 0 4 ZBM 314 LD R0 ULB,ULDRIVE drive where this account resides 0364C 60201F22 0 0 315 LD R0 VOLNTABLE(R0) get pointer to VOLN element 0364D 6056081C 1 0 BASE 316 LD R1 R0,VOLNFREBLK number of free blocks on this volume 0364E 1856081A 1 0 BASE 317 ADD R1 R0,VOLNFRECNT add in count of resident blocks 0364F 60040000 0 IMM 318 LD R0 0 assume no error is happening 03650 64440064 1 IMM 319 CPR R1 MINBLKLIM compare count against the minimum 03651 FE063653 320 JGE BLCEXIT jump if everything checks out 03652 6004009D 0 IMM 321 LD R0 XREQERNFSV no free storage on volume 00003653 322 BLCEXIT LABEL 03653 5D1F8001 6 STAK 323 LEAVE POP return 324 * --- 325 00000064 ABS 326 MINBLKLIM EQU 100 threshold minimum free block count 327 328 END BLKLIMCHK subroutine 329 330 331 END PSACOMEGO PSA Makers and Breakers 63 INPUT GETPUTADT free disk managers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 687 (GETPUTADT) F 38 Disk Free Space Managers 3 4 GETPUTADTB BLOCK routines that get and put disk blocks 5 6 ENTRY GETFREEBLK get a free disk block 7 ENTRY PUTFREEBLK return a free block 8 ENTRY GPREADSEC read in the security block 9 ENTRY GPWRITSEC write out the security block 10 ENTRY REBUILDADT initialize or rebuild the ADT structures 11 12 ********************************************************************************** 13 * * 14 * ADT Routines * 15 * The following routines are a nightmare of code that * 16 * performs the, on the surface, simple operation of fetching * 17 * and returning free blocks on volumes. These routines run * 18 * with the I/O interrupts disabled, possibly queueing the * 19 * calling process, and using WNDO3 to access the disk. * 20 * * 21 * The lock "VOLNFBZY" controls the major critical region * 22 * consisting of assorted flags and counters and a resident * 23 * list of free blocks for that volume. This critical region * 24 * is entered/exited with PLOCK/PUNLOCK and runs with the * 25 * interrupts off (of course). Most calls to get or put * 26 * blocks will simply enter this region and remove or enter * 27 * blocks in the list. * 28 * * 29 * If the resident list has too few or too many entries, * 30 * then the major part of the code is entered. The lock * 31 * "VOLNADTF" controls its own "virtual" critical region. * 32 * This "virtual" critical region may be run with the * 33 * interrupts on and may get page faults. To enter or leave * 34 * this inside region the outside region must be closed but * 35 * once inside the inner region the outside region may be * 36 * opened. This code twiddles with the disk ADT ("Available * 37 * Disk Table") to either increase or decrease the number of * 38 * resident blocks. There are VOLFREEN resident block * 39 * addresses possible. If there are too many blocks resident * 40 * then the list is emptied until there are only VOLNFREEN/2- * 41 * VOLNFREDSP blocks resident (i.e., it is assumed the current * 42 * tendency is to free blocks). If there are too few blocks * 43 * resident then the list is filled until there are VOLNFREEN * 44 * /2+VOLNFREDSP blocks resident (i.e., it is assumed the * 45 * current tendency is to use blocks). The resident list is * 46 * considered nearly empty when there are fewer than * 47 * VOLNFREMIN blocks resident and too full if more than * 48 * VOLNFREEN-VOLNFREMIN are resident. * 49 * * 50 * GETFREEBLK is passed the FBI type that the requested * 51 * block will become. This is used strictly to know when to * 52 * pass back a 'disk full' error. We wish to stop file * 53 * creation and swapping first, but we must allow control mode * 54 * to get swapping pages so that the error can be reported. * 55 * * 56 * PUTFREEBLK may be called with a fake MS address of all * 57 * ones when the volume is being dismounted or the system shut * 58 * down. When this occurs, PUTFREEBLK will empty the resident * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 688 (GETPUTADT) F 38 Disk Free Space Managers 59 * list into the MS ADT chain and fix up the pointers and * 60 * counts in the security block. The "system running" flag is * 61 * also cleared, so that each dismounted volume will look * 62 * clean. PUTFREEBLK and GETFREEBLK are put out of commission * 63 * by the cleanup call. The MOUNTNAME code must be run to * 64 * re-initialize the pointers. * 65 * * 66 * On each volume the ADT consists of up to eight lists * 67 * of blocks with each block holding up to ADTECNT free block * 68 * addresses. The volume's security block gives pointers to * 69 * the beginning and end of each of these lists and the number * 70 * of free blocks within each (the blocks of the lists * 71 * themselves are also counted as free). When an ADT list is * 72 * busy the pointer to the end of the list is destroyed in the * 73 * security block and the list is added to forward and used up * 74 * backward. If, while removing free blocks from the ADT, a * 75 * list is emptied, the security block is consulted and the * 76 * pointers for a new ADT list are fetched. If a list gets * 77 * more than one-eighth of the volume's total blocks in it, * 78 * the security block is consulted and a new ADT list is * 79 * begun. Hairyness is encountered if an error is found when * 80 * referencing an ADT block (mass storage or parity error). * 81 * The security block is consulted to find the beginning of * 82 * the current list and the list is searched forward until a * 83 * forward pointer is found which points to the (a) bad block. * 84 * The free blocks are counted during this search. Then, the * 85 * last good block is used as the new current ADT block. * 86 * * 87 * While the ADT mangler is waiting on the disk it * 88 * unlocks the resident list of free blocks. This may cause * 89 * some processes to discover that the list is either * 90 * completely empty or completely full. In this case the * 91 * process is placed in the ADT wait queue to wait for the ADT * 92 * mangler to finish getting or putting ADT blocks. * 93 * * 94 * Note that effectively all blocks get added to the ADT * 95 * by the PPUTADT mechanism. The freefile process maps in * 96 * each block to be freed, overwrites it with ones, and sets * 97 * the FBI to indicate free. The PPUTADT bit is set in the * 98 * PPL to indicate that this block is to be entered into the * 99 * ADT. The page is now removed from the working set of the * 100 * freefile process. However, another process may retain the * 101 * page in its working set extension list. The physical page * 102 * then, may remain resident for a considerable time. * 103 * * 104 * When the page finally ages out of everyones WSX, the * 105 * DONEPPL routine queues up an idle write request for the * 106 * page. After the write, DONEPPL detects the PPUTADT bit * 107 * (this time the page is clean ). The PPL is marked as * 108 * having unknown contents and the PUTADT routine is called. * 109 * It queues up an entry for the PADT process which finally * 110 * makes the ADT entry. This is all done because the block * 111 * number must not be entered into the ADT until the block is * 112 * no longer resident. If it were, the block number could be * 113 * given to a process that would request a zeropage. Since * 114 * the zeropage mechanism does not check for a page already * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 689 (GETPUTADT) F 38 Disk Free Space Managers 115 * resident, we would end up with two physical pages of main * 116 * memory named for the same MS block. This is a bad show! * 117 * * 118 * One disaster may occur -- there are two copies of the * 119 * security block and if they both become unreadable the * 120 * volume is unusable and what am I to do? (PUNT!) * 121 * * 122 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 690 (GETPUTADT) F 38 Disk Free Space Managers 124 125 ********************************************************************************** 126 * * 127 * GETFREEBLK * 128 * Call this routine to acquire the MS address of an * 129 * available (unused) block. This unused block will be filled * 130 * with 0FFFFFFFF and the FBI will indicate type 'free'. This * 131 * prevents security breaches following crashes. It is not * 132 * intended, however, that these free blocks be read without * 133 * further initialization. * 134 * The first parameter (block type) is used only for * 135 * control in the event of disk space shortage. A table decode * 136 * produces a threshold by which we prioritize the request. * 137 * This allows vital system functions to continue while less * 138 * critical requests are denied (the latter receive "disk full"). * 139 * * 140 * Call: * 141 * no lists locked * 142 * SP = stack pointer * 143 * CALL GETFREEBLK * 144 * PARV * 145 * PARVL volume number * 146 * * 147 * returns with: * 148 * R0 = block number (volume*BITS 0:7+diskblock*BITS 8:31) * 149 * condition bits = EQ - success * 150 * GT - no free space * 151 * The calling process may be queued or might be used to access the * 152 * ADT blocks on the disk. * 153 * * 154 * Eats R1:R3. * 155 * Stack required = 15 * 156 * 4 + max ( CANOPMSG (1), DQUEONE (4), FORCEWRW3 (5), * 157 * FREEFILE (3), GENOPMSG (1), GPREADSEC (5), * 158 * GPWRITESEC (6), GRUBWNDO3 (7), LOCKWAIT (0), * 159 * MAPOUTFBI (2), MAPVOLNFBI(2), P12TOCHAR (6), * 160 * REBUILDADT(11), SAVEVLNFBI(1), SETWNDO3 (4), * 161 * SFREEMEM (0), SGETMEM (0), SUSPENDME (0), * 162 * TIMENOW (1), TRACEPROC (3), UNSUBS (7) ) * 163 * * 164 ********************************************************************************** 165 166 BLOCK GETFREEBLK and PUTFREEBLK subroutines 167 ENTRY GETFREEBLK 168 ENTRY PUTFREEBLK 169 170 BEGFRAME 00178801 6 BASE 171 GETFREBLKT BSS 1 temp location 00178802 6 BASE 172 GETBLKTMP BSS 1 holds head address when making new ADT chain 00178803 6 BASE 173 GETBLKLIM BSS 1 holds limit while going to mass storage 174 ENDFRAME 175 000BC010 7 CBM 176 VOLNADTGT EQU R7/BIT 0 0<=putting block, 1<=getting block 177 03654 DD1F8004 6 STAK 178 GETFREEBLK ENTR PUSH 03655 C152C000 3 REG 179 STPV R3 save block type requested 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 691 (GETPUTADT) F 38 Disk Free Space Managers 03656 C0528000 2 REG 180 STPVL R2 get volume number 03657 603636B8 0 3 @ 181 LD R0 @GFBDECP(R3) decode the FBI type 03658 6404003F 0 IMM 182 CPR R0 GFBSWP is the current program asking for a swap? 03659 FE0C365E 183 JNE GETNOTCM jump if not 0365A 60C00414 3 184 LD R3 CPCUPC get the current UPC pointer 0365B 5C08C610 3 ZBM 185 CMZ R3,UPCNTLMODE see if the program running is control mode 0365C FE02365E 186 JEQ GETNOTCM jump if not 0365D 60040002 0 IMM 187 LD R0 GFBSYS control mode MUST get his swaps! 188 * \ / 189 0000365E 190 GETNOTCM LABEL 0365E E4178803 0 6 BASE 191 ST R0 SP,GETBLKLIM save the limit for this caller 0365F 60E41F22 3 2 192 LD R3 VOLNTABLE(R2) get VOLN element pointer 193 * \ / 194 195 ********************************************************************************** 196 * * 197 * Lock resident list and see if there is a free block to * 198 * get. We come here after a trip to mass storage. * 199 * * 200 ********************************************************************************** 201 202 * \ / 00003660 203 GETFRFREW LABEL 204 PLOCK R3,VOLNFBZY wait for list of free blocks 03660 0CC00000 204 IOFF 03661 D1D6C80C 3 BASE 204 SETT R3,VOLNFBZY 03662 FE0C3664 204 JNE MA(2+DISPW MA 0) 03663 DC40308B 204 CALLNP LOCKWAIT 205 * \ / 206 207 ********************************************************************************** 208 * * 209 * This special code is for the disk initializer. If * 210 * this counter and list exist, then GETFREEBLK uses this * 211 * counter to assign sequential block numbers from the disk. * 212 * The list is used to skip the bad blocks. * 213 * If PUTFREEBLK is called, those blocks go back into the * 214 * regular list, so the counter and list head do not interfere * 215 * with the regular free block variables. * 216 * Note that while the initial disk space is in use, no * 217 * disk space overflow checking is done. We don't have a * 218 * counter anyway. * 219 * * 220 ********************************************************************************** 221 222 * \ / 223 * VOLNFBZY Plocked 03664 5C16C819 3 BASE 224 CMZ R3,VOLNBCNTR disk initializing? 03665 FE023672 225 JEQ NORMALGET jump if not 226 * \ / 227 228 * find next consecutive good block 03666 6096C818 2 3 BASE 229 LD R2 R3,VOLNINLIST ptr to head element of bad trax list 00003667 230 GETSPAGAIN LABEL 03667 BC16C819 0 3 BASE 231 INCL R0 R3,VOLNBCNTR get the next available block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 692 (GETPUTADT) F 38 Disk Free Space Managers 03668 64168801 0 2 BASE 232 CPR R0 R2,VINBLOCK is this number bad? 03669 FE0C3685 233 JNE GIVEBLOCK jump if not, give out this number 0366A 60568800 1 2 BASE 234 LD R1 R2,VINLINK get link to next element 0366B E456C818 1 3 BASE 235 ST R1 R3,VOLNINLIST remove head element from list 0366C DC002F5D 236 CALL SFREEMEM free current element 0366D 41440001 IMM 237 PARV VINLOG indicate length 0366E 40528000 2 REG 238 PARVL R2 and location 0366F 6096C818 2 3 BASE 239 LD R2 R3,VOLNINLIST ptr to head element of bad trax list 03670 FAB23667 2 240 JNZA R2 GETSPAGAIN jump back if not list end 03671 EC16C819 3 BASE 241 STZ R3,VOLNBCNTR indicate special fetch done 242 * \ / 243 244 * check resident list level 00003672 245 NORMALGET LABEL 03672 6016C81A 0 3 BASE 246 LD R0 R3,VOLNFRECNT get size of resident list 03673 1816C81C 0 3 BASE 247 ADD R0 R3,VOLNFREBLK add total remaining on volume 03674 64178803 0 6 BASE 248 CPR R0 SP,GETBLKLIM check against allowed total 03675 FE04367A 249 JGT GETREQOK jump if sufficient space left to allow request 00003676 250 GPSOOS LABEL give out of storage error 251 PUNLOCK R3,VOLNFBZY clear the local list busy flag 03676 EC16C80C 3 BASE 251 STZ R3,VOLNFBZY 03677 0C800000 251 ION 03678 5C040001 IMM 252 CMZ 1 make condition bits GT 03679 FE0E368A 253 JMP GETFRRTN and return failure to caller 254 * --- 255 256 * resident list has a block, BUT warn operator if shortage appearing 0000367A 257 GETREQOK LABEL 0367A 64040100 0 IMM 258 CPR R0 BLKWRNMIN getting low on blocks? 0367B FE0A368C 259 JLE DISKLOW if so send warning 260 * \ / 261 262 * check whether resident list needs refreshing 0000367C 263 GETNUMRES LABEL 0367C 6056C81A 1 3 BASE 264 LD R1 R3,VOLNFRECNT get number of free blocks resident 0367D 64440005 1 IMM 265 CPR R1 VOLNFREMIN is there plenty for everyone? 0367E FE043682 266 JGT GETFRPLNTY jump if so 267 * \ / 268 269 ********************************************************************************** 270 * * 271 * Momentous decision! The resident list looks real close * 272 * to empty. Set-and-test the flag saying that blocks must * 273 * be moved from the disk ADT to the resident list. If the * 274 * flag was clear, we must do the chore ourselves. Else, * 275 * someone else is already doing it: if even one resident * 276 * entry exists, we can take it ... else we must suspend * 277 * the user until the ADT process gets something. * 278 * * 279 ********************************************************************************** 280 281 * \ / 0367F D1D6C80D 3 BASE 282 SETT R3,VOLNADTF someone already getting more blocks? 03680 FE0C36F7 283 JNE GETFRADT if not, handle disk ADT ourselves 03681 FA4236F2 1 284 JEQZ R1 GETFRQUE else, suspend user if nothing available 285 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 693 (GETPUTADT) F 38 Disk Free Space Managers 286 287 ********************************************************************************** 288 * * 289 * There are enough resident entries to allow the current * 290 * request. Use the free block counter to form index to * 291 * resident list. * 292 * * 293 ********************************************************************************** 294 295 * \ / 296 * R1 = count resident free blocks (>0) 00003682 297 GETFRPLNTY LABEL 03682 601CC81E 0 31 BASE 298 LD R0 R3,VOLNFREE(R1-1) get a free block 03683 EC1CC81E 31 BASE 299 STZ R3,VOLNFREE(R1-1) destroy the old one (helps debugging) 03684 D056C81A 3 BASE 300 DEC R3,VOLNFRECNT decrement count of resident free 00003685 301 GIVEBLOCK LABEL 03685 6048C086 1 3 ZBM 302 LD R1 R3,VOLNNUM 03686 E44A0080 1 0 CBM 303 ST R1 R0/VOLFIELD place volume number with disk block 304 305 * VOLNFBZY Plocked 306 00003687 307 PUTFRRTN LABEL 308 PUNLOCK R3,VOLNFBZY say I'm no longer busy with the lists 03687 EC16C80C 3 BASE 308 STZ R3,VOLNFBZY 03688 0C800000 308 ION 309 * \ / 310 00003689 311 PUTRTN1 LABEL 03689 5C040000 IMM 312 CMZ 0 set condition equal 0000368A 313 GETFRRTN LABEL 0368A D80BDA20 7 CBM 314 STPSR R7/BITS 13:14 return condition bits 0368B 5D1F8004 6 STAK 315 LEAVE POP return 316 * --- 317 0000368C 318 DISKLOW LABEL 0368C 5C16C81E 3 BASE 319 CMZ R3,VOLNLOMSN is the message already sent 0368D FE0C367C 320 JNE GETNUMRES if so then don't resend it 321 * \ / 0368E E4D78802 3 6 BASE 322 ST R3 SP,GETBLKTMP save R3 0368F DC002ED0 323 CALL SGETMEM get an OPMSG block 03690 40440005 IMM 324 PARVL OPMSGLOG size to get 03691 60D20000 3 0 REG 325 LD R3 R0 R3 -> OPMSG block 326 03692 3896C802 2 3 BASE 327 LEA R2 R3,OPMSGTEXT 03693 600436A6 0 IMM 328 LD R0 ADR DSKSPAM where the message is 03694 60440028 1 IMM 329 LD R1 DSKSPAML how long it is 03695 FE400000 330 CMOVE and move the message in 331 03696 E4D78801 3 6 BASE 332 ST R3 SP,GETFREBLKT save pointer to message block 03697 60D78802 3 6 BASE 333 LD R3 SP,GETBLKTMP restore pointer to VOLN entry 03698 DC005926 334 CALL P12TOCHAR put the disk name in the message 03699 4356C811 3 BASE 335 PARV2 R3,VOLNNAME pass the name 0369A 40168400 2 @R 336 PARL @R2 and pointer to destination 0369B 60D78801 3 6 BASE 337 LD R3 SP,GETFREBLKT restore pointer to message block 0369C 3816C802 0 3 BASE 338 LEA R0 R3,OPMSGTEXT get the character address of the message 0369D 604A9F30 1 2 CBM 339 LD R1 R2/FLDCHARS R2 pointed to end of message 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 694 (GETPUTADT) F 38 Disk Free Space Managers 0369E 104A1F30 1 0 CBM 340 SUB R1 R0/FLDCHARS get the number of characters in message 0369F E456C007 1 3 CACH 341 ST R1 R3,OPMSGLEN and put into the message block 342 036A0 EC08C2E0 3 ZBM 343 STZ R3,OPMSGPROC no process associated with message 036A1 DC0046F3 344 CALL GENOPMSG send the message 036A2 4052C000 3 REG 345 PARVL R3 where the message can be found 036A3 60D78802 3 6 BASE 346 LD R3 SP,GETBLKTMP restore R3 036A4 E416C81E 0 3 BASE 347 ST R0 R3,VOLNLOMSN save the message serial number 036A5 FE0E367C 348 JMP GETNUMRES continue on our merry way 349 * --- 350 036A6 4449534B 351 DSKSPAM TEXT "DISK SPACE Disk space is getting low on " 00000028 ABS 352 DSKSPAML EQU 40 353 354 ********************************************************************************** 355 * * 356 * Table to decode FBI type to number of file blocks that * 357 * must be available on the volume before that type will be * 358 * allowed. * 359 * * 360 ********************************************************************************** 361 00000002 ABS 362 GFBSYS EQU 2 system gets highest priority 0000000C ABS 363 GFBUFC EQU 12 file control structures next 00000018 ABS 364 GFBUSR EQU 24 user data structures next 0000003F ABS 365 GFBSWP EQU 63 and swaps lose very early 00000006 ABS 366 GFL EQU GFBSWP LOG 2 the field size to hold these values 367 036AF 00000002 368 GFBITDEC VFD GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 0-3 036B0 00000002 369 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 04-07 036B1 0000003F 370 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSWP 08-0B 036B2 00000018 371 VFDB GFL:GFBUSR,GFBUFC,GFBUFC,GFBUSR 0C-0F 036B2 0000000C 372 VFDB GFL:GFBSYS,GFBUFC,GFBUFC,GFBUFC 10-13 036B3 00000002 373 VFDB GFL:GFBUSR,GFBSYS,GFBSYS,GFBSYS 14-17 036B4 00000002 374 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 18-1B 036B5 00000002 375 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 1C-1F 036B5 00000002 376 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 20-23 036B6 00000002 377 VFDB GFL:GFBSYS,GFBSYS,GFBSYS,GFBSYS 24-27 036B8 018836B0 378 GFBDECP PTR GFBITDEC ptr to above table 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 695 (GETPUTADT) F 38 Disk Free Space Managers 380 381 ********************************************************************************** 382 * * 383 * PUTFREEBLK * 384 * Call this routine to give up an available MS block by * 385 * putting its address into the ADT. The block must already * 386 * have been filled with 0ffffffff and the FBI set to indicate * 387 * type 'free'. In addition, there MUST NOT be a copy of the * 388 * block in main memory! * 389 * Call: * 390 * no lists locked * 391 * SP = stack pointer * 392 * CALL PUTFREEBLK * 393 * PAR block to free * 394 * PARL volume number * 395 * * 396 * A block number of all ones is a special clean up * 397 * request that causes the resident ADT list to be dumped * 398 * to mass storage. The security block is updated to the * 399 * normal shutdown state. * 400 * it mangles R0 thru R3 but leaves R4 thru R7 unchanged. The * 401 * calling process may be queued or may be used to get at the ADT * 402 * on the disk (a small price to pay). * 403 * * 404 * Stack required = 15, See GETFREEBLK. * 405 * * 406 ********************************************************************************** 407 036B9 DD1F8004 6 STAK 408 PUTFREEBLK ENTR PUSH 036BA C1524000 1 REG 409 STPV R1 get the block number 036BB C0528000 2 REG 410 STPVL R2 get the volume number 036BC 60E41F22 3 2 411 LD R3 VOLNTABLE(R2) get VOLN element pointer 412 * \ / 413 414 ********************************************************************************** 415 * * 416 * See if the block we are freeing is substituted, and, * 417 * if so, unsubstitute it. * 418 * * 419 ********************************************************************************** 420 421 * \ / 036BD FA6C36D3 1 422 JEQMW R1 NOTSUBD1 jump if cleanup request 036BE E4578801 1 6 BASE 423 ST R1 SP,GETFREBLKT save block number 036BF E4898081 2 6 ZBM 424 ST R2 SP,GETFREBLKT/VOLFIELD save volume number 425 PLOCK SUBSLOCK lock the substitution list 036C0 0CC00000 425 IOFF 036C1 D1C01F62 425 SETT SUBSLOCK 036C2 FE0C36C4 425 JNE MA(2+DISPW MA 0) 036C3 DC40308B 425 CALLNP LOCKWAIT 036C4 60178801 0 6 BASE 426 LD R0 SP,GETFREBLKT R0 = block number (with volume) 036C5 60401F63 1 427 LD R1 SUBSLIST R1 -> substitution list 036C6 3C164801 0 1 BASE 428 LSRCH R0 R1,SUBLBAD see if block is substituted 036C7 FE0C36D0 429 JNE NOTSUBD jump if not substituted 430 PUNLOCK SUBSLOCK unlock the substitution list 036C8 EC001F62 430 STZ SUBSLOCK 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 696 (GETPUTADT) F 38 Disk Free Space Managers 036C9 0C800000 430 ION 036CA 60178801 0 6 BASE 431 LD R0 SP,GETFREBLKT get block number 432 TRACE SUBSTRACE,SUBTCALLU 036CB 5D401D32 432 XCT TRACECALL(SUBSTRACE) 036CC FEC000C1 432 NOP (SUBSTRACE*BITS 22:26)+(SUBTCALLU*BITS 27:31) 036CD DC005082 433 CALL UNSUBS unsubstitute the block 036CE 40520000 0 REG 434 PARVL R0 036CF FE0E3689 435 JMP PUTRTN1 good exit, done freeing block 436 * --- 000036D0 437 NOTSUBD LABEL 438 PUNLOCK SUBSLOCK unlock the substitution list 036D0 EC001F62 438 STZ SUBSLOCK 036D1 0C800000 438 ION 036D2 60499181 1 6 ZBM 439 LD R1 SP,GETFREBLKT/MSBLKFIELD restore block number 000036D3 440 NOTSUBD1 LABEL 441 * \ / 442 443 ********************************************************************************** 444 * * 445 * Try to place our block into the resident list. * 446 * * 447 ********************************************************************************** 448 449 * \ / 000036D3 450 PUTFRFREW LABEL 451 PLOCK R3,VOLNFBZY get access to the resident lists 036D3 0CC00000 451 IOFF 036D4 D1D6C80C 3 BASE 451 SETT R3,VOLNFBZY 036D5 FE0C36D7 451 JNE MA(2+DISPW MA 0) 036D6 DC40308B 451 CALLNP LOCKWAIT 036D7 6016C81A 0 3 BASE 452 LD R0 R3,VOLNFRECNT get the number of blocks resident 036D8 64040061 0 IMM 453 CPR R0 VOLNFREEN is the list totally full? 036D9 FE0636ED 454 JGE PUTFRQUE jump if I must wait 036DA FA6C36FD 1 455 JEQMW R1 PUTFRCLN jump if ADT clean up 036DB 7840254F 1 456 AND R1 MSBLKMASK make a clean disk address 036DC E45CC01F 1 30 BASE 457 ST R1 R3,VOLNFREE(R0) make this a free element 036DD BC56C81A 1 3 BASE 458 INCL R1 R3,VOLNFRECNT count this new entry 036DE 5C16C81E 3 BASE 459 CMZ R3,VOLNLOMSN should we remove disk low message? 036DF FE0C36E5 460 JNE REMOVEMES if it exists at least check it 461 * \ / 000036E0 462 CHEKRESBLK LABEL 036E0 6404005C 0 IMM 463 CPR R0 VOLNFREEN-VOLNFREMIN are there too many blocks resident? 036E1 FE083687 464 JLT PUTFRRTN jump if no MS activity needed 465 * \ / 466 467 ********************************************************************************** 468 * * 469 * The ADT on the disk must be played with. Check for * 470 * someone already doing it. * 471 * * 472 ********************************************************************************** 473 474 * \ / 036E2 D1D6C80D 3 BASE 475 SETT R3,VOLNADTF anyone already doing it? 036E3 FE023687 476 JEQ PUTFRRTN jump if being done - I ignore it 036E4 FE0E3700 477 JMP PUTFRADTE go to play with MS 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 697 (GETPUTADT) F 38 Disk Free Space Managers 478 * --- 479 480 ********************************************************************************** 481 * * 482 * An operator message has been sent warning of low disk * 483 * space. See if it can now be removed, and if so do it. * 484 * * 485 ********************************************************************************** 486 000036E5 487 REMOVEMES LABEL 036E5 1856C81C 1 3 BASE 488 ADD R1 R3,VOLNFREBLK get total of free blocks 036E6 64440118 1 IMM 489 CPR R1 BLKWRNMAX are there enough to remove message? 036E7 FE0836E0 490 JLT CHEKRESBLK if not then go back 491 * \ / 036E8 DC004713 492 CALL CANOPMSG cancel the operator message 036E9 4056C81E 3 BASE 493 PARVL R3,VOLNLOMSN message serial number 036EA EC16C81E 3 BASE 494 STZ R3,VOLNLOMSN say no message is left 036EB 6016C81A 0 3 BASE 495 LD R0 R3,VOLNFRECNT restore R0 (This value was incremented 496 * since R0 was loaded but will at worse start 497 * the disk writer earlier. Big deal.) 036EC FE0E36E0 498 JMP CHEKRESBLK 499 * --- 500 501 ********************************************************************************** 502 * * 503 * Queue the process to wait for a place to put the new * 504 * free block. * 505 * * 506 ********************************************************************************** 507 000036ED 508 PUTFRQUE LABEL 036ED DC00351C 509 CALL SUSPENDME put this user out of his misery 036EE 410036D3 510 PAR PUTFRFREW indicate where to restart the user 036EF 4148C086 3 ZBM 511 PARV R3,VOLNNUM this is the shutdown parameter 036F0 41001DAE 512 PAR SQADTWAIT list to suspend the user in 036F1 4016C80C 3 BASE 513 PARL R3,VOLNFBZY this is the lock field 514 * --- 515 516 ********************************************************************************** 517 * * 518 * Queue the process to wait for a free block. * 519 * * 520 ********************************************************************************** 521 000036F2 522 GETFRQUE LABEL 036F2 DC00351C 523 CALL SUSPENDME put this user out of his misery 036F3 41003660 524 PAR GETFRFREW indicate where to restart the user 036F4 4148C086 3 ZBM 525 PARV R3,VOLNNUM this is the shutdown parameter 036F5 41001DAE 526 PAR SQADTWAIT list to suspend the user in 036F6 4016C80C 3 BASE 527 PARL R3,VOLNFBZY this is the lock field 528 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 698 (GETPUTADT) F 38 Disk Free Space Managers 530 531 ********************************************************************************** 532 * * 533 * MS section * 534 * We must consult the ADT chains on mass storage because * 535 * our small resident table of free blocks is about used up. * 536 * * 537 ********************************************************************************** 538 539 * VOLNFBZY Plocked, VOLNADTF locked, R1 = resident list size 540 000036F7 541 GETFRADT LABEL 036F7 EDCBC010 7 CBM 542 STW VOLNADTGT remember we were getting 543 * \ / 544 545 ********************************************************************************** 546 * * 547 * If getting, we don't go to the disk if it's empty. If * 548 * there are no blocks in the resident list either, we have * 549 * encountered some kind of serious error. Otherwise, we * 550 * return to the resident list manager so that he may dig into * 551 * our limited supply of remaining blocks. * 552 * * 553 ********************************************************************************** 554 555 * \ / 036F8 5C08C184 3 ZBM 556 CMZ R3,VOLNADTPT check for no current block 036F9 FE0C3701 557 JNE GETPUTADT jump if there's one to go to 036FA EC16C80D 3 BASE 558 STZ R3,VOLNADTF indicate MS tables not busy after all 036FB FA4C3682 1 559 JNEZ R1 GETFRPLNTY jump if still blocks in resident table 560 * ( but not very many! ) 561 * no space at all, should not have come this way, 562 * but give appropriate response. 036FC FE0E3676 563 JMP GPSOOS go give out of storage 564 * --- 565 566 ********************************************************************************** 567 * * 568 * We need to clean up the ADT. Set the flag then enter * 569 * the disker. This sees that we are the last one through by * 570 * suspending me until I get the disker. If I am the last * 571 * freeing call to this volume, I will be the last one through * 572 * and thus ADTs get written out correctly. * 573 * * 574 ********************************************************************************** 575 576 * VOLNFBZY Plocked 577 000036FD 578 PUTFRCLN LABEL 036FD D1D6C80D 3 BASE 579 SETT R3,VOLNADTF is somebody diddling the disk? 036FE FE0236ED 580 JEQ PUTFRQUE if so, jump to await his completion 036FF EDC8C410 3 ZBM 581 STW R3,VOLNCLNUP set flag to indicate last gasp 582 * \ / 583 584 ********************************************************************************** 585 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 699 (GETPUTADT) F 38 Disk Free Space Managers 586 * Too few or too many free blocks -- off to the disk we * 587 * go. * 588 * * 589 ********************************************************************************** 590 591 * VOLNFBZY Plocked, VOLNADTF locked 592 593 * \ / 00003700 594 PUTFRADTE LABEL 03700 EC0BC010 7 CBM 595 STZ VOLNADTGT remember I was putting a block 596 * \ / 597 00003701 598 GETPUTADT LABEL 03701 60000412 0 599 LD R0 CPPSA get the current PSA pointer 03702 D0080230 0 ZBM 600 INC R0,PSLOCKCNTR indicate that we have a critical region locked 03703 E5178801 4 6 BASE 601 ST R4 SP,GETFREBLKT save R4 03704 6112C000 4 3 REG 602 LD VLN R3 (because SETWNDO gets R3) 603 PUNLOCK VLN,VOLNFBZY let others use the lists while we're on the disk 03705 EC17080C 4 BASE 603 STZ VLN,VOLNFBZY 03706 0C800000 603 ION 03707 60090184 0 4 ZBM 604 LD R0 VLN,VOLNADTPT get the current ADT block address 03708 FA0C3728 0 605 JNEZ R0 GETPLISTX jump if already a list on MS 606 * \ / 607 608 ********************************************************************************** 609 * * 610 * We come here if we were putting and there is no list * 611 * at all on mass storage. We get a block, make it into an * 612 * ADT block, make a security block entry, and proceed as * 613 * usual. * 614 * * 615 ********************************************************************************** 616 617 * VOLNADTF locked 618 619 * \ / 03709 6057081A 1 4 BASE 620 LD R1 VLN,VOLNFRECNT get current index to resident list 0370A FA423767 1 621 JEQZ R1 GPADTDN jump if nothing resident either 0370B 601D081E 0 41 BASE 622 LD R0 VLN,VOLNFREE(R1-1) get next block 0370C EC1D081E 41 BASE 623 STZ VLN,VOLNFREE(R1-1) clear address as aid to debugging 0370D D057081A 4 BASE 624 DEC VLN,VOLNFRECNT reduce count 0370E E4090184 0 4 ZBM 625 ST R0 VLN,VOLNADTPT save as current ADT block MS address 0370F E4091186 0 4 ZBM 626 ST R0 VLN,VOLNMSBLK and construct MS address 03710 DC003202 627 CALL SETWNDO3 map into the window 03711 4144001A IMM 628 PARV VPCNTLLK+VPCNTLW+VPCNTLNR locked writable and noread 03712 41440000 IMM 629 PARV VPNOFCB indicate no lun associated with this block 03713 41003726 630 PAR GETPNEWBAD error address 03714 41570806 4 BASE 631 PARV VLN,VOLNBLOCK indicate MS address 03715 40443F87 IMM 632 PARVL VPFBIOLDB*FBITFREE+VPFBINEWB*FBITADT 633 634 * VOLNADTF locked, IOFF = 1, R2 => FBI from PPL, R3 => PPL, VLN => volume element 635 03716 DC4037FD 636 CALLNP SAVEVLNFBI save location of FBI in VLN 03717 EC089180 2 ZBM 637 STZ R2,FBIFLINK clear the forward link 03718 EC089182 2 ZBM 638 STZ R2,FBIBLINK the backward link 03719 EE168805 2 BASE 639 STZ2 R2,FBIACCT the account number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 700 (GETPUTADT) F 38 Disk Free Space Managers 0371A DC40261B 640 CALLNP MAPOUTFBI unmap window, ION 0371B EC001000 641 STZ WNDO3 initialize the block as empty 0371C DC4031A3 642 CALLNP FORCEWRW3 force the ADT block to this disk 0371D DC40380E 643 CALLNP GPREADSEC read in the security block 0371E 5C001008 644 CMZ WNDO3(SECADTTOP) check for protocol error! 0371F FE023721 645 JEQ GETPNOK jump if okay 03720 001300A0 646 HALT HALTS00A0 bad VOLN table 647 * --- 00003721 648 GETPNOK LABEL 03721 60090184 0 4 ZBM 649 LD R0 VLN,VOLNADTPT get the new ADT block address 03722 E4001008 0 650 ST R0 WNDO3(SECADTTOP) set into the SEC block 03723 EDD7081B 4 BASE 651 STW VLN,VOLNFRELST indicate the size of the chain 03724 DC40381E 652 CALLNP GPWRITSEC write out the security block 03725 FE0E3729 653 JMP GETPVMAP continue on with balancing act 654 * --- 655 656 ********************************************************************************** 657 * * 658 * We couldn't read a free block from mass storage. * 659 * We don't get too upset, since we have done nothing that * 660 * depends on it. Since we may have emptied the resident list * 661 * of blocks, we just terminate this process and set going * 662 * anyone queued for ADTWAIT. * 663 * * 664 ********************************************************************************** 665 00003726 666 GETPNEWBAD LABEL error reading new ADT block 03726 DC40261B 667 CALLNP MAPOUTFBI unmap FBI, ION 03727 FE0E3767 668 JMP GPADTDN go terminate this process 669 * --- 670 00003728 671 GETPLISTX LABEL 03728 E4091186 0 4 ZBM 672 ST R0 VLN,VOLNMSBLK construct the volume address 673 * \ / 674 675 * VOLNADTF locked 676 677 * \ / 00003729 678 GETPVMAP LABEL 03729 DC003202 679 CALL SETWNDO3 get the ADT block in 0372A 41440002 IMM 680 PARV VPCNTLW+VPCNTLLK indicate writable and locked 0372B 41440000 IMM 681 PARV VPNOFCB not part of a file 0372C 410037F8 682 PAR GPADTBAD indicate error address 0372D 41570806 4 BASE 683 PARV VLN,VOLNBLOCK pass MS address 0372E 40440007 IMM 684 PARVL FBITADT indicate type expected 685 686 * VOLNADTF locked, R2 => FBI from PPL, R3 => PPL, VLN => volume element 687 * IOFF = 1, Window 3 = current ADT block 688 0372F DC4037FD 689 CALLNP SAVEVLNFBI save mapping info for FBI 03730 DC40261B 690 CALLNP MAPOUTFBI unmap window, ION 691 692 * VOLNADTF locked, Window 3 = current ADT block 693 694 * \ / 00003731 695 GPADTFREW LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 701 (GETPUTADT) F 38 Disk Free Space Managers 696 PLOCK VLN,VOLNFBZY get the list of free blocks back 03731 0CC00000 696 IOFF 03732 D1D7080C 4 BASE 696 SETT VLN,VOLNFBZY 03733 FE0C3735 696 JNE MA(2+DISPW MA 0) 03734 DC40308B 696 CALLNP LOCKWAIT 03735 6057081A 1 4 BASE 697 LD R1 VLN,VOLNFRECNT get the number of resident blocks 03736 5C090410 4 ZBM 698 CMZ VLN,VOLNCLNUP check for a cleanup request 03737 FE0C375D 699 JNE GPADTCLN pretend too many blocks in memory 03738 64440030 1 IMM 700 CPR R1 VOLNFREEN/2 see whether high or low 03739 FE0837BE 701 JLT GPADTADDIT jump if we must add 702 * \ / 703 704 ********************************************************************************** 705 * * 706 * Too many free blocks are resident - copy some to the * 707 * disk. * 708 * * 709 ********************************************************************************** 710 711 * VOLNFBZY Plocked, VOLNADTF locked, Window 3 = current ADT block 712 713 * \ / 0000373A 714 GPADTANXT LABEL 715 * R1 = VOLNFRECNT 0373A 601D081E 0 41 BASE 716 LD R0 VLN,VOLNFREE(R1-1) load the next available block address 0373B EC1D081E 41 BASE 717 STZ VLN,VOLNFREE(R1-1) destroy the old block (helps debugging) 0373C D057081A 4 BASE 718 DEC VLN,VOLNFRECNT indicate one less in the list 719 PUNLOCK VLN,VOLNFBZY unlock the resident list for others 0373D EC17080C 4 BASE 719 STZ VLN,VOLNFBZY 0373E 0C800000 719 ION 0373F 7800254F 0 720 AND R0 MSBLKMASK make it a clean address 721 * search ADT block for insertion point 03740 60C40000 3 IMM 722 LD R3 0 initialize index for ADT block 723 * \ / 724 * VOLNADTF locked, Window 3 = current ADT block 725 00003741 726 GPADTSRCH LABEL 03741 60661000 1 3 727 LD R1 WNDO3(R3) get an entry from the disk block 03742 64124000 0 1 REG 728 CPR R0 R1 is this the place to put it? 03743 FE06374B 729 JGE GPADTPLCE jump if sort location is found 03744 FAE03741 3 730 IRJ R3 GPADTSRCH count and try next location 731 * --- 732 733 ********************************************************************************** 734 * * 735 * Duplicate entry found in the ADT while adding to the * 736 * disk block. * 737 * R0= block address, R3= index into WNDO3. * 738 * * 739 ********************************************************************************** 740 00003745 741 GPADTDUPA LABEL 03745 001300A1 742 HALT HALTS00A1 duplicate entry while moving entries to disk 743 PLOCK VLN,VOLNFBZY relock the resident list 03746 0CC00000 743 IOFF 03747 D1D7080C 4 BASE 743 SETT VLN,VOLNFBZY 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 702 (GETPUTADT) F 38 Disk Free Space Managers 03748 FE0C374A 743 JNE MA(2+DISPW MA 0) 03749 DC40308B 743 CALLNP LOCKWAIT 0374A FE0E3758 744 JMP GPADTDNX recover by ignoring block 745 * --- 746 747 ********************************************************************************** 748 * * 749 * Sort position found to place free block (within each * 750 * ADT block the free block addresses are kept in descending * 751 * order -- this localizes disk usage a little and allows for * 752 * checking of duplicate entries). * 753 * * 754 ********************************************************************************** 755 756 * VOLNADTF locked, Window 3 = current ADT block 757 0000374B 758 GPADTPLCE LABEL 0374B FE023745 759 JEQ GPADTDUPA jump if duplicate entry found 760 * \ / 761 0000374C 762 GPADTPLLP LABEL 0374C E0261000 0 3 763 EXCH R0 WNDO3(R3) insert the free block into the ADT 0374D 18C40001 3 IMM 764 ADD R3 1 advance the pointer 0374E FA0C374C 0 765 JNEZ R0 GPADTPLLP jump back if still rippling 0374F EC261000 3 766 STZ WNDO3(R3) put a zero adjacent to the end 767 * \ / 768 769 ********************************************************************************** 770 * * 771 * A free block has been inserted in the ADT -- check for * 772 * ADT block full. * 773 * * 774 ********************************************************************************** 775 776 * VOLNADTF locked, Window 3 = current ADT block 777 778 * \ / 779 PLOCK VLN,VOLNFBZY relock the resident lists 03750 0CC00000 779 IOFF 03751 D1D7080C 4 BASE 779 SETT VLN,VOLNFBZY 03752 FE0C3754 779 JNE MA(2+DISPW MA 0) 03753 DC40308B 779 CALLNP LOCKWAIT 03754 D017081C 4 BASE 780 INC VLN,VOLNFREBLK count another free block on the volume 03755 D017081B 4 BASE 781 INC VLN,VOLNFRELST count another free block in this chain 03756 64C400C9 3 IMM 782 CPR R3 ADTECNT+1 is the block full (plus one for next ADT block)? 03757 FE063773 783 JGE GPADTADD jump if so 784 * \ / 785 * VOLNFBZY Plocked, VOLNADTF locked, Window 3 = current ADT block 786 00003758 787 GPADTDNX LABEL (entry after error) 03758 6057081A 1 4 BASE 788 LD R1 VLN,VOLNFRECNT get number of resident blocks 03759 64440028 1 IMM 789 CPR R1 VOLNFREEN/2-VOLNFREDSP do we have enough out? 0375A FE04373A 790 JGT GPADTANXT jump if more records need moving 0375B 5C090410 4 ZBM 791 CMZ VLN,VOLNCLNUP check for a clean up request 0375C FE023763 792 JEQ GPADTDNY jump if normal operation 793 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 703 (GETPUTADT) F 38 Disk Free Space Managers 794 795 ********************************************************************************** 796 * * 797 * This operation is a volume clean up. We ensure that * 798 * ALL blocks are forced out, then we fix up this chain in the * 799 * security block. * 800 * * 801 ********************************************************************************** 802 803 * VOLNFBZY Plocked, VOLNADTF locked, Window 3 = current ADT block 804 * R1 = VOLNFRECNT 805 806 * \ / 0000375D 807 GPADTCLN LABEL 0375D FA44373A 1 808 JGTZ R1 GPADTANXT jump if more records need moving 809 PUNLOCK VLN,VOLNFBZY release resident lists 0375E EC17080C 4 BASE 809 STZ VLN,VOLNFBZY 0375F 0C800000 809 ION 03760 DC4031A3 810 CALLNP FORCEWRW3 force out the current ADT block 03761 EC178802 6 BASE 811 STZ SP,GETBLKTMP indicate no new list (this is cleanup) 03762 FE0E37A4 812 JMP GPADTGSB go to fix up the security block 813 * --- 814 815 ********************************************************************************** 816 * * 817 * All of the resident table information has been copied * 818 * to the image of the MS block. Force the block to mass * 819 * storage, remove ourselves from this locked region, and set * 820 * going anyone queued. * 821 * * 822 ********************************************************************************** 823 824 * VOLNFBZY Plocked, VOLNADTF locked, Window 3 = current ADT block 825 00003763 826 GPADTDNY LABEL 827 PUNLOCK VLN,VOLNFBZY release resident lists 03763 EC17080C 4 BASE 827 STZ VLN,VOLNFBZY 03764 0C800000 827 ION 03765 DC4031A3 828 CALLNP FORCEWRW3 force the block to the disk 829 830 * VOLNADTF locked, Window 3 = current ADT block 831 00003766 832 GPADTDNZ LABEL 03766 5C001000 833 CMZ WNDO3 make process wait for forcewrite 834 835 * VOLNADTF locked, Window 3 = current ADT block 836 * \ / 00003767 837 GPADTDN LABEL 03767 DC403156 838 CALLNP GRUBWNDO3 now we are done with the window 03768 60000412 0 839 LD R0 CPPSA get the current PSA pointer 03769 D0480230 0 ZBM 840 DEC R0,PSLOCKCNTR indicate critical region now freed 0376A EC17080D 4 BASE 841 STZ VLN,VOLNADTF say I'm done with the ADT thing 842 * \ / 843 0000376B 844 GPDQMOR LABEL 0376B DC00354F 845 CALL DQUEONE set anyone queued going 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 704 (GETPUTADT) F 38 Disk Free Space Managers 0376C 41001DAE 846 PAR SQADTWAIT indicate which queue 0376D 40490086 4 ZBM 847 PARVL VLN,VOLNNUM who to set going 0376E FA0C376B 0 848 JNEZ R0 GPDQMOR loop until no one left 0376F 60D30000 3 4 REG 849 LD R3 VLN voln list ptr back to R3 03770 61178801 4 6 BASE 850 LD R4 SP,GETFREBLKT restore R4 03771 F3C03689 7 851 JBF VOLNADTGT PUTRTN1 return to putting a block 03772 FE0E3660 852 JMP GETFRFREW try getting a block again 853 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 705 (GETPUTADT) F 38 Disk Free Space Managers 855 856 ********************************************************************************** 857 * * 858 * ADT list extension * 859 * An ADT block is full so get another one and extend the * 860 * current list. If the size of the current list exceeds one * 861 * eighth of the volume then shuffle off to the security block * 862 * and begin a new list instead of extending the current one. * 863 * * 864 ********************************************************************************** 865 866 * VOLNFBZY Plocked, VOLNADTF locked, Window 3 = current ADT block 867 00003773 868 GPADTADD LABEL 03773 60C010C8 3 869 LD R3 WNDO3(ADTECNT) remove the last free block from the... 03774 EC0010C8 870 STZ WNDO3(ADTECNT) ... disk list to use for new ADT block 03775 6057081D 1 4 BASE 871 LD R1 VLN,VOLNSIZE get size of volume 03776 14440008 1 IMM 872 DIV R1 SECADTNUM 03777 18440008 1 IMM 873 ADD R1 SECADTNUM calculate blocks per list 03778 6457081B 1 4 BASE 874 CPR R1 VLN,VOLNFRELST see whether this list is full 03779 ED490210 4 ZBM 875 STLLE VLN,VOLNNEWLST remember whether we're adding to this list 0377A FE0A377E 876 JLE GPADTADDX jump if a new list is to be begun 0377B DC403803 877 CALLNP MAPVOLNFBI map in block containing FBI, IOFF 0377C E4C89180 3 2 ZBM 878 ST R3 R2,FBIFLINK set up forward link 0377D DC40261B 879 CALLNP MAPOUTFBI unmap window, ION 880 * \ / 881 0000377E 882 GPADTADDX LABEL 0377E E4C91186 3 4 ZBM 883 ST R3 VLN,VOLNMSBLK save the new block number 884 PUNLOCK VLN,VOLNFBZY lists not busy for now 0377F EC17080C 4 BASE 884 STZ VLN,VOLNFBZY 03780 0C800000 884 ION 03781 DC4031A3 885 CALLNP FORCEWRW3 force the old block to the disk 886 * \ / 887 888 ********************************************************************************** 889 * * 890 * We now need to get a physical page of memory so that * 891 * we can construct the next block of the chain. Normally, * 892 * one would call for a zeropage and let the page fault * 893 * processor supply one, but that can't be done here because * 894 * that calls this ADT manager again and a deadlock is * 895 * possible (although not likely). Therefore, we fetch the * 896 * block number of an available page from the current ADT and * 897 * go to read it in. We can't be too fussy about its type * 898 * when it comes in because it might be either free or * 899 * swapping (and maybe something else if we further shortcut * 900 * the free file process). * 901 * So far as I can think at the moment, the ADT manager * 902 * is the only place in the system where a free block is * 903 * intentionally read. Just don't check its type at all. * 904 * * 905 ********************************************************************************** 906 907 * VOLNADTF locked 908 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 706 (GETPUTADT) F 38 Disk Free Space Managers 03782 DC003202 909 CALL SETWNDO3 get the new block in 03783 41440002 IMM 910 PARV VPCNTLLK+VPCNTLW locked with write access 03784 41440000 IMM 911 PARV VPNOFCB indicate not part of a file 03785 41003796 912 PAR GPADTXTENB error address 03786 41570806 4 BASE 913 PARV VLN,VOLNBLOCK indicate MS address 03787 40440000 IMM 914 PARVL 0 pass type expected (no expectations, so don't check) 03788 60040007 0 IMM 915 LD R0 FBITADT get type indicating ADT 03789 E4088080 0 2 ZBM 916 ST R0 R2,FBITYPE and turn block into ADT block 0378A DC4037FD 917 CALLNP SAVEVLNFBI save mapping info for FBI 0378B EC089180 2 ZBM 918 STZ R2,FBIFLINK no forward link 0378C 60090184 0 4 ZBM 919 LD R0 VLN,VOLNADTPT get ptr to ADT block just filled 0378D E4089182 0 2 ZBM 920 ST R0 R2,FBIBLINK point back to old block 0378E EE168805 2 BASE 921 STZ2 R2,FBIACCT no owner 0378F DC40261B 922 CALLNP MAPOUTFBI unmap FBI for PPL, ION 03790 EC001000 923 STZ WNDO3 initialize as empty 03791 60491186 1 4 ZBM 924 LD R1 VLN,VOLNMSBLK get the address of the new ADT block 03792 5C090210 4 ZBM 925 CMZ VLN,VOLNNEWLST are we creating a new list? 03793 FE0C379F 926 JNE GPADTNEWL jump if so 03794 E4490184 1 4 ZBM 927 ST R1 VLN,VOLNADTPT this is our new current block 03795 FE0E3731 928 JMP GPADTFREW balance the ADT again 929 * --- 930 931 ********************************************************************************** 932 * * 933 * We have gotten an error reading a free block that we * 934 * are going to make into an ADT block. The proper fix is to * 935 * use VOLNADTPT to map us back to the previous block and * 936 * start over. Since the block is bad we must decrement the * 937 * list count and volume count, ADT blocks are themselves free * 938 * blocks. * 939 * * 940 ********************************************************************************** 941 942 * VOLNADTF locked 00003796 943 GPADTXTENB LABEL 03796 DC40261B 944 CALLNP MAPOUTFBI eliminate FBI of bad block 03797 DC403156 945 CALLNP GRUBWNDO3 and make bad block go away 03798 D057081B 4 BASE 946 DEC VLN,VOLNFRELST decrement the count in the list 03799 D057081C 4 BASE 947 DEC VLN,VOLNFREBLK decrement the overall count 0379A EC090210 4 ZBM 948 STZ VLN,VOLNNEWLST we have no blocks to add 0379B DC403803 949 CALLNP MAPVOLNFBI get the FBI pointer, IOFF 0379C EC089180 2 ZBM 950 STZ R2,FBIFLINK the forward block is the bad one 0379D DC40261B 951 CALLNP MAPOUTFBI unmap FBI, ION 0379E FE0E37D8 952 JMP GPADTSUBY map in the previous block and continue 953 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 707 (GETPUTADT) F 38 Disk Free Space Managers 955 956 ********************************************************************************** 957 * * 958 * A new ADT list is being made -- the security block * 959 * needs updating. * 960 * * 961 ********************************************************************************** 962 963 * VOLNADTF locked, Window 3 = current ADT block 964 0000379F 965 GPADTNEWL LABEL 0379F DC403803 966 CALLNP MAPVOLNFBI map in FBI for VLN, ION 037A0 EC089182 2 ZBM 967 STZ R2,FBIBLINK no backward place 037A1 DC40261B 968 CALLNP MAPOUTFBI unmap FBI for PPL, ION 037A2 E4578802 1 6 BASE 969 ST R1 SP,GETBLKTMP save this block number, first in new list 037A3 D057081B 4 BASE 970 DEC VLN,VOLNFRELST this block is not in last list 971 972 * VOLNADTF locked, Window 3 = current ADT block 973 000037A4 974 GPADTGSB LABEL 037A4 DC40380E 975 CALLNP GPREADSEC read in the security block 037A5 60C7FFF8 3 IMM 976 LD R3 -SECADTNUM number of entries to check 977 * \ / 978 000037A6 979 GPADTNLP LABEL 037A6 5C261018 3 980 CMZ WNDO3(SECADTBTM+SECADTNUM+R3) 037A7 FE0237AA 981 JEQ GPADTNFND jump if empty found 037A8 FAE037A6 3 982 IRJ R3 GPADTNLP 037A9 001300A3 983 HALT HALTS00A3 no free lists in use? 984 * --- 985 986 ********************************************************************************** 987 * * 988 * Place for our new list found - finish old one and * 989 * begin our new one. * 990 * * 991 ********************************************************************************** 992 993 * VOLNADTF locked, Window 3 = security block 994 000037AA 995 GPADTNFND LABEL 037AA 60090184 0 4 ZBM 996 LD R0 VLN,VOLNADTPT get last block in prior chain 037AB E4261018 0 3 997 ST R0 WNDO3(SECADTBTM+SECADTNUM+R3) fix up old bottom 037AC 6017081B 0 4 BASE 998 LD R0 VLN,VOLNFRELST get number of free blocks in old list 037AD E4261020 0 3 999 ST R0 WNDO3(SECADTCNT+SECADTNUM+R3) store the number free in list 037AE 60178802 0 6 BASE 1000 LD R0 SP,GETBLKTMP get first block in new chain 037AF FA0237BA 0 1001 JEQZ R0 GPADTSGN jump if clean up request 037B0 FAC637B9 3 1002 JGEZ R3 GPADTTML jump if R3+1 greater than table size 037B1 E4261011 0 3 1003 ST R0 WNDO3(SECADTTOP+SECADTNUM+1+R3) new top 037B2 EC261019 3 1004 STZ WNDO3(SECADTBTM+SECADTNUM+1+R3) no bottom 037B3 EC261021 3 1005 STZ WNDO3(SECADTCNT+SECADTNUM+1+R3) only the block itself 037B4 E4091186 0 4 ZBM 1006 ST R0 VLN,VOLNMSBLK setup whole MS address for SETWNDO 037B5 E4090184 0 4 ZBM 1007 ST R0 VLN,VOLNADTPT indicate current ADT block 037B6 EDD7081B 4 BASE 1008 STW VLN,VOLNFRELST only the block itself in the list 037B7 DC40381E 1009 CALLNP GPWRITSEC write out the security blocks 1010 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 708 (GETPUTADT) F 38 Disk Free Space Managers 1011 * VOLNADTF locked 1012 037B8 FE0E3729 1013 JMP GETPVMAP go map in new block and balance ADT again 1014 * --- 1015 000037B9 1016 GPADTTML LABEL 037B9 001300A6 1017 HALT HALTS00A6 attempt to create too many ADT lists 1018 * --- 1019 1020 ********************************************************************************** 1021 * * 1022 * At this point, we put out the last slept time. The * 1023 * security block writer also puts out the last known time and * 1024 * the current time correction data. * 1025 * * 1026 ********************************************************************************** 1027 1028 * VOLNADTF locked, Window 3 = security block 1029 000037BA 1030 GPADTSGN LABEL 037BA DC404532 1031 CALLNP TIMENOW get the current time 037BB E600122B 01 1032 ST2 R0 WNDO3(SECLASTSL) save time of sleep or dismount 037BC DC40381E 1033 CALLNP GPWRITSEC write out the security blocks 037BD FE0E3766 1034 JMP GPADTDNZ just return when clean up done 1035 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 709 (GETPUTADT) F 38 Disk Free Space Managers 1037 1038 ********************************************************************************** 1039 * * 1040 * Not enough free blocks resident -- get some more from * 1041 * the disk. Scan forward through ADT entries until we're at * 1042 * an empty entry. Go backwards from previous entry to the * 1043 * beginning, moving entries to VOLN list until we have enough, * 1044 * or this ADT block is empty. Interesting that this reverses * 1045 * the order of the entries (shouldn't hurt, and it would be * 1046 * difficult to move in order in a safe manner). * 1047 * * 1048 * N.B. The first loop assumes that there is at least one * 1049 * empty entry in the ADT block. If there isn't, we will * 1050 * spin into the next WNDO (probably 'excluded') and beyond ... * 1051 * * 1052 ********************************************************************************** 1053 1054 * VOLNFBZY Plocked, VOLNADTF locked, WNDO3 = current ADT block 1055 000037BE 1056 GPADTADDIT LABEL 1057 * loop to find first unused (=0) location, 1058 * assuming that there is at least one 037BE 60C40000 3 IMM 1059 LD R3 0 initial index 000037BF 1060 GPADTFND0 LABEL 037BF 5C261000 3 1061 CMZ WNDO3(R3) check for an unused location 037C0 FE0237CA 1062 JEQ GPADTSBOT exit if found 037C1 FAE037BF 3 1063 IRJ R3 GPADTFND0 move and try another 1064 * --- 1065 1066 * loop to move nonzero entries from WNDO3 to resident list 000037C2 1067 GPADTSNXT LABEL 037C2 60261000 0 3 1068 LD R0 WNDO3(R3) fetch the last entry 037C3 EC261000 3 1069 STZ WNDO3(R3) mark this location as used 037C4 BC57081A 1 4 BASE 1070 INCL R1 VLN,VOLNFRECNT one more entry in the resident list 037C5 E41D081E 0 41 BASE 1071 ST R0 VLN,VOLNFREE(R1-1) place entry into table 037C6 D057081C 4 BASE 1072 DEC VLN,VOLNFREBLK decrease volume total of available blocks 037C7 D057081B 4 BASE 1073 DEC VLN,VOLNFRELST decrease total available blocks in this ADT chain 037C8 64440038 1 IMM 1074 CPR R1 VOLNFREEN/2+VOLNFREDSP do we have enough in resident list? 037C9 FE063763 1075 JGE GPADTDNY if so, unlock the window and start user 000037CA 1076 GPADTSBOT LABEL 037CA FAE637C2 3 1077 JDR R3 GPADTSNXT move back to previous entry 1078 * \ / 1079 1080 ********************************************************************************** 1081 * * 1082 * ADT list shrinkage * 1083 * The ADT block is empty, call the free file process to * 1084 * make it available. Follow its back pointer back to the * 1085 * prior block in the ADT chain. If none exists, we've used * 1086 * up this chain and we go to the security block to start * 1087 * working on a new chain. * 1088 * * 1089 ********************************************************************************** 1090 1091 * \ / 1092 * VOLNFBZY Plocked, VOLNADTF locked, WNDO3 = current ADT block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 710 (GETPUTADT) F 38 Disk Free Space Managers 1093 037CB D057081B 4 BASE 1094 DEC VLN,VOLNFRELST count available in this list 037CC D057081C 4 BASE 1095 DEC VLN,VOLNFREBLK count available on volume 037CD DC403803 1096 CALLNP MAPVOLNFBI get pointer to current blocks FBI, IOFF 037CE 60489182 1 2 ZBM 1097 LD R1 R2,FBIBLINK get the pointer to the prior ADT block 037CF DC40261B 1098 CALLNP MAPOUTFBI unmap FBI, ION 037D0 E0490184 1 4 ZBM 1099 EXCH R1 VLN,VOLNADTPT make prior block into current block 037D1 E4491186 1 4 ZBM 1100 ST R1 VLN,VOLNMSBLK build a full MS address 037D2 DC403156 1101 CALLNP GRUBWNDO3 wave goodbye to page 037D3 DC004FEA 1102 CALL FREEFILE call to release that block 037D4 41570806 4 BASE 1103 PARV VLN,VOLNBLOCK pass MS address of just finished block 037D5 40440000 IMM 1104 PARVL FFTUNKNOWN indicate a single block 1105 PUNLOCK VLN,VOLNFBZY let people fool with the list 037D6 EC17080C 4 BASE 1105 STZ VLN,VOLNFBZY 037D7 0C800000 1105 ION 1106 1107 * VOLNADTF locked 1108 1109 * \ / 000037D8 1110 GPADTSUBY LABEL 037D8 60090184 0 4 ZBM 1111 LD R0 VLN,VOLNADTPT is there another block in the list? 037D9 FA0237E5 0 1112 JEQZ R0 GPADTSSEC jump if another ADT list is needed 037DA E4091186 0 4 ZBM 1113 ST R0 VLN,VOLNMSBLK combine MS address with volume number 037DB DC003202 1114 CALL SETWNDO3 get the ADT page in 037DC 41440002 IMM 1115 PARV VPCNTLW+VPCNTLLK indicate locked with write access 037DD 41440000 IMM 1116 PARV VPNOFCB indicate not part of a file 037DE 410037F8 1117 PAR GPADTBAD error address 037DF 41570806 4 BASE 1118 PARV VLN,VOLNBLOCK specify the MS address 037E0 40440007 IMM 1119 PARVL FBITADT indicate type of block expected 037E1 DC4037FD 1120 CALLNP SAVEVLNFBI save the FBI address 037E2 EC089180 2 ZBM 1121 STZ R2,FBIFLINK clear forward pointer (that block 1122 * is now a free block) 037E3 DC40261B 1123 CALLNP MAPOUTFBI unmap FBI block, ION 037E4 FE0E3731 1124 JMP GPADTFREW balance the ADT again 1125 * --- 1126 1127 ********************************************************************************** 1128 * * 1129 * Get the security block to remove the list in use and * 1130 * get a new one. * 1131 * * 1132 ********************************************************************************** 1133 1134 * VOLNADTF locked 1135 000037E5 1136 GPADTSSEC LABEL 037E5 DC40380E 1137 CALLNP GPREADSEC read in the security block 037E6 60C7FFF8 3 IMM 1138 LD R3 -SECADTNUM number of entries to look at 1139 * \ / 1140 000037E7 1141 GPADTSSECL LABEL 037E7 5C261018 3 1142 CMZ WNDO3(SECADTBTM+SECADTNUM+R3) 037E8 FE0237EB 1143 JEQ GPADTSSECF jump if busy entry found 037E9 FAE037E7 3 1144 IRJ R3 GPADTSSECL increment counter and loop 037EA 001300A4 1145 HALT HALTS00A4 no ADT list busy - what was I using? 1146 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 711 (GETPUTADT) F 38 Disk Free Space Managers 1147 000037EB 1148 GPADTSSECF LABEL 037EB EC261010 3 1149 STZ WNDO3(SECADTTOP+SECADTNUM+R3) remove old list 037EC EC261020 3 1150 STZ WNDO3(SECADTCNT+SECADTNUM+R3) 037ED 64C7FFF8 3 IMM 1151 CPR R3 -SECADTNUM is this the first entry? 037EE FE0237F6 1152 JEQ GPADTOOS yes - out of storage 037EF 60261017 0 3 1153 LD R0 WNDO3(SECADTBTM+SECADTNUM-1+R3) 037F0 E4090184 0 4 ZBM 1154 ST R0 VLN,VOLNADTPT get end of next list 037F1 6026101F 0 3 1155 LD R0 WNDO3(SECADTCNT+SECADTNUM-1+R3) 037F2 E417081B 0 4 BASE 1156 ST R0 VLN,VOLNFRELST save count of free blocks in list 037F3 EC261017 3 1157 STZ WNDO3(SECADTBTM+SECADTNUM-1+R3) say the list is busy 037F4 DC40381E 1158 CALLNP GPWRITSEC write out the security blocks 037F5 FE0E37D8 1159 JMP GPADTSUBY do it to this list 1160 * --- 1161 1162 ********************************************************************************** 1163 * * 1164 * Out of storage. Fix up the tables so that we * 1165 * recognize this situation. * 1166 * * 1167 ********************************************************************************** 1168 1169 * VOLNADTF locked 1170 000037F6 1171 GPADTOOS LABEL 037F6 DC40381E 1172 CALLNP GPWRITSEC write out the security blocks 037F7 FE0E3766 1173 JMP GPADTDNZ continue processing from here 1174 * --- 1175 1176 ********************************************************************************** 1177 * * 1178 * A block went bad in the ADT -- reconstruct it. * 1179 * * 1180 ********************************************************************************** 1181 1182 * VOLNADTF locked 1183 000037F8 1184 GPADTBAD LABEL 037F8 DC40261B 1185 CALLNP MAPOUTFBI unmap PPLWINDOW, ION 037F9 DC40380E 1186 CALLNP GPREADSEC read in the security block 037FA DC403830 1187 CALLNP REBUILDADT this will find the last ADT block 037FB DC40381E 1188 CALLNP GPWRITSEC write out the security block 037FC FE0E37D8 1189 JMP GPADTSUBY rebalance the ADT lists again 1190 * --- 1191 1192 END GETFREEBLK and PUTFREEBLK subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 712 (GETPUTADT) F 38 Disk Free Space Managers 1194 1195 ********************************************************************************** 1196 * * 1197 * SAVEVLNFBI. Copies mapping information for FBI from * 1198 * PPL in R3 to the volume element pointed to by VLN. * 1199 * Call: * 1200 * physical page element> * 1201 * volume name element> * 1202 * CALLNP MAPVOLFBI * 1203 * * 1204 * Eats R0 * 1205 * Stack usage: 1 * 1206 * * 1207 ********************************************************************************** 1208 1209 BLOCK SAVEVLNFBI subroutine 1210 1211 ENTRY SAVEVLNFBI 1212 1213 BEGFRAME 1214 ENDFRAME 1215 037FD DD5F8001 6 STAK 1216 SAVEVLNFBI ENTRNP PUSH 037FE 6008CC62 0 3 ZBM 1217 LD R0 R3,PPFBIBLK get loc of FBI PM in PFPMAP 037FF E4093274 0 4 ZBM 1218 ST R0 VLN,VOLNADTFBX save in VLN element 03800 6008C4A0 0 3 ZBM 1219 LD R0 R3,PPFBIDISP get loc of FBI in page 03801 E40904A5 0 4 ZBM 1220 ST R0 VLN,VOLNADTDSP save in VLN element 03802 5D1F8001 6 STAK 1221 LEAVE POP 1222 * --- 1223 1224 END SAVEVLNFBI subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 713 (GETPUTADT) F 38 Disk Free Space Managers 1226 1227 ********************************************************************************** 1228 * * 1229 * MAPVOLFBI. Maps PPLWINDOW to the page containing the * 1230 * FBI for the specified VLN element. * 1231 * Call: * 1232 * volume name element> * 1233 * CALLNP MAPVOLFBI * 1234 * FBI> * 1235 * * 1236 * Sets R2 * 1237 * Stack usage: 2 * 1238 * * 1239 ********************************************************************************** 1240 1241 BLOCK MAPVOLNFBI subroutine 1242 1243 ENTRY MAPVOLNFBI 1244 1245 BEGFRAME 00178801 6 BASE 1246 SAVER3 BSS 1 1247 ENDFRAME 1248 03803 DD5F8002 6 STAK 1249 MAPVOLNFBI ENTRNP PUSH 03804 E4D78801 3 6 BASE 1250 ST PFPTR SP,SAVER3 save a reg 03805 60893274 2 4 ZBM 1251 LD R2 VLN,VOLNADTFBX get index to PPLPFMAP 03806 0CC00000 1252 IOFF interrupts off 03807 60C400FB 3 IMM 1253 LD PFPTR PNPPLWNDO virtual page to use 03808 00E41C80 2 1254 LDPF PPLPFMAP(R2) map the window 03809 608904A5 2 4 ZBM 1255 LD R2 VLN,VOLNADTDSP get loc in window 0380A 38A5EC00 2 2 1256 LEA R2 PPLWINDOW(R2) get address of FBI 0380B 60D78801 3 6 BASE 1257 LD PFPTR SP,SAVER3 restore a reg 0380C E5C00465 7 1258 ST R7 MFBILAST say where called from 0380D 5D1F8002 6 STAK 1259 LEAVE POP 1260 * --- 1261 1262 END MAPVOLNFBI subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 714 (GETPUTADT) F 38 Disk Free Space Managers 1264 1265 ********************************************************************************** 1266 * * 1267 * GPREADSEC. Routine to read in a security block. * 1268 * Will attempt the secondary block if the first is found * 1269 * to be bad. * 1270 * Uses window 3 * 1271 * * 1272 * Eats R0:R3. * 1273 * Stack required = 5 * 1274 * 1 + max ( MAPOUTFBI (2), SETWNDO3 (4) ) * 1275 * * 1276 ********************************************************************************** 1277 1278 BLOCK GPREADSEC subroutine 1279 ENTRY GPREADSEC 1280 1281 BEGFRAME 1282 ENDFRAME 1283 0380E DD5F8001 6 STAK 1284 GPREADSEC ENTRNP PUSH 0380F 60092182 0 4 ZBM 1285 LD R0 VLN,VOLNSECBK1 get primary security block address 1286 * \ / 1287 00003810 1288 GPADTNSEC LABEL 03810 E4091187 0 4 ZBM 1289 ST R0 VLN,VOLNSMSBLK try this security block address 03811 DC003202 1290 CALL SETWNDO3 get the security block in 03812 41440002 IMM 1291 PARV VPCNTLLK+VPCNTLW locked with write access 03813 41440000 IMM 1292 PARV VPNOFCB indicate not part of a file 03814 41003819 1293 PAR GPADTSECE 03815 41570807 4 BASE 1294 PARV VLN,VOLNSECAD pass the security block address 03816 40440006 IMM 1295 PARVL FBITSEC and expected type 03817 DC40261B 1296 CALLNP MAPOUTFBI unmap FBI for PPL 03818 5D1F8001 6 STAK 1297 LEAVE POP return 1298 * --- 1299 1300 ********************************************************************************** 1301 * * 1302 * Mass storage error while reading in one of the * 1303 * security blocks. Try the secondary security block (if we * 1304 * haven't already). * 1305 * * 1306 ********************************************************************************** 1307 00003819 1308 GPADTSECE LABEL 03819 DC40261B 1309 CALLNP MAPOUTFBI release FBI mapping 0381A 60091183 0 4 ZBM 1310 LD R0 VLN,VOLNSECBK2 get secondary security block address 0381B 64091187 0 4 ZBM 1311 CPR R0 VLN,VOLNSMSBLK have we already tried this block? 0381C FE0C3810 1312 JNE GPADTNSEC jump if not 1313 * \ / fall through if double failure 1314 1315 ********************************************************************************** 1316 * * 1317 * Error in secondary security block after error in * 1318 * primary. This is a wipe out. Here we really need to * 1319 * somehow return a fatal volume error to the caller and * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 715 (GETPUTADT) F 38 Disk Free Space Managers 1320 * dismount the volume (i.e., localize the problem to the * 1321 * users of this volume). * 1322 * * 1323 ********************************************************************************** 1324 1325 * \ / 0381D 000400A5 1326 HALT HALTD00A5 error in both security blocks 1327 * --- 1328 1329 END GPREADSEC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 716 (GETPUTADT) F 38 Disk Free Space Managers 1331 1332 ********************************************************************************** 1333 * * 1334 * GRWRITSEC. Routine calls DUALWRITE to force out the * 1335 * security blocks. * 1336 * * 1337 * Eats R0:R3. * 1338 * Stack required = 6 * 1339 * 1 + max ( DUALWRITE (5), TIMENOW (1) ) * 1340 * * 1341 ********************************************************************************** 1342 1343 BLOCK GPWRITSEC subroutine 1344 ENTRY GPWRITSEC 1345 1346 BEGFRAME 1347 ENDFRAME 1348 0381E DD5F8001 6 STAK 1349 GPWRITSEC ENTRNP PUSH 0381F DC404532 1350 CALLNP TIMENOW get the current time 03820 E6001229 01 1351 ST2 R0 WNDO3(SECLASTDT) save as last known date-time 03821 60001EEB 0 1352 LD R0 LASTCORR get the date of the last time correction 03822 E400122F 0 1353 ST R0 WNDO3(SECDATCOR) remember last date correction 03823 60001EED 0 1354 LD R0 FDATERROR get the current clock offset 03824 E400122D 0 1355 ST R0 WNDO3(SECDATERR) remember clock correction term 03825 60001EEE 0 1356 LD R0 FDATEDRFT get the current clock rate error 03826 E400122E 0 1357 ST R0 WNDO3(SECDATDRFT) remember clock drift factor 03827 60001EEF 0 1358 LD R0 TIMEZONE get the time zone info 03828 E4001226 0 1359 ST R0 WNDO3(SECTZONE) and remember that, too 03829 60C40084 3 IMM 1360 LD R3 PNWNDO3 get number of window with security block 0382A DC0031A6 1361 CALL DUALWRITE call to make two copies 0382B 60170807 0 4 BASE 1362 LD R0 VLN,VOLNSECAD get address where we found sec. block 0382C 74092182 0 4 ZBM 1363 XOR R0 VLN,VOLNSECBK1 flip - 0382D 74091183 0 4 ZBM 1364 XOR R0 VLN,VOLNSECBK2 flop to other address 0382E 40520000 0 REG 1365 PARVL R0 indicate where to write it out 0382F 5D1F8001 6 STAK 1366 LEAVE POP return 1367 * --- 1368 1369 END GPWRITSEC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 717 (GETPUTADT) F 38 Disk Free Space Managers 1371 1372 ********************************************************************************** 1373 * * 1374 * REBUILDADT. * 1375 * Routine to rebuild the ADT list whenever a MS error * 1376 * occurs on one of the ADT blocks. This routine searches * 1377 * through the chain of ADT blocks and sets VOLNADTPT to the * 1378 * end block or 0 if there is none. Note that VOLNMSBLK is * 1379 * destroyed by this routine. This routine must be called * 1380 * with the security block mapped and locked into window 3. * 1381 * The important storage locations used have the following * 1382 * meaning: VOLNADTPT contains the last known good ADT block, * 1383 * VOLNMSBLK contains the current ADT block we need to look * 1384 * at, and RBLDBLKTMP contains the the next block in the * 1385 * chain. The criteria used to determine the last good block * 1386 * is as follows: * 1387 * * 1388 * 1). Null forward pointer in FBI, current block last. * 1389 * 2). MS error, previous block last. * 1390 * 3). Not an ADT block, previous block last. * 1391 * 4). No non-zero entries, previous block last. * 1392 * * 1393 * CALL: * 1394 * WNDO3 = security block * 1395 * SP = stack pointer * 1396 * VLN = points to volume element * 1397 * CALLNP REBUILDADT * 1398 * * 1399 * Eats R0:R3. * 1400 * Stack required = 11 * 1401 * 4 + max ( GRUBWNDO2 (7), MAPOUTFBI (2), RSTRWNDO (7), * 1402 * SAVEWNDO2 (2), SETWNDO2 (4) ) * 1403 * * 1404 ********************************************************************************** 1405 1406 BLOCK REBUILDADT routine 1407 ENTRY REBUILDADT 1408 1409 BEGFRAME 00178801 6 BASE 1410 RBLDSECIND BSS 1 temp for security block index 00178802 6 BASE 1411 RBLDBLKTMP BSS 1 temp for last block looked at 00178803 6 BASE 1412 RBLDWNDO2 BSS 1 storage for call to SAVEWNDO2 1413 ENDFRAME 1414 03830 DD5F8004 6 STAK 1415 REBUILDADT ENTRNP PUSH 03831 60938000 2 6 REG 1416 LD R2 SP save the stack pointer 03832 DC00328D 1417 CALL SAVEWNDO2 save the state of window 2 03833 40168803 2 BASE 1418 PARL R2,RBLDWNDO2 address of duplicate VP element 03834 EC17081C 4 BASE 1419 STZ VLN,VOLNFREBLK don't know how many blocks we have 03835 EC090184 4 ZBM 1420 STZ VLN,VOLNADTPT assume no ADT blocks left 03836 6047FFF8 1 IMM 1421 LD R1 -SECADTNUM 1422 * \ / 1423 00003837 1424 ADTFNDLOOP LABEL 03837 5C221010 1 1425 CMZ WNDO3(SECADTTOP+SECADTNUM+R1) 03838 FE02383E 1426 JEQ ADTHAVEND jump if last ADT list looked at 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 718 (GETPUTADT) F 38 Disk Free Space Managers 03839 5C221018 1 1427 CMZ WNDO3(SECADTBTM+SECADTNUM+R1) 0383A FE023849 1428 JEQ ADTGETEND jump if this is the last list 0383B 60221020 0 1 1429 LD R0 WNDO3(SECADTCNT+SECADTNUM+R1) 0383C 9817081C 0 4 BASE 1430 ADDM R0 VLN,VOLNFREBLK count the number of free on volume 0383D FA603837 1 1431 IRJ R1 ADTFNDLOOP fall through means all lists full 1432 * \ / 1433 0000383E 1434 ADTHAVEND LABEL 0383E 6447FFF8 1 IMM 1435 CPR R1 -SECADTNUM is there any free storage? 0383F FE023845 1436 JEQ NONELEFT jump if no space at all 03840 60221017 0 1 1437 LD R0 WNDO3(SECADTBTM+SECADTNUM+R1-1) 03841 E4090184 0 4 ZBM 1438 ST R0 VLN,VOLNADTPT get end of initial list 03842 EC221017 1 1439 STZ WNDO3(SECADTBTM+SECADTNUM+R1-1) 03843 6022101F 0 1 1440 LD R0 WNDO3(SECADTCNT+SECADTNUM+R1-1) 03844 E417081B 0 4 BASE 1441 ST R0 VLN,VOLNFRELST get free blocks in list 1442 * \ / 1443 00003845 1444 NONELEFT LABEL 03845 60938000 2 6 REG 1445 LD R2 SP save address of stack pointer 03846 DC0032A0 1446 CALL RSTRWNDO restore state of window 2 03847 40168803 2 BASE 1447 PARL R2,RBLDWNDO2 address of old VP element 03848 5D1F8004 6 STAK 1448 LEAVE POP 1449 * --- 1450 1451 ********************************************************************************** 1452 * * 1453 * We have found the list to search so that we may find * 1454 * the last block. We search for the end of the chain by * 1455 * reading each block. The reason we examine the block is * 1456 * because the block may be readable but contain garbage. In * 1457 * each ADT block there should be a marker of zero to indicate * 1458 * the end of the table. Failure to find this marker causes * 1459 * us to treat that block as bad. * 1460 * * 1461 ********************************************************************************** 1462 00003849 1463 ADTGETEND LABEL 03849 E4578801 1 6 BASE 1464 ST R1 SP,RBLDSECIND save security block index 0384A EC17081B 4 BASE 1465 STZ VLN,VOLNFRELST no blocks yet in list 0384B EC090184 4 ZBM 1466 STZ VLN,VOLNADTPT and no known good ADT blocks 1467 * \ / 1468 0384C 60221010 0 1 1469 LD R0 WNDO3(SECADTTOP+SECADTNUM+R1) get list head pointer 0000384D 1470 ADTSETCNT LABEL 0384D E4091186 0 4 ZBM 1471 ST R0 VLN,VOLNMSBLK place address of next block 0384E DC0031FF 1472 CALL SETWNDO2 get the ADT block in 0384F 41440003 IMM 1473 PARV VPCNTLRO+VPCNTLLK read only and locked 03850 41440000 IMM 1474 PARV VPNOFCB indicate no lun associated 03851 41003862 1475 PAR BUMADTBLK error address 03852 41570806 4 BASE 1476 PARV VLN,VOLNBLOCK pass the block address 03853 40440007 IMM 1477 PARVL FBITADT and the FBI type expected 03854 60489180 1 2 ZBM 1478 LD R1 R2,FBIFLINK get pointer to the forward block 03855 DC40261B 1479 CALLNP MAPOUTFBI unmap FBI, ION 03856 E4578802 1 6 BASE 1480 ST R1 SP,RBLDBLKTMP save pointer to next block 1481 * \ / 1482 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 719 (GETPUTADT) F 38 Disk Free Space Managers 03857 6007FC00 0 IMM 1483 LD R0 -WPP 00003858 1484 CHKADTBLK LABEL 03858 5C201000 0 1485 CMZ WNDO2(WPP)(R0) check for end of list 03859 FE023864 1486 JEQ ADTBLKOK jump if end 0385A FA203858 0 1487 IRJ R0 CHKADTBLK 1488 * \ / fall through indicates a garbage block 1489 1490 ********************************************************************************** 1491 * * 1492 * We have been scanning an ADT to find its end and have * 1493 * discovered this block is bad. Use the previous block if * 1494 * there is one else resort to the last list. * 1495 * * 1496 ********************************************************************************** 1497 1498 * \ / 0000385B 1499 CRAPADTBLK LABEL 0385B DC403153 1500 CALLNP GRUBWNDO2 get rid of the page 0385C 60578801 1 6 BASE 1501 LD R1 SP,RBLDSECIND restore security block index 0385D 5C090184 4 ZBM 1502 CMZ VLN,VOLNADTPT were any blocks found in this list? 0385E FE0C386C 1503 JNE ADTLASTBLK jump if at least one found 1504 * \ / 1505 1506 ********************************************************************************** 1507 * * 1508 * There are no free blocks in this list -- destroy this * 1509 * list and try the previous one. * 1510 * * 1511 ********************************************************************************** 1512 1513 * \ / 0385F EC221010 1 1514 STZ WNDO3(SECADTTOP+SECADTNUM+R1) 03860 EC221020 1 1515 STZ WNDO3(SECADTCNT+SECADTNUM+R1) 03861 FE0E383E 1516 JMP ADTHAVEND use previous list 1517 * --- 1518 1519 ********************************************************************************** 1520 * * 1521 * Bad block during SETWNDO. Unmap the FBI page and act * 1522 * normal. * 1523 * * 1524 ********************************************************************************** 1525 00003862 1526 BUMADTBLK LABEL 03862 DC40261B 1527 CALLNP MAPOUTFBI unmap PPLWINDOW 03863 FE0E385B 1528 JMP CRAPADTBLK 1529 * --- 1530 1531 ********************************************************************************** 1532 * * 1533 * The blocks in the current ADT block are counted. Try * 1534 * the next block in the list. * 1535 * * 1536 ********************************************************************************** 1537 00003864 1538 ADTBLKOK LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 720 (GETPUTADT) F 38 Disk Free Space Managers 03864 18040401 0 IMM 1539 ADD R0 WPP+1 blocks counted + the block itself 03865 9817081B 0 4 BASE 1540 ADDM R0 VLN,VOLNFRELST add to growing total in list 03866 DC403153 1541 CALLNP GRUBWNDO2 we don't need this ADT anymore 03867 60091186 0 4 ZBM 1542 LD R0 VLN,VOLNMSBLK get address of current good block 03868 E4090184 0 4 ZBM 1543 ST R0 VLN,VOLNADTPT and save as the current end 03869 60178802 0 6 BASE 1544 LD R0 SP,RBLDBLKTMP is there a next block? 0386A FA0C384D 0 1545 JNEZ R0 ADTSETCNT if so, count the free blocks herein 0386B 60578801 1 6 BASE 1546 LD R1 SP,RBLDSECIND restore security block index 1547 * \ / 1548 1549 ********************************************************************************** 1550 * * 1551 * The block at the end has been found. Use this block. * 1552 * * 1553 ********************************************************************************** 1554 1555 * \ / 0000386C 1556 ADTLASTBLK LABEL 0386C 6017081B 0 4 BASE 1557 LD R0 VLN,VOLNFRELST see how many in list 0386D E4221020 0 1 1558 ST R0 WNDO3(SECADTCNT+SECADTNUM+R1) 0386E 9817081C 0 4 BASE 1559 ADDM R0 VLN,VOLNFREBLK add these to total free 0386F FE0E3845 1560 JMP NONELEFT use this list 1561 * --- 1562 1563 END REBUILDADT routine 1564 1565 END GETPUTADTB routines that get and put disk blocks 64 INPUT MONITOR instruction usage monitor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 721 (MONITOR) F 39 Performance Monitor and Trace Routines 3 4 ********************************************************************************** 5 * * 6 * MONITRPROC. * 7 * This routine is called by the dispatcher when the * 8 * monitor flag is set. The CPU that calls us will end up * 9 * doing the monitoring of other CPUs in the system. * 10 * We monitor all of the remaining CPUs in the system * 11 * and produce a histogram of their PCs, including whether * 12 * monitor or user. In order to prevent getting a PC and * 13 * MSR that do not belong together (e.g. an interrupt occurred * 14 * between our two fetches) we request that the victim CPU * 15 * stop, then fetch the MSR and PC, then command the victim * 16 * CPU to go. This also means that our recorded PCs will * 17 * be properly associated with the actual instruction * 18 * responsible for the time spent (normally, PC will point * 19 * to the next instruction). Without the stop, it is likely * 20 * that several instructions will be executed before the PC * 21 * is fetched (since the MSR is fetched first), thereby * 22 * spreading the peaks. * 23 * Call: * 24 * SP = stack pointer * 25 * CALLNP MONITRPROC * 26 * * 27 * Eats R0:R5. * 28 * Stack required = 15. * 29 * 1 + max ( FREEZE (14), FREEZEWAIT(12), LOCKWAIT (0), * 30 * UNFREEZE (1) ) * 31 * * 32 ********************************************************************************** 33 34 BLOCK MONITORPROC subroutine 35 ENTRY MONITRPROC 36 37 BEGFRAME 38 ENDFRAME 39 03870 DD5F8001 6 STAK 40 MONITRPROC ENTRNP PUSH 41 * Remove us from list of active CPUs 03871 DC402D79 42 CALLNP FREEZE freeze the system 03872 D0401CF7 43 DEC CPUCOUNT one fewer CPUs 03873 D0401CF8 44 DEC CPUCOUNT1 one fewer unfrozen CPU 03874 60040000 0 IMM 45 LD R0 0 03875 60400415 1 46 LD R1 OURSLOT get slot where we reside 00003876 47 FINDUS LABEL 03876 64601CFB 1 0 48 CPR R1 CPUSLOTS(R0) is this our entry? 03877 FE023879 49 JEQ FOUNDUS jump if yes 03878 FA203876 0 50 IRJ R0 FINDUS else search more 51 * --- 52 00003879 53 FOUNDUS LABEL 03879 60801CF7 2 54 LD R2 CPUCOUNT 0387A 60641CFB 1 2 55 LD R1 CPUSLOTS(R2) pick up last entry in table 0387B E4601CFB 1 0 56 ST R1 CPUSLOTS(R0) overlay our entry 0387C EC241CFB 2 57 STZ CPUSLOTS(R2) and remove last entry 0387D DC402D95 58 CALLNP UNFREEZE allow the system to continue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 722 (MONITOR) F 39 Performance Monitor and Trace Routines 59 60 * \ / 61 62 ********************************************************************************** 63 * * 64 * Main loop. We: * 65 * 1.) wait for a short interval. * 66 * 2.) for each CPU: fetch and record its PC, using the IRELOC bit for * 67 * the high order (18th) PC bit. * 68 * 3.) if we should exit, do so, else loop * 69 * * 70 ********************************************************************************** 71 72 * \ / 0000387E 73 MAINLOOP LABEL 0387E 00440064 IMM 74 WAIT 100 delay for a millisecond 75 * \ / 76 0387F 61401CF7 5 77 LD R5 CPUCOUNT get count of CPUs 00003880 78 CPULOOP LABEL 03880 602A1CFA 0 5 79 LD R0 CPUSLOTS(R5-1) get a CPU slot number 03881 60440000 1 IMM 80 LD R1 CPUREGOFST/FLDABSPG prototype page file 03882 E40A4840 0 1 CBM 81 ST R0 R1/PFSLOT put slot number into it 03883 60C40086 3 IMM 82 LD PFPTR PNCIX get I/O window page number 03884 00D24000 1 REG 83 LDPF R1 map this CPUs registers into the CIX page 03885 60C40083 3 IMM 84 LD PFPTR PNWNDO2 and use another virtual page 03886 00D650C0 1 REG 85 LDPF R1+CPUCOFFSET/FLDABSPG-CPUREGOFST/FLDABSPG to point to commands 86 PLOCK CPUCOMLOCK get access to it 03887 0CC00000 86 IOFF 03888 D1C01CF5 86 SETT CPUCOMLOCK 03889 FE0C388B 86 JNE MA(2+DISPW MA 0) 0388A DC40308B 86 CALLNP LOCKWAIT 0388B EC000C01 87 STZ WNDO2(CPUSTOP) stop this fella 0388C 60001809 0 88 LD R0 CIX(CPUMSR) get that CPUs MSR 0388D 60401808 1 89 LD R1 CIX(CPUPC) and its PC 0388E EC000C00 90 STZ WNDO2(CPURUN) make this CPU go again 91 PUNLOCK CPUCOMLOCK give up access to CPU 0388F EC001CF5 91 STZ CPUCOMLOCK 03890 0C800000 91 ION 92 03891 600A3610 0 0 CBM 93 LD R0 R0/MSRIRELOCB get relocation bit as a word 03892 E40A40F0 0 1 CBM 94 ST R0 R1/UPR15 make PC monitor or user 03893 10401D16 1 95 SUB R1 IHBASE subtract off minimum 03894 54440000 1 IMM 96 MAX R1 0 lower PCs (now negative) go into first bucket 03895 14401D17 1 97 DIV R1 IHBUKSIZE put PC into a bucket 03896 504407FF 1 IMM 98 MIN R1 IHMAX-1 use highest if PC is out of range high 03897 600A5E70 0 1 CBM 99 LD R0 R1/FLDPAGE R0 = bucket page index 03898 604A6CA0 1 1 CBM 100 LD R1 R1/DISPFIELD R1 = offset into bucket page 03899 60201D18 0 0 101 LD R0 IHBLOCKS(R0) R0 => bucket page 0389A D01C0800 01 BASE 102 INC R0,0(R1) increment the bucket 0389B FB623880 5 103 DRJ R5 CPULOOP do any other CPUs 104 * \ / 0389C 5C001D15 105 CMZ IHBUSY should we stop 0389D FE04387E 106 JGT MAINLOOP loop if not 107 * \ / 108 * We come here when we were asked to go away. Restore the CPU slot 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 723 (MONITOR) F 39 Performance Monitor and Trace Routines 109 * number list and exit. 110 * \ / 0389E 60C40086 3 IMM 111 LD PFPTR PNCIX get I/O window page number 0389F 80D2C000 3 REG 112 PFRC PFPTR clear out this PF location 038A0 60C40083 3 IMM 113 LD PFPTR PNWNDO2 and the other virtual page that we used 038A1 80D2C000 3 REG 114 PFRC PFPTR clear out this PF location 038A2 60000415 0 115 LD R0 OURSLOT get our slot number 038A3 60401CF7 1 116 LD R1 CPUCOUNT how many other CPUs 038A4 E4221CFB 0 1 117 ST R0 CPUSLOTS(R1) put us onto end of table 038A5 D0001CF7 118 INC CPUCOUNT indicate back into the running 038A6 D0001CF8 119 INC CPUCOUNT1 038A7 DC402D9A 120 CALLNP FREEZEWAIT in case we should freeze 038A8 EDC01D15 121 STW IHBUSY say that I saw the stop command 038A9 5D1F8001 6 STAK 122 LEAVE POP return 123 * --- 124 125 END MONITORPROC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 724 (MONITOR) F 39 Performance Monitor and Trace Routines 127 128 ********************************************************************************** 129 * * 130 * TRACEPROC. * 131 * Put an entry into the trace table. This routine will log * 132 * the return address, the slot number who called us, and the * 133 * contents of R0-R2. * 134 * Call: * 135 * XCT TRACECALL(CLASS) ="NOP 0" or "CALLNP TRACEPROC" * 136 * NOP (class*bits 22:26)+(event*bits 27:31) * 137 * * 138 * No registers are destroyed. * 139 * Stack required = 3. * 140 * * 141 ********************************************************************************** 142 143 BLOCK TRACEPROC subroutine 144 ENTRY TRACEPROC 145 146 BEGFRAME 00178801 6 BASE 147 SAVER0 BSS 1 save area for R0 00178802 6 BASE 148 SAVER1 BSS 1 save area for R1 149 ENDFRAME 150 151 TRINFORD LIST 151 ********************************************************************************** 151 * * 151 * Information returned by the stop trace request. * 151 * * 151 ********************************************************************************** 151 000038AA 151 TIPROTO BASE R0 00080040 0 ZBM 151 TISLOT BSSB 4 slot number of CPU creating this entry 000808A0 0 ZBM 151 TIEVENT BSSB 10 class and event number 00081D20 0 ZBM 151 TITIME BSSB 18 right bits of clock 00160801 0 BASE 151 TIR0 BSS 1 contents of R0 at time of event 00160802 0 BASE 151 TIR1 BSS 1 contents of R1 at time of event 00160803 0 BASE 151 TIR2 BSS 1 contents of R2 at time of event 151 DRCT 00000004 ABS 151 TILENGTH EQU DISPW TIPROTO entry length 151 ORG TIPROTO 152 038AA DD5F8003 6 STAK 153 TRACEPROC ENTRNP PUSH 038AB E6178801 016 BASE 154 ST2 R0 SP,SAVER0 save these registers 038AC BC001D2A 0 155 INCL R0 TRACEINDEX next entry in table 038AD 600A3080 0 0 CBM 156 LD R0 R0/BITS 24:31 index into trace buffer 038AE 60401D29 1 157 LD R1 TRACEADDR ptr to beginning of buffer 038AF 980A5EF0 0 1 CBM 158 ADDM R0 R1/BITS 15:29 add in the index 038B0 60001EE6 0 159 LD R0 FDATE(1) get current time 038B1 E4085D20 0 1 ZBM 160 ST R0 R1,TITIME and plop into buffer 038B2 6009ECA0 0 7 ZBM 161 LD R0 R7,0/BITS 22:31 038B3 E40848A0 0 1 ZBM 162 ST R0 R1,TIEVENT save the trace address 038B4 60000415 0 163 LD R0 OURSLOT 038B5 E4084040 0 1 ZBM 164 ST R0 R1,TISLOT save the cpu slot nubmer 038B6 E4964803 2 1 BASE 165 ST R2 R1,TIR2 save R2 value 038B7 60178802 0 6 BASE 166 LD R0 SP,SAVER1 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 725 (MONITOR) F 39 Performance Monitor and Trace Routines 038B8 E4164802 0 1 BASE 167 ST R0 R1,TIR1 save R1 value 038B9 60178801 0 6 BASE 168 LD R0 SP,SAVER0 038BA E4164801 0 1 BASE 169 ST R0 R1,TIR0 save R0 value 038BB 60578802 1 6 BASE 170 LD R1 SP,SAVER1 restore register 038BC 5D1F8003 6 STAK 171 LEAVE POP return 172 * --- 173 174 END TRACEPROC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 726 F 0 Performance Monitor and Trace Routines 66 67 ********************************************************************************** 68 * * 69 * Place to break the listing. * 70 * This section contains the resident I/O drivers. * 71 * * 72 ********************************************************************************** 73 74 nolist cref skip creffing rest of files 75 INPUT INTSORT interrupt entry processor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 727 (INTSORT) F 40 User Interrupt handlers 3 4 INTSORTB BLOCK Interrupt Sort Routines 5 6 ENTRY TRACETRAP trace return 7 ENTRY UERRTRAP user error entry 8 ENTRY XCALLTRAP trap entry for XCALL instructions 9 ENTRY XREQRETURN return from XREQ processing 10 ENTRY XREQRTNX return without incrementing PC 11 ENTRY XREQTRAP user to system request 12 ENTRY BREAKOP instruction sub-op for breakpoint 13 ENTRY MONITORRTN return from XREQ, no CHKWNDO 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 728 (INTSORT) F 40 User Interrupt handlers 15 16 ********************************************************************************** 17 * * 18 * XREQ trap processor * 19 * * 20 ********************************************************************************** 21 22 BLOCK XREQTRAP routine 23 ENTRY XREQTRAP 24 ENTRY BREAKOP 25 000038BD 26 XREQTRAP LABEL 038BD 81538000 6 REG 27 STCAR SP pick up Console Area pointer 038BE E4D7880E 3 6 BASE 28 ST R3 SP,CAXOPERAND save XREQ operand 038BF 6197880D 6 6 BASE 29 LD SP SP,CASTACKPTR pick up stack area pointer 038C0 61979020 6 6 REG 30 LD SP SP+(2 POWER STAKLOG) and make actual stack pointer 038C1 DC00284A 31 CALL GRABCA exchange new CA for one in trap vector 038C2 4000040C 32 PARL IVTXREQ 038C3 0C800000 33 ION interrupts on 038C4 5D401D1B 34 XCT XHCHECK maybe log XREQ call 038C5 600A8E30 0 2 CBM 35 LD R0 R2/BITS 7:9 get the sub-op from the inst 038C6 5CA038C7 0 36 LDPC XREQJMP(R0) goto appropriate routine 37 * --- 38 39 * Processing routine entered with: 40 * SP = R6 => stack top 41 * R4 => requesters console area 42 000038C7 43 XREQJMP LABEL 038C7 000059D8 44 VFD ADR UERRORILR 038C8 000059D8 45 VFD ADR UERRORILR 038C9 00005EA8 46 VFD ADR FREQTRAP file function request 038CA 000059D8 47 VFD ADR UERRORILR 038CB 000087C7 48 VFD ADR UREQTRAP assorted user request traps 038CC 00009113 49 VFD ADR OPREQTRAP operator function request 038CD 000059D8 50 VFD ADR UERRORILR 00000007 DISP 51 BREAKOP EQU DISP XREQJMP index for next entry 038CE 00003903 52 VFD ADR BREAKINST a debugging break instruction 53 * --- 54 55 END XREQTRAP routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 729 (INTSORT) F 40 User Interrupt handlers 57 58 ********************************************************************************** 59 * * 60 * Routine used to return from XREQs. * 61 * * 62 ********************************************************************************** 63 64 BLOCK XREQRETURN routine 65 ENTRY XREQRETURN 66 ENTRY MONITORRTN 67 000038CF 68 XREQRETURN LABEL 69 * Note: The following 5 instructions are for test purposes only. 70 * They maybe patched out without harm. 038CF 60400412 1 71 LD R1 CPPSA get pointer to PSA 038D0 60485F11 1 1 ZBM 72 LD R1 R1,PSCACHNP1 get pointer to console area 038D1 5C087611 1 ZBM 73 CMZ R1,CAMSR/MSRIRELOCB check xreq from monitor 038D2 FE0C38D4 74 JNE MONITORRTN if so, skip window check 038D3 DC40317A 75 CALLNP CHKWNDOS check if windows left mapped in 000038D4 76 MONITORRTN LABEL 038D4 0CC00000 77 IOFF disable interrupts 78 SETSP 038D5 81538000 6 REG 78 STCAR SP 038D6 6197880D 6 6 BASE 78 LD SP SP,CASTACKPTR 038D7 61979020 6 6 REG 78 LD SP SP+(2 POWER STAKLOG) 038D8 DC40285A 79 CALLNP DROPCA discard CA 038D9 61000412 4 80 LD R4 CPPSA get pointer to PSA 038DA 61091F10 4 4 ZBM 81 LD R4 R4,PSCACHN and pointer to callers CA 038DB D0091F10 4 ZBM 82 INC R4,CAPC advance PC to not re-execute XREQ 038DC 5C092C11 4 ZBM 83 CMZ R4,CAMSR/MSRTRACEIB check for single stepping instructions 038DD FE0228B7 84 JEQ DISPATCH if not, just return from request 038DE FE0E38F0 85 JMP TRACETRAP fake end of instruction trace trap 86 * --- 87 88 END XREQRETURN routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 730 (INTSORT) F 40 User Interrupt handlers 90 91 ********************************************************************************** 92 * * 93 * Return from an XREQ without incrementing the program counter. * 94 * This is used by the requests that set interrupt conditions * 95 * in the user error list. We exit here so that the dispatcher * 96 * will go to the program controller. * 97 * Also, does not check for tracing when returning. * 98 * * 99 ********************************************************************************** 100 101 BLOCK XREQRTNX routine 102 ENTRY XREQRTNX 103 000038DF 104 XREQRTNX LABEL 038DF 0CC00000 105 IOFF disable interrupts 106 SETSP 038E0 81538000 6 REG 106 STCAR SP 038E1 6197880D 6 6 BASE 106 LD SP SP,CASTACKPTR 038E2 61979020 6 6 REG 106 LD SP SP+(2 POWER STAKLOG) 038E3 DC40285A 107 CALLNP DROPCA discard extra CA 038E4 FE0E28B7 108 JMP DISPATCH off to run the user 109 * --- 110 111 END XREQRTNX routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 731 (INTSORT) F 40 User Interrupt handlers 113 114 ********************************************************************************** 115 * * 116 * The XCALL instructions are not yet in the CPU microcode, so * 117 * we have to simulate them. As yet we do not simulate them so here * 118 * we fake an illegal operation interrupt. * 119 * * 120 ********************************************************************************** 121 122 BLOCK XCALLTRAP routine 123 ENTRY XCALLTRAP 124 000038E5 125 XCALLTRAP LABEL 038E5 60D28000 3 2 REG 126 LD R3 R2 R3 = instruction image 038E6 60840001 2 IMM 127 LD R2 UINTUOP R2 = error code 038E7 FE0E38E8 128 JMP UERRTRAP treat as error trap 129 * --- 130 131 END XCALLTRAP routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 732 (INTSORT) F 40 User Interrupt handlers 133 134 ********************************************************************************** 135 * * 136 * Routine to handle a user trap * 137 * * 138 ********************************************************************************** 139 140 BLOCK UERRTRAP and TRACETRAP routines 141 ENTRY UERRTRAP 142 ENTRY TRACETRAP 143 000038E8 144 UERRTRAP LABEL 145 SETSP 038E8 81538000 6 REG 145 STCAR SP 038E9 6197880D 6 6 BASE 145 LD SP SP,CASTACKPTR 038EA 61979020 6 6 REG 145 LD SP SP+(2 POWER STAKLOG) 038EB 5C093611 4 ZBM 146 CMZ R4,CAMSR/MSRIRELOCB was error from within monitor? 038EC FE0238F5 147 JEQ UERRT1 jump if a real user error 038ED 60342AF5 0 2 @ 148 LD R0 @INTMASKB(R2) get code for interrupt bits 038EE FA0C38F7 0 149 JNEZ R0 UERRT2 jump if possible 038EF 00080050 150 HALT HALTH0050 a bad instruction from the monitor 151 * --- (what is the world coming to?) 152 153 ********************************************************************************** 154 * * 155 * Come here after an XREQ that is being traced by the user * 156 * program. We fake like we got the proper interrupt by putting * 157 * the right stuff in the registers and faking the user interrupt. * 158 * * 159 ********************************************************************************** 160 000038F0 161 TRACETRAP LABEL 162 SETSP 038F0 81538000 6 REG 162 STCAR SP 038F1 6197880D 6 6 BASE 162 LD SP SP,CASTACKPTR 038F2 61979020 6 6 REG 162 LD SP SP+(2 POWER STAKLOG) 038F3 6084001F 2 IMM 163 LD R2 UINTTRACEI interrupt code to R2 038F4 60C40000 3 IMM 164 LD R3 0 other param unknown 165 * \ / 166 000038F5 167 UERRT1 LABEL 038F5 DC403589 168 CALLNP UERRSET place the error in user list 038F6 FE0E28B7 169 JMP DISPATCH return to the user 170 * --- 171 172 ********************************************************************************** 173 * * 174 * An error occurred while in the monitor and the monitor * 175 * routine says it wishes to process such errors. This is here * 176 * on the off-chance that a monitor routine would wish to use * 177 * CKB or other trapping instructions. It is also used by URLEA * 178 * to get the trap from the failed LEA. * 179 * The error codes are returned in R0, R1 and control is * 180 * passed directly back to the interrupt error address. * 181 * * 182 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 733 (INTSORT) F 40 User Interrupt handlers 183 000038F7 184 UERRT2 LABEL 038F7 3849001B 1 4 ZBM 185 LEA R1 R4,CAINTMASK/BIT 0 produce pointer to interrupt mask 038F8 5C1A4400 10 @R 186 CMZ @R1(R0) is this interrupt enabled? 038F9 FE023902 187 JEQ UERRTMH jump if not, this is a bad error 038FA 6017080A 0 4 BASE 188 LD R0 R4,CAINTADR get the interrupt address 038FB FA023902 0 189 JEQZ R0 UERRTMH cannot return to nothing 038FC E6970802 234 BASE 190 ST2 R2 R4,CAR0 return error info in R0, R1 038FD E4091F10 0 4 ZBM 191 ST R0 R4,CAPC place to return 038FE EDC93011 4 ZBM 192 STW R4,CAMSR/MSRSRELOCB restore monitor relocation 038FF EDC93211 4 ZBM 193 STW R4,CAMSR/MSRFRELOCB restore monitor relocation 03900 EDC93411 4 ZBM 194 STW R4,CAMSR/MSRPRELOCB restore monitor relocation 03901 FE0E28B7 195 JMP DISPATCH return to the error maker 196 * --- 197 198 * Unexpected instruction traps from the monitor 00003902 199 UERRTMH LABEL 03902 00080051 200 HALT HALTH0051 instruction trap from monitor 201 * --- 202 203 END UERRTRAP and TRACETRAP routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 734 (INTSORT) F 40 User Interrupt handlers 205 206 ********************************************************************************** 207 * * 208 * A break instruction is provided for debuggers so that * 209 * they can place an instruction in the execution path and get * 210 * control back. Other illegal instructions don't work because * 211 * the program can request traps on illegal instructions. * 212 * * 213 ********************************************************************************** 214 215 BLOCK BREAKINST routine 216 ENTRY BREAKINST 217 00003903 218 BREAKINST LABEL 03903 60840079 2 IMM 219 LD R2 UINTBRKINS R2 = reason for interrupt 03904 60C91F10 3 4 ZBM 220 LD R3 R4,CAPC parameter is location of instruction 03905 EC092C11 4 ZBM 221 STZ R4,CAMSR/MSRTRACEIB single stepping is to stop 03906 DC403589 222 CALLNP UERRSET set error that will pass up 03907 FE0E38DF 223 JMP XREQRTNX return from XREQ processing 224 * --- 225 226 END BREAKINST routine 227 228 229 END INTSORTB Interrupt Sort Routines 76 INPUT IOINTPROC IO interrupt processor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 735 (IOINTPROC) F 41 I/O interrupt processor 3 4 ********************************************************************************** 5 * I/O interrupt processor * 6 * On entry here: * 7 * R2 = interrupt poll response from device * 8 * R3 = slot number causing interrupt * 9 * R4 = previous console area * 10 ********************************************************************************** 11 12 BLOCK IOINTPROC routine 13 ENTRY IOINTPROC enter here on I/O interrupts 14 00003908 15 IOINTPROC LABEL 16 SETSP 03908 81538000 6 REG 16 STCAR SP 03909 6197880D 6 6 BASE 16 LD SP SP,CASTACKPTR 0390A 61979020 6 6 REG 16 LD SP SP+(2 POWER STAKLOG) 0390B 60661ECE 1 3 17 LD R1 SLOTTABLE(R3) fetch this slots descriptor 0390C 600A4030 0 1 CBM 18 LD R0 R1/SLOTTYPE find device type causing interrupt 0390D 7845FFFF 1 IMM 19 AND R1 ONEBITS/SLOTPTR mask to field size 0390E 5CA0390F 0 20 LDPC SLOTDECODE(R0) decode device type 21 * --- 0000390F 22 SLOTDECODE LABEL 0390F 00003917 23 ADR BADTYPE 0 - empty slot 03910 00003917 24 ADR BADTYPE 1 - MCU 03911 00003917 25 ADR BADTYPE 2 - CPU ( IAPR is different ) 03912 00003918 26 ADR CHANTYPE 3 - PPU 03913 0000446A 27 ADR SSU_INT 4 - SSU 03914 00003917 28 ADR BADTYPE 5 - undef 03915 00003917 29 ADR BADTYPE 6 - undef 03916 00003917 30 ADR BADTYPE 7 - undef 31 03917 00090800 32 BADTYPE HALT HALTI0800 SLOTTABLE was garbage or interrupt 33 * --- from unbelievable slot 34 35 ********************************************************************************** 36 * Interrupt was from a channel. Determine which * 37 * controller and call its driver. * 38 ********************************************************************************** 39 00003918 40 CHANTYPE LABEL 03918 600A9080 0 2 CBM 41 LD R0 R2/IPRPPUCHAN isolate channel number (used from R0 later) 03919 614A0C00 5 0 CBM 42 LD R5 R0*PPUCHAN position channel number for PF 0391A 7D564800 5 1 BASE 43 IOR R5 R1,PPUPF make PF to talk to channel 0391B 60C40086 3 IMM 44 LD PFPTR PNCIX get the I/O page file location 0391C 00D34000 5 REG 45 LDPF R5 point to PPU channel 0391D 7C801801 2 46 IOR R2 CIX(PPUINTSTAT) clear out the int bit in the PPU, get any new ints 0391E 608AA100 2 2 CBM 47 LD R2 R2/IPRPPUSTAT isolate the interrupting status 0391F E4964802 2 1 BASE 48 ST R2 R1,PPULASTST save as last status 03920 60DC4004 3 10 BASE 49 LD R3 R1,PPUCNTLPTR(R0) get pointer to device control element 03921 600AC080 0 3 CBM 50 LD R0 R3/DEVTYPE get the device type 03922 5004000F 0 IMM 51 MIN R0 0F catch bad types 03923 78C5FFFF 3 IMM 52 AND R3 ONEBITS/DEVPTR isolate the control block pointer 03924 5CA03925 0 53 LDPC DEVICETYPE(R0) decode type of controller 54 * Processing routine entered with: 55 * R2 = PPU internal status for channel 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 736 (IOINTPROC) F 41 I/O interrupt processor 56 * R3 => controller table 57 * SP => stack top 58 * CIX = window to device 59 * --- 60 00003925 61 DEVICETYPE BASE 03925 00003935 62 ADR BADEVTYPE 00 - not legal 03926 00003994 63 ADR MSPROCINT 01 - mass storage controller 03927 00004D7B 64 ADR LPCINT 02 - line printer 03928 00003935 65 ADR BADEVTYPE 03 - not legal 03929 00003935 66 ADR BADEVTYPE 04 - not legal 0392A 00003935 67 ADR BADEVTYPE 05 - not legal 0392B 00003935 68 ADR BADEVTYPE 06 - not legal 0392C 00003935 69 ADR BADEVTYPE 07 - not legal 0392D 00004761 70 ADR CIA_INT 08 - async comm controller 0392E 000041B0 71 ADR MTPROCINT 09 - 9 track MT 0392F 000041B0 72 ADR MTPROCINT 0A - cartridge mag tape 03930 000041B0 73 ADR MTPROCINT 0B - video tape 03931 00003994 74 ADR MSPROCINT 0C - SCSI disk controller 03932 00003935 75 ADR BADEVTYPE 0D - not legal 03933 00003935 76 ADR BADEVTYPE 0E - not legal 03934 00003935 77 ADR BADEVTYPE 0F - not legal 78 DRCT 79 03935 00090801 80 BADEVTYPE HALT HALTI0801 channel table garbage or 81 * --- interrupt from unbelievable device 82 * R1 -> PPU control element 83 84 END IOINTPROC routine 77 INPUT MSREQUEST mass storage request queuer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 737 (MSREQUEST) F 42 Mass storage request queuer 3 4 ********************************************************************************** 5 * * 6 * MSQREADREQ * 7 * This routine places a read request into the MS queue * 8 * if it is not already present. If the page is already present * 9 * in the queue, we exit directly. All users requesting a given * 10 * page get it when it becomes available. * 11 * LD R2 * 12 * LD R4 * 13 * SP = stack pointer * 14 * CALL MSREADREQ with MSQIN locked, interrupts off * 15 * note: R0, R1, and R3 are destroyed before* 16 * the parameters are passed * 17 * PARVL * 18 * R3 => VOLN element * 19 * R2 => MSQ element iff request for this * 20 * address not already present. * 21 * * 22 * Eats R0:R3 * 23 * Stack required = 1. * 24 * 1 + max ( SGETMEM (0) ) * 25 * * 26 ********************************************************************************** 27 28 BLOCK MSREADREQ subroutine 29 ENTRY MSREADREQ entry to request a transfer 30 31 BEGFRAME 32 ENDFRAME 33 03936 DD9F8001 6 STAK 34 MSREADREQ ENTRS PUSH 03937 600B0080 0 4 CBM 35 LD R0 R4/VOLFIELD get the volume requested 03938 60E01F22 3 0 36 LD R3 VOLNTABLE(R0) R3=> VOLN element 03939 6016C816 0 3 BASE 37 LD R0 R3,VOLNREADQ => first element in list 0393A 3C960801 2 0 BASE 38 LSRCH R2 R0,MSQBLOCK search for this block in read queue 0393B FE02395A 39 JEQ MSRRXITX jump if already present 40 * element not present, produce a new one 0393C DC002ED0 41 CALL SGETMEM call for a block of memory 0393D 40440002 IMM 42 PARVL MSQLOG this big 0393E EC160800 0 BASE 43 STZ R0,MSQWORDA clear this word 0393F E4960801 2 0 BASE 44 ST R2 R0,MSQBLOCK set the block number 03940 E5160802 4 0 BASE 45 ST R4 R0,MSQACTAD set actual read address 03941 EC160803 0 BASE 46 STZ R0,MSQXPTR indicate no extra PPL pointer 03942 60920000 2 0 REG 47 LD R2 R0 copy the element pointer 03943 DCD3C000 7 REG 48 EXPCS R7 go back to caller for parameters 03944 C04880F0 2 ZBM 49 STPVL R2,MSQTYPE set into the request block 03945 BC001F1A 0 50 INCL R0 DISKCOUNT increment the reads so far 03946 64001F1B 0 51 CPR R0 DISKREND time to give someone else a chance? 03947 FE06394F 52 JGE PUTEND jump if so, put this one on the end 53 * \ / 54 03948 6056C816 1 3 BASE 55 LD R1 R3,VOLNREADQ address of the read queue 03949 FA4C394B 1 56 JNEZ R1 MSNOTEMPTY 0394A 3856C816 1 3 BASE 57 LEA R1 R3,VOLNREADQ pointer to the read queue 58 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 738 (MSREQUEST) F 42 Mass storage request queuer 59 0000394B 60 MSNOTEMPTY LABEL 0394B 60085F10 0 1 ZBM 61 LD R0 R1,MSQLINK actually get second in list 0394C E4089F10 0 2 ZBM 62 ST R0 R2,MSQLINK fix up our pointer 0394D E4885F10 2 1 ZBM 63 ST R2 R1,MSQLINK now we are second 0394E FE0E3954 64 JMP MSDONE finished here 65 * --- 66 0000394F 67 PUTEND LABEL 0394F EC001F1A 68 STZ DISKCOUNT only one every comes here 03950 60040000 0 IMM 69 LD R0 0 search for this in the pointer 03951 3856C816 1 3 BASE 70 LEA R1 R3,VOLNREADQ get the address of the queue head 03952 3C085F10 0 1 ZBM 71 LSRCH R0 R1,MSQLINK look for the end of the list 03953 E4885F10 2 1 ZBM 72 ST R2 R1,MSQLINK place this element on end of MS queue 73 * \ / 74 00003954 75 MSDONE LABEL 03954 D0001F18 76 INC DISKRBUSY increment number of MS reads 03955 6496C816 2 3 BASE 77 CPR R2 R3,VOLNREADQ equal if this is the first entry 03956 FE0C3959 78 JNE MSRRXIT if queue already exists, exit directly 03957 60040001 0 IMM 79 LD R0 1*BIT FLMSPROC MS driver start flag 03958 FC001CF6 0 80 IORM R0 FLAGS indicate that the driver must be started 81 * \ / 82 00003959 83 MSRRXIT LABEL 03959 5D1F8001 6 STAK 84 LEAVE POP 85 * --- 86 87 ********************************************************************************** 88 * * 89 * A MS request for the desired block is already present * 90 * in the MS read request queue. * 91 * It is not possible to have a find in one of the queues * 92 * if the call specified a switch in block number, because that * 93 * only happens with a newly acquired free block. The ADT * 94 * is managed such that all free blocks are written full of * 95 * garbage on the disk and purged from physical memory before * 96 * that block becomes available for re-use. * 97 * Notice that a find in one of the MS queues would prevent * 98 * the required block number switch for this user. * 99 * This situation may require re-analysis at some future * 100 * date. * 101 * * 102 ********************************************************************************** 103 0000395A 104 MSRRXITX LABEL request already in, chuck the parameters 0395A DCD3C000 7 REG 105 EXPCS R7 back to the caller 0395B C0520000 0 REG 106 STPVL R0 0395C 5D1F8001 6 STAK 107 LEAVE POP done here, return 108 * --- 109 110 END MSREADREQ subroutine 78 INPUT MSPROC mass storage driver 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 739 (MSPROC) F 43 Mass Storage Driver 3 4 BLOCK Mass Storage Driver 5 6 ENTRY MSPROC Try to schedule more I/O - entry from dispatcher 7 ENTRY MSPROCINT Disk interrupt - entry from interrupt handler 8 ENTRY MS_RESET Reset a controller - entry from INITIAL and DEADMAN 9 ENTRY CALCDRVADR Calculate drive's hardware address 10 ENTRY DISKWRUMASK WRU mask for DEADMAN 11 ENTRY DISKWRUVAL WRU value for DEADMAN 12 13 ********************************************************************************** 14 * * 15 * MASS STORAGE DATA STRUCTURES * 16 * * 17 * Each disk controller (BFDC - "Binary Formatted Disk * 18 * Controller") is represented by a block called an MCT * 19 * element (Mass storage ConTroller). These elements are * 20 * created at system initialization and never destroyed. * 21 * Each BFDC may have as many as eight disk drives * 22 * attached to it (only four unit cables are provided in the * 23 * production versions). Similarly, each MCT element points to * 24 * as many as eight MDV ("Mass storage DeVice") elements, each * 25 * of which describes one disk drive. The MDV elements are * 26 * dynamic. An MDV element is created whenever a drive comes * 27 * into existence by being powered on or having a unit plug * 28 * put into it, and an MDV element is destroyed whenever the * 29 * unit plug is removed from the drive or it is powered down. * 30 * Note that a drive that has power applied but no pack * 31 * spinning will retain an MDV element. * 32 * No operations other than head check are performed on a * 33 * drive unless it has a volume mounted on it. In this case, * 34 * the MDV contains the volume number of the volume mounted * 35 * there. The volume number is used to access the VOLN * 36 * ("VOLume Name") element, which describes the volume. * 37 * Pending I/O requests are represented by MSQ (Mass * 38 * Storage Queue") elements, which are chained off the VOLN * 39 * element in two queues: Read and Write. * 40 * Most read requests are the result of a page-fault. * 41 * The exceptions to this are the FORMAT and REINITIALIZE * 42 * operations, and the pre-fetching operation performed by * 43 * the backup requests. Each read should generally release * 44 * one or more processes from the MSWAIT queue. The read * 45 * requests come in five different flavors: normal, zeropage, * 46 * address-switch, format, and reinit. Normal requests are * 47 * handled by allocating a page of memory, and reading a * 48 * block from the disk. Zero-page requests are handled by * 49 * allocating a page of memory and zeroing it. Address- * 50 * switch requests require that a page be returned that * 51 * claims to be for one block, but the data has come from * 52 * a different block. * 53 * This is done by either: * 54 * a) Finding the real block on the idle page list and * 55 * converting it to the requested block, or * 56 * b) Finding the real block on the in-use page list, and * 57 * copying the data to another page of memory. Note that * 58 * if the page is resident, it MUST NOT be read in from * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 740 (MSPROC) F 43 Mass Storage Driver 59 * mass storage, since the resident version may have been * 60 * modified. Or, * 61 * c) Reading in the real block, then converting it to the * 62 * requested block. * 63 * * 64 * Neither FORMAT nor REINITIALIZE are reads in the * 65 * normal sense: they do not "read" the disk, and therefore * 66 * require no PPL. Instead, they are specialized functions * 67 * most readily processed via the disk read queue. They are * 68 * indicated by bits in the MSQ element control field. * 69 * FORMAT will seek to and format the track associated * 70 * with the specified disk address. Note that formatting * 71 * is inherently a full track operation, as it must wait for * 72 * the index and do a whole track to ensure correct timing. * 73 * REINITIALIZE causes the drive/pack information in the * 74 * MDV element to be reread from the disk. This is required * 75 * following initialization (formatting) of a previously * 76 * unreadable pack, because the current MDV info is incomplete. * 77 * * 78 * The write queue may contain MSQ elements representing * 79 * one of several different kinds of writes: * 80 * IDLE-WRITE or NORMAL-WRITE * 81 * These MSQ elements are created when a PAL with PAMODIFIED * 82 * set is destroyed. These writes are the normal mechanism by * 83 * which writes to mass storage are accomplished. * 84 * FORCE-WRITE * 85 * These MSQ elements are created when a force request is * 86 * made. They are essentially the same as the normal-write * 87 * elements except that the PPL is marked FWIP (force write * 88 * in progress). If the FWIP bit is set, any new reference * 89 * to the page so marked causes the referencing process to * 90 * be suspended. Therefore, when a disk write is completed a * 91 * process may need to be released from the MSWAIT queue, just * 92 * as for a read. This type of write also causes the block to * 93 * be write checked for accuracy. * 94 * DUAL-WRITE * 95 * These MSQ elements are created when a dual-write request is * 96 * made. This is done when a given page of memory must be * 97 * written to an address other than (or in addition to) the * 98 * one represented by its PPL. The XPTR field in the MSQ is * 99 * made to point to a phony PPL-FBI combination that is used * 100 * for the extra write. Following this write the XPTR is * 101 * cleared and the MSQ element looks like a normal force-write * 102 * element. A bit is available in the control field to * 103 * prevent the normal write from taking place. This allows a * 104 * page to be written to an extra place without disturbing the * 105 * original. This type of write also causes both blocks to be * 106 * write checked for accuracy. * 107 * * 108 * * 109 * LOCKS * 110 * * 111 * Generally, all lists are locked only while being * 112 * searched or altered. * 113 * MCTELOCK is set to indicate that some CPU is actively * 114 * talking to a disk controller. While the controller is * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 741 (MSPROC) F 43 Mass Storage Driver 115 * performing a data transfer operation, it is tied up and * 116 * cannot talk to anybody. In this case MCTBUSY is set. * 117 * While an MS request is being performed, the MSQ * 118 * element is left at the head of the queue. This allows * 119 * other processes to realize that the operation has already * 120 * been requested. Since we inspect the heads of the request * 121 * queues with them unlocked, nobody but us may remove an * 122 * element from the queue or put an element at the beginning * 123 * of a non-empty queue. We lock the queue before removing an * 124 * element, and everyone else locks the queue before adding an * 125 * element. The system has two global locks that are used to * 126 * lock the queues on all volumes simultaneously. The READ * 127 * queues are locked by MSQINLOCK, and the WRITE queues are * 128 * locked by MSQOUTLOCK. However, we must hold the MSQINLOCK * 129 * when manipulating the FWIP bit in a PPL at the conclusion * 130 * of a write. This is so that the page fault processor does * 131 * not suspend someone due to the FWIP at the same time that * 132 * we are clearing it. * 133 * * 134 * PROGRAM STRUCTURE * 135 * * 136 * The Mass Storage Driver consists of two sections: the * 137 * controller-scheduling section and the drive logic section. * 138 * The controller-scheduling section is always entered first. * 139 * Its job is to route control to the code for the various * 140 * drives at the appropriate times, so that any appropriate * 141 * activity can be done to the drive. The drive logic section * 142 * contains the code that performs the actual read and write * 143 * requests. * 144 * These two sections act as co-routines. Whenever the * 145 * code in the drive section reaches a critical point (for * 146 * example, wait for seek completion), it loads a code into R0 * 147 * and executes an "EXPCS MDV,MDVPC" instruction. This * 148 * transfers control to the scheduling section. Control will * 149 * return when the appropriate conditions are met. The drive * 150 * section loads one of the following codes into R0 before the * 151 * "EXPCS": * 152 * * 153 * MDVSTRUN - Run the drive code next time the scheduling * 154 * section is entered. This is what the drive * 155 * code does when there are no pending requests. * 156 * MDVSTSEEK - Run the drive code when it has seek end status. * 157 * This is what the drive does after starting up * 158 * a seek or rezero request. * 159 * MDVSTONCYL - Run the drive code after any other drive's * 160 * code that must be run. This is what a drive * 161 * does right before it starts something that * 162 * will tie up the controller. * 163 * MDVSTDT - The drive has just tied up the controller. * 164 * Run its code after the next interrupt from * 165 * the drive. Until then, no other drive on * 166 * the same controller can be run. * 167 * MDVSTKILL - Destroy the MDV for this drive. This is what * 168 * the drive code does when it discovers that * 169 * the physical disk drive no longer is responding. * 170 * MDVSTPFAIL - The drive routine was interrupted by a power * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 742 (MSPROC) F 43 Mass Storage Driver 171 * failure. The drive routine returns with this * 172 * code after power-fail restart, to let the * 173 * controller scheduler know that things need * 174 * to be reset. * 175 * * 176 * When the controller-scheduling section eventually * 177 * returns to the drive section (via "EXPCS MDV,MDVPC"), * 178 * registers R0:R2 have been altered, but R3:R7 have been * 179 * restored. Note that each drive has its own stack (as part * 180 * of the MDV element). * 181 * * 182 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 743 (MSPROC) F 43 Mass Storage Driver 184 185 * We generate the following trace events: 186 00000001 ABS 187 MSTENTER EQU 01 Enter MSPROC, R0=PageMap, R2=PpuStatus 00000002 ABS 188 MSTSEEK EQU 02 Start Seek, R0=Unit, R1=SeekAdr 00000003 ABS 189 MSTREAD EQU 03 Start Read, R0=Unit 00000004 ABS 190 MSTRDCHK EQU 04 Get Check Segment, R0 = unit 00000005 ABS 191 MSTWRITE EQU 05 Start Write, R0=Unit, R1=TimeCode 00000006 ABS 192 MSTCHECK EQU 06 Start Check, R0=Unit, R1=TimeCode 00000007 ABS 193 MSTREZERO EQU 07 Start Rezero, R0=Unit 00000008 ABS 194 MSTINTRPT EQU 08 Interrupt, R0=PageMap, R2=PpuStatus 00000009 ABS 195 MSTSKEND EQU 09 Seek End, R0=Unit, R1=BfdStatus 0000000A ABS 196 MSTTREND EQU 0A Xfer End, R0=Unit, R1=BfdStatus, R2=PpuStatus 0000000B ABS 197 MSTLEAVE EQU 0B Leave driver, R0=PageMap 0000000C ABS 198 MSTRESET EQU 0C Reset controller, R0=PageMap, R1=0 if controller dead 0000000D ABS 199 MSTGETID EQU 0D Get Drive Id, R0=Unit 0000000E ABS 200 MSTUNLOAD EQU 0E Unload Heads, R0=Unit 0000000F ABS 201 MSTFORMAT EQU 0F Format Track, R0=Unit 202 203 204 * Operation code values for error logging: 205 00000001 ABS 206 OPSEEK EQU 01 seek operation 00000002 ABS 207 OPREZERO EQU 02 rezero operation 00000003 ABS 208 OPREAD EQU 03 read operation 209 * EQU 04 unused - was "about to read check seg" 00000005 ABS 210 OPCHKSEG EQU 05 read check segment 00000006 ABS 211 OPWRITE EQU 06 write operation 00000007 ABS 212 OPCHECK EQU 07 write-check operation 00000008 ABS 213 OPOFFSET EQU 08 offset heads for read retry 00000009 ABS 214 OPFORMAT EQU 09 format operation 215 216 217 * BFD Status Masks 218 0395D FF00FF00 219 DISKWRUMASK VFD ONEBITS/DWRUTYPE*DWRUTYPE+ONEBITS/BFDIDSTEST*BFDIDSTEST 0395E 01000000 220 DISKWRUVAL VFD DVCTBFD*DWRUTYPE+0*BFDIDSTEST 221 0395F 0F000100 222 SEEKMASK VFD 1*BFDSSRDY+1*BFDSSONCYL+1*BFDSSSKERR+1*BFDSSFAULT+1*BFDSSRSPER 03960 08000000 223 SEEKING VFD 1*BFDSSRDY status while seeking 03961 0C000000 224 SEEKOK VFD 1*BFDSSRDY+1*BFDSSONCYL value if seek is normal 225 00016540 ABS 226 PPUMASK EQU 1*PPUITOUT+1*PPUIXTRA+1*PPUIDPPE+1*PPUICONF+1*PPUIMPE+1*PPUIBCNR 227 0F000000 ABS 228 MASK1 EQU 1*BFDSSRDY+1*BFDSSONCYL+1*BFDSSSKERR+1*BFDSSFAULT 00000F00 ABS 229 MASK2 EQU 1*BFDSSWCERR+1*BFDSSLOSTD+1*BFDSSIFPE+1*BFDSSRSPER 000000FF ABS 230 MASK3 EQU 7*BFDSSHDECD+1*BFDSSCEOV+0F*BFDSSERRCD 231 03962 0F000FFF 232 XFERMASK VFD MASK1+MASK2+MASK3 relevant bits of disk status 03963 0C000000 233 XFEROK VFD 1*BFDSSRDY+1*BFDSSONCYL good disk status 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 744 (MSPROC) F 43 Mass Storage Driver 235 236 ********************************************************************************** 237 * * 238 * DISK HEAD - CRASH CHECKING ALGORITHM: * 239 * The following parameters control the disk head-crash * 240 * checking algorithm: * 241 * * 242 * HDCHKINT - Number of seconds to wait after completing * 243 * the algorithm before doing it again. * 244 * HDCHKCNT1 - Number of tracks to read on each head when * 245 * the algorithm is run. * 246 * HDCHKERR1 - Number of errors that would cause us to do * 247 * more checking. If we get fewer than * 248 * 'HDCHKERR1' errors reading 'HDCHKCNT1' * 249 * tracks, we assume that the head has not * 250 * crashed. Otherwise, we continue checking. * 251 * HDCHKCNT2 - Number of tracks to read on a head that * 252 * has failed the first check. * 253 * HDCHKERR2 - Number of errors that would cause us to * 254 * unload the heads. If we get fewer than * 255 * 'HDCHKERR2' errors reading 'HDCHKCNT2' * 256 * tracks, then we assume that the head has * 257 * not crashed. Otherwise, we unload the heads. * 258 * HDCHKCYLM - Number of cylinders to move the heads between * 259 * two successive tracks. To guarantee that the * 260 * entire disk eventually gets covered, this number * 261 * should be relatively prime to both the number * 262 * of heads and the number of cylinders on a disk. * 263 * * 264 ********************************************************************************** 265 03964 00000078 266 HDCHKINT VFD 120 re-check after 2 minutes 03965 00000001 267 HDCHKCNT1 VFD 1 check one track on each head 03966 00000001 268 HDCHKERR1 VFD 1 one error causes us to look further 03967 00000019 269 HDCHKCNT2 VFD 25 check 25 tracks if we had errors 03968 0000000A 270 HDCHKERR2 VFD 10 ten errors cause us to unload the heads 03969 0000002F 271 HDCHKCYLM VFD 47 move 47 cylinders each time 272 273 ********************************************************************************** 274 * * 275 * DRIVE COROUTINE DELAY: * 276 * * 277 * Every once in a while we need to delay activity on a * 278 * drive for a period of time to allow the hardware logic to * 279 * clear itself up. Here is the length of time DRIVEPROC is * 280 * allowed to ignore a drive coroutine. * 281 * * 282 ********************************************************************************** 283 0396A 00000320 284 IDLEPERIOD VFD 800 delay in milliseconds 285 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 745 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 288 289 BLOCK Controller-Scheduling Section 290 291 ENTRY MSPROC Try to schedule something 292 ENTRY MSPROCINT Process an interrupt 293 ENTRY MS_RESET Reset the controller 294 295 ********************************************************************************** 296 * * 297 * This is the controller-scheduling section of the mass * 298 * storage driver. We have three entry points: MSPROC, * 299 * MSPROCINT, and MS_RESET. * 300 * * 301 * MSPROC is entered by the dispatcher when someone has * 302 * set the MSPROC flag. This is done when someone adds an I/O * 303 * request to an empty queue. MSPROC must loop through each * 304 * controller, attempting to start activity. It exits * 305 * directly to DISPATCH. * 306 * * 307 * MSPROCINT is entered by the interrupt handler when a * 308 * disk interrupt occurrs. It must update status according to * 309 * the interrupt, then start activity as necessary. It is * 310 * only necessary to look at one controller when entered via * 311 * MSPROCINT. It exits directly to DISPATCH. * 312 * * 313 * MS_RESET is called by INITIAL and DEADMAN to reset a * 314 * particular controller. It will update drive statuses, then * 315 * start any necessary activity on the drive. * 316 * * 317 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 746 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 319 320 ********************************************************************************** 321 * * 322 * MSPROC - Entry from Dispatcher. * 323 * * 324 * We are entered here when it may be possible to start * 325 * some new I/O operations. We must scan each controller and * 326 * each device in turn to see if it is possible. * 327 * * 328 * Exits to DISPATCH. * 329 * Eats R0:R5,R7. Unmaps CIX and WNDO4. * 330 * Stack required: 6 * 331 * 0 + max ( DODISK (6), LOCKWAIT (0), PROCESSINT (6), * 332 * TRACEPROC (3) ) * 333 * * 334 ********************************************************************************** 335 336 BLOCK MSPROC routine 337 ENTRY MSPROC 338 0000396B 339 MSPROC LABEL 0396B 61C01F13 7 340 LD MCT MCTLIST get pointer to first controller 0396C FBF03991 7 341 JZA MCT DONE jump if none (unusual, to say the least!) 342 * \ / 343 0000396D 344 LOOP LABEL 345 PFAILCHK DONE jump if power fail 0396D 5C00044E 345 CMZ POWERFLAG power-fail restart in progress? 0396E FE0C3991 345 JNE DONE jump if so 345 PFAILEN DONE else allow interrupt 0396F 60043991 0 IMM 345 LD R0 ADR DONE 03970 E400044F 0 345 ST R0 POWERUPLOC 03971 59C40800 IMM 345 IORMSR MSRPFINTE 345 PFAILDS then disallow interrupt 03972 59840800 IMM 345 CLBMSR MSRPFINTE 03973 EC00044F 345 STZ POWERUPLOC 346 PLOCK (MCT,MCTELOCK) 03974 0CC00000 346 IOFF 03975 D1D7C803 7 BASE 346 SETT (MCT,MCTELOCK) 03976 FE0C3978 346 JNE MA(2+DISPW MA 0) 03977 DC40308B 346 CALLNP LOCKWAIT 03978 5C09C014 7 ZBM 347 CMZ MCT,MCTBUSY is controller transferring data? 03979 FE0C398E 348 JNE CONTBUSY jump if so -- do nothing here 349 0397A 60C40086 3 IMM 350 LD PFPTR PNCIX page number of controller window 0397B 00D7C801 7 BASE 351 LDPF MCT,MCTPMVALUE map in the controller 0397C 5C09D014 7 ZBM 352 CMZ MCT,MCTDEAD is the controller being non-responsive? 0397D FE0C398D 353 JNE NOINT jump if dead 0397E 5C001800 354 CMZ CIX(PPUCABLED) see if responding now 0397F FE0C3982 355 JNE ALIVE jump if alive 03980 EDC9D014 7 ZBM 356 STW MCT,MCTDEAD otherwise, mark as dead 03981 FE0E398D 357 JMP NOINT 358 * --- 359 00003982 360 ALIVE LABEL 03982 60040028 0 IMM 361 LD R0 BFDFNDSINT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 747 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03983 E4001A20 0 362 ST R0 CIX(BFDFUNC) disable further interrupt requests 03984 60801801 2 363 LD R2 CIX(PPUINTSTAT) get current channel status 03985 6017C801 0 7 BASE 364 LD R0 MCT,MCTPMVALUE for trace 365 TRACE MSTRACE,MSTENTER enter - R0=PageMap, R2=PpuStatus 03986 5D401D2C 365 XCT TRACECALL(MSTRACE) 03987 FEC00001 365 NOP (MSTRACE*BITS 22:26)+(MSTENTER*BITS 27:31) 366 * \ / 03988 F2A8398E 2 367 JBF R2/PPUICIA CONTBUSY jump if another CPU just got interrupted 03989 F2B8398D 2 368 JBF R2/PPUIINTC NOINT jump if interrupt is not pending 0398A DC0039E4 369 CALL PROCESSINT post the interrupt 0398B 414AA100 2 CBM 370 PARV R2/BITS 16:31 channel status 0398C 40401802 371 PARVL CIX(PPUCHANS1) disk status 0000398D 372 NOINT LABEL 373 0398D DC403A51 374 CALLNP DODISK do any necessary disk activity 375 * \ / 376 0000398E 377 CONTBUSY LABEL 378 PUNLOCK (MCT,MCTELOCK) release the controller 0398E EC17C803 7 BASE 378 STZ (MCT,MCTELOCK) 0398F 0C800000 378 ION 03990 FBF6396D 7 379 LJNA MCT LOOP do next controller, if any 380 * \ / 381 00003991 382 DONE LABEL 03991 60C40086 3 IMM 383 LD PFPTR PNCIX page number of CIX 03992 80D2C000 3 REG 384 PFRC PFPTR unmap anything left here 03993 FE0E28B7 385 JMP DISPATCH exit to dispatcher 386 * --- 387 388 END MSPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 748 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 390 391 ********************************************************************************** 392 * * 393 * MSPROCINT - Entry from Interrupt Handler. * 394 * * 395 * We are entered here when an I/O interrupt for a disk * 396 * occurs. * 397 * On entry: * 398 * R2 = PPU status * 399 * R3 -> MCT * 400 * CIX is mapped to BFD controller. * 401 * Exit to DISPATCH * 402 * Eats R0:R5,R7. Unmaps CIX and WNDO4. * 403 * Stack required: 6 * 404 * 0 + max ( DODISK (6), LOCKWAIT (0), PROCESSINT (6), * 405 * TRACEPROC (3) ) * 406 * * 407 ********************************************************************************** 408 409 BLOCK MSPROCINT routine 410 ENTRY MSPROCINT process I/O interrupt 411 00003994 412 MSPROCINT LABEL 03994 61D2C000 7 3 REG 413 LD MCT R3 pointer to MCT element 414 PLOCK (MCT,MCTELOCK) lock the controller 03995 0CC00000 414 IOFF 03996 D1D7C803 7 BASE 414 SETT (MCT,MCTELOCK) 03997 FE0C3999 414 JNE MA(2+DISPW MA 0) 03998 DC40308B 414 CALLNP LOCKWAIT 03999 5C09D014 7 ZBM 415 CMZ MCT,MCTDEAD is the controller dead? 0399A FE0C39A4 416 JNE NOINT jump if controller presumed dead 0399B 6017C801 0 7 BASE 417 LD R0 MCT,MCTPMVALUE for trace 418 TRACE MSTRACE,MSTINTRPT trace - R0=PageMap, R2=PpuStatus 0399C 5D401D2C 418 XCT TRACECALL(MSTRACE) 0399D FEC00008 418 NOP (MSTRACE*BITS 22:26)+(MSTINTRPT*BITS 27:31) 419 * \ / 420 CLRTBIT MCT,MCTTIMEOUT clear the timeout flag 0399E 60021000 0 IMM 420 LD R0 1*BIT(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 0:4) 0399F A817C804 0 7 BASE 420 BRSBM R0 MCT,(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 15:31) 039A0 DC0039E4 421 CALL PROCESSINT post the interrupt 039A1 41528000 2 REG 422 PARV R2 PPU status 039A2 40401802 423 PARVL CIX(PPUCHANS1) disk status 424 * \ / 039A3 DC403A51 425 CALLNP DODISK schedule any disk activity 426 * \ / 427 000039A4 428 NOINT LABEL 039A4 60C40086 3 IMM 429 LD PFPTR PNCIX page number of controller window 039A5 80D2C000 3 REG 430 PFRC PFPTR unmap the controller 431 PUNLOCK (MCT,MCTELOCK) unlock the MCT element 039A6 EC17C803 7 BASE 431 STZ (MCT,MCTELOCK) 039A7 0C800000 431 ION 039A8 FE0E28B7 432 JMP DISPATCH exit to dispatcher 433 * --- 434 435 END MSPROCINT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 749 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 437 438 ********************************************************************************** 439 * * 440 * MS_RESET - Reset a BFD Controller. * 441 * * 442 * This routine will reset and re-initialize a BFD * 443 * controller. We are called at initialization, and later if * 444 * requests are queued on a device but nothing has happened * 445 * for at least 10 seconds. * 446 * We go to the effort of determining whether, if the * 447 * controller is alive, there is only one unit that is * 448 * seeking or awaiting end of transfer. We take a skip * 449 * return and give the unit number if it is true. This is * 450 * intended to point a finger at an unresponsive drive if * 451 * we were called after the 10 second timeout. * 452 * * 453 * LD R5 => MCT element * 454 * PLOCK (R5,MCTELOCK) * 455 * CIX mapped to BFD controller * 456 * LD R0 0 if PPU is dead * 457 * CALLNP MS_RESET * 458 * JMP * 459 * * 460 * * 461 * Registers Used: R0:R4 * 462 * Stack Required: 8 * 463 * 2 + max ( CANCELTMR (6), DISKCHECK (2), DODISK (6), * 464 * TRACEPROC (3) ) * 465 * * 466 ********************************************************************************** 467 468 BLOCK MS_RESET subroutine 469 ENTRY MS_RESET reset the controller 470 471 BEGFRAME 00178801 6 BASE 472 SAVER7 BSS 1 save area for R7 473 ENDFRAME 474 475 * we have bits 0:9 in R7 available, here we use 0:6 00000040 BYTE 476 DCNT EQU BITS 0:LOGUPC count of disks we bumped (must count 0:8) 00000830 BYTE 477 DNUM EQU BITS (LOGUPC+1):(2*LOGUPC) last one we bumped if DCNT <> 0 478 039A9 DD5F8002 6 STAK 479 MS_RESET ENTRNP PUSH 039AA EC0BC040 7 CBM 480 STZ R7/DCNT say no disks reset yet 039AB E5D78801 7 6 BASE 481 ST R7 SP,SAVER7 save volatile register 039AC 60520000 1 0 REG 482 LD R1 R0 R1 = 0 if BFD dead 039AD 61D34000 7 5 REG 483 LD MCT R5 load pointer to MCT 039AE 60C40086 3 IMM 484 LD PFPTR PNCIX get the I/O window page number 039AF 80920000 0 REG 485 PFRD R0 find the page map value to access controller 486 TRACE MSTRACE,MSTRESET Reset controller, R0=PageMap, R1=0 if cntlr dead 039B0 5D401D2C 486 XCT TRACECALL(MSTRACE) 039B1 FEC0000C 486 NOP (MSTRACE*BITS 22:26)+(MSTRESET*BITS 27:31) 039B2 FA4C39B5 1 487 JNEZ R1 ALIVE jump if controller acts alive 039B3 EDC9D014 7 ZBM 488 STW MCT,MCTDEAD otherwise, mark as dead 039B4 FE0E39BD 489 JMP NORESET and save energy 490 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 750 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 491 000039B5 492 ALIVE LABEL 039B5 EC09D014 7 ZBM 493 STZ MCT,MCTDEAD mark controller alive 039B6 EC001801 494 STZ CIX(PPUABORT) clear out the PPU channel 495 039B7 60040028 0 IMM 496 LD R0 BFDFNDSINT code for disable interrupts 039B8 E4001A20 0 497 ST R0 CIX(BFDFUNC) and issue 039B9 60040021 0 IMM 498 LD R0 BFDFNSISE code for select interrupt on seek end 039BA E4001A20 0 499 ST R0 CIX(BFDFUNC) and issue 039BB 60040014 0 IMM 500 LD R0 BFDFNSOLNT code for select off-line interrupt 039BC E4001A20 0 501 ST R0 CIX(BFDFUNC) and issue 502 * \ / 503 000039BD 504 NORESET LABEL 039BD 6109CA34 4 7 ZBM 505 LD R4 MCT,MCTMAXUNIT start with largest unit number 000039BE 506 UNITLOOP LABEL 039BE 615DE005 5 74 BASE 507 LD MDV MCT,MCTDRIVE(R4) get MDV pointer 039BF FB7039D6 5 508 JZA MDV UNITNEXT jump if none here 039C0 60094231 0 5 ZBM 509 LD R0 MDV,MDVSTATE get current state 039C1 5CA039C2 0 510 LDPC JUMPTAB(R0) branch according to it 511 * --- 512 000039C2 513 JUMPTAB LABEL 039C2 000039D6 514 ADR UNITNEXT 0 - initialize 039C3 000039D6 515 ADR UNITNEXT 1 - runnable 039C4 000039CA 516 ADR UNITRESET 2 - seeking 039C5 000039D6 517 ADR UNITNEXT 3 - transfer start wait 039C6 000039CA 518 ADR UNITRESET 4 - transfer end wait 039C7 000039D6 519 ADR UNITNEXT 5 - destroy MDV 039C8 000039D6 520 ADR UNITNEXT 6 - interrupted by power failure 039C9 000039E1 521 ADR UNITCANIDL 7 - idling 522 000039CA 523 UNITRESET LABEL 039CA 6007FFFF 0 IMM 524 LD R0 ONEBITS get a really bad status 039CB 5C09D014 7 ZBM 525 CMZ MCT,MCTDEAD check for controller dead 039CC FE0C39D1 526 JNE HAVESTAT use really bad stuff if controller dead 039CD D0098041 6 ZBM 527 INC SP,SAVER7/DCNT inc the counter 039CE E5098831 4 6 ZBM 528 ST R4 SP,SAVER7/DNUM record this unit number 039CF 60281A28 0 4 529 LD R0 CIX(BFDSS+BFDSELECTB)(R4) get unit status 039D0 7C020400 0 IMM 530 IOR R0 1*BFDSSSKERR claim seek error 000039D1 531 HAVESTAT LABEL 039D1 E4174809 0 5 BASE 532 ST R0 MDV,MDVBFDSTAT save status 039D2 60050000 0 IMM 533 LD R0 1*PPUITOUT indicate deadman timeout 039D3 E417480A 0 5 BASE 534 ST R0 MDV,MDVPPUSTAT indicate deadman timeout in PPU status 000039D4 535 RUNIT LABEL 039D4 60040001 0 IMM 536 LD R0 MDVSTRUN get new state code 039D5 E4094231 0 5 ZBM 537 ST R0 MDV,MDVSTATE set state = runnable 538 * \ / 539 000039D6 540 UNITNEXT LABEL 039D6 FB2639BE 4 541 JDR R4 UNITLOOP do all units 542 * \ / 543 039D7 DC403A15 544 CALLNP DISKCHECK check presence of disks 039D8 DC403A51 545 CALLNP DODISK perform necessary disk activity 546 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 751 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 039D9 6153C000 5 7 REG 547 LD R5 MCT restore R5 039DA 61D78801 7 6 BASE 548 LD R7 SP,SAVER7 restore return register 549 039DB 600BC040 0 7 CBM 550 LD R0 R7/DCNT count of units bumped 039DC 64040001 0 IMM 551 CPR R0 1 exactly one? 039DD FE0C39E0 552 JNE MREXIT jump if not 039DE 610BC830 4 7 CBM 553 LD R4 R7/DNUM call this the culprit 039DF 61D7D001 7 7 REG 554 LD R7 R7+1 bump the return address 555 * \ / 556 000039E0 557 MREXIT LABEL 039E0 5D1F8002 6 STAK 558 LEAVE POP return to caller 559 * --- 560 000039E1 561 UNITCANIDL LABEL 039E1 DC003B80 562 CALL CANCELTMR remove idler interrupt, if any 039E2 40174813 5 BASE 563 PARL MDV,MDVIDLESER pass serial number field 039E3 FE0E39D4 564 JMP RUNIT then let the thing run 565 * --- 566 567 END MS_RESET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 752 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 569 570 ********************************************************************************** 571 * * 572 * PROCESSINT - Post an Interrupt Request. * 573 * * 574 * This routine will awaken any drives for which a seek * 575 * or data transfer has completed. It will also handle * 576 * offline interrupt requests. * 577 * * 578 * LD MCT => MCT element * 579 * CALL PROCESSINT * 580 * PARV PPU status * 581 * PARVL BFD status * 582 * * 583 * Registers Used: R0:R5 * 584 * Stack Required: 6 * 585 * 3 + max ( DISKCHECK (2), TRACEPROC (3) ) * 586 * * 587 ********************************************************************************** 588 589 BLOCK PROCESSINT subroutine 590 ENTRY PROCESSINT 591 592 BEGFRAME 00178801 6 BASE 593 PPUSTAT BSS 1 interrupting PPU status 00178802 6 BASE 594 BFDSTAT BSS 1 interrupting disk status 595 ENDFRAME 596 039E4 DD1F8003 6 STAK 597 PROCESSINT ENTR PUSH 039E5 C1578801 6 BASE 598 STPV SP,PPUSTAT 039E6 C0578802 6 BASE 599 STPVL SP,BFDSTAT 039E7 E1D78800 7 6 BASE 600 EXCH R7 SP,0 get MCT pointer 601 039E8 6009CA34 0 7 ZBM 602 LD R0 MCT,MCTMAXUNIT start at the largest unit 000039E9 603 UNITLOOP LABEL 039E9 615DC005 5 70 BASE 604 LD MDV MCT,MCTDRIVE(R0) get MDV pointer 039EA FB703A0F 5 605 JZA MDV UNITNEXT jump if no unit here 039EB 60C94231 3 5 ZBM 606 LD R3 MDV,MDVSTATE get current state 039EC 5CA639ED 3 607 LDPC STATETAB(R3) branch depending on state 608 * --- 609 000039ED 610 STATETAB LABEL 039ED 00003A0F 611 ADR UNITNEXT 0 - initialize 039EE 00003A0F 612 ADR UNITNEXT 1 - runnable 039EF 000039F5 613 ADR SEEKENDTST 2 - waiting for seek end 039F0 00003A0F 614 ADR UNITNEXT 3 - waiting to start transfer 039F1 00003A01 615 ADR XFEREND 4 - transfer end 039F2 00003A0F 616 ADR UNITNEXT 5 - destroy MDV 039F3 00003A0F 617 ADR UNITNEXT 6 - interrupted by power failure 039F4 00003A0F 618 ADR UNITNEXT 7 - idling 619 000039F5 620 SEEKENDTST LABEL 039F5 70C95231 3 5 ZBM 621 LDN R3 MDV,MDVCABLE get cable position, negated 039F6 39099E12 4 6 ZBM 622 LEA R4 SP,BFDSTAT/BIT 15 039F7 5C1B1C00 43 @R 623 CMZ @R4(R3) is this drive at seek end? 039F8 FE023A0F 624 JEQ UNITNEXT jump if not 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 753 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 039F9 60578802 1 6 BASE 625 LD R1 SP,BFDSTAT get status 039FA 70D2C000 3 3 REG 626 LDN R3 R3 get cable number 039FB 64CA6030 3 1 CBM 627 CPR R3 R1/BFDSSDNUM is this our status? 039FC FE0239FE 628 JEQ HAVESTAT jump if yes 039FD 60601A28 1 0 629 LD R1 CIX(BFDSS+BFDSELECTB)(R0) get correct status 000039FE 630 HAVESTAT LABEL 631 TRACE MSTRACE,MSTSKEND seek end, R0=unit, R1=status 039FE 5D401D2C 631 XCT TRACECALL(MSTRACE) 039FF FEC00009 631 NOP (MSTRACE*BITS 22:26)+(MSTSKEND*BITS 27:31) 03A00 FE0E3A0C 632 JMP SAVESTAT 633 * --- 634 00003A01 635 XFEREND LABEL 03A01 60D61001 3 0 REG 636 LD R3 R0+1 03A02 64C9CA34 3 7 ZBM 637 CPR R3 MCT,MCTMAXUNIT greater than the rest 03A03 FE0A3A05 638 JLE UNITFINE jump if unit still in range 03A04 EC12C000 3 REG 639 STZ R3 start at the bottom 640 * \ / 641 00003A05 642 UNITFINE LABEL 03A05 E4C9C234 3 7 ZBM 643 ST R3 MCT,MCTUNIT change unit for start of scan 03A06 60978801 2 6 BASE 644 LD R2 SP,PPUSTAT 03A07 E497480A 2 5 BASE 645 ST R2 MDV,MDVPPUSTAT save PPU status 03A08 60578802 1 6 BASE 646 LD R1 SP,BFDSTAT 03A09 E657480B 125 BASE 647 ST2 R1 MDV,MDVLOPSTAT save last operation status 648 TRACE MSTRACE,MSTTREND xfer end, R0=unit, R1=BfdStat, R2=PpuStat 03A0A 5D401D2C 648 XCT TRACECALL(MSTRACE) 03A0B FEC0000A 648 NOP (MSTRACE*BITS 22:26)+(MSTTREND*BITS 27:31) 649 * \ / 650 00003A0C 651 SAVESTAT LABEL 03A0C E4574809 1 5 BASE 652 ST R1 MDV,MDVBFDSTAT save disk status 03A0D 60440001 1 IMM 653 LD R1 MDVSTRUN 03A0E E4494231 1 5 ZBM 654 ST R1 MDV,MDVSTATE set drive runnable 655 * \ / 656 00003A0F 657 UNITNEXT LABEL 03A0F FA2639E9 0 658 JDR R0 UNITLOOP do next unit 659 * \ / 660 03A10 60578802 1 6 BASE 661 LD R1 SP,BFDSTAT get interrupting status 03A11 F2403A13 1 662 JBF R1/BFDSSOLINT NOTOFFL jump if not offline interrupt request 03A12 DC403A15 663 CALLNP DISKCHECK else do offline stuff 00003A13 664 NOTOFFL LABEL 665 03A13 E1D78800 7 6 BASE 666 EXCH R7 SP,0 restore return pointer 03A14 5D1F8003 6 STAK 667 LEAVE POP 668 * --- 669 670 END PROCESSINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 754 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 672 673 ********************************************************************************** 674 * * 675 * DISKCHECK - Check Presence of Disks. * 676 * * 677 * This routine will create an MDV for each drive that is * 678 * present but does not already have an MDV, and will set any * 679 * drive runnable that is not already so. * 680 * * 681 * LD R7 => MCT element * 682 * CALLNP DISKCHECK * 683 * * 684 * Eats R0:R5. * 685 * Stack required: 2 * 686 * 1 + max ( LOCKLIST (1), SGETMEM (0), UNLOCKLIST (1), * 687 * ZEROIT (1) ) * 688 * * 689 ********************************************************************************** 690 691 BLOCK DISKCHECK subroutine 692 ENTRY DISKCHECK 693 694 BEGFRAME 695 ENDFRAME 696 03A15 DD5F8001 6 STAK 697 DISKCHECK ENTRNP PUSH 03A16 E1D78800 7 6 BASE 698 EXCH R7 SP,0 get MCT pointer 03A17 61040000 4 IMM 699 LD R4 0 make fake presence bits 03A18 5C09D014 7 ZBM 700 CMZ MCT,MCTDEAD check for dead controller 03A19 FE0C3A1C 701 JNE NOSTAT jump if controller not responding 03A1A 61001A40 4 702 LD R4 CIX(BFDEF9A) get word containing disk presence bits 03A1B 610B2080 4 4 CBM 703 LD R4 R4/BFDPRESENT bits 24:31 = units 7..0 00003A1C 704 NOSTAT LABEL 03A1C 60840007 2 IMM 705 LD R2 UPC-1 unit number index 706 * \ / 707 00003A1D 708 UNITLOOP LABEL 03A1D 615DD005 5 72 BASE 709 LD MDV MCT,MCTDRIVE(R2) get MDV pointer 03A1E FB723A3D 5 710 JNZA MDV HAVEMDV jump if it exists 03A1F F3303A4C 4 711 JBF R4/BIT 24 UNITNEXT jump if it shouldn't exist 712 * \ / 713 714 ********************************************************************************** 715 * * 716 * Create a new MDV. Note that we can get away with several * 717 * stores into the first word of a new MDV element without using * 718 * read-modify-writes, because nobody else can possibly be looking * 719 * at it until we put it onto the MDVLIST. * 720 * * 721 ********************************************************************************** 722 723 * \ / 03A20 DC002ED0 724 CALL SGETMEM get some storage for it 03A21 40440005 IMM 725 PARVL MDVLOG 03A22 61520000 5 0 REG 726 LD MDV R0 the pointer to the block 03A23 DC003090 727 CALL ZEROIT remove unwanted garbage 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 755 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03A24 41174800 5 BASE 728 PAR MDV,0 03A25 40440020 IMM 729 PARVL 2 POWER MDVLOG 03A26 E5C95F11 7 5 ZBM 730 ST MCT MDV,MDVCNTL enter pointer to its controller 03A27 E4895830 2 5 ZBM 731 ST R2 MDV,MDVUNIT enter the unit number 03A28 6009C841 0 7 ZBM 732 LD R0 MCT,MCTPMVALUE/PFSLOT 03A29 1C040028 0 IMM 733 MUL R0 40 03A2A 1809F021 0 7 ZBM 734 ADD R0 MCT,MCTPMVALUE/PPUCHAN 03A2B 1C040028 0 IMM 735 MUL R0 40 03A2C 18128000 0 2 REG 736 ADD R0 R2 03A2D 18003A50 0 737 ADD R0 DISKNAME R1=drive name ("DSKxxx") 03A2E E4174805 0 5 BASE 738 ST R0 MDV,MDVNAME enter in element 03A2F DC003096 739 CALL LOCKLIST get access to the MDV list 03A30 40001F14 740 PARL MDVLOCK 03A31 E55DD005 5 72 BASE 741 ST MDV MCT,MCTDRIVE(R2) point controller to new unit 03A32 60001F15 0 742 LD R0 MDVLIST 03A33 E4095F10 0 5 ZBM 743 ST R0 MDV,MDVLINK 03A34 E5401F15 5 744 ST MDV MDVLIST link new element into list 03A35 DC0030A4 745 CALL UNLOCKLIST release the list 03A36 40001F14 746 PARL MDVLOCK 03A37 60128000 0 2 REG 747 LD R0 R2 place unit number in temp register 03A38 5409CA34 0 7 ZBM 748 MAX R0 MCT,MCTMAXUNIT see if new one is larger 03A39 E409CA34 0 7 ZBM 749 ST R0 MCT,MCTMAXUNIT only the driver knows for sure 03A3A 60040000 0 IMM 750 LD R0 MDVSTINIT 03A3B E4094231 0 5 ZBM 751 ST R0 MDV,MDVSTATE set state to initialize 03A3C FE0E3A4C 752 JMP UNITNEXT and process next unit 753 * --- 754 00003A3D 755 HAVEMDV LABEL 756 SETTBIT MDV,MDVCHKSTAT set to check state 03A3D 60020080 0 IMM 756 LD R0 1*BIT(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 0:4) 03A3E FC174800 0 5 BASE 756 IORM R0 MDV,(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 15:31) 03A3F 60094231 0 5 ZBM 757 LD R0 MDV,MDVSTATE get current state 03A40 64040002 0 IMM 758 CPR R0 MDVSTSEEK are we seeking? 03A41 FE0C3A4C 759 JNE UNITNEXT jump if not - no action necessary 03A42 6007FFFF 0 IMM 760 LD R0 ONEBITS get really bad status 03A43 5C09D014 7 ZBM 761 CMZ MCT,MCTDEAD check for dead controller 03A44 FE0C3A49 762 JNE ENDSEEK jump if dead controller 03A45 60241A28 0 2 763 LD R0 CIX(BFDSS+BFDSELECTB)(R2) get current drive status 03A46 6040395F 1 764 LD R1 SEEKMASK mask of relevant seek bits 03A47 6C003960 01 765 MCPR R0 SEEKING is drive still seeking? 03A48 FE023A4C 766 JEQ UNITNEXT jump if so 00003A49 767 ENDSEEK LABEL 03A49 E4174809 0 5 BASE 768 ST R0 MDV,MDVBFDSTAT else save the status 03A4A 60040001 0 IMM 769 LD R0 MDVSTRUN 03A4B E4094231 0 5 ZBM 770 ST R0 MDV,MDVSTATE and set state = runnable 771 * \ / 772 00003A4C 773 UNITNEXT LABEL 03A4C 610B0200 4 4 CBM 774 LD R4 R4/BITS 1:0 shift R4 left one 03A4D FAA63A1D 2 775 JDR R2 UNITLOOP and do next unit 776 * \ / 777 03A4E E1D78800 7 6 BASE 778 EXCH R7 SP,0 restore return link 03A4F 5D1F8001 6 STAK 779 LEAVE POP 780 * --- 781 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 756 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03A50 59F45869 782 DISKNAME PAK6 DSK000 skeleton disk name 783 784 END DISKCHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 757 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 786 787 ********************************************************************************** 788 * * 789 * DODISK - Disk Activity Scheduler. * 790 * * 791 * This routine will inspect each drive in turn, running * 792 * each one whose state is runnable. Then it will run the * 793 * first one whose state is on cylinder (so it can start a * 794 * transfer). * 795 * * 796 * LD R7 => MCT element * 797 * CALLNP DODISK * 798 * * 799 * Eats R0:R5. * 800 * Stack required: 6 * 801 * 3 + max ( LOCKLIST (1), SFREEMEM (0), TRACEPROC (3), * 802 * UNLOCKLIST (1) ) * 803 * * 804 ********************************************************************************** 805 806 BLOCK DODISK subroutine 807 ENTRY DODISK 808 809 BEGFRAME 00178801 6 BASE 810 UNIT BSS 1 current unit number to scan 00178802 6 BASE 811 XFERMDV BSS 1 address of MDV for data transfer 812 ENDFRAME 813 03A51 DD5F8003 6 STAK 814 DODISK ENTRNP PUSH 03A52 E1D78800 7 6 BASE 815 EXCH R7 SP,0 restore MCT pointer 816 * \ / 817 00003A53 818 DODISK1 LABEL take it again from the top 03A53 EC178802 6 BASE 819 STZ SP,XFERMDV say no unit found for data transfer 03A54 6009C234 0 7 ZBM 820 LD R0 MCT,MCTUNIT get starting unit number 821 * \ / 822 00003A55 823 DRIVELOOP LABEL try next drive 03A55 E4178801 0 6 BASE 824 ST R0 SP,UNIT current unit number to process 03A56 615DC005 5 70 BASE 825 LD MDV MCT,MCTDRIVE(R0) get MDV element 03A57 FB703A9A 5 826 JZA MDV DRIVENEXT jump if none 827 PFAILCHK RETURN quit if power failed 03A58 5C00044E 827 CMZ POWERFLAG power-fail restart in progress? 03A59 FE0C3AC2 827 JNE RETURN jump if so 827 PFAILEN RETURN else allow interrupt 03A5A 60043AC2 0 IMM 827 LD R0 ADR RETURN 03A5B E400044F 0 827 ST R0 POWERUPLOC 03A5C 59C40800 IMM 827 IORMSR MSRPFINTE 827 PFAILDS then disallow interrupt 03A5D 59840800 IMM 827 CLBMSR MSRPFINTE 03A5E EC00044F 827 STZ POWERUPLOC 03A5F 60094231 0 5 ZBM 828 LD R0 MDV,MDVSTATE get state of drive 03A60 5CA03A61 0 829 LDPC STATETAB1(R0) jump depending on state 830 * --- 831 00003A61 832 STATETAB1 LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 758 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03A61 00003A69 833 ADR INITDRIVE 0 - initialize drive 03A62 00003A6B 834 ADR RUNDRIVE 1 - runnable 03A63 00003A9A 835 ADR DRIVENEXT 2 - seeking 03A64 00003A7E 836 ADR CHECKTRAN 3 - waiting to start data transfer 03A65 00003A9A 837 ADR DRIVENEXT 4 - transfer in progress (can't happen) 03A66 00003A82 838 ADR DESTROYMDV 5 - destroy this MDV element 03A67 00003A6B 839 ADR RUNDRIVE 6 - interrupted by power failure 03A68 00003A9A 840 ADR DRIVENEXT 7 - idling 841 842 ********************************************************************************** 843 * * 844 * Drive is just starting up. Set initial entry point * 845 * into drive coroutine, then let it run. * 846 * * 847 ********************************************************************************** 848 00003A69 849 INITDRIVE LABEL initialize the drive 03A69 60043AC4 0 IMM 850 LD R0 ADR DRIVEPROC get initial program counter 03A6A E417481B 0 5 BASE 851 ST R0 MDV,MDVPC and save it 852 * \ / 853 854 ********************************************************************************** 855 * * 856 * Let drive coroutine execute from just after its most * 857 * recent EXPCS. * 858 * * 859 ********************************************************************************** 860 861 * \ / 00003A6B 862 RUNDRIVE LABEL run this drive 03A6B 62D7481C 345 BASE 863 LD2 R3 MDV,MDVSAVER34 restore these regs 03A6C 6009D014 0 7 ZBM 864 LD R0 MCT,MCTDEAD get dead indicator 03A6D E397481E 675 BASE 865 EXCH2 R6 MDV,MDVSAVER67 save our regs, get drive's regs 03A6E DCD7481B 5 BASE 866 EXPCS MDV,MDVPC go to drive code 867 * \ / 868 * Here, R0 = new state for drive 869 * \ / 03A6F E397481E 675 BASE 870 EXCH2 R6 MDV,MDVSAVER67 save drive's regs, get ours 03A70 E6D7481C 345 BASE 871 ST2 R3 MDV,MDVSAVER34 save drive's regs 03A71 E4094231 0 5 ZBM 872 ST R0 MDV,MDVSTATE save new state 03A72 5CA03A73 0 873 LDPC STATETAB2(R0) jump depending on new state 874 * --- 875 00003A73 876 STATETAB2 LABEL 03A73 00003A9A 877 ADR DRIVENEXT 0 - initialize (can't happen) 03A74 00003A9A 878 ADR DRIVENEXT 1 - runnable (next time) 03A75 00003A7B 879 ADR DIDSEEK 2 - seeking 03A76 00003A7E 880 ADR CHECKTRAN 3 - wants to start data transfer 03A77 00003AB2 881 ADR CONTBUSY 4 - has started data transfer 03A78 00003A82 882 ADR DESTROYMDV 5 - destroy this drive's MDV 03A79 00003AC2 883 ADR RETURN 6 - interrupted by power failure 03A7A 00003A9A 884 ADR DRIVENEXT 7 - idling 885 886 ********************************************************************************** 887 * * 888 * Here, we just started a seek. Clear the timeout * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 759 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 889 * indicator. * 890 * * 891 ********************************************************************************** 892 00003A7B 893 DIDSEEK LABEL 894 CLRTBIT MCT,MCTTIMEOUT clear the timeout indicator 03A7B 60021000 0 IMM 894 LD R0 1*BIT(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 0:4) 03A7C A817C804 0 7 BASE 894 BRSBM R0 MCT,(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 15:31) 03A7D FE0E3A9A 895 JMP DRIVENEXT 896 * --- 897 898 ********************************************************************************** 899 * * 900 * Here, a drive wants to start a data transfer. * 901 * Remember it. * 902 * * 903 ********************************************************************************** 904 00003A7E 905 CHECKTRAN LABEL 03A7E 5C178802 6 BASE 906 CMZ SP,XFERMDV one already set up? 03A7F FE0C3A9A 907 JNE DRIVENEXT jump if so, we will be found later 03A80 E5578802 5 6 BASE 908 ST MDV SP,XFERMDV else remember which MDV 03A81 FE0E3A9A 909 JMP DRIVENEXT do next drive 910 * --- 911 912 ********************************************************************************** 913 * * 914 * Here, we should destroy the MDV of a drive. * 915 * Recalculate highest unit number on controller. * 916 * * 917 ********************************************************************************** 918 00003A82 919 DESTROYMDV LABEL 03A82 60095830 0 5 ZBM 920 LD R0 MDV,MDVUNIT get unit number 03A83 EC1DC005 70 BASE 921 STZ MCT,MCTDRIVE(R0) remove pointer in MCT 03A84 60040007 0 IMM 922 LD R0 UPC-1 start at the very top 923 * \ / 924 00003A85 925 MAXLOOP LABEL 03A85 5C1DC005 70 BASE 926 CMZ MCT,MCTDRIVE(R0) MDV element with this unit number 03A86 FE0C3A88 927 JNE FOUNDMAX if non-zero found the max 03A87 FA223A85 0 928 DRJ R0 MAXLOOP back around, note we skip zero 929 * \ / 930 00003A88 931 FOUNDMAX LABEL 03A88 E409CA34 0 7 ZBM 932 ST R0 MCT,MCTMAXUNIT save away for later use 03A89 6409C234 0 7 ZBM 933 CPR R0 MCT,MCTUNIT compare against the starting unit 03A8A FE063A8C 934 JGE UNITEXIST jump if starting unit still in good range 03A8B E409C234 0 7 ZBM 935 ST R0 MCT,MCTUNIT readjust starting unit number 936 * \ / 937 00003A8C 938 UNITEXIST LABEL 03A8C DC003096 939 CALL LOCKLIST lock the MDV list 03A8D 40001F14 940 PARL MDVLOCK 03A8E 60441F15 1 IMM 941 LD R1 ADR MDVLIST get pointer to head of list 03A8F 3D485F10 5 1 ZBM 942 LSRCH MDV R1,MDVLINK find our predecessor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 760 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03A90 FE023A92 943 JEQ FOUNDIT jump if found 03A91 00130104 944 HALT HALTS0104 our MDV is not in the list 945 * --- 946 00003A92 947 FOUNDIT LABEL 03A92 60095F10 0 5 ZBM 948 LD R0 MDV,MDVLINK R0 := adr next 03A93 740B5F10 0 5 CBM 949 XOR R0 MDV/FLDADRS R0 := (adr next) XOR (adr us) 03A94 F4164800 0 1 BASE 950 XORM R0 R1,MDVWORDA MDVLINK := adr next 951 * The above convolutions were necessary 952 * to update using read-modify-write. 03A95 DC0030A4 953 CALL UNLOCKLIST unlock the MDV list 03A96 40001F14 954 PARL MDVLOCK 03A97 DC002F5D 955 CALL SFREEMEM free up the MDV 03A98 41440005 IMM 956 PARV MDVLOG its length 03A99 40534000 5 REG 957 PARVL MDV its address 958 * \ / 959 960 ********************************************************************************** 961 * * 962 * Move on to the next drive, if any, on the controller. * 963 * * 964 ********************************************************************************** 965 966 * \ / 00003A9A 967 DRIVENEXT LABEL 03A9A BC178801 0 6 BASE 968 INCL R0 SP,UNIT get next unit number 03A9B 6409CA34 0 7 ZBM 969 CPR R0 MCT,MCTMAXUNIT compare against the maximum unit number 03A9C FE0A3A9E 970 JLE UNITLOW jump if unit number NOT over the max 03A9D EC120000 0 REG 971 STZ R0 start at the bottom 972 * \ / 973 00003A9E 974 UNITLOW LABEL 03A9E 6409C234 0 7 ZBM 975 CPR R0 MCT,MCTUNIT back to start? 03A9F FE0C3A55 976 JNE DRIVELOOP loop if not 977 * \ / 978 979 ********************************************************************************** 980 * * 981 * Done with general processing on all units of this * 982 * controller. If someone wanted to start a data transfer, do * 983 * it now. * 984 * * 985 ********************************************************************************** 986 987 * \ / 03AA0 61578802 5 6 BASE 988 LD MDV SP,XFERMDV get unit for data transfer 03AA1 FB703AB6 5 989 JZA MDV NODATAXFER jump if none 990 PFAILCHK RETURN quit if power failing 03AA2 5C00044E 990 CMZ POWERFLAG power-fail restart in progress? 03AA3 FE0C3AC2 990 JNE RETURN jump if so 990 PFAILEN RETURN else allow interrupt 03AA4 60043AC2 0 IMM 990 LD R0 ADR RETURN 03AA5 E400044F 0 990 ST R0 POWERUPLOC 03AA6 59C40800 IMM 990 IORMSR MSRPFINTE 990 PFAILDS then disallow interrupt 03AA7 59840800 IMM 990 CLBMSR MSRPFINTE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 761 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03AA8 EC00044F 990 STZ POWERUPLOC 03AA9 62D7481C 345 BASE 991 LD2 R3 MDV,MDVSAVER34 get drive's registers 03AAA 6009D014 0 7 ZBM 992 LD R0 MCT,MCTDEAD get dead indicator 03AAB E397481E 675 BASE 993 EXCH2 R6 MDV,MDVSAVER67 save our regs, get drive's 03AAC DCD7481B 5 BASE 994 EXPCS MDV,MDVPC and go do him 995 * \ / 996 * Here, R0 is drive's new state. Normally it will be MDVSTDT 997 * (data transfer in progress), but in strange cases it could 998 * be something else. If so, we must re-scan the whole 999 * controller, because someone else may have wanted to start 1000 * a data transfer operation. 1001 * \ / 03AAD E397481E 675 BASE 1002 EXCH2 R6 MDV,MDVSAVER67 save drive's registers, get ours 03AAE E6D7481C 345 BASE 1003 ST2 R3 MDV,MDVSAVER34 save drive's registers 03AAF E4094231 0 5 ZBM 1004 ST R0 MDV,MDVSTATE save new state 03AB0 64040004 0 IMM 1005 CPR R0 MDVSTDT data transfer now in progress? 03AB1 FE0C3A53 1006 JNE DODISK1 if not, start all over 1007 * \ / 1008 1009 ********************************************************************************** 1010 * * 1011 * Controller can not be disturbed. * 1012 * * 1013 ********************************************************************************** 1014 1015 * \ / 00003AB2 1016 CONTBUSY LABEL 1017 CLRTBIT MCT,MCTTIMEOUT clear the timeout indicator 03AB2 60021000 0 IMM 1017 LD R0 1*BIT(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 0:4) 03AB3 A817C804 0 7 BASE 1017 BRSBM R0 MCT,(((MCT,MCTTIMEOUT) DISP (MCT,0))/BITS 15:31) 03AB4 EDC9C014 7 ZBM 1018 STW MCT,MCTBUSY data transfer is in progress 03AB5 FE0E3ABB 1019 JMP DONE 1020 * --- 1021 00003AB6 1022 NODATAXFER LABEL no data transfer in progress 03AB6 EC09C014 7 ZBM 1023 STZ MCT,MCTBUSY say no longer busy 03AB7 5C09D014 7 ZBM 1024 CMZ MCT,MCTDEAD is the controller dead? 03AB8 FE0C3ABB 1025 JNE NOENABLE1 jump if so 03AB9 60040024 0 IMM 1026 LD R0 BFDFNENINT 03ABA E4001A20 0 1027 ST R0 CIX(BFDFUNC) enable disk interrupts 00003ABB 1028 NOENABLE1 LABEL 1029 * \ / 1030 00003ABB 1031 DONE LABEL 03ABB 5C09D014 7 ZBM 1032 CMZ MCT,MCTDEAD check for dead controller 03ABC FE0C3ABF 1033 JNE NOENABLE2 jump if dead 03ABD 60040800 0 IMM 1034 LD R0 1*PPUICIA 03ABE E4001802 0 1035 ST R0 CIX(PPUSSSTAT) enable PPU interrupts 00003ABF 1036 NOENABLE2 LABEL 03ABF 6017C801 0 7 BASE 1037 LD R0 MCT,MCTPMVALUE 1038 TRACE MSTRACE,MSTLEAVE leaving, R0=PageMap 03AC0 5D401D2C 1038 XCT TRACECALL(MSTRACE) 03AC1 FEC0000B 1038 NOP (MSTRACE*BITS 22:26)+(MSTLEAVE*BITS 27:31) 1039 * \ / 1040 00003AC2 1041 RETURN LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 762 (MSPROC) F 43 Mass Storage Driver - Controller Scheduler 03AC2 E1D78800 7 6 BASE 1042 EXCH R7 SP,0 restore return link 03AC3 5D1F8003 6 STAK 1043 LEAVE POP return to caller 1044 * --- 1045 1046 END DODISK subroutine 1047 1048 1049 END Controller-Scheduling Section 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 763 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1052 1053 BLOCK Drive Activity Section 1054 ENTRY DRIVEPROC Entry point for drive process 1055 ENTRY CALCDRVADR Calculate drive's hardware address 1056 1057 ********************************************************************************** 1058 * * 1059 * This is the drive activity section of the mass storage * 1060 * driver. In this section we actually handle all requests * 1061 * for disk input and output. When necessary to wait for * 1062 * something, we call the controller-scheduling section as a * 1063 * coroutine via "EXPCS MDV,MDVPC". * 1064 * * 1065 * The initial entry point for the drive section is * 1066 * DRIVEPROC, which is the code that starts by initializing * 1067 * the MDV. The chain of control finally dies when we call the * 1068 * controller- scheduler with a new state of MDVSTKILL. It * 1069 * will then destroy our MDV and control will not come back * 1070 * here. The only place where we actually do that is in * 1071 * DRIVEPROC, after we discover that the disk drive is no * 1072 * longer responding. * 1073 * * 1074 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 764 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1076 1077 ********************************************************************************** 1078 * * 1079 * This section consists of a large number of subroutines. * 1080 * After DRIVEPROC, which is first, they make their appearances * 1081 * in alphabetical order. Following is a very brief description * 1082 * of each: * 1083 * * 1084 ********************************************************************************** 1085 1086 * ROUTINE INPUT OUT EATEN SKIP 1087 * NAME PARAMS REGISTERS REG REGS RETURNS DESCRIPTION 1088 * ---------- ------- ----------- --- ----- ------------ -------------------------- 1089 * ADDRSWITCH MSQ,MDV PPL R0:R2 Offl,NoPages Perform an address-switch read request 1090 * ADJUSTCYL MDV R0 R0 Adjust MDVCHKCYL 1091 * CALCDRVADR MDV R0 R0:R2 Calculate cable position 1092 * CALCSKADR MDV R0:R3 Calculate seek address 1093 * CANCELTMR ser# MDV R0:R3 Cancel drive timer request 1094 * CHECKHEADS MDV R0:R4 Offline Check all heads for crash 1095 * CHECK1HEAD HeadNum MDV R0:R4 Offline Check one head for crash 1096 * CHECKSTATE MDV R0:R4 Destroy Check state of drive 1097 * CLEARFAULT MDV R0:R3 Offline Clears drive fault 1098 * DISKCHECK PPL,MDV R0:R3 Offl,ReWrite Perform write-check operation 1099 * DISKOPRMSG code MDV R0:R3 Send offline msg to operator 1100 * DISKSEEK PPL,MDV R0:R3 Offl,SeekErr Seek to particular block 1101 * DISKWRITE PPL,MDV R0:R3 Offl,MemErr Perform write operation 1102 * DOREADREQ MSQ,MDV R0:R4 Offline Perform a read request 1103 * DOREWRITE PPL,MDV R0:R3 Offline Rewrite block for error recovery 1104 * DOWRITEREQ MSQ,MDV R0:R4 Offline Perform a write request 1105 * FIXSEGMENT R0,PPL,MDV R0:R3 Error Reconstruct bad segment 1106 * FORMAT BlkNum MSQ,MDV R0:R3 Offline Formats one track 1107 * GETDISKID MDV 3&4 R0:R4 Offline Get and Log Id of Drive and pack 1108 * GETDRIVEID buffer MDV R0:R4 Offline Get Drive serial number 1109 * GETZEROPG BlkNum MDV PPL R0:R2 Offl,NoPages Get a zero page for specified block 1110 * HEADCHKINT R3 R0:R5 Head Crash Check Timer Interrupt Routine 1111 * HEADCHKSET MDV R0:R2 Set Head Crash Check Timer Interrupt 1112 * IDLEINT R3 R0:R5 Reactivate idle driver 1113 * IDLEDRIVE MDV R0:R3 Drive coroutine delay 1114 * INTREAD BlkNum,FbiType MDV PPL R0:R3 Offl,DataErr,ChanErr Internal Read Routine 1115 * LOGCOUNT MDV R0:R3 Log activity counts for 1 drive 1116 * PADBUILD PPL,MDV R0:R3 Setup transfer addresses in PPU 1117 * READ BlkNum MDV PPL R0:R2 Offl,NoPages Read specified page from disk 1118 * READTRACKS HeadNum,MDV Count R0 R0:R4 Offline Read a group of Tracks 1119 * REMOUNT R3,R4,MDV R0:R4 Check for remounting a volume 1120 * REZERO PPL,MDV R0:R3 Offline Rezero the disk 1121 * RQSTDONE MSQ,PPL,MDV R0:R4 Post a request as complete 1122 * SEEKNDSTAT OpCode PPL,MDV R0:R3 Offl,SeekErr Check status at seek end 1123 * SEEKNDWAIT MDV R0 R0:R2 Wait for seek end 1124 * STATCHECK OpCode PPL,MDV R0 R0:R3 Offl,Perm,ReSeek,ReXfer,Misc Status check after xfer 1125 * TSELECT PPL,MDV R0:R3 Offl,SeekErr Select trick for reading 1126 * UNLOADHEAD MDV R0:R4 Unload the heads from the disk 1127 * UNMOUNTVOL MDV R0:R4 Unmount a volume (drive dropped ready) 1128 * WRITE PPL,MDV R0:R2 Offline Write specified page to disk 1129 * ZEROPAGE PPL R0:R3 Zero out a given page 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 765 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1131 1132 ********************************************************************************** 1133 * * 1134 * DRIVEPROC - Entry Point for the Drive Activity * 1135 * Process. * 1136 * * 1137 * This is the entry point for the drive activity * 1138 * process. Here, we initialize the MDV, then fall into the * 1139 * main processing loop. The main loop tries to perform a * 1140 * read request, a write request and another write request in * 1141 * that order. If any of them cannot be done, we skip it and * 1142 * go to the next one. * 1143 * * 1144 * On entry, MDV -> our MDV element. * 1145 * We alter R0:R4,R6:R7. * 1146 * Stack required: 23. (We call SGETMEM to get our own.) * 1147 * !!!!!!! WARNING !!!!!!! Check STACKSIZE (below) when expanding stack.* 1148 * 0 + max ( CHECKHEADS (22), CHECKSTATE (23), DISKOPRMSG (6), * 1149 * DOREADREQ (17), DOWRITEREQ (14), FREESTAK (0), * 1150 * GETSTAK (0), LOGCOUNT (4), UNMOUNTVOL (8) ) * 1151 * * 1152 ********************************************************************************** 1153 1154 BLOCK DRIVEPROC routine 1155 ENTRY DRIVEPROC 1156 0000001F ABS 1157 STACKSIZE EQU 31 size of stack to get 1158 00003AC4 1159 DRIVEPROC LABEL 03AC4 DC00286A 1160 CALL GETSTACK allocate a stack for us 03AC5 4044001F IMM 1161 PARVL STACKSIZE 1162 * \ / 03AC6 EDD7400B 5 CACH 1163 STW MDV,MDVSECPTRK set sectors per track 03AC7 EDD7400A 5 CACH 1164 STW MDV,MDVTRKPCYL set tracks per cylinder 03AC8 D1574804 5 BASE 1165 STMW MDV,MDVMAXSEEK say volume is huge 1166 SETTBIT MDV,MDVCHKSTAT say we must check status 03AC9 60020080 0 IMM 1166 LD R0 1*BIT(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 0:4) 03ACA FC174800 0 5 BASE 1166 IORM R0 MDV,(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 15:31) 1167 * \ / 1168 * Main processing loop. 1169 * \ / 1170 00003ACB 1171 LOOP LABEL 1172 CLRTBIT MDV,MDVCHKSTAT status check required? 03ACB 60020080 0 IMM 1172 LD R0 1*BIT(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 0:4) 03ACC A8174800 0 5 BASE 1172 BRSBM R0 MDV,(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 15:31) 03ACD FE023AD0 1173 JEQ NOSTAT jump if not 03ACE DC403BD8 1174 CALLNP CHECKSTATE and do the check 03ACF FE0E3AF4 1175 JMP DESTROYUS jump if we should no longer exist 1176 * \ / 00003AD0 1177 NOSTAT LABEL 1178 CLRTBIT MDV,MDVLOGCNT should we log counts? 03AD0 60020040 0 IMM 1178 LD R0 1*BIT(((MDV,MDVLOGCNT) DISP (MDV,0))/BITS 0:4) 03AD1 A8174800 0 5 BASE 1178 BRSBM R0 MDV,(((MDV,MDVLOGCNT) DISP (MDV,0))/BITS 15:31) 03AD2 FE023AD4 1179 JEQ NOLOG jump if not 03AD3 DC403E82 1180 CALLNP LOGCOUNT and do the logging 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 766 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1181 * \ / 00003AD4 1182 NOLOG LABEL 1183 CLRTBIT MDV,MDVCHKHEAD should we run the head checker? 03AD4 60020020 0 IMM 1183 LD R0 1*BIT(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 0:4) 03AD5 A8174800 0 5 BASE 1183 BRSBM R0 MDV,(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 15:31) 03AD6 FE023AD9 1184 JEQ NOHEADCHK jump if not 03AD7 DC403B8E 1185 CALLNP CHECKHEADS call to look for suspicious heads 03AD8 FE0E3AEE 1186 JMP SETOFFLINE get rid of volume if suspicious 1187 * \ / 00003AD9 1188 NOHEADCHK LABEL 03AD9 EC094011 5 ZBM 1189 STZ MDV,MDVDIDXFER say we haven't done anything this time 03ADA 60494080 1 5 ZBM 1190 LD R1 MDV,MDVVOLUME get volume number here 03ADB FA423AEB 1 1191 JEQZ R1 IDLE jump if none - can't do anything 03ADC 61E21F22 7 1 1192 LD R7 VOLNTABLE(R1) get VOLN pointer 1193 * \ / 03ADD 60D7C816 3 7 BASE 1194 LD MSQ R7,VOLNREADQ get first read request 03ADE FAF03AE1 3 1195 JZA MSQ NOREAD jump if none 03ADF DC403CC1 1196 CALLNP DOREADREQ else do the read request 03AE0 FE0E3AEE 1197 JMP SETOFFLINE jump if drive fell offline 1198 * \ / 00003AE1 1199 NOREAD LABEL 03AE1 60D7C817 3 7 BASE 1200 LD MSQ R7,VOLNWRITEQ get first write request 03AE2 FAF03AE9 3 1201 JZA MSQ NOWRITE jump if none 03AE3 DC403CFD 1202 CALLNP DOWRITEREQ else do a write request 03AE4 FE0E3AEE 1203 JMP SETOFFLINE jump if drive now unusable 1204 * \ / 03AE5 60D7C817 3 7 BASE 1205 LD MSQ R7,VOLNWRITEQ get first write request 03AE6 FAF03AE9 3 1206 JZA MSQ NOWRITE jump if none 03AE7 DC403CFD 1207 CALLNP DOWRITEREQ else do a write request 03AE8 FE0E3AEE 1208 JMP SETOFFLINE jump if drive now unusable 1209 * \ / 00003AE9 1210 NOWRITE LABEL 03AE9 5C094011 5 ZBM 1211 CMZ MDV,MDVDIDXFER did we accomplish anything? 03AEA FE0C3ACB 1212 JNE LOOP jump if so 1213 * \ / 1214 00003AEB 1215 IDLE LABEL 03AEB 60040001 0 IMM 1216 LD R0 MDVSTRUN new state = runnable (next time) 03AEC DCD7481B 5 BASE 1217 EXPCS MDV,MDVPC wait for next request 03AED FE0E3ACB 1218 JMP LOOP and go try again 1219 * --- 1220 00003AEE 1221 SETOFFLINE LABEL 03AEE 5C094212 5 ZBM 1222 CMZ MDV,MDVBADSKS faking offline for seek errors? 03AEF FE023AF2 1223 JEQ REALLYOFF jump if not 03AF0 DC003C3D 1224 CALL DISKOPRMSG tell operator 03AF1 40440001 IMM 1225 PARVL 1 "Unable to seek DSKscu" 1226 * \ / 00003AF2 1227 REALLYOFF LABEL 03AF2 DC4040A4 1228 CALLNP UNMOUNTVOL make volume unmounted 03AF3 FE0E3ACB 1229 JMP LOOP 1230 * --- 1231 00003AF4 1232 DESTROYUS LABEL 03AF4 DC002875 1233 CALL FREESTACK free our stack 03AF5 4044001F IMM 1234 PARVL STACKSIZE 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 767 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1235 * \ / 03AF6 60040005 0 IMM 1236 LD R0 MDVSTKILL new state: destroy us 03AF7 DCD7481B 5 BASE 1237 EXPCS MDV,MDVPC go bare the old bodkin 1238 * --- 1239 1240 END DRIVEPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 768 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1242 1243 ********************************************************************************** 1244 * * 1245 * ADDRSWITCH - Perform a Read with Address Switch * 1246 * Request. * 1247 * * 1248 * This subroutine will perform an address-switch read * 1249 * request. It must get the block whose number is in MSQACTAD * 1250 * and convert it to block number MSQBLOCK. There are three * 1251 * possible ways to do this: * 1252 * - If the right page is on the idle page list, we can grab * 1253 * it and convert it to the correct page number. * 1254 * - If the right page is on the PPage list, we can grab an * 1255 * idle page and copy the data into it. * 1256 * - Otherwise, we read the right page from disk and convert * 1257 * it to the correct page number. * 1258 * * 1259 * LD MSQ => MSQ element * 1260 * LD MDV => MDV element * 1261 * CALLNP ADDRSWITCH * 1262 * * 1263 * * 1264 * PPL for page> * 1265 * * 1266 * Registers Used: R0:R2. Sets PPL. * 1267 * Stack Required: 16 * 1268 * 3 + max ( FINDPPAGE (1), GETIDLE (1), GETIDLEPG (2), * 1269 * MAPINFBI (2), MAPOUTFBI (2), READ (13), * 1270 * SFREEMEM (0), SGETMEM (0) ) * 1271 * * 1272 ********************************************************************************** 1273 1274 BLOCK ADDRSWITCH subroutine 1275 ENTRY ADDRSWITCH 1276 1277 BEGFRAME 00178801 6 BASE 1278 SAVER3 BSS 1 save area for R3 00178802 6 BASE 1279 OLDPAGE BSS 1 pointer to PPL of page to copy 1280 ENDFRAME 1281 03AF8 DD5F8003 6 STAK 1282 ADDRSWITCH ENTRNP PUSH 03AF9 DC002D3B 1283 CALL GETIDLEPG get the page from the idle list 03AFA 4056C802 3 BASE 1284 PARVL MSQ,MSQACTAD address to find 03AFB FE0E3AFE 1285 JMP NOTONIDLE jump if not there 03AFC EDC91F12 4 ZBM 1286 STW PPL,PPBUSYWORD/FLDADRS make it once busy 03AFD FE0E3B3D 1287 JMP CHANGEADDR jump if gotten 1288 * --- 1289 00003AFE 1290 NOTONIDLE LABEL 03AFE DC002D0E 1291 CALL FINDPPAGE find page on PPAGE list 03AFF 4056C802 3 BASE 1292 PARVL MSQ,MSQACTAD page number to find 03B00 FE0E3B39 1293 JMP NOTONPPAGE jump if not there 1294 * \ / 1295 * Now, PPL => page on PAGE list, list is locked. 1296 * \ / 03B01 E5178802 4 6 BASE 1297 ST PPL SP,OLDPAGE save pointer to it 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 769 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03B02 DC402D1C 1298 CALLNP GETIDLE get any idle page 03B03 FE0E3B34 1299 JMP NOIDLE ain't none, can't copy it 1300 * \ / 1301 * Now, PPL => empty page. 1302 * \ / 03B04 EDC91F12 4 ZBM 1303 STW PPL,PPBUSYWORD/FLDADRS make it once busy 03B05 E4D78801 3 6 BASE 1304 ST PFPTR SP,SAVER3 save this register 1305 * \ / 1306 00003B06 1307 RETRY LABEL 1308 PFAILEN PFAIL enable power fail interrupt 03B06 60043B52 0 IMM 1308 LD R0 ADR PFAIL 03B07 E400044F 0 1308 ST R0 POWERUPLOC 03B08 59C40800 IMM 1308 IORMSR MSRPFINTE 03B09 60C40086 3 IMM 1309 LD PFPTR PNCIX page number for destination page 03B0A 00D70803 4 BASE 1310 LDPF PPL,PPPMVALUE map new page into CIX 03B0B 60C40085 3 IMM 1311 LD PFPTR PNWNDO4 page number for source page 03B0C 60178802 0 6 BASE 1312 LD R0 SP,OLDPAGE point to old PPL 03B0D 00D60803 0 BASE 1313 LDPF R0,PPPMVALUE map old page into WNDO4 03B0E 60041400 0 IMM 1314 LD R0 ADR WNDO4 03B0F 60441000 1 IMM 1315 LD R1 CPP 03B10 60841800 2 IMM 1316 LD R2 ADR CIX 03B11 FE400000 1317 CMOVE copy the page 03B12 80D20000 0 REG 1318 PFRC R0 unmap WNDO4 1319 PFAILDS disable power-fail interrupt 03B13 59840800 IMM 1319 CLBMSR MSRPFINTE 03B14 EC00044F 1319 STZ POWERUPLOC 03B15 60C40086 3 IMM 1320 LD PFPTR PNCIX page number of controller window 03B16 60095F11 0 5 ZBM 1321 LD R0 MDV,MDVCNTL R0 -> MCT element 03B17 00D60801 0 BASE 1322 LDPF R0,MCTPMVALUE remap controller into CIX 1323 1324 * copy FBI for the PPL 03B18 DC002ED0 1325 CALL SGETMEM get a spare FBI 03B19 40440004 IMM 1326 PARVL FBILOG pass log length 03B1A 60920000 2 0 REG 1327 LD R2 R0 set as CMOVE destination 03B1B 60D20000 3 0 REG 1328 LD R3 R0 and put in more perm register 03B1C E0D78802 3 6 BASE 1329 EXCH R3 SP,OLDPAGE get back old PPL 03B1D DC002606 1330 CALL MAPINFBI map in FBI for it 03B1E 4052C000 3 REG 1331 PARVL R3 pass PPL 03B1F 60124000 0 1 REG 1332 LD R0 R1 copy FBI addr as CMOVE source 03B20 6044002C 1 IMM 1333 LD R1 FBILNTH*CPW length of FBI CMOVE 03B21 FE400000 1334 CMOVE copy the FBI to temp area 03B22 DC40261B 1335 CALLNP MAPOUTFBI unmap FBI, ION 1336 03B23 DC002606 1337 CALL MAPINFBI map in new FBIs PPL, IOFF 03B24 40530000 4 REG 1338 PARVL PPL pass address of PPL 03B25 60924000 2 1 REG 1339 LD R2 R1 R2 => new FBI 03B26 60178802 0 6 BASE 1340 LD R0 SP,OLDPAGE R0 => temp FBI 03B27 6044002C 1 IMM 1341 LD R1 FBILNTH*CPW R1 = length of FBI 03B28 FE400000 1342 CMOVE copy temp FBI into new PPL 03B29 DC40261B 1343 CALLNP MAPOUTFBI unmap new FBI 03B2A E0D78802 3 6 BASE 1344 EXCH R3 SP,OLDPAGE save old PPL, R3 => temp FBI 03B2B DC002F5D 1345 CALL SFREEMEM get rid of temp 03B2C 41440004 IMM 1346 PARV FBILOG pass log length 03B2D 4052C000 3 REG 1347 PARVL R3 pass address 1348 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 770 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03B2E 60D78801 3 6 BASE 1349 LD PFPTR SP,SAVER3 restore this register 03B2F 60178802 0 6 BASE 1350 LD R0 SP,OLDPAGE old PPL 03B30 60883461 2 0 ZBM 1351 LD R2 R0,PPBLOCK/PPHASHFLD get hash field 1352 PUNLOCK PPAGELOCK(R2) unlock the list 03B31 EC241E21 2 1352 STZ PPAGELOCK(R2) 03B32 0C800000 1352 ION 03B33 FE0E3B3D 1353 JMP CHANGEADDR and go do the address change 1354 * --- 1355 00003B34 1356 NOIDLE LABEL can't copy page - nowhere to copy it 03B34 60178802 0 6 BASE 1357 LD R0 SP,OLDPAGE get old PPL pointer 03B35 60883461 2 0 ZBM 1358 LD R2 R0,PPBLOCK/PPHASHFLD get hash field 1359 PUNLOCK PPAGELOCK(R2) unlock the list 03B36 EC241E21 2 1359 STZ PPAGELOCK(R2) 03B37 0C800000 1359 ION 03B38 FE0E3B50 1360 JMP CANTREAD and say we couldn't do it 1361 * --- 1362 00003B39 1363 NOTONPPAGE LABEL 03B39 DC003EBE 1364 CALL READ read the block 03B3A 4056C802 3 BASE 1365 PARVL MSQ,MSQACTAD address to read 03B3B FE0E3B51 1366 JMP OFFLINE jump if drive went offline 03B3C FE0E3B50 1367 JMP CANTREAD jump if no page available 1368 * \ / 1369 * Now, PPL points to the proper page. Here we do the 1370 * address change. 1371 * \ / 1372 00003B3D 1373 CHANGEADDR LABEL 03B3D DC002606 1374 CALL MAPINFBI get access to FBI, IOFF 03B3E 40530000 4 REG 1375 PARVL PPL pass PPL address 03B3F 6016C803 0 3 BASE 1376 LD R0 MSQ,MSQXPTR pick up pointer to extra PPL 03B40 FA303B4A 0 1377 JZA R0 NONEWFBI jump if none here 03B41 E4578801 1 6 BASE 1378 ST R1 SP,SAVER3 save FBI pointer 03B42 60924000 2 1 REG 1379 LD R2 R1 make destination address 03B43 6044002C 1 IMM 1380 LD R1 CPW*FBILNTH get length to move 03B44 38160804 0 0 BASE 1381 LEA R0 R0,PPFBFBI make source address 03B45 FE400000 1382 CMOVE 03B46 DC002F5D 1383 CALL SFREEMEM call to dump PPL-FBI element 03B47 41440004 IMM 1384 PARV PPFBLOG indicate length 03B48 4056C803 3 BASE 1385 PARVL MSQ,MSQXPTR and address 03B49 60578801 1 6 BASE 1386 LD R1 SP,SAVER3 restore real FBI address 00003B4A 1387 NONEWFBI LABEL 03B4A 6016C801 0 3 BASE 1388 LD R0 MSQ,MSQBLOCK get new block number 03B4B E4170801 0 4 BASE 1389 ST R0 PPL,PPBLOCK save in PPL 03B4C E4085181 0 1 ZBM 1390 ST R0 R1,FBIDA and in FBI 03B4D EDC90012 4 ZBM 1391 STW PPL,PPMODIFIED say this page has been modified 03B4E DC40261B 1392 CALLNP MAPOUTFBI unmap PPLs FBI, ION 03B4F 61D7D001 7 7 REG 1393 LD R7 R7+1 we got the page 1394 * \ / 1395 00003B50 1396 CANTREAD LABEL 03B50 61D7D001 7 7 REG 1397 LD R7 R7+1 no idle pages available 1398 * \ / 1399 00003B51 1400 OFFLINE LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 771 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03B51 5D1F8003 6 STAK 1401 LEAVE POP 1402 * --- 1403 00003B52 1404 PFAIL LABEL power failure occurred 03B52 60040006 0 IMM 1405 LD R0 MDVSTPFAIL say we are runnable 03B53 DCD7481B 5 BASE 1406 EXPCS MDV,MDVPC go back to controller 03B54 FE0E3B06 1407 JMP RETRY when we come back, try again 1408 * --- 1409 1410 END ADDRSWITCH subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 772 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1412 1413 ********************************************************************************** 1414 * * 1415 * ADJUSTCYL - Select New Track for Head Check. * 1416 * * 1417 * This routine uses the head checking constant HDCHKCYLM * 1418 * to select a new MDVCHKCYL. Returns new MDVCHKCYL in R0. * 1419 * * 1420 * LD MDV => MDV element * 1421 * CALLNP ADJUSTCYL * 1422 * R0 = new cylinder number * 1423 * * 1424 * Sets R0. * 1425 * Stack required: 1 * 1426 * * 1427 ********************************************************************************** 1428 1429 BLOCK ADJUSTCYL subroutine 1430 ENTRY ADJUSTCYL 1431 1432 BEGFRAME 1433 ENDFRAME 1434 03B55 DD5F8001 6 STAK 1435 ADJUSTCYL ENTRNP PUSH 03B56 60174814 0 5 BASE 1436 LD R0 MDV,MDVCHKCYL get current cylinder number 03B57 10003969 0 1437 SUB R0 HDCHKCYLM pick another cylinder 03B58 FA063B5B 0 1438 JGEZ R0 HAVECYL jump if ok 1439 * \ / 1440 00003B59 1441 ADJCYL LABEL 03B59 18094104 0 5 ZBM 1442 ADD R0 MDV,MDVMAXSEEK/BFDSACYL wrap around the disk 03B5A FA083B59 0 1443 JLTZ R0 ADJCYL 1444 * \ / 1445 00003B5B 1446 HAVECYL LABEL 03B5B E4174814 0 5 BASE 1447 ST R0 MDV,MDVCHKCYL save this cylinder number 03B5C 5D1F8001 6 STAK 1448 LEAVE POP 1449 * --- 1450 1451 END ADJUSTCYL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 773 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1453 1454 ********************************************************************************** 1455 * * 1456 * CALCDRVADR - Calculate drive's hardware address * 1457 * * 1458 * This routine calculates the drive's hardware address as a * 1459 * combination of the BFD's location and the drive cable position. * 1460 * * 1461 * LD MDV => MDV element * 1462 * CALLNP CALCDRVADR * 1463 * R0 = drive address * 1464 * * 1465 * Eats R0:R2. Sets R0. * 1466 * Stack required: 1 * 1467 * * 1468 ********************************************************************************** 1469 1470 BLOCK CALCDRVADR subroutine 1471 ENTRY CALCDRVADR 1472 1473 BEGFRAME 1474 ENDFRAME 1475 03B5D DD5F8001 6 STAK 1476 CALCDRVADR ENTRNP PUSH 03B5E 60495F11 1 5 ZBM 1477 LD R1 MDV,MDVCNTL get controller element 03B5F 60564801 1 1 BASE 1478 LD R1 R1,MCTPMVALUE page map for BFD 03B60 60095231 0 5 ZBM 1479 LD R0 MDV,MDVCABLE cable position 03B61 608A7020 2 1 CBM 1480 LD R2 R1/PPUCHAN channel on the PPU 03B62 E48A3040 2 0 CBM 1481 ST R2 R0/BITS 24:27 combine with cable position 03B63 608A4840 2 1 CBM 1482 LD R2 R1/PFSLOT get slot PPU resides in 03B64 E48A2840 2 0 CBM 1483 ST R2 R0/BITS 20:23 combine with the rest 03B65 5D1F8001 6 STAK 1484 LEAVE POP return 1485 * --- 1486 1487 END CALCDRVADR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 774 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1489 1490 ********************************************************************************** 1491 * * 1492 * CALCSKADR - Calculate Seek Address. * 1493 * * 1494 * This routine will calculate the physical seek address * 1495 * for a block, and save it in the MDV element. It searches * 1496 * the substitution list to see if the block is substituted. * 1497 * * 1498 * LD MDV => MDV for drive * 1499 * CALL CALCSKADR * 1500 * PARVL * 1501 * * 1502 * Eats R0:R1. * 1503 * Stack required: 1 * 1504 * 1 + max ( LOCKWAIT (0) ) * 1505 * * 1506 ********************************************************************************** 1507 1508 BLOCK CALCSKADR subroutine 1509 ENTRY CALCSKADR 1510 1511 BEGFRAME 1512 ENDFRAME 1513 03B66 DD1F8001 6 STAK 1514 CALCSKADR ENTR PUSH 03B67 C0524000 1 REG 1515 STPVL R1 get disk address 1516 * \ / 03B68 5C094013 5 ZBM 1517 CMZ MDV,MDVNOSUB should substitutions be ignored? 03B69 FE0C3B74 1518 JNE SKIPSUBS jump if yes 1519 PLOCK SUBSLOCK lock the substitution list 03B6A 0CC00000 1519 IOFF 03B6B D1C01F62 1519 SETT SUBSLOCK 03B6C FE0C3B6E 1519 JNE MA(2+DISPW MA 0) 03B6D DC40308B 1519 CALLNP LOCKWAIT 03B6E 60001F63 0 1520 LD R0 SUBSLIST R0 -> first element on list 03B6F 3C560801 1 0 BASE 1521 LSRCH R1 R0,SUBLBAD find substitution list entry for block 03B70 FE0C3B72 1522 JNE NOTSUBBED jump if none - block is not substituted 03B71 60560802 1 0 BASE 1523 LD R1 R0,SUBLGOOD get substituted block number 1524 * \ / 00003B72 1525 NOTSUBBED LABEL 1526 PUNLOCK SUBSLOCK unlock the substitution list 03B72 EC001F62 1526 STZ SUBSLOCK 03B73 0C800000 1526 ION 1527 * \ / 00003B74 1528 SKIPSUBS LABEL 03B74 7840254F 1 1529 AND R1 MSBLKMASK remove volume number 03B75 EC174808 5 BASE 1530 STZ MDV,MDVSEEKADR clear out result location 03B76 58C40010 IMM 1531 IORPSR PSRMODIF turn on funky arithmetic 03B77 62124000 011 REG 1532 LD2 R0 R1 swell up for divide 03B78 1417400B 0 5 CACH 1533 DIV R0 MDV,MDVSECPTRK R0 = quotient, R1 = remainder 03B79 E4497088 1 5 ZBM 1534 ST R1 MDV,MDVSEEKADR/BFDSASEC save sector number 03B7A 62120000 010 REG 1535 LD2 R0 R0 swell up for divide 03B7B 1417400A 0 5 CACH 1536 DIV R0 MDV,MDVTRKPCYL R0 = quotient, R1 = remainder 03B7C E4496088 1 5 ZBM 1537 ST R1 MDV,MDVSEEKADR/BFDSAHEAD save head number 03B7D E4094108 0 5 ZBM 1538 ST R0 MDV,MDVSEEKADR/BFDSACYL save cylinder number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 775 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03B7E 58840010 IMM 1539 CLBPSR PSRMODIF clear funky arithmetic 03B7F 5D1F8001 6 STAK 1540 LEAVE POP return 1541 * --- 1542 1543 END CALCSKADR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 776 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1545 1546 ********************************************************************************** 1547 * * 1548 * CANCELTMR - Cancel Time Interrupt For Drive. * 1549 * * 1550 * This routine will cancel the given timer interrupt for * 1551 * the specified drive coroutine. * 1552 * * 1553 * LD MDV =>MDV element * 1554 * CALL CANCELTMR * 1555 * PARL * 1556 * * 1557 * Eats R0:R3. * 1558 * Stack required: 6 * 1559 * 4 + max ( TIMEKILL (2) ) * 1560 * * 1561 ********************************************************************************** 1562 1563 BLOCK CANCELTMR subroutine 1564 ENTRY CANCELTMR 1565 1566 BEGFRAME 00178801 6 BASE 1567 TIMERADR BSS 1 address of serial number 00178802 6 BASE 1568 SAVEPF BSS 1 CIX mapping 00178803 6 BASE 1569 KEEPR4 BSS 1 R4 safe spot 1570 ENDFRAME 1571 03B80 DD1F8004 6 STAK 1572 CANCELTMR ENTR PUSH 03B81 C0178801 6 BASE 1573 STPL SP,TIMERADR save address of serial number 03B82 E5178803 4 6 BASE 1574 ST R4 SP,KEEPR4 save a register 03B83 61178C01 4 6 FPVR 1575 LD TMR @(SP,TIMERADR) serial number of timer request 03B84 FB023B8C 4 1576 JEQZ TMR RETURN jump if none 03B85 60C40086 3 IMM 1577 LD PFPTR PNCIX page number of CIX window 03B86 80D78802 6 BASE 1578 PFRC SP,SAVEPF save mapping on stack 03B87 DC404517 1579 CALLNP TIMEKILL else kill the request 03B88 FEC00000 1580 NOP 0 (not found return) 03B89 60C40086 3 IMM 1581 LD PFPTR PNCIX restore CIX window 03B8A 00D78802 6 BASE 1582 LDPF SP,SAVEPF saved PF value 03B8B EC178C01 6 FPVR 1583 STZ @(SP,TIMERADR) say request no longer outstanding 1584 * \ / 1585 00003B8C 1586 RETURN LABEL 03B8C 61178803 4 6 BASE 1587 LD R4 SP,KEEPR4 restore a register 03B8D 5D1F8004 6 STAK 1588 LEAVE POP and return 1589 * --- 1590 1591 END CANCELTMR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 777 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1593 1594 ********************************************************************************** 1595 * * 1596 * CHECKHEADS - Check All Heads for Crash. * 1597 * * 1598 * This routine is called periodically to check for head * 1599 * crashes. It will do at least one read from each head * 1600 * looking for errors. If we find too many errors, we will * 1601 * unload the heads. Note that we can inhibit the head * 1602 * checker by setting a bit in the VOLN element. This is done * 1603 * so if the drive is powered off/on the head checker will * 1604 * remain inhibited or if the volume is unloaded and the next * 1605 * disk spun up, the head checker will function normally. * 1606 * * 1607 * LD MDV => MDV element * 1608 * CALLNP CHECKHEADS * 1609 * JMP drive offline or heads unloaded * 1610 * * 1611 * Registers Used: R0:R4 * 1612 * Stack Required: 22 * 1613 * 2 + max ( ADJUSTCYL (1), CANCELTMR (6), CHECK1HEAD (20), * 1614 * HEADCHKSET (6), INTREAD (14), PUTIDLE (1) ) * 1615 * * 1616 ********************************************************************************** 1617 1618 1619 BLOCK CHECKHEADS subroutine 1620 ENTRY CHECKHEADS 1621 1622 BEGFRAME 00178801 6 BASE 1623 HEADNUM BSS 1 current head number 1624 ENDFRAME 1625 03B8E DD5F8002 6 STAK 1626 CHECKHEADS ENTRNP PUSH 03B8F DC003B80 1627 CALL CANCELTMR clear any outstanding timer request 03B90 40174812 5 BASE 1628 PARL MDV,MDVTIMESER pass serial num field 1629 * \ / 03B91 EC174817 5 BASE 1630 STZ MDV,MDVBTRXPPL assume no bad tracks block 03B92 EC174819 5 BASE 1631 STZ MDV,MDVSUBSPPL assume no substitution block 03B93 60174804 0 5 BASE 1632 LD R0 MDV,MDVMAXSEEK at max seek address 03B94 FA2C3BB3 0 1633 JEQMW R0 DONE if not set, we cannot do this 1634 * \ / 03B95 60094080 0 5 ZBM 1635 LD R0 MDV,MDVVOLUME get the volume number 03B96 FA023B9A 0 1636 JEQZ R0 DOHEADCHK jump if volume not loaded 03B97 60201F22 0 0 1637 LD R0 VOLNTABLE(R0) address of the VOLN element 03B98 5C080015 0 ZBM 1638 CMZ R0,VOLNHDCK is the head checker inhibited? 03B99 FE0C3BB3 1639 JNE DONE jump if so 1640 * \ / 00003B9A 1641 DOHEADCHK LABEL 03B9A EC174803 5 BASE 1642 STZ MDV,MDVERRWORD clear flags and counters 03B9B DC003E63 1643 CALL INTREAD read the bad tracks block 03B9C 41574816 5 BASE 1644 PARV MDV,MDVBTRXDA disk address 03B9D 40440002 IMM 1645 PARVL FBITBTRX expected FBI type 03B9E FE0E3BB5 1646 JMP RETURN0 jump if drive offline 03B9F FE0E3BA2 1647 JMP GOTBTRX jump if data error 03BA0 FE0E3BA2 1648 JMP GOTBTRX jump if channel error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 778 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03BA1 E5174817 4 5 BASE 1649 ST PPL MDV,MDVBTRXPPL normal return - save PPL pointer 1650 * \ / 00003BA2 1651 GOTBTRX LABEL 03BA2 DC003E63 1652 CALL INTREAD read the substitution block 03BA3 41574818 5 BASE 1653 PARV MDV,MDVSUBSDA disk address 03BA4 40440005 IMM 1654 PARVL FBITSUBS expected FBI type 03BA5 FE0E3BB5 1655 JMP RETURN0 jump if drive offline 03BA6 FE0E3BA9 1656 JMP GOTSUBS jump if data error 03BA7 FE0E3BA9 1657 JMP GOTSUBS jump if channel error 03BA8 E5174819 4 5 BASE 1658 ST PPL MDV,MDVSUBSPPL normal return - save PPL pointer 1659 * \ / 00003BA9 1660 GOTSUBS LABEL 03BA9 EDC94213 5 ZBM 1661 STW MDV,MDVNOERRS indicate immunity to most errors 03BAA DC403B55 1662 CALLNP ADJUSTCYL select cylinder 03BAB 6017400A 0 5 CACH 1663 LD R0 MDV,MDVTRKPCYL number of heads 03BAC FE0E3BB2 1664 JMP LOOPEND start loop with a count down 1665 * --- 1666 00003BAD 1667 LOOP LABEL 03BAD E4178801 0 6 BASE 1668 ST R0 SP,HEADNUM set current number on stack 03BAE DC003BC2 1669 CALL CHECK1HEAD else check that head 03BAF 40520000 0 REG 1670 PARVL R0 pass head number 03BB0 FE0E3BB5 1671 JMP RETURN0 jump if bad or offline 03BB1 60178801 0 6 BASE 1672 LD R0 SP,HEADNUM get head just done 00003BB2 1673 LOOPEND LABEL 03BB2 FA263BAD 0 1674 JDR R0 LOOP do next head 1675 * \ / 00003BB3 1676 DONE LABEL 03BB3 DC403E33 1677 CALLNP HEADCHKSET set timer request for next check 03BB4 61D7D001 7 7 REG 1678 LD R7 R7+1 good return 1679 * \ / 00003BB5 1680 RETURN0 LABEL 03BB5 61174817 4 5 BASE 1681 LD PPL MDV,MDVBTRXPPL PPL => block containing bad tracks list 03BB6 FB303BB8 4 1682 JZA PPL NOBTRXPPL jump if none 03BB7 DC402D51 1683 CALLNP PUTIDLE free the block 1684 * \ / 00003BB8 1685 NOBTRXPPL LABEL 03BB8 61174819 4 5 BASE 1686 LD PPL MDV,MDVSUBSPPL PPL => block containing substitution entries 03BB9 FB303BBB 4 1687 JZA PPL NOSUBSPPL jump if none 03BBA DC402D51 1688 CALLNP PUTIDLE free the block 1689 * \ / 00003BBB 1690 NOSUBSPPL LABEL 03BBB D0574815 5 BASE 1691 DEC MDV,MDVRZPROBS say seeker looks good 03BBC FE063BBE 1692 JGE OKNOW jump if counter normal 03BBD EC174815 5 BASE 1693 STZ MDV,MDVRZPROBS make it ok 1694 * \ / 00003BBE 1695 OKNOW LABEL 03BBE EC094213 5 ZBM 1696 STZ MDV,MDVNOERRS restore normal error handling 1697 CLRTBIT MDV,MDVCHKHEAD don't re-check immediately 03BBF 60020020 0 IMM 1697 LD R0 1*BIT(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 0:4) 03BC0 A8174800 0 5 BASE 1697 BRSBM R0 MDV,(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 15:31) 03BC1 5D1F8002 6 STAK 1698 LEAVE POP 1699 * --- 1700 1701 END CHECKHEADS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 779 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1703 1704 ********************************************************************************** 1705 * * 1706 * CHECK1HEAD - Check One Head for Crash. * 1707 * * 1708 * This routine checks for a crash on one disk head. It * 1709 * will read a small number of tracks. If the number of * 1710 * errors exceeds a predefined value, it will read a larger * 1711 * number of tracks. If the number of errors in this second * 1712 * group of tracks exceeds another predefined value, we will * 1713 * unload the heads. * 1714 * * 1715 * LD MDV => MDV element * 1716 * CALL CHECK1HEAD * 1717 * PARVL head number * 1718 * JMP offline of heads unloaded * 1719 * * 1720 * Eats R0:R4 * 1721 * Stack required: 20 * 1722 * 2 + max ( ADJUSTCYL (1), DISKOPRMSG (6), READTRACKS (18), * 1723 * UNLOADHEAD (4) ) * 1724 * * 1725 ********************************************************************************** 1726 1727 BLOCK CHECK1HEAD Subroutine 1728 ENTRY CHECK1HEAD 1729 1730 BEGFRAME 00178801 6 BASE 1731 HEADNUM BSS 1 number of the head to check 1732 ENDFRAME 1733 03BC2 DD1F8002 6 STAK 1734 CHECK1HEAD ENTR PUSH 03BC3 C0578801 6 BASE 1735 STPVL SP,HEADNUM R0 <= also contains the head number 1736 * \ / 03BC4 DC003F28 1737 CALL READTRACKS read a group of tracks 03BC5 41520000 0 REG 1738 PARV R0 head number 03BC6 41403965 1739 PARV HDCHKCNT1 number of tracks 03BC7 40403966 1740 PARVL HDCHKERR1 number of allowable errors 03BC8 FE0E3BD7 1741 JMP RETURN0 jump if offline 03BC9 FA043BD6 0 1742 JGTZ R0 RETURN1 return if not too many errors 1743 * \ / 1744 1745 * Bad start, move to another cylinder and try some more 03BCA DC403B55 1746 CALLNP ADJUSTCYL move to new cylinder 03BCB 60178801 0 6 BASE 1747 LD R0 SP,HEADNUM get head number back 03BCC DC003F28 1748 CALL READTRACKS read another group of tracks 03BCD 41520000 0 REG 1749 PARV R0 head number 03BCE 41403967 1750 PARV HDCHKCNT2 number of tracks 03BCF 40403968 1751 PARVL HDCHKERR2 number of allowable errors 03BD0 FE0E3BD7 1752 JMP RETURN0 jump if drive is offline 03BD1 FA043BD6 0 1753 JGTZ R0 RETURN1 return if not too many errors 1754 * \ / 03BD2 DC404097 1755 CALLNP UNLOADHEAD else unload the heads 03BD3 DC003C3D 1756 CALL DISKOPRMSG tell operator about the problem 03BD4 40440000 IMM 1757 PARVL 0 "Suspected head crash on ..." 03BD5 FE0E3BD7 1758 JMP RETURN0 and say we unloaded heads 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 780 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1759 * --- 1760 00003BD6 1761 RETURN1 LABEL 03BD6 61D7D001 7 7 REG 1762 LD R7 R7+1 good return 1763 * \ / 1764 00003BD7 1765 RETURN0 LABEL 03BD7 5D1F8002 6 STAK 1766 LEAVE POP 1767 * --- 1768 END CHECK1HEAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 781 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1770 1771 ********************************************************************************** 1772 * * 1773 * CHECKSTATE - Check Drive State for Present and Online. * 1774 * * 1775 * This subroutine will check the current drive status to * 1776 * see whether the drive is present and online. If not, we * 1777 * unmount any volume mounted here. * 1778 * * 1779 * LD MDV => MDV element * 1780 * CALLNP CHECKSTATE * 1781 * JMP drive no longer responding * 1782 * * 1783 * Registers Used: R0:R4 * 1784 * Stack Required: 23 * 1785 * 1 + max ( CANCELTMR (6), GETDISKID (22), HEADCHKSET (6), * 1786 * IDLEDRIVE (5), REMOUNT (4), UNMOUNTVOL (8) ) * 1787 * * 1788 ********************************************************************************** 1789 1790 BLOCK CHECKSTATE subroutine 1791 ENTRY CHECKSTATE 1792 1793 BEGFRAME 1794 ENDFRAME 1795 03BD8 DD5F8001 6 STAK 1796 CHECKSTATE ENTRNP PUSH 1797 * \ / 00003BD9 1798 AGAIN LABEL 03BD9 60095F11 0 5 ZBM 1799 LD R0 MDV,MDVCNTL R0 -> MCT element 03BDA 5C081014 0 ZBM 1800 CMZ R0,MCTDEAD is the BFD dead? 03BDB FE0C3BEE 1801 JNE NODRIVE jump if so 03BDC 60095830 0 5 ZBM 1802 LD R0 MDV,MDVUNIT our unit number 03BDD 60601A28 1 0 1803 LD R1 CIX(BFDSS+BFDSELECTB+R0) R1=our status 03BDE F66E3BEE 1 1804 JBT R1/BFDSSRSPER NODRIVE jump if drive not here 03BDF 600A6030 0 1 CBM 1805 LD R0 R1/BFDSSDNUM get the hardware drive number 03BE0 E4095231 0 5 ZBM 1806 ST R0 MDV,MDVCABLE which is drive cable position 03BE1 60094212 0 5 ZBM 1807 LD R0 MDV,MDVBADSKS drive unable to seek? 03BE2 7C094012 0 5 ZBM 1808 IOR R0 MDV,MDVBADDISK was head retracted 'cause of errors? 03BE3 FA0C3BF4 0 1809 JNEZ R0 NOTREADY if either, presume not ready 03BE4 F2483BF4 1 1810 JBF R1/BFDSSRDY NOTREADY jump if drive not ready 03BE5 600A4610 0 1 CBM 1811 LD R0 R1/BFDSSWPROT get status of writeprotect 03BE6 60894811 2 5 ZBM 1812 LD R2 MDV,MDVWPROT get prev state 03BE7 E4094811 0 5 ZBM 1813 ST R0 MDV,MDVWPROT save new state for mounter 03BE8 FA0C3BF6 0 1814 JNEZ R0 WRITEPROT if wprot, act similar to 'not ready' 03BE9 F6443BFC 1 1815 JBT R1/BFDSSNSAFE CAMEREADY jump if drive not safe 03BEA 5C095010 5 ZBM 1816 CMZ MDV,MDVREADY did we know drive is ready? 03BEB FE023C03 1817 JEQ DRIVEINIT jump if not 03BEC FA8C3BFC 2 1818 JNEZ R2 CAMEREADY jump if just un-writeprotected 03BED FE0E3C0C 1819 JMP RETURN1 else do nothing 1820 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 782 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1822 1823 ********************************************************************************** 1824 * * 1825 * The above code sorts out the various cases and transfers * 1826 * to one of the following labels: * 1827 * * 1828 * NODRIVE - Either the disk controller is dead or the drive is * 1829 * not selectable. This is what happens when one pulls * 1830 * the plug on a drive. We don't try to dismount if * 1831 * there is no volume. This keeps us from generating * 1832 * a 'not ready' error log entry we don't want. * 1833 * * 1834 * NOTREADY - Either the disk is not spinning, or we have previously * 1835 * had problems with the drive (head crash or excessive * 1836 * seek failures). The first case means the disk has * 1837 * been spun down. The "problems" case means the drive * 1838 * ought to be spun down and looked at (we won't even * 1839 * handle the drive again until it's been power cycled). * 1840 * * 1841 * CAMEREADY - a) The drive is ready but in "volume not safe" status. * 1842 * The BFDC asserts "not safe" to indicate that the * 1843 * drive has spun down. The drive is now ready, so we * 1844 * read the pack information and try to remount. We * 1845 * first unmount, tho, in case the system was stopped * 1846 * when the drive was spun down. N.B. "Volume not safe" * 1847 * is NOT the same as the "drive unsafe" condition given * 1848 * (by the drive) when a drive can not be used. * 1849 * Or b) The drive just became un-writeprotected. Because * 1850 * wprot is much like not ready, the remedy is the same. * 1851 * * 1852 * DRIVEINIT - The drive is ready and safe, but MDVREADY = 0. * 1853 * This happens right after boot on drives that were * 1854 * made safe by boot, and on drives that whose MDV * 1855 * is being reinitialized (see ORRESETMDV OPREQ and * 1856 * DOREADREQ). This is where the head initially starts. * 1857 * * 1858 ********************************************************************************** 1859 00003BEE 1860 NODRIVE LABEL 03BEE DC003B80 1861 CALL CANCELTMR cancel head check timer 03BEF 40174812 5 BASE 1862 PARL MDV,MDVTIMESER pass ser num field 03BF0 5C094080 5 ZBM 1863 CMZ MDV,MDVVOLUME was there a volume? 03BF1 FE023C0D 1864 JEQ RETURN0 if not, don't try dismount 03BF2 DC4040A4 1865 CALLNP UNMOUNTVOL unmount volume 03BF3 FE0E3C0D 1866 JMP RETURN0 jump to destroy MDV 1867 * --- 1868 00003BF4 1869 NOTREADY LABEL 03BF4 DC003B80 1870 CALL CANCELTMR cancel head check timer 03BF5 40174812 5 BASE 1871 PARL MDV,MDVTIMESER pass ser num field 00003BF6 1872 WRITEPROT LABEL 1873 CLRTBIT MDV,MDVREADY say drive is no longer ready 03BF6 60020100 0 IMM 1873 LD R0 1*BIT(((MDV,MDVREADY) DISP (MDV,0))/BITS 0:4) 03BF7 A8174800 0 5 BASE 1873 BRSBM R0 MDV,(((MDV,MDVREADY) DISP (MDV,0))/BITS 15:31) 03BF8 FE023BFA 1874 JEQ NOVOLUME jump if we knew drive was not ready 03BF9 DC4040A4 1875 CALLNP UNMOUNTVOL make log file entries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 783 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 00003BFA 1876 NOVOLUME LABEL 03BFA EE17480E 5 BASE 1877 STZ2 MDV,MDVVOLNAME clear volume name 03BFB FE0E3C0C 1878 JMP RETURN1 and return to our death 1879 * --- 1880 00003BFC 1881 CAMEREADY LABEL 03BFC DC003B80 1882 CALL CANCELTMR cancel head check timer 03BFD 40174812 5 BASE 1883 PARL MDV,MDVTIMESER serial number field 03BFE 5C094080 5 ZBM 1884 CMZ MDV,MDVVOLUME was there a volume? 03BFF FE023C01 1885 JEQ NOVOL if not, don't try dismount 03C00 DC4040A4 1886 CALLNP UNMOUNTVOL (drive spun down while sys stopped) 00003C01 1887 NOVOL LABEL 03C01 60040020 0 IMM 1888 LD R0 BFDFNSAFE controller function code to ... 03C02 E4001A20 0 1889 ST R0 CIX(BFDFUNC) ... make volume safe 1890 * \ / 1891 00003C03 1892 DRIVEINIT LABEL 03C03 DC403E43 1893 CALLNP IDLEDRIVE delay to allow drive logic to clear 03C04 DC403D9A 1894 CALLNP GETDISKID get drive, pack id's, & mount time 03C05 FE0E3BD9 1895 JMP AGAIN jump if drive went away 1896 SETTBIT MDV,MDVREADY say we know drive is ready 03C06 60020100 0 IMM 1896 LD R0 1*BIT(((MDV,MDVREADY) DISP (MDV,0))/BITS 0:4) 03C07 FC174800 0 5 BASE 1896 IORM R0 MDV,(((MDV,MDVREADY) DISP (MDV,0))/BITS 15:31) 03C08 DC403E33 1897 CALLNP HEADCHKSET set head check timer 03C09 5C094080 5 ZBM 1898 CMZ MDV,MDVVOLUME is volume already here? 03C0A FE0C3C0C 1899 JNE RETURN1 jump if so 1900 * \ / 1901 1902 * R3 & R4 have double word volume mount date 03C0B DC403F4C 1903 CALLNP REMOUNT else try the remounter 1904 * \ / 1905 00003C0C 1906 RETURN1 LABEL 03C0C 61D7D001 7 7 REG 1907 LD R7 R7+1 normal return 1908 * \ / 1909 00003C0D 1910 RETURN0 LABEL 03C0D 5D1F8001 6 STAK 1911 LEAVE POP return 1912 * --- 1913 1914 END CHECKSTATE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 784 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1916 1917 ********************************************************************************** 1918 * * 1919 * CLEARFAULT - Clear a Drive Fault. * 1920 * * 1921 * This routine does the operations that are necessary to * 1922 * clear a drive fault, assuming the drive state is unknown. * 1923 * This means that a seek operation is possible, so we may * 1924 * need to wait for an interrupt. * 1925 * Remember that a reseek operation is necessary after * 1926 * this routine is called. * 1927 * * 1928 * LD MDV => MDV element * 1929 * CALLNP CLEARFAULT * 1930 * * 1931 * * 1932 * Eats R0:R3. * 1933 * Stack required: 2 * 1934 * 1 + max ( SEEKNDWAIT (1) ) * 1935 * * 1936 ********************************************************************************** 1937 1938 BLOCK CLEARFAULT routine 1939 ENTRY CLEARFAULT 1940 1941 BEGFRAME 1942 ENDFRAME 1943 03C0E DD5F8001 6 STAK 1944 CLEARFAULT ENTRNP PUSH 03C0F 60095830 0 5 ZBM 1945 LD R0 MDV,MDVUNIT R0 = our unit number 03C10 EC201A18 0 1946 STZ CIX(BFDSEEK+BFDSELECTB+R0) clear out cyl, head, sector 03C11 DC403FBE 1947 CALLNP SEEKNDWAIT wait for possible seek end 03C12 FA0C3C1A 0 1948 JNEZ R0 RETURN0 jump if controller is dead 03C13 60040011 0 IMM 1949 LD R0 BFDFNCLFLT get function to clear fault 03C14 E4001A20 0 1950 ST R0 CIX(BFDFUNC) and issue it to clear any faults 03C15 60040020 0 IMM 1951 LD R0 BFDFNSAFE get command code to make drive safe 03C16 E4001A20 0 1952 ST R0 CIX(BFDFUNC) and issue it 03C17 DC403FBE 1953 CALLNP SEEKNDWAIT wait for possible seek end 03C18 FA0C3C1A 0 1954 JNEZ R0 RETURN0 jump if controller is dead 03C19 19C40001 7 IMM 1955 ADD R7 1 give skip return 1956 * \ / 00003C1A 1957 RETURN0 LABEL 03C1A 5D1F8001 6 STAK 1958 LEAVE POP return to caller 1959 * --- 1960 1961 END of CLEARFAULT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 785 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 1963 1964 ********************************************************************************** 1965 * * 1966 * DISKCHECK - Perform a Write-Check Operation. * 1967 * * 1968 * This routine will perform a write-check operation with * 1969 * error recovery. If assumes that the drive is already on * 1970 * cylinder (but if it's not, we will discover that fact and * 1971 * redo the seek). * 1972 * * 1973 * LD PPL => PPL element * 1974 * LD MDV => MDV element * 1975 * CALLNP DISKCHECK * 1976 * * 1977 * * 1978 * * 1979 * * 1980 * In the normal return case, the caller should inspect * 1981 * MDVSUB to see whether the block should be substituted. * 1982 * * 1983 * Registers Used: R0:R3 * 1984 * Stack Required: 10 * 1985 * 1 + max ( DISKSEEK (8), PADBUILD (3), STATCHECK (9), * 1986 * TRACEPROC(3) ) * 1987 * * 1988 ********************************************************************************** 1989 1990 BLOCK DISKCHECK subroutine 1991 ENTRY DISKCHECK 1992 1993 BEGFRAME 1994 ENDFRAME 1995 03C1B DD5F8001 6 STAK 1996 DISKCHECK ENTRNP PUSH 03C1C EC0949C3 5 ZBM 1997 STZ MDV,MDVERRFLDS clean out the error counters 03C1D FE0E3C21 1998 JMP RECHECK skip initial seek 1999 * --- 2000 00003C1E 2001 RESEEK LABEL 03C1E DC403C7B 2002 CALLNP DISKSEEK redo the seek 03C1F FE0E3C3C 2003 JMP OFFLINE jump if drive went offline 03C20 FE0E3C37 2004 JMP MUSTSUB jump if permanent seek error 2005 * \ / 2006 00003C21 2007 RECHECK LABEL 03C21 60040003 0 IMM 2008 LD R0 MDVSTONCYL new state: waiting to start transfer 03C22 DCD7481B 5 BASE 2009 EXPCS MDV,MDVPC wait our turn 03C23 FA0C3C3C 0 2010 JNEZ R0 OFFLINE jump if controller is dead 2011 * \ / 03C24 60040001 0 IMM 2012 LD R0 1*PPUIDMAD 03C25 E4001802 0 2013 ST R0 CIX(PPUSSSTAT) set DMA direction to output 03C26 DC403EAA 2014 CALLNP PADBUILD set up data transfer addresses 2015 * \ / 03C27 60095830 0 5 ZBM 2016 LD R0 MDV,MDVUNIT get unit number 03C28 6057480D 1 5 BASE 2017 LD R1 MDV,MDVTIMCODE get write time code 03C29 E4601AD8 1 0 2018 ST R1 CIX(BFDWRCH+1*BFDINTBIT+BFDSELECTB)(R0) start write-check 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 786 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2019 TRACE MSTRACE,MSTCHECK write-check, R0=unit, R1=TimeCode 03C2A 5D401D2C 2019 XCT TRACECALL(MSTRACE) 03C2B FEC00006 2019 NOP (MSTRACE*BITS 22:26)+(MSTCHECK*BITS 27:31) 03C2C 60040004 0 IMM 2020 LD R0 MDVSTDT new state: data transfer in progress 03C2D DCD7481B 5 BASE 2021 EXPCS MDV,MDVPC wait for it to complete 03C2E FA0C3C3C 0 2022 JNEZ R0 OFFLINE jump if controller is dead 2023 * \ / 03C2F DC003FCA 2024 CALL STATCHECK check our status 03C30 40440007 IMM 2025 PARVL OPCHECK operation is write-check 03C31 FE0E3C3C 2026 JMP OFFLINE drive went offline 03C32 FE0E3C37 2027 JMP MUSTSUB the case is hopeless 03C33 FE0E3C1E 2028 JMP RESEEK must redo the seek 03C34 FE0E3C21 2029 JMP RECHECK must redo the transfer 03C35 FE0E3C3B 2030 JMP NEEDWRITE check failed, but rewrite might help 03C36 FE0E3C3A 2031 JMP CHECKOK all is well 2032 * --- 2033 00003C37 2034 MUSTSUB LABEL 03C37 5C094013 5 ZBM 2035 CMZ MDV,MDVNOSUB should substitutions be ignored 03C38 FE0C3C3A 2036 JNE CHECKOK jump if yes 03C39 EDC94A13 5 ZBM 2037 STW MDV,MDVSUB say we must substitute 2038 * \ / 2039 00003C3A 2040 CHECKOK LABEL normal return 03C3A 61D7D001 7 7 REG 2041 LD R7 R7+1 2042 * \ / 2043 00003C3B 2044 NEEDWRITE LABEL failed check - rewrite may help 03C3B 61D7D001 7 7 REG 2045 LD R7 R7+1 2046 * \ / 2047 00003C3C 2048 OFFLINE LABEL drive is offline 03C3C 5D1F8001 6 STAK 2049 LEAVE POP return 2050 * --- 2051 2052 END DISKCHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 787 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2054 2055 ********************************************************************************** 2056 * * 2057 * DISKOPRMSG - Send a "Drive Is Offline" Message * 2058 * to the Operator. * 2059 * * 2060 * This routine sends a message to the front panel to say * 2061 * that the given drive has been taken offline by the system, * 2062 * and sends a short explanation to the operator. * 2063 * The messages are defined herein. The code parameter * 2064 * indicates the type of disk problem that occurred. * 2065 * Assignment: * 2066 * * 2067 * code lights operator * 2068 * ---- ------ -------- * 2069 * 0 "CRASH scu" "Suspected head crash on * 2070 * DSKscu... Do not use!" * 2071 * 1 "REZEROscu" "Unable to seek * 2072 * DSKscu... Do not use!" * 2073 * * 2074 * LD MDV => MDV element * 2075 * CALL DISKOPRMSG * 2076 * PARVL code * 2077 * * 2078 * Eats R0:R3. * 2079 * Stack required: 6 * 2080 * 2 + max ( GENOPMSG (1), HEXTOCHAR (4), P6TOCHAR (3), * 2081 * SGETMEM (0) ) * 2082 * * 2083 ********************************************************************************** 2084 2085 BLOCK DISKOPRMSG Subroutine 2086 ENTRY DISKOPRMSG 2087 2088 BEGFRAME 00178801 6 BASE 2089 MSGPTR BSS 1 loc of message group 2090 ENDFRAME 2091 03C3D DD1F8002 6 STAK 2092 DISKOPRMSG ENTR PUSH 03C3E C0520000 0 REG 2093 STPVL R0 get code 03C3F 60203C66 0 0 2094 LD R0 MSGPTRTAB(R0) determine msgs to use 03C40 E4178801 0 6 BASE 2095 ST R0 MSGPTR save loc of msg group 03C41 DC002ED0 2096 CALL SGETMEM get an OPMSG block 03C42 40440005 IMM 2097 PARVL OPMSGLOG 03C43 61120000 4 0 REG 2098 LD R4 R0 2099 * \ / 03C44 38970802 2 4 BASE 2100 LEA R2 R4,OPMSGTEXT put lights part into message 03C45 60178801 0 6 BASE 2101 LD R0 SP,MSGPTR get current position in block 03C46 60560400 1 0 @R 2102 LD R1 @R0 get length field 03C47 38160001 0 0 CACH 2103 LEA R0 CACH R0,1 get address of first char 03C48 FE400000 2104 CMOVE move chars 03C49 E4178801 0 6 BASE 2105 ST R0 SP,MSGPTR save current position in block 2106 * \ / 03C4A 60495F11 1 5 ZBM 2107 LD R1 MDV,MDVCNTL R1 => MCT element 03C4B 60084841 0 1 ZBM 2108 LD R0 R1,MCTPMVALUE/PFSLOT R0 = PPU slot number 03C4C 600A0800 0 0 CBM 2109 LD R0 R0/BITS 4:3 shift left 1 hex digit 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 788 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03C4D 18087021 0 1 ZBM 2110 ADD R0 R1,MCTPMVALUE/PPUCHAN insert BFD channel number 03C4E 600A0800 0 0 CBM 2111 LD R0 R0/BITS 4:3 shift left another hex digit 03C4F 18095830 0 5 ZBM 2112 ADD R0 MDV,MDVUNIT R0 = hardware address 03C50 DC0058D1 2113 CALL HEXTOCHAR convert it to characters 03C51 41520000 0 REG 2114 PARV R0 value 03C52 41440003 IMM 2115 PARV 3 field width 03C53 40168000 2 CACH 2116 PARL CACH R2,0 where to put it 2117 * \ / R2 => null at end of string 03C54 60178801 0 6 BASE 2118 LD R0 SP,MSGPTR get current position in msg group 03C55 60560400 1 0 @R 2119 LD R1 @R0 get length field 03C56 38160001 0 0 CACH 2120 LEA R0 CACH R0,1 get address of first char 03C57 FE400000 2121 CMOVE move chars 2122 * \ / 03C58 DC00593E 2123 CALL P6TOCHAR put disk name into message 03C59 41574805 5 BASE 2124 PARV MDV,MDVNAME 03C5A 40168000 2 CACH 2125 PARL CACH R2,0 2126 * \ / R2 => null at end of string 03C5B 60043C77 0 IMM 2127 LD R0 ADR FINW pointer to final msg part 03C5C 6044000F 1 IMM 2128 LD R1 FINWLEN length 03C5D FE400000 2129 CMOVE move chars 2130 * \ / 03C5E 38170802 0 4 BASE 2131 LEA R0 R4,OPMSGTEXT R0 = beginning of text 03C5F 608A9F30 2 2 CBM 2132 LD R2 R2/FLDCHARS 03C60 108A1F30 2 0 CBM 2133 SUB R2 R0/FLDCHARS R2 = message length 03C61 E4970007 2 4 CACH 2134 ST R2 R4,OPMSGLEN save it 03C62 EC0902E0 4 ZBM 2135 STZ R4,OPMSGPROC no process number 03C63 DC0046F3 2136 CALL GENOPMSG generate the message 03C64 40530000 4 REG 2137 PARVL R4 03C65 5D1F8002 6 STAK 2138 LEAVE POP return to caller 2139 * --- 2140 2141 * Table of message descriptors indexed by msg code 00003C66 2142 MSGPTRTAB LABEL 03C66 020C3C68 2143 PTR MSG0 head crash 03C67 420C3C70 2144 PTR MSG1 re-zero probs 2145 2146 * Operator message when drive appears to have 2147 * a head crash and we've retracted heads 02003C68 2148 MSG0 BSSC 0 03C67 00000006 2149 VFDC 6 03C68 00000020 2150 VFDC "C","R","A","S","H"," " 03C69 00000019 2151 VFDC 25 03C6B 00000020 2152 VFDC " ","S","u","s","p","e","c","t","e","d"," " 03C6F 00000020 2153 VFDC "h","e","a","d"," ","c","r","a","s","h"," ","o","n"," " 2154 2155 * Operator message when drive must be taken offline 2156 * because it can't be re-zeroed. 42003C70 2157 MSG1 BSSC 0 03C6F 00000006 2158 VFDC 6 03C71 0000004F 2159 VFDC "R","E","Z","E","R","O" 03C71 00000010 2160 VFDC 16 03C75 00000020 2161 VFDC " ","U","n","a","b","l","e"," ","t","o"," ","s","e","e","k"," " 2162 2163 * Final warning on both messages 0000000F ABS 2164 FINWLEN EQU 15 03C77 2E2E2E20 2165 FINW TEXT "... Do not use!" 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 789 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2166 2167 END DISKOPRMSG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 790 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2169 2170 ********************************************************************************** 2171 * * 2172 * DISKSEEK - Perform a Seek on the Disk. * 2173 * * 2174 * This routine will seek the disk, and wait for it to * 2175 * complete. It will do any necessary retries. * 2176 * * 2177 * LD PPL => PPL (used for error logging only) * 2178 * LD MDV => MDV element (MDVSEEKADR must be set) * 2179 * CALLNP DISKSEEK * 2180 * * 2181 * * 2182 * * 2183 * * 2184 * Registers Used: R0:R3 * 2185 * Stack Required: 8 * 2186 * 1 + max ( REZERO (7), SEEKNDSTAT (4), SEEKNDWAIT (1) * 2187 * TRACEPROC (3) ) * 2188 * * 2189 ********************************************************************************** 2190 2191 BLOCK DISKSEEK subroutine 2192 ENTRY DISKSEEK 2193 2194 BEGFRAME 2195 ENDFRAME 2196 03C7B DD5F8001 6 STAK 2197 DISKSEEK ENTRNP PUSH 00003C7C 2198 RESEEK LABEL 03C7C 60095F11 0 5 ZBM 2199 LD R0 MDV,MDVCNTL get the controller element pointer 03C7D 5C081014 0 ZBM 2200 CMZ R0,MCTDEAD is the controller dead? 03C7E FE0C3C91 2201 JNE RETURN split if so 2202 * \ / 03C7F 60095830 0 5 ZBM 2203 LD R0 MDV,MDVUNIT get unit number 03C80 60574808 1 5 BASE 2204 LD R1 MDV,MDVSEEKADR get seek address 03C81 68574804 1 5 BASE 2205 UCPR R1 MDV,MDVMAXSEEK is the address reasonable? 03C82 ECC94C19 5 ZBM 2206 STLGE MDV,MDVBFDSTAT/BFDSSSKERR indicate seek error if not 03C83 ECC94C1B 5 ZBM 2207 STLGE MDV,MDVLOPSTAT/BFDSSSKERR remember in last operation status 03C84 FE063C99 2208 JGE PERMDSKERR and don't even try the operation 03C85 E4601A18 1 0 2209 ST R1 CIX(BFDSEEK+BFDSELECTB)(R0) start the seek 2210 TRACE MSTRACE,MSTSEEK seeking, R0=unit, R1=SeekAdr 03C86 5D401D2C 2210 XCT TRACECALL(MSTRACE) 03C87 FEC00002 2210 NOP (MSTRACE*BITS 22:26)+(MSTSEEK*BITS 27:31) 2211 * \ / 03C88 DC403FBE 2212 CALLNP SEEKNDWAIT wait for seek to complete 03C89 FA0C3C91 0 2213 JNEZ R0 RETURN jump if controller is dead 03C8A 60174809 0 5 BASE 2214 LD R0 MDV,MDVBFDSTAT get disk status after seek 03C8B E417480B 0 5 BASE 2215 ST R0 MDV,MDVLOPSTAT and save in last operation status 03C8C DC003FA0 2216 CALL SEEKNDSTAT check seek end status 03C8D 40440001 IMM 2217 PARVL OPSEEK doing seek 03C8E FE0E3C91 2218 JMP RETURN jump if went offline 03C8F FE0E3C92 2219 JMP SEEKERR jump if seek error 2220 * \ / 03C90 61D7D002 7 7 REG 2221 LD R7 R7+2 normal return 00003C91 2222 RETURN LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 791 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03C91 5D1F8001 6 STAK 2223 LEAVE POP 2224 * -- 2225 00003C92 2226 SEEKERR LABEL 03C92 DC403F74 2227 CALLNP REZERO try to realign the drive 03C93 FE0E3C91 2228 JMP RETURN jump if drive offline 03C94 BC095843 0 5 ZBM 2229 INCL R0 MDV,MDVSKERRS say one more seek error 03C95 5C094213 5 ZBM 2230 CMZ MDV,MDVNOERRS see if special error handling 03C96 FE0C3C99 2231 JNE PERMDSKERR if so, one is too many 03C97 64040005 0 IMM 2232 CPR R0 MDVSKERLIM too many otherwise? 03C98 FE083C7C 2233 JLT RESEEK jump if not 2234 * \ / 00003C99 2235 PERMDSKERR LABEL 03C99 FBE03C91 7 2236 IRJ R7 RETURN else give error return 2237 * --- 2238 2239 END DISKSEEK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 792 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2241 2242 ********************************************************************************** 2243 * * 2244 * DISKWRITE - Write a Disk Block. * 2245 * * 2246 * This routine will perform a disk-write operation, * 2247 * retrying as necessary. It will not do such things as * 2248 * write-check, however. * 2249 * * 2250 * LD PPL => PPL element * 2251 * LD MDV => MDV element * 2252 * CALLNP DISKWRITE * 2253 * * 2254 * * 2255 * * 2256 * * 2257 * Registers Used: R0:R3 * 2258 * Stack Required: 10 * 2259 * 1 + max ( DISKSEEK (8), PADBUILD (3), STATCHECK (9), * 2260 * TRACEPROC(3) ) * 2261 * * 2262 ********************************************************************************** 2263 2264 BLOCK DISKWRITE subroutine 2265 ENTRY DISKWRITE 2266 2267 BEGFRAME 2268 ENDFRAME 2269 03C9A DD5F8001 6 STAK 2270 DISKWRITE ENTRNP PUSH 03C9B EC0949C3 5 ZBM 2271 STZ MDV,MDVERRFLDS reset error counters 2272 * \ / 2273 00003C9C 2274 RESEEK LABEL 03C9C DC403C7B 2275 CALLNP DISKSEEK do the seek 03C9D FE0E3CBC 2276 JMP OFFLINE jump if drive went offline 03C9E FE0E3CB7 2277 JMP MUSTSUB jump if permanent seek error 2278 * \ / 2279 00003C9F 2280 REWRITE LABEL 03C9F 60040003 0 IMM 2281 LD R0 MDVSTONCYL new state: on cylinder 03CA0 DCD7481B 5 BASE 2282 EXPCS MDV,MDVPC wait our turn 03CA1 FA0C3CBC 0 2283 JNEZ R0 OFFLINE jump if controller is dead 2284 * \ / 03CA2 60040001 0 IMM 2285 LD R0 1*PPUIDMAD 03CA3 E4001802 0 2286 ST R0 CIX(PPUSSSTAT) set DMA to output 03CA4 DC403EAA 2287 CALLNP PADBUILD set up data transfer addresses 2288 * \ / 03CA5 D0174807 5 BASE 2289 INC MDV,MDVWRITCNT count number of writes 03CA6 60095830 0 5 ZBM 2290 LD R0 MDV,MDVUNIT get unit number 03CA7 60401EE6 1 2291 LD R1 FDATE(1) get timecode value 03CA8 E4601AC8 1 0 2292 ST R1 CIX(BFDWRITE+1*BFDINTBIT+BFDSELECTB)(R0) start the write 2293 TRACE MSTRACE,MSTWRITE write, R0=unit, R1=TimeCode 03CA9 5D401D2C 2293 XCT TRACECALL(MSTRACE) 03CAA FEC00005 2293 NOP (MSTRACE*BITS 22:26)+(MSTWRITE*BITS 27:31) 03CAB E457480D 1 5 BASE 2294 ST R1 MDV,MDVTIMCODE save the time code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 793 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2295 * \ / 03CAC 60040004 0 IMM 2296 LD R0 MDVSTDT new state: doing transfer 03CAD DCD7481B 5 BASE 2297 EXPCS MDV,MDVPC wait for it to complete 03CAE FA0C3CBC 0 2298 JNEZ R0 OFFLINE jump if controller is dead 2299 * \ / 03CAF DC003FCA 2300 CALL STATCHECK check our status 03CB0 40440006 IMM 2301 PARVL OPWRITE doing a write 03CB1 FE0E3CBC 2302 JMP OFFLINE jump if drive went offline 03CB2 FE0E3CB7 2303 JMP MUSTSUB jump if hopeless error 03CB3 FE0E3C9C 2304 JMP RESEEK jump if need to reseek 03CB4 FE0E3C9F 2305 JMP REWRITE jump if need to redo the write 03CB5 FE0E3CBB 2306 JMP MEMPARERR jump if memory parity error 03CB6 FE0E3CBA 2307 JMP WRITEOK jump if all went well 2308 * --- 2309 00003CB7 2310 MUSTSUB LABEL 03CB7 5C094013 5 ZBM 2311 CMZ MDV,MDVNOSUB are substitutions to be ignored 03CB8 FE0C3CBA 2312 JNE WRITEOK jump if they are 03CB9 EDC94A13 5 ZBM 2313 STW MDV,MDVSUB say we should substitute 2314 * \ / 2315 00003CBA 2316 WRITEOK LABEL normal return 03CBA 61D7D001 7 7 REG 2317 LD R7 R7+1 2318 * \ / 2319 00003CBB 2320 MEMPARERR LABEL memory parity error 03CBB 61D7D001 7 7 REG 2321 LD R7 R7+1 2322 * \ / 2323 00003CBC 2324 OFFLINE LABEL drive is offline 03CBC 5D1F8001 6 STAK 2325 LEAVE POP return 2326 * --- 2327 2328 END DISKWRITE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 794 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2330 2331 ********************************************************************************** 2332 * * 2333 * DOREADREQ - Process a Read Request. * 2334 * * 2335 * This routine will process a read request if possible. * 2336 * There are actually six different types of requests, as * 2337 * follows: * 2338 * * 2339 * If MSQFORMAT = 1, the track corresponding to MSQBLOCK gets * 2340 * formatted. * 2341 * * 2342 * If MSQREINIT = 1, the drive's MDV get's reinitialized from * 2343 * the pack label, etc.. * 2344 * * 2345 * Otherwise, the two flags are interpreted as: * 2346 * * 2347 * MSQSNEWAD MSQZPAGE action * 2348 * --------- -------- ------------------------------ * 2349 * 0 X Read block MSQACTAD. * 2350 * 1 0 Get block MSQACTAD, convert to MSQBLOCK. * 2351 * 1 1 Get zero page, convert to MSQBLOCK. * 2352 * * 2353 * If it is not possible to do the request because no * 2354 * idle pages are available, we will do nothing. If it is * 2355 * possible, we will remove and free the MSQ element after * 2356 * completion. Note that a format operation requires no PPL, * 2357 * hence it will most certainly get done. * 2358 * Note the oddity that FORMAT is a read operation. This * 2359 * is for list locking considerations. See the ORFORMAT OPREQ. * 2360 * * 2361 * LD MSQ => MSQ element * 2362 * LD MDV => MDV element * 2363 * CALLNP DOREADREQ * 2364 * * 2365 * * 2366 * * 2367 * Registers Used: R0:R4 * 2368 * Stack Required: 17 * 2369 * 1 + max ( ADDRSWITCH (16), FORMAT (10), GETZEROPAGE (5), * 2370 * LOCKWAIT (0), PUTPPAGE (1), READ (13), * 2371 * RQSTDONE (13) ) * 2372 * * 2373 ********************************************************************************** 2374 2375 BLOCK DOREADREQ subroutine 2376 ENTRY DOREADREQ 2377 2378 BEGFRAME 2379 ENDFRAME 2380 00003CBD 2381 MSREADTAB LABEL 03CBD 00003CCC 2382 ADR NORMREAD normal read request 03CBE 00003CD1 2383 ADR FUNNYREAD address switch request 03CBF 00003CCC 2384 ADR NORMREAD normal read 03CC0 00003CD5 2385 ADR ZIPPAGE zero page request 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 795 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2386 03CC1 DD5F8001 6 STAK 2387 DOREADREQ ENTRNP PUSH 03CC2 6008D230 0 3 ZBM 2388 LD R0 MSQ,MSQTYPE/MSQMAIFLD get the maintenance bits only 03CC3 E4094033 0 5 ZBM 2389 ST R0 MDV,MDVMAIFLD and put into the MDV element 2390 2391 * check for special operations 03CC4 5C08D010 3 ZBM 2392 CMZ MSQ,MSQTYPE/MSQFORMAT is this a format request? 03CC5 FE0C3CE8 2393 JNE DOFORMAT jump if it is 03CC6 5C08CE10 3 ZBM 2394 CMZ MSQ,MSQTYPE/MSQREINIT is this a reinit request? 03CC7 FE0C3CEB 2395 JNE DOREINIT jump if it is 2396 * \ / 2397 03CC8 60094213 0 5 ZBM 2398 LD R0 MDV,MDVNOERRS error recovery inhibit flag 03CC9 E4094613 0 5 ZBM 2399 ST R0 MDV,MDVNOLOG forego logging maint errors 03CCA 6008DA20 0 3 ZBM 2400 LD R0 MSQ,MSQTYPE/MSQTYPFLD get non maintenance bits 03CCB 5CA03CBD 0 2401 LDPC MSREADTAB(R0) perform appropriate processing 2402 * --- 2403 2404 * Normal read request 2405 00003CCC 2406 NORMREAD LABEL 03CCC DC003EBE 2407 CALL READ read from disk 03CCD 4056C802 3 BASE 2408 PARVL MSQ,MSQACTAD block number wanted 03CCE FE0E3CE7 2409 JMP OFFLINE jump if drive is offline 03CCF FE0E3CE6 2410 JMP CANTREAD jump if no pages available 03CD0 FE0E3CD8 2411 JMP DIDREAD jump if we got the page 2412 * --- 2413 2414 * Address switch request 2415 00003CD1 2416 FUNNYREAD LABEL 03CD1 DC403AF8 2417 CALLNP ADDRSWITCH do address-switch request 03CD2 FE0E3CE7 2418 JMP OFFLINE jump if drive went offline 03CD3 FE0E3CE6 2419 JMP CANTREAD jump if no pages available 03CD4 FE0E3CD8 2420 JMP DIDREAD jump if we got the page 2421 * --- 2422 2423 * Zero page request 2424 00003CD5 2425 ZIPPAGE LABEL 03CD5 DC003E18 2426 CALL GETZEROPG do zero-page request 03CD6 4056C801 3 BASE 2427 PARVL MSQ,MSQBLOCK block number to become 03CD7 FE0E3CE6 2428 JMP CANTREAD jump if page not available 2429 * \ / 2430 00003CD8 2431 DIDREAD LABEL 03CD8 DC402D6C 2432 CALLNP PUTPPAGE put PPL on PPAGE list 2433 * \ / 00003CD9 2434 FORMATXIT LABEL (jumped to w/PPL=0) 2435 PLOCK MSQINLOCK lock the MS read queue 03CD9 0CC00000 2435 IOFF 03CDA D1C01F16 2435 SETT MSQINLOCK 03CDB FE0C3CDD 2435 JNE MA(2+DISPW MA 0) 03CDC DC40308B 2435 CALLNP LOCKWAIT 03CDD 60494080 1 5 ZBM 2436 LD R1 MDV,MDVVOLUME get volume number 03CDE 60621F22 1 1 2437 LD R1 VOLNTABLE(R1) R1 -> VOLN element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 796 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03CDF 60D64816 3 1 BASE 2438 LD MSQ R1,VOLNREADQ first read request 03CE0 6008DF10 0 3 ZBM 2439 LD R0 MSQ,MSQLINK the rest of the list 03CE1 E4164816 0 1 BASE 2440 ST R0 R1,VOLNREADQ remove first element from read queue 2441 PUNLOCK MSQINLOCK unlock the input queue 03CE2 EC001F16 2441 STZ MSQINLOCK 03CE3 0C800000 2441 ION 2442 * \ / 03CE4 D0401F18 2443 DEC DISKRBUSY decrement the number of MS read requests 03CE5 DC403F95 2444 CALLNP RQSTDONE clean up after request 2445 * \ / 2446 00003CE6 2447 CANTREAD LABEL 03CE6 61D7D001 7 7 REG 2448 LD R7 R7+1 normal return 2449 * \ / 2450 00003CE7 2451 OFFLINE LABEL 03CE7 5D1F8001 6 STAK 2452 LEAVE POP return to caller 2453 * --- 2454 2455 ********************************************************************************** 2456 * * 2457 * DOFORMAT - Format a Track on a Disk. * 2458 * * 2459 * This code handle the request to format a track. The * 2460 * MSQ element contains a disk address, we seek to that block * 2461 * and start the format operation there. * 2462 * * 2463 * N.B. There is no PPL associated with this request. * 2464 * * 2465 ********************************************************************************** 2466 00003CE8 2467 DOFORMAT LABEL 03CE8 DC403D79 2468 CALLNP FORMAT format a track 03CE9 FE0E3CE7 2469 JMP OFFLINE jump if drive went offline 03CEA FE0E3CD9 2470 JMP FORMATXIT finish the request 2471 * --- 2472 2473 ********************************************************************************** 2474 * * 2475 * DOREINIT - Reinitialize the MDV * 2476 * * 2477 * This code handles the request to ensure that the MDV * 2478 * has the up-to-date drive info from the pack itself. It's * 2479 * needed when a drive is made readable online (i.e. formatted). * 2480 * This is deceptively simple! It decrements R7 so that * 2481 * we'll take the OFFLINE exit (but not until the MSQ element * 2482 * is dumped!), sets the flag that causes CHECKSTATE to be * 2483 * called, and clears the flag MDVREADY flag so CHECKSTATE * 2484 * will reread the pack label, etc. (i.e. it looks like the * 2485 * drive was "made safe by boot"). * 2486 * * 2487 * Note that the operation isn't complete by the time this * 2488 * subroutine returns! For this reason, and because there * 2489 * is no MS block involved, we have no one to unsuspend from * 2490 * MSWAIT. * 2491 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 797 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2492 * N.B. There is no PPL associated with this request. We * 2493 * therefore clear the PPL register for RQSTDONE. * 2494 * * 2495 ********************************************************************************** 2496 00003CEB 2497 DOREINIT LABEL 03CEB 11C40001 7 IMM 2498 SUB R7 1 so that we take OFFLINE exit 2499 SETTBIT MDV,MDVCHKSTAT so CHECKSTATE is called 03CEC 60020080 0 IMM 2499 LD R0 1*BIT(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 0:4) 03CED FC174800 0 5 BASE 2499 IORM R0 MDV,(((MDV,MDVCHKSTAT) DISP (MDV,0))/BITS 15:31) 2500 CLRTBIT MDV,MDVREADY so CHECKSTATE resets MDV 03CEE 60020100 0 IMM 2500 LD R0 1*BIT(((MDV,MDVREADY) DISP (MDV,0))/BITS 0:4) 03CEF A8174800 0 5 BASE 2500 BRSBM R0 MDV,(((MDV,MDVREADY) DISP (MDV,0))/BITS 15:31) 03CF0 61040000 4 IMM 2501 LD PPL 0 indicate no page associated 03CF1 FE0E3CD9 2502 JMP FORMATXIT finish the request 2503 * --- 2504 2505 END DOREADREQ subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 798 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2507 2508 ********************************************************************************** 2509 * * 2510 * DOREWRITE - Rewrite a Block for Error Recovery. * 2511 * * 2512 * This routine will re-write and write-check a block. It * 2513 * is called by READ and WRITE for error-recovery purposes. * 2514 * * 2515 * LD PPL => PPL * 2516 * LD MDV => MDV element * 2517 * CALLNP DOREWRITE * 2518 * * 2519 * * 2520 * * 2521 * Registers Used: R0:R3 * 2522 * Stack Required: 11 * 2523 * 1 + max ( DISKCHECK (10), DISKWRITE (10) ) * 2524 * * 2525 ********************************************************************************** 2526 2527 BLOCK DOREWRITE subroutine 2528 ENTRY DOREWRITE 2529 2530 BEGFRAME 2531 ENDFRAME 2532 03CF2 DD5F8001 6 STAK 2533 DOREWRITE ENTRNP PUSH 03CF3 DC403C9A 2534 CALLNP DISKWRITE write the block 03CF4 FE0E3CFC 2535 JMP OFFLINE jump if drive is offline 03CF5 FE0E3CFB 2536 JMP RETURN jump if memory parity error 03CF6 5C094A13 5 ZBM 2537 CMZ MDV,MDVSUB is substitute needed? 03CF7 FE0C3CFB 2538 JNE RETURN if so, don't bother with check 03CF8 DC403C1B 2539 CALLNP DISKCHECK do the write-check 03CF9 FE0E3CFC 2540 JMP OFFLINE jump if drive now offline 03CFA EDC94A13 5 ZBM 2541 STW MDV,MDVSUB flag if still not written well 2542 * \ / 2543 00003CFB 2544 RETURN LABEL 03CFB 61D7D001 7 7 REG 2545 LD R7 R7+1 normal return 2546 * \ / 2547 00003CFC 2548 OFFLINE LABEL 03CFC 5D1F8001 6 STAK 2549 LEAVE POP return 2550 * --- 2551 2552 END DOREWRITE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 799 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2554 2555 ********************************************************************************** 2556 * * 2557 * DOWRITEREQ - Process a Write Request. * 2558 * * 2559 * This routine will process a request on the MS write * 2560 * queue. There are two kinds of requests: dual-write and * 2561 * force-write. * 2562 * After performing the request, we clear the * 2563 * "force-write in progress" flag in the associated PPL. To * 2564 * appropriately interlock with the page-fault processor, the * 2565 * MSQINLOCK must be held while clearing the flag. Otherwise, * 2566 * the page-fault processor might decide that the page is not * 2567 * available and shut a user down at the same time that we are * 2568 * clearing the flag, and the user might never get awakened. * 2569 * * 2570 * LD MSQ => MSQ element * 2571 * LD MDV => MDV element * 2572 * CALLNP DOWRITEREQ * 2573 * * 2574 * * 2575 * * 2576 * Eats R0:R4. * 2577 * Stack required: 14 * 2578 * 1 + max ( LOCKWAIT (0), RQSTDONE (13), SFREEMEM (0), * 2579 * WRITE (13) ) * 2580 * * 2581 ********************************************************************************** 2582 2583 BLOCK DOWRITEREQ subroutine 2584 ENTRY DOWRITEREQ 2585 2586 BEGFRAME 2587 ENDFRAME 2588 03CFD DD5F8001 6 STAK 2589 DOWRITEREQ ENTRNP PUSH 03CFE 6008D230 0 3 ZBM 2590 LD R0 MSQ,MSQTYPE/MSQMAIFLD get the maintenance bits only 03CFF E4094033 0 5 ZBM 2591 ST R0 MDV,MDVMAIFLD and put into the MDV element 03D00 60094213 0 5 ZBM 2592 LD R0 MDV,MDVNOERRS error recovery inhibit flag 03D01 E4094613 0 5 ZBM 2593 ST R0 MDV,MDVNOLOG forego logging maint errors 03D02 6116C803 4 3 BASE 2594 LD PPL MSQ,MSQXPTR get extra PPL for dual-write 03D03 FB303D0A 4 2595 JZA PPL NOTDUAL jump if none, not a dual-write 03D04 DC4040D7 2596 CALLNP WRITE write the secondary block 03D05 FE0E3D23 2597 JMP OFFLINE jump if drive went offline 03D06 EC16C803 3 BASE 2598 STZ MSQ,MSQXPTR convert dual-write to force-write 03D07 DC002F5D 2599 CALL SFREEMEM free the funny extra PPL 03D08 41440004 IMM 2600 PARV PPFBLOG pass the size 03D09 40530000 4 REG 2601 PARVL PPL and the block address 2602 * \ / 2603 00003D0A 2604 NOTDUAL LABEL 03D0A 6116C802 4 3 BASE 2605 LD PPL MSQ,MSQPPPTR get pointer to real PPL 03D0B DC4040D7 2606 CALLNP WRITE write the block 03D0C FE0E3D23 2607 JMP OFFLINE jump if drive went offline 2608 * \ / 2609 PLOCK MSQINLOCK lock the INPUT queue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 800 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03D0D 0CC00000 2609 IOFF 03D0E D1C01F16 2609 SETT MSQINLOCK 03D0F FE0C3D11 2609 JNE MA(2+DISPW MA 0) 03D10 DC40308B 2609 CALLNP LOCKWAIT 2610 CLRTBIT PPL,PPFWIP clear the force-write bit 03D11 60022000 0 IMM 2610 LD R0 1*BIT(((PPL,PPFWIP) DISP (PPL,0))/BITS 0:4) 03D12 A8170802 0 4 BASE 2610 BRSBM R0 PPL,(((PPL,PPFWIP) DISP (PPL,0))/BITS 15:31) 2611 PUNLOCK MSQINLOCK unlock the input queue 03D13 EC001F16 2611 STZ MSQINLOCK 03D14 0C800000 2611 ION 2612 * \ / 2613 PLOCK MSQOUTLOCK lock the output queue 03D15 0CC00000 2613 IOFF 03D16 D1C01F17 2613 SETT MSQOUTLOCK 03D17 FE0C3D19 2613 JNE MA(2+DISPW MA 0) 03D18 DC40308B 2613 CALLNP LOCKWAIT 03D19 60494080 1 5 ZBM 2614 LD R1 MDV,MDVVOLUME get volume number 03D1A 60621F22 1 1 2615 LD R1 VOLNTABLE(R1) R1 -> VOLN element 03D1B 60D64817 3 1 BASE 2616 LD MSQ R1,VOLNWRITEQ 03D1C 6008DF10 0 3 ZBM 2617 LD R0 MSQ,MSQLINK 03D1D E4164817 0 1 BASE 2618 ST R0 R1,VOLNWRITEQ remove first element from write queue 2619 PUNLOCK MSQOUTLOCK unlock the output queue 03D1E EC001F17 2619 STZ MSQOUTLOCK 03D1F 0C800000 2619 ION 2620 * \ / 03D20 D0401F19 2621 DEC DISKWBUSY say one less write pending 03D21 DC403F95 2622 CALLNP RQSTDONE finish off the request 03D22 61D7D001 7 7 REG 2623 LD R7 R7+1 good return 2624 * \ / 00003D23 2625 OFFLINE LABEL 03D23 5D1F8001 6 STAK 2626 LEAVE POP return 2627 * --- 2628 2629 END DOWRITEREQ subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 801 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2631 2632 ********************************************************************************** 2633 * * 2634 * FIXSEGMENT - Correct a Single-Segment Error after * 2635 * Read. * 2636 * * 2637 * This routine will read the correction segment from the * 2638 * disk controller and fix up the segment in error. It must be * 2639 * called after a read and before any other data transfer * 2640 * operation on the controller. * 2641 * This is a controller operation, so it should not fail * 2642 * unless the controller got tied up and MS_RESET was called. * 2643 * This invalidates the check segment, so no retries are made. * 2644 * Appropriate recovery is to reread the block. * 2645 * * 2646 * LD R0 bad segment number * 2647 * LD PPL => PPL of block read * 2648 * LD MDV => MDV element * 2649 * CALLNP FIXSEGMENT * 2650 * * 2651 * * 2652 * * 2653 * Eats R0:R3. * 2654 * Stack required: 7 * 2655 * 4 + max ( ERRORLOG (3), MAPINFBI (2), MAPOUTFBI (2), * 2656 * SFREEMEM (0), SGETMEM (0), TRACEPROC (3) ) * 2657 * * 2658 ********************************************************************************** 2659 2660 BLOCK FIXSEGMENT subroutine 2661 ENTRY FIXSEGMENT 2662 2663 BEGFRAME 00178801 6 BASE 2664 BLOCKPTR BSS 1 address of correction segment memory 00178802 6 BASE 2665 BADSEGPTR BSS 1 offset to end of bad segment 00178803 6 BASE 2666 PPLFBI BSS 1 address of FBI for bad segment 00000040 BYTE 2667 SAVESEGN EQU BITS 0:3 some temp storage in R7 2668 ENDFRAME 2669 03D24 DD5F8004 6 STAK 2670 FIXSEGMENT ENTRNP PUSH 03D25 E40BC040 0 7 CBM 2671 ST R0 R7/SAVESEGN save away so ERRORLOG doesn't get it 03D26 60D20000 3 0 REG 2672 LD R3 R0 place here for parameter passing 03D27 DC005048 2673 CALL ERRORLOG log that we are trying to correct 03D28 41440C39 IMM 2674 PARV ERLCRDGCS reading check segment 03D29 41574805 5 BASE 2675 PARV MDV,MDVNAME drive name 03D2A 41570801 4 BASE 2676 PARV PPL,PPBLOCK block number 03D2B 4052C000 3 REG 2677 PARVL R3 segment number 2678 03D2C 60CBC040 3 7 CBM 2679 LD R3 R7/SAVESEGN restore bad segment number 03D2D FAC23D78 3 2680 JEQZ R3 BADSEGNUM jump if segment number out of range 03D2E 68C4000A 3 IMM 2681 UCPR R3 BFDCHKSEG is error in correction segment? 03D2F FE043D78 2682 JGT BADSEGNUM jump if unreasonable 03D30 FE083D32 2683 JLT OKSEGNUM jump if reasonable 03D31 FBE03D77 7 2684 IRJ R7 RETURN error is in correction segment - do nothing 2685 * --- 2686 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 802 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 00003D32 2687 OKSEGNUM LABEL 03D32 1CC40073 3 IMM 2688 MUL R3 BFDSEGSIZE R3 = offset to END of bad segment 03D33 E4D78802 3 6 BASE 2689 ST R3 SP,BADSEGPTR save it 03D34 DC002ED0 2690 CALL SGETMEM get space for correction segment 03D35 40440007 IMM 2691 PARVL (BFDSEGSIZE+1) LOG 2 03D36 E4178801 0 6 BASE 2692 ST R0 SP,BLOCKPTR save pointer to block 2693 * \ / 2694 2695 * Read the correction segment. 2696 2697 * \ / 03D37 60CA1E70 3 0 CBM 2698 LD PFPTR R0/FLDPAGE page number of gotten page 03D38 7CC40080 3 IMM 2699 IOR PFPTR MONPF make it monitor space 03D39 80928000 2 REG 2700 PFRD R2 get real page number 03D3A E48A14C0 2 0 CBM 2701 ST R2 R0/FLDABSPG replace virt page with real page 03D3B E40A9560 0 2 CBM 2702 ST R0 R2/PAGEANDISP combine with slot number 03D3C 60040001 0 IMM 2703 LD R0 1*PPUIDMAD 03D3D E4001803 0 2704 ST R0 CIX(PPUSCSTAT) set DMA direction to input 03D3E E4801805 2 2705 ST R2 CIX(PPUADDR1) set transfer address 03D3F 600481D0 0 IMM 2706 LD R0 (BFDSEGSIZE+1)*CPW+1*PPUCLAST 03D40 E4001804 0 2707 ST R0 CIX(PPUCNT1) set byte count 03D41 60095830 0 5 ZBM 2708 LD R0 MDV,MDVUNIT get unit number in R0 for trace 03D42 EDE01AB8 0 2709 STW CIX(BFDREAD+BFDSELECTB+1*BFDINTBIT)(R0) get check segment 2710 TRACE MSTRACE,MSTRDCHK get check seg, R0=unit 03D43 5D401D2C 2710 XCT TRACECALL(MSTRACE) 03D44 FEC00004 2710 NOP (MSTRACE*BITS 22:26)+(MSTRDCHK*BITS 27:31) 2711 * \ / 03D45 60040004 0 IMM 2712 LD R0 MDVSTDT new state: data transfer in progress 03D46 DCD7481B 5 BASE 2713 EXPCS MDV,MDVPC wait for it to complete 2714 * \ / 2715 03D47 FA0C3D73 0 2716 JNEZ R0 FREEBLK jump if controller is dead 03D48 62574809 125 BASE 2717 LD2 R1 MDV,MDVBFDSTAT get statuses 03D49 78403962 1 2718 AND R1 XFERMASK mask off irrelevant bits 03D4A 64403963 1 2719 CPR R1 XFEROK is all well with disk? 03D4B FE0C3D4E 2720 JNE BUMSEG jump if not 03D4C 78856540 2 IMM 2721 AND R2 PPUMASK mask off irrelevant PPU bits 03D4D FA823D57 2 2722 JEQZ R2 GOTSEG exit if life is easy 2723 * \ / 2724 00003D4E 2725 BUMSEG LABEL 03D4E DC005048 2726 CALL ERRORLOG log the bad transfer 03D4F 41441A32 IMM 2727 PARV ERLCDE disk error 03D50 41574805 5 BASE 2728 PARV MDV,MDVNAME 03D51 41570801 4 BASE 2729 PARV PPL,PPBLOCK block number 03D52 41574808 5 BASE 2730 PARV MDV,MDVSEEKADR seek address 03D53 41440005 IMM 2731 PARV OPCHKSEG operation 03D54 41574809 5 BASE 2732 PARV MDV,MDVBFDSTAT disk status 03D55 4057480A 5 BASE 2733 PARVL MDV,MDVPPUSTAT channel status 03D56 FE0E3D73 2734 JMP FREEBLK take error return 2735 * --- 2736 2737 * Map the block into WNDO4, then do the XOR trick to 2738 * fix the bad segment. 00003D57 2739 GOTSEG LABEL 03D57 DC002606 2740 CALL MAPINFBI map the FBI to correct 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 803 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03D58 40530000 4 REG 2741 PARVL PPL pass physical page element 03D59 E4578803 1 6 BASE 2742 ST R1 SP,PPLFBI store FBI loc 03D5A 60C40085 3 IMM 2743 LD PFPTR PNWNDO4 page number of available window 03D5B 00D70803 4 BASE 2744 LDPF PPL,PPPMVALUE map page into WNDO4 03D5C 60D78801 3 6 BASE 2745 LD R3 SP,BLOCKPTR R3 -> correction segment 03D5D 6087FF8D 2 IMM 2746 LD R2 -BFDSEGSIZE get initial word index 2747 * \ / 2748 00003D5E 2749 NEXTWORD LABEL 03D5E 60569073 1 2 REG 2750 LD R1 R2+BFDSEGSIZE copy the 'within segment' word index 03D5F 601CC800 0 31 BASE 2751 LD R0 R3,0(R1) get word from correction segment 03D60 10440400 1 IMM 2752 SUB R1 WPP make data/FBI split at 0! 2753 * \ / 2754 00003D61 2755 DOREGW LABEL 03D61 74221800 0 1 2756 XOR R0 WNDO4(WPP)(R1) get word from data area 03D62 18440073 1 IMM 2757 ADD R1 BFDSEGSIZE move to corresponding word in next segment 03D63 FA483D61 1 2758 JLTZ R1 DOREGW jump if still in data area 03D64 6444000B 1 IMM 2759 CPR R1 9*BFDSEGSIZE-WPP not in data area, still in FBI? 03D65 FE063D67 2760 JGE DIDFBIW jump if not in FBI 03D66 741D8C03 0 61 FPVR 2761 XOR R0 @(SP,PPLFBI)(R1) do last word from FBI 00003D67 2762 DIDFBIW LABEL 03D67 60578802 1 6 BASE 2763 LD R1 SP,BADSEGPTR get pointer to end of bad segment 03D68 18528000 1 2 REG 2764 ADD R1 R2 make point to current word 03D69 10440400 1 IMM 2765 SUB R1 WPP make data/FBI split at 0 03D6A FA483D6D 1 2766 JLTZ R1 COREGW jump if not into FBI 03D6B F41D8C03 0 61 FPVR 2767 XORM R0 @(SP,PPLFBI)(R1) fixup FBI word 03D6C FE0E3D6E 2768 JMP THISCDN done with this word, next 2769 * --- 2770 00003D6D 2771 COREGW LABEL 03D6D F4221800 0 1 2772 XORM R0 WNDO4(WPP)(R1) fixup data segment word 2773 00003D6E 2774 THISCDN LABEL 03D6E FAA03D5E 2 2775 IRJ R2 NEXTWORD go on to do next word 2776 * \ / 2777 * The data is now corrected. Release the correction 2778 * block and unmap the page. 2779 * \ / 2780 03D6F 61D7D001 7 7 REG 2781 LD R7 R7+1 successful return 03D70 60C40085 3 IMM 2782 LD PFPTR PNWNDO4 page number of correction data page 03D71 80D2C000 3 REG 2783 PFRC PFPTR unmap the data block 03D72 DC40261B 2784 CALLNP MAPOUTFBI unmap FBI we corrected 2785 * \ / 2786 00003D73 2787 FREEBLK LABEL 03D73 60D78801 3 6 BASE 2788 LD R3 SP,BLOCKPTR address of temp storage 03D74 DC002F5D 2789 CALL SFREEMEM free the correction segment 03D75 41440007 IMM 2790 PARV (BFDSEGSIZE+1) LOG 2 size 03D76 4052C000 3 REG 2791 PARVL R3 address 2792 * \ / 2793 00003D77 2794 RETURN LABEL 03D77 5D1F8004 6 STAK 2795 LEAVE POP return to caller 2796 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 804 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2797 03D78 00130105 2798 BADSEGNUM HALT HALTS0105 segment number is bad (in R3) 2799 * --- 2800 2801 END FIXSEGMENT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 805 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2803 2804 ********************************************************************************** 2805 * * 2806 * FORMAT - Format One Track. * 2807 * * 2808 * This routine will perform a disk-format operation, * 2809 * retrying as necessary. It does not guarantee that the * 2810 * surface is usable, this should be done with writes and * 2811 * subsequent reads. * 2812 * * 2813 * LD MDV => MDV element * 2814 * CALLNP FORMAT * 2815 * * 2816 * * 2817 * * 2818 * Registers Used: R0:R3. Sets PPL. * 2819 * Stack Required: 10 * 2820 * 1 + max ( CALCSKADR (1), DISKSEEK (8), STATCHECK (9), * 2821 * TRACEPROC (3) ) * 2822 * * 2823 ********************************************************************************** 2824 2825 BLOCK FORMAT subroutine 2826 ENTRY FORMAT 2827 2828 BEGFRAME 2829 ENDFRAME 2830 03D79 DD5F8001 6 STAK 2831 FORMAT ENTRNP PUSH 03D7A 6002A000 0 IMM 2832 LD R0 (1*MDVNOERRSB)+(1*MDVNOLOGB) 03D7B E4174803 0 5 BASE 2833 ST R0 MDV,MDVERRWORD clear MDVERRFLDS, set flags 03D7C EC130000 4 REG 2834 STZ PPL this request does not deal with pages 03D7D DC003B66 2835 CALL CALCSKADR calculate seek address 03D7E 4056C801 3 BASE 2836 PARVL MSQ,MSQBLOCK pass disk address 2837 * \ / 2838 00003D7F 2839 RETRYSEEK LABEL 03D7F DC403C7B 2840 CALLNP DISKSEEK attempt to seek to cylinder 03D80 FE0E3D97 2841 JMP OFFLINE disk is now offline 03D81 FE0E3D96 2842 JMP FORMATXIT unable to seek, just return 2843 * \ / 2844 00003D82 2845 RETRYFMT LABEL 03D82 60040003 0 IMM 2846 LD R0 MDVSTONCYL new state: on cylinder 03D83 DCD7481B 5 BASE 2847 EXPCS MDV,MDVPC wait our turn 03D84 FA0C3D97 0 2848 JNEZ R0 OFFLINE jump if controller dead 2849 * \ / 03D85 6004F078 0 IMM 2850 LD R0 BFDFORMATW/BITS 0:15 construct the format word 03D86 60443C1E 1 IMM 2851 LD R1 BFDFORMATW/BITS 16:31 03D87 E40A4100 0 1 CBM 2852 ST R0 R1/BITS 0:15 that should do it 03D88 60095830 0 5 ZBM 2853 LD R0 MDV,MDVUNIT get unit number 03D89 E4601AE8 1 0 2854 ST R1 CIX(BFDFORMAT+1*BFDINTBIT+BFDSELECTB)(R0) start the format 2855 TRACE MSTRACE,MSTFORMAT format, R0=unit 03D8A 5D401D2C 2855 XCT TRACECALL(MSTRACE) 03D8B FEC0000F 2855 NOP (MSTRACE*BITS 22:26)+(MSTFORMAT*BITS 27:31) 2856 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 806 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03D8C 60040004 0 IMM 2857 LD R0 MDVSTDT new state: doing operation 03D8D DCD7481B 5 BASE 2858 EXPCS MDV,MDVPC wait for completion interrupt 03D8E FA0C3D97 0 2859 JNEZ R0 OFFLINE jump if controller dead 2860 * \ / 03D8F DC003FCA 2861 CALL STATCHECK check operation status 03D90 40440009 IMM 2862 PARVL OPFORMAT doing a format 03D91 FE0E3D97 2863 JMP OFFLINE drive is now offline 03D92 FE0E3D96 2864 JMP FORMATXIT jump if permanent error 03D93 FE0E3D7F 2865 JMP RETRYSEEK jump to retry seek 03D94 FE0E3D82 2866 JMP RETRYFMT jump to retry operation 03D95 FEC00000 2867 NOP 0 shouldn't get here 2868 * \ / 00003D96 2869 FORMATXIT LABEL 03D96 19C40001 7 IMM 2870 ADD R7 1 advance to good return 2871 * \ / 00003D97 2872 OFFLINE LABEL 03D97 EC094213 5 ZBM 2873 STZ MDV,MDVNOERRS restore normal error handling 03D98 EC094613 5 ZBM 2874 STZ MDV,MDVNOLOG restore normal error logging 03D99 5D1F8001 6 STAK 2875 LEAVE POP return to caller 2876 * --- 2877 2878 END FORMAT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 807 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 2880 2881 ********************************************************************************** 2882 * * 2883 * GETDISKID - Get ID of Drive and Pack. * 2884 * * 2885 * This routine will get the drive serial number, pack * 2886 * manufacturer and serial number, pack formatted date, and * 2887 * volume name. It will put an entry into the error log with * 2888 * this information. It will also fill in MDVSECPTRK, * 2889 * MDVTRKPCYL, MDVMAXSEEK, MDVFMTDAT, MDVBTRXDA and MDVVOLNAME. * 2890 * It returns a double word value that REMOUNT should * 2891 * match against VOLNMNTDAT. Normally, it is SECMNTDAT from * 2892 * the security block. If the sec blocks were not available, * 2893 * or the SECMNTDAT is 0, it is 0 and should be ignored (the * 2894 * MDVFMTDAT should be used instead). * 2895 * * 2896 * LD MDV => MDV element * 2897 * CALLNP GETDISKID * 2898 * JMP drive offline * 2899 * ST2 R3 * 2900 * * 2901 * Registers Used: R0:R4 * 2902 * Stack Required: 22 * 2903 * 8 + max ( CALCDRVADR (1), ERRORLOG (3), GETDRIVEID (7), * 2904 * INTREAD (14), PUTIDLE (1) ) * 2905 * * 2906 ********************************************************************************** 2907 2908 BLOCK GETDISKID subroutine 2909 ENTRY GETDISKID 2910 00000010 BYTE 2911 NODIDBIT EQU BIT 0 bit in R7 to indicate no drive ID board 00000210 BYTE 2912 SBIT EQU BIT 1 bit in R7 to say we tried 2nd security block 2913 2914 BEGFRAME 00178801 6 BASE 2915 DRIVEID BSS 3 disk drive id 00178804 6 BASE 2916 PACKMFG BSS 1 pack manufacturer 00178805 6 BASE 2917 PACKSN BSS 1 pack serial number 00178806 6 BASE 2918 TEMPSPOT BSS 2 storage 2919 ENDFRAME 2920 03D9A DD5F8008 6 STAK 2921 GETDISKID ENTRNP PUSH 03D9B EE178801 6 BASE 2922 STZ2 SP,DRIVEID clear drive serial number in case... 03D9C EC178803 6 BASE 2923 STZ SP,DRIVEID(2) ... the call to GETDRIVEID is skipped 03D9D EC178804 6 BASE 2924 STZ SP,PACKMFG clear pack manufacturer field 03D9E EC178805 6 BASE 2925 STZ SP,PACKSN clear pack serial number field 03D9F EE178806 6 BASE 2926 STZ2 SP,TEMPSPOT clear these, too 2927 * MDVFMTDAT and MDVBTRXPPL zeroed in initial element creation 2928 * \ / 03DA0 62003E00 01 2929 LD2 R0 DFLTVOLNM get default volume name 03DA1 E617480E 015 BASE 2930 ST2 R0 MDV,MDVVOLNAME save it 03DA2 D157400B 5 CACH 2931 STMW MDV,MDVSECPTRK get sectors per track 03DA3 D157400A 5 CACH 2932 STMW MDV,MDVTRKPCYL set tracks per cylinder 03DA4 D1574804 5 BASE 2933 STMW MDV,MDVMAXSEEK set max seek address 2934 * \ / 03DA5 DC003E63 2935 CALL INTREAD read a block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 808 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03DA6 41440000 IMM 2936 PARV PLDA disk address of the pack label 03DA7 40440001 IMM 2937 PARVL FBITPL expected FBI type 03DA8 FE0E3DF7 2938 JMP RETURN0 jump if offline 03DA9 FE0E3DF8 2939 JMP ERRPKLBL jump if data error 03DAA FE0E3DF8 2940 JMP ERRPKLBL jump if electronic error 2941 * \ / 03DAB 60C40085 3 IMM 2942 LD PFPTR PNWNDO4 page number of available page 03DAC 00D70803 4 BASE 2943 LDPF PPL,PPPMVALUE map page into WNDO4 03DAD 60001400 0 2944 LD R0 WNDO4/PLMAKER 03DAE E4178804 0 6 BASE 2945 ST R0 SP,PACKMFG save manufacturer name 03DAF 60001401 0 2946 LD R0 WNDO4/PLSERNO 03DB0 E4178805 0 6 BASE 2947 ST R0 SP,PACKSN save pack serial number 03DB1 62001407 01 2948 LD2 R0 WNDO4/PLINIDATE 03DB2 E6174810 015 BASE 2949 ST2 R0 MDV,MDVFMTDAT save formatted date 03DB3 60001410 0 2950 LD R0 WNDO4/PLSECPTRK get size of volume... 03DB4 E417400B 0 5 CACH 2951 ST R0 MDV,MDVSECPTRK ...sectors per track 03DB5 60001411 0 2952 LD R0 WNDO4/PLTRKPCYL 03DB6 E417400A 0 5 CACH 2953 ST R0 MDV,MDVTRKPCYL ...tracks per cylinder 03DB7 60001412 0 2954 LD R0 WNDO4/PLCYLPPCK 03DB8 60440000 1 IMM 2955 LD R1 0 initialize reg for hardware seek address 03DB9 E40A4100 0 1 CBM 2956 ST R0 R1/BFDSACYL 03DBA E4574804 1 5 BASE 2957 ST R1 MDV,MDVMAXSEEK ...and maximum seek address 03DBB 60041400 0 IMM 2958 LD R0 ADR WNDO4 get pointer to page 03DBC 60083014 0 0 ZBM 2959 LD R0 R0,PLFLAGS/PLNODRVID get bit indicating no head retract board 03DBD E40BC010 0 7 CBM 2960 ST R0 R7/NODIDBIT and stash in R7 03DBE 60001413 0 2961 LD R0 WNDO4/PLSIZE 03DBF E417481A 0 5 BASE 2962 ST R0 MDV,MDVSIZE ...size in blocks 03DC0 60001418 0 2963 LD R0 WNDO4/PLBDTRXDA get address of bad trax list 03DC1 E4174816 0 5 BASE 2964 ST R0 MDV,MDVBTRXDA 03DC2 80D2C000 3 REG 2965 PFRC PFPTR unmap the page 03DC3 DC402D51 2966 CALLNP PUTIDLE free the page 2967 * \ / 2968 2969 ********************************************************************************** 2970 * Here we check to see if this drive has a head retract * 2971 * board (drive ID board) that we should read. If so, as * 2972 * indicated by a bit in the pack label, we call GETDRIVEID to * 2973 * get its serial number. * 2974 ********************************************************************************** 2975 2976 * \ / 03DC4 F7C03DC9 7 2977 JBT R7/NODIDBIT NODIDBRD jump if no board present 03DC5 38178801 0 6 BASE 2978 LEA R0 SP,DRIVEID 03DC6 DC003E02 2979 CALL GETDRIVEID get drive serial number 03DC7 40160400 0 @R 2980 PARL @R0 where to put it 03DC8 FE0E3DF7 2981 JMP RETURN0 jump if drive went offline 2982 * \ / 2983 2984 ********************************************************************************** 2985 * Read volume label to get the volume name (among others, * 2986 * used for mount-by-volumename XREQ). Also, get security * 2987 * block addresses for our own use. * 2988 ********************************************************************************** 2989 2990 * \ / 00003DC9 2991 NODIDBRD LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 809 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03DC9 DC003E63 2992 CALL INTREAD read a block 03DCA 41440001 IMM 2993 PARV VOLLABELDA the volume label 03DCB 40440004 IMM 2994 PARVL FBITVL expected FBI type 03DCC FE0E3DF7 2995 JMP RETURN0 jump if offline 03DCD FE0E3DE8 2996 JMP DOLOG jump if data error 03DCE FE0E3DE8 2997 JMP DOLOG jump if data error 2998 * \ / 03DCF 60C40085 3 IMM 2999 LD PFPTR PNWNDO4 page number of available window 03DD0 00D70803 4 BASE 3000 LDPF PPL,PPPMVALUE map in the page 03DD1 62001404 01 3001 LD2 R0 WNDO4/VLVNAME get volume name 03DD2 E617480E 015 BASE 3002 ST2 R0 MDV,MDVVOLNAME save it 03DD3 60001410 0 3003 LD R0 WNDO4/VLSUBSDA address of substitution block 03DD4 E4174818 0 5 BASE 3004 ST R0 MDV,MDVSUBSDA save in the MDV element 03DD5 60001412 0 3005 LD R0 WNDO4/VLSECBDA address of primary security block 03DD6 60401413 1 3006 LD R1 WNDO4/VLSECB2DA address of secondary security block 03DD7 E6178806 016 BASE 3007 ST2 R0 SP,TEMPSPOT save on stack 03DD8 80D2C000 3 REG 3008 PFRC PFPTR unmap the page 03DD9 DC402D51 3009 CALLNP PUTIDLE release the page 3010 * \ / 3011 3012 * read the security block to get the last mount time stamp 03DDA 60D78806 3 6 BASE 3013 LD R3 SP,TEMPSPOT(0) primary security block address 03DDB EC0BC210 7 CBM 3014 STZ R7/SBIT say no retry yet 00003DDC 3015 TRYAGAIN LABEL 03DDC DC003E63 3016 CALL INTREAD try to read it 03DDD 4152C000 3 REG 3017 PARV R3 DA 03DDE 40440006 IMM 3018 PARVL FBITSEC FBI type 03DDF FE0E3DF7 3019 JMP RETURN0 offline 03DE0 FE0E3DFB 3020 JMP TRYOTHER data error 03DE1 FE0E3DFB 3021 JMP TRYOTHER electronic error 3022 * \ / 3023 03DE2 60C40085 3 IMM 3024 LD PFPTR PNWNDO4 page number of available window 03DE3 00D70803 4 BASE 3025 LDPF PPL,PPPMVALUE map in the page 03DE4 62001402 01 3026 LD2 R0 WNDO4/SECMNTDAT get last mount date 03DE5 E6178806 016 BASE 3027 ST2 R0 SP,TEMPSPOT save it on the stack 03DE6 80D2C000 3 REG 3028 PFRC PFPTR unmap the page 03DE7 DC402D51 3029 CALLNP PUTIDLE release the page 3030 * \ / 3031 3032 * log the spin up 00003DE8 3033 DOLOG LABEL 03DE8 61138000 4 6 REG 3034 LD R4 SP base reg for local vars 03DE9 DC005048 3035 CALL ERRORLOG log an event 03DEA 41442830 IMM 3036 PARV ERLCDSKID disk is spinning 03DEB 41574805 5 BASE 3037 PARV MDV,MDVNAME 03DEC 41570801 4 BASE 3038 PARV R4,DRIVEID(0) disk drive 03DED 41570802 4 BASE 3039 PARV R4,DRIVEID(1) serial 03DEE 41570803 4 BASE 3040 PARV R4,DRIVEID(2) number 03DEF 41570804 4 BASE 3041 PARV R4,PACKMFG pack manufacturer 03DF0 41570805 4 BASE 3042 PARV R4,PACKSN pack serial number 03DF1 41574810 5 BASE 3043 PARV MDV,MDVFMTDAT(0) pack formatted 03DF2 41574811 5 BASE 3044 PARV MDV,MDVFMTDAT(1) date 03DF3 4157480E 5 BASE 3045 PARV MDV,MDVVOLNAME(0) volume 03DF4 4057480F 5 BASE 3046 PARVL MDV,MDVVOLNAME(1) name 3047 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 810 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03DF5 61D7D001 7 7 REG 3048 LD R7 R7+1 good return 3049 * \ / 3050 03DF6 62D78806 346 BASE 3051 LD2 R3 SP,TEMPSPOT retrieve remount ID 00003DF7 3052 RETURN0 LABEL 03DF7 5D1F8008 6 STAK 3053 LEAVE POP 3054 * --- 3055 3056 ********************************************************************************** 3057 * * 3058 * The pack label is unreadable at this point, hopefully * 3059 * a format operation is to be performed on this pack. In an * 3060 * attempt to generate some kind of format date (to identify * 3061 * the pack) we use the cable position. * 3062 * * 3063 ********************************************************************************** 3064 00003DF8 3065 ERRPKLBL LABEL 03DF8 DC403B5D 3066 CALLNP CALCDRVADR calculate drive's address 03DF9 E4174811 0 5 BASE 3067 ST R0 MDV,MDVFMTDAT(1) and set into MDV element 03DFA FE0E3DE8 3068 JMP DOLOG log this event 3069 * --- 3070 3071 ********************************************************************************** 3072 * * 3073 * A security block won't read. Try the second if we haven't already. * 3074 * * 3075 ********************************************************************************** 3076 00003DFB 3077 TRYOTHER LABEL 03DFB 60D78807 3 6 BASE 3078 LD R3 SP,TEMPSPOT(1) secondary security block address 03DFC D1CBC210 7 CBM 3079 SETT R7/SBIT test, set flag 03DFD FE0C3DDC 3080 JNE TRYAGAIN jump if still alive 3081 * \ / 3082 03DFE EE178806 6 BASE 3083 STZ2 SP,TEMPSPOT say no date available 03DFF FE0E3DE8 3084 JMP DOLOG join exit chorus 3085 * --- 3086 03E00 E6A76B44 3087 DFLTVOLNM PAK12 !UNLABELLED! name of volume with unreadable vol label 3088 3089 END GETDISKID subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 811 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3091 3092 ********************************************************************************** 3093 * * 3094 * GETDRIVEID - Get Disk Drive Serial Number. * 3095 * * 3096 * This routine will fetch the serial number (and other * 3097 * identifying information from a drive). This depends on a * 3098 * special BTI - installed board in the disk drive, that works * 3099 * as follows: * 3100 * If one seeks to cylinder and head BFDMAGICHD, then * 3101 * the kludge board takes over control of the write-protect * 3102 * status line, and instead of it reflecting the setting of * 3103 * the write protect switch, it is the value of bit in a * 3104 * 1K prom on the kludge board. The drive id is in bits 0..95 * 3105 * of this prom. Note that it is not necessary for a seek to * 3106 * complete before looking at the status. * 3107 * Note also that some drives believe that this write * 3108 * protect status is real and furthermore, they 'de-bounce' * 3109 * the signal by leaving the drive write protected for a * 3110 * period of time (800 ms) following the release of the write * 3111 * protect line. we therefore we call for the driver to idle * 3112 * for that length of time after we read the board. * 3113 * * 3114 * LD MDV => MDV element * 3115 * CALL GETDRIVEID * 3116 * PARL 3-word area to put ID into * 3117 * JMP drive quit responding * 3118 * * 3119 * Eats R0:R4 * 3120 * Stack required: 7 * 3121 * 2 + max ( CLEARFAULT (2), IDLEDRIVE (5), SEEKNDWAIT (1), * 3122 * TRACEPROC (3) ) * 3123 * * 3124 ********************************************************************************** 3125 3126 BLOCK GETDRIVEID subroutine 3127 ENTRY GETDRIVEID 3128 3129 BEGFRAME 00178801 6 BASE 3130 RESULTPTR BSS 1 ZBM pointer to first bit of result 3131 ENDFRAME 3132 03E02 DD1F8002 6 STAK 3133 GETDRIVEID ENTR PUSH 03E03 38080010 0 0 ZBM 3134 LEA R0 R0,0/BIT 0 convert to 1-bit ZBM address 03E04 C0178801 6 BASE 3135 STPL SP,RESULTPTR save pointer to first bit of result 03E05 60095830 0 5 ZBM 3136 LD R0 MDV,MDVUNIT R0 = our unit number 3137 TRACE MSTRACE,MSTGETID get drive id, R0 = unit 03E06 5D401D2C 3137 XCT TRACECALL(MSTRACE) 03E07 FEC0000D 3137 NOP (MSTRACE*BITS 22:26)+(MSTGETID*BITS 27:31) 3138 * \ / 03E08 6084FF00 2 IMM 3139 LD R2 BFDMAGICHD*BFDSAHEAD prototype seek address 03E09 6044005F 1 IMM 3140 LD R1 3*WORDLNTH-1 index in prom 3141 * \ / 00003E0A 3142 LOOP LABEL 03E0A E44A8100 1 2 CBM 3143 ST R1 R2/BFDSACYL get cylinder number 03E0B E4A01A18 2 0 3144 ST R2 CIX(BFDSEEK+BFDSELECTB+R0) do the seek command 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 812 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03E0C 60C01A20 3 3145 LD R3 CIX(BFDSS) get status 03E0D F6EE3E17 3 3146 JBT R3/BFDSSRSPER RETURN0 jump if not there 03E0E 60CAC610 3 3 CBM 3147 LD R3 R3/BFDSSWPROT isolate data bit 03E0F E4DD8C01 3 61 FPVR 3148 ST R3 @(SP,RESULTPTR)(R1) save a data bit 03E10 FA663E0A 1 3149 JDR R1 LOOP get all bits 03E11 DC403FBE 3150 CALLNP SEEKNDWAIT wait for possible seek and 03E12 FA0C3E17 0 3151 JNEZ R0 RETURN0 jump if controller is dead 03E13 DC403C0E 3152 CALLNP CLEARFAULT clear any fault 03E14 FE0E3E17 3153 JMP RETURN0 jump if drive offline 03E15 DC403E43 3154 CALLNP IDLEDRIVE delay a moment 03E16 61D7D001 7 7 REG 3155 LD R7 R7+1 good return 3156 * \ / 00003E17 3157 RETURN0 LABEL 03E17 5D1F8002 6 STAK 3158 LEAVE POP 3159 * --- 3160 3161 END GETDRIVEID subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 813 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3163 3164 ********************************************************************************** 3165 * * 3166 * GETZEROPG - Get a Fresh Zero Page. * 3167 * * 3168 * This routine will get an idle page, zero it, and * 3169 * convert it into a page for a specified block. On return, * 3170 * the PPL is not on any list, but has a busy count of 1. * 3171 * * 3172 * CALL GETZEROPG * 3173 * PARVL block number * 3174 * * 3175 * * 3176 * * 3177 * Eats R0:R2. Sets PPL. * 3178 * Stack required: 5 * 3179 * 2 + max ( GETIDLE (1), ZEROPAGE (3) ) * 3180 * * 3181 ********************************************************************************** 3182 3183 BLOCK GETZEROPG subroutine 3184 ENTRY GETZEROPG 3185 3186 BEGFRAME 00178801 6 BASE 3187 TEMP BSS 1 place to stuff the block number 3188 ENDFRAME 3189 03E18 DD1F8002 6 STAK 3190 GETZEROPG ENTR PUSH 03E19 C0578801 6 BASE 3191 STPVL SP,TEMP TEMP = block number 3192 * \ / 03E1A DC402D1C 3193 CALLNP GETIDLE get an idle page 03E1B FE0E3E23 3194 JMP RETURN jump if none available 03E1C EDC91F12 4 ZBM 3195 STW PPL,PPBUSYWORD/FLDADRS make it busy once 03E1D EDC90012 4 ZBM 3196 STW PPL,PPMODIFIED make it modified 03E1E E0D78801 3 6 BASE 3197 EXCH R3 SP,TEMP TEMP = R3, R3 = block number 03E1F E4D70801 3 4 BASE 3198 ST R3 PPL,PPBLOCK set block number in PPL 03E20 DC404120 3199 CALLNP ZEROPAGE zero out the page 03E21 60D78801 3 6 BASE 3200 LD R3 SP,TEMP restore R3 03E22 61D7D001 7 7 REG 3201 LD R7 R7+1 successful return 3202 * \ / 3203 00003E23 3204 RETURN LABEL 03E23 5D1F8002 6 STAK 3205 LEAVE POP 3206 * --- 3207 3208 END GETZEROPG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 814 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3210 3211 ********************************************************************************** 3212 * * 3213 * HEADCHKINT - Head-check Timer Interrupt Routine. * 3214 * * 3215 * This routine is called by the timer handler when it is * 3216 * time to run the head-crash checker. Since we are run * 3217 * asynchronously from the rest of the disk driver, we just * 3218 * set a flag and let DRIVEPROC call the head-crash checker * 3219 * next time through its main loop. * 3220 * * 3221 * MCTELOCK not held by us! * 3222 * Controller may be busy. * 3223 * LD R3 => MDV element (may no longer exist) * 3224 * CALLNP HEADCHECKINT * 3225 * * 3226 * Eats R0:R5. * 3227 * Stack required: 2 * 3228 * 1 + max ( SRCHLIST (1), UNSRCHLIST (1) ) * 3229 * * 3230 ********************************************************************************** 3231 3232 BLOCK HEADCHKINT subroutine 3233 ENTRY HEADCHKINT 3234 3235 BEGFRAME 3236 ENDFRAME 3237 03E24 DD5F8001 6 STAK 3238 HEADCHKINT ENTRNP PUSH 03E25 6152C000 5 3 REG 3239 LD MDV R3 MDV -> our MDV element 03E26 DC0030AA 3240 CALL SRCHLIST lock the MDV list 03E27 40001F14 3241 PARL MDVLOCK 03E28 60041F15 0 IMM 3242 LD R0 ADR MDVLIST R0 -> first MDV 03E29 3D481F10 5 0 ZBM 3243 LSRCH MDV R0,MDVLINK see if we are on the list 03E2A FE0C3E30 3244 JNE NOTHERE jump if not 3245 SETTBIT MDV,MDVCHKHEAD else request a head-check 03E2B 60020020 0 IMM 3245 LD R0 1*BIT(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 0:4) 03E2C FC174800 0 5 BASE 3245 IORM R0 MDV,(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 15:31) 03E2D EC174812 5 BASE 3246 STZ MDV,MDVTIMESER and say interval not outstanding 03E2E 60040001 0 IMM 3247 LD R0 1*BIT FLMSPROC 03E2F FC001CF6 0 3248 IORM R0 FLAGS 3249 * \ / 3250 00003E30 3251 NOTHERE LABEL 03E30 DC0030B7 3252 CALL UNSRCHLIST release the MDV list 03E31 40001F14 3253 PARL MDVLOCK 03E32 5D1F8001 6 STAK 3254 LEAVE POP and all done 3255 * --- 3256 3257 END HEADCHKINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 815 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3259 3260 ********************************************************************************** 3261 * * 3262 * HEADCHKSET - Set Head-check Timer Interrupt. * 3263 * * 3264 * This routine will set a timer interrupt for the next * 3265 * time to run the head-crash checker. * 3266 * * 3267 * LD MDV => MDV element * 3268 * CALLNP HEADCHKSET * 3269 * * 3270 * Eats R0:R4. * 3271 * Stack required: 6 * 3272 * 4 + max ( TIMESET (2) ) * 3273 * * 3274 ********************************************************************************** 3275 3276 BLOCK HEADCHKSET subroutine 3277 ENTRY HEADCHKSET 3278 3279 BEGFRAME 00178801 6 BASE 3280 SAVEPF BSS 1 00178802 6 BASE 3281 SAVEOTHERS BSS 2 3282 ENDFRAME 3283 03E33 DD5F8004 6 STAK 3284 HEADCHKSET ENTRNP PUSH 03E34 E6D78802 346 BASE 3285 ST2 R3 SP,SAVEOTHERS save regs 03E35 60C40086 3 IMM 3286 LD PFPTR PNCIX page number of I/O window 03E36 80D78801 6 BASE 3287 PFRC SP,SAVEPF exclude it 03E37 60C03964 3 3288 LD R3 HDCHKINT interval in seconds 03E38 1CC403E8 3 IMM 3289 MUL R3 MSECSS make it milliseconds 03E39 DC0044F8 3290 CALL TIMESET request an interval 03E3A 4352C000 3 REG 3291 PARV2 R3 interval 03E3B 41440000 IMM 3292 PARV 0 CPU (any) 03E3C 41003E24 3293 PAR HEADCHKINT subroutine to call 03E3D 40534000 5 REG 3294 PARVL MDV parameter 03E3E E5174812 4 5 BASE 3295 ST TMR MDV,MDVTIMESER save serial number of request 03E3F 60C40086 3 IMM 3296 LD PFPTR PNCIX page number of CIX window 03E40 00D78801 6 BASE 3297 LDPF SP,SAVEPF restore the page file 03E41 62D78802 346 BASE 3298 LD2 R3 SP,SAVEOTHERS restore regs 03E42 5D1F8004 6 STAK 3299 LEAVE POP all done 3300 * --- 3301 3302 END HEADCHKSET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 816 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3304 3305 ********************************************************************************** 3306 * * 3307 * IDLEDRIVE - Delay for a Period of Time. * 3308 * * 3309 * This routine forestalls execution of the caller's drive * 3310 * coroutine for a set period of time. It sets up a timer * 3311 * interrupt and returns to the main coroutine in an * 3312 * inactivatible state. The timer routine should change the * 3313 * MDVSTATE to MDVSTRUN, and we'll be reentered right after * 3314 * the EXPCS. * 3315 * We assume that we can leave ourselves in the runnable * 3316 * state, since our next return the main coroutine sets up a * 3317 * new state, anyway. * 3318 * * 3319 * LD MDV => MDV element * 3320 * CALLNP IDLEDRIVE * 3321 * * 3322 * Eats R0:R3. * 3323 * Stack required: 5 * 3324 * 3 + max ( TIMESET (2) ) * 3325 * * 3326 ********************************************************************************** 3327 3328 BLOCK IDLEDRIVE subroutine 3329 ENTRY IDLEDRIVE 3330 3331 BEGFRAME 00178801 6 BASE 3332 SAVEAREG BSS 1 00178802 6 BASE 3333 SAVEPF BSS 1 3334 ENDFRAME 3335 03E43 DD5F8003 6 STAK 3336 IDLEDRIVE ENTRNP PUSH 03E44 E5178801 4 6 BASE 3337 ST R4 SP,SAVEAREG guard this register 03E45 60C40086 3 IMM 3338 LD PFPTR PNCIX save this window's mapping 03E46 80D78802 6 BASE 3339 PFRC SP,SAVEPF on the stack 03E47 60C0396A 3 3340 LD R3 IDLEPERIOD interval in milliseconds 03E48 DC0044F8 3341 CALL TIMESET request an interval 03E49 4352C000 3 REG 3342 PARV2 R3 interval 03E4A 41440000 IMM 3343 PARV 0 CPU (any) 03E4B 41003E54 3344 PAR IDLEINT subroutine to call 03E4C 40534000 5 REG 3345 PARVL MDV parameter 03E4D E5174813 4 5 BASE 3346 ST TMR MDV,MDVIDLESER save serial number of request 03E4E 60C40086 3 IMM 3347 LD PFPTR PNCIX page number of CIX window 03E4F 00D78802 6 BASE 3348 LDPF SP,SAVEPF restore the page file 03E50 61178801 4 6 BASE 3349 LD R4 SP,SAVEAREG restore this register 3350 * \ / 3351 03E51 60040007 0 IMM 3352 LD R0 MDVSTIDLE new state - idling 03E52 DCD7481B 5 BASE 3353 EXPCS MDV,MDVPC return to main coroutine 3354 03E53 5D1F8003 6 STAK 3355 LEAVE POP all done 3356 * --- 3357 3358 END IDLEDRIVE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 817 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3360 3361 ********************************************************************************** 3362 * * 3363 * IDLEINT - Idle Drive Timer Interrupt Routine. * 3364 * * 3365 * This routine is called by the timer handler when it is * 3366 * time to reactivate the driver coroutine. We change the * 3367 * MDVSTATE to allow DRIVEPROC to run the drive the next time * 3368 * through its main loop. We also alter the FLAGS word to * 3369 * ensure service. * 3370 * * 3371 * MCTELOCK not held by us! * 3372 * Controller may be busy. * 3373 * LD R3 => MDV element (may no longer exist) * 3374 * CALLNP IDLEINT * 3375 * * 3376 * Eats R0:R5. * 3377 * Stack required: 2 * 3378 * 1 + max ( SRCHLIST (1), UNSRCHLIST (1) ) * 3379 * * 3380 ********************************************************************************** 3381 3382 BLOCK IDLEINT subroutine 3383 ENTRY IDLEINT 3384 3385 BEGFRAME 3386 ENDFRAME 3387 03E54 DD5F8001 6 STAK 3388 IDLEINT ENTRNP PUSH 03E55 6152C000 5 3 REG 3389 LD MDV R3 MDV -> our MDV element 03E56 DC0030AA 3390 CALL SRCHLIST lock the MDV list 03E57 40001F14 3391 PARL MDVLOCK 03E58 60041F15 0 IMM 3392 LD R0 ADR MDVLIST R0 -> first MDV 03E59 3D481F10 5 0 ZBM 3393 LSRCH MDV R0,MDVLINK see if we are on the list 03E5A FE0C3E60 3394 JNE NOTHERE jump if not 03E5B 60040001 0 IMM 3395 LD R0 MDVSTRUN new state - runnable 03E5C E4094231 0 5 ZBM 3396 ST R0 MDV,MDVSTATE give it to him 03E5D EC174813 5 BASE 3397 STZ MDV,MDVIDLESER and say interval not outstanding 03E5E 60040001 0 IMM 3398 LD R0 1*BIT FLMSPROC 03E5F FC001CF6 0 3399 IORM R0 FLAGS 3400 * \ / 3401 00003E60 3402 NOTHERE LABEL 03E60 DC0030B7 3403 CALL UNSRCHLIST release the MDV list 03E61 40001F14 3404 PARL MDVLOCK 03E62 5D1F8001 6 STAK 3405 LEAVE POP and all done 3406 * --- 3407 3408 END IDLEINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 818 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3410 3411 ********************************************************************************** 3412 * * 3413 * INTREAD - Internal Read Subroutine. * 3414 * * 3415 * This routine will read a block and check the FBI. It * 3416 * gives returns for the different error conditions. A page of * 3417 * memory remains allocated for the read only if the read was * 3418 * successful. The PPL is not on any lists. PPBLOCK = 0 so * 3419 * the page looks 'clean'. These two measures have the effect * 3420 * of making the PPL invisible to the page fault processor and * 3421 * others, so the disk block might be or become resident * 3422 * elsewhere as well. Therefore, the data on the page is * 3423 * current as of the time of the read, but not necessarily * 3424 * later, and the page should never be written out. * 3425 * * 3426 * LD MDV => MDV element * 3427 * CALL INTREAD * 3428 * PARV block number * 3429 * PARVL expected FBI type * 3430 * JMP drive offline * 3431 * JMP disk data (or FBI) error * 3432 * JMP electronic error * 3433 * page for data> * 3434 * * 3435 * Eats R2 during parameter passing * 3436 * Eats R0:R4. Sets PPL. * 3437 * Stack required: 14 * 3438 * 1 + max ( MAPINFBI (2), MAPOUTFBI (2), PUTIDLE (1), * 3439 * READ (13) ) * 3440 * * 3441 ********************************************************************************** 3442 3443 BLOCK INTREAD subroutine 3444 ENTRY INTREAD 3445 3446 BEGFRAME 3447 ENDFRAME 3448 00000080 BYTE 3449 FBIT EQU BITS 0:7 expected FBI type (in R7) 3450 03E63 DD1F8001 6 STAK 3451 INTREAD ENTR PUSH 03E64 C152C000 3 REG 3452 STPV R3 block number 03E65 C04BC080 7 CBM 3453 STPVL R7/FBIT expected FBI type 3454 * \ / 00003E66 3455 AGAIN LABEL 03E66 DC003EBE 3456 CALL READ read the block 03E67 4052C000 3 REG 3457 PARVL R3 block number 03E68 FE0E3E79 3458 JMP OFFLINE jump if offline 03E69 FE0E3E76 3459 JMP NOPAGE jump if no idle paper available 03E6A EC170801 4 BASE 3460 STZ PPL,PPBLOCK clear block number field 03E6B 5C090212 4 ZBM 3461 CMZ PPL,PPDISKERR did an error occur? 03E6C FE0C3E74 3462 JNE DISKERR jump if so 03E6D DC002606 3463 CALL MAPINFBI map in FBI for PPL, IOFF 03E6E 40530000 4 REG 3464 PARVL PPL pass physical page element 03E6F 600BC080 0 7 CBM 3465 LD R0 R7/FBIT get expected type 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 819 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03E70 FA023E7D 0 3466 JEQZ R0 GOODRET jump if any block type OK 03E71 64084080 0 1 ZBM 3467 CPR R0 R1,FBITYPE do types match? 03E72 FE023E7D 3468 JEQ GOODRET jump if type OK 03E73 DC40261B 3469 CALLNP MAPOUTFBI unmap FBI for PPL, ION 3470 * \ / 3471 00003E74 3472 DISKERR LABEL 03E74 DC402D51 3473 CALLNP PUTIDLE release the page 03E75 FE0E3E80 3474 JMP DATARET take data error return 3475 * --- 3476 00003E76 3477 NOPAGE LABEL 03E76 60040001 0 IMM 3478 LD R0 MDVSTRUN new state: runnable (next time) 03E77 DCD7481B 5 BASE 3479 EXPCS MDV,MDVPC go back to controller-scheduler 03E78 FE0E3E66 3480 JMP AGAIN try again later 3481 * --- 3482 00003E79 3483 OFFLINE LABEL 03E79 60174809 0 5 BASE 3484 LD R0 MDV,MDVBFDSTAT get last status 03E7A F62E3E81 0 3485 JBT R0/BFDSSRSPER OFFLRET jump if drive disappeared 03E7B F2083E81 0 3486 JBF R0/BFDSSRDY OFFLRET jump if drive offline 03E7C FE0E3E7F 3487 JMP CHANRET else assume channel error 3488 * --- 3489 00003E7D 3490 GOODRET LABEL data successfully read 03E7D DC40261B 3491 CALLNP MAPOUTFBI unmap FBI for PPL, ION 03E7E 61D7D001 7 7 REG 3492 LD R7 R7+1 3493 * \ / 3494 00003E7F 3495 CHANRET LABEL channel (electronic) error 03E7F 61D7D001 7 7 REG 3496 LD R7 R7+1 3497 * \ / 3498 00003E80 3499 DATARET LABEL disk data error 03E80 61D7D001 7 7 REG 3500 LD R7 R7+1 3501 * \ / 3502 00003E81 3503 OFFLRET LABEL drive offline error 03E81 5D1F8001 6 STAK 3504 LEAVE POP 3505 * --- 3506 3507 END INTREAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 820 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3509 3510 ********************************************************************************** 3511 * * 3512 * LOGCOUNT - Log Activity on Drive. * 3513 * * 3514 * This routine will write an error log record containing * 3515 * the number of reads and writes that have been done to the * 3516 * drive. It will then clean out the counters. This is done * 3517 * once per hour, and whenever a volume is dismounted. * 3518 * * 3519 * LD MDV => MDV element * 3520 * CALLNP LOGCOUNT * 3521 * * 3522 * Eats R0:R3. * 3523 * Stack required: 4 * 3524 * 1 + max ( ERRORLOG (3) ) * 3525 * * 3526 ********************************************************************************** 3527 3528 BLOCK LOGCOUNT subroutine 3529 ENTRY LOGCOUNT 3530 3531 BEGFRAME 3532 ENDFRAME 3533 03E82 DD5F8001 6 STAK 3534 LOGCOUNT ENTRNP PUSH 03E83 5E174806 5 BASE 3535 CMZ2 MDV,MDVCOUNTS any activity? 03E84 FE023E8C 3536 JEQ RETURN jump if not 3537 * \ / 03E85 DC005048 3538 CALL ERRORLOG log the activity 03E86 41441021 IMM 3539 PARV ERLCDCNT disk count 03E87 41574805 5 BASE 3540 PARV MDV,MDVNAME drive name 03E88 41495231 5 ZBM 3541 PARV MDV,MDVCABLE cable position 03E89 41574806 5 BASE 3542 PARV MDV,MDVREADCNT read count 03E8A 40574807 5 BASE 3543 PARVL MDV,MDVWRITCNT write count 03E8B EE174806 5 BASE 3544 STZ2 MDV,MDVCOUNTS 3545 * \ / 3546 00003E8C 3547 RETURN LABEL 03E8C 5D1F8001 6 STAK 3548 LEAVE POP 3549 * --- 3550 3551 END LOGCOUNT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 821 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3553 3554 ********************************************************************************** 3555 * * 3556 * LOOKUPBTRX - Look Up Block in Bad Tracks List. * 3557 * * 3558 * This subroutine determines whether a given block * 3559 * number is on the bad blocks list. It assumes that * 3560 * MDVBTRXPPL contains a pointer to the PPL of a page * 3561 * containing the bad tracks block. If the block is a * 3562 * substitute then ignore those as well since they will * 3563 * cause a DA mismatch. Note that if a volume is loaded * 3564 * we search the resident substitution list, ohterwise * 3565 * the substitution block is mapped in. * 3566 * * 3567 * LD MDV => MDV element * 3568 * CALL LOOKUPBTRX * 3569 * PARVL block number * 3570 * JMP block is on the list * 3571 * * 3572 * * 3573 * Eats R0:R1, R3. Unmaps WNDO4. * 3574 * Stack required: 1 * 3575 * * 3576 ********************************************************************************** 3577 3578 BLOCK LOOKUPBTRX subroutine 3579 ENTRY LOOKUPBTRX 3580 3581 BEGFRAME 3582 ENDFRAME 3583 03E8D DD1F8001 6 STAK 3584 LOOKUPBTRX ENTR PUSH 03E8E C0524000 1 REG 3585 STPVL R1 R1 = block number 3586 * \ / 03E8F 7840254F 1 3587 AND R1 MSBLKMASK clear upper bits 03E90 60C40085 3 IMM 3588 LD PFPTR PNWNDO4 page number of available window 03E91 60174817 0 5 BASE 3589 LD R0 MDV,MDVBTRXPPL R0 -> PPL of bad tracks block, if any 03E92 FA303E9C 0 3590 JZA R0 NOBTRXLIST jump if no bad tracks block 03E93 00D60803 0 BASE 3591 LDPF R0,PPPMVALUE map in the bad tracks block 03E94 60041400 0 IMM 3592 LD R0 ADR WNDO4 R0 -> first entry 3593 * \ / 00003E95 3594 BTRXLOOP LABEL 03E95 5C160800 0 BASE 3595 CMZ R0,BTRXEL end of block? 03E96 FE023E9C 3596 JEQ NOBTRXLIST jump if yes 03E97 64481180 1 0 ZBM 3597 CPR R1 R0,BTRXEL/MSBLKFIELD is this entry for us? 03E98 FE023EA8 3598 JEQ FOUND jump if yes 03E99 38160802 0 0 BASE 3599 LEA R0 R0,BTRXLNTH R0 -> next entry 03E9A 640417FE 0 IMM 3600 CPR R0 ADR WNDO4(WPP-BTRXLNTH) end of block? 03E9B FE0A3E95 3601 JLE BTRXLOOP loop if not 3602 * \ / 00003E9C 3603 NOBTRXLIST LABEL 03E9C 60174819 0 5 BASE 3604 LD R0 MDV,MDVSUBSPPL R0 - > PPL of substitution block 03E9D FA303EA7 0 3605 JZA R0 NOTFOUND jump if no substitution block 03E9E 00D60803 0 BASE 3606 LDPF R0,PPPMVALUE map in substitution block 03E9F 60041400 0 IMM 3607 LD R0 ADR WNDO4 R0 -> first entry 3608 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 822 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 00003EA0 3609 SUBSLOOP LABEL 03EA0 5C160800 0 BASE 3610 CMZ R0,SUBSBADDY end of block? 03EA1 FE023EA7 3611 JEQ NOTFOUND jump if yes 03EA2 64481181 1 0 ZBM 3612 CPR R1 R0,SUBSSUB/MSBLKFIELD is this entry for us? 03EA3 FE023EA8 3613 JEQ FOUND jump if yes 03EA4 38160802 0 0 BASE 3614 LEA R0 R0,SUBSLNTH R0 -> next entry 03EA5 640417FE 0 IMM 3615 CPR R0 ADR WNDO4(WPP-SUBSLNTH) end of block? 03EA6 FE0A3EA0 3616 JLE SUBSLOOP loop if not 3617 * \ / 00003EA7 3618 NOTFOUND LABEL 03EA7 61D7D001 7 7 REG 3619 LD R7 R7+1 advance to good return 00003EA8 3620 FOUND LABEL 03EA8 80D2C000 3 REG 3621 PFRC PFPTR unmap WNDO4 03EA9 5D1F8001 6 STAK 3622 LEAVE POP 3623 * --- 3624 3625 END LOOKUPBTRX subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 823 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3627 3628 ********************************************************************************** 3629 * * 3630 * PADBUILD - Set Up Physical Addresses for Data * 3631 * Transfer. * 3632 * * 3633 * This routine will store the data transfer addresses * 3634 * and byte counts into the PPU for a disk transfer. Before * 3635 * calling this routine, the DMA direction had better be set * 3636 * correctly (or the PPU will cause a bus error). * 3637 * * 3638 * LD PPL => PPL for page * 3639 * CALLNP PADBUILD * 3640 * * 3641 * Eats R0:R1, PFPTR * 3642 * Stack required: 3 * 3643 * 1 + max ( MAPINFBI (2), MAPOUTFBI (2) ) * 3644 * * 3645 ********************************************************************************** 3646 3647 BLOCK PADBUILD subroutine 3648 ENTRY PADBUILD 3649 3650 BEGFRAME 3651 ENDFRAME 3652 03EAA DD5F8001 6 STAK 3653 PADBUILD ENTRNP PUSH 03EAB DC002606 3654 CALL MAPINFBI get virtual address of the FBI 03EAC 40530000 4 REG 3655 PARVL PPL pass the PPL address 03EAD 60CA5C80 3 1 CBM 3656 LD PFPTR R1/PAGEFIELD extract the virtual page number 03EAE 7CC40080 3 IMM 3657 IOR PFPTR MONPF make it monitor space 03EAF 80920000 0 REG 3658 PFRD R0 get the page map value 03EB0 E40A54C0 0 1 CBM 3659 ST R0 R1/FLDABSPG combine page with displacement 03EB1 E44A1560 1 0 CBM 3660 ST R1 R0/PAGEANDISP add page and displacement to slot number 03EB2 E4001807 0 3661 ST R0 CIX(PPUADDR2) store memory address for FBI 03EB3 DC40261B 3662 CALLNP MAPOUTFBI unmap the FBI window 03EB4 6004802C 0 IMM 3663 LD R0 FBILNTH*CPW+PPUCLAST*1 indicate size of FBI, also indicate end 03EB5 E4001806 0 3664 ST R0 CIX(PPUCNT2) set into PPU 3665 * \ / 03EB6 60170803 0 4 BASE 3666 LD R0 PPL,PPPMVALUE get the page location 03EB7 60440000 1 IMM 3667 LD R1 0 page displacement (beginning of page) 03EB8 E40A54C0 0 1 CBM 3668 ST R0 R1/FLDABSPG build the relative address 03EB9 E44A1560 1 0 CBM 3669 ST R1 R0/PAGEANDISP combine with slot number 03EBA E4001805 0 3670 ST R0 CIX(PPUADDR1) store mem address for data block 03EBB 60041000 0 IMM 3671 LD R0 CPP get the size of one page 03EBC E4001804 0 3672 ST R0 CIX(PPUCNT1) store data block byte count 03EBD 5D1F8001 6 STAK 3673 LEAVE POP 3674 * --- 3675 3676 END PADBUILD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 824 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3678 3679 ********************************************************************************** 3680 * * 3681 * READ - Read a Block, with Full Error Recovery * 3682 * * 3683 * This routine will read a block from the disk, with full * 3684 * error recovery, including re-writing a marginally written * 3685 * block, and substituting a block from a bad piece of the disk. * 3686 * It will allocate a page of memory for the data. * 3687 * If the block contains a permanent I/O error, it will * 3688 * return its best approximation of the data, if possible. If * 3689 * no data can be gotten off the disk, it will return a zero * 3690 * page. In either case, the PPDISKERR bit will be set. * 3691 * * 3692 * LD MDV => MDV element * 3693 * CALL READ * 3694 * PARVL block number * 3695 * * 3696 * * 3697 * page of data> * 3698 * * 3699 * Registers Used: R0:R2. Sets PPL. * 3700 * Stack Required: 13 * 3701 * 2 + max ( CALCSKADR (1), DISKSEEK (8), DOREWRITE (11), * 3702 * ERRORLOG (3), FBICHKCKSM (6), FIXSEGMENT (7), * 3703 * GETIDLE (1), MAPINFBI (2), MAPOUTFBI (2), * 3704 * PADBUILD (3), PUTIDLE (1) STATCHECK (9), * 3705 * SUBSTITUTE (7), TRACEPROC (3), TSELECT (6), * 3706 * ZEROPAGE (3) ) * 3707 * * 3708 ********************************************************************************** 3709 3710 BLOCK READ subroutine 3711 ENTRY READ 3712 3713 BEGFRAME 00178801 6 BASE 3714 TEMP BSS 1 block num and save for R3 3715 ENDFRAME 3716 03EBE DD1F8002 6 STAK 3717 READ ENTR PUSH 03EBF C0578801 6 BASE 3718 STPVL SP,TEMP TEMP = block number 03EC0 E0D78801 3 6 BASE 3719 EXCH R3 SP,TEMP TEMP = R3, R3 = block number 3720 * \ / 03EC1 DC402D1C 3721 CALLNP GETIDLE get an idle page 03EC2 FBE03F10 7 3722 IRJ R7 CANTREAD jump if none available 03EC3 EDC91F12 4 ZBM 3723 STW PPL,PPBUSYWORD/FLDADRS make it once busy 03EC4 E4D70801 3 4 BASE 3724 ST R3 PPL,PPBLOCK save block number 03EC5 DC002606 3725 CALL MAPINFBI get access to FBI for PPL, IOFF 03EC6 40530000 4 REG 3726 PARVL PPL pass physical page element 03EC7 D1564801 1 BASE 3727 STMW R1,FBIWORDB flag nothing read so far 03EC8 DC40261B 3728 CALLNP MAPOUTFBI unmap FBI, ION 3729 * \ / 03EC9 EC0949C3 5 ZBM 3730 STZ MDV,MDVERRFLDS clear error counters 03ECA DC003B66 3731 CALL CALCSKADR calculate seek address 03ECB 40570801 4 BASE 3732 PARVL PPL,PPBLOCK pass the disk address 3733 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 825 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3734 00003ECC 3735 SEEKOVER LABEL 03ECC DC403C7B 3736 CALLNP DISKSEEK seek the disk 03ECD FE0E3F25 3737 JMP OFFLINE jump if drive is offline 03ECE FE0E3F15 3738 JMP GIVEERROR jump if permanent seek error 3739 * \ / 3740 00003ECF 3741 READOVER LABEL 03ECF DC002606 3742 CALL MAPINFBI get access to FBI for PPL, IOFF 03ED0 40530000 4 REG 3743 PARVL PPL pass physical page element 03ED1 D1564801 1 BASE 3744 STMW R1,FBIWORDB flag nothing read so far 03ED2 DC40261B 3745 CALLNP MAPOUTFBI unmap FBI, ION 03ED3 60040003 0 IMM 3746 LD R0 MDVSTONCYL new state: ready for data transfer 03ED4 DCD7481B 5 BASE 3747 EXPCS MDV,MDVPC wait our turn 03ED5 FA0C3F25 0 3748 JNEZ R0 OFFLINE jump if controller is dead 3749 * \ / 03ED6 DC40406D 3750 CALLNP TSELECT tweak for error recovery 03ED7 FE0E3F25 3751 JMP OFFLINE jump if drive now offline 03ED8 FE0E3ECC 3752 JMP SEEKOVER jump if seek error 3753 * \ / 03ED9 60040001 0 IMM 3754 LD R0 1*PPUIDMAD 03EDA E4001803 0 3755 ST R0 CIX(PPUSCSTAT) set DMA direction to input 03EDB DC403EAA 3756 CALLNP PADBUILD set up data transfer addresses 3757 * \ / 03EDC EC001AB0 3758 STZ CIX(BFDREAD+1*BFDINTBIT) start the read 03EDD 60095830 0 5 ZBM 3759 LD R0 MDV,MDVUNIT R0 = unit number 3760 TRACE MSTRACE,MSTREAD reading, R0=Unit 03EDE 5D401D2C 3760 XCT TRACECALL(MSTRACE) 03EDF FEC00003 3760 NOP (MSTRACE*BITS 22:26)+(MSTREAD*BITS 27:31) 03EE0 D0174806 5 BASE 3761 INC MDV,MDVREADCNT say one more read attempt 03EE1 60040004 0 IMM 3762 LD R0 MDVSTDT new state: data transfer in progress 03EE2 DCD7481B 5 BASE 3763 EXPCS MDV,MDVPC wait for interrupt 03EE3 FA0C3F25 0 3764 JNEZ R0 OFFLINE jump if controller is dead 3765 * \ / 03EE4 DC003FCA 3766 CALL STATCHECK check transfer status 03EE5 40440003 IMM 3767 PARVL OPREAD operation is read 03EE6 FE0E3F25 3768 JMP OFFLINE drive went offline 03EE7 FE0E3F15 3769 JMP GIVEERROR unrecoverable error 03EE8 FE0E3ECC 3770 JMP SEEKOVER retry the seek 03EE9 FE0E3ECF 3771 JMP READOVER retry the read 03EEA FE0E3F12 3772 JMP FIXSEG do segment reconstruction 3773 * \ / good read 3774 3775 ********************************************************************************** 3776 * * 3777 * Read operation was successful, correctable, or at least * 3778 * we have something to give back to the user. See if we need * 3779 * to take preventative measures for next time. We tally the * 3780 * operation in the table of read counts by FBI type, verify the * 3781 * checksum, then rewrite and/or substitute if required. * 3782 * MDVREWRITE can be set by STATCHECK. MDVSUB can be set either * 3783 * by STATCHECK or DOREWRITE. A headcheck is called for if the * 3784 * block gets substituted. * 3785 * * 3786 ********************************************************************************** 3787 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 826 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3788 * \ / 00003EEB 3789 READOK LABEL 03EEB DC002606 3790 CALL MAPINFBI get access to FBI, IOFF 03EEC 40530000 4 REG 3791 PARVL PPL pass PPAGE element 03EED 60084080 0 1 ZBM 3792 LD R0 R1,FBITYPE get type of block read 03EEE 50040016 0 IMM 3793 MIN R0 MAXFBITYPE make sure it's reasonable 03EEF D0201D4C 0 3794 INC READCOUNTS(R0) and keep statistics on reads 03EF0 DC404161 3795 CALLNP FBICHKCKSM check the checksum 03EF1 EDC90212 4 ZBM 3796 STW PPL,PPDISKERR set error flag if bad 03EF2 DC40261B 3797 CALLNP MAPOUTFBI unmap FBI, ION 3798 03EF3 5C094813 5 ZBM 3799 CMZ MDV,MDVREWRITE do we want to do rewrite? 03EF4 FE023F08 3800 JEQ MAYBESUB jump if not 03EF5 5C090081 4 ZBM 3801 CMZ PPL,PPBLOCK/VOLFIELD no rewrites on unmounted vols. 03EF6 FE023F08 3802 JEQ MAYBESUB try another flag 3803 * \ / 3804 3805 * Rewrite the block 03EF7 DC002606 3806 CALL MAPINFBI get the FBI of the block to rewrite 03EF8 40530000 4 REG 3807 PARVL PPL 03EF9 D0484011 1 ZBM 3808 DEC R1,FBINOREWRIT flip 'rewritten' bit and test previous value 03EFA ED928000 2 REG 3809 STLNE R2 R2 <= 1 if block has not already been rewritten 3810 * Update the checksum in the FBI, since we just changed a bit 03EFB 6003FF80 0 IMM 3811 LD R0 FBIGMASK 03EFC F0164800 0 1 BASE 3812 PRMUT R0 R1,0 03EFD 7407FFFF 0 IMM 3813 XOR R0 -1 03EFE E416480A 0 1 BASE 3814 ST R0 R1,FBICKSUM 03EFF DC40261B 3815 CALLNP MAPOUTFBI 03F00 FA823F0A 2 3816 JEQZ R2 DOTHESUB substitute if block has been rewritten before 3817 * \ / 03F01 DC005048 3818 CALL ERRORLOG log the rewrite 03F02 41440C3F IMM 3819 PARV ERLCDSKRW rewrite after read 03F03 41574805 5 BASE 3820 PARV MDV,MDVNAME disk name 03F04 41570801 4 BASE 3821 PARV PPL,PPBLOCK MS address 03F05 40574808 5 BASE 3822 PARVL MDV,MDVSEEKADR seek address 03F06 DC403CF2 3823 CALLNP DOREWRITE do the rewrite 03F07 FE0E3F25 3824 JMP OFFLINE drive went offline 3825 * \ / 3826 00003F08 3827 MAYBESUB LABEL 03F08 5C094A13 5 ZBM 3828 CMZ MDV,MDVSUB do we want to substitute? 03F09 FE023F0F 3829 JEQ DONE jump if not 3830 * \ / 3831 3832 * Substitute, and call for head check 00003F0A 3833 DOTHESUB LABEL 3834 TRACE SUBSTRACE,SUBTCALL trace the substitution 03F0A 5D401D32 3834 XCT TRACECALL(SUBSTRACE) 03F0B FEC000C0 3834 NOP (SUBSTRACE*BITS 22:26)+(SUBTCALL*BITS 27:31) 03F0C DC40506E 3835 CALLNP SUBSTITUTE do the substitution 00003F0D 3836 PERM LABEL 3837 SETTBIT MDV,MDVCHKHEAD say headcheck required 03F0D 60020020 0 IMM 3837 LD R0 1*BIT(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 0:4) 03F0E FC174800 0 5 BASE 3837 IORM R0 MDV,(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 15:31) 3838 * \ / 00003F0F 3839 DONE LABEL good return 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 827 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03F0F 61D7D002 7 7 REG 3840 LD R7 R7+2 advance the return address 00003F10 3841 CANTREAD LABEL error return, +1=>offline, +2=>no idle page 03F10 60D78801 3 6 BASE 3842 LD R3 SP,TEMP restore R3 03F11 5D1F8002 6 STAK 3843 LEAVE POP and return 3844 * --- 3845 3846 ********************************************************************************** 3847 * * 3848 * Sort out various possible results from seek and/or read * 3849 * attempts. * 3850 * * 3851 * Fix segment, try rewrite (STATCHECK sets MDVREWRITE). * 3852 * Failed write check causes substitution. * 3853 * * 3854 ********************************************************************************** 3855 00003F12 3856 FIXSEG LABEL do segment correction 03F12 DC403D24 3857 CALLNP FIXSEGMENT do the correction 03F13 FE0E3ECC 3858 JMP SEEKOVER error, reread 03F14 FE0E3EEB 3859 JMP READOK it went well 3860 * --- 3861 3862 ********************************************************************************** 3863 * * 3864 * Permanent error trying seek or read. Log the error, * 3865 * mark and possibly zero fill the memory page. We want the * 3866 * head checker to run, but we suppress REWRITE and/or SUB. * 3867 * * 3868 ********************************************************************************** 3869 00003F15 3870 GIVEERROR LABEL permanent I/O error 03F15 5C094213 5 ZBM 3871 CMZ MDV,MDVNOERRS special error handling 03F16 FE0C3F0F 3872 JNE DONE if so, just return what was read 03F17 EDC90212 4 ZBM 3873 STW PPL,PPDISKERR flag the error 03F18 DC005048 3874 CALL ERRORLOG log the error 03F19 41440E3E IMM 3875 PARV ERLCDSKRD permanent read error 03F1A 41574805 5 BASE 3876 PARV MDV,MDVNAME disk name 03F1B 41570801 4 BASE 3877 PARV PPL,PPBLOCK block number 03F1C 40574808 5 BASE 3878 PARVL MDV,MDVSEEKADR seek address 3879 * \ / 03F1D DC002606 3880 CALL MAPINFBI get access to FBI for PPL 03F1E 40530000 4 REG 3881 PARVL PPL pass PPAGE element 03F1F 60485181 1 1 ZBM 3882 LD R1 R1,FBIDA get block number from FBI 03F20 DC40261B 3883 CALLNP MAPOUTFBI unmap FBI 03F21 64491181 1 4 ZBM 3884 CPR R1 PPL,PPBLOCK/MSBLKFIELD is it the right one? 03F22 FE023F0D 3885 JEQ PERM jump if so, allow data to be seen 03F23 DC404120 3886 CALLNP ZEROPAGE else zero the page ... 03F24 FE0E3F0D 3887 JMP PERM ... then hand it back 3888 * --- 3889 3890 ********************************************************************************** 3891 * * 3892 * Disk is no longer accessible. Abort the operation so * 3893 * it can be retried when the disk comes ready again (or the * 3894 * volume is remounted elsewhere). * 3895 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 828 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3896 ********************************************************************************** 3897 00003F25 3898 OFFLINE LABEL 03F25 EC170801 4 BASE 3899 STZ PPL,PPBLOCK nothing useful in block 03F26 DC402D51 3900 CALLNP PUTIDLE put it back on the idle list 03F27 FE0E3F10 3901 JMP CANTREAD 3902 * --- 3903 3904 END READ subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 829 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 3906 3907 ********************************************************************************** 3908 * * 3909 * READTRACKS - Read a Group of Tracks. * 3910 * * 3911 * This routine will read a group of tracks. It returns * 3912 * when all tracks are read or as soon as the number of blocks * 3913 * with errors exceeds the specified number. It is used for * 3914 * head-crash detection. * 3915 * * 3916 * LD MDV => MDV element * 3917 * CALL READTRACKS * 3918 * PARV head number * 3919 * PARV number of tracks * 3920 * PARVL error limit * 3921 * JMP drive went offline * 3922 * ST R0 number of errors remaining in limit (may be negative!) * 3923 * * 3924 * Registers Used: R0:R4 * 3925 * Stack Required: 18 * 3926 * 4 + max ( ADJUSTCYL (1), INTREAD (14), LOOKUPBTRX (1), * 3927 * PUTIDLE (1) ) * 3928 * * 3929 ********************************************************************************** 3930 3931 BLOCK READTRACKS subroutine 3932 ENTRY READTRACKS 3933 3934 BEGFRAME 00178801 6 BASE 3935 HEADNUM BSS 1 head number to read 00178802 6 BASE 3936 COUNT BSS 1 number of tracks left to read 00178803 6 BASE 3937 ERRORS BSS 1 number of errors found so far 3938 ENDFRAME 3939 03F28 DD1F8004 6 STAK 3940 READTRACKS ENTR PUSH 03F29 C1578801 6 BASE 3941 STPV SP,HEADNUM save head number 03F2A C1578802 6 BASE 3942 STPV SP,COUNT save number of tracks to do 03F2B C0578803 6 BASE 3943 STPVL SP,ERRORS save error limit 3944 * \ / 03F2C EC0949C3 5 ZBM 3945 STZ MDV,MDVERRFLDS indicate no errors found yet 03F2D 60174814 0 5 BASE 3946 LD R0 MDV,MDVCHKCYL get cylinder to check 03F2E FE0E3F30 3947 JMP READTRK join in 3948 * --- 3949 00003F2F 3950 LOOP LABEL 03F2F DC403B55 3951 CALLNP ADJUSTCYL move to new cylinder 00003F30 3952 READTRK LABEL 03F30 1C17400A 0 5 CACH 3953 MUL R0 MDV,MDVTRKPCYL mult cyl# by trackspercyl 03F31 18178801 0 6 BASE 3954 ADD R0 SP,HEADNUM R0 = track number 03F32 6117400B 4 5 CACH 3955 LD R4 MDV,MDVSECPTRK for mult, and in case block is on bad trax 03F33 1C130000 0 4 REG 3956 MUL R0 R4 R0 = number of 0th block on track 03F34 60920000 2 0 REG 3957 LD R2 R0 save it 00003F35 3958 GOTSECTOR LABEL 03F35 DC003E8D 3959 CALL LOOKUPBTRX is this block on bad trax list? 03F36 40528000 2 REG 3960 PARVL R2 block number 03F37 FE0E3F49 3961 JMP OOPS jump if block is known bad 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 830 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03F38 DC003E63 3962 CALL INTREAD read the block 03F39 41528000 2 REG 3963 PARV R2 block number 03F3A 40440000 IMM 3964 PARVL 0 any type is ok 03F3B FE0E3F48 3965 JMP RETURN0 jump if offline 03F3C FE0E3F3F 3966 JMP CHKERR jump if data/fbi error 03F3D FE0E3F44 3967 JMP NEXT jump if electronic error 03F3E DC402D51 3968 CALLNP PUTIDLE free up the page 3969 * \ / 3970 00003F3F 3971 CHKERR LABEL 03F3F 60095843 0 5 ZBM 3972 LD R0 MDV,MDVSKERRS get number of seek errors 03F40 18097083 0 5 ZBM 3973 ADD R0 MDV,MDVDKERRS add number of disk errors 03F41 FA023F44 0 3974 JEQZ R0 NEXT jump if no errors 03F42 D0578803 6 BASE 3975 DEC SP,ERRORS subtract error from limit 03F43 FE0A3F46 3976 JLE RETURN1 jump if exhausted 00003F44 3977 NEXT LABEL 03F44 D0578802 6 BASE 3978 DEC SP,COUNT done enough? 03F45 FE043F2F 3979 JGT LOOP loop if not 3980 * \ / 3981 00003F46 3982 RETURN1 LABEL 03F46 60178803 0 6 BASE 3983 LD R0 SP,ERRORS number of errors remaining 03F47 61D7D001 7 7 REG 3984 LD R7 R7+1 good return 3985 * \ / 3986 00003F48 3987 RETURN0 LABEL 03F48 5D1F8004 6 STAK 3988 LEAVE POP 3989 * --- 3990 3991 * Block is on list of baddies, try next block on track 00003F49 3992 OOPS LABEL 03F49 60969001 2 2 REG 3993 LD R2 R2+1 next! 03F4A FB223F35 4 3994 DRJ R4 GOTSECTOR jump if we haven't exhausted track 03F4B FE0E3F44 3995 JMP NEXT not an error, but ... 3996 * --- 3997 3998 END READTRACKS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 831 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4000 4001 ********************************************************************************** 4002 * * 4003 * REMOUNT - Check for Remounting a Volume. * 4004 * * 4005 * This routine is called when a drive a) comes ready, b) * 4006 * becomes unwriteprotected, c) has just been initialized * 4007 * (and is being reset, see ORRESETDRV). We attempt to * 4008 * reassociate the MDV with the volume it represents, if any. * 4009 * It is critical that we don't mismatch volumes and drives. * 4010 * Our first and most secure line of defense to match the * 4011 * VOLNMNTDAT with the SECMNTDAT. This is the raw date when * 4012 * the volume was last messed with. Unfortunately, SECMNTDAT * 4013 * is not always available (pack label and/or security blocks * 4014 * are unreadable, or the SECMNTDAT is 0), or usable (the * 4015 * security blocks are being written out). In these cases we * 4016 * fall back on matching the VOLNMNTDAT with the MDVFMTDAT * 4017 * (either PLINITDAT or cable pos). This match is fallible in * 4018 * that PLINITDAT may not be unique (someone copied a pack * 4019 * label without updating this field). The third possiblity is * 4020 * a match on cable position EVEN IF we were able to read the * 4021 * pack label and/or security blocks. This should only happen * 4022 * on packs that were made readable by an online disk * 4023 * initialization. * 4024 * * 4025 * LD MDV => MDV element * 4026 * LD2 R3 * 4027 * CALLNP REMOUNT * 4028 * * 4029 * Eats R0:R4. * 4030 * Stack required: 4 * 4031 * 1 + max ( CANOPMSG (1), ERRORLOG (3), SRCHLIST (1), * 4032 * UNSRCHLIST (1) ) * 4033 * * 4034 ********************************************************************************** 4035 4036 BLOCK REMOUNT subroutine 4037 ENTRY REMOUNT 4038 4039 BEGFRAME 4040 ENDFRAME 4041 00000020 BYTE 4042 MCNT EQU BITS 0:1 pass counter in R7 4043 03F4C DD5F8001 6 STAK 4044 REMOUNT ENTRNP PUSH 03F4D EC0BC020 7 CBM 4045 STZ R7/MCNT clear pass counter 03F4E DC0030AA 4046 CALL SRCHLIST lock the VOLN table 03F4F 40001F22 4047 PARL VOLNLOCK 00003F50 4048 REMTRYOVER LABEL 03F50 FAD23F59 34 4049 JEQZ2 R3 NEXTPASS jump if format date does not exist 03F51 60440001 1 IMM 4050 LD R1 1 lowest volume number 4051 * \ / 4052 00003F52 4053 FINDVOL LABEL 03F52 64440040 1 IMM 4054 CPR R1 MAXVOLNUM all volumes checked? 03F53 FE063F59 4055 JGE NEXTPASS loop if so 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 832 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03F54 60A21F22 2 1 4056 LD R2 VOLNTABLE(R1) R2 -> a VOLN element 03F55 FAB03F58 2 4057 JZA R2 NEXTVOL jump if none 03F56 66D68813 342 BASE 4058 CPR2 R3 R2,VOLNMNTDAT is this one ours? 03F57 FE023F62 4059 JEQ FOUNDVOL jump if so 4060 * \ / 00003F58 4061 NEXTVOL LABEL 03F58 FA603F52 1 4062 IRJ R1 FINDVOL up and try next 4063 * --- 4064 4065 * Made a pass, and nothing matched. Try another. 00003F59 4066 NEXTPASS LABEL 03F59 62D74810 345 BASE 4067 LD2 R3 MDV,MDVFMTDAT get formatted date 03F5A BC0BC020 0 7 CBM 4068 INCL R0 R7/MCNT test, set flag 03F5B 64040001 0 IMM 4069 CPR R0 1 second pass? 03F5C FE023F50 4070 JEQ REMTRYOVER jump to try format date 4071 * \ / 03F5D 64040002 0 IMM 4072 CPR R0 2 third pass? 03F5E FE043F71 4073 JGT NOREMOUNT jump if already done 03F5F DC403B5D 4074 CALLNP CALCDRVADR calculate cable position 03F60 62D20000 340 REG 4075 LD2 R3 R0 move into R3,R4 03F61 FE0E3F50 4076 JMP REMTRYOVER and try again 4077 * --- 4078 4079 * found a volume that matched, attempt remount 00003F62 4080 FOUNDVOL LABEL 03F62 600A7000 0 1 CBM 4081 LD R0 R1*MDVVOLFLD put volume number in right place 03F63 FC174800 0 5 BASE 4082 IORM R0 MDV,MDVWORDA set (RMW) volume number in MDV 03F64 5C089F15 2 ZBM 4083 CMZ R2,VOLNHCB drive for volume already exist? 03F65 FE023F67 4084 JEQ SETHCB jump if not 03F66 00130102 4085 HALT HALTS0102 VOLN already associated with a drive 00003F67 4086 SETHCB LABEL 03F67 E5489F15 5 2 ZBM 4087 ST MDV R2,VOLNHCB set VOLN ptr to MDV (ta dah!) 03F68 DC004713 4088 CALL CANOPMSG cancel complaint about volume 03F69 40489180 2 ZBM 4089 PARVL R2,VOLNMSGID 03F6A DC005048 4090 CALL ERRORLOG log the event 03F6B 4144081C IMM 4091 PARV ERLCRMNT 03F6C 41494080 5 ZBM 4092 PARV MDV,MDVVOLUME 03F6D 40574805 5 BASE 4093 PARVL MDV,MDVNAME 4094 * \ / 4095 00003F6E 4096 RETURN LABEL 03F6E DC0030B7 4097 CALL UNSRCHLIST release the lock 03F6F 40001F22 4098 PARL VOLNLOCK 03F70 5D1F8001 6 STAK 4099 LEAVE POP return 4100 * --- 4101 4102 * nothing! 00003F71 4103 NOREMOUNT LABEL 03F71 6003FE00 0 IMM 4104 LD R0 ONEBITS/MDVVOLFLD*MDVVOLFLD 03F72 A8174800 0 5 BASE 4105 BRSBM R0 MDV,MDVWORDA clear (RMW) volume field in MDV 03F73 FE0E3F6E 4106 JMP RETURN exit this routine 4107 * --- 4108 4109 END REMOUNT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 833 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4111 4112 ********************************************************************************** 4113 * * 4114 * REZERO - ReZero a Drive. * 4115 * * 4116 * This routine will rezero a drive, to recover from a * 4117 * previous seek error. * 4118 * We delay for short while if the drive already has had * 4119 * problems trying to rezero. This allows for problems caused * 4120 * by power glitches and other fleeting events. If we can't * 4121 * rezero and many other tries have failed as well, we unload * 4122 * the heads (in case the heads are crashing, too) and go * 4123 * offline. * 4124 * * 4125 * LD PPL => PPL (used for error logging only) * 4126 * LD MDV => MDV element * 4127 * CALLNP REZERO * 4128 * * 4129 * * 4130 * * 4131 * Eats R0:R3. * 4132 * Stack required: 7 * 4133 * 2 + max ( IDLEDRIVE (5), SEEKNDSTAT (4), SEEKNDWAIT (1), * 4134 * TRACEPROC (3), UNLOADHEAD (4) ) * 4135 * * 4136 ********************************************************************************** 4137 4138 BLOCK REZERO subroutine 4139 ENTRY REZERO 4140 4141 BEGFRAME 00178801 6 BASE 4142 RZERRS BSS 1 retry limit minus retries 4143 ENDFRAME 4144 03F74 DD5F8002 6 STAK 4145 REZERO ENTRNP PUSH 03F75 5C174815 5 BASE 4146 CMZ MDV,MDVRZPROBS having seek problems already? 03F76 FE023F78 4147 JEQ GOAHEAD jump if not 03F77 DC403E43 4148 CALLNP IDLEDRIVE else, wait for air to clear 4149 * \ / 00003F78 4150 GOAHEAD LABEL 03F78 60040005 0 IMM 4151 LD R0 MDVRZRTLIM max number of retries 03F79 E4178801 0 6 BASE 4152 ST R0 SP,RZERRS save it 4153 * \ / 00003F7A 4154 RETRY LABEL 03F7A 60095F11 0 5 ZBM 4155 LD R0 MDV,MDVCNTL load the controller element pointer 03F7B 5C081014 0 ZBM 4156 CMZ R0,MCTDEAD check for dead controller 03F7C FE0C3F94 4157 JNE RETURN jump if controller dead 03F7D 60095830 0 5 ZBM 4158 LD R0 MDV,MDVUNIT unit number 03F7E 60440012 1 IMM 4159 LD R1 BFDFNZERO operation 03F7F E4601A28 1 0 4160 ST R1 CIX(BFDFUNC+BFDSELECTB)(R0) start the rezero 4161 TRACE MSTRACE,MSTREZERO rezero, R0=Unit 03F80 5D401D2C 4161 XCT TRACECALL(MSTRACE) 03F81 FEC00007 4161 NOP (MSTRACE*BITS 22:26)+(MSTREZERO*BITS 27:31) 4162 * \ / 03F82 DC403FBE 4163 CALLNP SEEKNDWAIT wait for seek end 03F83 FA0C3F94 0 4164 JNEZ R0 RETURN jump if controller is dead 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 834 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03F84 DC003FA0 4165 CALL SEEKNDSTAT check seek end status 03F85 40440002 IMM 4166 PARVL OPREZERO operation is rezero 03F86 FE0E3F94 4167 JMP RETURN jump if drive is offline 03F87 FE0E3F8C 4168 JMP BADREZERO error rezeroing drive 4169 * \ / 4170 4171 * Rezero worked, say drive is getting better 03F88 D0574815 5 BASE 4172 DEC MDV,MDVRZPROBS one fewer problem 03F89 FE063F8B 4173 JGE NORMRETURN jump if non-neg 03F8A EC174815 5 BASE 4174 STZ MDV,MDVRZPROBS don't let counter go neg 4175 * \ / 4176 4177 * Drive is OK, or at least tolerable 00003F8B 4178 NORMRETURN LABEL 03F8B FBE03F94 7 4179 IRJ R7 RETURN successful return 4180 * --- 4181 4182 * Rezero failed, consider a retry 00003F8C 4183 BADREZERO LABEL 03F8C D0578801 6 BASE 4184 DEC SP,RZERRS count error 03F8D FE043F7A 4185 JGT RETRY jump we can still retry 03F8E BC174815 0 5 BASE 4186 INCL R0 MDV,MDVRZPROBS say seeker is sicker 03F8F 64040005 0 IMM 4187 CPR R0 MDVRZERLIM too sick? 03F90 FE083F8B 4188 JLT NORMRETURN not yet ... 4189 SETTBIT MDV,MDVBADSKS say why now offline 03F91 60028000 0 IMM 4189 LD R0 1*BIT(((MDV,MDVBADSKS) DISP (MDV,0))/BITS 0:4) 03F92 FC174802 0 5 BASE 4189 IORM R0 MDV,(((MDV,MDVBADSKS) DISP (MDV,0))/BITS 15:31) 03F93 DC404097 4190 CALLNP UNLOADHEAD unload the heads 4191 * \ / 4192 00003F94 4193 RETURN LABEL 03F94 5D1F8002 6 STAK 4194 LEAVE POP back to caller 4195 * --- 4196 4197 END REZERO subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 835 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4199 4200 ********************************************************************************** 4201 * * 4202 * RQSTDONE - Clean up After MS Request. * 4203 * * 4204 * This routine will clean up after a request: it will * 4205 * release the MSQ element, make the page available, and * 4206 * decrement the disk busy count. * 4207 * * 4208 * * 4209 * LD MSQ => MSQ element * 4210 * LD PPL => PPL for page (0 if none) * 4211 * LD MDV => MDV element * 4212 * CALLNP RQSTDONE * 4213 * * 4214 * Eats R0:R4. * 4215 * Stack required: 13 * 4216 * 2 + max ( PAGEREADY (11), SFREEMEM(0) ) * 4217 * * 4218 ********************************************************************************** 4219 4220 BLOCK RQSTDONE subroutine 4221 ENTRY RQSTDONE 4222 4223 BEGFRAME 00178801 6 BASE 4224 SAVEMDV BSS 1 save area for MDV register 4225 ENDFRAME 4226 03F95 DD5F8002 6 STAK 4227 RQSTDONE ENTRNP PUSH 03F96 6096C801 2 3 BASE 4228 LD R2 MSQ,MSQBLOCK get the disk address 03F97 DC002F5D 4229 CALL SFREEMEM release the MSQ element 03F98 41440002 IMM 4230 PARV MSQLOG block size 03F99 4052C000 3 REG 4231 PARVL MSQ and address 03F9A E5578801 5 6 BASE 4232 ST MDV SP,SAVEMDV save this register 03F9B DC002E94 4233 CALL PAGEREADY release the page to the rest of system 03F9C 40528000 2 REG 4234 PARVL R2 pass the disk address 03F9D 61578801 5 6 BASE 4235 LD MDV SP,SAVEMDV restore this register 03F9E EDC94011 5 ZBM 4236 STW MDV,MDVDIDXFER say we accomplished something 03F9F 5D1F8002 6 STAK 4237 LEAVE POP 4238 * --- 4239 4240 END RQSTDONE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 836 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4242 4243 ********************************************************************************** 4244 * * 4245 * SEEKNDSTAT - Check Status at Seek End. * 4246 * * 4247 * This routine will inspect the status after a seek (or * 4248 * rezero) operation to decide whether it was successful. * 4249 * * 4250 * LD PPL => PPL (used for error logging only) * 4251 * LD MDV => MDV element * 4252 * CALL SEEKNDSTAT * 4253 * PARVL operation code (OPSEEK or OPZERO) * 4254 * * 4255 * * 4256 * * 4257 * * 4258 * Eats R0:R3. * 4259 * Stack required: 4 * 4260 * 1 + max ( CLEARFAULT (2), ERRORLOG (3) ) * 4261 * * 4262 ********************************************************************************** 4263 4264 BLOCK SEEKNDSTAT subroutine 4265 ENTRY SEEKNDSTAT 4266 4267 BEGFRAME 4268 ENDFRAME 4269 03FA0 DD1F8001 6 STAK 4270 SEEKNDSTAT ENTR PUSH 03FA1 C052C000 3 REG 4271 STPVL R3 R3 = operation code 4272 * \ / 03FA2 60174809 0 5 BASE 4273 LD R0 MDV,MDVBFDSTAT get disk status 03FA3 6040395F 1 4274 LD R1 SEEKMASK mask of relevant bits 03FA4 6C003961 01 4275 MCPR R0 SEEKOK is it all right? 03FA5 FE023FBC 4276 JEQ DONE jump if so 03FA6 5C094613 5 ZBM 4277 CMZ MDV,MDVNOLOG error logging disabled? 03FA7 FE0C3FB3 4278 JNE CKSEEKSTAT jump if so 4279 * \ / 03FA8 DC005048 4280 CALL ERRORLOG log the bad status 03FA9 41441A32 IMM 4281 PARV ERLCDE disk error 03FAA 41574805 5 BASE 4282 PARV MDV,MDVNAME 03FAB 60040000 0 IMM 4283 LD R0 0 get dummy value 03FAC FB303FAE 4 4284 JZA PPL NOPPL don't use pointer if no PPL 03FAD 60170801 0 4 BASE 4285 LD R0 PPL,PPBLOCK otherwise, get block number involved 00003FAE 4286 NOPPL LABEL 03FAE 41520000 0 REG 4287 PARV R0 03FAF 41574808 5 BASE 4288 PARV MDV,MDVSEEKADR seek address 03FB0 4152C000 3 REG 4289 PARV R3 operation 03FB1 41574809 5 BASE 4290 PARV MDV,MDVBFDSTAT disk status 03FB2 40440000 IMM 4291 PARVL 0 PPU status 4292 * \ / 4293 00003FB3 4294 CKSEEKSTAT LABEL 03FB3 60174809 0 5 BASE 4295 LD R0 MDV,MDVBFDSTAT get disk status 03FB4 F62E3FBD 0 4296 JBT R0/BFDSSRSPER OFFLINE jump if drive has disappeared 03FB5 F60E3FB9 0 4297 JBT R0/BFDSSFAULT DRVFAULT jump if drive has faulted 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 837 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03FB6 F60C3FBB 0 4298 JBT R0/BFDSSSKERR ERROR jump on seek error 03FB7 F6083FBB 0 4299 JBT R0/BFDSSRDY ERROR jump if drive is ready 03FB8 FE0E3FBD 4300 JMP OFFLINE jump if drive seems to be not ready 4301 * --- 4302 00003FB9 4303 DRVFAULT LABEL 03FB9 DC403C0E 4304 CALLNP CLEARFAULT try to clear fault 03FBA FE0E3FBD 4305 JMP OFFLINE jump if drive is offline 4306 * \ / 4307 00003FBB 4308 ERROR LABEL 03FBB FBE03FBD 7 4309 IRJ R7 RETURN advance return address 4310 * --- 4311 00003FBC 4312 DONE LABEL 03FBC 61D7D002 7 7 REG 4313 LD R7 R7+2 4314 * \ / 4315 00003FBD 4316 OFFLINE LABEL 00003FBD 4317 RETURN LABEL 03FBD 5D1F8001 6 STAK 4318 LEAVE POP 4319 * --- 4320 4321 END SEEKNDSTAT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 838 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4323 4324 ********************************************************************************** 4325 * * 4326 * SEEKNDWAIT - Wait for Seek to Complete. * 4327 * * 4328 * LD MDV => MDV element * 4329 * CALLNP SEEKNDWAIT * 4330 * * 4331 * * 4332 * Eats R0:R2. * 4333 * Stack required: 1 * 4334 * * 4335 ********************************************************************************** 4336 4337 BLOCK SEEKNDWAIT subroutine 4338 ENTRY SEEKNDWAIT 4339 4340 BEGFRAME 4341 ENDFRAME 4342 03FBE DD5F8001 6 STAK 4343 SEEKNDWAIT ENTRNP PUSH 03FBF 60095830 0 5 ZBM 4344 LD R0 MDV,MDVUNIT get unit number 03FC0 60201A28 0 0 4345 LD R0 CIX(BFDSS+BFDSELECTB)(R0) get status 03FC1 6040395F 1 4346 LD R1 SEEKMASK mask of relevant bits 03FC2 6C003960 01 4347 MCPR R0 SEEKING are we actually seeking? 03FC3 FE023FC7 4348 JEQ DOWAIT jump if so - must wait 03FC4 E4174809 0 5 BASE 4349 ST R0 MDV,MDVBFDSTAT else save status 03FC5 60040000 0 IMM 4350 LD R0 0 say controller is alive 03FC6 FE0E3FC9 4351 JMP RETURN and return 4352 * --- 4353 00003FC7 4354 DOWAIT LABEL 03FC7 60040002 0 IMM 4355 LD R0 MDVSTSEEK new state: seeking 03FC8 DCD7481B 5 BASE 4356 EXPCS MDV,MDVPC wait for seek-end interrupt 4357 * \ / 4358 00003FC9 4359 RETURN LABEL 03FC9 5D1F8001 6 STAK 4360 LEAVE POP 4361 * --- 4362 4363 END SEEKNDWAIT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 839 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4365 4366 ********************************************************************************** 4367 * * 4368 * STATCHECK - Perform Status Check after Data Transfer. * 4369 * * 4370 * This routine will do the status checking after a data * 4371 * transfer operation. It will decide whether the operation * 4372 * was successful, and if not, what kind of retry to do. It * 4373 * will do any necessary ClearFault or ReZero. It will log * 4374 * any nonoptimal status. * 4375 * * 4376 * Note: If the MDVNOERRS flag is set, errors are counted but * 4377 * not checked against the maximums. No recovery is attempted, * 4378 * and the "permanent error" return is used. * 4379 * * 4380 * LD PPL => PPL of block transferred * 4381 * LD MDV => MDV element * 4382 * CALL STATCHECK * 4383 * PARVL operation code * 4384 * * 4385 * * 4386 * * 4387 * * 4388 * * 4389 * * 4390 * * 4391 * The miscellaneous error is: * 4392 * For READ, single segment reconstruction is necessary * 4393 * (R0 is the segment number) * 4394 * For WRITE, memory parity error occurred * 4395 * For CHECK, the data does not check (or is not readable) * 4396 * For FORMAT, should not happen, assume seek error * 4397 * * 4398 * Registers Used: R0:R3 * 4399 * Stack Required: 9 * 4400 * 2 + max ( CLEARFAULT (2), ERRORLOG (3), MAPINFBI (2), * 4401 * MAPOUTFBI (2) REZERO (7) ) * 4402 * * 4403 ********************************************************************************** 4404 4405 BLOCK STATCHECK subroutine 4406 ENTRY STATCHECK 4407 4408 BEGFRAME 00178801 6 BASE 4409 OPCODE BSS 1 requested operation 4410 ENDFRAME 4411 03FCA DD1F8002 6 STAK 4412 STATCHECK ENTR PUSH 03FCB C0578801 6 BASE 4413 STPVL SP,OPCODE operation code 4414 4415 ********************************************************************************** 4416 * * 4417 * Make first checks common to all operation types. * 4418 * * 4419 ********************************************************************************** 4420 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 840 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4421 * \ / 4422 * ignore parity error on page we already know about 03FCC FB303FCF 4 4423 JZA PPL CHKTRNSFER if no PPL, skip adjustment 03FCD 60090812 0 4 ZBM 4424 LD R0 PPL,PPMEMERR get bit for memory error found 03FCE A8096E1A 0 5 ZBM 4425 BRSBM R0 MDV,MDVPPUSTAT/PPUIMPE remove it from transfer status 4426 * \ / 4427 4428 * see whether all is OK right off the bat 00003FCF 4429 CHKTRNSFER LABEL 03FCF 62574809 125 BASE 4430 LD2 R1 MDV,MDVBFDSTAT get statuses 03FD0 78403962 1 4431 AND R1 XFERMASK mask off irrelevant bits 03FD1 64403963 1 4432 CPR R1 XFEROK is all well with disk? 03FD2 FE0C3FD5 4433 JNE HARDWAY jump if not 03FD3 78856540 2 IMM 4434 AND R2 PPUMASK mask off irrelevant PPU bits 03FD4 FA824065 2 4435 JEQZ R2 ALLOK exit if life is easy 4436 * \ / 4437 4438 * statuses not clean, log and process them 00003FD5 4439 HARDWAY LABEL 03FD5 5C094613 5 ZBM 4440 CMZ MDV,MDVNOLOG logging disabled? 03FD6 FE0C3FE3 4441 JNE CHKSTATUS jump if so 03FD7 60D78801 3 6 BASE 4442 LD R3 SP,OPCODE get the requested op code 03FD8 DC005048 4443 CALL ERRORLOG log the error 03FD9 41441A32 IMM 4444 PARV ERLCDE disk error 03FDA 41574805 5 BASE 4445 PARV MDV,MDVNAME 03FDB 60040000 0 IMM 4446 LD R0 0 parm if no PPL 03FDC FB303FDE 4 4447 JZA PPL HAVEPARM jump if no PPL 03FDD 60170801 0 4 BASE 4448 LD R0 PPL,PPBLOCK block number 00003FDE 4449 HAVEPARM LABEL 03FDE 41520000 0 REG 4450 PARV R0 pass MS block address 03FDF 41574808 5 BASE 4451 PARV MDV,MDVSEEKADR seek address 03FE0 4152C000 3 REG 4452 PARV R3 operation in progress 03FE1 41574809 5 BASE 4453 PARV MDV,MDVBFDSTAT disk status 03FE2 4057480A 5 BASE 4454 PARVL MDV,MDVPPUSTAT channel status 4455 * \ / 4456 4457 * check unmasked PPUINTSTAT and BFDSS 00003FE3 4458 CHKSTATUS LABEL 03FE3 62574809 125 BASE 4459 LD2 R1 MDV,MDVBFDSTAT get statuses 03FE4 F69E404F 2 4460 JBT R2/PPUITOUT SEEKERROR deadman timeout, re-start everything 03FE5 F6AA4057 2 4461 JBT R2/PPUICONF CHANERROR jump if PPU is confused 03FE6 F66E406A 1 4462 JBT R1/BFDSSRSPER OFFLINE exit if response error 03FE7 F64E4047 1 4463 JBT R1/BFDSSFAULT DRVFAULT jump to process drive fault 03FE8 F64C404F 1 4464 JBT R1/BFDSSSKERR SEEKERROR jump on seek error 03FE9 F24A404F 1 4465 JBF R1/BFDSSONCYL SEEKERROR jump if not on cylinder 03FEA F644406A 1 4466 JBT R1/BFDSSNSAFE OFFLINE else exit if drive is unsafe 03FEB F248406A 1 4467 JBF R1/BFDSSRDY OFFLINE exit if drive not ready 4468 * \ / 4469 4470 * check error code 03FEC 600A7840 0 1 CBM 4471 LD R0 R1/BFDSSERRCD get error code 03FED 5C30406B 0 @ 4472 CMZ @PTRBDE(R0) is it B, D or E? 03FEE FE0C4057 4473 JNE CHANERROR jump if yes 4474 * \ / 4475 4476 * branch to operation-specific checking 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 841 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 03FEF 60178801 0 6 BASE 4477 LD R0 SP,OPCODE get the operation code 03FF0 64040006 0 IMM 4478 CPR R0 OPWRITE write operation? 03FF1 FE02402B 4479 JEQ STATWRITE jump if so 03FF2 64040007 0 IMM 4480 CPR R0 OPCHECK write-check operation? 03FF3 FE024038 4481 JEQ STATWCHK jump if yes 03FF4 64040009 0 IMM 4482 CPR R0 OPFORMAT format operation? 03FF5 FE02404F 4483 JEQ SEEKERROR treat like seek error 4484 * \ / 4485 4486 ********************************************************************************** 4487 * * 4488 * Status checking for READ operation. * 4489 * * 4490 * This section is not entered by the other operation checks. * 4491 * * 4492 ********************************************************************************** 4493 4494 * \ / 03FF6 F6A44057 2 4495 JBT R2/PPUIDPPE CHANERROR jump if data path parity error 03FF7 F6B24057 2 4496 JBT R2/PPUIBCNR CHANERROR jump if byte count not ready 03FF8 F6A24057 2 4497 JBT R2/PPUIXTRA CHANERROR jump if extra bytes after rollover 03FF9 F6684057 1 4498 JBT R1/BFDSSWCERR CHANERROR jump if word-count error 03FFA F66A4057 1 4499 JBT R1/BFDSSLOSTD CHANERROR jump if FIFO over/under-flow 03FFB F66C4057 1 4500 JBT R1/BFDSSIFPE CHANERROR jump if interface parity error 4501 4502 * BFDSS and PPUINTSTAT check out for the most part. Only 4503 * things left to check are header errors and BFDSSCEOV. 4504 03FFC 5C0A7030 1 CBM 4505 CMZ R1/BFDSSHDECD any header errors? 03FFD FE024013 4506 JEQ NOHEADERR1 jump if none 03FFE 60097083 0 5 ZBM 4507 LD R0 MDV,MDVDKERRS pick up media counter 03FFF FA02405F 0 4508 JEQZ R0 DISKERROR treat very first header error as media 04000 600A01D0 0 0 CBM 4509 LD R0 R0/BITS 0:28 use .125 as appropriate ratio 04001 64095843 0 5 ZBM 4510 CPR R0 MDV,MDVSKERRS check against seek error count 04002 FE06404F 4511 JGE SEEKERROR apportion some blame to seek errors 04003 60D24000 3 1 REG 4512 LD R3 R1 save BFD status 04004 DC002606 4513 CALL MAPINFBI get access to FBI 04005 40530000 4 REG 4514 PARVL PPL pass physical page element 04006 6003FFC0 0 IMM 4515 LD R0 FBICSMASK 04007 F0164800 0 1 BASE 4516 PRMUT R0 R1,0 generate FBI checksum 04008 FA2E405E 0 4517 JNEMW R0 DSKERRUMAP jump if not correct 04009 60085181 0 1 ZBM 4518 LD R0 R1,FBIDA get disk address read 0400A 64091181 0 4 ZBM 4519 CPR R0 PPL,PPBLOCK/MSBLKFIELD is it right? 0400B FE0C405E 4520 JNE DSKERRUMAP jump if not 0400C DC40261B 4521 CALLNP MAPOUTFBI unmap FBI, ION 0400D 6052C000 1 3 REG 4522 LD R1 R3 get BFD status 0400E 5C0A7840 1 CBM 4523 CMZ R1/BFDSSERRCD did we have any data errors too? 0400F FE0C4013 4524 JNE NOHEADERR1 jump if so, data not good enough to substitute 04010 5C094013 5 ZBM 4525 CMZ MDV,MDVNOSUB ignore substitutions? 04011 FE0C4013 4526 JNE NOHEADERR1 jump if so, substitutions not allowed 04012 EDC94A13 5 ZBM 4527 STW MDV,MDVSUB else accept, but substitute block 4528 * \ / 4529 4530 * either, no header error occurred or not too many have 00004013 4531 NOHEADERR1 LABEL 04013 600A7840 0 1 CBM 4532 LD R0 R1/BFDSSERRCD get error code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 842 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 04014 6404000A 0 IMM 4533 CPR R0 BFDNUMSEGS is it single-segment error? 04015 FE04405F 4534 JGT DISKERROR jump if not 04016 FA044019 0 4535 JGTZ R0 SEGERROR jump if so 04017 F2764065 1 4536 JBF R1/BFDSSCEOV ALLOK exit if no error code or flags 4537 * \ / 4538 4539 ********************************************************************************** 4540 * Only thing wrong with read is BFDSSCEOV. Everything * 4541 * else is perfect. This means "time code error". Fake * 4542 * register to process "segment error" in check segment. * 4543 ********************************************************************************** 4544 04018 6004000A 0 IMM 4545 LD R0 BFDCHKSEG supply check segment number 4546 * \ / 4547 4548 ********************************************************************************** 4549 * READ: At least one segment (R0=number) has had an error. We * 4550 * can reconstruct it from checksum information if it is the only * 4551 * such segment (but just retry if this is the first time through). * 4552 * Read the BFDs auxiliary status to check on other segments. Each * 4553 * segment has four bits of information regarding its type of error: * 4554 * (write check), (overrun), (crc error), (time code error). The * 4555 * ten segments occupy the first 40 bits of the double word status, * 4556 * the remaining 24 bits are not relevant here. We mask off the * 4557 * bits we assume are bad in the known segment. If everything else * 4558 * is 0, no other segments had errors of any kind, so we set a flag * 4559 * (MDVREWRITE) and take the "correctable segment error" return. * 4560 ********************************************************************************** 4561 4562 * \ / 00004019 4563 SEGERROR LABEL 04019 5C097083 5 ZBM 4564 CMZ MDV,MDVDKERRS any disk errors yet? 0401A FE02405F 4565 JEQ DISKERROR if not, just retry 4566 * \ / 4567 0401B 60401A30 1 4568 LD R1 CIX(BFDEF18) get info on first 8 segments (1:8) 0401C 60801A40 2 4569 LD R2 CIX(BFDEF9A) get info on last two segments (9:A) 0401D 7883FE00 2 IMM 4570 AND R2 0FF000000 mask off irrelevant stuff 0401E E6574809 125 BASE 4571 ST2 R1 MDV,MDVBFDSTAT save them (wiping out status) 0401F 6044000C 1 IMM 4572 LD R1 0C mask to remove CRC and timecode errors 04020 38897848 2 5 ZBM 4573 LEA R2 MDV,MDVBFDSTAT/BITS 0:3(-1) point to segment "zero" info 04021 F85A8400 1 20 @R 4574 ANDM R1 @R2(R0) clear some bits in bad segment 04022 5E174809 5 BASE 4575 CMZ2 MDV,MDVBFDSTAT any other bits set? 04023 FE0C405F 4576 JNE DISKERROR jump if so 4577 * \ / 4578 4579 * Single segment error - rewrite unless we've been asked to 4580 * keep our hands off. R0 <= segment number. 04024 BC497083 1 5 ZBM 4581 INCL R1 MDV,MDVDKERRS count the error 04025 64440014 1 IMM 4582 CPR R1 MDVDKERLIM too many? 04026 FE064069 4583 JGE PERMERROR exit if so, treat as perm 04027 5C094213 5 ZBM 4584 CMZ MDV,MDVNOERRS special error handling? 04028 FE0C4066 4585 JNE SEGERR exit w/o rewrite 04029 EDC94813 5 ZBM 4586 STW MDV,MDVREWRITE say we should rewrite the block 0402A FE0E4066 4587 JMP SEGERR exit 4588 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 843 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4589 4590 ********************************************************************************** 4591 * * 4592 * Status checking for WRITE operations. * 4593 * * 4594 * This section is not entered by the other operation checks. * 4595 * * 4596 ********************************************************************************** 4597 0000402B 4598 STATWRITE LABEL 0402B F646406A 1 4599 JBT R1/BFDSSWPROT OFFLINE exit if write-protected (treat as offline) 0402C F6AE4066 2 4600 JBT R2/PPUIMPE MEMPARERR exit if memory parity error 0402D 5C0A7030 1 CBM 4601 CMZ R1/BFDSSHDECD any header errors? 0402E FE024032 4602 JEQ NOHEADERR2 jump if not 0402F 5C095843 5 ZBM 4603 CMZ MDV,MDVSKERRS have we retried seek yet? 04030 FE02404F 4604 JEQ SEEKERROR if not, do so 04031 FE0E4069 4605 JMP PERMERROR exit, it's a hopeless perm 4606 * --- 4607 00004032 4608 NOHEADERR2 LABEL 04032 5C0A7650 1 CBM 4609 CMZ R1/(BFDSSCEOV+BFDSSERRCD) any disk errors? 04033 FE024057 4610 JEQ CHANERROR jump if not 04034 60097083 0 5 ZBM 4611 LD R0 MDV,MDVDKERRS see how many so far 04035 64040005 0 IMM 4612 CPR R0 5 too many? 04036 FE08405F 4613 JLT DISKERROR jump if not 04037 FE0E406A 4614 JMP OFFLINE exit, drive is not useable 4615 * --- 4616 4617 ********************************************************************************** 4618 * * 4619 * Status checking for Write-Check operations. * 4620 * * 4621 * This section is not entered by the other operation checks. * 4622 * * 4623 ********************************************************************************** 4624 00004038 4625 STATWCHK LABEL 04038 5C0A7030 1 CBM 4626 CMZ R1/BFDSSHDECD any header errors? 04039 FE02403D 4627 JEQ NOHEADERR3 jump if not 0403A 5C095843 5 ZBM 4628 CMZ MDV,MDVSKERRS retried seek yet? 0403B FE02404F 4629 JEQ SEEKERROR if not, do so 0403C FE0E4069 4630 JMP PERMERROR exit, it's a fatal perm 4631 * --- 4632 0000403D 4633 NOHEADERR3 LABEL 0403D F6AE4066 2 4634 JBT R2/PPUIMPE NEEDWRITE exit if memory parity error 0403E F6684057 1 4635 JBT R1/BFDSSWCERR CHANERROR jump if word-count error 0403F F66A4057 1 4636 JBT R1/BFDSSLOSTD CHANERROR jump if FIFO over/under-run 04040 F66C4057 1 4637 JBT R1/BFDSSIFPE CHANERROR jump if interface parity error 04041 F6764069 1 4638 JBT R1/BFDSSCEOV PERMERROR trap undefined error which comes 04041 F6764069 1 4639 up once in a blue moon and doesn't 04041 F6764069 1 4640 seem to be recoverable 04042 5C0A7840 1 CBM 4641 CMZ R1/BFDSSERRCD any miscellaneous errors? 04043 FE024057 4642 JEQ CHANERROR if not, it's a channel error 04044 5C097083 5 ZBM 4643 CMZ MDV,MDVDKERRS have we retried yet? 04045 FE02405F 4644 JEQ DISKERROR if not, do so 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 844 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 04046 FE0E4066 4645 JMP NEEDWRITE exit, we must do a rewrite 4646 * --- 4647 4648 ********************************************************************************** 4649 * * 4650 * Problems. This section is entered from any of the operation * 4651 * checks attempting to recover from common hardware shortcomings. * 4652 * The counter for the specific error is incremented. We try no * 4653 * recovery and just perm the error if the MDVNOERRS flag is set. * 4654 * We say the drive is offline and do no recovery if our count * 4655 * of the specific error exceeds a predefined maximum. * 4656 * * 4657 ********************************************************************************** 4658 4659 4660 * Drive fault - clear fault, reseek or kill drive 00004047 4661 DRVFAULT LABEL 04047 DC403C0E 4662 CALLNP CLEARFAULT try to clear drive logic 04048 FE0E406A 4663 JMP OFFLINE jump if drive offline 04049 BC095043 0 5 ZBM 4664 INCL R0 MDV,MDVFLTERRS increment and get error count 0404A 5C094213 5 ZBM 4665 CMZ MDV,MDVNOERRS special error handling? 0404B FE0C4069 4666 JNE PERMERROR exit if so, treat as perm 0404C 64040005 0 IMM 4667 CPR R0 MDVFLERLIM have we hit the limit? 0404D FE084068 4668 JLT RESEEK exit if not, try reseek 0404E FE0E406A 4669 JMP OFFLINE exit, error is permanent 4670 * --- 4671 4672 * Seek error - rezero the drive, re-seek or kill the drive. 0000404F 4673 SEEKERROR LABEL 0404F DC403F74 4674 CALLNP REZERO try to realign the drive 04050 FE0E406A 4675 JMP OFFLINE jump if drive offline 04051 BC095843 0 5 ZBM 4676 INCL R0 MDV,MDVSKERRS increment and get error count 04052 5C094213 5 ZBM 4677 CMZ MDV,MDVNOERRS see if special error handling 04053 FE0C4069 4678 JNE PERMERROR exit if so, treat as perm 04054 64040005 0 IMM 4679 CPR R0 MDVSKERLIM too many otherwise? 04055 FE084068 4680 JLT RESEEK exit if not, try reseek 04056 FE0E406A 4681 JMP OFFLINE exit, drive looks bad 4682 * --- 4683 4684 * Channel error - clear channel, retry transfer or kill the drive 00004057 4685 CHANERROR LABEL 04057 EC001801 4686 STZ CIX(PPUABORT) try to make the channel happier 04058 BC096083 0 5 ZBM 4687 INCL R0 MDV,MDVCHERRS count the error 04059 5C094213 5 ZBM 4688 CMZ MDV,MDVNOERRS see if special error handling 0405A FE0C4069 4689 JNE PERMERROR exit if so, treat as perm 0405B 64040032 0 IMM 4690 CPR R0 MDVCHERLIM too many? 0405C FE084067 4691 JLT REXFER exit if not, retry the transfer 0405D FE0E406A 4692 JMP OFFLINE exit, the error is permanent 4693 * --- 4694 4695 * Disk error - retry transfer or kill the drive 0000405E 4696 DSKERRUMAP LABEL 0405E DC40261B 4697 CALLNP MAPOUTFBI unmap FBI, ION 0000405F 4698 DISKERROR LABEL 0405F BC097083 0 5 ZBM 4699 INCL R0 MDV,MDVDKERRS count the error 04060 5C094213 5 ZBM 4700 CMZ MDV,MDVNOERRS see if special error handling 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 845 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 04061 FE0C4069 4701 JNE PERMERROR exit if so, treat as perm 04062 64040014 0 IMM 4702 CPR R0 MDVDKERLIM too many otherwise? 04063 FE084067 4703 JLT REXFER exit if not, retry transfer 04064 FE0E4069 4704 JMP PERMERROR exit, error is permanent 4705 * --- 4706 4707 ********************************************************************************** 4708 * * 4709 * The various skip returns. * 4710 * * 4711 ********************************************************************************** 4712 00004065 4713 ALLOK LABEL transfer was successful 04065 61D7D001 7 7 REG 4714 LD R7 R7+1 4715 * \ / 4716 00004066 4717 SEGERR LABEL READ: single-segment error 00004066 4718 MEMPARERR LABEL WRITE: memory parity error 00004066 4719 NEEDWRITE LABEL CHECK: data badly written 04066 61D7D001 7 7 REG 4720 LD R7 R7+1 miscellaneous error 4721 * \ / 4722 00004067 4723 REXFER LABEL retry the data transfer 04067 61D7D001 7 7 REG 4724 LD R7 R7+1 4725 * \ / 4726 00004068 4727 RESEEK LABEL retry the seek 04068 61D7D001 7 7 REG 4728 LD R7 R7+1 4729 * \ / 4730 00004069 4731 PERMERROR LABEL permanent error 04069 61D7D001 7 7 REG 4732 LD R7 R7+1 4733 * \ / 4734 0000406A 4735 OFFLINE LABEL drive is offline 0406A 5D1F8002 6 STAK 4736 LEAVE POP return to caller 4737 * --- 4738 4739 * Bit table to check code in BFDSSERRCD. Quick check 4740 * whether code is one of 0B, 0D, or 0E. 0406B 0048406C 4741 PTRBDE PTR SETBDE pointer to bit table 0406B 00000000 4742 SETBDE VFDB 0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0 4743 4744 BSS 0 align to fullword 4745 4746 END STATCHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 846 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4748 4749 ********************************************************************************** 4750 * * 4751 * TSELECT - Select Special Settings for Read Operation. * 4752 * * 4753 * This routine will select the drive for reading, and * 4754 * perform any initializing operation required. It can select * 4755 * early or late data strobe, and/or positioner offset forward * 4756 * or backward. It makes its decision based on the disk error * 4757 * counter, and will try all of the various possibilities in * 4758 * turn. * 4759 * * 4760 * Notes: * 4761 * a) After selecting the options, we cannot do another * 4762 * select operation, as that would cause any selected * 4763 * options to be cancelled. * 4764 * b) After selecting a positioner offset, we have to wait * 4765 * for the drive to once more claim that it is on-cylinder. * 4766 * Since the disk controller is not guaranteed to give an * 4767 * interrupt for that condition, we just loop here waiting * 4768 * for it. * 4769 * c) Some drives (e.g. fixed Fujitsu with SMD/ESDI interface) * 4770 * can't handle these options. The interface deals with * 4771 * it, but is slow (90 micro-seconds) to drop "on-cylinder". * 4772 * We therefore WAIT a bit prior to checking the status. * 4773 * * 4774 * This is kind of dirty, but c'est la vie. * 4775 * * 4776 * LD PPL => PPL for page (used for error logging only) * 4777 * LD MDV => MDV element * 4778 * CALLNP TSELECT * 4779 * * 4780 * * 4781 * * 4782 * * 4783 * Eats R0:R3. * 4784 * Stack required: 6 * 4785 * 2 + max ( SEEKNDSTAT (4) ) * 4786 * * 4787 ********************************************************************************** 4788 4789 BLOCK TSELECT subroutine 4790 ENTRY TSELECT 4791 000001F4 ABS 4792 WAITTIME EQU 500 x 10 usec = 5 msec 00000064 ABS 4793 MAXWAITS EQU 100 x WAITTIME = 1/2 sec 4794 4795 BEGFRAME 00178801 6 BASE 4796 ACTION BSS 1 strobe/offset to use 4797 ENDFRAME 4798 0406D DD5F8002 6 STAK 4799 TSELECT ENTRNP PUSH 0406E 60495830 1 5 ZBM 4800 LD R1 MDV,MDVUNIT get the unit number 0406F E4401A00 1 4801 ST R1 CIX(BFDSELECT) select the drive just this once 4802 * \ / 04070 60497083 1 5 ZBM 4803 LD R1 MDV,MDVDKERRS get the error counter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 847 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 04071 FA42408B 1 4804 JEQZ R1 GOODRET leave if this is the first try 04072 60040000 0 IMM 4805 LD R0 0 clear for divide 04073 58C40010 IMM 4806 IORPSR PSRMODIF turn on mod arithmetic 04074 1404000A 0 IMM 4807 DIV R0 TERRORLIM R1 = which trick to use 04075 58840010 IMM 4808 CLBPSR PSRMODIF back to normal math 4809 * \ / 04076 6062408C 1 1 4810 LD R1 OFSETA(R1) select a trick from our grab bag 04077 FE0E407A 4811 JMP TSWAIT wait for any un-operations to happen 4812 * --- 4813 00004078 4814 TALOOP LABEL 04078 600A7080 0 1 CBM 4815 LD R0 R1/CH3 extract current operation 04079 E4001A20 0 4816 ST R0 CIX(BFDFUNC) do the function 0000407A 4817 TSWAIT LABEL 0407A E4578801 1 6 BASE 4818 ST R1 SP,ACTION save remaining codes 0407B 00440019 IMM 4819 WAIT 25 pause to let interface work 4820 * \ / 4821 4822 * Now loop until the mechanical motion is done. 0407C 60840064 2 IMM 4823 LD R2 MAXWAITS max number of times through the loop 0407D 6040395F 1 4824 LD R1 SEEKMASK load bits relevant to seek 0000407E 4825 WAIT LABEL 0407E 60001A20 0 4826 LD R0 CIX(BFDSS) get drive status 0407F 6C003960 01 4827 MCPR R0 SEEKING still seeking? 04080 FE0C4084 4828 JNE WAITDONE no, we're done 04081 004401F4 IMM 4829 WAIT WAITTIME wait a while 04082 FAA2407E 2 4830 DRJ R2 WAIT try again if under the limit 04083 FE0E4087 4831 JMP OFFLINE the thing can't take that long 4832 * --- 00004084 4833 WAITDONE LABEL 04084 E4174809 0 5 BASE 4834 ST R0 MDV,MDVBFDSTAT save current status 04085 DC003FA0 4835 CALL SEEKNDSTAT see how it looks 04086 40440008 IMM 4836 PARVL OPOFFSET doing offset operation 04087 5D1F8002 6 STAK 4837 OFFLINE LEAVE POP exit (SEEKNDSTAT sez offline) 04088 FBE04087 7 4838 ERROR IRJ R7 OFFLINE advance exit (SEEKNDSTAT sez seekerror) 4839 * \ / 4840 4841 * look for next action 04089 60499101 1 6 ZBM 4842 LD R1 SP,ACTION/(CH1+CH2) rotate! 0408A FA4C4078 1 4843 JNEZ R1 TALOOP jump if something to do 0000408B 4844 GOODRET LABEL 0408B FBE04088 7 4845 IRJ R7 ERROR make for third exit 4846 * --- 4847 4848 ********************************************************************************** 4849 * * 4850 * Bag of Tricks * 4851 * Each character in an entry is a function to be * 4852 * issued to the disk controller before the read. Many of * 4853 * the functions take time to execute and the driver must wait * 4854 * for on-cylinder to be re-asserted. Worse yet, the select * 4855 * at the beginning of this routine may also require a wait * 4856 * due to the controller cancelling a previous operation. * 4857 * The entries from the following table are right shifted * 4858 * for each loop. When the residue is zero, the loop terminates. * 4859 * The first pass through the loop does not issue any function, * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 848 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4860 * so the rightmost character is a dummy. * 4861 * * 4862 ********************************************************************************** 4863 0000408C 4864 OFSETA LABEL 0408C 00000000 4865 VFD 8:0,0,0,0 index of zero -- not used on first try 0408D 00000000 4866 VFD 8:0,0,0,0 index of one -- simply a retry, nothing fancy 0408E 00000000 4867 VFD 8:0,0,BFDFNDSE,0 try early data strobe 0408F 00000000 4868 VFD 8:0,0,BFDFNDSL,0 try late data strobe 04090 00000000 4869 VFD 8:0,0,BFDFNOFSF,0 try offset forward 04091 00000000 4870 VFD 8:0,BFDFNDSE,BFDFNOFSF,0 early, forward 04092 00000000 4871 VFD 8:0,BFDFNDSL,BFDFNOFSF,0 late, forward 04093 00000000 4872 VFD 8:0,0,BFDFNOFSB,0 try offset backward 04094 00000000 4873 VFD 8:0,BFDFNDSE,BFDFNOFSB,0 early, backward 04095 00000000 4874 VFD 8:0,BFDFNDSL,BFDFNOFSB,0 late, backward 0000000A ABS 4875 TERRORLIM EQU DISPW OFSETA number of elements in above table 04096 00000000 4876 VFD 8:0,0,0,0 extra do nothing element 4877 4878 END TSELECT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 849 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4880 4881 ********************************************************************************** 4882 * * 4883 * UNLOADHEAD - Unload the Heads from the Disk. * 4884 * * 4885 * This routine will cause the disk drive to unload the * 4886 * heads from the disk. This depends on a special BTI * 4887 * installed board in the disk drive that works as follows: * 4888 * On a seek, if the cylinder is BFDUNLDCYL and the head * 4889 * is BFDMAGICID, the kludge board will assert the power fault * 4890 * inside of the drive. This will cause the heads to unload. * 4891 * * 4892 * LD MDV => MDV element * 4893 * CALLNP UNLOADHEAD * 4894 * * 4895 * Eats R0:R3. * 4896 * Stack required: 4 * 4897 * 1 + max ( ERRORLOG (3), TRACEPROC (3) ) * 4898 * * 4899 ********************************************************************************** 4900 4901 BLOCK UNLOADHEAD subroutine 4902 ENTRY UNLOADHEAD 4903 4904 BEGFRAME 4905 ENDFRAME 4906 04097 DD5F8001 6 STAK 4907 UNLOADHEAD ENTRNP PUSH 04098 60095830 0 5 ZBM 4908 LD R0 MDV,MDVUNIT our unit number 04099 604040A3 1 4909 LD R1 MAGICSEEK seek to unload heads 0409A E4601A18 1 0 4910 ST R1 CIX(BFDSEEK+BFDSELECTB+R0) do the dirty deed 4911 TRACE MSTRACE,MSTUNLOAD trace the event 0409B 5D401D2C 4911 XCT TRACECALL(MSTRACE) 0409C FEC0000E 4911 NOP (MSTRACE*BITS 22:26)+(MSTUNLOAD*BITS 27:31) 4912 SETTBIT MDV,MDVBADDISK remember we did it 0409D 60030000 0 IMM 4912 LD R0 1*BIT(((MDV,MDVBADDISK) DISP (MDV,0))/BITS 0:4) 0409E FC174802 0 5 BASE 4912 IORM R0 MDV,(((MDV,MDVBADDISK) DISP (MDV,0))/BITS 15:31) 0409F DC005048 4913 CALL ERRORLOG log the head retraction 040A0 41440631 IMM 4914 PARV ERLCUNLOAD code 040A1 40574805 5 BASE 4915 PARVL MDV,MDVNAME drive name 040A2 5D1F8001 6 STAK 4916 LEAVE POP 4917 * --- 4918 040A3 03FFFF00 4919 MAGICSEEK VFD BFDUNLDCYL*BFDSACYL+BFDMAGICHD*BFDSAHEAD 4920 4921 END UNLOADHEAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 850 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 4923 4924 ********************************************************************************** 4925 * * 4926 * UNMOUNTVOL - Disassociate Volume and Drive. * 4927 * * 4928 * This routine will disassociate a volume and a drive. * 4929 * This is done when a drive drops ready but a volume is * 4930 * mounted there. * 4931 * * 4932 * LD MDV => MDV element * 4933 * CALLNP UNMOUNTVOL * 4934 * * 4935 * Eats R0:R4. * 4936 * Stack required: 8 * 4937 * 2 + max ( ERRORLOG (3), GENOPMSG (1), LOGCOUNT (4) * 4938 * P12TOCHAR (6), P6TOCHAR (3), SGETMEM (0) ) * 4939 * * 4940 ********************************************************************************** 4941 4942 BLOCK UNMOUNTVOL subroutine 4943 ENTRY UNMOUNTVOL 4944 4945 BEGFRAME 00178801 6 BASE 4946 SAVER5 BSS 1 save area for R5 4947 ENDFRAME 4948 040A4 DD5F8002 6 STAK 4949 UNMOUNTVOL ENTRNP PUSH 040A5 DC403E82 4950 CALLNP LOGCOUNT log the activity from this volume 040A6 DC005048 4951 CALL ERRORLOG log what we are doing 040A7 41440A3D IMM 4952 PARV ERLCDNRDY drive dropped ready 040A8 41574805 5 BASE 4953 PARV MDV,MDVNAME disk name 040A9 40494080 5 ZBM 4954 PARVL MDV,MDVVOLUME volume number 040AA 60094080 0 5 ZBM 4955 LD R0 MDV,MDVVOLUME get volume number 040AB FA0240CE 0 4956 JEQZ R0 RETURN jump if no volume mounted here 040AC 61201F22 4 0 4957 LD VLN VOLNTABLE(R0) R0 -> VOLN element 040AD EC091F15 4 ZBM 4958 STZ VLN,VOLNHCB clear reference to MDV 040AE 6003FE00 0 IMM 4959 LD R0 ONEBITS/MDVVOLFLD*MDVVOLFLD 040AF A8174800 0 5 BASE 4960 BRSBM R0 MDV,MDVWORDA clear (RMW) volume number in MDV 4961 4962 * Create message telling operator about the problem. 4963 040B0 E5578801 5 6 BASE 4964 ST R5 SP,SAVER5 save this register 040B1 DC002ED0 4965 CALL SGETMEM get an OPMSG block 040B2 40440005 IMM 4966 PARVL OPMSGLOG 040B3 61520000 5 0 REG 4967 LD R5 R0 R5 -> OPMSG block 4968 * \ / 040B4 38974802 2 5 BASE 4969 LEA R2 R5,OPMSGTEXT put "VOL " into message 040B5 600440CF 0 IMM 4970 LD R0 ADR MSGPART1 040B6 60440004 1 IMM 4971 LD R1 MSG1LEN 040B7 FE400000 4972 CMOVE 4973 * \ / 040B8 DC00593E 4974 CALL P6TOCHAR put half of volume name into message 040B9 41570811 4 BASE 4975 PARV VLN,VOLNNAME 040BA 41440006 IMM 4976 PARV 6 040BB 40168000 2 CACH 4977 PARL CACH R2,0 4978 * \ / R2 => null at end of string 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 851 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 040BC 600440D0 0 IMM 4979 LD R0 ADR MSGPART2 put "Volume " into message 040BD 60440007 1 IMM 4980 LD R1 MSG2LEN 040BE FE400000 4981 CMOVE 4982 * \ / 040BF DC005926 4983 CALL P12TOCHAR put volume name into message 040C0 43570811 4 BASE 4984 PARV2 VLN,VOLNNAME 040C1 40168000 2 CACH 4985 PARL CACH R2,0 4986 * \ / R2 => null at end of string 040C2 600440D2 0 IMM 4987 LD R0 ADR MSGPART3 put " is not accessible." into message 040C3 60440013 1 IMM 4988 LD R1 MSG3LEN 040C4 FE400000 4989 CMOVE 4990 * \ / 040C5 38174802 0 5 BASE 4991 LEA R0 R5,OPMSGTEXT R0 -> beginning of text 040C6 608A9F30 2 2 CBM 4992 LD R2 R2/FLDCHARS 040C7 108A1F30 2 0 CBM 4993 SUB R2 R0/FLDCHARS R2 = message length 040C8 E4974007 2 5 CACH 4994 ST R2 R5,OPMSGLEN save length 040C9 EC0942E0 5 ZBM 4995 STZ R5,OPMSGPROC no process number 040CA DC0046F3 4996 CALL GENOPMSG generate the message 040CB 40534000 5 REG 4997 PARVL R5 040CC E4091180 0 4 ZBM 4998 ST R0 VLN,VOLNMSGID save id of message 040CD 61578801 5 6 BASE 4999 LD R5 SP,SAVER5 restore ptr to MDV 5000 * \ / 5001 000040CE 5002 RETURN LABEL 040CE 5D1F8002 6 STAK 5003 LEAVE POP 5004 * --- 5005 040CF 564F4C20 5006 MSGPART1 TEXT "VOL " 00000004 ABS 5007 MSG1LEN EQU 4 040D0 566F6C75 5008 MSGPART2 TEXT "Volume " 00000007 ABS 5009 MSG2LEN EQU 7 040D2 20697320 5010 MSGPART3 TEXT " is not accessible." 00000013 ABS 5011 MSG3LEN EQU 19 5012 5013 END UNMOUNTVOL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 852 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 5015 5016 ********************************************************************************** 5017 * * 5018 * WRITE - Do a Write Operation, with Complete Recovery. * 5019 * * 5020 * This routine will do a disk write operation, complete * 5021 * with recovery, including write-check and rewrite. * 5022 * * 5023 * LD PPL => PPL of page to be written * 5024 * LD MDV => MDV of drive * 5025 * CALLNP WRITE * 5026 * * 5027 * * 5028 * * 5029 * Registers Used: R0:R2 * 5030 * Stack Required: 13 * 5031 * 2 + max ( CALCSKADR (1), DISKCHECK (10), DISKWRITE (10), * 5032 * DOREWRITE (11), ERRORLOG (3), MAPINFBI (2), * 5033 * MAPOUTFBI (2), SUBSTITUTE (7), TRACEPROC (3) ) * 5034 * * 5035 ********************************************************************************** 5036 5037 BLOCK WRITE subroutine 5038 ENTRY WRITE 5039 5040 BEGFRAME 00178801 6 BASE 5041 TEMP BSS 1 save area for R3 5042 ENDFRAME 5043 040D7 DD5F8002 6 STAK 5044 WRITE ENTRNP PUSH 040D8 E4D78801 3 6 BASE 5045 ST R3 SP,TEMP save volatile register 5046 * \ / 000040D9 5047 WRITEAGAIN LABEL 5048 CLRTBIT PPL,PPMODIFIED say resident page is no longer dirty 040D9 60030000 0 IMM 5048 LD R0 1*BIT(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 0:4) 040DA A8170802 0 4 BASE 5048 BRSBM R0 PPL,(((PPL,PPMODIFIED) DISP (PPL,0))/BITS 15:31) 040DB DC002606 5049 CALL MAPINFBI get access to FBI, IOFF 040DC 40530000 4 REG 5050 PARVL PPL pass physical page element 040DD 60090812 0 4 ZBM 5051 LD R0 PPL,PPMEMERR get memory error flag 040DE E4084611 0 1 ZBM 5052 ST R0 R1,FBIMEMERR save in FBI 040DF 60101EE7 0 @ 5053 LD R0 @FDATEPTR get current date and time 040E0 E4164803 0 1 BASE 5054 ST R0 R1,FBILCD save change date in FBI 040E1 6003FF80 0 IMM 5055 LD R0 FBIGMASK 040E2 F0164800 0 1 BASE 5056 PRMUT R0 R1,0 generate the checksum 040E3 7407FFFF 0 IMM 5057 XOR R0 -1 change sense 040E4 E416480A 0 1 BASE 5058 ST R0 R1,FBICKSUM and save it into FBI 040E5 60485181 1 1 ZBM 5059 LD R1 R1,FBIDA get disk address from FBI 040E6 DC40261B 5060 CALLNP MAPOUTFBI unmap FBI, ION 040E7 64491181 1 4 ZBM 5061 CPR R1 PPL,PPBLOCK/MSBLKFIELD compare against block number 040E8 FE0240EC 5062 JEQ BLKNUMOK jump if it is right 040E9 5C094023 5 ZBM 5063 CMZ MDV,MDVSPECDA are we allowing DA mismatches? 040EA FE0C40EC 5064 JNE BLKNUMOK ignore this halt if so 040EB 00130101 5065 HALT HALTS0101 FBIDA and PPBLOCK disagree 5066 * --- 5067 000040EC 5068 BLKNUMOK LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 853 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 040EC DC003B66 5069 CALL CALCSKADR calculate the seek address 040ED 40570801 4 BASE 5070 PARVL PPL,PPBLOCK pass disk address 040EE DC403C9A 5071 CALLNP DISKWRITE do the write 040EF FE0E411B 5072 JMP OFFLINE jump if drive went offline 040F0 FE0E40F2 5073 JMP MEMERROR jump if new memory error 040F1 FE0E40F9 5074 JMP WRITEOK jump if all went well 5075 * --- 5076 000040F2 5077 MEMERROR LABEL 5078 SETTBIT PPL,PPMEMERR set the memory error bit 040F2 60021000 0 IMM 5078 LD R0 1*BIT(((PPL,PPMEMERR) DISP (PPL,0))/BITS 0:4) 040F3 FC170802 0 4 BASE 5078 IORM R0 PPL,(((PPL,PPMEMERR) DISP (PPL,0))/BITS 15:31) 040F4 DC005048 5079 CALL ERRORLOG log the error 040F5 41440A1A IMM 5080 PARV ERLCMPED disk driver discovered memory error 040F6 41570803 4 BASE 5081 PARV PPL,PPPMVALUE page file value for page 040F7 40570801 4 BASE 5082 PARVL PPL,PPBLOCK disk block number 040F8 FE0E40D9 5083 JMP WRITEAGAIN rewrite, with memory error bit 5084 * --- 5085 000040F9 5086 WRITEOK LABEL 040F9 5C094A13 5 ZBM 5087 CMZ MDV,MDVSUB do we need to substitute? 040FA FE0C410F 5088 JNE DOSUB jump if yes 040FB DC002606 5089 CALL MAPINFBI get access to FBI, IOFF 040FC 40530000 4 REG 5090 PARVL PPL pass physical page element 040FD 60084080 0 1 ZBM 5091 LD R0 R1,FBITYPE get type of block written 040FE 50040016 0 IMM 5092 MIN R0 MAXFBITYPE keep it within bounds 040FF D0201D63 0 5093 INC WRITCOUNTS(R0) increment counters by type 04100 60484211 1 1 ZBM 5094 LD R1 R1,FBIWCHK does this page deserve write-check? 04101 DC40261B 5095 CALLNP MAPOUTFBI unmap FBI, ION 04102 FA4C4105 1 5096 JNEZ R1 DOWRITECK perform write-check if so 04103 5C094413 5 ZBM 5097 CMZ MDV,MDVWWCHK write-check operation indicated? 04104 FE02411A 5098 JEQ WRITEDONE if not, all finished 5099 * \ / 5100 00004105 5101 DOWRITECK LABEL 04105 DC403C1B 5102 CALLNP DISKCHECK else do the write-check 04106 FE0E411B 5103 JMP OFFLINE jump if drive is offline 04107 FE0E4109 5104 JMP NEEDWRITE jump if rewrite is needed 04108 FE0E410D 5105 JMP NOREWRITE jump if rewrite not needed 5106 * --- 5107 00004109 5108 NEEDWRITE LABEL 04109 5C094213 5 ZBM 5109 CMZ MDV,MDVNOERRS special error handling? 0410A FE0C411A 5110 JNE WRITEDONE if so, skip rewrite 0410B DC403CF2 5111 CALLNP DOREWRITE do the rewrite (and write-check) 0410C FE0E411B 5112 JMP OFFLINE jump if drive went offline 5113 * \ / 0000410D 5114 NOREWRITE LABEL 0410D 5C094A13 5 ZBM 5115 CMZ MDV,MDVSUB do we now need to substitute? 0410E FE02411A 5116 JEQ WRITEDONE jump if not 5117 * \ / 5118 0000410F 5119 DOSUB LABEL 5120 SETTBIT MDV,MDVCHKHEAD perform a head check 0410F 60020020 0 IMM 5120 LD R0 1*BIT(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 0:4) 04110 FC174800 0 5 BASE 5120 IORM R0 MDV,(((MDV,MDVCHKHEAD) DISP (MDV,0))/BITS 15:31) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 854 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 04111 DC002606 5121 CALL MAPINFBI get access to FBI, IOFF 04112 40530000 4 REG 5122 PARVL PPL pass physical page element 04113 60084411 0 1 ZBM 5123 LD R0 R1,FBINOSUB is block substitutable? 04114 60484080 1 1 ZBM 5124 LD R1 R1,FBITYPE get the type of this block 04115 DC40261B 5125 CALLNP MAPOUTFBI unmap FBI, ION 04116 FA0C411D 0 5126 JNEZ R0 CANTSUB jump if not substitutable 5127 * \ / 5128 TRACE SUBSTRACE,SUBTCALL trace the substitution 04117 5D401D32 5128 XCT TRACECALL(SUBSTRACE) 04118 FEC000C0 5128 NOP (SUBSTRACE*BITS 22:26)+(SUBTCALL*BITS 27:31) 04119 DC40506E 5129 CALLNP SUBSTITUTE substitute the block 5130 * \ / 5131 0000411A 5132 WRITEDONE LABEL 0411A 61D7D001 7 7 REG 5133 LD R7 R7+1 successful return 5134 * \ / 5135 0000411B 5136 OFFLINE LABEL 0411B 60D78801 3 6 BASE 5137 LD R3 SP,TEMP restore this register 0411C 5D1F8002 6 STAK 5138 LEAVE POP 5139 * --- 5140 5141 * Halt iff system volume, else set drive offline 0000411D 5142 CANTSUB LABEL 0411D 60094080 0 5 ZBM 5143 LD R0 MDV,MDVVOLUME get the volume number 0411E FA22411B 0 5144 DRJ R0 OFFLINE jump if not system volume 5145 * \ / 0411F 00100103 5146 HALT HALTP0103 write error on non-substitutable block 5147 * --- 5148 5149 END WRITE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 855 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 5151 5152 ********************************************************************************** 5153 * * 5154 * ZEROPAGE - Zero Out a Page. * 5155 * * 5156 * This routine will zero out a page. This is done for * 5157 * zeropage requests, and for read requests when absolutely no * 5158 * data can be scraped off the disk. * 5159 * * 5160 * LD PPL => PPL for page * 5161 * CALLNP ZEROPAGE * 5162 * * 5163 * Eats R0:R3. Unmaps WNDO4. * 5164 * Stack required: 3 * 5165 * 1 + max ( MAPINFBI (2), MAPOUTFBI (2) ) * 5166 * * 5167 ********************************************************************************** 5168 5169 BLOCK ZEROPAGE subroutine 5170 ENTRY ZEROPAGE 5171 5172 BEGFRAME 5173 ENDFRAME 5174 04120 DD5F8001 6 STAK 5175 ZEROPAGE ENTRNP PUSH 04121 DC002606 5176 CALL MAPINFBI get access to FBI, IOFF 04122 40530000 4 REG 5177 PARVL PPL pass physical page element 04123 60124000 0 1 REG 5178 LD R0 R1 save address of FBI 04124 60924000 2 1 REG 5179 LD R2 R1 address of FBI 04125 6044002C 1 IMM 5180 LD R1 FBILNTH*CPW size of FBI 04126 FE580000 5181 CFILL 0 clear out the FBI 04127 6044007F 1 IMM 5182 LD R1 FBITFREE 04128 E4480080 1 0 ZBM 5183 ST R1 R0,FBITYPE set FBITYPE = free block 04129 60570801 1 4 BASE 5184 LD R1 PPL,PPBLOCK 0412A E4481181 1 0 ZBM 5185 ST R1 R0,FBIDA set block number 0412B 6043FF80 1 IMM 5186 LD R1 FBIGMASK 0412C F0560800 1 0 BASE 5187 PRMUT R1 R0,0 generate FBI checksum 0412D 7447FFFF 1 IMM 5188 XOR R1 -1 change sense 0412E E456080A 1 0 BASE 5189 ST R1 R0,FBICKSUM save the checksum 0412F DC40261B 5190 CALLNP MAPOUTFBI unmap FBI, ION 5191 * \ / 5192 00004130 5193 RETRY LABEL 5194 PFAILEN PFAIL enable power-fail interrupts 04130 6004413C 0 IMM 5194 LD R0 ADR PFAIL 04131 E400044F 0 5194 ST R0 POWERUPLOC 04132 59C40800 IMM 5194 IORMSR MSRPFINTE 04133 60C40085 3 IMM 5195 LD PFPTR PNWNDO4 page number of available window 04134 00D70803 4 BASE 5196 LDPF PPL,PPPMVALUE map in the page 04135 60441000 1 IMM 5197 LD R1 CPP size of page 04136 60841400 2 IMM 5198 LD R2 ADR WNDO4 address of page 04137 FE580000 5199 CFILL 0 fill it up with zeros 04138 80D2C000 3 REG 5200 PFRC PFPTR unmap the window 5201 PFAILDS disable power-fail interrupts 04139 59840800 IMM 5201 CLBMSR MSRPFINTE 0413A EC00044F 5201 STZ POWERUPLOC 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 856 (MSPROC) F 43 Mass Storage Driver - Drive Activity Section 0413B 5D1F8001 6 STAK 5202 LEAVE POP 5203 * --- 5204 0000413C 5205 PFAIL LABEL power-fail restart here 0413C 60040006 0 IMM 5206 LD R0 MDVSTPFAIL go back to controller 0413D DCD7481B 5 BASE 5207 EXPCS MDV,MDVPC 0413E FE0E4130 5208 JMP RETRY on return, try again 5209 * --- 5210 5211 END ZEROPAGE subroutine 5212 5213 5214 END Drive Activity Section 5215 5216 5217 END Mass Storage Driver 79 INPUT FBICHECK FBI validity checker 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 857 (FBICHECK) F 44 FBI checker 3 4 BLOCK FBI Checking Routines 5 6 ENTRY VOLTODISK convert volume number to disk name 7 ENTRY FBICHECK check the FBI contents 8 ENTRY FBICHKCKSM verify checksum 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 858 (FBICHECK) F 44 FBI checker 10 11 ********************************************************************************** 12 * * 13 * FBICHECK * 14 * A routine called by the page fault processor that * 15 * handles the checking and type conversion of the mass * 16 * storage block. It is passed the VP element pointer, the * 17 * PAL pointer, and the PPL. The expected and new FBI types * 18 * are retrieved from the VP element. Values of these FBI * 19 * types may be: * 20 * * 21 * old new action * 22 * 00 xx the FBI is checked to be type xx * 23 * xx yy the FBI is checked to be type xx, * 24 * then, if it was okay, * 25 * it is changed to type yy. * 26 * 00 00 no checking at all is done on the FBI * 27 * If an error does occur, the error logger is called to * 28 * record the problem and the error return is taken. * 29 * * 30 * Call: * 31 * SP = stack address * 32 * LD R3 => PAL element * 33 * LD R4 => PPL element * 34 * LD VPP => virtual page element * 35 * CALLNP FBICHECK * 36 * * 37 * * 38 * Eats R0:R1, Sets R2. * 39 * Stack required = 6 * 40 * 2 + max ( ERRORLOG/VOLTODISK (4), MAPINFBI (2), MAPOUTFBI (2) ) * 41 * * 42 ********************************************************************************** 43 44 BLOCK FBICHECK subroutine 45 ENTRY FBICHECK 46 47 BEGFRAME 00178801 6 BASE 48 SAVER3 BSS 1 guess 49 ENDFRAME 50 0413F DD5F8002 6 STAK 51 FBICHECK ENTRNP PUSH 04140 608942E2 2 5 ZBM 52 LD R2 VPP,VPFBITYPE get the virtual page types 04141 5C090212 4 ZBM 53 CMZ PPL,PPDISKERR check error bit 04142 FE0C4157 54 JNE FBIDATERR jump if prior discovered data error 04143 DC002606 55 CALL MAPINFBI get access to FBI, IOFF 04144 40530000 4 REG 56 PARVL PPL pass physical page element 04145 64884080 2 1 ZBM 57 CPR R2 R1,FBITYPE is this the type of block we have? 04146 FE02415C 58 JEQ CHECKPE jump if success 04147 FA82415C 2 59 JEQZ R2 CHECKPE jump if no checking desired 04148 600AA470 0 2 CBM 60 LD R0 R2/VPFBIOLDB get the old type expected 04149 64084080 0 1 ZBM 61 CPR R0 R1,FBITYPE is that what we have? 0414A FE024159 62 JEQ TYPECHANGE yes, type change request 0414B E4D78801 3 6 BASE 63 ST R3 SP,SAVER3 tuck this away 0414C 60C84080 3 1 ZBM 64 LD R3 R1,FBITYPE put received type in safe reg 0414D DC40261B 65 CALLNP MAPOUTFBI unmap FBI, ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 859 (FBICHECK) F 44 FBI checker 0414E DC005048 66 CALL ERRORLOG bad news for whoever 0414F 41441236 IMM 67 PARV ERLCBFBI indicate bad FBI 04150 DC00417D 68 CALL VOLTODISK make disk name 04151 40490081 4 ZBM 69 PARVL PPL,PPBLOCK/VOLFIELD volume number 04152 41520000 0 REG 70 PARV R0 PAK6 disk name 04153 41570801 4 BASE 71 PARV PPL,PPBLOCK MS address 04154 414942E2 5 ZBM 72 PARV VPP,VPFBITYPE expected FBI type 04155 4052C000 3 REG 73 PARVL R3 found FBI type 04156 60D78801 3 6 BASE 74 LD R3 SP,SAVER3 restore 00004157 75 DISKERROR LABEL 04157 60840871 2 IMM 76 LD R2 UINTVMFDE+VERYBAD diskerror - very bad 04158 FE0E4160 77 JMP GROUPEXIT take error exit 78 * --- 79 80 81 ********************************************************************************** 82 * * 83 * The PPL represents a page that was recovered with a * 84 * read error. * 85 * Since we have already logged the error, we don't * 86 * clutter up the log file with another entry. * 87 * * 88 ********************************************************************************** 89 00004157 90 FBIDATERR EQU DISKERROR give error return 91 * --- 92 93 ********************************************************************************** 94 * * 95 * Do the FBI type conversion and return success. * 96 * * 97 ********************************************************************************** 98 00004159 99 TYPECHANGE LABEL a type change was requested 04159 600AB270 0 2 CBM 100 LD R0 R2/VPFBINEWB get the new type 0415A E4084080 0 1 ZBM 101 ST R0 R1,FBITYPE convert the FBI type 0415B EC094272 5 ZBM 102 STZ VPP,VPFBIOLD dump old type 103 * \ / 104 0000415C 105 CHECKPE LABEL 0415C 60884611 2 1 ZBM 106 LD R2 R1,FBIMEMERR then check for parity errors 0415D FA82415F 2 107 JEQZ R2 NOMEMERR jump if page is rosy (R2=0 => no error) 0415E 60840870 2 IMM 108 LD R2 UINTVMFPE+VERYBAD parityerror - very bad 109 * \ / 110 0000415F 111 NOMEMERR LABEL 0415F DC40261B 112 CALLNP MAPOUTFBI unmap FBI, ION 113 * \ / 114 00004160 115 GROUPEXIT LABEL 04160 5D1F8002 6 STAK 116 LEAVE POP return 117 * --- 118 119 END FBICHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 860 (FBICHECK) F 44 FBI checker 121 122 ********************************************************************************** 123 * * 124 * Routine to calculate and verify the FBI checksum. * 125 * Call: * 126 * FBI mapped in * 127 * MDV => drive element (for logging) * 128 * PPL => PPAGE element * 129 * R1 => FBI * 130 * CALLNP FBICHKCKSM * 131 * JMP * 132 * * 133 * Eats R0:R3 * 134 * Stack required: 6 * 135 * 2 + ERRORLOG/VOLTODISK (4) * 136 * * 137 ********************************************************************************** 138 139 BLOCK FBICHKCKSM subroutine 140 ENTRY FBICHKCKSM 141 142 BEGFRAME 00178801 6 BASE 143 SAVER5 BSS 1 144 ENDFRAME 145 04161 DD5F8002 6 STAK 146 FBICHKCKSM ENTRNP PUSH 04162 6003FFC0 0 IMM 147 LD R0 FBICSMASK mask includes all FBI words 04163 F0164800 0 1 BASE 148 PRMUT R0 R1,0 calculate the FBI checksum 04164 FA2E4169 0 149 JNEMW R0 FBICKSBAD jump if checksum bad 150 * \ / 151 04165 60085181 0 1 ZBM 152 LD R0 R1,FBIDA get DA from FBI 04166 64091181 0 4 ZBM 153 CPR R0 PPL,PPBLOCK/MSBLKFIELD compare DA with block where transfer occurred 04167 FE0C4176 154 JNE BADBLKNUM jump if block number mismatch 04168 FBE0417C 7 155 IRJ R7 RETURN advance over the error return 156 * --- 157 158 * FBI checksum was found bad 00004169 159 FBICKSBAD LABEL 04169 E5578801 5 6 BASE 160 ST R5 SP,SAVER5 tuck away this reg 0416A 60D20000 3 0 REG 161 LD R3 R0 save the error bits 0416B 6156480A 5 1 BASE 162 LD R5 R1,FBICKSUM get CS from FBI 0416C DC005048 163 CALL ERRORLOG log the error 0416D 41441237 IMM 164 PARV ERLCCKFBI indicate checksum error 0416E DC00417D 165 CALL VOLTODISK make disk name 0416F 40490081 4 ZBM 166 PARVL PPL,PPBLOCK/VOLFIELD volume number 04170 41520000 0 REG 167 PARV R0 PAK6 disk name 04171 41570801 4 BASE 168 PARV PPL,PPBLOCK get the block number of the bad block 04172 4152C000 3 REG 169 PARV R3 get the difference 04173 40534000 5 REG 170 PARVL R5 and the existing checksum 04174 61578801 5 6 BASE 171 LD R5 SP,SAVER5 restore this reg 04175 FE0E417C 172 JMP RETURN error return 173 * --- 174 175 * FBI checksum was okay, but FBIDA did not match expectations 00004176 176 BADBLKNUM LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 861 (FBICHECK) F 44 FBI checker 04176 60D20000 3 0 REG 177 LD R3 R0 copy block number from FBI 04177 DC005048 178 CALL ERRORLOG log the error 04178 41440E38 IMM 179 PARV ERLCBKFBI bad block number 04179 41574805 5 BASE 180 PARV R5,MDVNAME disk name 0417A 41570801 4 BASE 181 PARV PPL,PPBLOCK pass the expected block number 0417B 4052C000 3 REG 182 PARVL R3 pass the FBIs claim 0000417C 183 RETURN LABEL 0417C 5D1F8002 6 STAK 184 LEAVE POP back to caller 185 * --- 186 187 END FBICHKCKSM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 862 (FBICHECK) F 44 FBI checker 189 190 ********************************************************************************** 191 * * 192 * VOLTODISK. Subroutine to convert a volume number to the * 193 * name of the drive on which the volume is currently mounted. * 194 * Call: * 195 * CALL VOLTODISK * 196 * PARVL * 197 * ST R0 | 0 if none * 198 * * 199 * Eats R0 * 200 * Stack usage: 1 * 201 * * 202 ********************************************************************************** 203 204 BLOCK VOLTODISK subroutine 205 ENTRY VOLTODISK 206 207 BEGFRAME 208 ENDFRAME 209 0417D DD1F8001 6 STAK 210 VOLTODISK ENTR PUSH 0417E C0520000 0 REG 211 STPVL R0 get volume number 0417F FA024183 0 212 JEQZ R0 VTDEXIT jump if none (head checker) 04180 60201F22 0 0 213 LD R0 VOLNTABLE(R0) VOLN element 04181 60081F15 0 0 ZBM 214 LD R0 R0,VOLNHCB MDV element 04182 60160805 0 0 BASE 215 LD R0 R0,MDVNAME PAK6 name 00004183 216 VTDEXIT LABEL 04183 5D1F8001 6 STAK 217 LEAVE POP return 218 * --- 219 220 END VOLTODISK subroutine 221 222 END FBI Checking Routines 80 INPUT MTDRIVER mag tape driver 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 863 (MTDRIVER) F 45 Magnetic Tape Driver 3 4 BLOCK Magnetic Tape Driver 5 6 ENTRY MTPROC Try to schedule I/O - Entry from Dispatcher 7 ENTRY MTPROCINT Tape interrupt - entry from interrupt handler 8 ENTRY MT_RESET Reset a controller - entry from INITIAL and DEADMAN 9 10 ENTRY MTDRIVE Initial address for drive routine (used by INITIAL) 11 12 13 ********************************************************************************** 14 * * 15 * MAGNETIC TAPE DATA STRUCTURES * 16 * * 17 * Each tape controller (either cartridge, 9 track, or video) * 18 * is represented by a block called an MTC element (Mag Tape * 19 * Controller). Each controller can have up to 4 tape drives * 20 * connected to it. Each drive is represented by a block * 21 * called an MTU element (Mag Tape Unit). These blocks are * 22 * created at initialization and are never destroyed. * 23 * Each tape drive can be opened by only one process * 24 * at a time. Furthermore, there can be only one request * 25 * outstanding for each drive at a time. The request is * 26 * described by a word in the MTU element. * 27 * For READ and WRITE requests, the data is read directly * 28 * into or written directly from the user's address space. * 29 * The pages are locked into core in advance, and are * 30 * described by a chain of UBS elements (User Buffer Space). * 31 * These elements are chained from the MTU element. * 32 * * 33 * LOCKS * 34 * * 35 * MTCELOCK (within each MTC element) is set to indicate * 36 * that some CPU is actively talking to a tape controller. * 37 * CPU's use PLOCK for mutual exclusion on entry to the tape * 38 * controller. * 39 * MTCBUSY (within each MTC element) is set to indicate * 40 * that the controller is doing an operation and that nobody * 41 * can talk to it. This lock is only changed while MTCELOCK * 42 * is held. * 43 * MTREQLOCK (global) is held by a user while requesting * 44 * an operation, and is held by the driver while rousting a * 45 * user. * 46 * * 47 * REQUESTS * 48 * * 49 * The protocol for requesting an operation is as follows: * 50 * - Lock MTREQLOCK. * 51 * - If requesting a DMA operation, call DIOSETUP. * 52 * - Set the request code in MTUREQUEST. * 53 * - Set MTCREQUEST bit to indicate that a request is pending. * 54 * - Set FLMTPROC in the dispatcher FLAGS. * 55 * - Suspend in DIO Wait, releasing MTCREQLOCK. * 56 * - When awakened, inspect MTUERRCODE and MTURECTYPE. * 57 * * 58 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 864 (MTDRIVER) F 45 Magnetic Tape Driver 60 61 ********************************************************************************** 62 * * 63 * PROGRAM STRUCTURE * 64 * * 65 * The Magnetic Tape Driver consists of two sections: the * 66 * controller-scheduling section and the drive logic section. * 67 * The controller-scheduling section is always entered first. * 68 * Its job is to route control to the code for the various * 69 * drives at the appropriate times, so that any appropriate * 70 * activity can be done to the drive. The drive logic section * 71 * contains the code that performs the actual tape requests. * 72 * * 73 * These two sections act as coroutines. Whenever the * 74 * code in the drive section reaches a critical point (for * 75 * example, wait for completion of an operation), it loads a * 76 * code into R0 and executes an "EXPCS MTU,MTUPC" instruction. * 77 * This transfers control to the scheduling section. Control * 78 * will return (again via "EXPCS MTU,MTUPC") when the * 79 * appropriate conditions are met. The drive section loads * 80 * one of the following codes into R0 before the "EXPCS": * 81 * * 82 * MTUSTRUN - Run the drive code next time the * 83 * scheduling section is entered. * 84 * This is what the drive code does * 85 * when there are no pending requests. * 86 * * 87 * MTUSTWAIT - Run the drive code after any other * 88 * drive's code that must be run. This * 89 * is what a drive does right before it * 90 * starts an operation that will tie up * 91 * the controller. (This gives other * 92 * drives an opportunity to make progress * 93 * meanwhile.) * 94 * * 95 * MTUSTBUSY - The drive has just tied up the controller. * 96 * Run its code after the next interrupt * 97 * from the controller. Until then, no * 98 * other drive on the same controller * 99 * can be run. * 100 * * 101 * When the controller-scheduling section eventually * 102 * returns to the drive section (via "EXPCS MTU,MTUPC"), R0 = * 103 * 0 if controller is alive, 1 if dead, registers R1:R2 have * 104 * been altered, but R3-R7 have been saved and restored. Note * 105 * that each drive has its own stack (as part of the MTU * 106 * element). * 107 * * 108 ********************************************************************************** 109 110 111 112 * We generate the following trace events: 113 00000001 ABS 114 MTTENTER EQU 1 Enter MTPROC, R0=PageMap, R1=MtcStat, R2=PpuStat 00000002 ABS 115 MTTINTRPT EQU 2 Interrupt, R0=PageMap, R1=MtcStat, R2=PpuStat 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 865 (MTDRIVER) F 45 Magnetic Tape Driver 00000003 ABS 116 MTTRESET EQU 3 Reset, R0=PageMap, R0=0 if cntlr is dead 00000004 ABS 117 MTTLEAVE EQU 4 Leave, R0=PageMap 00000005 ABS 118 MTTFUNC EQU 5 Tape Function, R0=Unit, R1=Address, R2=Value 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 866 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 121 122 BLOCK Controller-Scheduling Section 123 124 ENTRY MTPROC Try to schedule something 125 ENTRY MTPROCINT Process an interrupt 126 ENTRY MT_RESET Reset a controller 127 128 ENTRY NEWBYTECNT Load next byte count for transfer 129 130 ********************************************************************************** 131 * * 132 * This is the controller-scheduling section of the tape * 133 * driver. We have three main entry points: MTPROC, * 134 * MTPROCINT, and MT_RESET. * 135 * * 136 * MTPROC is entered by the dispatcher when someone has * 137 * set the MTPROC flag. This is done when someone requests a * 138 * new tape operation. MTPROC must loop through each * 139 * controller, attempting to start activity. It exits * 140 * directly to DISPATCH. * 141 * * 142 * MTPROCINT is entered by the interrupt handler when a * 143 * tape interrupt occurs. It must update tape status, then * 144 * attempt to start any new activity on the interrupting * 145 * controller. It also exits directly to DISPATCH. * 146 * * 147 * MT_RESET is called by INITIAL and DEADMAN to reset a * 148 * particular controller. It will update drive statuses, then * 149 * start any necessary activity on the drive. * 150 * * 151 * The subroutine NEWBYTECNT will load the next byte * 152 * count on a byte count rollover interrupt. This routine is * 153 * an entry because it is called by the drive activity section * 154 * of the tape driver. * 155 * * 156 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 867 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 158 159 ********************************************************************************** 160 * * 161 * MTPROC - Entry from dispatcher. * 162 * * 163 * We are entered here when it may be possible to start * 164 * some new I/O operations. We must scan each controller and * 165 * each device in turn to see if it is possible. * 166 * * 167 * Exits to DISPATCH. unmaps CIX. * 168 * * 169 * Eats R0:R5,R7. * 170 * Stack required = 5. * 171 * 0 + max ( DOTAPE (5), LOCKWAIT (0), PROCESSINT (4), * 172 * TRACEPROC (3) ) * 173 * * 174 ********************************************************************************** 175 176 BLOCK MTPROC routine 177 ENTRY MTPROC 178 00004184 179 MTPROC LABEL 04184 61C01F1C 7 180 LD MTC MTCLIST get pointer to the first controller 04185 FBF041AD 7 181 JZA MTC DONE jump if no tape controllers 182 * \ / 183 00004186 184 LOOP LABEL 04186 D197C805 7 BASE 185 CLRT MTC,MTCREQUEST is anything new requested here? 04187 FE0241AC 186 JEQ NEXT if not, skip this controller 187 PFAILCHK DONE jump if power failure 04188 5C00044E 187 CMZ POWERFLAG power-fail restart in progress? 04189 FE0C41AD 187 JNE DONE jump if so 187 PFAILEN DONE else allow interrupt 0418A 600441AD 0 IMM 187 LD R0 ADR DONE 0418B E400044F 0 187 ST R0 POWERUPLOC 0418C 59C40800 IMM 187 IORMSR MSRPFINTE 187 PFAILDS then disallow interrupt 0418D 59840800 IMM 187 CLBMSR MSRPFINTE 0418E EC00044F 187 STZ POWERUPLOC 188 PLOCK (MTC,MTCELOCK) lock the controller 0418F 0CC00000 188 IOFF 04190 D1D7C803 7 BASE 188 SETT (MTC,MTCELOCK) 04191 FE0C4193 188 JNE MA(2+DISPW MA 0) 04192 DC40308B 188 CALLNP LOCKWAIT 04193 5C09DF16 7 ZBM 189 CMZ MTC,MTCBUSY is the controller busy? 04194 FE0C41AA 190 JNE CONTBUSY jump if so 191 04195 60C40086 3 IMM 192 LD PFPTR PNCIX 04196 00D7C801 7 BASE 193 LDPF MTC,MTCPMVALUE map in the controller 04197 5C09C816 7 ZBM 194 CMZ MTC,MTCDEAD check for dead controller 04198 FE0C41A9 195 JNE NOINT jump if controller is presumed dead 04199 5C001800 196 CMZ CIX(PPUCABLED) check for response 0419A FE0C419D 197 JNE ALIVE jump on good response 0419B EDC9C816 7 ZBM 198 STW MTC,MTCDEAD mark controller as dead 0419C FE0E41A9 199 JMP NOINT 200 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 868 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 201 0000419D 202 ALIVE LABEL 0419D 60040008 0 IMM 203 LD R0 MTFNDSCIOF 0419E E4001A30 0 204 ST R0 CIX(MTCMFUNC) disable state-change interrupts 0419F 60801801 2 205 LD R2 CIX(PPUINTSTAT) get PPU interrupt status 041A0 6017C801 0 7 BASE 206 LD R0 MTC,MTCPMVALUE for trace 041A1 60401802 1 207 LD R1 CIX(PPUCHANS1) R1 = MTC status 208 TRACE MTTRACE,MTTENTER enter MTPROC, R0=PageMap, R1=MtcStat, R2=PpuStat 041A2 5D401D30 208 XCT TRACECALL(MTTRACE) 041A3 FEC00081 208 NOP (MTTRACE*BITS 22:26)+(MTTENTER*BITS 27:31) 209 041A4 F2A841AA 2 210 JBF R2/PPUICIA CONTBUSY jump if another CPU just got interrupt 041A5 F2B841A9 2 211 JBF R2/PPUIINTC NOINT jump if interrupt not pending 041A6 DC0041F3 212 CALL PROCESSINT process the pending interrupt 041A7 414AA100 2 CBM 213 PARV R2/BITS 16:31 PPU status 041A8 40524000 1 REG 214 PARVL R1 interrupting tape status 000041A9 215 NOINT LABEL 216 041A9 DC404212 217 CALLNP DOTAPE do any necessary tape activity 218 * \ / 219 000041AA 220 CONTBUSY LABEL 221 PUNLOCK (MTC,MTCELOCK) unlock the controller 041AA EC17C803 7 BASE 221 STZ (MTC,MTCELOCK) 041AB 0C800000 221 ION 222 * \ / 223 000041AC 224 NEXT LABEL 041AC FBF64186 7 225 LJNA MTC LOOP do next controller, if any 226 * \ / 227 000041AD 228 DONE LABEL 041AD 60C40086 3 IMM 229 LD PFPTR PNCIX 041AE 80D2C000 3 REG 230 PFRC PFPTR unmap anything left here 041AF FE0E28B7 231 JMP DISPATCH and all done 232 * --- 233 234 END MTPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 869 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 236 237 ********************************************************************************** 238 * * 239 * MTPROCINT - Entry from Interrupt Handler * 240 * * 241 * We are entered here when an I/O interrupt for a tape * 242 * occurs. On entry: * 243 * * 244 * R2 = PPU status * 245 * R3 -> MTC element * 246 * CIX is mapped to the controller * 247 * Exits to DISPATCH. Unmaps CIX. * 248 * * 249 * Stack required = 5. * 250 * 0 + max ( DOTAPE (5), LOCKWAIT (0), NEWBYTECNT (1), * 251 * PROCESSINT (4), TRACEPROC (3) ) * 252 * * 253 ********************************************************************************** 254 255 BLOCK MTPROCINT routine 256 ENTRY MTPROCINT process an I/O interrupt 257 000041B0 258 MTPROCINT LABEL 041B0 61D2C000 7 3 REG 259 LD MTC R3 pointer to the MTC element 260 PLOCK (MTC,MTCELOCK) lock the controller 041B1 0CC00000 260 IOFF 041B2 D1D7C803 7 BASE 260 SETT (MTC,MTCELOCK) 041B3 FE0C41B5 260 JNE MA(2+DISPW MA 0) 041B4 DC40308B 260 CALLNP LOCKWAIT 041B5 6017C801 0 7 BASE 261 LD R0 MTC,MTCPMVALUE for trace 041B6 60401802 1 262 LD R1 CIX(PPUCHANS1) get tape controller status 263 TRACE MTTRACE,MTTINTRPT interrupt, R0=PageMap, R1=MtcStat, R2=PpuStat 041B7 5D401D30 263 XCT TRACECALL(MTTRACE) 041B8 FEC00082 263 NOP (MTTRACE*BITS 22:26)+(MTTINTRPT*BITS 27:31) 264 041B9 5C09C816 7 ZBM 265 CMZ MTC,MTCDEAD check for dead controller 041BA FE0C41C6 266 JNE RETURN jump if controller is believed to be dead 041BB F6B841C2 2 267 JBT R2/PPUIINTC CONTINT jump if controller wants interrupt 041BC F2B641BF 2 268 JBF R2/PPUIROLL NOROLL jump if not rollover interrupt 041BD 6149DF16 5 7 ZBM 269 LD MTU MTC,MTCBUSY get MTU element for busy drive 041BE DC40425E 270 CALLNP NEWBYTECNT load next byte count 271 * \ / 272 000041BF 273 NOROLL LABEL 041BF 60040800 0 IMM 274 LD R0 1*PPUICIA 041C0 E4001802 0 275 ST R0 CIX(PPUSSSTAT) re-enable the interrupts 041C1 FE0E41C6 276 JMP RETURN and return 277 * --- 278 000041C2 279 CONTINT LABEL 041C2 DC0041F3 280 CALL PROCESSINT process the interrupt 041C3 41528000 2 REG 281 PARV R2 PPU status 041C4 40524000 1 REG 282 PARVL R1 MTC status 283 041C5 DC404212 284 CALLNP DOTAPE schedule any necessary activity 285 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 870 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 286 000041C6 287 RETURN LABEL 041C6 60C40086 3 IMM 288 LD PFPTR PNCIX 041C7 80D2C000 3 REG 289 PFRC PFPTR unmap the controller 290 PUNLOCK (MTC,MTCELOCK) unlock the controller 041C8 EC17C803 7 BASE 290 STZ (MTC,MTCELOCK) 041C9 0C800000 290 ION 291 041CA FE0E28B7 292 JMP DISPATCH and we're all done 293 * --- 294 295 END MTPROCINT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 871 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 297 298 ********************************************************************************** 299 * * 300 * MT_RESET - Reset a Tape Controller * 301 * * 302 * This routine will reset and re-initialize a tape * 303 * controller. We are called at initialization, and later if * 304 * nothing has happened on the tape for a while. * 305 * * 306 * LD R5 => MTC element * 307 * PLOCK (R5,MTCELOCK) * 308 * CIX mapped to the controller * 309 * LD R0 0 if controller is dead * 310 * CALLNP MT_RESET * 311 * JMP don't log a timeout * 312 * * 313 * Eats R0:R4. * 314 * Stack required = 7. * 315 * 2 + max ( DOTAPE (5), PROCESSINT (4), TRACEPROC (3) ) * 316 * * 317 ********************************************************************************** 318 319 BLOCK MT_RESET subroutine 320 ENTRY MT_RESET 321 322 BEGFRAME 00178801 6 BASE 323 SAVER7 BSS 1 save area for R7 324 ENDFRAME 325 041CB DD5F8002 6 STAK 326 MT_RESET ENTRNP PUSH 041CC E5D78801 7 6 BASE 327 ST R7 SP,SAVER7 save this register 041CD 60520000 1 0 REG 328 LD R1 R0 R1=flag for controller alive 041CE 61D34000 7 5 REG 329 LD MTC R5 get MTC pointer 330 041CF 6017C801 0 7 BASE 331 LD R0 MTC,MTCPMVALUE for trace 332 TRACE MTTRACE,MTTRESET reset ctlr, R0=PageMap, R1=0 if cntlr dead 041D0 5D401D30 332 XCT TRACECALL(MTTRACE) 041D1 FEC00083 332 NOP (MTTRACE*BITS 22:26)+(MTTRESET*BITS 27:31) 041D2 FA4C41D6 1 333 JNEZ R1 ALIVE jump if cntlr is alive 041D3 EDC9C816 7 ZBM 334 STW MTC,MTCDEAD otherwise, mark as dead 041D4 604240C0 1 IMM 335 LD R1 1*MTSTANER+MTSTTMLOST*MTSTTMD indicate error and lost 041D5 FE0E41EC 336 JMP DOINT and process 337 * --- 338 000041D6 339 ALIVE LABEL 041D6 EC09C816 7 ZBM 340 STZ MTC,MTCDEAD mark controller as alive now 041D7 EC001801 341 STZ CIX(PPUABORT) clean up the controller 342 041D8 60040008 0 IMM 343 LD R0 MTFNDSCIOF 041D9 E4001A30 0 344 ST R0 CIX(MTCMFUNC) disable state-change interrupts 041DA D1401803 345 STMW CIX(PPUSCSTAT) clear all PPU status 346 041DB 5C09DF16 7 ZBM 347 CMZ MTC,MTCBUSY was the controller busy? 041DC FE0241DE 348 JEQ NOTBUSY jump if not 041DD D0178801 6 BASE 349 INC SP,SAVER7 else use skip return 000041DE 350 NOTBUSY LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 872 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 351 041DE 60040003 0 IMM 352 LD R0 MTCUPC-1 get count of units 000041DF 353 DRIVELOOP LABEL 041DF 615DC007 5 70 BASE 354 LD MTU MTC,MTCDRIVE(R0) get unit element pointer for next drive 041E0 FB7041E9 5 355 JZA MTU NEXTDRIVE jump if no drive here 041E1 6044000C 1 IMM 356 LD R1 MTFNDENSEL get density select function 041E2 18495A20 1 5 ZBM 357 ADD R1 MTU,MTUDENSITY select proper density function 041E3 E4601A38 1 0 358 ST R1 CIX(MTCMFUNC+MTSELECT+R0) and issue to unit 041E4 5C094021 5 ZBM 359 CMZ MTU,MTUTYPE check for type of tape (0=ct, 1=mt, 2=vt) 041E5 FE0C41E9 360 JNE NEXTDRIVE skip following for 9 track and video 041E6 60440010 1 IMM 361 LD R1 MTFNTRSEL get function for track select 041E7 18495831 1 5 ZBM 362 ADD R1 MTU,MTUTRACK make proper track select 041E8 E4601A38 1 0 363 ST R1 CIX(MTCMFUNC+MTSELECT+R0) and issue to unit 000041E9 364 NEXTDRIVE LABEL 041E9 FA2641DF 0 365 JDR R0 DRIVELOOP scan all units 041EA 60401A10 1 366 LD R1 CIX(MTLDSTAT) get current status 041EB 7C4340C0 1 IMM 367 IOR R1 1*MTSTDSC+1*MTSTANER+MTSTTMLOST*MTSTTMD indicate error and lost 368 000041EC 369 DOINT LABEL 041EC DC0041F3 370 CALL PROCESSINT process as an interrupt 041ED 41450000 IMM 371 PARV 1*PPUITOUT fake PPU status 041EE 40524000 1 REG 372 PARVL R1 fake tape status 373 041EF DC404212 374 CALLNP DOTAPE start any possible activity 375 041F0 6153C000 5 7 REG 376 LD R5 MTC restore R5 041F1 61D78801 7 6 BASE 377 LD R7 SP,SAVER7 restore return link 041F2 5D1F8002 6 STAK 378 LEAVE POP and return 379 * --- 380 381 END MT_RESET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 873 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 383 384 ********************************************************************************** 385 * * 386 * PROCESSINT - Post a Tape Interrupt * 387 * * 388 * This routine will post the interrupting status to the * 389 * drive that had the controller busy, if any. It will also * 390 * post status to all other drives if a state-change interrupt * 391 * has occurred. * 392 * * 393 * LD MTC => MTC element * 394 * CALL PROCESSINT * 395 * PARV PPU status * 396 * PARVL MTC status * 397 * * 398 * Eats R0:R5. * 399 * Stack required = 4 * 400 * * 401 ********************************************************************************** 402 403 BLOCK PROCESSINT subroutine 404 ENTRY PROCESSINT 405 406 BEGFRAME 00178801 6 BASE 407 PPUSTAT BSS 1 interrupting PPU status 00178802 6 BASE 408 TAPESTAT BSS 1 interrupting controller status 00178803 6 BASE 409 ALLSTATS BSS 1 status for all 4 drives 410 ENDFRAME 411 041F3 DD1F8004 6 STAK 412 PROCESSINT ENTR PUSH 041F4 C1578801 6 BASE 413 STPV SP,PPUSTAT interrupting PPU status 041F5 C0578802 6 BASE 414 STPVL SP,TAPESTAT interrupting tape status 041F6 E1D78800 7 6 BASE 415 EXCH R7 SP,0 get MTC pointer 416 * \ / 417 * If the bit is on for state change, we will update the drive 418 * status of all drives. 419 * \ / 041F7 60D78802 3 6 BASE 420 LD R3 SP,TAPESTAT get interrupting tape status 041F8 F2C04204 3 421 JBF R3/MTSTDSC NOCHANGE jump if no drive changed state 041F9 5C09C816 7 ZBM 422 CMZ MTC,MTCDEAD check for controller dead 041FA FE0C4204 423 JNE NOCHANGE jump if controller dead 041FB 60001A40 0 424 LD R0 CIX(MTLDDRVST) get status for all 4 drives 041FC E4178803 0 6 BASE 425 ST R0 SP,ALLSTATS save it 426 041FD 60440003 1 IMM 427 LD R1 MTCUPC-1 index through drives 041FE 38898083 2 6 ZBM 428 LEA R2 SP,ALLSTATS/BITS 0:7 R2 -> status for first drive 000041FF 429 LOOP LABEL 041FF 615DC807 5 71 BASE 430 LD MTU MTC,MTCDRIVE(R1) get MTU for a drive 04200 FB704203 5 431 JZA MTU NEXT jump if no drive here 04201 601A8C00 0 21 @R 432 LD R0 @R2(R1) get new status for this drive 04202 E409708B 0 5 ZBM 433 ST R0 MTU,MTUMTCSTAT/MTSTDRVST save it for the drive 434 * \ / 00004203 435 NEXT LABEL 04203 FA6641FF 1 436 JDR R1 LOOP loop through all drives 437 * \ / 438 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 874 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 00004204 439 NOCHANGE LABEL 440 * \ / 441 * If the controller was busy, we will save the interrupting 442 * status for the drive that was doing something. 443 * \ / 04204 6149DF16 5 7 ZBM 444 LD MTU MTC,MTCBUSY get MTU for busy device 04205 FB704210 5 445 JZA MTU NOTBUSY jump if none 04206 EC09DF16 7 ZBM 446 STZ MTC,MTCBUSY else say no longer busy 04207 60978801 2 6 BASE 447 LD R2 SP,PPUSTAT get interrupting PPU status 04208 60D78802 3 6 BASE 448 LD R3 SP,TAPESTAT get interrupting tape status 04209 E697480A 235 BASE 449 ST2 R2 MTU,MTUPPUSTAT save statuses for drive 0420A 60040000 0 IMM 450 LD R0 MTUSTRUN 0420B E4094020 0 5 ZBM 451 ST R0 MTU,MTUSTATE and set state to runnable 0420C 60095040 0 5 ZBM 452 LD R0 MTU,MTUUNIT get unit number of this guy 0420D 60161001 0 0 REG 453 LD R0 R0+1 make him last to look at 0420E 78040003 0 IMM 454 AND R0 MTUNITMASK do the MOD function 0420F E409CA36 0 7 ZBM 455 ST R0 MTC,MTCUNIT and save the number 00004210 456 NOTBUSY LABEL 457 * \ / 458 04210 E1D78800 7 6 BASE 459 EXCH R7 SP,0 restore return register 04211 5D1F8004 6 STAK 460 LEAVE POP and all done 461 * --- 462 463 END PROCESSINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 875 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 465 466 ********************************************************************************** 467 * * 468 * DOTAPE - Tape Activity Scheduler * 469 * * 470 * This routine will inspect each drive in turn, running * 471 * each one whose state is runnable. Then it will run the * 472 * first one whose state is waiting (to start a transfer). * 473 * * 474 * LD MTC => MTC element * 475 * CALLNP DOTAPE * 476 * * 477 * Eats R0:R5. * 478 * Stack required = 5. * 479 * 2 + max ( TRACEPROC (3) ) * 480 * * 481 ********************************************************************************** 482 483 BLOCK DOTAPE subroutine 484 ENTRY DOTAPE 485 486 BEGFRAME 00178801 6 BASE 487 UNIT BSS 1 current unit number to scan 488 ENDFRAME 489 04212 DD5F8002 6 STAK 490 DOTAPE ENTRNP PUSH 04213 E1D78800 7 6 BASE 491 EXCH R7 SP,0 get MTC pointer 492 * \ / 493 00004214 494 DOTAPE1 LABEL 04214 EC09DF16 7 ZBM 495 STZ MTC,MTCBUSY say no drive wants data XFER 04215 6009CA36 0 7 ZBM 496 LD R0 MTC,MTCUNIT get starting unit number 497 * \ / 498 00004216 499 DRIVELOOP LABEL 04216 E4178801 0 6 BASE 500 ST R0 SP,UNIT save current unit number 04217 615DC007 5 70 BASE 501 LD MTU MTC,MTCDRIVE(R0) get MTU element 04218 FB704235 5 502 JZA MTU DRIVENEXT jump if none 503 PFAILCHK RETURN jump if power failure 04219 5C00044E 503 CMZ POWERFLAG power-fail restart in progress? 0421A FE0C425C 503 JNE RETURN jump if so 503 PFAILEN RETURN else allow interrupt 0421B 6004425C 0 IMM 503 LD R0 ADR RETURN 0421C E400044F 0 503 ST R0 POWERUPLOC 0421D 59C40800 IMM 503 IORMSR MSRPFINTE 503 PFAILDS then disallow interrupt 0421E 59840800 IMM 503 CLBMSR MSRPFINTE 0421F EC00044F 503 STZ POWERUPLOC 04220 60094020 0 5 ZBM 504 LD R0 MTU,MTUSTATE get drive state 04221 5CA04222 0 505 LDPC STATETAB1(R0) jump depending on state 506 * --- 507 00004222 508 STATETAB1 LABEL 04222 00004226 509 ADR RUNDRIVE 0 - runnable 04223 00004232 510 ADR CHECKTRAN 1 - wait to start data transfer 04224 00004235 511 ADR DRIVENEXT 2 - transfer in progress (can't happen) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 876 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 04225 00004226 512 ADR RUNDRIVE 3 - interrupted by power failure 513 00004226 514 RUNDRIVE LABEL 04226 62D7480C 345 BASE 515 LD2 R3 MTU,MTUSAVER34 restore these registers 04227 6009C816 0 7 ZBM 516 LD R0 MTC,MTCDEAD get indicator for dead controller 04228 E397480E 675 BASE 517 EXCH2 R6 MTU,MTUSAVER67 save, restore these registers 04229 DCD74810 5 BASE 518 EXPCS MTU,MTUPC go to the drive code 519 * \ / 520 * Here, R0 = new state for drive. If new state is 521 * "transfer in progress", then R1 = timeout count. 522 * \ / 0422A E397480E 675 BASE 523 EXCH2 R6 MTU,MTUSAVER67 save, restore these registers 0422B E6D7480C 345 BASE 524 ST2 R3 MTU,MTUSAVER34 save these registers 0422C E4094020 0 5 ZBM 525 ST R0 MTU,MTUSTATE save new state 0422D 5CA0422E 0 526 LDPC STATETAB2(R0) jump depending on new state 527 * --- 528 0000422E 529 STATETAB2 LABEL 0422E 00004235 530 ADR DRIVENEXT 0 - runnable (next time) 0422F 00004232 531 ADR CHECKTRAN 1 - wait to start data transfer 04230 0000424B 532 ADR CONTBUSY 2 - transfer in progress 04231 0000425C 533 ADR RETURN 3 - interrupted by power failure 534 535 * Here, a drive wants to start a transfer. Remember it. 536 00004232 537 CHECKTRAN LABEL 04232 5C09DF16 7 ZBM 538 CMZ MTC,MTCBUSY is one already set up? 04233 FE0C4235 539 JNE DRIVENEXT if so, skip this one 04234 E549DF16 5 7 ZBM 540 ST MTU MTC,MTCBUSY else remember this one 541 * \ / 542 00004235 543 DRIVENEXT LABEL 04235 BC178801 0 6 BASE 544 INCL R0 SP,UNIT try the next unit 04236 78040003 0 IMM 545 AND R0 MTUNITMASK mask for wrap-around 04237 6409CA36 0 7 ZBM 546 CPR R0 MTC,MTCUNIT back to start? 04238 FE0C4216 547 JNE DRIVELOOP if not, scan another drive 548 * \ / 549 550 * If someone wanted to start a data transfer, do so. 551 * \ / 552 04239 6149DF16 5 7 ZBM 553 LD MTU MTC,MTCBUSY get MTU for guy to start 0423A FB704251 5 554 JZA MTU NOBUSY jump if nobody to start 555 PFAILCHK RETURN jump if power failure 0423B 5C00044E 555 CMZ POWERFLAG power-fail restart in progress? 0423C FE0C425C 555 JNE RETURN jump if so 555 PFAILEN RETURN else allow interrupt 0423D 6004425C 0 IMM 555 LD R0 ADR RETURN 0423E E400044F 0 555 ST R0 POWERUPLOC 0423F 59C40800 IMM 555 IORMSR MSRPFINTE 555 PFAILDS then disallow interrupt 04240 59840800 IMM 555 CLBMSR MSRPFINTE 04241 EC00044F 555 STZ POWERUPLOC 04242 62D7480C 345 BASE 556 LD2 R3 MTU,MTUSAVER34 restore these registers 04243 6009C816 0 7 ZBM 557 LD R0 MTC,MTCDEAD get indicator for dead controller 04244 E397480E 675 BASE 558 EXCH2 R6 MTU,MTUSAVER67 save, restore these registers 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 877 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 04245 DCD74810 5 BASE 559 EXPCS MTU,MTUPC go run the drive 560 * \ / 561 * Here, R0 is the drive's new state. Normally it will be 562 * MTUSTBUSY (data transfer in progress), but in strange 563 * cases it could be something else. If so, we must re-scan 564 * the whole controller, because someone else may have wanted 565 * to start an operation. 566 * \ / 04246 E397480E 675 BASE 567 EXCH2 R6 MTU,MTUSAVER67 save, restore these registers 04247 E6D7480C 345 BASE 568 ST2 R3 MTU,MTUSAVER34 save these registers 04248 E4094020 0 5 ZBM 569 ST R0 MTU,MTUSTATE save new state 04249 64040002 0 IMM 570 CPR R0 MTUSTBUSY did he make controller busy? 0424A FE0C4214 571 JNE DOTAPE1 jump if not (back to the top) 572 * \ / 573 0000424B 574 CONTBUSY LABEL 0424B E457C804 1 7 BASE 575 ST R1 MTC,MTCTIMEOUT time-out counter 0424C 5C09C816 7 ZBM 576 CMZ MTC,MTCDEAD check for dead controller 0424D FE0C4259 577 JNE DONE jump if dead 0424E 60040800 0 IMM 578 LD R0 1*PPUICIA 0424F E4001802 0 579 ST R0 CIX(PPUSSSTAT) allow interrupts from controller 04250 FE0E4259 580 JMP DONE and all done 581 * --- 582 00004251 583 NOBUSY LABEL nothing to make controller busy 04251 60040008 0 IMM 584 LD R0 8 allow extra time before checking again 04252 E417C804 0 7 BASE 585 ST R0 MTC,MTCTIMEOUT set time out counter 04253 5C09C816 7 ZBM 586 CMZ MTC,MTCDEAD check for dead controller 04254 FE0C4259 587 JNE DONE jump if controller dead 04255 60040009 0 IMM 588 LD R0 MTFNDSCION 04256 E4001A30 0 589 ST R0 CIX(MTCMFUNC) allow interrupts on state change 04257 60040800 0 IMM 590 LD R0 1*PPUICIA 04258 E4001802 0 591 ST R0 CIX(PPUSSSTAT) allow interrupts from controller 592 * \ / 593 00004259 594 DONE LABEL 04259 6017C801 0 7 BASE 595 LD R0 MTC,MTCPMVALUE for trace 596 TRACE MTTRACE,MTTLEAVE leaving MSPROC, R0=PageMap 0425A 5D401D30 596 XCT TRACECALL(MTTRACE) 0425B FEC00084 596 NOP (MTTRACE*BITS 22:26)+(MTTLEAVE*BITS 27:31) 597 * \ / 598 0000425C 599 RETURN LABEL 0425C E1D78800 7 6 BASE 600 EXCH R7 SP,0 restore R7 0425D 5D1F8002 6 STAK 601 LEAVE POP and return 602 * --- 603 604 END DOTAPE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 878 (MTDRIVER) F 45 Magnetic Tape Driver - Controller Scheduler 606 607 ********************************************************************************** 608 * * 609 * NEWBYTECNT - Load next byte count for data transfer. * 610 * * 611 * This subroutine will load the byte count and address * 612 * registers for the next page of a read or write transfer. * 613 * Field MTUNUBS contains the address of the UBS block that * 614 * describes the next fragment of the transfer. If there are * 615 * even more byte counts to follow, we will enable byte-count * 616 * rollover interrupts from the PPU. * 617 * * 618 * LD MTU => MTU element * 619 * CIX mapped to device * 620 * CALLNP NEWBYTECNT * 621 * * 622 * Eats R0:R1. * 623 * Stack required = 1. * 624 * * 625 ********************************************************************************** 626 627 BLOCK NEWBYTECNT subroutine 628 ENTRY NEWBYTECNT 629 630 BEGFRAME 631 ENDFRAME 632 0425E DD5F8001 6 STAK 633 NEWBYTECNT ENTRNP PUSH 0425F 60574809 1 5 BASE 634 LD R1 MTU,MTUNUBS get pointer to next UBS block 04260 FA70426A 1 635 JZA R1 RETURN jump if no next byte count 636 04261 60164801 0 1 BASE 637 LD R0 R1,UBSMAW get the memory address word 04262 E4001807 0 638 ST R0 CIX(PPUADDR2) place into the PPU 04263 60164802 0 1 BASE 639 LD R0 R1,UBSBCW get the byte count word 04264 E4001806 0 640 ST R0 CIX(PPUCNT2) place into the PPU 04265 60085F10 0 1 ZBM 641 LD R0 R1,UBSLINK get link to next UBS 04266 E4174809 0 5 BASE 642 ST R0 MTU,MTUNUBS update pointer to next one 04267 FA30426A 0 643 JZA R0 RETURN jump if no more to follow 04268 60041200 0 IMM 644 LD R0 1*PPUIINTR+1*PPUIPIA 04269 E4001802 0 645 ST R0 CIX(PPUSSSTAT) enable rollover interrupts 646 * \ / 647 0000426A 648 RETURN LABEL 0426A 5D1F8001 6 STAK 649 LEAVE POP and all done 650 * --- 651 652 END NEWBYTECNT subroutine 653 654 655 END Controller-Scheduling Section 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 879 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 658 659 BLOCK Drive Activity Section 660 661 ENTRY MTDRIVE Initial Entry Point 662 663 ********************************************************************************** 664 * * 665 * This is the drive activity section of the tape driver. * 666 * In this section we actually handle all requests for tape * 667 * I/O. When necessary, we call the controller-scheduling * 668 * section as a coroutine via "EXPCS MTU,MTUPC". * 669 * * 670 * The initial entry point for the drive section is * 671 * MTDRIVE. During initialization, the value in MTUPC for each * 672 * drive is set to the address of MTDRIVE. Thereafter, the * 673 * drive coroutine stays in its loop forever. * 674 * * 675 ********************************************************************************** 676 677 0000426B 678 TAPEERRMAX LABEL max number of retries on an error 0426B 0000000C 679 VFD 12 retries for CT 0426C 0000000C 680 VFD 12 retries for MT 0426D 00000000 681 VFD 0 retries for VT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 880 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 683 684 ********************************************************************************** 685 * * 686 * MTDRIVE - Drive Activity Process * 687 * * 688 * This is the entry point and main loop for the drive * 689 * activity process. We set up the stack, then process * 690 * requests one at a time. * 691 * * 692 * On entry, MTU -> our MTU element. No other registers * 693 * defined. We alter R0:R4,R6:R7. Since we never return, this * 694 * doesn't matter. * 695 * * 696 * Stack required = 9. We use MTUSTACK, maximum stack size = 15. * 697 * 0 + max ( DOBKSP ( 7), DOCYCLE ( 7), DOFWSP ( 7), * 698 * DOGAP ( 4), DOREAD ( 9), DOSEFB ( 9), * 699 * DOSEFF ( 9), DOSETPARM ( 7), DOWFM ( 9), * 700 * DOWRITE ( 9), LOCKWAIT ( 0), REWNOWAIT ( 8), * 701 * TAPENOTRDY ( 8), WAKEUPUSER( 5) ) * 702 * * 703 ********************************************************************************** 704 705 BLOCK MTDRIVE routine 706 ENTRY MTDRIVE 707 0000426E 708 MTDRIVE LABEL 0426E 39974820 6 5 BASE 709 LEA SP MTU,MTUSTACK initialize our stack pointer 710 * \ / 711 0000426F 712 OFFLINE LABEL 0426F DC404433 713 CALLNP TAPENOTRDY wait for tape to become ready 714 * \ / 715 00004270 716 LOOP LABEL 717 PLOCK MTREQLOCK lock to get request 04270 0CC00000 717 IOFF 04271 D1C01F20 717 SETT MTREQLOCK 04272 FE0C4274 717 JNE MA(2+DISPW MA 0) 04273 DC40308B 717 CALLNP LOCKWAIT 04274 60574008 1 5 CACH 718 LD R1 MTU,MTUREQUEST get the request code 04275 EC174008 5 CACH 719 STZ MTU,MTUREQUEST say we got it 720 PUNLOCK MTREQLOCK unlock the request lock 04276 EC001F20 720 STZ MTREQLOCK 04277 0C800000 720 ION 04278 FA42427E 1 721 JEQZ R1 NOREQUEST jump if none 04279 60224283 0 1 722 LD R0 ROUTINE(R1) get address of routine to execute 0427A DC560400 0 @R 723 CALLNP @R0 do the request 0427B FA2C4280 0 724 JEQMW R0 TRYAGAIN jump if no wakeup wanted 0427C DC40445D 725 CALLNP WAKEUPUSER and wake up the requester 0427D FE0E4280 726 JMP TRYAGAIN and go try again 727 * --- 728 0000427E 729 NOREQUEST LABEL 0427E 60040000 0 IMM 730 LD R0 MTUSTRUN new state: runnable (next time) 0427F DCD74810 5 BASE 731 EXPCS MTU,MTUPC and go back to controller scheduler 732 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 881 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 733 00004280 734 TRYAGAIN LABEL 04280 6017480B 0 5 BASE 735 LD R0 MTU,MTUMTCSTAT get current status 04281 F6344270 0 736 JBT R0/MTDSTRDY LOOP jump if tape is ready 04282 FE0E426F 737 JMP OFFLINE else do the offline stuff again 738 * --- 739 00004283 740 ROUTINE LABEL request codes 04283 00000000 741 VFD 0 00 - never used 04284 00004406 742 ADR REWNOWAIT 01 - rewind tape 04285 00004367 743 ADR DOSEFF 02 - skip file forward 04286 00004350 744 ADR DOSEFB 03 - skip file backward 04287 000042B5 745 ADR DOFWSP 04 - forward space record 04288 0000428F 746 ADR DOBKSP 05 - back space record 04289 000042EC 747 ADR DOREAD 06 - read record 0428A 000043B2 748 ADR DOWRITE 07 - write record 0428B 00004398 749 ADR DOWFM 08 - write filemark 0428C 000042C6 750 ADR DOGAP 09 - write gap 0428D 0000437D 751 ADR DOSETPARM 10 - select track and density 0428E 000042A1 752 ADR DOCYCLE 11 - cycle cartridge tape 753 754 END MTDRIVE routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 882 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 756 757 ********************************************************************************** 758 * * 759 * DOBKSP - Back Space One Record * 760 * * 761 * LD MTU => MTU element * 762 * CALLNP DOBKSP * 763 * ST R0 error code (0 if ok) * 764 * * 765 * Eats R0:R4. * 766 * Stack required = 7 * 767 * 1 + TAPEFUNC (6). * 768 * * 769 ********************************************************************************** 770 771 BLOCK DOBKSP subroutine 772 ENTRY DOBKSP 773 774 BEGFRAME 775 ENDFRAME 776 0428F DD5F8001 6 STAK 777 DOBKSP ENTRNP PUSH 04290 60494021 1 5 ZBM 778 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 04291 6122426B 4 1 779 LD R4 TAPEERRMAX(R1) retry count 00004292 780 LOOP LABEL 04292 DC00440C 781 CALL TAPEFUNC request a backspace 04293 41440006 IMM 782 PARV MTFNBKSP operation code 04294 60494021 1 5 ZBM 783 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 04295 4062429E 1 784 PARVL TIMEOUT(R1) timeout value 04296 FA0C429B 0 785 JNEZ R0 RETURN jump if error 04297 F652429B 1 786 JBT R1/MTSTTMBKB RETURN jump if tape moved backward 04298 F676429B 1 787 JBT R1/MTDSTBOT RETURN jump if at load point 04299 FB224292 4 788 DRJ R4 LOOP else try again (several times) 789 * \ / fall through when retries exhausted 790 0429A 60040089 0 IMM 791 LD R0 XREQERFAU error: abnormal/unavailable 792 * \ / 793 0000429B 794 RETURN LABEL 0429B 6049501B 1 5 ZBM 795 LD R1 MTU,MTUMTCSTAT/MTSTEOF 0429C E4495810 1 5 ZBM 796 ST R1 MTU,MTUEOF 0429D 5D1F8001 6 STAK 797 LEAVE POP return to caller 798 * --- 799 042A0 00000100 800 TIMEOUT VFD 2,1,256 backspace timeouts for CT, MT, VT 801 802 END DOBKSP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 883 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 804 805 ********************************************************************************** 806 * * 807 * DOCYCLE - Cycle a cartridge tape * 808 * * 809 * LD MTU => MTU element * 810 * CALLNP DOCYCLE * 811 * ST R0 error code (0 if ok) * 812 * * 813 * Eats R0:R4. * 814 * Stack required = 7 * 815 * 1 + TAPEFUNC (6). * 816 * * 817 ********************************************************************************** 818 819 BLOCK DOCYCLE subroutine 820 ENTRY DOCYCLE 821 822 BEGFRAME 823 ENDFRAME 824 042A1 DD5F8001 6 STAK 825 DOCYCLE ENTRNP PUSH 042A2 60094021 0 5 ZBM 826 LD R0 MTU,MTUTYPE get tape type 042A3 FA0C42AE 0 827 JNEZ R0 DOCYCILOP illegal operation if MT or video 042A4 6120426B 4 0 828 LD R4 TAPEERRMAX(R0) retry counter 829 * \ / 000042A5 830 LOOP LABEL 042A5 DC00440C 831 CALL TAPEFUNC request tape to cycle 042A6 41440001 IMM 832 PARV MTFNCYCLE operation code 042A7 404042B4 833 PARVL TIMEOUT timeout value 042A8 FA0C42B3 0 834 JNEZ R0 RETURN jump if error 042A9 F27442B0 1 835 JBF R1/MTDSTRDY OFFLINE jump if drive went offline 042AA F67642B2 1 836 JBT R1/MTDSTBOT OKSTAT jump if at load point 042AB FB2642A5 4 837 JDR R4 LOOP fall through when retries exhausted 838 * \ / 839 042AC 60040089 0 IMM 840 LD R0 XREQERFAU error: abnormal/unavailable 042AD FE0E42B3 841 JMP RETURN inform caller 842 * --- 843 000042AE 844 DOCYCILOP LABEL 042AE 60040091 0 IMM 845 LD R0 XREQERILOP error: illegal operation on device 042AF FE0E42B3 846 JMP RETURN return to caller 847 * --- 848 000042B0 849 OFFLINE LABEL 042B0 600400AE 0 IMM 850 LD R0 XREQERDNR error: device not ready 042B1 FE0E42B3 851 JMP RETURN return to caller 852 * --- 853 000042B2 854 OKSTAT LABEL 042B2 EC120000 0 REG 855 STZ R0 indicate all went well 856 * \ / 857 000042B3 858 RETURN LABEL 042B3 5D1F8001 6 STAK 859 LEAVE POP exit this mess 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 884 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 860 * --- 861 042B4 00000042 862 TIMEOUT VFD 042 7 minutes max 863 864 END DOCYCLE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 885 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 866 867 ********************************************************************************** 868 * * 869 * DOFWSP - Forward Space One Record * 870 * * 871 * LD MTU => MTU element * 872 * CALLNP DOFWSP * 873 * ST R0 error code (0 if OK) * 874 * * 875 * Eats R0:R4. * 876 * Stack required = 7 * 877 * 1 + TAPEFUNC (6). * 878 * * 879 ********************************************************************************** 880 881 BLOCK DOFWSP subroutine 882 ENTRY DOFWSP 883 884 BEGFRAME 885 ENDFRAME 886 042B5 DD5F8001 6 STAK 887 DOFWSP ENTRNP PUSH 042B6 60494021 1 5 ZBM 888 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 042B7 6122426B 4 1 889 LD R4 TAPEERRMAX(R1) retry counter 890 * \ / 000042B8 891 LOOP LABEL 042B8 DC00440C 892 CALL TAPEFUNC request a forward space 042B9 41440007 IMM 893 PARV MTFNFWSP operation code 042BA 60494021 1 5 ZBM 894 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 042BB 406242C3 1 895 PARVL TIMEOUT(R1) timeout value 042BC FA0C42C0 0 896 JNEZ R0 RETURN jump if error 042BD F65442C0 1 897 JBT R1/MTSTTMFWB RETURN jump if tape moved forward 042BE FB2642B8 4 898 JDR R4 LOOP else try again (several times) 899 * \ / fall through when retries exhausted 900 042BF 60040089 0 IMM 901 LD R0 XREQERFAU error: abnormal/unavailable 902 * \ / 903 000042C0 904 RETURN LABEL 042C0 6049501B 1 5 ZBM 905 LD R1 MTU,MTUMTCSTAT/MTSTEOF 042C1 E4495810 1 5 ZBM 906 ST R1 MTU,MTUEOF 042C2 5D1F8001 6 STAK 907 LEAVE POP return to caller 908 * --- 909 042C5 0000000C 910 TIMEOUT VFD 2,1,12 forward space timeouts for CT, MT, VT 911 912 END DOFWSP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 886 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 914 915 ********************************************************************************** 916 * * 917 * DOGAP - Erase a Gap * 918 * * 919 * LD MTU => MTU element * 920 * CALLNP DOGAP * 921 * ST R0 error code (0 if OK) * 922 * * 923 * Eats R0:R4. * 924 * Stack required = 4 * 925 * 1 + max ( ERRORLOG (3), TRACEPROC (3) ) * 926 * * 927 ********************************************************************************** 928 929 BLOCK DOGAP subroutine 930 ENTRY DOGAP 931 932 BEGFRAME 933 ENDFRAME 934 042C6 DD5F8001 6 STAK 935 DOGAP ENTRNP PUSH 042C7 60094021 0 5 ZBM 936 LD R0 MTU,MTUTYPE R0 = 0 if CT, 1 if MT, 2 if video 042C8 6120426B 4 0 937 LD R4 TAPEERRMAX(R0) retry counter 000042C9 938 LOOP LABEL 042C9 60040001 0 IMM 939 LD R0 MTUSTWAIT new state: wait our turn 042CA DCD74810 5 BASE 940 EXPCS MTU,MTUPC go back to controller scheduler 042CB FA0C42E3 0 941 JNEZ R0 ERROR jump if controller is dead 042CC 60095040 0 5 ZBM 942 LD R0 MTU,MTUUNIT get our unit number 042CD 60440260 1 IMM 943 LD R1 MTCMERASE operation code (for trace) 042CE 60840003 2 IMM 944 LD R2 3 parameter (number of inches) 945 TRACE MTTRACE,MTTFUNC function: R0=Unit, R1=Address, R2=Parm 042CF 5D401D30 945 XCT TRACECALL(MTTRACE) 042D0 FEC00085 945 NOP (MTTRACE*BITS 22:26)+(MTTFUNC*BITS 27:31) 946 * \ / 042D1 E4A01AE8 2 0 947 ST R2 CIX(MTCMERASE+MTINTREQ+MTSELECT+R0) start the erase gap 042D2 60040002 0 IMM 948 LD R0 MTUSTBUSY new state: busy with transfer 042D3 60440001 1 IMM 949 LD R1 1 timeout counter 042D4 DCD74810 5 BASE 950 EXPCS MTU,MTUPC go back to controller scheduler 951 * \ / 042D5 6057480B 1 5 BASE 952 LD R1 MTU,MTUMTCSTAT get new tape status 042D6 784042EB 1 953 AND R1 STATMASK mask off all but error bits 042D7 FA4242DE 1 954 JEQZ R1 NOERROR jump if no error 042D8 DC005048 955 CALL ERRORLOG else log the error 042D9 4144122F IMM 956 PARV ERLCMTCERR mag tape error 042DA 41574804 5 BASE 957 PARV MTU,MTUNAME tape drive name 042DB 41440260 IMM 958 PARV MTCMERASE operation 042DC 4157480B 5 BASE 959 PARV MTU,MTUMTCSTAT tape status 042DD 4057480A 5 BASE 960 PARVL MTU,MTUPPUSTAT PPU status 961 * \ / 000042DE 962 NOERROR LABEL 042DE 6057480B 1 5 BASE 963 LD R1 MTU,MTUMTCSTAT get the status again 042DF F24442E9 1 964 JBF R1/MTSTANER OKSTAT jump if operation was OK 042E0 F27442E7 1 965 JBF R1/MTDSTRDY OFFLINE jump if drive went offline 042E1 F67842E5 1 966 JBT R1/MTDSTWPRT PROTECTED jump if drive is write-protected 042E2 FB2642C9 4 967 JDR R4 LOOP else retry as many times as allowed 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 887 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 968 * \ / 000042E3 969 ERROR LABEL 042E3 60040089 0 IMM 970 LD R0 XREQERFAU then error: abnormal/unavailable 042E4 FE0E42EA 971 JMP RETURN and return 972 * --- 973 000042E5 974 PROTECTED LABEL 042E5 60040084 0 IMM 975 LD R0 XREQERPFM error: protected from modification 042E6 FE0E42EA 976 JMP RETURN 977 * --- 978 000042E7 979 OFFLINE LABEL 042E7 600400AE 0 IMM 980 LD R0 XREQERDNR error: drive not ready 042E8 FE0E42EA 981 JMP RETURN 982 * --- 983 000042E9 984 OKSTAT LABEL 042E9 60040000 0 IMM 985 LD R0 0 no error 986 * \ / 987 000042EA 988 RETURN LABEL 042EA 5D1F8001 6 STAK 989 LEAVE POP return to caller 990 * --- 991 042EB 201F0000 992 STATMASK VFD 1*MTSTANER+ONEBITS/MTSTERSTAT*MTSTERSTAT 993 994 END DOGAP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 888 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 996 997 ********************************************************************************** 998 * * 999 * DOREAD - Read a Record from the Tape * 1000 * * 1001 * This routine assumes that MTUUBS points to the chain * 1002 * of UBS elements describing the user's buffer. It will set * 1003 * MTURECLEN to the length of the record read, and MTUEOF to * 1004 * indicate whether a tape mark was read. * 1005 * * 1006 * LD MTU => MTU element * 1007 * CALLNP DOREAD * 1008 * ST R0 error code (0 if OK) * 1009 * * 1010 * Eats R0:R4. * 1011 * Stack required = 9. * 1012 * 2 + max ( DOBKSP (7), ERRORLOG (3), PADEXT (2), * 1013 * TRACEPROC (3) ) * 1014 * * 1015 ********************************************************************************** 1016 1017 BLOCK DOREAD subroutine 1018 ENTRY DOREAD 1019 1020 BEGFRAME 00178801 6 BASE 1021 RETRYCOUNT BSS 1 retry counter 1022 ENDFRAME 1023 042EC DD5F8002 6 STAK 1024 DOREAD ENTRNP PUSH 042ED 60094021 0 5 ZBM 1025 LD R0 MTU,MTUTYPE R0 = 0 if CT, 1 if MT, 2 if video 042EE 6020426B 0 0 1026 LD R0 TAPEERRMAX(R0) retry count 042EF E4178801 0 6 BASE 1027 ST R0 SP,RETRYCOUNT initialize retry counter 1028 * \ / 000042F0 1029 LOOP LABEL 042F0 60040001 0 IMM 1030 LD R0 MTUSTWAIT new state: wait for our turn 042F1 DCD74810 5 BASE 1031 EXPCS MTU,MTUPC go back to controller scheduler 042F2 FA0C431F 0 1032 JNEZ R0 ERROR jump if controller is dead 1033 * \ / 042F3 60040001 0 IMM 1034 LD R0 1*PPUIDMAD 042F4 E4001803 0 1035 ST R0 CIX(PPUSCSTAT) set DMA to input 042F5 DC4043F5 1036 CALLNP PADEXT set up DMA registers 1037 * \ / 042F6 60095040 0 5 ZBM 1038 LD R0 MTU,MTUUNIT our unit number 042F7 60440240 1 IMM 1039 LD R1 MTCMREAD for trace 042F8 60974807 2 5 BASE 1040 LD R2 MTU,MTUREQLEN get requested read length 1041 TRACE MTTRACE,MTTFUNC function, R0=Unit, R1=Address, R2=Data 042F9 5D401D30 1041 XCT TRACECALL(MTTRACE) 042FA FEC00085 1041 NOP (MTTRACE*BITS 22:26)+(MTTFUNC*BITS 27:31) 1042 * \ / 042FB E4A01AC8 2 0 1043 ST R2 CIX(MTCMREAD+MTINTREQ+MTSELECT+R0) start the read 1044 * \ / 042FC 60094021 0 5 ZBM 1045 LD R0 MTU,MTUTYPE R0 = 0 if CT, 1 if MT, 2 if VT 042FD 60604327 1 0 1046 LD R1 TIMEOUT(R0) timeout value 042FE 60040002 0 IMM 1047 LD R0 MTUSTBUSY new state: busy with transfer 042FF DCD74810 5 BASE 1048 EXPCS MTU,MTUPC go back to controller scheduler 1049 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 889 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 04300 FA0C431F 0 1050 JNEZ R0 ERROR jump if controller is dead 04301 60001803 0 1051 LD R0 CIX(PPUCHANS2) R0 = length actually read 04302 E4174806 0 5 BASE 1052 ST R0 MTU,MTURECLEN save it 1053 * \ / 04303 6009501B 0 5 ZBM 1054 LD R0 MTU,MTUMTCSTAT/MTSTEOF R0 = eof flag 04304 E4095810 0 5 ZBM 1055 ST R0 MTU,MTUEOF save it 04305 FA024307 0 1056 JEQZ R0 NOTEOF jump if not an EOF 04306 EC174806 5 BASE 1057 STZ MTU,MTURECLEN if EOF, set record length to zero 1058 * \ / 00004307 1059 NOTEOF LABEL 04307 6217480A 015 BASE 1060 LD2 R0 MTU,MTUPPUSTAT get PPU and tape status 04308 7A00432A 01 1061 AND2 R0 STATMASK look at error bits 04309 FA124325 01 1062 JEQZ2 R0 OKSTAT jump if no errors 0430A DC005048 1063 CALL ERRORLOG else log the error 0430B 4144122F IMM 1064 PARV ERLCMTCERR tape error 0430C 41574804 5 BASE 1065 PARV MTU,MTUNAME drive name 0430D 41440240 IMM 1066 PARV MTCMREAD operation 0430E 4157480B 5 BASE 1067 PARV MTU,MTUMTCSTAT tape status 0430F 4057480A 5 BASE 1068 PARVL MTU,MTUPPUSTAT PPU status 1069 * \ / 04310 6217480A 015 BASE 1070 LD2 R0 MTU,MTUPPUSTAT get PPU and tape status 04311 7800432A 0 1071 AND R0 STATMASK mask the PPU status 04312 FA0C4314 0 1072 JNEZ R0 NOTGOOD jump if PPU is unhappy 04313 F2444325 1 1073 JBF R1/MTSTANER OKSTAT jump if tape recovered from error 1074 * \ / 00004314 1075 NOTGOOD LABEL 04314 EC001801 1076 STZ CIX(PPUABORT) make the PPU happy 04315 F2744323 1 1077 JBF R1/MTDSTRDY OFFLINE jump if drive not ready 04316 D0578801 6 BASE 1078 DEC SP,RETRYCOUNT tried one more time 04317 FE084321 1079 JLT READERROR jump if error is permanent 04318 600A5220 0 1 CBM 1080 LD R0 R1/MTSTTMD get tape motion bits 04319 FA0242F0 0 1081 JEQZ R0 LOOP just retry if the tape didn't move 0431A 64040001 0 IMM 1082 CPR R0 MTSTTMFW did the tape move forward? 0431B FE0C431F 1083 JNE ERROR if not, can't recover 0431C DC40428F 1084 CALLNP DOBKSP else backspace the tape 0431D FA0C4326 0 1085 JNEZ R0 RETURN jump if can't backspace 0431E FE0E42F0 1086 JMP LOOP then try the read again 1087 * --- 1088 0000431F 1089 ERROR LABEL 0431F 60040089 0 IMM 1090 LD R0 XREQERFAU error: abnormal/unavailable 04320 FE0E4326 1091 JMP RETURN 1092 * --- 1093 00004321 1094 READERROR LABEL 04321 600400E3 0 IMM 1095 LD R0 DEVERTRE error: tape read error 04322 FE0E4326 1096 JMP RETURN 1097 * --- 1098 00004323 1099 OFFLINE LABEL 04323 600400AE 0 IMM 1100 LD R0 XREQERDNR error: drive not ready 04324 FE0E4326 1101 JMP RETURN 1102 * --- 1103 00004325 1104 OKSTAT LABEL 04325 60040000 0 IMM 1105 LD R0 0 no error 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 890 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1106 * \ / 1107 00004326 1108 RETURN LABEL 04326 5D1F8002 6 STAK 1109 LEAVE POP return to caller 1110 * --- 1111 04329 00000009 1112 TIMEOUT VFD 3,3,9 read timeouts for CT, MT, VT 1113 0000432A 1114 STATMASK LABEL 0432A 00012540 1115 VFD 1*PPUITOUT+1*PPUIBCNR+1*PPUIMPE+1*PPUICONF+1*PPUIDPPE 0432B 201F0000 1116 VFD 1*MTSTANER+ONEBITS/MTSTERSTAT*MTSTERSTAT 1117 1118 END DOREAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 891 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1120 1121 ********************************************************************************** 1122 * * 1123 * DOREWIND - Rewind the Tape * 1124 * * 1125 * LD MTU => MTU element * 1126 * CALLNP DOREWIND * 1127 * ST R0 error code (0 if OK) * 1128 * * 1129 * Eats R0:R4. * 1130 * Stack required = 7 * 1131 * 1 + max ( TAPEFUNC (6), TRACEPROC (3) ) * 1132 * * 1133 ********************************************************************************** 1134 1135 BLOCK DOREWIND subroutine 1136 ENTRY DOREWIND 1137 1138 BEGFRAME 1139 ENDFRAME 1140 0432C DD5F8001 6 STAK 1141 DOREWIND ENTRNP PUSH 0432D EC095810 5 ZBM 1142 STZ MTU,MTUEOF no EOF yet 0432E 60C94021 3 5 ZBM 1143 LD R3 MTU,MTUTYPE R3 = 0 if CT, 1 if MT, 2 if VT 0432F 6126426B 4 3 1144 LD R4 TAPEERRMAX(R3) retry counter 1145 * \ / 00004330 1146 LOOP LABEL 04330 60095F11 0 5 ZBM 1147 LD R0 MTU,MTUCNTL get pointer to MTC element 04331 5C080816 0 ZBM 1148 CMZ R0,MTCDEAD check for dead controller 04332 FE0C4347 1149 JNE ERROR jump if controller dead 04333 F2FE4341 3 1150 JBF R3/BIT 31 REWINDCT jump if not MT 1151 * \ / 1152 * Rewind a MT, this does not tie up the controller. 1153 * \ / 04334 60095040 0 5 ZBM 1154 LD R0 MTU,MTUUNIT R0 = our unit number 04335 60440230 1 IMM 1155 LD R1 MTCMFUNC for trace 04336 60840002 2 IMM 1156 LD R2 MTFNREWIND R2 = function code 1157 TRACE MTTRACE,MTTFUNC function, R0=Unit, R1=location, R2=value 04337 5D401D30 1157 XCT TRACECALL(MTTRACE) 04338 FEC00085 1157 NOP (MTTRACE*BITS 22:26)+(MTTFUNC*BITS 27:31) 04339 E4A01A38 2 0 1158 ST R2 CIX(MTCMFUNC+MTSELECT+R0) start the rewind 0433A 6066434D 1 3 1159 LD R1 TIMEOUT(R3) get timeout value 1160 * \ / 0000433B 1161 WAIT LABEL 0433B 60040000 0 IMM 1162 LD R0 MTUSTRUN new state: runnable (next time) 0433C DCD74810 5 BASE 1163 EXPCS MTU,MTUPC go back to controller-scheduler 0433D FA0C4347 0 1164 JNEZ R0 ERROR jump if controller dead 0433E 6057480B 1 5 BASE 1165 LD R1 MTU,MTUMTCSTAT get new tape status 0433F F67A433B 1 1166 JBT R1/MTDSTBREW WAIT jump if busy rewinding 04340 FE0E4344 1167 JMP DONEREW else go check status 1168 * --- 1169 00004341 1170 REWINDCT LABEL here to rewind a CT or VT 04341 DC00440C 1171 CALL TAPEFUNC request the rewind 04342 41440002 IMM 1172 PARV MTFNREWIND code for rewind 04343 4066434D 3 1173 PARVL TIMEOUT(R3) timeout counter 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 892 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1174 * \ / 00004344 1175 DONEREW LABEL 04344 F2744349 1 1176 JBF R1/MTDSTRDY OFFLINE jump if tape is offline 04345 F676434B 1 1177 JBT R1/MTDSTBOT OKSTAT jump if at load point 04346 FB264330 4 1178 JDR R4 LOOP else retry as allowed 1179 * \ / 00004347 1180 ERROR LABEL 04347 60040089 0 IMM 1181 LD R0 XREQERFAU then error: abnormal/unavailable 04348 FE0E434C 1182 JMP RETURN 1183 * --- 1184 00004349 1185 OFFLINE LABEL 04349 600400AE 0 IMM 1186 LD R0 XREQERDNR error: drive not ready 0434A FE0E434C 1187 JMP RETURN 1188 * --- 1189 0000434B 1190 OKSTAT LABEL 0434B 60040000 0 IMM 1191 LD R0 0 no error 1192 * \ / 0000434C 1193 RETURN LABEL 0434C 5D1F8001 6 STAK 1194 LEAVE POP return to caller 1195 * --- 1196 0434F 00000060 1197 TIMEOUT VFD 48,48,96 rewind timeouts for CT, MT, VT 1198 1199 END DOREWIND subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 893 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1201 1202 ********************************************************************************** 1203 * * 1204 * DOSEFB - Seek End of File Backward * 1205 * * 1206 * LD MTU => MTU element * 1207 * CALLNP DOSEFB * 1208 * ST R0 error code (0 if OK) * 1209 * * 1210 * Eats R0:R4. * 1211 * Stack required = 9 * 1212 * 2 + max ( DOFWSP (7), TAPEFUNC (6) ). * 1213 * * 1214 ********************************************************************************** 1215 1216 BLOCK DOSEFB subroutine 1217 ENTRY DOSEFB 1218 1219 BEGFRAME 00178801 6 BASE 1220 RETRYCOUNT BSS 1 retry counter 1221 ENDFRAME 1222 04350 DD5F8002 6 STAK 1223 DOSEFB ENTRNP PUSH 04351 60494021 1 5 ZBM 1224 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 04352 6022426B 0 1 1225 LD R0 TAPEERRMAX(R1) retry counter 04353 E4178801 0 6 BASE 1226 ST R0 SP,RETRYCOUNT save it 1227 * \ / 00004354 1228 LOOP LABEL 04354 DC00440C 1229 CALL TAPEFUNC request a skip file backward 04355 41440004 IMM 1230 PARV MTFNSEFB operation code 04356 60494021 1 5 ZBM 1231 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 04357 40624364 1 1232 PARVL TIMEOUT(R1) timeout value 04358 FA0C4362 0 1233 JNEZ R0 RETURN jump if error 04359 F2444362 1 1234 JBF R1/MTSTANER RETURN jump if no error occurred 0435A F6764362 1 1235 JBT R1/MTDSTBOT RETURN jump if at load point 0435B D0578801 6 BASE 1236 DEC SP,RETRYCOUNT one fewer retry allowed 0435C FE084361 1237 JLT ERROR jump if permanent error 0435D F2524354 1 1238 JBF R1/MTSTTMBKB LOOP just retry if tape did not move backward 0435E DC4042B5 1239 CALLNP DOFWSP else forward space over problem 0435F FA0C4362 0 1240 JNEZ R0 RETURN jump if couldn't even do that 04360 FE0E4354 1241 JMP LOOP else retry the SEFB 1242 * --- 1243 00004361 1244 ERROR LABEL 04361 60040089 0 IMM 1245 LD R0 XREQERFAU error: abnormal/unavailable 1246 * \ / 00004362 1247 RETURN LABEL 04362 EDC95810 5 ZBM 1248 STW MTU,MTUEOF 04363 5D1F8002 6 STAK 1249 LEAVE POP return to caller 1250 * --- 1251 04366 0000007D 1252 TIMEOUT VFD 48,78,125 SEFB timeouts for CT, MT, VT 1253 1254 END DOSEFB subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 894 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1256 1257 ********************************************************************************** 1258 * * 1259 * DOSEFF - Seek End of File Forward * 1260 * * 1261 * LD MTU => MTU element * 1262 * CALLNP DOSEFF * 1263 * ST R0 error code (0 if OK) * 1264 * * 1265 * Eats R0:R4. * 1266 * Stack required = 9 * 1267 * 2 + max ( DOBKSP (7), TAPEFUNC (6) ). * 1268 * * 1269 ********************************************************************************** 1270 1271 BLOCK DOSEFF subroutine 1272 ENTRY DOSEFF 1273 1274 BEGFRAME 00178801 6 BASE 1275 RETRYCOUNT BSS 1 retry counter 1276 ENDFRAME 1277 04367 DD5F8002 6 STAK 1278 DOSEFF ENTRNP PUSH 04368 60494021 1 5 ZBM 1279 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 04369 6022426B 0 1 1280 LD R0 TAPEERRMAX(R1) retry counter 0436A E4178801 0 6 BASE 1281 ST R0 SP,RETRYCOUNT save it 1282 * \ / 0000436B 1283 LOOP LABEL 0436B DC00440C 1284 CALL TAPEFUNC request a skip file forward 0436C 41440005 IMM 1285 PARV MTFNSEFF operation code 0436D 60494021 1 5 ZBM 1286 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if video 0436E 4062437A 1 1287 PARVL TIMEOUT(R1) timeout value 0436F FA0C4378 0 1288 JNEZ R0 RETURN jump if error 04370 F2444378 1 1289 JBF R1/MTSTANER RETURN jump if no error occurred 04371 D0578801 6 BASE 1290 DEC SP,RETRYCOUNT one fewer retry allowed 04372 FE084377 1291 JLT ERROR jump if permanent error 04373 F254436B 1 1292 JBF R1/MTSTTMFWB LOOP just retry if tape did not move forward 04374 DC40428F 1293 CALLNP DOBKSP else backspace over problem 04375 FA0C4378 0 1294 JNEZ R0 RETURN jump if couldn't even do that 04376 FE0E436B 1295 JMP LOOP else retry the SEFF 1296 * --- 1297 00004377 1298 ERROR LABEL 04377 60040089 0 IMM 1299 LD R0 XREQERFAU error: abnormal/unavailable 1300 * \ / 1301 00004378 1302 RETURN LABEL 04378 EDC95810 5 ZBM 1303 STW MTU,MTUEOF 04379 5D1F8002 6 STAK 1304 LEAVE POP return to caller 1305 * --- 1306 0437C 0000007D 1307 TIMEOUT VFD 48,78,125 SEFF timeouts for CT, MT, VT 1308 1309 END DOSEFF subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 895 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1311 1312 ********************************************************************************** 1313 * * 1314 * DOSETPARM - Select Track and Density * 1315 * * 1316 * This routine will select a density, and if CT, a * 1317 * track. * 1318 * * 1319 * LD MTU => MTU element * 1320 * CALLNP DOSETPARM * 1321 * ST R0 error code (0 if OK) * 1322 * * 1323 * Eats R0:R4. * 1324 * Stack required = 7 * 1325 * 1 + max (TAPEFUNC (6) ). * 1326 * * 1327 ********************************************************************************** 1328 1329 BLOCK DOSETPARM subroutine 1330 ENTRY DOSETPARM 1331 1332 BEGFRAME 1333 ENDFRAME 1334 0437D DD5F8001 6 STAK 1335 DOSETPARM ENTRNP PUSH 0437E EC0BC010 7 CBM 1336 STZ R7/BIT 0 flag no error 0437F 60095A20 0 5 ZBM 1337 LD R0 MTU,MTUDENSITY get requested density 04380 DC00440C 1338 CALL TAPEFUNC select the density 04381 4156100C 0 REG 1339 PARV R0+MTFNDENSEL indicate the operation 04382 40440001 IMM 1340 PARVL 1 and timeout counter 04383 F2444389 1 1341 JBF R1/MTSTANER DENSITYOK jump if density selected okay 04384 EDCBC010 7 CBM 1342 STW R7/BIT 0 say an error occurred 04385 EC095A20 5 ZBM 1343 STZ MTU,MTUDENSITY reset to low density 04386 DC00440C 1344 CALL TAPEFUNC and issue that function 04387 4144000C IMM 1345 PARV MTFNDENSEL (select low density) 04388 40440001 IMM 1346 PARVL 1 timeout counter 00004389 1347 DENSITYOK LABEL 04389 5C094021 5 ZBM 1348 CMZ MTU,MTUTYPE is this an MT or video? 0438A FE0C4395 1349 JNE TRACKOK MTs and VTs don't have track select 0438B 60095831 0 5 ZBM 1350 LD R0 MTU,MTUTRACK get the track number 0438C DC00440C 1351 CALL TAPEFUNC issue the function 0438D 41561010 0 REG 1352 PARV R0+MTFNTRSEL operation 0438E 40440001 IMM 1353 PARVL 1 time-out counter 0438F F2444395 1 1354 JBF R1/MTSTANER TRACKOK jump if it worked 04390 EDCBC010 7 CBM 1355 STW R7/BIT 0 else, say that an error occurred 04391 EC095831 5 ZBM 1356 STZ MTU,MTUTRACK and reset to track zero 04392 DC00440C 1357 CALL TAPEFUNC issue that function 04393 41440010 IMM 1358 PARV MTFNTRSEL (select track 0) 04394 40440001 IMM 1359 PARVL 1 timeout counter 00004395 1360 TRACKOK LABEL 04395 600BC010 0 7 CBM 1361 LD R0 R7/BIT 0 get the error flag 04396 1C040082 0 IMM 1362 MUL R0 XREQERPOB possible error code, param out of bounds 04397 5D1F8001 6 STAK 1363 LEAVE POP and all done 1364 * --- 1365 1366 END DOSETPARM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 896 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1368 1369 ********************************************************************************** 1370 * * 1371 * DOWFM - Write File Mark * 1372 * * 1373 * LD MTU => MTU element * 1374 * CALLNP DOWFM * 1375 * ST R0 error code (0 if OK) * 1376 * * 1377 * Eats R0:R4. * 1378 * Stack required = 9 * 1379 * 2 + max ( DOBKSP (7), DOGAP (4), TAPEFUNC (6) ). * 1380 * * 1381 ********************************************************************************** 1382 1383 BLOCK DOWFM subroutine 1384 ENTRY DOWFM 1385 1386 BEGFRAME 00178801 6 BASE 1387 RETRYCOUNT BSS 1 retry counter 1388 ENDFRAME 1389 04398 DD5F8002 6 STAK 1390 DOWFM ENTRNP PUSH 04399 60494021 1 5 ZBM 1391 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if VT 0439A 6022426B 0 1 1392 LD R0 TAPEERRMAX(R1) retry counter 0439B E4178801 0 6 BASE 1393 ST R0 SP,RETRYCOUNT 1394 * \ / 0000439C 1395 LOOP LABEL 0439C DC00440C 1396 CALL TAPEFUNC request a write file mark 0439D 41440018 IMM 1397 PARV MTFNWFM operation code 0439E 60494021 1 5 ZBM 1398 LD R1 MTU,MTUTYPE R1 = 0 if CT, 1 if MT, 2 if VT 0439F 406243AF 1 1399 PARVL TIMEOUT(R1) timeout value 043A0 FA0C43AE 0 1400 JNEZ R0 RETURN jump if error 1401 * \ / 043A1 F24443AE 1 1402 JBF R1/MTSTANER RETURN jump if all is well 043A2 F67843AD 1 1403 JBT R1/MTDSTWPRT PROTECTED jump if write-protected 043A3 D0578801 6 BASE 1404 DEC SP,RETRYCOUNT one fewer retry 043A4 FE0843AB 1405 JLT ERROR jump if all used up 1406 * \ / 043A5 F254439C 1 1407 JBF R1/MTSTTMFWB LOOP jump if tape did not move forward 043A6 DC40428F 1408 CALLNP DOBKSP else do a backspace 043A7 FA0C43AE 0 1409 JNEZ R0 RETURN return if that didn't work 043A8 DC4042C6 1410 CALLNP DOGAP then do a gap 043A9 FA0C43AE 0 1411 JNEZ R0 RETURN and return if that didn't work 043AA FE0E439C 1412 JMP LOOP then try again 1413 * --- 1414 000043AB 1415 ERROR LABEL 043AB 60040089 0 IMM 1416 LD R0 XREQERFAU error: abnormal/unavailable 043AC FE0E43AE 1417 JMP RETURN and return 1418 * --- 1419 000043AD 1420 PROTECTED LABEL 043AD 60040084 0 IMM 1421 LD R0 XREQERPFM error: protected from modification 1422 * \ / 000043AE 1423 RETURN LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 897 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 043AE 5D1F8002 6 STAK 1424 LEAVE POP return to caller 1425 * --- 1426 043B1 00000009 1427 TIMEOUT VFD 1,1,9 WFM timeouts for CT, MT, VT 1428 1429 END DOWFM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 898 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1431 1432 ********************************************************************************** 1433 * * 1434 * DOWRITE - Write a Record onto the Tape * 1435 * * 1436 * This routine assumes that MTUUBS points to the chain * 1437 * of UBS elements describing the user's buffer, and that * 1438 * MTURECLEN is the length of the record to be written. * 1439 * * 1440 * LD MTU => MTU element * 1441 * CALLNP DOWRITE * 1442 * ST R0 error code (0 if OK) * 1443 * * 1444 * Eats R0:R4. * 1445 * Stack required = 9. * 1446 * 2 + max ( DOBKSP (7), DOGAP (4), ERRORLOG (3), * 1447 * PADEXT (2), TRACEPROC (3) ) * 1448 * * 1449 ********************************************************************************** 1450 1451 BLOCK DOWRITE subroutine 1452 ENTRY DOWRITE 1453 1454 BEGFRAME 00178801 6 BASE 1455 RETRYCOUNT BSS 1 retry counter 1456 ENDFRAME 1457 043B2 DD5F8002 6 STAK 1458 DOWRITE ENTRNP PUSH 043B3 60094021 0 5 ZBM 1459 LD R0 MTU,MTUTYPE R0 = 0 if CT, 1 if MT, 2 if VT 043B4 6020426B 0 0 1460 LD R0 TAPEERRMAX(R0) retry count 043B5 E4178801 0 6 BASE 1461 ST R0 SP,RETRYCOUNT initialize retry counter 1462 * \ / 000043B6 1463 LOOP LABEL 043B6 60040001 0 IMM 1464 LD R0 MTUSTWAIT new state: wait for our turn 043B7 DCD74810 5 BASE 1465 EXPCS MTU,MTUPC go back to controller scheduler 043B8 FA0C43E9 0 1466 JNEZ R0 ERROR jump if controller is dead 1467 * \ / 043B9 60040001 0 IMM 1468 LD R0 1*PPUIDMAD 043BA E4001802 0 1469 ST R0 CIX(PPUSSSTAT) set DMA to output 043BB DC4043F5 1470 CALLNP PADEXT set up DMA registers 1471 * \ / 043BC 60095040 0 5 ZBM 1472 LD R0 MTU,MTUUNIT our unit number 043BD 60440250 1 IMM 1473 LD R1 MTCMWRITE for trace 043BE 60974806 2 5 BASE 1474 LD R2 MTU,MTURECLEN for trace 1475 TRACE MTTRACE,MTTFUNC function, R0=Unit, R1=Address, R2=Data 043BF 5D401D30 1475 XCT TRACECALL(MTTRACE) 043C0 FEC00085 1475 NOP (MTTRACE*BITS 22:26)+(MTTFUNC*BITS 27:31) 1476 * \ / 043C1 E4A01AD8 2 0 1477 ST R2 CIX(MTCMWRITE+MTINTREQ+MTSELECT+R0) start the write 1478 * \ / 043C2 60094021 0 5 ZBM 1479 LD R0 MTU,MTUTYPE R0 = 0 if CT, 1 if MT, 2 if VT 043C3 606043F0 1 0 1480 LD R1 TIMEOUT(R0) timeout value 043C4 60040002 0 IMM 1481 LD R0 MTUSTBUSY new state: busy with transfer 043C5 DCD74810 5 BASE 1482 EXPCS MTU,MTUPC go back to controller scheduler 1483 * \ / 043C6 FA0C43E9 0 1484 JNEZ R0 ERROR jump if controller is dead 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 899 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 043C7 6217480A 015 BASE 1485 LD2 R0 MTU,MTUPPUSTAT get PPU and tape status 043C8 7A0043F3 01 1486 AND2 R0 STATMASK look at error bits 043C9 FA1243ED 01 1487 JEQZ2 R0 OKSTAT jump if no errors 043CA DC005048 1488 CALL ERRORLOG else log the error 043CB 4144122F IMM 1489 PARV ERLCMTCERR tape error 043CC 41574804 5 BASE 1490 PARV MTU,MTUNAME drive name 043CD 41440250 IMM 1491 PARV MTCMWRITE operation 043CE 4157480B 5 BASE 1492 PARV MTU,MTUMTCSTAT tape status 043CF 4057480A 5 BASE 1493 PARVL MTU,MTUPPUSTAT PPU status 1494 * \ / 043D0 6217480A 015 BASE 1495 LD2 R0 MTU,MTUPPUSTAT get PPU and tape status 043D1 780043F3 0 1496 AND R0 STATMASK mask the PPU status 043D2 FA0C43D4 0 1497 JNEZ R0 NOTGOOD jump if PPU is unhappy 043D3 F24443ED 1 1498 JBF R1/MTSTANER OKSTAT jump if tape recovered from error 1499 * \ / 000043D4 1500 NOTGOOD LABEL 043D4 EC001801 1501 STZ CIX(PPUABORT) make the PPU happy 043D5 F27443EB 1 1502 JBF R1/MTDSTRDY OFFLINE jump if drive not ready 043D6 F67843E7 1 1503 JBT R1/MTDSTWPRT PROTECTED jump if drive is write-protected 043D7 F62E43E3 0 1504 JBT R0/PPUIMPE MEMERROR jump if memory parity error 043D8 D0578801 6 BASE 1505 DEC SP,RETRYCOUNT tried one more time 043D9 FE0843E9 1506 JLT ERROR jump if error is permanent 043DA 600A5220 0 1 CBM 1507 LD R0 R1/MTSTTMD get tape motion bits 043DB FA0243B6 0 1508 JEQZ R0 LOOP just retry if the tape didn't move 043DC 64040001 0 IMM 1509 CPR R0 MTSTTMFW did the tape move forward? 043DD FE0C43E9 1510 JNE ERROR if not, can't recover 043DE DC40428F 1511 CALLNP DOBKSP else backspace the tape 043DF FA0C43EE 0 1512 JNEZ R0 RETURN jump if can't backspace 043E0 DC4042C6 1513 CALLNP DOGAP then write a gap 043E1 FA0C43EE 0 1514 JNEZ R0 RETURN jump if we can't do that either 043E2 FE0E43B6 1515 JMP LOOP then try the write again 1516 * --- 1517 000043E3 1518 MEMERROR LABEL 043E3 F25443E5 1 1519 JBF R1/MTSTTMFWB MEMERR2 jump if tape was not moved 043E4 DC40428F 1520 CALLNP DOBKSP else backspace the tape 000043E5 1521 MEMERR2 LABEL 043E5 60040070 0 IMM 1522 LD R0 UINTVMFPE error: memory parity error 043E6 FE0E43EE 1523 JMP RETURN 1524 * --- 1525 000043E7 1526 PROTECTED LABEL 043E7 60040084 0 IMM 1527 LD R0 XREQERPFM error: protected from modification 043E8 FE0E43EE 1528 JMP RETURN 1529 * --- 1530 000043E9 1531 ERROR LABEL 043E9 60040089 0 IMM 1532 LD R0 XREQERFAU error: abnormal/unavailable 043EA FE0E43EE 1533 JMP RETURN 1534 * --- 1535 000043EB 1536 OFFLINE LABEL 043EB 600400AE 0 IMM 1537 LD R0 XREQERDNR error: drive not ready 043EC FE0E43EE 1538 JMP RETURN 1539 * --- 1540 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 900 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 000043ED 1541 OKSTAT LABEL 043ED 60040000 0 IMM 1542 LD R0 0 no error 1543 * \ / 000043EE 1544 RETURN LABEL 043EE EC095810 5 ZBM 1545 STZ MTU,MTUEOF 043EF 5D1F8002 6 STAK 1546 LEAVE POP return to caller 1547 * --- 1548 043F2 00000006 1549 TIMEOUT VFD 1,1,6 write timeouts for CT, MT, VT 1550 000043F3 1551 STATMASK LABEL 043F3 00012540 1552 VFD 1*PPUITOUT+1*PPUIBCNR+1*PPUIMPE+1*PPUICONF+1*PPUIDPPE 043F4 201F0000 1553 VFD 1*MTSTANER+ONEBITS/MTSTERSTAT*MTSTERSTAT 1554 1555 END DOWRITE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 901 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1557 1558 ********************************************************************************** 1559 * * 1560 * PADEXT - Set Up the PPU DMA Registers * 1561 * * 1562 * You must previously set the DMA direction bit. We use * 1563 * the UBS blocks chained from the MTU element to set up the * 1564 * PPU registers. * 1565 * * 1566 * LD MTU => MTU element * 1567 * CALLNP PADEXT * 1568 * * 1569 * Eats R0:R1. * 1570 * Stack required = 2 * 1571 * 1 + NEWBYTECNT (1). * 1572 * * 1573 ********************************************************************************** 1574 1575 BLOCK PADEXT subroutine 1576 ENTRY PADEXT 1577 1578 BEGFRAME 1579 ENDFRAME 1580 043F5 DD5F8001 6 STAK 1581 PADEXT ENTRNP PUSH 043F6 60574808 1 5 BASE 1582 LD R1 MTU,MTUUBS R1 -> first UBS block 043F7 FA7243FD 1 1583 JNZA R1 DOIT jump if there is a buffer 043F8 EC174809 5 BASE 1584 STZ MTU,MTUNUBS else say no next UBS element 043F9 EC001805 1585 STZ CIX(PPUADDR1) no relevant address 043FA 60048000 0 IMM 1586 LD R0 1*PPUCLAST 043FB E4001804 0 1587 ST R0 CIX(PPUCNT1) and only byte count = 0 043FC FE0E4405 1588 JMP RETURN 1589 * --- 1590 000043FD 1591 DOIT LABEL 043FD 60085F10 0 1 ZBM 1592 LD R0 R1,UBSLINK R0 => second UBS block 043FE E4174809 0 5 BASE 1593 ST R0 MTU,MTUNUBS set so NEWBYTECNT uses this one 043FF DC40425E 1594 CALLNP NEWBYTECNT load the second byte count 04400 60574808 1 5 BASE 1595 LD R1 MTU,MTUUBS R1 => first UBS block 04401 60164801 0 1 BASE 1596 LD R0 R1,UBSMAW get the memory address word 04402 E4001805 0 1597 ST R0 CIX(PPUADDR1) give it to the PPU 04403 60164802 0 1 BASE 1598 LD R0 R1,UBSBCW get the byte count word 04404 E4001804 0 1599 ST R0 CIX(PPUCNT1) give it to the PPU 1600 * \ / 1601 00004405 1602 RETURN LABEL 04405 5D1F8001 6 STAK 1603 LEAVE POP 1604 * --- 1605 1606 END PADEXT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 902 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1608 1609 ********************************************************************************** 1610 * * 1611 * REWNOWAIT - Awaken User, then Rewind a Tape * 1612 * * 1613 * This routine is called in response to a user's REWIND * 1614 * request. It will awaken the user so he can continue, then * 1615 * rewind the tape. Note that future user requests will not * 1616 * even be looked for until the rewind has completed. * 1617 * * 1618 * On return, R0 = -1. This is a flag to MTDRIVE saying * 1619 * that it shouldn't awaken the user (because we already have). * 1620 * * 1621 * CALLNP REWNOWAIT * 1622 * * 1623 * Eats R0:R4. * 1624 * Stack required = 8 * 1625 * 1 + max ( DOREWIND (7), WAKEUPUSER (5) ). * 1626 * * 1627 ********************************************************************************** 1628 1629 BLOCK REWNOWAIT subroutine 1630 ENTRY REWNOWAIT 1631 1632 BEGFRAME 1633 ENDFRAME 1634 04406 DD5F8001 6 STAK 1635 REWNOWAIT ENTRNP PUSH 04407 60040000 0 IMM 1636 LD R0 0 error code for WAKEUPUSER 04408 DC40445D 1637 CALLNP WAKEUPUSER awaken the user 04409 DC40432C 1638 CALLNP DOREWIND then rewind the tape 0440A 6007FFFF 0 IMM 1639 LD R0 -1 tell MTDRIVE not to awaken user 0440B 5D1F8001 6 STAK 1640 LEAVE POP and return 1641 * --- 1642 1643 END REWNOWAIT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 903 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1645 1646 ********************************************************************************** 1647 * * 1648 * TAPEFUNC - Perform a Non-Data Transfer Tape Function * 1649 * * 1650 * This routine will perform a tape function that ties * 1651 * up the controller. It will not do any retries. It will, * 1652 * however, log an error if any non-optimal status is * 1653 * encountered. It also does preliminary error checking. * 1654 * Note especially that this routine will not return an * 1655 * error indication for normal errors. Backspace normally * 1656 * gets an error following a write error, and this routine * 1657 * ignores any such error. * 1658 * * 1659 * LD MTU => MTU element * 1660 * CALL TAPEFUNC * 1661 * PARV command for controller * 1662 * PARVL max time required (in 10-second intervals) * 1663 * ST R1 new tape status * 1664 * ST R0 XREQERDNR if drive went offline * 1665 * XREQERFAU if tape position lost * 1666 * 0 otherwise * 1667 * * 1668 * Eats R0:R3. * 1669 * Stack required = 6 * 1670 * 3 + max ( ERRORLOG (3), TRACEPROC (3) ) * 1671 * * 1672 ********************************************************************************** 1673 1674 BLOCK TAPEFUNC subroutine 1675 ENTRY TAPEFUNC 1676 1677 BEGFRAME 00178801 6 BASE 1678 OPERATION BSS 1 operation requested 00178802 6 BASE 1679 TIMEOUT BSS 1 timeout counter 1680 ENDFRAME 1681 0440C DD1F8003 6 STAK 1682 TAPEFUNC ENTR PUSH 0440D C1578801 6 BASE 1683 STPV SP,OPERATION get the operation code 0440E C0578802 6 BASE 1684 STPVL SP,TIMEOUT get the timeout value 0440F 60040001 0 IMM 1685 LD R0 MTUSTWAIT new state: wait our turn to start I/O 04410 DCD74810 5 BASE 1686 EXPCS MTU,MTUPC go back to controller-scheduler 04411 FA0C442C 0 1687 JNEZ R0 ERROR jump if controller is dead 1688 * \ / 04412 60095040 0 5 ZBM 1689 LD R0 MTU,MTUUNIT R0 = unit number 04413 60440230 1 IMM 1690 LD R1 MTCMFUNC for trace 04414 60978801 2 6 BASE 1691 LD R2 SP,OPERATION get operation code 1692 TRACE MTTRACE,MTTFUNC tape function, R0=Unit, R1=Address, R2=Value 04415 5D401D30 1692 XCT TRACECALL(MTTRACE) 04416 FEC00085 1692 NOP (MTTRACE*BITS 22:26)+(MTTFUNC*BITS 27:31) 04417 E4A01AB8 2 0 1693 ST R2 CIX(MTCMFUNC+MTINTREQ+MTSELECT+R0) start the operation 1694 * \ / 04418 60040002 0 IMM 1695 LD R0 MTUSTBUSY new state: made controller busy 04419 60578802 1 6 BASE 1696 LD R1 SP,TIMEOUT timeout counter 0441A DCD74810 5 BASE 1697 EXPCS MTU,MTUPC go back to controller-scheduler 1698 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 904 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 0441B FA0C442C 0 1699 JNEZ R0 ERROR jump if controller is dead 0441C 6057480B 1 5 BASE 1700 LD R1 MTU,MTUMTCSTAT get new status 0441D 78404432 1 1701 AND R1 STATMASK mask off irrelevant bits 0441E FA424427 1 1702 JEQZ R1 NOERROR jump if no error to log 0441F E1178801 4 6 BASE 1703 EXCH R4 SP,OPERATION save R4, get op code 04420 DC005048 1704 CALL ERRORLOG else log the error 04421 4144122F IMM 1705 PARV ERLCMTCERR tape error 04422 41574804 5 BASE 1706 PARV MTU,MTUNAME tape name 04423 41530000 4 REG 1707 PARV R4 operation requested 04424 4157480B 5 BASE 1708 PARV MTU,MTUMTCSTAT tape status 04425 4057480A 5 BASE 1709 PARVL MTU,MTUPPUSTAT PPU status 04426 E1178801 4 6 BASE 1710 EXCH R4 SP,OPERATION restore R4, op code 1711 * \ / 00004427 1712 NOERROR LABEL 04427 6057480B 1 5 BASE 1713 LD R1 MTU,MTUMTCSTAT get current status 04428 F274442E 1 1714 JBF R1/MTDSTRDY OFFLINE jump if drive went offline 1715 * note that other errors are accepted 04429 600A5220 0 1 CBM 1716 LD R0 R1/MTSTTMD get tape motion direction 0442A 64040003 0 IMM 1717 CPR R0 MTSTTMLOST is tape position lost? 0442B FE0C4430 1718 JNE OKSTAT jump if not 1719 * \ / 0000442C 1720 ERROR LABEL 0442C 60040089 0 IMM 1721 LD R0 XREQERFAU else error: abnormal/unavailable 0442D FE0E4431 1722 JMP RETURN and return 1723 * --- 1724 0000442E 1725 OFFLINE LABEL 0442E 600400AE 0 IMM 1726 LD R0 XREQERDNR error: drive not ready 0442F FE0E4431 1727 JMP RETURN and return 1728 * --- 1729 00004430 1730 OKSTAT LABEL 04430 60040000 0 IMM 1731 LD R0 0 no error (so far) 1732 * \ / 00004431 1733 RETURN LABEL 04431 5D1F8003 6 STAK 1734 LEAVE POP 1735 * --- 1736 04432 201F0000 1737 STATMASK VFD 1*MTSTANER+ONEBITS/MTSTERSTAT*MTSTERSTAT 1738 1739 END TAPEFUNC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 905 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1741 1742 ********************************************************************************** 1743 * * 1744 * TAPENOTRDY - Handle Tapes that are not Ready * 1745 * * 1746 * This routine is called when we discover that a tape is * 1747 * not ready. We will complain to the operator as necessary, * 1748 * and will also give errors for any requests that happen. We * 1749 * return when the controller seems to be OK (not MTCDEAD) and * 1750 * the drive is ready (MTDSTRDY). Note that the drive might * 1751 * be inoperative for some other reason, however. * 1752 * * 1753 * * 1754 * LD MTU => our MTU element * 1755 * CALLNP TAPENOTRDY * 1756 * * 1757 * Eats R0:R4. * 1758 * Stack required = 8. * 1759 * 1 + max ( CANOPMSG (1), DEVNOTRDY (5), DOREWIND (7), * 1760 * LOCKWAIT (0), WAKEUPUSER (5) ) * 1761 * * 1762 ********************************************************************************** 1763 1764 BLOCK TAPENOTRDY subroutine 1765 ENTRY TAPENOTRDY 1766 1767 BEGFRAME 1768 ENDFRAME 1769 04433 DD5F8001 6 STAK 1770 TAPENOTRDY ENTRNP PUSH 1771 1772 ********************************************************************************** 1773 * * 1774 * The tape is not ready or the controller is dead. If * 1775 * is someone is using the drive generate a "not ready" * 1776 * message (if there isn't already a message for the drive) * 1777 * and let the user go. If no user, clear any message since * 1778 * none is needed when no one is using the drive. * 1779 * * 1780 ********************************************************************************** 1781 1782 * \ / 00004434 1783 ERROR LABEL 04434 5C174803 5 BASE 1784 CMZ MTU,MTUPCADRS is this tape open? 04435 FE024447 1785 JEQ NOTOPEN jump if not - no message needed 1786 * \ / 1787 1788 * Drive in use, generate necessary message 04436 5C174805 5 BASE 1789 CMZ MTU,MTUMSGID is a message outstanding? 04437 FE0C443B 1790 JNE CHECKREQ jump if so, don't complain again 04438 DC004FBE 1791 CALL DEVNOTRDY else generate a complaint 04439 40574804 5 BASE 1792 PARVL MTU,MTUNAME tape drive name 0443A E4174805 0 5 BASE 1793 ST R0 MTU,MTUMSGID and save complaint id 0000443B 1794 CHECKREQ LABEL 1795 PLOCK MTREQLOCK get the request lock 0443B 0CC00000 1795 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 906 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 0443C D1C01F20 1795 SETT MTREQLOCK 0443D FE0C443F 1795 JNE MA(2+DISPW MA 0) 0443E DC40308B 1795 CALLNP LOCKWAIT 0443F 60174008 0 5 CACH 1796 LD R0 MTU,MTUREQUEST get the request 04440 EC174008 5 CACH 1797 STZ MTU,MTUREQUEST say we got it 1798 PUNLOCK MTREQLOCK release the lock 04441 EC001F20 1798 STZ MTREQLOCK 04442 0C800000 1798 ION 04443 FA02444C 0 1799 JEQZ R0 WAIT jump if no new request 04444 600400AE 0 IMM 1800 LD R0 XREQERDNR error code: device not ready 04445 DC40445D 1801 CALLNP WAKEUPUSER and go wake up the user 04446 FE0E444C 1802 JMP WAIT then wait it out 1803 * --- 1804 1805 * Drive is not in use, clear any message associated with it 00004447 1806 NOTOPEN LABEL 04447 5C174805 5 BASE 1807 CMZ MTU,MTUMSGID do we have a complaint outstanding? 04448 FE02444C 1808 JEQ WAIT jump if not 04449 DC004713 1809 CALL CANOPMSG else cancel the complaint 0444A 40574805 5 BASE 1810 PARVL MTU,MTUMSGID 0444B EC174805 5 BASE 1811 STZ MTU,MTUMSGID say we have cancelled it 1812 * \ / 1813 1814 ********************************************************************************** 1815 * * 1816 * Now return to the controller-scheduler to wait for a * 1817 * change of state. * 1818 * * 1819 ********************************************************************************** 1820 0000444C 1821 WAIT LABEL 0444C 60040000 0 IMM 1822 LD R0 MTUSTRUN new state: runnable (next time) 0444D DCD74810 5 BASE 1823 EXPCS MTU,MTUPC go back to controller scheduler 1824 * \ / 1825 1826 ********************************************************************************** 1827 * * 1828 * Check whether the controller is well and the drive * 1829 * "ready". We get here after coming back from the * 1830 * controller-scheduler or after doing an unsuccessful rewind * 1831 * when the drive said "ready". In the first case we want to * 1832 * try all over again if things aren't OK, or do a rewind if * 1833 * they are. In the second case we want to try over if things * 1834 * don't check out, but LEAVE if they do. We return because * 1835 * the rewind found an error, but the error wasn't that the * 1836 * controller is dead or the drive not ready. This is as far * 1837 * as our jurisdiction goes, so we return. This way, further * 1838 * requests produce errors but we don't waste our time doing * 1839 * the same. * 1840 * * 1841 ********************************************************************************** 1842 0444E 60040000 0 IMM 1843 LD R0 0 say we haven't tried rewind 0000444F 1844 REWERROR LABEL R0 = 0, or DOREWIND error code 0444F 60495F11 1 5 ZBM 1845 LD R1 MTU,MTUCNTL get pointer to MTC element 04450 5C084816 1 ZBM 1846 CMZ R1,MTCDEAD check for dead controller 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 907 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 04451 FE0C4434 1847 JNE ERROR jump if controller dead 04452 6057480B 1 5 BASE 1848 LD R1 MTU,MTUMTCSTAT get current status 04453 F2744434 1 1849 JBF R1/MTDSTRDY ERROR jump if tape is not ready 04454 FA0C445C 0 1850 JNEZ R0 EXIT jump if final rewind got bad error 1851 * \ / 1852 1853 ********************************************************************************** 1854 * * 1855 * Drive is now ready. Cancel message (if we must) and * 1856 * rewind the tape. * 1857 * * 1858 ********************************************************************************** 1859 04455 5C174805 5 BASE 1860 CMZ MTU,MTUMSGID do we have a complaint outstanding? 04456 FE02445A 1861 JEQ TRYREWIND jump if not 04457 DC004713 1862 CALL CANOPMSG else cancel the complaint 04458 40574805 5 BASE 1863 PARVL MTU,MTUMSGID 04459 EC174805 5 BASE 1864 STZ MTU,MTUMSGID 0000445A 1865 TRYREWIND LABEL 0445A DC40432C 1866 CALLNP DOREWIND try to rewind the tape 0445B FA0C444F 0 1867 JNEZ R0 REWERROR jump if it wouldn't work 1868 * \ / 1869 0000445C 1870 EXIT LABEL 0445C 5D1F8001 6 STAK 1871 LEAVE POP we're all done, controller alive and drive ready 1872 * --- 1873 END TAPENOTRDY subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 908 (MTDRIVER) F 45 Magnetic Tape Driver - Drive Activity Section 1875 1876 ********************************************************************************** 1877 * * 1878 * WAKEUPUSER - Roust the Process Using This Tape * 1879 * * 1880 * This routine will roust the process that was waiting * 1881 * for a tape operation. * 1882 * * 1883 * LD MTU => our MTU element * 1884 * LD R0 error code (0 if no error) * 1885 * CALLNP WAKEUPUSER * 1886 * * 1887 * Eats R0:R2. * 1888 * Stack required = 5 * 1889 * 1 + max ( DQUEONE(4), LOCKWAIT (0) ) * 1890 * * 1891 ********************************************************************************** 1892 1893 BLOCK WAKEUPUSER subroutine 1894 ENTRY WAKEUPUSER 1895 1896 BEGFRAME 1897 ENDFRAME 1898 0445D DD5F8001 6 STAK 1899 WAKEUPUSER ENTRNP PUSH 0445E 60520000 1 0 REG 1900 LD R1 R0 R1 = error code 1901 PLOCK MTREQLOCK get the request lock 0445F 0CC00000 1901 IOFF 04460 D1C01F20 1901 SETT MTREQLOCK 04461 FE0C4463 1901 JNE MA(2+DISPW MA 0) 04462 DC40308B 1901 CALLNP LOCKWAIT 04463 E44944A1 1 5 ZBM 1902 ST R1 MTU,MTUERRCODE save the error code 04464 DC00354F 1903 CALL DQUEONE roust the user 04465 41001DAC 1904 PAR SQDIOWAIT queue header 04466 40534000 5 REG 1905 PARVL MTU queue parameter 1906 PUNLOCK MTREQLOCK release the request lock 04467 EC001F20 1906 STZ MTREQLOCK 04468 0C800000 1906 ION 04469 5D1F8001 6 STAK 1907 LEAVE POP and all done 1908 * --- 1909 1910 END WAKEUPUSER subroutine 1911 1912 1913 END Drive Activity Section 1914 1915 1916 END Magnetic Tape Driver 81 INPUT TIMER clock routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 909 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 3 4 BLOCK SSU Routines 5 6 ENTRY CANOPMSG cancel a message to the operator 7 ENTRY FLASHVAL pointer to front panel information 8 ENTRY FLREADNVM read flagged datum from NVM 9 ENTRY FLWRITENVM write flagged datum into NVM 10 ENTRY FPFLASHER front panel flasher 11 ENTRY GENOPMSG generate a message to the operator 12 ENTRY GETDATE get the 64 bit date, does not ensure uniqueness 13 ENTRY GETFDATE get 32 bit current date 14 ENTRY GETFSEQN get 64 bit sequence number/date 15 ENTRY HOURINT routine to run each hour 16 ENTRY NVMREAD read from NVM 17 ENTRY NVMSTORE store into NVM 18 ENTRY READNVM read datum from NVM 19 ENTRY SSU_INT interrupt from SSU 20 ENTRY SSU_RESET to restart the SSU 21 ENTRY TIMEADJUST clock adjuster 22 ENTRY TIMEDRFT clock drifter 23 ENTRY TIMENOW get current time from SSU 24 ENTRY TIMESET queue a time interrupt 25 ENTRY TIMEKILL remove a time interrupt 26 ENTRY WRITENVM write datum into NVM 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 910 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 28 29 ********************************************************************************** 30 * * 31 * SSU_INT. * 32 * The SSU has the real time clock, the non-volatile * 33 * memory, the remote front panel, and the real front panel. * 34 * One interrupt from the SSU could be for all. This routine * 35 * accepts the interrupt and examines the WRU response and * 36 * processes each in turn. This whole mess runs with the * 37 * interrupts off so we have to try and keep it short. * 38 * * 39 * Stack required = 11. * 40 * 1 + max ( CHECKLOGD (6), DQUEONE (4), FPFLASHER (3), * 41 * GETOUTCHAR (5), LOCKWAIT (0), PUTINCHAR (10), * 42 * SETALARM (1), SFREEMEM (0), TIMENOW (1) ) * 43 * * 44 ********************************************************************************** 45 46 BLOCK SSU_INT routine 47 ENTRY SSU_INT 48 49 BEGFRAME2 00178800 6 BASE 50 INTSTAT BSS 1 interrupt poll response 51 ENDFRAME 52 53 * R2=WRU response, R3=slot SSU in, R4=>prev CA, SP=>stack top 54 0000446A 55 SSU_INT LABEL 0446A E49F8001 2 6 STAK 56 ST R2 PUSH allocate stack frame and save response 0446B 60C40086 3 IMM 57 LD PFPTR PNCIX (destroys R3) 0446C 00C01EDE 58 LDPF CLOCKPF set up communication 0446D F2BA447A 2 59 JBF R2/IPRSSUSTAT/SSUIMNVM NOTNVMINT 60 * \ / 61 62 * Interrupt from NVM. Means that a store to the NVM has completed. 63 * The PLOCK is needed so that a reader about to suspend on 64 * NVMBSYFLAG is in a known state... either fully suspended 65 * in the DIOWAIT queue or waiting for us to release our lock. 66 67 * \ / 68 PLOCK NVMBSYLOCK lock the NVM 0446E 0CC00000 68 IOFF 0446F D1C01EF4 68 SETT NVMBSYLOCK 04470 FE0C4472 68 JNE MA(2+DISPW MA 0) 04471 DC40308B 68 CALLNP LOCKWAIT 04472 EC001EF5 69 STZ NVMBSYFLAG say no longer busy 70 PUNLOCK NVMBSYLOCK then release the lock 04473 EC001EF4 70 STZ NVMBSYLOCK 04474 0C800000 70 ION 00004475 71 RELESEMORE LABEL 04475 DC00354F 72 CALL DQUEONE release anyone waiting 04476 41001DAC 73 PAR SQDIOWAIT from this queue 04477 40441EF4 IMM 74 PARVL ADR NVMBSYLOCK waiting for the NVM 04478 FA0C4475 0 75 JNEZ R0 RELESEMORE jump if someone was released, 76 * \ / we want to clean out the queue 04479 60978800 2 6 BASE 77 LD R2 SP,INTSTAT restore SSU interrupt response 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 911 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 78 * \ / 79 0000447A 80 NOTNVMINT LABEL 0447A F2BC447F 2 81 JBF R2/IPRSSUSTAT/SSUIMFPS NOTFPINT 0447B 60001811 0 82 LD R0 CIX(SSUFPSWCH) new front panel setting 0447C E4001EDF 0 83 ST R0 FPSWITCH 0447D DC404639 84 CALLNP FPFLASHER update the display now 0447E 60978800 2 6 BASE 85 LD R2 SP,INTSTAT restore the WRU response 86 * \ / 87 0000447F 88 NOTFPINT LABEL 0447F F2B0448D 2 89 JBF R2/IPRSSUSTAT/SSUIMCI NOSSUCHIN jump if not char in int 90 PLOCK FPCHARINLK prevent interference 04480 0CC00000 90 IOFF 04481 D1C01EE3 90 SETT FPCHARINLK 04482 FE0C4484 90 JNE MA(2+DISPW MA 0) 04483 DC40308B 90 CALLNP LOCKWAIT 04484 6080180D 2 91 LD R2 CIX(SSUCHARIN) get the typed character 04485 78840FFF 2 IMM 92 AND R2 0FFF remove the new bit 04486 61001EE1 4 93 LD TCB FPTCB get the TCB for this special device 04487 DC404C29 94 CALLNP CHECKLOGD check for process creation 04488 FE0E448A 95 JMP DONTPUT (R4 eaten on this return) 04489 DC404B21 96 CALLNP PUTINCHAR put character into the buffer 0000448A 97 DONTPUT LABEL 98 PUNLOCK FPCHARINLK release critical region 0448A EC001EE3 98 STZ FPCHARINLK 0448B 0C800000 98 ION 0448C 60978800 2 6 BASE 99 LD R2 SP,INTSTAT restore R2 100 * \ / 0000448D 101 NOSSUCHIN LABEL 0448D 61001EE1 4 102 LD TCB FPTCB get the TCB for this special device 0448E F6B24493 2 103 JBT R2/IPRSSUSTAT/SSUIMCO DOCHAROUT jump if interrupt caused by 104 * ready for char output 105 * check to see if we must start output 0448F 5C091F1A 4 ZBM 106 CMZ TCB,TCTTOBP are there characters to output? 04490 FE024497 107 JEQ NOSSUCHOUT jump if not 04491 D1C01EE2 108 SETT FPTERMBZY is it already busy? 04492 FE024497 109 JEQ NOSSUCHOUT jump if so - int will happen yet 110 * \ / 00004493 111 DOCHAROUT LABEL 04493 DC4049DC 112 CALLNP GETOUTCHAR get an output char 04494 FE0E44B9 113 JMP NOCHARS jump if no chars there 04495 E4801808 2 114 ST R2 CIX(SSUCHAROUT) output the char 00004496 115 RESTORR2 LABEL 04496 60978800 2 6 BASE 116 LD R2 SP,INTSTAT restore the WRU word 117 * \ / 00004497 118 NOSSUCHOUT LABEL 04497 F2BE44B8 2 119 JBF R2/IPRSSUSTAT/SSUIMTICK NOTTICKINT 120 * \ / 121 122 ********************************************************************************** 123 * A clock interrupt has occurred. Pass it to the * 124 * proper cpu ( or take it if ours or a don't care ). * 125 ********************************************************************************** 126 127 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 912 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 00004498 128 TICKAGAIN LABEL 129 PLOCK TIMERLOCK acquire the timer queue 04498 0CC00000 129 IOFF 04499 D1C01EF1 129 SETT TIMERLOCK 0449A FE0C449C 129 JNE MA(2+DISPW MA 0) 0449B DC40308B 129 CALLNP LOCKWAIT 0449C 61001EF2 4 130 LD TMR TIMERQ get pointer to head element 0449D FB3044B5 4 131 JZA TMR FAKE jump if nothing in queue 0449E DC404532 132 CALLNP TIMENOW get current time in R0,R1 0449F 66170801 014 BASE 133 CPR2 R0 TMR,TMRTIME check against the elements request 044A0 FE0844B5 134 JLT FAKE jump if not time for the interrupt 135 * that is now at the queue head 044A1 60970800 2 4 BASE 136 LD R2 TMR,TMRLINK get the forward pointer 044A2 E4801EF2 2 137 ST R2 TIMERQ remove this element from the list 138 PUNLOCK TIMERLOCK release the timer queue 044A3 EC001EF1 138 STZ TIMERLOCK 044A4 0C800000 138 ION 139 * \ / 140 141 * Check to see if the request is for this CPU 044A5 60490043 1 4 ZBM 142 LD R1 TMR,TMRCPU see if anyone can do it 044A6 FA4244BB 1 143 JEQZ R1 MEDOIT if anyone, I'll do it 044A7 64400415 1 144 CPR R1 OURSLOT is this request for me? 044A8 FE0244BB 145 JEQ MEDOIT jump if so 146 * only quantums go this way, so we just kick the other CPU 147 PLOCK CPUCOMLOCK wait for critical region 044A9 0CC00000 147 IOFF 044AA D1C01CF5 147 SETT CPUCOMLOCK 044AB FE0C44AD 147 JNE MA(2+DISPW MA 0) 044AC DC40308B 147 CALLNP LOCKWAIT 044AD 0C4044B4 148 STTB IAPRPROTO tell him to cut off the current process 149 PUNLOCK CPUCOMLOCK release critical region 044AE EC001CF5 149 STZ CPUCOMLOCK 044AF 0C800000 149 ION 044B0 DC002F5D 150 CALL SFREEMEM release the queue element 044B1 41440003 IMM 151 PARV TMRLOG indicate its length 044B2 40530000 4 REG 152 PARVL TMR and address 044B3 FE0E4498 153 JMP TICKAGAIN check for the next int 154 * --- 155 044B4 00030004 156 IAPRPROTO VFD BUSCWRITE+CPUCOFFSET+CPUIAPR bus command for IAPR 157 000044B5 158 FAKE LABEL 044B5 DC404567 159 CALLNP SETALARM set up timer to get us back here 160 PUNLOCK TIMERLOCK release the timer queue 044B6 EC001EF1 160 STZ TIMERLOCK 044B7 0C800000 160 ION 161 * \ / 000044B8 162 NOTTICKINT LABEL 044B8 FE0E28B7 163 JMP DISPATCH return from int 164 * --- 165 166 * There are no chars to output so we say output 167 * is no longer busy. 000044B9 168 NOCHARS LABEL 044B9 EC001EE2 169 STZ FPTERMBZY clear the busy flag 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 913 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 044BA FE0E4496 170 JMP RESTORR2 171 * --- 172 173 ********************************************************************************** 174 * * 175 * We have found a time queue element whose time has * 176 * arrived. We call the requested routine with R3 containing * 177 * the parameter that the user passed with the TIMESET request. * 178 * SP contains a pointer to the resident stack. The called * 179 * routine may destroy all registers except SP. No lists are * 180 * locked, so the called routine may call any resident routine * 181 * including the TIMESET routine. The caller must return! * 182 * * 183 ********************************************************************************** 184 000044BB 185 MEDOIT LABEL 044BB 60891F13 2 4 ZBM 186 LD R2 TMR,TMRPC get the call address 044BC 60D70805 3 4 BASE 187 LD R3 TMR,TMRPARAM give caller param in R3 044BD DC002F5D 188 CALL SFREEMEM release the element 044BE 41440003 IMM 189 PARV TMRLOG indicate the elements length 044BF 40530000 4 REG 190 PARVL TMR and address 044C0 DC568400 2 @R 191 CALLNP @R2 go off to the indicated routine 192 PFAILCHK DISPATCH 044C1 5C00044E 192 CMZ POWERFLAG power-fail restart in progress? 044C2 FE0C28B7 192 JNE DISPATCH jump if so 192 PFAILEN DISPATCH else allow interrupt 044C3 600428B7 0 IMM 192 LD R0 ADR DISPATCH 044C4 E400044F 0 192 ST R0 POWERUPLOC 044C5 59C40800 IMM 192 IORMSR MSRPFINTE 192 PFAILDS then disallow interrupt 044C6 59840800 IMM 192 CLBMSR MSRPFINTE 044C7 EC00044F 192 STZ POWERUPLOC 044C8 FE0E4498 193 JMP TICKAGAIN check new element 194 * --- 195 196 END SSU_INT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 914 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 198 199 ********************************************************************************** 200 * * 201 * SSU_RESET. This routine initializes the SSU that is * 202 * described in CLOCKPF. The current time is fetched and the * 203 * SSUs interrupt mask is initialized. * 204 * * 205 * Eats R0 thru R3. * 206 * Stack required = 5 * 207 * 1 + max ( DQUEONE (4), LOCKWAIT (0) ) * 208 * * 209 ********************************************************************************** 210 211 BLOCK SSU_RESET subroutine 212 ENTRY SSU_RESET 213 214 BEGFRAME 215 ENDFRAME 216 044C9 DD5F8001 6 STAK 217 SSU_RESET ENTRNP PUSH 044CA 60C40086 3 IMM 218 LD PFPTR PNCIX get I/O window page number 044CB 00C01EDE 219 LDPF CLOCKPF set the window to point to the SSU 220 * \ / 044CC 60001801 0 221 LD R0 CIX(SSUCLOCKU) get clock upper half 044CD 60401802 1 222 LD R1 CIX(SSUCLOCKL) get clock lower half 044CE 684403E8 1 IMM 223 UCPR R1 1*MSECSS check for possible rollover 044CF FE0644D1 224 JGE NOROLL jump if clock safely away from rollover point 044D0 60001801 0 225 LD R0 CIX(SSUCLOCKU) get another copy of the upper half 226 * in case the lower carried out while 227 * we were between the LD R0 and R1 000044D1 228 NOROLL LABEL 044D1 6A001EE5 01 229 UCPR2 R0 FDATE check for better value already in! 044D2 FE0844F6 230 JLT BADTIME jump if so, maybe someday reset the clock 044D3 E6001EE5 01 231 ST2 R0 FDATE set current date 000044D4 232 USEASTIME LABEL 044D4 60001810 0 233 LD R0 CIX(SSUBOOTFP) get the buttons at boot 044D5 E4001EE0 0 234 ST R0 FPSWITCHB set indicators to use for bootstrap 044D6 60001811 0 235 LD R0 CIX(SSUFPSWCH) get and save current switches 044D7 E4001EDF 0 236 ST R0 FPSWITCH 044D8 600400C7 0 IMM 237 LD R0 1*SSUIMTICK+1*SSUIMFPS+1*SSUIMNVM+1*SSUIMCI+1*SSUIMCO 238 * interrupt on clock fence, front panel change, 239 * and characters in and out 044D9 5C001EE4 240 CMZ SSUVER is this a new SSU? 044DA FE0244E4 241 JEQ NOSETCLOCK if so, skip set up for SSU to set FDATE 242 * \ / 243 244 ********************************************************************************** 245 * * 246 * New SSUs (REV 0D and up) will set the operating system's * 247 * clock in memory. We must however request this service of the * 248 * SSU and tell it where in memory we keep our clock. * 249 * * 250 ********************************************************************************** 251 252 * \ / 044DB 60441EE5 1 IMM 253 LD R1 ADR FDATE where we want the SSU to store the time 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 915 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 044DC 60CA5C80 3 1 CBM 254 LD PFPTR R1/PAGEFIELD get the page number 044DD 7CC40080 3 IMM 255 IOR PFPTR MONPF make monitor page number 044DE 80920000 0 REG 256 PFRD R0 get the physical location 044DF E40A54C0 0 1 CBM 257 ST R0 R1/FLDABSPG mix in with the virtual address 044E0 E44A1560 1 0 CBM 258 ST R1 R0/PAGEANDISP add page and displacement to slot number 044E1 E4001817 0 259 ST R0 CIX(SSUCLOKAD) set address of FDATE 044E2 60C40086 3 IMM 260 LD PFPTR PNCIX reload I/O window page number 044E3 600400D7 0 IMM 261 LD R0 1*SSUIMTICK+1*SSUIMFPS+1*SSUIMNVM+1*SSUIMCI+1*SSUIMCO+1*SSUIMCLKSTR 262 * interrupt on clock fence, front panel 263 * change, characters in and out, and 264 * \ / our clock word in memory (FDATE). 265 000044E4 266 NOSETCLOCK LABEL 044E4 E400180F 0 267 ST R0 CIX(SSUINTMASK) set up what to interrupt for 044E5 60001802 0 268 LD R0 CIX(SSUCLOCKL) get the current clock 044E6 18040002 0 IMM 269 ADD R0 2 ensure that the fence is ahead of the clock 044E7 E4001809 0 270 ST R0 CIX(SSUFENCE) cause him to interrupt now 044E8 EC001EE2 271 STZ FPTERMBZY ensure restart of output 272 273 PLOCK NVMBSYLOCK lock the NVM 044E9 0CC00000 273 IOFF 044EA D1C01EF4 273 SETT NVMBSYLOCK 044EB FE0C44ED 273 JNE MA(2+DISPW MA 0) 044EC DC40308B 273 CALLNP LOCKWAIT 044ED EC001EF5 274 STZ NVMBSYFLAG say no longer busy 275 PUNLOCK NVMBSYLOCK then release the lock 044EE EC001EF4 275 STZ NVMBSYLOCK 044EF 0C800000 275 ION 000044F0 276 LETGOMORE LABEL 044F0 DC00354F 277 CALL DQUEONE release anyone waiting 044F1 41001DAC 278 PAR SQDIOWAIT from this queue 044F2 40441EF4 IMM 279 PARVL ADR NVMBSYLOCK waiting for the NVM 044F3 FA0C44F0 0 280 JNEZ R0 LETGOMORE jump if someone was released, 281 * \ / we want to clean out the queue 044F4 80D2C000 3 REG 282 PFRC PFPTR destroy the mapping 044F5 5D1F8001 6 STAK 283 LEAVE POP return 284 * --- 285 286 ********************************************************************************** 287 * * 288 * We come here if the clock has died during a power * 289 * failure or other anomaly causing a timeout. This may also * 290 * occur if an FS type is adjusting the clock back. If it is a * 291 * short interval, just stay here until the clock passes FDATE. * 292 * If it is a long interval, fix the times in the TIMERQ and * 293 * hope that you don't get a file serial number duplicate. We * 294 * won't stop here during boot because FDATE is initialized to * 295 * zeros. INITPROC will fix the clock. * 296 * * 297 ********************************************************************************** 298 000044F6 299 BADTIME LABEL 044F6 00880700 300 STOP STOPH0700 clock went backwards 044F7 FE0E44D4 301 JMP USEASTIME 302 * --- 303 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 916 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 304 END SSU_RESET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 917 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 306 307 ********************************************************************************** 308 * * 309 * TIMER SET ROUTINE * 310 * This routine keeps track of the entire queue of clock * 311 * requests. The set routine inserts new entries into the queue * 312 * in time order, resetting the interval timer if a new entry * 313 * goes on at the head of the queue. * 314 * Interrupts MUST be off when called. * 315 * SP = stack pointer * 316 * CALL TIMESET destroys R0, R1, and R2 before the * 317 * parameters are passed * 318 * caller must not destroy R2 * 319 * PARV2 * 320 * PARV * 321 * PAR * 322 * PARVL * 323 * * 324 * * 325 * CALLED ROUTINE * 326 * When the time is up, a CALLNP to the callback location * 327 * is executed. The interrupts are off. The called routine * 328 * must be resident (must not page fault). The parameter is * 329 * in R3 at that time. SP contains a stack pointer. The * 330 * entire stack is available to the called routine. The * 331 * called routine may destroy any registers except SP, but it * 332 * must return. The called routine may call TIMESET or any of * 333 * the other SSU routines. * 334 * * 335 * Eats R0:R3, sets R4 * 336 * Stack required = 2 * 337 * 1 + max ( LOCKWAIT (0), SETALARM (1), SGETMEM (0), * 338 * TIMENOW (1) ) * 339 * * 340 ********************************************************************************** 341 342 BLOCK TIMESET subroutine 343 ENTRY TIMESET 344 345 BEGFRAME 346 ENDFRAME 347 044F8 DD9F8001 6 STAK 348 TIMESET ENTRS PUSH 044F9 DC002ED0 349 CALL SGETMEM get a piece of memory 044FA 40440003 IMM 350 PARVL TMRLOG for the timer queue element 044FB 60920000 2 0 REG 351 LD R2 R0 copy the pointer 044FC DCD3C000 7 REG 352 EXPCS R7 back to pick up the parameters 044FD C3568801 2 BASE 353 STPV2 R2,TMRTIME save the time interval 044FE C1488043 2 ZBM 354 STPV R2,TMRCPU ... the cpu number 044FF C1089F13 2 ZBM 355 STP R2,TMRPC ... the callback address 04500 C0568805 2 BASE 356 STPVL R2,TMRPARAM ... and the parameter 04501 61128000 4 2 REG 357 LD TMR R2 copy the pointer 04502 DC404532 358 CALLNP TIMENOW get current time in R0,R1 04503 9A170801 014 BASE 359 ADD2M R0 TMR,TMRTIME make time interval into actual time 360 PLOCK TIMERLOCK lock the timer queue 04504 0CC00000 360 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 918 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 04505 D1C01EF1 360 SETT TIMERLOCK 04506 FE0C4508 360 JNE MA(2+DISPW MA 0) 04507 DC40308B 360 CALLNP LOCKWAIT 361 04508 BC001EF0 0 362 INCL R0 TIMESERIAL get the next available serial number 04509 E4170804 0 4 BASE 363 ST R0 TMR,TMRSERIAL save in element 364 0450A 62970801 234 BASE 365 LD2 R2 TMR,TMRTIME get insertion sort value (time of int) 0450B 60441EF2 1 IMM 366 LD R1 ADR TIMERQ get address of list head 0450C 60001EF2 0 367 LD R0 TIMERQ and address of first element 0450D 4E960801 230 BASE 368 RLSLE2 R2 R0,TMRTIME now search for insertion point 369 0450E E4170800 0 4 BASE 370 ST R0 TMR,TMRLINK hook tail of list behind us 0450F E5164800 4 1 BASE 371 ST TMR R1,TMRLINK insinuate us into the list 04510 64441EF2 1 IMM 372 CPR R1 ADR TIMERQ check for us being new first element 04511 FE0C4513 373 JNE INSERTDONE jump if not 374 * \ / 375 376 ********************************************************************************** 377 * * 378 * The element that is now the head of the list needs * 379 * to have the clock set to correspond to it. * 380 * * 381 ********************************************************************************** 382 383 * \ / 04512 DC404567 384 CALLNP SETALARM set up timer to reflect this element 00004513 385 INSERTDONE LABEL 04513 61170804 4 4 BASE 386 LD TMR TMR,TMRSERIAL get this elements serial number 387 PUNLOCK TIMERLOCK release the timer queue 04514 EC001EF1 387 STZ TIMERLOCK 04515 0C800000 387 ION 04516 5D1F8001 6 STAK 388 LEAVE POP 389 * --- 390 391 END TIMESET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 919 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 393 394 ********************************************************************************** 395 * * 396 * TIME KILL ROUTINE * 397 * This routine is called when an already set up * 398 * time interrupt must be deleted. This routine searches * 399 * the queue for the indicated interrupt and removes it * 400 * from the queue. We reset the alarm if we removed the * 401 * first element. * 402 * Interrupts MUST be off to call this routine!!!! * 403 * It is possible for the interrupt to already be * 404 * posted in the hardware, however, this condition should * 405 * be handled okay by the interrupt routine. * 406 * Call: * 407 * interrupts off * 408 * TMR = serial number of time queue element * 409 * SP = stack pointer * 410 * CALLNP TIMEKILL * 411 * * 412 * * 413 * Eats R0:R3, TMR * 414 * Stack required = 2 * 415 * 1 + max( LOCKWAIT (0), SETALARM (1), SFREEMEM (0), * 416 * TIMENOW (1) ) * 417 * * 418 ********************************************************************************** 419 420 BLOCK TIMEKILL subroutine 421 ENTRY TIMEKILL 422 423 BEGFRAME 424 ENDFRAME 425 04517 DD5F8001 6 STAK 426 TIMEKILL ENTRNP PUSH 427 PLOCK TIMERLOCK lock the timer queue 04518 0CC00000 427 IOFF 04519 D1C01EF1 427 SETT TIMERLOCK 0451A FE0C451C 427 JNE MA(2+DISPW MA 0) 0451B DC40308B 427 CALLNP LOCKWAIT 0451C 60001EF2 0 428 LD R0 TIMERQ get the list head 0451D 38401EF2 1 429 LEA R1 TIMERQ get address of the list head 0451E 49160804 4 0 BASE 430 RLSRCH TMR R0,TMRSERIAL search for element with desired SN 0451F FE0C452F 431 JNE TIMEKGONE jump if element not in list 04520 61120000 4 0 REG 432 LD TMR R0 copy address of element 04521 60960800 2 0 BASE 433 LD R2 R0,TMRLINK get the forward ptr from this element 04522 E4964800 2 1 BASE 434 ST R2 R1,TMRLINK remove us from the list 04523 19C40001 7 IMM 435 ADD R7 1 advance the return address 04524 64441EF2 1 IMM 436 CPR R1 ADR TIMERQ check, were we first? 437 * Condition bits saved until later 04525 DC404532 438 CALLNP TIMENOW 04526 32170801 014 BASE 439 RSB2 R0 TMR,TMRTIME calculate now to requested 04527 60840000 2 IMM 440 LD R2 0 04528 FA18452A 0 441 JLTZ2 R0 NOTPASSED if time went by return zero 04529 60924000 2 1 REG 442 LD R2 R1 return real difference 443 * \ / 444 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 920 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 0000452A 445 NOTPASSED LABEL 0452A DC002F5D 446 CALL SFREEMEM release this element 0452B 41440003 IMM 447 PARV TMRLOG indicate the size 0452C 40530000 4 REG 448 PARVL TMR and address 0452D FE0C452F 449 JNE TIMEKGONE jump if we didn't touch first queue element 0452E DC404567 450 CALLNP SETALARM re-set the fence if needed 451 * \ / 452 0000452F 453 TIMEKGONE LABEL 454 PUNLOCK TIMERLOCK release the timer queue 0452F EC001EF1 454 STZ TIMERLOCK 04530 0C800000 454 ION 04531 5D1F8001 6 STAK 455 LEAVE POP 456 * --- 457 458 END TIMEKILL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 921 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 460 461 ********************************************************************************** 462 * * 463 * TIMENOW * 464 * This routine goes to the clock and determines the * 465 * current time. FDATE is set to the current time, except * 466 * that it may not decrease. * 467 * Fetches from the SSU are slower than memory fetches. * 468 * In order to avoid constantly checking the clock upper * 469 * half ( which only changes once every six weeks ) we check * 470 * to see if the the right half is smaller than it was on * 471 * the previous check. If the new right half is smaller, * 472 * we assume that the rollover has recently occurred and * 473 * we read the upper half from the SSU. * 474 * The newer revision SSUs will update FDATE for us so * 475 * we check for a new SSU and if it is there pick up FDATE. * 476 * Call: * 477 * SP = stack pointer * 478 * CALLNP TIMENOW * 479 * * 480 * Eats R0, R1, R3 * 481 * stack required = 1 * 482 * * 483 ********************************************************************************** 484 485 BLOCK TIMENOW subroutine 486 ENTRY TIMENOW 487 488 BEGFRAME 489 ENDFRAME 490 04532 DD5F8001 6 STAK 491 TIMENOW ENTRNP PUSH 04533 5C001EE4 492 CMZ SSUVER new SSU? 04534 FE0C4547 493 JNE QUICKTIME if so don't waste time here 494 * \ / 495 496 PLOCK FDATELOCK get access to FDATE for modify 04535 0CC00000 496 IOFF 04536 D1C01EE8 496 SETT FDATELOCK 04537 FE0C4539 496 JNE MA(2+DISPW MA 0) 04538 DC40308B 496 CALLNP LOCKWAIT 04539 60C40086 3 IMM 497 LD PFPTR PNCIX set up for channel page 0453A 00C01EDE 498 LDPF CLOCKPF point to the clock board 0453B 60001EE5 0 499 LD R0 FDATE 0453C 60401802 1 500 LD R1 CIX(SSUCLOCKL) fetch the current clock value 0453D 68401EE6 1 501 UCPR R1 FDATE(1) check to see if recently rolled over 0453E FE044540 502 JGT TOK jump if rollover unlikely 0453F 60001801 0 503 LD R0 CIX(SSUCLOCKU) may have rolled, get new upper 00004540 504 TOK LABEL 04540 80D2C000 3 REG 505 PFRC PFPTR unmap from the clock 04541 66001EE5 01 506 CPR2 R0 FDATE check against current date 04542 FE084544 507 JLT NOCHANGE jump if FDATE has counted faster than clock 04543 E6001EE5 01 508 ST2 R0 FDATE update time 00004544 509 NOCHANGE LABEL 510 PUNLOCK FDATELOCK release lock 04544 EC001EE8 510 STZ FDATELOCK 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 922 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 04545 0C800000 510 ION 04546 5D1F8001 6 STAK 511 LEAVE POP return 512 * --- 513 00004547 514 QUICKTIME LABEL 04547 62001EE5 01 515 LD2 R0 FDATE pick up the time 04548 5D1F8001 6 STAK 516 LEAVE POP and get out of here 517 * --- 518 519 END TIMENOW subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 923 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 521 522 ********************************************************************************** 523 * * 524 * Routines to get file sequence numbers and dates. * 525 * GETDATE and GETFSEQN return a 44 bit clock value in R0,R1. * 526 * GETFDATE returns a 32 bit date in R0. * 527 * Stack required = 1 * 528 * * 529 ********************************************************************************** 530 531 BLOCK GETDATE subroutine 532 ENTRY GETDATE 533 534 BEGFRAME 535 ENDFRAME 536 04549 DD5F8001 6 STAK 537 GETDATE ENTRNP PUSH 0454A 62001EE5 01 538 LD2 R0 FDATE get the current clock 0454B 68441388 1 IMM 539 UCPR R1 5*MSECSS check for recent rollover 0454C FE06454E 540 JGE GETDALV falls through for 5 seconds every six weeks 0454D 60001EE5 0 541 LD R0 FDATE reload the upper half to ensure 542 * that the halves make sense together 0000454E 543 GETDALV LABEL 0454E 5D1F8001 6 STAK 544 LEAVE POP return 545 * --- 546 547 END GETDATE subroutine 548 549 BLOCK GETFDATE subroutine 550 ENTRY GETFDATE 551 552 BEGFRAME 553 ENDFRAME 554 0454F DD5F8001 6 STAK 555 GETFDATE ENTRNP PUSH 04550 60101EE7 0 @ 556 LD R0 @FDATEPTR set R0 to current date, short form 04551 5C0A1940 0 CBM 557 CMZ R0/BITS 12:31 check part that came from low word 04552 FE0C4554 558 JNE GETFDLV jump if not near rollover 04553 60101EE7 0 @ 559 LD R0 @FDATEPTR get again if maybe just rolled over 00004554 560 GETFDLV LABEL 04554 5D1F8001 6 STAK 561 LEAVE POP 562 * --- 563 564 END GETFDATE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 924 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 566 567 ********************************************************************************** 568 * * 569 * GETFSEQN * 570 * This routine is used to get a unique serial number in * 571 * R0:R1. The number used is FDATE. This number represents the * 572 * current time, however, it is advanced after it is picked up * 573 * for serial number use. When a clock interrupt comes in, it * 574 * can never set FDATE back. * 575 * As an undesirable side effect, a user can actually cause * 576 * FDATE to advance faster than real time. This might produce * 577 * some awkwardness when FDATE is used as the actual time, but * 578 * tough. * 579 * If a new SSU is on the system it is keeping FDATE * 580 * constantly correct. In this case we cannot set FDATE ahead * 581 * and assure unique serial numbers so we keep the most recent * 582 * dispensed serial number in FSNDATE and if FDATE is smaller or * 583 * equal to this increment FSNDATE and hand that back as the new * 584 * serial number. * 585 * * 586 ********************************************************************************** 587 588 BLOCK GETFSEQN subroutine 589 ENTRY GETFSEQN 590 591 BEGFRAME 592 ENDFRAME 593 04555 DD5F8001 6 STAK 594 GETFSEQN ENTRNP PUSH 595 PLOCK FDATELOCK ensure no competition for update 04556 0CC00000 595 IOFF 04557 D1C01EE8 595 SETT FDATELOCK 04558 FE0C455A 595 JNE MA(2+DISPW MA 0) 04559 DC40308B 595 CALLNP LOCKWAIT 0455A 62001EE5 01 596 LD2 R0 FDATE get the current clock 0455B 5C001EE4 597 CMZ SSUVER new SSU? 0455C FE0C4561 598 JNE NEWWAY if so do this the new way 599 * \ / 600 0455D D2001EE5 601 INC2 FDATE increase the time to ensure uniqueness 0000455E 602 UNDOFLOCK LABEL 603 PUNLOCK FDATELOCK release the lock 0455E EC001EE8 603 STZ FDATELOCK 0455F 0C800000 603 ION 04560 5D1F8001 6 STAK 604 LEAVE POP return 605 * --- 606 00004561 607 NEWWAY LABEL 04561 6A001EE9 01 608 UCPR2 R0 FSNDATE is FDATE newer than FSNDATE? 04562 FE044565 609 JGT HAVESN if so then use it 04563 62001EE9 01 610 LD2 R0 FSNDATE use FSNDATE instead 04564 D2140000 01 PAIR 611 INC2 PAIR R0 make it unique 00004565 612 HAVESN LABEL 04565 E6001EE9 01 613 ST2 R0 FSNDATE save for next time 04566 FE0E455E 614 JMP UNDOFLOCK unlock and leave 615 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 925 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 616 617 END GETFSEQN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 926 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 619 620 ********************************************************************************** 621 * * 622 * SETALARM * 623 * This routine sets up the fence register to provide an * 624 * interrupt at the time indicated by the first queue element. * 625 * We make the assumption that no interval exceeds 65535 * 626 * milliseconds. If longer intervals exist, we may get fake * 627 * interrupts because of fence aliasing. The CPR2 in the * 628 * interrupt handler will sort them out. This will only be * 629 * a consideration during initialization, since during normal * 630 * system operation there are always one second front panel * 631 * interrupts, two second TICK interrupts, etc. * 632 * * 633 * Eats R0, R3 * 634 * Uses CIX window * 635 * Stack required = 1 * 636 * * 637 ********************************************************************************** 638 639 BLOCK SETALARM subroutine 640 ENTRY SETALARM 641 642 BEGFRAME 643 ENDFRAME 644 04567 DD5F8001 6 STAK 645 SETALARM ENTRNP PUSH 04568 60C40086 3 IMM 646 LD PFPTR PNCIX set up for channel page 04569 00C01EDE 647 LDPF CLOCKPF point to the clock board 0456A 60001EF2 0 648 LD R0 TIMERQ get the head of the queue 0456B FA304570 0 649 JZA R0 SETALARMY jump if nothing there 0456C 60160802 0 0 BASE 650 LD R0 R0,TMRTIME(1) get the time for the interrupt 0000456D 651 SETALARMX LABEL 0456D E4001809 0 652 ST R0 CIX(SSUFENCE) set the fence value 0456E 80D2C000 3 REG 653 PFRC PFPTR unmap the virtual page 0456F 5D1F8001 6 STAK 654 LEAVE POP return 655 * --- 656 00004570 657 SETALARMY LABEL 04570 60001802 0 658 LD R0 CIX(SSUCLOCKL) get the current time 04571 180403E8 0 IMM 659 ADD R0 MSECSS make time in the near future 04572 FE0E456D 660 JMP SETALARMX pretend came from legitimate queue element 661 * --- 662 663 END SETALARM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 927 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 665 666 ********************************************************************************** 667 * * 668 * CLOCK ADJUSTER * 669 * Clock adjust routine. This routine will slowly (so as * 670 * not to frighten the accounting routines or user benchmarks) * 671 * adjust the clock on the SSU. If the FDATERROR word is * 672 * positive, we add one to the clock and decrement FDATERROR * 673 * each time through. Conversly for a fast clock. * 674 * The frequency with which this routine is scheduled * 675 * has been set to provide 1000 ppm as the correction rate. * 676 * * 677 * Stack required = 2 * 678 * 0 + TIMESET(2) * 679 * * 680 ********************************************************************************** 681 682 BLOCK TIMEADJUST subroutine 683 ENTRY TIMEADJUST 684 04573 DD534000 5 REG 685 TIMEADJUST ENTRNP R5 04574 5C001EED 686 CMZ FDATERROR check sense of correction term 04575 FE024582 687 JEQ TAEXIT jump if no offset error 04576 60C40086 3 IMM 688 LD PFPTR PNCIX get the I/O window page number 04577 00C01EDE 689 LDPF CLOCKPF make point to clock 04578 FE084583 690 JLT TARETARD jump if clock fast 04579 EDC01803 691 STW CIX(SSUINCCLK) add extra tick to clock 0457A D0401EED 692 DEC FDATERROR and remove one from correction term 0000457B 693 TAUNLOAD LABEL 0457B 80D2C000 3 REG 694 PFRC PFPTR unmap the clock 0457C FE024582 695 JEQ TAEXIT avoid rescheduling if not needed 0457D DC0044F8 696 CALL TIMESET call the timer routine 0457E 434403E8 IMM 697 PARV2 1000 indicate interval to next correction 0457F 41440000 IMM 698 PARV 0 don't care which CPU 04580 41004573 699 PAR TIMEADJUST come to this routine 04581 40440000 IMM 700 PARVL 0 parameter is don't care 00004582 701 TAEXIT LABEL 04582 5D134000 5 REG 702 LEAVE R5 return 703 * --- 704 00004583 705 TARETARD LABEL code for fast clock 04583 EDC01804 706 STW CIX(SSUDECCLK) subtract one tick 04584 D0001EED 707 INC FDATERROR and adjust correction term 04585 FE0E457B 708 JMP TAUNLOAD return to main line code 709 * --- 710 711 END TIMEADJUST subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 928 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 713 714 ********************************************************************************** 715 * * 716 * Clock rate fixer. The system clock is driven by a * 717 * quartz crystal oscillator and has the following error * 718 * sources: * 719 * 1) initial rate error (accuracy) 10 ppm * 720 * 2) crystal aging 5 ppm/year * 721 * 3) temperature stability 5 ppm (0-50 C) * 722 * When the system operator specifies a clock error (as * 723 * number of seconds fast or slow) the system, in addition to * 724 * setting FDATERROR to accomplish the correction, calculates * 725 * FDATEDRFT, the total apparent error in the clock rate. * 726 * FDATEDRFT is set up as the number of parts per billion * 727 * error in the clock. * 728 * Positive means add ticks. Negative means delete ticks. * 729 * Stack required = 2 * 730 * 0 + TIMESET(2) * 731 * * 732 ********************************************************************************** 733 734 BLOCK TIMEDRFT subroutine 735 ENTRY TIMEDRFT 736 04586 DD534000 5 REG 737 TIMEDRFT ENTRNP R5 04587 61001EEE 4 738 LD R4 FDATEDRFT get the rate error factor 04588 FB024596 4 739 JEQZ R4 TAEXIT jump if no error indicated 04589 60C40086 3 IMM 740 LD PFPTR PNCIX get the I/O window page number 0458A 00C01EDE 741 LDPF CLOCKPF make point to clock 0458B FB044597 4 742 JGTZ R4 CLKRUP jump if we must add ticks 0458C EDC01804 743 STW CIX(SSUDECCLK) subtract a tick from the clock 0458D 71130000 4 4 REG 744 LDN R4 R4 make factor positive 0000458E 745 CLKRUNLOAD LABEL 0458E 80D2C000 3 REG 746 PFRC PFPTR clear the page file for the I/O window 0458F DC0044F8 747 CALL TIMESET set up an interrupt 04590 62130000 014 REG 748 LD2 R0 R4 get the magnitude of the error (in PPB) 04591 36004599 01 749 RDV2 R0 ABILLION produce the interval between correction ticks 04592 43540000 01 PAIR 750 PARV2 PAIR R0 pass the interval 04593 41440000 IMM 751 PARV 0 don't care which CPU 04594 41004586 752 PAR TIMEDRFT routine to call 04595 40440000 IMM 753 PARVL 0 don't care parameter 00004596 754 TAEXIT LABEL 04596 5D134000 5 REG 755 LEAVE R5 return to caller 756 * --- 757 00004597 758 CLKRUP LABEL 04597 EDC01803 759 STW CIX(SSUINCCLK) add an extra count to the clock 04598 FE0E458E 760 JMP CLKRUNLOAD return to main line code 761 * --- 762 0459A 3B9ACA00 763 ABILLION VFD 0,1000000000 a billion 764 765 END TIMEDRFT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 929 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 767 768 ********************************************************************************** 769 * One hour interrupt routine. Note that this routine * 770 * recalculates the next interrupt each time. This is so it * 771 * always happens on the hour (except for a single execution * 772 * following a system stop). We prevent two interrupts within * 773 * one minute of each other by a special check. The only thing * 774 * that this routine does is to create a process that will write * 775 * the current time and clock correction numbers onto the * 776 * security block. A process must be created because of the * 777 * required disk transfers. If the time happens to be off due * 778 * to the 6 week rollover, we will have an extra hourint and * 779 * then it will reset. * 780 * * 781 * Stack required = 4. * 782 * 1 + max ( BLDPROCESS(2), MAPINMEM (3), SETRUNNING(2), * 783 * TIMESET (2) ) * 784 * * 785 ********************************************************************************** 786 787 BLOCK HOURINT subroutine 788 ENTRY HOURINT 789 790 BEGFRAME 791 ENDFRAME 792 0459B DD5F8001 6 STAK 793 HOURINT ENTRNP PUSH 0459C 62801EE5 23 794 LD2 R2 FDATE R2,R3 = now 0459D 58C40010 IMM 795 IORPSR PSRMODIF turn on funny arithmetic 0459E 1480255B 2 796 DIV R2 ONEHOUR R3 = amount into the hour 0459F 58840010 IMM 797 CLBPSR PSRMODIF restore normalcy 045A0 30C0255B 3 798 RSB R3 ONEHOUR R3 = amount until next hour 045A1 64C4EA60 3 IMM 799 CPR R3 1*MSECSM greater than one minute? 045A2 FE0645A4 800 JGE WAITTHIS jump if long time 045A3 18C0255B 3 801 ADD R3 ONEHOUR if less then 1 min, wait out a full hour 000045A4 802 WAITTHIS LABEL 045A4 DC0044F8 803 CALL TIMESET set up interrupt for next hour 045A5 4352C000 3 REG 804 PARV2 R3 pass calculated time to next hour 045A6 41440000 IMM 805 PARV 0 don't care which CPU 045A7 4100459B 806 PAR HOURINT call this routine again 045A8 40440000 IMM 807 PARVL 0 no parameter 808 * \ / 809 * build hour processing routine 045A9 0CC00000 810 IOFF we must not be interrupted 045AA DC0035D2 811 CALL BLDPROCESS build the process 045AB 4144F1F0 IMM 812 PARV MONMSR indicate what for MSR 045AC 434045B4 813 PARV2 HOURPROCNM pass the name 045AD 414454C5 IMM 814 PARV ADR HOURPROC indicate where the process is to start 045AE 40440001 IMM 815 PARVL 1 this is a system process 045AF DC402B99 816 CALLNP SETRUNNING set this new process running 045B0 DC0025EB 817 CALL MAPINMEM re-map original caller 045B1 40400412 818 PARVL CPPSA pointer to the PSA 045B2 0C800000 819 ION turn interrupts back on 820 * \ / 821 * return to the clock driver 045B3 5D1F8001 6 STAK 822 LEAVE POP 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 930 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 823 * --- 824 045B4 B674F8A9 825 HOURPROCNM PAK12 SYS_HOURPROC 826 827 END HOURINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 931 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 829 830 ********************************************************************************** 831 * * 832 * NVMREAD * 833 * Routine to read a single byte from the NVM. * 834 * Caller may be suspended. * 835 * Call: * 836 * CALL NVMREAD * 837 * PARVL
* 838 * Eats R0, R1. Value returned in R1. * 839 * Stack required = 3 * 840 * 3 + max ( LOCKWAIT (0), SUSPENDME (0) ) * 841 * * 842 ********************************************************************************** 843 844 BLOCK NVMREAD subroutine 845 ENTRY NVMREAD to read a single byte from the NVM 846 847 BEGFRAME 00178801 6 BASE 848 DATASAVE BSS 1 to save the data byte 00178802 6 BASE 849 REGSAVE BSS 1 to save registers 850 ENDFRAME 851 045B6 DD1F8003 6 STAK 852 NVMREAD ENTR PUSH 045B7 C0524000 1 REG 853 STPVL R1 get desired location 045B8 E4D78802 3 6 BASE 854 ST PFPTR SP,REGSAVE save this register 000045B9 855 RDNVMOVER LABEL 856 PLOCK NVMBSYLOCK gain access to the controlling flag 045B9 0CC00000 856 IOFF 045BA D1C01EF4 856 SETT NVMBSYLOCK 045BB FE0C45BD 856 JNE MA(2+DISPW MA 0) 045BC DC40308B 856 CALLNP LOCKWAIT 045BD 5C001EF5 857 CMZ NVMBSYFLAG check for long operation in progress 045BE FE0C45CB 858 JNE SUSP4NVM jump if NVM busy with write 045BF 60C40086 3 IMM 859 LD PFPTR PNCIX get I/O window page number 045C0 60001EDE 0 860 LD R0 CLOCKPF get the normal page map value 045C1 18040001 0 IMM 861 ADD R0 (SSUNVM-SSUCOFFSET)/WPP move to NVM location 045C2 00D20000 0 REG 862 LDPF R0 and set up mapping 045C3 60221800 0 1 863 LD R0 CIX(R1) read out the data 045C4 E4178801 0 6 BASE 864 ST R0 SP,DATASAVE save the byte read 045C5 80D2C000 3 REG 865 PFRC PFPTR destroy the mapping 866 PUNLOCK NVMBSYLOCK release the list 045C6 EC001EF4 866 STZ NVMBSYLOCK 045C7 0C800000 866 ION 045C8 60D78802 3 6 BASE 867 LD PFPTR SP,REGSAVE restore this register 868 * if readers are suspended behind a writer, they 869 * are all released when the writer finishes. 045C9 60578801 1 6 BASE 870 LD R1 SP,DATASAVE get the result to return 045CA 5D1F8003 6 STAK 871 LEAVE POP 872 * --- 873 000045CB 874 SUSP4NVM LABEL 045CB DC00351C 875 CALL SUSPENDME call for suspension 045CC 410045B9 876 PAR RDNVMOVER indicate restart address 045CD 41041EF4 IMM 877 PAR ADR NVMBSYLOCK parameter for shutdown 045CE 41001DAC 878 PAR SQDIOWAIT use direct I/O wait queue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 932 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 045CF 40001EF4 879 PARL NVMBSYLOCK what to unlock 880 * --- 881 882 END NVMREAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 933 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 884 885 ********************************************************************************** 886 * * 887 * NVMSTORE * 888 * Routine to store a single byte into the NVM. * 889 * Caller may be suspended. * 890 * Call: * 891 * CALL NVMSTORE eats R1 during parameter passing * 892 * PARV
* 893 * PARVL * 894 * Eats R0, R1 * 895 * Stack required = 3 * 896 * 3 + max ( LOCKWAIT (0), SUSPENDME (0) ) * 897 * * 898 ********************************************************************************** 899 900 BLOCK NVMSTORE subroutine 901 ENTRY NVMSTORE to store a byte into the NVM 902 903 BEGFRAME 00178801 6 BASE 904 DATASAVE BSS 1 place to save the data byte 00178802 6 BASE 905 REGSAVE BSS 1 to save R3 906 ENDFRAME 907 045D0 DD1F8003 6 STAK 908 NVMSTORE ENTR PUSH 045D1 C1524000 1 REG 909 STPV R1 get the address 045D2 C0578801 6 BASE 910 STPVL SP,DATASAVE get the data byte 045D3 E4D78802 3 6 BASE 911 ST PFPTR SP,REGSAVE save this register 000045D4 912 WRNVMOVER LABEL 913 PLOCK NVMBSYLOCK gain access to the flag 045D4 0CC00000 913 IOFF 045D5 D1C01EF4 913 SETT NVMBSYLOCK 045D6 FE0C45D8 913 JNE MA(2+DISPW MA 0) 045D7 DC40308B 913 CALLNP LOCKWAIT 045D8 D1C01EF5 914 SETT NVMBSYFLAG is the NVM busy now? set if not 045D9 FE0245E5 915 JEQ SUSP4WNVM jump if so, we must suspend 045DA 60C40086 3 IMM 916 LD PFPTR PNCIX get the I/O window page number 045DB 60001EDE 0 917 LD R0 CLOCKPF get the normal page map value 045DC 18040001 0 IMM 918 ADD R0 (SSUNVM-SSUCOFFSET)/WPP move to point to NVM 045DD 00D20000 0 REG 919 LDPF R0 set up mapping to NVM 045DE 60178801 0 6 BASE 920 LD R0 SP,DATASAVE get the date byte 045DF E4221800 0 1 921 ST R0 CIX(R1) and do the store 045E0 80D2C000 3 REG 922 PFRC PFPTR undo the mapping 923 PUNLOCK NVMBSYLOCK release the critical region 045E1 EC001EF4 923 STZ NVMBSYLOCK 045E2 0C800000 923 ION 045E3 60D78802 3 6 BASE 924 LD PFPTR SP,REGSAVE restore register for caller 045E4 5D1F8003 6 STAK 925 LEAVE POP return 926 * --- 927 000045E5 928 SUSP4WNVM LABEL 045E5 DC00351C 929 CALL SUSPENDME suspend to await NVM completion 045E6 410045D4 930 PAR WRNVMOVER indicate restart address 045E7 41041EF4 IMM 931 PAR ADR NVMBSYLOCK parameter for shutdown 045E8 41001DAC 932 PAR SQDIOWAIT use direct I/O wait queue 045E9 40001EF4 933 PARL NVMBSYLOCK what to unlock 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 934 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 934 * --- 935 936 END NVMSTORE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 935 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 938 939 ********************************************************************************** 940 * * 941 * READNVM * 942 * This routine is provided to read a specific datum * 943 * from the NVM. * 944 * Call: * 945 * CALL READNVM eats R3 during parameter passing * 946 * PARV * 947 * PARVL
* 948 * * 993 * PARVL
* 994 * Eats R0:R3 * 995 * Stack required = 6 * 996 * 3 + NVMSTORE (3) * 997 * * 998 ********************************************************************************** 999 1000 BLOCK WRITENVM subroutine 1001 ENTRY WRITENVM place a datum into the NVM 1002 1003 BEGFRAME 00178801 6 BASE 1004 DATASPOTW BSS2 0 word address for following 00178004 6 CACH 1005 DATASPOT BSSC 8 place to hold the data word 1006 ENDFRAME 1007 045F9 DD1F8003 6 STAK 1008 WRITENVM ENTR PUSH 045FA E6978801 236 BASE 1009 ST2 R2 SP,DATASPOTW save the data on the stack 045FB C152C000 3 REG 1010 STPV R3 save the size 045FC C0528000 2 REG 1011 STPVL R2 and address 045FD E4CBC040 3 7 CBM 1012 ST R3 R7/BITS 0:3 save the size in R7 045FE 38D78004 3 6 CACH 1013 LEA R3 SP,DATASPOT make pointer to data area on stack 000045FF 1014 NEXTBYTE LABEL 045FF DC0045D0 1015 CALL NVMSTORE place the byte into the NVM 04600 41528000 2 REG 1016 PARV R2 indicate the address 04601 4056C400 3 @R 1017 PARVL @R3 and the data byte 04602 18840001 2 IMM 1018 ADD R2 1 advance the NVM address 04603 D092C000 3 REG 1019 INCP R3 and advance the build pointer 04604 D04BC040 7 CBM 1020 DEC R7/BITS 0:3 decrement the count 04605 FE0445FF 1021 JGT NEXTBYTE jump if still more bytes to go 04606 5D1F8003 6 STAK 1022 LEAVE POP return 1023 * --- 1024 1025 END WRITENVM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 937 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 1027 1028 ********************************************************************************** 1029 * * 1030 * FLREADNVM * 1031 * Some data stored in the NVM is duplicated and has * 1032 * a flag indicating which copy to use. Items are updated * 1033 * by changing the copy NOT in use, then changing the flag. * 1034 * Proper flag values are 000 and 0FF. Other values * 1035 * represent a power failure during a previous alteration * 1036 * of the flag (or a defective memory). If other flag values * 1037 * are discovered in the memory, they are overwritten with * 1038 * a 0FF so that everyone will stay together. * 1039 * This routine is provided to read a specific datum * 1040 * from the NVM. * 1041 * Call: * 1042 * CALL FLREADNVM eats R3 during parameter passing * 1043 * PARV * 1044 * PARVL
* 1045 * * 1091 * PARVL
* 1092 * Eats R0:R3 * 1093 * Stack required = 7. * 1094 * 4 + max ( NVMREAD (3), NVMSTORE (3) ) * 1095 * * 1096 ********************************************************************************** 1097 1098 BLOCK FLWRITENVM subroutine 1099 ENTRY FLWRITENVM place a datum into the NVM 1100 1101 BEGFRAME 00178801 6 BASE 1102 DATASPOTW BSS2 0 word address for following 00178004 6 CACH 1103 DATASPOT BSSC 8 place to hold the data word 00178803 6 BASE 1104 ADDWORD BSS 1 holds various address and length items 00098083 6 ZBM 1105 FLAG EQU ADDWORD/CH0 holds the flag read 00099F13 6 ZBM 1106 NVMADDR EQU ADDWORD/FLDADRS holds location of datum 1107 ENDFRAME 1108 04617 DD1F8004 6 STAK 1109 FLWRITENVM ENTR PUSH 04618 E6978801 236 BASE 1110 ST2 R2 SP,DATASPOTW save the data 04619 C152C000 3 REG 1111 STPV R3 save the size 0461A C0499F13 6 ZBM 1112 STPVL SP,NVMADDR and the address 0461B 60899F13 2 6 ZBM 1113 LD R2 SP,NVMADDR fetch up the address for the read 0461C DC0045B6 1114 CALL NVMREAD read the flag from the NVM 0461D 40528000 2 REG 1115 PARVL R2 pass the address 0461E E4498083 1 6 ZBM 1116 ST R1 SP,FLAG save for now 0461F FA424627 1 1117 JEQZ R1 ALTERHI jump if currently using low copy 04620 644400FF 1 IMM 1118 CPR R1 0FF check for other good flag value 04621 FE024628 1119 JEQ ALTERLO jump if currently using high copy 04622 DC0045D0 1120 CALL NVMSTORE fix the flag by storing default 04623 41528000 2 REG 1121 PARV R2 indicate the address 04624 404400FF IMM 1122 PARVL 0FF and the value 04625 D1498083 6 ZBM 1123 STMW SP,FLAG indicate that the flag contains 0FF 04626 FE0E4628 1124 JMP ALTERLO 1125 * --- 1126 00004627 1127 ALTERHI LABEL 04627 1892C000 2 3 REG 1128 ADD R2 R3 advance address to high copy 00004628 1129 ALTERLO LABEL 04628 18840001 2 IMM 1130 ADD R2 1 skip over the flag byte 04629 E4CBC040 3 7 CBM 1131 ST R3 R7/BITS 0:3 save the size in R7 0462A 38D78004 3 6 CACH 1132 LEA R3 SP,DATASPOT make pointer to data area on stack 0000462B 1133 NEXTBYTE LABEL 0462B DC0045D0 1134 CALL NVMSTORE place the byte into the NVM 0462C 41528000 2 REG 1135 PARV R2 indicate the address 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 939 (TIMER) F 46 SSU Driver - NVM, Clock, Front panel 0462D 4056C400 3 @R 1136 PARVL @R3 and the data byte 0462E 18840001 2 IMM 1137 ADD R2 1 advance the NVM address 0462F D092C000 3 REG 1138 INCP R3 and advance the build pointer 04630 D04BC040 7 CBM 1139 DEC R7/BITS 0:3 decrement the count 04631 FE04462B 1140 JGT NEXTBYTE jump if still more bytes to go 1141 * \ / 1142 1143 * Now, indicate that the new word is in place 04632 60899F13 2 6 ZBM 1144 LD R2 SP,NVMADDR get the flags address 04633 60C98083 3 6 ZBM 1145 LD R3 SP,FLAG and the old flag 04634 74C400FF 3 IMM 1146 XOR R3 0FF make the opposite flag 04635 DC0045D0 1147 CALL NVMSTORE and store the new flag value 04636 41528000 2 REG 1148 PARV R2 indicate address 04637 4052C000 3 REG 1149 PARVL R3 and new value 04638 5D1F8004 6 STAK 1150 LEAVE POP return 1151 * --- 1152 1153 END FLWRITENVM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 940 (TIMER) F 46 Front panel flasher 1156 1157 ********************************************************************************** 1158 * * 1159 * This routine flashes the front panel lights to * 1160 * keep the operator (and anyone else looking) happy. * 1161 * * 1162 * Eats R??? * 1163 * Stack required = 3. * 1164 * 3 + max ( LOCKWAIT (0) ) * 1165 * * 1166 ********************************************************************************** 1167 1168 BLOCK FPFLASHER subroutine 1169 ENTRY FPFLASHER update the front panel display 1170 ENTRY FLASHVAL table of the front panel values 1171 1172 BEGFRAME 00178801 6 BASE 1173 SECONDS BSS 1 number of seconds for clock 00178802 6 BASE 1174 MINUTES BSS 1 number of minutes for clock 1175 ENDFRAME 1176 04639 DD5F8003 6 STAK 1177 FPFLASHER ENTRNP PUSH 0463A 60C40086 3 IMM 1178 LD PFPTR PNCIX 0463B 00C01EDE 1179 LDPF CLOCKPF point to the SSU 1180 * \ / 1181 1182 ********************************************************************************** 1183 * Display the next error message for the operator, if any. * 1184 * If there are none, or if we have just displayed the last one, * 1185 * then do the normal frront panel display. * 1186 ********************************************************************************** 1187 1188 * \ / 1189 PLOCK OPMSGLOCK lock the list of messages 0463C 0CC00000 1189 IOFF 0463D D1C01EA7 1189 SETT OPMSGLOCK 0463E FE0C4640 1189 JNE MA(2+DISPW MA 0) 0463F DC40308B 1189 CALLNP LOCKWAIT 04640 BC001EAA 0 1190 INCL R0 OPMSGDISP get next message number to display 04641 60401EA8 1 1191 LD R1 OPMSGLIST R1 -> first message 04642 4C084181 0 1 ZBM 1192 RLSHLE R0 R1,OPMSGID find next message 04643 FE044652 1193 JGT NORMALDISP jump if no more messages 04644 60084181 0 1 ZBM 1194 LD R0 R1,OPMSGID get id of message found 04645 E4001EAA 0 1195 ST R0 OPMSGDISP save for future reference 04646 60964804 2 1 BASE 1196 LD R2 R1,OPMSGTEXT(2) get characters 9..10 of display 04647 78870000 2 IMM 1197 AND R2 0FFFF0000 mask off chars 11.12 04648 60084010 0 1 ZBM 1198 LD R0 R1,OPMSGHORN get bit for the horn 04649 E40AB410 0 2 CBM 1199 ST R0 R2/SSUHORN set it into the word 0464A EC084010 1 ZBM 1200 STZ R1,OPMSGHORN clear bit so horn only sounds once 0464B EDCAB610 2 CBM 1201 STW R2/SSUALARM set bit for alarm light 0464C 62164802 011 BASE 1202 LD2 R0 R1,OPMSGTEXT get chars 1..8 of display 0464D E600180A 01 1203 ST2 R0 MA ((CIX DISPW MA 0)+SSUDISP03) display chars 1..8 0464E E480180C 2 1204 ST R2 CIX(SSUDISP89) display chars 9..10, alarm, horn 1205 PUNLOCK OPMSGLOCK unlock the lock 0464F EC001EA7 1205 STZ OPMSGLOCK 04650 0C800000 1205 ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 941 (TIMER) F 46 Front panel flasher 04651 FE0E46DC 1206 JMP FLSH004 and all done 1207 * --- 1208 00004652 1209 NORMALDISP LABEL 04652 EC001EAA 1210 STZ OPMSGDISP say we are doing normal display 1211 PUNLOCK OPMSGLOCK unlock the list of messages 04653 EC001EA7 1211 STZ OPMSGLOCK 04654 0C800000 1211 ION 1212 * \ / 1213 1214 ********************************************************************************** 1215 * Check the front panel switches to see what we are * 1216 * being asked to display. * 1217 * T R A F : X X X terminal count * 1218 * S E S S : X X X PCCOUNT * 1219 * D R B Z Y : X X X DISKRBUSY * 1220 * B C P U : X X X BUSYCPUS * 1221 * S U N : X X X SYSTEMSUN * 1222 * I D L E P : X X X PPIDLCOUNT * 1223 * D W B Z Y : X X X DISKWBUSY * 1224 * T B U S Y : X X X TERMWBUSY * 1225 * D Y N W : X X X DYNWAIT * 1226 * E C N T : X X X ERRLOGCNT * 1227 * L O A D : X X X LOADFACT * 1228 ********************************************************************************** 1229 1230 * \ / 04655 61401EDF 5 1231 LD R5 FPSWITCH get the front panel switches 04656 7944000F 5 IMM 1232 AND R5 16-1 isolate the relevant bits 04657 FB4246B0 5 1233 JEQZ R5 TIMEFLASH jump if to give the time 04658 1D440003 5 IMM 1234 MUL R5 3 multiply to make table index 04659 606A4681 1 5 1235 LD R1 FLASHVAL(R5) get ptr to value we should display 0465A FA4246B0 1 1236 JEQZ R1 TIMEFLASH no pointer, give time 0465B FA6C4678 1 1237 JEQMW R1 JUSTBLANK this combo is blank display 0465C 602A467F 0 5 1238 LD R0 FIRST(R5) fetch the first 4 chars of display 0465D E400180A 0 1239 ST R0 CIX(SSUDISP03) place the name of the value 0465E 60564400 1 1 @R 1240 LD R1 @R1 fetch the value itself 0465F 60040000 0 IMM 1241 LD R0 0 make into a double word 04660 58C40010 IMM 1242 IORPSR PSRMODIF turn on funny arithmetic 04661 1404000A 0 IMM 1243 DIV R0 10 take out a digit 04662 608046AF 2 1244 LD R2 LAST get some magic unknown quantity 04663 F44A9080 1 2 CBM 1245 XORM R1 R2/CH1 place the rightmost digit 04664 FA024669 0 1246 JEQZ R0 FLSH001 jump if now zero 04665 62120000 010 REG 1247 LD2 R0 R0 make into a double word 04666 1404000A 0 IMM 1248 DIV R0 10 produce another digit 04667 74440030 1 IMM 1249 XOR R1 "0" make into an ascii character 04668 E44A8080 1 2 CBM 1250 ST R1 R2/CH0 store character into display digit 8 00004669 1251 FLSH001 LABEL 04669 E480180C 2 1252 ST R2 CIX(SSUDISP89) place lowest stuff 0466A 60AA4680 2 5 1253 LD R2 MIDDLE(R5) get the middle 4 chars of display 0466B FA024675 0 1254 JEQZ R0 FLSH002 jump if zero suppress 0466C 62120000 010 REG 1255 LD2 R0 R0 make into a double word 0466D 1404000A 0 IMM 1256 DIV R0 10 extract another digit 0466E 74440030 1 IMM 1257 XOR R1 "0" make an ascii digit 0466F E44AB080 1 2 CBM 1258 ST R1 R2/CH3 store into display value 04670 FA024675 0 1259 JEQZ R0 FLSH003 jump if zero suppress 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 942 (TIMER) F 46 Front panel flasher 04671 62120000 010 REG 1260 LD2 R0 R0 make into a double word 04672 1404000A 0 IMM 1261 DIV R0 10 extract a fourth digit 04673 74440030 1 IMM 1262 XOR R1 "0" make into an ascii character 04674 E44AA080 1 2 CBM 1263 ST R1 R2/CH2 store into display value 00004675 1264 FLSH002 LABEL 00004675 1265 FLSH003 LABEL 04675 58840010 IMM 1266 CLBPSR PSRMODIF restore normal arithmetic 04676 E480180B 2 1267 ST R2 CIX(SSUDISP47) place the middle characters 04677 FE0E46DC 1268 JMP FLSH004 return from flasher driver 1269 * --- 1270 1271 * Display only a blank display 00004678 1272 JUSTBLANK LABEL 04678 6000467E 0 1273 LD R0 DISPBLANK get a word of blanks 04679 E400180A 0 1274 ST R0 CIX(SSUDISP03) clear the first 4 characters 0467A E400180B 0 1275 ST R0 CIX(SSUDISP47) and the next 0467B 78070000 0 IMM 1276 AND R0 ONEBITS/(CH0+CH1)*(CH0+CH1) mask off garbage bits 0467C E400180C 0 1277 ST R0 CIX(SSUDISP89) 0467D FE0E46DC 1278 JMP FLSH004 go return 1279 * --- 1280 1281 ********************************************************************************** 1282 * * 1283 * This table is not only used by the SSU driver but it * 1284 * also is used by the OPREQ ORGSYSINFO, to return information * 1285 * about the system. If any changes are made to this table be * 1286 * sure they are compatable with ORGSYSINFO. * 1287 * * 1288 ********************************************************************************** 1289 0467E 20202020 1290 DISPBLANK TEXT " " 1291 0467F 58585858 1292 FIRST TEXT "XXXX" (zero index handled differently) 04680 58585858 1293 MIDDLE TEXT "XXXX" (zero index not used) 04681 00000000 1294 FLASHVAL PTR ZERO (not used) 1295 04682 54524146 1296 TEXT "TRAF: " 04684 00001F02 1297 PTR TERMCOUNT 1298 04685 53455353 1299 TEXT "SESS: " 04687 00001EB0 1300 PTR PCCOUNT 1301 04688 4452425A 1302 TEXT "DRBZY: " 0468A 00001F18 1303 PTR DISKRBUSY 1304 0468B 42435055 1305 TEXT "BCPU: " 0468D 00001D0B 1306 PTR BUSYCPUS 1307 0468E 53554E3A 1308 TEXT "SUN: " 04690 00001EFC 1309 PTR SYSTEMSUN 1310 04691 49444C45 1311 TEXT "IDLEP: " 04693 00001DDA 1312 PTR PPIDLCOUNT 1313 04694 4457425A 1314 TEXT "DWBZY: " 04696 00001F19 1315 PTR DISKWBUSY 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 943 (TIMER) F 46 Front panel flasher 1316 04697 54425553 1317 TEXT "TBUSY: " 04699 00001F05 1318 PTR TERMWBUSY 1319 0469A 44594E57 1320 TEXT "DYNW: " 0469C 00001D0E 1321 PTR DYNWAIT 1322 0469D 45434E54 1323 TEXT "ECNT: " 0469F 00001D98 1324 PTR ERRLOGCNT 1325 046A0 4C4F4144 1326 TEXT "LOAD: " 046A2 00001DD7 1327 PTR LOADFACT 1328 046A5 00000000 1329 VFD 0,0,0 1330 046A8 00000000 1331 VFD 0,0,0 1332 046AB 00000000 1333 VFD 0,0,0 1334 046AE FFFFFFFF 1335 VFD 0,0,-1 1336 046AF 20300000 1337 LAST TEXTZ " 0" 1338 000046B0 1339 TIMEFLASH LABEL 046B0 60401EEF 1 1340 LD R1 TIMEZONE get the timezone indicator 046B1 700A7010 0 1 CBM 1341 LDN R0 R1/BIT 24 get the sign bit 046B2 E40A4180 0 1 CBM 1342 ST R0 R1/BITS 0:23 extend the sign 046B3 1C40255B 1 1343 MUL R1 ONEHOUR convert to milliseconds 046B4 1A001EE5 01 1344 ADD2 R0 FDATE add to now 1345 * could provide bogus display on 6 week boundary 046B5 58C40010 IMM 1346 IORPSR PSRMODIF enable funny arithmetic 046B6 1400255C 0 1347 DIV R0 ONEDAY R0=days since ...,R1=ms in today 046B7 644403E8 1 IMM 1348 CPR R1 1000 check for proximity to midnight 046B8 FE0846E0 1349 JLT DOMIDNIGHT jump if less than one second after 046B9 644046F1 1 1350 CPR R1 NOONTIME check for proximity to noon 046BA FE0846BD 1351 JLT NOTNOON jump if not yet noon 046BB 644046F2 1 1352 CPR R1 NOONTIMEPE check for noon + 1 second 046BC FE0846E7 1353 JLT DONOON jump if within one second of noon 000046BD 1354 NOTNOON LABEL 046BD 62924000 231 REG 1355 LD2 R2 R1 046BE 148403E8 2 IMM 1356 DIV R2 1000 R2=seconds in today, R3=ms in second 046BF 62928000 232 REG 1357 LD2 R2 R2 046C0 1484003C 2 IMM 1358 DIV R2 60 R2=minutes in today, R3=seconds 046C1 E4D78801 3 6 BASE 1359 ST R3 SP,SECONDS save seconds 046C2 62928000 232 REG 1360 LD2 R2 R2 046C3 1484003C 2 IMM 1361 DIV R2 60 R2=hours, R3=minutes 046C4 E4D78802 3 6 BASE 1362 ST R3 SP,MINUTES 046C5 62928000 232 REG 1363 LD2 R2 R2 046C6 1484000A 2 IMM 1364 DIV R2 10 R2=tens of hours, R3=ones of hours 046C7 600046DD 0 1365 LD R0 TIMEW(0) 046C8 F48A1080 2 0 CBM 1366 XORM R2 R0/BITS 8:15 place chars in display 046C9 F4CA2080 3 0 CBM 1367 XORM R3 R0/BITS 16:23 046CA E400180A 0 1368 ST R0 CIX(SSUDISP03) 046CB 60840000 2 IMM 1369 LD R2 0 get most significant zero bits 046CC 60D78802 3 6 BASE 1370 LD R3 SP,MINUTES get the minutes back 046CD 1484000A 2 IMM 1371 DIV R2 10 R2=tens of minutes, R3=ones of minutes 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 944 (TIMER) F 46 Front panel flasher 046CE 600046DE 0 1372 LD R0 TIMEW(1) 046CF F48A0080 2 0 CBM 1373 XORM R2 R0/BITS 0:7 046D0 F4CA1080 3 0 CBM 1374 XORM R3 R0/BITS 8:15 046D1 60840000 2 IMM 1375 LD R2 0 get most significant zero bits 046D2 60D78801 3 6 BASE 1376 LD R3 SP,SECONDS 046D3 1484000A 2 IMM 1377 DIV R2 10 R2=tens of seconds, R3=ones of seconds 046D4 F48A3080 2 0 CBM 1378 XORM R2 R0/BITS 24:31 046D5 E400180B 0 1379 ST R0 CIX(SSUDISP47) 046D6 600046DF 0 1380 LD R0 TIMEW(2) 046D7 F4CA0080 3 0 CBM 1381 XORM R3 R0/BITS 0:7 046D8 5C001EED 1382 CMZ FDATERROR doing clock correction? 046D9 ED8A0010 0 CBM 1383 STLNE R0/BIT 0 turn on decimal point if so 046DA E400180C 0 1384 ST R0 CIX(SSUDISP89) 046DB 58840010 IMM 1385 CLBPSR PSRMODIF funny arithmetic off 000046DC 1386 FLSH004 LABEL 046DC 5D1F8003 6 STAK 1387 LEAVE POP return from processing 1388 * --- 1389 046DD 2030303A 1390 TIMEW TEXTZ " 00:00:00 " 1391 1392 * Exactly midnight 000046E0 1393 DOMIDNIGHT LABEL 046E0 58840010 IMM 1394 CLBPSR PSRMODIF clear modify arithmetic 046E1 620046E4 01 1395 LD2 R0 MIDNIGHTM get midnight message 046E2 608046E6 2 1396 LD R2 MIDNIGHTM(2) get rest of midnight message 046E3 FE0E46EA 1397 JMP DONOONX go share 1398 * --- 046E4 204D4944 1399 MIDNIGHTM TEXTZ " MIDNIGHT " 1400 1401 * Exactly noon 000046E7 1402 DONOON LABEL 046E7 58840010 IMM 1403 CLBPSR PSRMODIF clear modify arithmetic 046E8 620046EE 01 1404 LD2 R0 NOONM get noon message 046E9 608046F0 2 1405 LD R2 NOONM(2) get rest of noon message 000046EA 1406 DONOONX LABEL 046EA E400180A 0 1407 ST R0 CIX(SSUDISP03) put out the message 046EB E440180B 1 1408 ST R1 CIX(SSUDISP47) 046EC E480180C 2 1409 ST R2 CIX(SSUDISP89) 046ED FE0E46DC 1410 JMP FLSH004 done, leave 1411 * --- 046EE 48494748 1412 NOONM TEXTZ "HIGH NOON " 046F1 02932E00 1413 NOONTIME VFD 12*MSECSH noon 046F2 029331E8 1414 NOONTIMEPE VFD 12*MSECSH+MSECSS noon + 1 second 1415 1416 END FPFLASHER subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 945 (TIMER) F 46 GENOPMSG - Generate Message to Operator 1419 1420 ********************************************************************************** 1421 * * 1422 * GENOPMSG - Generate Message to Operator * 1423 * * 1424 * This routine will generate a message to the operator. * 1425 * To use it, you must allocate (via SGETMEM) an OPMSG block and * 1426 * fill in the length, text, and process number fields * 1427 * (OPMSGLEN, OPMSGTEXT and OPMSGPROC), then call us and we take * 1428 * care of the rest. On return, you get back the message serial * 1429 * number, which you can save for future reference to the * 1430 * message. * 1431 * * 1432 * CALL GENOPMSG * 1433 * PARVL address of OPMSG block * 1434 * * 1435 * * 1436 * Eats R1:R3 * 1437 * Sets R0 <= message serial number * 1438 * Stack required = 1 * 1439 * 1 + max ( LOCKWAIT (0) ) * 1440 * * 1441 ********************************************************************************** 1442 1443 BLOCK GENOPMSG subroutine 1444 ENTRY GENOPMSG 1445 1446 BEGFRAME 1447 ENDFRAME 1448 046F3 DD1F8001 6 STAK 1449 GENOPMSG ENTR PUSH 046F4 C0528000 2 REG 1450 STPVL R2 R2 -> OPMSG block 1451 * \ / 1452 1453 ********************************************************************************** 1454 * * 1455 * Convert lower-case to upper case in the first 10 * 1456 * characters of the message. This part goes into the front * 1457 * panel display, which only has a 64 character set. * 1458 * * 1459 ********************************************************************************** 1460 1461 * \ / 046F5 60440009 1 IMM 1462 LD R1 9 000046F6 1463 LOOP LABEL 046F6 601A8808 0 21 CACH 1464 LD R0 R2,OPMSGTEXTC(R1) get a character 046F7 64040061 0 IMM 1465 CPR R0 "a" 046F8 FE084701 1466 JLT NEXT 046F9 6404007A 0 IMM 1467 CPR R0 "z" 046FA FE0A46FF 1468 JLE UPPERFY 046FB 640400E1 0 IMM 1469 CPR R0 080+"a" 046FC FE084701 1470 JLT NEXT 046FD 640400FA 0 IMM 1471 CPR R0 080+"z" 046FE FE044701 1472 JGT NEXT 1473 * \ / 1474 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 946 (TIMER) F 46 GENOPMSG - Generate Message to Operator 000046FF 1475 UPPERFY LABEL 046FF 10040020 0 IMM 1476 SUB R0 "a"-"A" convert char to upper case 04700 E41A8808 0 21 CACH 1477 ST R0 R2,OPMSGTEXTC(R1) and save it 1478 * \ / 00004701 1479 NEXT LABEL 04701 FA6646F6 1 1480 JDR R1 LOOP inspect all ten characters 1481 1482 PLOCK OPMSGLOCK lock the list 04702 0CC00000 1482 IOFF 04703 D1C01EA7 1482 SETT OPMSGLOCK 04704 FE0C4706 1482 JNE MA(2+DISPW MA 0) 04705 DC40308B 1482 CALLNP LOCKWAIT 04706 60168007 0 2 CACH 1483 LD R0 R2,OPMSGLEN get length of message 04707 EC1A8008 20 CACH 1484 STZ R2,OPMSGTEXTC(R0) put NUL at end of message 04708 EC089F10 2 ZBM 1485 STZ R2,OPMSGLINK clear the link 04709 EDC88010 2 ZBM 1486 STW R2,OPMSGHORN set to sound horn when displayed 0470A 60040000 0 IMM 1487 LD R0 0 to search for end of list 0470B 60441EA8 1 IMM 1488 LD R1 ADR OPMSGLIST R1 -> previous to first element 0470C 3C085F10 0 1 ZBM 1489 LSRCH R0 R1,OPMSGLINK find end of list (can't fail) 0470D E4885F10 2 1 ZBM 1490 ST R2 R1,OPMSGLINK put new element on end 0470E BC001EA9 0 1491 INCL R0 OPMSGSER get brand new serial number 0470F E4088181 0 2 ZBM 1492 ST R0 R2,OPMSGID save into message 1493 PUNLOCK OPMSGLOCK unlock the list 04710 EC001EA7 1493 STZ OPMSGLOCK 04711 0C800000 1493 ION 04712 5D1F8001 6 STAK 1494 LEAVE POP all done, R0 = serial number 1495 * --- 1496 1497 END GENOPMSG subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 947 (TIMER) F 46 CANOPMSG - Cancel Operator Message 1500 1501 ********************************************************************************** 1502 * * 1503 * CANOPMSG - Cancel Operator Message * 1504 * * 1505 * This routine will cancel a message to the operator. You * 1506 * must supply the message serial number as returned by GENOPMSG. * 1507 * * 1508 * CALL CANOPMSG * 1509 * PARVL * 1510 * * 1511 * * 1512 * Sets R0, eats R1:R2. * 1513 * Stack required = 1. * 1514 * 1 + max ( LOCKWAIT (0), SFREEMEM (0) ) * 1515 * * 1516 ********************************************************************************** 1517 1518 BLOCK CANOPMSG subroutine 1519 ENTRY CANOPMSG 1520 1521 BEGFRAME 1522 ENDFRAME 1523 04713 DD1F8001 6 STAK 1524 CANOPMSG ENTR PUSH 04714 C0528000 2 REG 1525 STPVL R2 R2 = serial number 1526 PLOCK OPMSGLOCK lock the list 04715 0CC00000 1526 IOFF 04716 D1C01EA7 1526 SETT OPMSGLOCK 04717 FE0C4719 1526 JNE MA(2+DISPW MA 0) 04718 DC40308B 1526 CALLNP LOCKWAIT 04719 60001EA8 0 1527 LD R0 OPMSGLIST R0 -> first element 0471A 60441EA8 1 IMM 1528 LD R1 ADR OPMSGLIST R1 -> previous 0471B 4C880181 2 0 ZBM 1529 RLSHLE R2 R0,OPMSGID find our message 0471C FE0C4727 1530 JNE NOTTHERE jump if not there 0471D 60881F10 2 0 ZBM 1531 LD R2 R0,OPMSGLINK R2 -> following one 0471E E4885F10 2 1 ZBM 1532 ST R2 R1,OPMSGLINK remove us from list 0471F 60920000 2 0 REG 1533 LD R2 R0 R2 -> our message 1534 PUNLOCK OPMSGLOCK unlock the list 04720 EC001EA7 1534 STZ OPMSGLOCK 04721 0C800000 1534 ION 04722 DC002F5D 1535 CALL SFREEMEM free the OPMSG block 04723 41440005 IMM 1536 PARV OPMSGLOG size 04724 40528000 2 REG 1537 PARVL R2 address 04725 60040000 0 IMM 1538 LD R0 0 normal return 04726 FE0E472A 1539 JMP RETURN 1540 * --- 1541 00004727 1542 NOTTHERE LABEL 1543 PUNLOCK OPMSGLOCK unlock the list 04727 EC001EA7 1543 STZ OPMSGLOCK 04728 0C800000 1543 ION 04729 600400AB 0 IMM 1544 LD R0 XREQERNSE error code: no such entry 1545 * \ / 1546 0000472A 1547 RETURN LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 948 (TIMER) F 46 CANOPMSG - Cancel Operator Message 0472A 5D1F8001 6 STAK 1548 LEAVE POP 1549 * --- 1550 1551 END CANOPMSG subroutine 1552 1553 1554 END SSU Routines 82 INPUT ONCEASEC once a second interrupt 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 949 (ONCEASEC) F 47 Once a second interrupt 3 4 ********************************************************************************** 5 * * 6 * ONCEASEC. Several system things occur once a second. This * 7 * routine is called once a second and this performs various display, * 8 * book keeping, and timing routines. Things done are: * 9 * - update the front panel display * 10 * - examine the time wait queue to count the session elapsed time. * 11 * This routine is called out of the SSU interrupt routine so the * 12 * interrupts are very off, so keep it short. * 13 * Eats R??? * 14 * Stack required = 4 * 15 * 1 + max ( FPFLASHER (3), LOCKWAIT (0), SETRUNNING (2), * 16 * TIMESET (2) ) * 17 * * 18 ********************************************************************************** 19 20 BLOCK ONCEASEC subroutine 21 ENTRY ONCEASEC place entered once each second 22 23 BEGFRAME 24 ENDFRAME 25 0472B DD5F8001 6 STAK 26 ONCEASEC ENTRNP PUSH 0472C DC0044F8 27 CALL TIMESET set up for next second 0472D 434403E8 IMM 28 PARV2 1*MSECSS this many milliseconds 0472E 41440000 IMM 29 PARV 0 no particular CPU 0472F 4100472B 30 PAR ONCEASEC call me in a second 04730 40440000 IMM 31 PARVL 0 call parameter is a don't care 32 * \ / 33 * Update the front panel 04731 DC404639 34 CALLNP FPFLASHER update the front panel 35 * \ / 36 37 ********************************************************************************** 38 * * 39 * Scan the sessions in the time wait queue and count their * 40 * time down. Set running the timed out sessions. * 41 * * 42 ********************************************************************************** 43 44 * \ / 45 PLOCK SQLOCKS(NQTIMEWAIT) lock the queue 04732 0CC00000 45 IOFF 04733 D1C01DC8 45 SETT SQLOCKS(NQTIMEWAIT) 04734 FE0C4736 45 JNE MA(2+DISPW MA 0) 04735 DC40308B 45 CALLNP LOCKWAIT 04736 39001DB7 4 46 LEA R4 SQTIMEWAIT R4 => root of list 04737 FB38474A 45 47 RLJZA R4 LISTEMPTY get first element ptr and check empty 48 * \ / 49 00004738 50 NXTTIMER LABEL 04738 60C91F13 3 4 ZBM 51 LD R3 R4,PCPSADRS R3 => PSA 04739 FAF04749 3 52 JZA R3 NOPUSH don't look farther if none 0473A 6088DF10 2 3 ZBM 53 LD R2 R3,PSCACHN R2 => console area 0473B FAB04749 2 54 JZA R2 NOPUSH odd that there is no CA 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 950 (ONCEASEC) F 47 Once a second interrupt 0473C D0568803 2 BASE 55 DEC R2,CAR1 count the second 0473D FE044749 56 JGT NOPUSH jump if more seconds to count 0473E 60040143 0 IMM 57 LD R0 URDELAYR get XREQ to finish delay 0473F 5C089014 2 ZBM 58 CMZ R2,CAR2/BIT CAIMNETERM was waiting for .TERM? 04740 FE0C4743 59 JNE NOSWEAT if so, have him do XREQ 04741 D0089F10 2 ZBM 60 INC R2,CAPC move him past XREQ call 04742 60040000 0 IMM 61 LD R0 0 else, set AOK XREQ return 00004743 62 NOSWEAT LABEL 04743 E4168802 0 2 BASE 63 ST R0 R2,CAR0 set users R0 04744 EC168804 2 BASE 64 STZ R2,CAR2 clear event mask 04745 60091F10 0 4 ZBM 65 LD R0 R4,PCQLINK get link out of this session 04746 E4095F10 0 5 ZBM 66 ST R0 R5,PCQLINK unlink this timed out session 04747 DC402B99 67 CALLNP SETRUNNING set running the timed out session 04748 61134000 4 5 REG 68 LD R4 R5 R4 -> previous PCB 00004749 69 NOPUSH LABEL 04749 FB3A4738 45 70 RLJNA R4 NXTTIMER link to next PCB in list 71 * \ / 72 0000474A 73 LISTEMPTY LABEL 74 PUNLOCK SQLOCKS(NQTIMEWAIT) no more sessions - unlock list 0474A EC001DC8 74 STZ SQLOCKS(NQTIMEWAIT) 0474B 0C800000 74 ION 0474C 5D1F8001 6 STAK 75 LEAVE POP return 76 * --- 77 78 END ONCEASEC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 951 (ONCEASEC) F 47 UNFILEWAIT - Release Jobs From FileWait 81 82 ********************************************************************************** 83 * * 84 * UNFILEWAIT - Release Jobs From FILEWAIT. * 85 * * 86 * Because of some synchronization and interlocking * 87 * problems, it is possible for jobs to end up waiting * 88 * on a file and have nobody using the file. While the * 89 * probability of this is small, it can happen. So, we * 90 * execute this routine periodically, which dumps everyone * 91 * out of FILEWAIT onto the runnable queue. Those who * 92 * should have been waiting will immediately re-queue, * 93 * while those who had been improperly stuck will go on * 94 * their merry way. This is a kludge. * 95 * * 96 * We are called by the timer interrupt routine, and we * 97 * schedule the next call to ourselves before exiting. * 98 * * 99 * CALLNP UNFILEWAIT * 100 * * 101 * Eats R0-R5. * 102 * stack required = 3. * 103 * 1 + max ( LOCKWAIT (0), SETRUNNING (2), TIMESET (2) ) * 104 * * 105 ********************************************************************************** 106 107 BLOCK UNFILEWAIT subroutine 108 ENTRY UNFILEWAIT 109 110 BEGFRAME 111 ENDFRAME 112 0474D DD5F8001 6 STAK 113 UNFILEWAIT ENTRNP PUSH 114 PLOCK SQLOCKS(NQFILEWAIT) lock the filewait queue 0474E 0CC00000 114 IOFF 0474F D1C01DC2 114 SETT SQLOCKS(NQFILEWAIT) 04750 FE0C4752 114 JNE MA(2+DISPW MA 0) 04751 DC40308B 114 CALLNP LOCKWAIT 04752 61001DB1 4 115 LD R4 SQFILEWAIT R4 -> head of list 04753 EC001DB1 116 STZ SQFILEWAIT clear out the list 117 PUNLOCK SQLOCKS(NQFILEWAIT) release the list 04754 EC001DC2 117 STZ SQLOCKS(NQFILEWAIT) 04755 0C800000 117 ION 118 * \ / 119 00004756 120 UFWLOOP LABEL 04756 FB30475B 4 121 JZA R4 UFWDONE jump if no more sessions 04757 61491F10 5 4 ZBM 122 LD R5 R4,PCQLINK R5 -> next one 04758 DC402B99 123 CALLNP SETRUNNING set one guy running 04759 61134000 4 5 REG 124 LD R4 R5 R4 -> next session 0475A FE0E4756 125 JMP UFWLOOP and loop 126 * --- 127 0000475B 128 UFWDONE LABEL 0475B DC0044F8 129 CALL TIMESET do it again later 0475C 4344EA60 IMM 130 PARV2 60*MSECSS one minute later 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 952 (ONCEASEC) F 47 UNFILEWAIT - Release Jobs From FileWait 0475D 41440000 IMM 131 PARV 0 any CPU 0475E 4100474D 132 PAR UNFILEWAIT indicate what routine to call 0475F 40440000 IMM 133 PARVL 0 parameter (don't care) 134 04760 5D1F8001 6 STAK 135 LEAVE POP all done 136 * --- 137 138 END UNFILEWAIT subroutine 83 INPUT CIADRIVER Driver for CIA 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 953 (CIADRIVER) F 48 CIA interrupt routine 3 4 BLOCK CIA Driver 5 6 ENTRY CIA_INT process an interrupt from the CIA 7 ENTRY CIA_RESET do reinitialize of a CIA 8 9 ENTRY STATE15 the CIA port state for shut down 10 ENTRY TIMESHUT code for the shutdown routine 11 ENTRY WAIT120SEC a timing count for shutdown 12 13 ********************************************************************************** 14 * * 15 * This is the driver routine for the Communication * 16 * Interface Adaptor. In the Reset and Initialization routine, * 17 * we set up the interval between interrupts to be 100 ms. * 18 * This interval was chosen since we felt that an interactive * 19 * user was likely to notice longer delays between typing * 20 * characters and the system response. The CIA will override * 21 * this interval and give us an interrupt ahead of time if any * 22 * terminal buffer gets more than 50% full. This should not * 23 * happen with the chosen interval (100 ms), except on a 19200 * 24 * baud terminal, since a 9600 baud terminal will only receive * 25 * 96 characters in that time, although the actual processing * 26 * associated delays may push it slightly over the 128 * 27 * threshold. * 28 * In the current version of CIA microcode, we are able to * 29 * select the read operation before the interrupt occurs. At * 30 * the completion of output processing we set up the PPU and * 31 * CIA to do the next read. This delayed read does not * 32 * actually happen until the interrupt interval has expired. * 33 * We then process the characters and status changes that * 34 * are contained in that read. After the input and status * 35 * processing, we scan all terminals and look for output * 36 * characters or commands and build an output buffer. The * 37 * output buffer is sent to the CIA. On the completion * 38 * interrupt we set up the delayed read (as mentioned above) * 39 * for the next interval. * 40 * The differences to this sequence are abnormal end of * 41 * operations which may come from either the PPU or the CIA. * 42 * No matter who did it, some characters will be lost so all * 43 * we do is log the error and try the operation again. * 44 * The CIA_RESET routine is called at system boot, or * 45 * after a deadman timeout. It clears up the state of the * 46 * device and re-establishes the interrupt parameters. * 47 * * 48 * The port number scheme is a little complex. The * 49 * hardware has its own numbering scheme which is easily * 50 * decoded by a three-bit board and three-bit port number. * 51 * The internal port numbering scheme is based on adding an * 52 * offset to this hardware derived number. An offset of 1 is * 53 * used for the first port so that number zero can be reserved * 54 * for the RFP. However, to make the system a little more * 55 * operator friendly, a matrix form is used when talking to * 56 * the outside world. This scheme is based on an initial * 57 * letter to indicate which Comm, a second letter indicates * 58 * which board on that comm, and a digit indicates which port * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 954 (CIADRIVER) F 48 CIA interrupt routine 59 * on that board (starting with 1 at the top). This table * 60 * should facilitate conversions between the hardware * 61 * addresses and the external form. * 62 * The indices into this table are the external form and * 63 * the entries are given in both decimal and hex. The hex * 64 * entries are especially useful in locating the physical * 65 * board, the decimal entries in converting to the old * 66 * external form. * 67 * * 68 * port A B C D E F H J * 69 * --- --- --- --- --- --- --- --- * 70 * 1 56 48 40 32 24 16 08 00 * 71 * 038 030 028 020 018 010 008 000 * 72 * 2 57 49 41 33 25 17 09 01 * 73 * 039 031 029 021 019 011 009 001 * 74 * 3 58 50 42 34 26 18 10 02 * 75 * 03A 032 02A 022 01A 012 00A 002 * 76 * 4 59 51 43 35 27 19 11 03 * 77 * 03B 033 02B 023 01B 013 00B 003 * 78 * 5 60 52 44 36 28 20 12 04 * 79 * 03C 034 02C 024 01C 014 00C 004 * 80 * 6 61 53 45 37 29 21 13 05 * 81 * 03D 035 02D 025 01D 015 00D 005 * 82 * 7 62 54 46 38 30 22 14 06 * 83 * 03E 036 02E 026 01E 016 00E 006 * 84 * 8 63 55 47 39 31 23 15 07 * 85 * 03F 037 02F 027 01F 017 00F 007 * 86 * * 87 * The first Comm controller encountered during configuration * 88 * is designated with an 'A' and to convert ports on this Comm * 89 * to the internal format add one to the number above. * 90 * The second Comm controller becomes 'B' and add 65. * 91 * The third Comm controller becomes 'C' and add 129. * 92 * * 93 ********************************************************************************** 94 95 * Events logged when CIA traced 00000001 ABS 96 CIATINT EQU 1 interrupt only, R0 = who, R1 = why, R2 = PPU stat 00000002 ABS 97 CIATLV EQU 2 leave, R0 = who, R1 = state on exit 00000003 ABS 98 CIATRST EQU 3 reset, R0 = who 00000004 ABS 99 CIATSTAT EQU 4 status, R0 = recvd bits, R1 = routine, R2 = port 00000005 ABS 100 CIATINCH EQU 5 input char(s), R0 = count, R1 = port, R2 = first char 00000006 ABS 101 CIATOCH EQU 6 output char(s), R0 = first char, R1 = ccnt, R2 = port 00000007 ABS 102 CIATSTIME EQU 7 start timing, R0 = time, R2 = port 00000008 ABS 103 CIATSSTAT EQU 8 send status, R0 = comm parms, R1 = comm code, R2 = port 00000009 ABS 104 CIATSTRD EQU 9 start read, R0, R1, R2 = first 3 words of CIA buffer 0000000A ABS 105 CIATSTWRT EQU 0A start write, R0, R1, R2 = first 3 words of output buffer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 955 (CIADRIVER) F 48 CIA interrupt routine 107 108 ********************************************************************************** 109 * * 110 * CIA_INT. The interrupt routine. * 111 * We arrive here on any interrupt from any CIA device. * 112 * The interrupt code has loaded CIX to point to the proper * 113 * CIA device, and loaded R3 with the address of the * 114 * appropriate CIA control block. * 115 * We can get here either when an interval interrupt has * 116 * expired or any comm port input buffer exceeds half full. * 117 * We may or may not have actually0accomplished a read of the * 118 * current characters and status (the CIA status word AND the * 119 * variable COMSTATE will tell the tale). * 120 * As a side note, the DEADMAN routine is checking every * 121 * ten seconds for dead I/O devices. It sets the bit called * 122 * COMTIMEOUT. We must clear it on every interrupt, since if * 123 * the DEADMAN routine goes to set it and finds it already * 124 * set, it presumes that we are not getting interrupts (a * 125 * pretty safe assumption). On timeout, CIA_RESET is called * 126 * to attempt to put things right. This is real handy for * 127 * recovering from all sorts of things. * 128 * * 129 * Stack required = 19 * 130 * 5 + max ( CHECKLOGD (6), DQUETHIS (3), ERRORLOG (3), * 131 * INPUTERR (3), LINKBEGLST (3), LOCKWAIT (0), * 132 * MAKEABSAD (1), MOVECHARIN (14), OUTTERMCH (5), * 133 * OUTTSETX (8), PUTINCHAR (10), ROUST (4), * 134 * SETTRSMTR (5), SFREEMEM (0), SRCHLIST (1), * 135 * TRACEPROC (3), UERRSETY (1), UNSRCHLIST (1) ) * 136 * * 137 ********************************************************************************** 138 139 BLOCK CIA_INT routine 140 ENTRY CIA_INT 141 ENTRY STATE15 142 ENTRY TIMESHUT 143 ENTRY WAIT120SEC 144 145 BEGFRAME 00178801 6 BASE 146 COMBLOCK BSS 1 pointer to CIA control block 00178802 6 BASE 147 COMCCNT BSS 1 on read, chars being queued 00178803 6 BASE 148 COMBUFR BSS 1 on write, buffer remaining 00178804 6 BASE 149 OUTBUFPTR BSS 1 ptr to place in output buffer 150 ENDFRAME 151 152 153 * Entered with R2=PPU status, R3=>CIA control block, 154 * CIX = window to CIA 00004761 155 CIA_INT LABEL 04761 EC1F8005 6 STAK 156 STZ PUSH allocate stack frame 04762 60401802 1 157 LD R1 CIX(PPUCHANS1) get the interrupt status of CIA 158 * (this is the I/O status of the CIA 159 * at the time that the interrupt was requested) 04763 E456C804 1 3 BASE 160 ST R1 R3,COMLASTST remember last status 04764 6016C802 0 3 BASE 161 LD R0 R3,COMPF "who ints for" for trace 162 TRACE CIATRACE,CIATINT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 956 (CIADRIVER) F 48 CIA interrupt routine 04765 5D401D2D 162 XCT TRACECALL(CIATRACE) 04766 FEC00021 162 NOP (CIATRACE*BITS 22:26)+(CIATINT*BITS 27:31) 04767 EC08C215 3 ZBM 163 STZ R3,COMTIMEOUT indicate that we're running 04768 E4D78801 3 6 BASE 164 ST R3 SP,COMBLOCK save cntl block address 04769 60001F00 0 165 LD R0 PPUBADSTAT 0476A 78128000 0 2 REG 166 AND R0 R2 check for bad bits in the PPU status 0476B FA0C477A 0 167 JNEZ R0 LOGPPUBAD jump if status is bad 168 * \ / 169 170 ********************************************************************************** 171 * * 172 * The PPU status seems to be okay. Check the CIA status * 173 * to see why we were interrupted. Note that errors here are * 174 * generally those affecting the CIA as a whole. Errors like * 175 * input buffer overrun, etc. are handled in the read data * 176 * processing for that individual port. * 177 * * 178 ********************************************************************************** 179 180 * \ / 0476C F67A478A 1 181 JBT R1/CIAEOP PROCEOP jump if the comm thinks done 0476D F67E4791 1 182 JBT R1/CIATICK SETUPREAD jump if it's ready for read 0476E F67C4791 1 183 JBT R1/CIAFULL SETUPREAD jump if it has to be read 0476F F6764773 1 184 JBT R1/CIAERR DOCIAERR jump if the comm thinks error 04770 F6784782 1 185 JBT R1/CIAAEOP PROCAEOP jump if the comm thought abnormal 00004771 186 SETNORM LABEL return with normal state set 187 * \ / 188 189 ********************************************************************************** 190 * * 191 * Set up 'delayed read'. The CIA will wait until either * 192 * enough chars or tick timeout to give an EOP for this read. * 193 * We set state and wait for the EOP. * 194 * * 195 ********************************************************************************** 196 197 * \ / 00004771 198 SETDREAD LABEL 04771 60040004 0 IMM 199 LD R0 COMSTDREAD get the status code for 'delayed read' 04772 FE0E4792 200 JMP SETUPREADX go to read setup code 201 * --- 202 203 ********************************************************************************** 204 * * 205 * The CIA says it got an error while processing. We log * 206 * the error and pray for the best. * 207 * * 208 ********************************************************************************** 209 00004773 210 DOCIAERR LABEL 04773 60C40086 3 IMM 211 LD PFPTR PNCIX get page map index for PFRD 04774 80930000 4 REG 212 PFRD R4 set R4 to indexing PF 04775 DC005048 213 CALL ERRORLOG log the error 04776 41440A0E IMM 214 PARV ERLCCIAE 04777 41530000 4 REG 215 PARV R4 param1 = PF of channel 04778 40401A03 216 PARVL CIX(CIAERROR) param2 = CIA error code 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 957 (CIADRIVER) F 48 CIA interrupt routine 04779 FE0E47A3 217 JMP ENABCIAI return without changing state 218 * --- 219 220 ********************************************************************************** 221 * * 222 * The PPU thinks that the transmission was bad. We log * 223 * the error and then fake a AEOP. * 224 * * 225 ********************************************************************************** 226 0000477A 227 LOGPPUBAD LABEL 0477A 60C40086 3 IMM 228 LD PFPTR PNCIX get page map index for PFRD 0477B 80930000 4 REG 229 PFRD R4 set R4 to PF for CIA 0477C 61528000 5 2 REG 230 LD R5 R2 copy the PPU status for the call 0477D DC005048 231 CALL ERRORLOG log the error 0477E 41440A0D IMM 232 PARV ERLCPPUBT 0477F 41530000 4 REG 233 PARV R4 param1 = PF of channel 04780 40534000 5 REG 234 PARVL R5 param2 = bad status 00004781 235 PROCAEOPX LABEL 04781 60D78801 3 6 BASE 236 LD R3 SP,COMBLOCK pick up the control block pointer 237 * \ / 238 239 ********************************************************************************** 240 * * 241 * Abnormal end of operation. In every case, we have * 242 * lost some data. All we can do is try to continue on and * 243 * not do it again. * 244 * * 245 ********************************************************************************** 246 247 * \ / 00004782 248 PROCAEOP LABEL 04782 EC001801 249 STZ CIX(PPUABORT) clean out the channel 04783 6008F085 0 3 ZBM 250 LD R0 R3,COMSTATE load the current port state 04784 5CA04785 0 251 LDPC AEOPJMP(R0) process according to state 252 * --- 253 00004785 254 AEOPJMP LABEL 04785 00004771 255 VFD ADR SETNORM 0 - I don't know why I got the interrupt 04786 00004791 256 VFD ADR SETUPREAD 1 - read, just try again 04787 00004771 257 VFD ADR SETNORM 2 - write, just forget it 04788 00004771 258 VFD ADR SETNORM 3 - write2, just ignore 04789 00004771 259 VFD ADR SETDREAD 4 - delayed read, just try again 260 261 262 ********************************************************************************** 263 * * 264 * End of operation. This is selected for the read * 265 * operation (so we can begin processing of the data) and at * 266 * the end of a write that didn't all fit in one buffer (so * 267 * we can output more). This interrupt should not occur in * 268 * the other states but we won't freak out if they do. * 269 * * 270 ********************************************************************************** 271 0000478A 272 PROCEOP LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 958 (CIADRIVER) F 48 CIA interrupt routine 0478A 6008F085 0 3 ZBM 273 LD R0 R3,COMSTATE load the current port state 0478B 5CA0478C 0 274 LDPC EOPJMP(R0) 275 * --- 276 0000478C 277 EOPJMP LABEL 0478C 00004771 278 VFD ADR SETNORM 0 - idle, just return 0478D 000047AA 279 VFD ADR PROCRDIN 1 - read, process the read data 0478E 00004771 280 VFD ADR SETNORM 2 - write, set up delayed read (shouldn't happen) 0478F 00004860 281 VFD ADR SETUPWRIT 3 - write2, try to write more data 04790 000047AA 282 VFD ADR PROCRDIN 4 - delayed read, process the read data 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 959 (CIADRIVER) F 48 CIA interrupt routine 284 285 ********************************************************************************** 286 * * 287 * The flags seem to imply that it is time to read the * 288 * ports characters and status. We set up the read and wait * 289 * for it. * 290 * * 291 ********************************************************************************** 292 00004791 293 SETUPREAD LABEL 04791 60040001 0 IMM 294 LD R0 COMSTREAD get state code for 'reading' 00004792 295 SETUPREADX LABEL 04792 E408F085 0 3 ZBM 296 ST R0 R3,COMSTATE set new state 04793 60040001 0 IMM 297 LD R0 1*PPUIDMAD get bit that we wish to clear (DMA direction) 04794 E4001803 0 298 ST R0 CIX(PPUSCSTAT) DMA direction = device to memory 04795 6056C806 1 3 BASE 299 LD R1 R3,COMINBUF get virtual input buffer address 04796 7C420004 1 IMM 300 IOR R1 1*MONBIT*FLDABSPG make 18 bit monitor address 04797 DC404946 301 CALLNP MAKEABSAD make an absolute memory address 04798 60D78801 3 6 BASE 302 LD R3 SP,COMBLOCK restore CIA control block pointer 04799 E4001805 0 303 ST R0 CIX(PPUADDR1) destination memory addr 0479A 6056C807 1 3 BASE 304 LD R1 R3,COMINBUFS pick up buffer size 305 * LD R0 R1 copy the transfer size 0479B E4561004 1 0 REG 306 ST R1 R0+4 (allow for bug in CIA microcode) 0479C 7C448000 1 IMM 307 IOR R1 1*PPUCLAST this is the only byte count 0479D E4401804 1 308 ST R1 CIX(PPUCNT1) give addr and set PPU going 0479E 6056C804 1 3 BASE 309 LD R1 R3,COMLASTST retrieve the status 0479F E44A0080 1 0 CBM 310 ST R1 R0/CIASRWACK acknowledge the previous interrupt 047A0 7C020038 0 IMM 311 IOR R0 (1*CIAEOP+1*CIAAEOP+1*CIAERR)*CIASRWMSK 047A1 6048F085 1 3 ZBM 312 LD R1 R3,COMSTATE state so we can tell new from old 047A2 E4221A03 0 1 313 ST R0 CIX(CIASREAD)(R1-COMSTREAD) start the CIA going 314 * note that the buffer size is included here 315 * so that CIA knows where to stop (the PPU 316 * does not pass along the buffer length to 317 * the controller). 000047A3 318 ENABCIAI LABEL 047A3 6016C802 0 3 BASE 319 LD R0 R3,COMPF "who" for trace 047A4 6048F085 1 3 ZBM 320 LD R1 R3,COMSTATE "new state" for trace 321 TRACE CIATRACE,CIATLV 047A5 5D401D2D 321 XCT TRACECALL(CIATRACE) 047A6 FEC00022 321 NOP (CIATRACE*BITS 22:26)+(CIATLV*BITS 27:31) 047A7 60040800 0 IMM 322 LD R0 1*PPUICIA get bit for controller interrupt allowed 047A8 E4001802 0 323 ST R0 CIX(PPUSSSTAT) set bit in PPU allowing controller interrupt 047A9 FE0E28B7 324 JMP DISPATCH return from interrupt 325 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 960 (CIADRIVER) F 48 CIA interrupt routine 327 328 ********************************************************************************** 329 * * 330 * We have an end-of-operation interrupt from the * 331 * completion of a read. We now pass through the block moving * 332 * the characters into the buffers for the terminals. * 333 * Entered with: R3=>CIA control block * 334 * SP=>allocated stack area * 335 * CIX = window to the device * 336 * During the major loop that you see here (over all * 337 * ports) R5 contains the pointer to the input buffer. This * 338 * pointer is advanced as appropriate, and at NEXTINPRT will * 339 * point to the character that contains the port number of the * 340 * terminal whose status and input follows. * 341 * The rough format of the input buffer elements is... * 342 * For ports with no status change. * 343 * Char 0 = 000 + port number * 344 * Char 1 = amount of space in output buffer * 345 * Char 2 = count of input characters transmitted with this read * 346 * Char 3... = the characters counted by Char 2. * 347 * For ports with a status change. * 348 * Char 0 = 040 + port number * 349 * Char 1 = amount of space in output buffer * 350 * Char 2 = current status * 351 * Char 3 = count of input characters transmitted with this read * 352 * Char 4... = the characters counted by Char 3. * 353 * For the end of the input buffer. * 354 * Char 0 = 0FF (iff all terminals got a chance) * 355 * = 0FE (iff buffer filled up first) * 356 * Char 1 = * 357 * * 358 ********************************************************************************** 359 000047AA 360 PROCRDIN LABEL 361 PFAILEN PFAIL enable power-fail interrupts 047AA 60044939 0 IMM 361 LD R0 ADR PFAIL 047AB E400044F 0 361 ST R0 POWERUPLOC 047AC 59C40800 IMM 361 IORMSR MSRPFINTE 047AD 6156C806 5 3 BASE 362 LD R5 R3,COMINBUF R5=>current char in input buffer 047AE FE0E47B3 363 JMP NEXTINPRT jump around trace call and setup 364 * --- 365 366 * NOPping the previous jump will cause the first 3 words of input from 367 * the CIA to be added to TRACE data. 047AF 62174800 015 BASE 368 LD2 R0 R5,0 pick up the first two words of buffer 047B0 60974802 2 5 BASE 369 LD R2 R5,2 and the third word, too 370 TRACE CIATRACE,CIATSTRD 047B1 5D401D2D 370 XCT TRACECALL(CIATRACE) 047B2 FEC00029 370 NOP (CIATRACE*BITS 22:26)+(CIATSTRD*BITS 27:31) 371 * \ / 372 000047B3 373 NEXTINPRT LABEL 047B3 60174000 0 5 CACH 374 LD R0 CACH R5,0 get the port number 047B4 F630485B 0 375 JBT R0/PORTLAST DONERDPC jump if no more data 376 * \ / 377 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 961 (CIADRIVER) F 48 CIA interrupt routine 378 ********************************************************************************** 379 * * 380 * We have found that more port data is present in the CIA * 381 * input buffer. Find the TCB for the port and check for a * 382 * status change. If we find a status change, we go off to the * 383 * status checking routine which returns to STATDONE. * 384 * * 385 ********************************************************************************** 386 387 * \ / 047B5 604A3430 1 0 CBM 388 LD R1 R0/CIABRDF R1=board number 047B6 78040007 0 IMM 389 AND R0 CIAPPBRD-1 R0=port on the board 047B7 611CC80C 4 31 BASE 390 LD TCB R3,COMTERMS(R1) R4=>block of TCBs for this board 047B8 FB3247C3 4 391 JNZA TCB GOODTCB jump if TCB block exists 392 393 ********************************************************************************** 394 * * 395 * Data read from the CIA refers to a board that doesn't * 396 * exist. We can make no assumptions about any following * 397 * data, so we must log bad address and abnormal processing. * 398 * * 399 ********************************************************************************** 400 401 PFAILDS disable power-fail interrupt 047B9 59840800 IMM 401 CLBMSR MSRPFINTE 047BA EC00044F 401 STZ POWERUPLOC 047BB 5C00044E 402 CMZ POWERFLAG did one happen? 047BC FE0C28B7 403 JNE DISPATCH jump if so 047BD 00900200 404 STOP STOPP0200 CIA board magicly appeared (for debugging) 047BE DC005048 405 CALL ERRORLOG fake a CIA error 047BF 41440A0E IMM 406 PARV ERLCCIAE pass code 047C0 41534000 5 REG 407 PARV R5 param 1 = location in buffer 047C1 40574800 5 BASE 408 PARVL R5,0 param 2 = the funny data 047C2 FE0E4781 409 JMP PROCAEOPX say abnormal 410 * --- 411 000047C3 412 GOODTCB LABEL 047C3 1920493E 4 0 413 ADD TCB TCBLENGTHS(R0) R4=> this ports TCB 047C4 60174001 0 5 CACH 414 LD R0 CACH R5,1 get the next byte 047C5 E4091289 0 4 ZBM 415 ST R0 TCB,TCOUTSPACE this is output space 047C6 60174002 0 5 CACH 416 LD R0 CACH R5,2 and the next could be status 047C7 60974000 2 5 CACH 417 LD R2 CACH R5,0 get the port number 047C8 F6B247EC 2 418 JBT R2/PORTSTAT STATCHANGE status here so update stuff 419 * \ / 420 000047C9 421 STATDONE LABEL 047C9 FA0247E9 0 422 JEQZ R0 SKIPOVERX if no characters, we're done 423 * \ / 424 425 ********************************************************************************** 426 * * 427 * This port has characters that must be moved into the * 428 * systems input buffer for this port. For a normal user, * 429 * only a few characters will arrive on each interrupt. These * 430 * will be processed through the PUTINCHAR routine which does * 431 * relatively complete checking of the state of this port. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 962 (CIADRIVER) F 48 CIA interrupt routine 432 * If, however, we have a machine generated input (either * 433 * block mode send or machine to machine messages) we attempt * 434 * to go to the MOVECHARIN routine. This routine has a high * 435 * setup time, but it is quite fast for a large number of * 436 * characters (break-even is at 4 or 5, as a guess). Before * 437 * we can call it, we have to check for several conditions * 438 * that it cannot cope with. If any exist, we must use the * 439 * more complete PUTINCHAR. * 440 * * 441 ********************************************************************************** 442 443 * \ / 047CA 60974003 2 5 CACH 444 LD R2 CACH R5,3 get the first character 047CB 60574000 1 5 CACH 445 LD R1 CACH R5,0 get port number for trace 446 TRACE CIATRACE,CIATINCH trace for input character(s) 047CC 5D401D2D 446 XCT TRACECALL(CIATRACE) 047CD FEC00025 446 NOP (CIATRACE*BITS 22:26)+(CIATINCH*BITS 27:31) 047CE DC404C29 447 CALLNP CHECKLOGD can he get input? 047CF FE0E47E7 448 JMP SKIPOVER jump if to ignore 047D0 60174002 0 5 CACH 449 LD R0 CACH R5,2 get the number of chars received 047D1 64040009 0 IMM 450 CPR R0 9 see if enough to do en masse 047D2 FE0847E0 451 JLT SLOWWAY if a few, do slowly with echo 047D3 60093C21 0 4 ZBM 452 LD R0 TCB,TCECHO pick up current echo mode 047D4 64040002 0 IMM 453 CPR R0 ECHOMSOFT is software echoing enabled? 047D5 FE0647E0 454 JGE SLOWWAY if it is, we cannot do en masse 047D6 600407BA 0 IMM 455 LD R0 MAXINQUE maximum allowance for input buffer 047D7 5C091015 4 ZBM 456 CMZ TCB,TCXOFFIQ does he want to be XOFFed earlier? 047D8 FE0247DA 457 JEQ HAVEMAX if not then this is the correct max 047D9 600403DD 0 IMM 458 LD R0 MAXIXOFF otherwise, use smaller max 000047DA 459 HAVEMAX LABEL 047DA 640922FB 0 4 ZBM 460 CPR R0 TCB,TCTTICNT is the input buffer full? 047DB FE0847E0 461 JLT SLOWWAY if it is, do slowly so error is seen 047DC DC004BDE 462 CALL MOVECHARIN move the characters in a lump 047DD 41174003 5 CACH 463 PAR CACH R5,3 => to the characters 047DE 40574002 5 CACH 464 PARVL CACH R5,2 the number of characters there 047DF FE0E47E7 465 JMP SKIPOVER move up R5 pointer and continue 466 * --- 467 468 * Move the characters one at a time -- good for a few characters 469 * and error checking. 000047E0 470 SLOWWAY LABEL 047E0 60040000 0 IMM 471 LD R0 0 initialize running index to character zero 047E1 E4178802 0 6 BASE 472 ST R0 SP,COMCCNT save current running index 000047E2 473 MOVEINCH LABEL 047E2 609B4003 2 50 CACH 474 LD R2 CACH R5,3(R0) get the character 047E3 DC404B21 475 CALLNP PUTINCHAR place in the input queue 047E4 BC178802 0 6 BASE 476 INCL R0 SP,COMCCNT count this character 047E5 64174002 0 5 CACH 477 CPR R0 CACH R5,2 are all characters now processed? 047E6 FE0847E2 478 JLT MOVEINCH jump back if not 000047E7 479 SKIPOVER LABEL 047E7 60174002 0 5 CACH 480 LD R0 CACH R5,2 get number of characters 047E8 60D78801 3 6 BASE 481 LD R3 SP,COMBLOCK restore control block pointer 000047E9 482 SKIPOVERX LABEL 047E9 18040003 0 IMM 483 ADD R0 3 add length of the header 047EA 980B5F30 0 5 CBM 484 ADDM R0 R5/FLDCHARS move pointer to info for next port 047EB FE0E47B3 485 JMP NEXTINPRT do the next port 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 963 (CIADRIVER) F 48 CIA interrupt routine 486 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 964 (CIADRIVER) F 48 CIA interrupt routine 488 489 ********************************************************************************** 490 * * 491 * STATUS CHECKING * 492 * There are three interface handling protocols that may * 493 * be specified for each port. The three protocols and their * 494 * codes are: * 495 * 0 - no handling * 496 * 1 - DTR/DSR drop disconnect * 497 * 2 - RS232 modem handshake * 498 * These three protocols are complicated by the fact that * 499 * each port may have either terminal or modem configuration * 500 * (that is, the receivers and transmitters are set up to * 501 * communicate with either a terminal or a modem). So the * 502 * following table is a description of the 6 configurations * 503 * and the meaning of the interface states that are used to * 504 * control them. * 505 * * 506 * Some states are predefined. These are: * 507 * STATE0 - initialization, boot. Set by INITIAL. * 508 * STATE1 - powerfail/reset. Set by POWERFAIL. * 509 * STATE2 - normal operation. A process will not be created for * 510 * a port until it is in this state. * 511 * STATE15 - if a port seems to be receiving continuous input * 512 * without the program reading same, the port goes into * 513 * this state and is shut down (turn off RDE) for * 514 * one minute. * 515 * * 516 * The RS-232 signal names that are used herein: * 517 * DSR = Data Set Ready. Incoming signal that indicates * 518 * that the modem is ready to receive/transmit data. * 519 * DTR = Data Terminal Ready. Outgoing signal that indicates * 520 * that the computer is ready to receive/transmit * 521 * data. This signal must be asserted to answer * 522 * the phone. De-assertion of this signal causes * 523 * the phone connection to be broken. * 524 * CD = Carrier Detect. Incoming signal indicating that * 525 * the modem has established a connection with a * 526 * remote modem. * 527 * RI = Ring Indicator. Indicates that the local modem * 528 * is receiving a ring signal from the phone line. * 529 * * 530 * A routine name is given for each state. That name is * 531 * of the form "Sncm" where "n" is the configuration number, * 532 * "c" is "N" if not a modem and "M" if it is a modem, and "m" * 533 * is the state number. Many of the state handling routines * 534 * can be shared and this is reflected by the duplication of * 535 * the routine names. * 536 * * 537 * CONFIGURATION ROUTINE STATE MEANING * 538 * ------------- ------- ----- ------- * 539 * protocol=0 S0N0 0 initialization, => 2 * 540 * no handling S0N0 1 powerfail reset, => 2 * 541 * not modem S0N2 2 normal operation, =>2 * 542 * S0N2 15 shut down -- wait for timeout * 543 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 965 (CIADRIVER) F 48 CIA interrupt routine 544 * protocol=0 S0N0 0 initialization, => 2 * 545 * no handling S0N0 1 powerfail reset, => 2 * 546 * modem S0N2 2 normal operation, => 2 * 547 * S0N2 15 shut down -- wait for timeout * 548 * * 549 * protocol=1 S1N0 0 initialization, all transmitters on, * 550 * DTR disconnect => 2 * 551 * not modem S1N2 1 powerfail reset, if DTR on => 2, * 552 * if DTR off => 3 and start timing * 553 * S1N2 2 normal operation, if DTR on => 2, * 554 * if DTR off => 3 and start timing * 555 * S1N3 3 timing disconnect, if DTR on then stop timing* 556 * and =>2, if count exceeded disc. * 557 * S1N0 4 disconnecting * 558 * S0N2 15 shut down -- wait for timeout * 559 * * 560 * protocol=1 S1N0 0 initialization, all transmitters on, * 561 * DSR disconnect => 2 * 562 * modem S1N2 1 powerfail reset, if DSR on => 2, if DSR * 563 * off => 3 and start timing * 564 * S1N2 2 normal operation, if DSR on => 2, if DSR * 565 * off => 3 and start timing * 566 * S1N3 3 timing disconnect, if DSR on stop timing * 567 * and =>2, if count exceeded disc. * 568 * S1N0 4 disconnecting * 569 * S0N2 15 shut down -- wait for timeout * 570 * * 571 * protocol=2 S1N0 0 initialization, all transmitters on, * 572 * RS232 handshake => 2 * 573 * not modem S1N0 1 powerfail reset, if DTR on => 2, if DTR * 574 * (handle like off => 3 and start timing * 575 * DTR disc.) S1N2 2 normal operation, if DTR on => 2, if DTR * 576 * off => 3 and start timing * 577 * S1N3 3 timing disconnect, if DTR on stop timing * 578 * and =>2, if count exceeded disc. * 579 * S1N0 4 disconnecting * 580 * S0N2 15 shut down -- wait for timeout * 581 * * 582 * protocol=2 S2M0 0 initialization, all transmitters off, =>5 * 583 * RS232 handshake S2M0 1 powerfail reset, if no process transmitter * 584 * modem off, if process => 4 and disc. and * 585 * hang up phone * 586 * S2M2 2 normal operation, if DSR or CD off then * 587 * => 3 and and start timing * 588 * S2M3 3 timing disconnect, if DSR and CD on then * 589 * => 2 and stop timing otherwise if * 590 * count exceeded => 4 and disc. * 591 * S2M5 4 disconnecting, => 5 * 592 * S2M5 5 idle, if RING then assert DTR, => 6 and * 593 * start timing * 594 * S2M6 6 waiting for phone to answer, if DSR and * 595 * CD on then => 2, else if timing * 596 * done hang up phone and => 5. * 597 * S2M5 7 identical to 5 * 598 * S0N2 15 shut down -- wait for timeout * 599 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 966 (CIADRIVER) F 48 CIA interrupt routine 600 * This state changing is done in the CIA read processor * 601 * and this has the problem of only getting here when the * 602 * status changes for the port. We also do not have access to * 603 * the output buffer to do the outputting of status for the * 604 * modem (changing the state of DTR) so that and the other * 605 * timing operations are done after the read information is * 606 * processed. If an operation is needed, then timing of 1 * 607 * tick is requested so that the operation will be done * 608 * immediatly after this. * 609 * * 610 ********************************************************************************** 611 612 * Values for state changing so they can be found in the CREF 00000000 ABS 613 STATE0 EQU 0 initialization 00000001 ABS 614 STATE1 EQU 1 powerfail reset 00000002 ABS 615 STATE2 EQU 2 normal operation 00000003 ABS 616 STATE3 EQU 3 00000004 ABS 617 STATE4 EQU 4 00000005 ABS 618 STATE5 EQU 5 00000006 ABS 619 STATE6 EQU 6 0000000F ABS 620 STATE15 EQU 15 port shutdown 621 622 * Timing times 00000000 ABS 623 WAITNOSEC EQU 0 used to turn off timing 00000001 ABS 624 WAITONCE EQU 1 one tick to happen immediatly 0000003C ABS 625 WAIT6SEC EQU 6*CIATPS 6 seconds of CIA ticks 00000096 ABS 626 WAIT15SEC EQU 15*CIATPS 15 seconds of CIA ticks 00000258 ABS 627 WAIT60SEC EQU 60*CIATPS 60 seconds of CIA ticks 000004B0 ABS 628 WAIT120SEC EQU 120*CIATPS 120 seconds of CIA ticks 629 630 ********************************************************************************** 631 * * 632 * We also look for errors that may have occurred on a * 633 * port such as framing errors or parity errors. If one is * 634 * detected we build an error element and link it into the * 635 * chain of input TCQs. Note that a parity error detected * 636 * is reported as a framing error so if a framing error is * 637 * indicated we return a parity error iff the port has * 638 * requested parity checking. * 639 * * 640 ********************************************************************************** 641 000047EC 642 STATCHANGE LABEL 643 * R0 = status 644 * R2 = port number/status present bit (for trace) 047EC 39574001 5 5 CACH 645 LEA R5 CACH R5,1 increment pointer in R5 by one char 047ED E4092289 0 4 ZBM 646 ST R0 TCB,TCLASTST remember the last status 047EE F23247F6 0 647 JBF R0/PORTFFE STATECASE jump if no framing error 648 * \ / 649 047EF 600400E0 0 IMM 650 LD R0 DEVERPFE error code for framing error 047F0 5C093814 4 ZBM 651 CMZ TCB,TCLASTCOM2/PORTCHKPAR see if it might be a parity error 047F1 FE0247F3 652 JEQ NOTPARITY jump if not 047F2 600400E1 0 IMM 653 LD R0 DEVERPPE error code for parity error 000047F3 654 NOTPARITY LABEL 047F3 DC004D5C 655 CALL INPUTERR build an error element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 967 (CIADRIVER) F 48 CIA interrupt routine 047F4 40520000 0 REG 656 PARVL R0 pass the error code 047F5 60092289 0 4 ZBM 657 LD R0 TCB,TCLASTST restore R0 658 * \ / 659 000047F6 660 STATECASE LABEL 047F6 60493C78 1 4 ZBM 661 LD R1 TCB,TCCONTROL pick up state control fields 047F7 60724813 1 1 @ 662 LD R1 @INTERFACE(R1) R1 = index of state operation routine 663 TRACE CIATRACE,CIATSTAT 047F8 5D401D2D 663 XCT TRACECALL(CIATRACE) 047F9 FEC00024 663 NOP (CIATRACE*BITS 22:26)+(CIATSTAT*BITS 27:31) 047FA 7804000F 0 IMM 664 AND R0 1*PORTRI+1*PORTCD+1*PORTCS+1*PORTDSR 047FB 5CA247FC 1 665 LDPC STATEOPR(R1) go to appropriate routine 666 * --- 667 668 ********************************************************************************** 669 * * 670 * The following jump table is provided to decode the * 671 * current state of this port. The index to the jump table is * 672 * the 7 bit field TCCONTROL. This field is made up of three * 673 * other fields. TCIPROT, the leftmost two bits is the * 674 * handling protocol that has been established for this port. * 675 * TCMODEM, the next bit to the right, indicates that this * 676 * port is configured for modem connection (1) or configured * 677 * for terminal connection (0). TCINTSTATE, the rightmost 4 * 678 * bits, is the current interface state. * 679 * This jump table implements the state transitions * 680 * that were described in the large box. * 681 * * 682 * The routine that is called by the jump through table * 683 * accomplishes the actions indicated by the commentary in the * 684 * large box. When that routine is entered, the following * 685 * items are found where indicated: * 686 * R0 = received status bits, * 687 * R1-R3 available * 688 * R4 = TCB => TCB * 689 * R5 => input buffer, * 690 * SP = R6 = stack pointer * 691 * * 692 ********************************************************************************** 693 000047FC 694 STATEOPR BASE 047FC 00004814 695 SERR VFD ADR SERRR 047FD 00004816 696 S0N0 VFD ADR S0N0R 047FE 00004852 697 S0N2 VFD ADR S0N2R 047FF 0000481A 698 S1N0 VFD ADR S1N0R 04800 00004821 699 S1N2 VFD ADR S1N2R 04801 00004830 700 S1N3 VFD ADR S1N3R 04802 00004838 701 S2M0 VFD ADR S2M0R 04803 0000483B 702 S2M2 VFD ADR S2M2R 04804 00004840 703 S2M3 VFD ADR S2M3R 04805 00004843 704 S2M5 VFD ADR S2M5R 04806 0000484D 705 S2M6 VFD ADR S2M6R 706 DRCT 00000004 ABS 707 SLOG EQU (DISPW STATEOPR) LOG 2 calculate size of needed index 708 04806 00000000 709 INTERFACET VFD SLOG:S0N0,S0N0,S0N2,SERR,SERR,SERR no interface, not modem 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 968 (CIADRIVER) F 48 CIA interrupt routine 04807 00000000 710 VFDB SLOG:SERR,SERR,SERR,SERR,SERR,SERR 04808 00000002 711 VFDB SLOG:SERR,SERR,SERR,S0N2 04808 00000000 712 VFDB SLOG:S0N0,S0N0,S0N2,SERR,SERR,SERR no interface, modem 04809 00000000 713 VFDB SLOG:SERR,SERR,SERR,SERR,SERR,SERR 0480A 00000002 714 VFDB SLOG:SERR,SERR,SERR,S0N2 0480A 00000000 715 VFDB SLOG:S1N0,S1N2,S1N2,S1N3,S1N0,SERR DTR disconnect, not modem 0480B 00000000 716 VFDB SLOG:SERR,SERR,SERR,SERR,SERR,SERR 0480C 00000002 717 VFDB SLOG:SERR,SERR,SERR,S0N2 0480C 00000000 718 VFDB SLOG:S1N0,S1N2,S1N2,S1N3,S1N0,SERR DSR disconnect, modem 0480D 00000000 719 VFDB SLOG:SERR,SERR,SERR,SERR,SERR,SERR 0480E 00000002 720 VFDB SLOG:SERR,SERR,SERR,S0N2 0480E 00000000 721 VFDB SLOG:S1N0,S1N2,S1N2,S1N3,S1N0,SERR DTR disconnect, not modem 0480F 00000000 722 VFDB SLOG:SERR,SERR,SERR,SERR,SERR,SERR 04810 00000002 723 VFDB SLOG:SERR,SERR,SERR,S0N2 04810 00000009 724 VFDB SLOG:S2M0,S2M0,S2M2,S2M3,S2M5,S2M5 modem control, modem 04811 00000000 725 VFDB SLOG:S2M6,S2M5,SERR,SERR,SERR,SERR 04812 00000002 726 VFDB SLOG:SERR,SERR,SERR,S0N2 727 BSS 0 take up slack 04813 01084807 728 INTERFACE PTR INTERFACET 729 730 ********************************************************************************** 731 * * 732 * Illegal and undefined state. The odds are someone * 733 * is messing with the IPROT setting on a busy port. * 734 * We set the interface state to reinitialize the port and * 735 * go through the state jump tables again. Since there is * 736 * no way that an interface state of zero will generate an * 737 * error and return us here it is safe to do this. * 738 * * 739 ********************************************************************************** 740 00004814 741 SERRR LABEL 04814 EC090249 4 ZBM 742 STZ TCB,TCINTSTATE reset the interface state 04815 FE0E47F6 743 JMP STATECASE and go through the state tables 744 * --- 745 746 ********************************************************************************** 747 * Do nothing, set all transmitters, go to normal state * 748 * This state occurs during resets and boot. We set the * 749 * output signals as appropriate and change the state to * 750 * normal. * 751 ********************************************************************************** 752 00004816 753 S0N0R LABEL 04816 DC004A79 754 CALL SETTRSMTR turn everything on 04817 40570012 4 CACH 755 PARVL TCB,TCLASTCOM 04818 60C40002 3 IMM 756 LD R3 STATE2 04819 FE0E4832 757 JMP STOPTIMEX stop any timing that might have been 758 * --- 759 760 ********************************************************************************** 761 * Do nothing and continue that. * 762 ********************************************************************************** 763 764 S0N2R EQU NOCHANGE 765 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 969 (CIADRIVER) F 48 CIA interrupt routine 766 ********************************************************************************** 767 * DTR/DSR drop disconnect, initialization, check for * 768 * the bit being good. * 769 ********************************************************************************** 770 0000481A 771 S1N0R LABEL 0481A DC004A79 772 CALL SETTRSMTR turn everything on 0481B 40570012 4 CACH 773 PARVL TCB,TCLASTCOM 0481C 60092289 0 4 ZBM 774 LD R0 TCB,TCLASTST fetch the prior status 0481D 60C40002 3 IMM 775 LD R3 STATE2 if on, normal operation 0481E F63C4851 0 776 JBT R0/PORTDSR SETSTATE jump for normal operation 0000481F 777 S1N0X LABEL 0481F 60C40004 3 IMM 778 LD R3 STATE4 if off, port won't work 04820 FE0E4832 779 JMP STOPTIMEX stop any timing that might have been 780 * --- 781 782 ********************************************************************************** 783 * DTR/DSR drop disconnect, restart, if status is off, * 784 * flush the process. * 785 ********************************************************************************** 786 00004821 787 S1N2R LABEL 04821 60C40002 3 IMM 788 LD R3 STATE2 get state for good status 04822 F63C4851 0 789 JBT R0/PORTDSR SETSTATE all is okay if DSR is on 04823 5C091F17 4 ZBM 790 CMZ TCB,TCPCADRS is there a process here? 04824 FE02481F 791 JEQ S1N0X no, but port won't work 04825 70040096 0 IMM 792 LDN R0 WAIT15SEC wait for 15 seconds 04826 60C40003 3 IMM 793 LD R3 STATE3 get state for that 00004827 794 SETTIMEOUT LABEL 795 * R0=time to delay, R3=new state 796 TRACE CIATRACE,CIATSTIME trace timing event 04827 5D401D2D 796 XCT TRACECALL(CIATRACE) 04828 FEC00027 796 NOP (CIATRACE*BITS 22:26)+(CIATSTIME*BITS 27:31) 04829 60440000 1 IMM 797 LD R1 TIMEDISC all calls from here are for timing disconnect 0482A E4490A39 1 4 ZBM 798 ST R1 TCB,TCTIMERTN we are waiting for timing 0482B E0170817 0 4 BASE 799 EXCH R0 TCB,TCTIMECNT place new time, fetch any old 0482C FA0C482F 0 800 JNEZ R0 S1N2X jump if a prior value found 0482D 60178801 0 6 BASE 801 LD R0 SP,COMBLOCK get pointer to comm block 0482E D016080A 0 BASE 802 INC R0,COMTRMTMNG indicate another terminal timing 0000482F 803 S1N2X LABEL 0482F FE0E4851 804 JMP SETSTATE 805 * --- 806 807 ********************************************************************************** 808 * DTR/DSR drop disconnect, timing, see if our bit has * 809 * come back. * 810 ********************************************************************************** 811 00004830 812 S1N3R LABEL 04830 F23C4852 0 813 JBF R0/PORTDSR NOCHANGE no change in timing state 00004831 814 STOPTIMING LABEL 04831 60C40002 3 IMM 815 LD R3 STATE2 back to normal state 00004832 816 STOPTIMEX LABEL 04832 60040000 0 IMM 817 LD R0 WAITNOSEC indicate no longer timing 04833 E0170817 0 4 BASE 818 EXCH R0 TCB,TCTIMECNT not timing anymore 04834 FA024837 0 819 JEQZ R0 S1N3X jump if no prior value 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 970 (CIADRIVER) F 48 CIA interrupt routine 04835 60178801 0 6 BASE 820 LD R0 SP,COMBLOCK get pointer to comm block 04836 D056080A 0 BASE 821 DEC R0,COMTRMTMNG indicate another terminal done timing 00004837 822 S1N3X LABEL 04837 FE0E4851 823 JMP SETSTATE 824 * --- 825 826 ********************************************************************************** 827 * Modem handling, initialization, initial hung up phone * 828 * so we zap any process. * 829 ********************************************************************************** 830 00004838 831 S2M0R LABEL 04838 70040001 0 IMM 832 LDN R0 WAITONCE 04839 60C40004 3 IMM 833 LD R3 STATE4 go idle after this 0483A FE0E4827 834 JMP SETTIMEOUT 835 * --- 836 837 ********************************************************************************** 838 * Modem handling, normal operation, the loss of some * 839 * things starts disconnect timing * 840 ********************************************************************************** 841 0000483B 842 S2M2R LABEL 0483B F23C483D 0 843 JBF R0/PORTDSR S2M2X loss of DSR is bad news 0483C F63A4852 0 844 JBT R0/PORTCD NOCHANGE loss of CD is bad news (falls through) 0000483D 845 S2M2X LABEL 0483D 7004003C 0 IMM 846 LDN R0 WAIT6SEC time for 6 seconds 0483E 60C40003 3 IMM 847 LD R3 STATE3 0483F FE0E4827 848 JMP SETTIMEOUT 849 * --- 850 851 ********************************************************************************** 852 * Modem handling, timing disconnect, see if DSR and * 853 * CD have returned. * 854 * We come here if an interruption in a phone line occurred. * 855 * If the interruption was a transient, we will go back to the * 856 * normal state when DSR and CD are restored. If however, we * 857 * time out, we have no choice but to hang up the phone and force * 858 * the process into control mode disconnect state. Control mode * 859 * will dump the standard input and output units and wait a few * 860 * minutes looking for an attach. * 861 ********************************************************************************** 862 00004840 863 S2M3R LABEL 04840 F23C4852 0 864 JBF R0/PORTDSR NOCHANGE if no DSR, still timing 04841 F23A4852 0 865 JBF R0/PORTCD NOCHANGE if no CD, still timing 04842 FE0E4831 866 JMP STOPTIMING stop timing, return to normal state 867 * --- 868 869 ********************************************************************************** 870 ** Modem handling, idle waiting for the phone to ring * 871 ********************************************************************************** 872 00004843 873 S2M5R LABEL 04843 F2384852 0 874 JBF R0/PORTRI NOCHANGE no ringy, no worky 04844 5C001D0D 875 CMZ ALLINHIBIT check global inhibit 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 971 (CIADRIVER) F 48 CIA interrupt routine 04845 FE0C4852 876 JNE NOCHANGE if cannot logon, do not answer phone 04846 5C091C10 4 ZBM 877 CMZ TCB,TCINHIB check inhibit for this port 04847 FE0C4852 878 JNE NOCHANGE if cannot logon, do not answer phone 04848 DC004A79 879 CALL SETTRSMTR assert DTR and RTS 04849 40440028 IMM 880 PARVL 1*PORTSDTR+1*PORTSRTS 0484A 70040258 0 IMM 881 LDN R0 WAIT60SEC timing value allowed for logon 0484B 60C40006 3 IMM 882 LD R3 STATE6 answering phone 0484C FE0E4827 883 JMP SETTIMEOUT 884 * --- 885 886 ********************************************************************************** 887 ** Modem handling, answering phone, waiting for DSR and CD * 888 ********************************************************************************** 889 0000484D 890 S2M6R LABEL 0484D F23A4852 0 891 JBF R0/PORTCD NOCHANGE if no CD, we wait 0484E F23C4852 0 892 JBF R0/PORTDSR NOCHANGE if no DSR, we wait 0484F EDC92619 4 ZBM 893 STW TCB,TCLASTST/PORTFBRK fake a break to ensure continuity of timing 04850 FE0E4831 894 JMP STOPTIMING go to normal operation 895 * --- 896 897 ********************************************************************************** 898 * * 899 * The state routine has finished and come here with a * 900 * new state for this port. We set that state into the * 901 * TCB and check status bits unrelated to phones timing. * 902 * * 903 ********************************************************************************** 904 00004851 905 SETSTATE LABEL 04851 E4C90249 3 4 ZBM 906 ST R3 TCB,TCINTSTATE set interface state 00004852 907 NOCHANGE LABEL 04852 5C092619 4 ZBM 908 CMZ TCB,TCLASTST/PORTFBRK has a break (or fake break) occurred? 04853 FE024858 909 JEQ NOTBREAK jump if not 04854 60840100 2 IMM 910 LD R2 BREAKMARK get fake character to say break 04855 DC404C29 911 CALLNP CHECKLOGD is there a process? 04856 FE0E47E7 912 JMP SKIPOVER return, no process 04857 DC404B21 913 CALLNP PUTINCHAR pass info along 00004858 914 NOTBREAK LABEL 04858 60D78801 3 6 BASE 915 LD R3 SP,COMBLOCK restore control block pointer 04859 60174002 0 5 CACH 916 LD R0 CACH R5,2 get count of characters received 0485A FE0E47C9 917 JMP STATDONE process incoming characters 918 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 972 (CIADRIVER) F 48 CIA interrupt routine 920 921 ********************************************************************************** 922 * * 923 * All of the input characters have been processed. See * 924 * if this was a complete read and, if not, read again. * 925 * * 926 ********************************************************************************** 927 0000485B 928 DONERDPC LABEL 929 PFAILDS disable power fail interrupts 0485B 59840800 IMM 929 CLBMSR MSRPFINTE 0485C EC00044F 929 STZ POWERUPLOC 0485D 5C00044E 930 CMZ POWERFLAG did one happen? 0485E FE0C28B7 931 JNE DISPATCH jump if so 0485F F23E4791 0 932 JBF R0/BIT 31 SETUPREAD jump if more to read 933 * \ / 934 935 ********************************************************************************** 936 * * 937 * The read processing is complete. Now build the output * 938 * for the write by passing over the TCBs and creating the * 939 * output commands for each. * 940 * We do a few clever things here to prevent the needless * 941 * scan of all of the TCBs. Since we are usually NOT timing * 942 * anything, we keep a count of ports that are timing for some * 943 * reason for each CIA in their comm block. Iff this count is * 944 * zero, we can completely skip the code for processing * 945 * timing. * 946 * While it is not so common to have no output occurring, * 947 * we also keep a count of ports that are outputting * 948 * (TERMWBUSY). Iff this count is zero, we can completely * 949 * skip the code for processing output. Also if this count * 950 * goes to zero while we are processing TCBs we can stop * 951 * processing any more TCBs. * 952 * * 953 ********************************************************************************** 954 955 * \ / 00004860 956 SETUPWRIT LABEL 04860 6156C808 5 3 BASE 957 LD R5 R3,COMOUTBUF R5 => output buffer 04861 6016C809 0 3 BASE 958 LD R0 R3,COMOUTBUFS get the size allotted for the output buffer 04862 E4178803 0 6 BASE 959 ST R0 SP,COMBUFR set number of characters remaining in buffer 04863 60D78801 3 6 BASE 960 LD R3 SP,COMBLOCK R3 => CIA control block 04864 5C16C80A 3 BASE 961 CMZ R3,COMTRMTMNG are any terminals timing? 04865 FE0C490E 962 JNE DOTIMING jump if so 00004866 963 CHECKWBUSY LABEL 04866 5C001F05 964 CMZ TERMWBUSY is there anything to write? 04867 FE024771 965 JEQ SETNORM if none, go idle 966 * \ / 967 968 * Done with port timing, but there are other ports that should output. 969 PFAILEN PFAIL enable power-fail interrupts 04868 60044939 0 IMM 969 LD R0 ADR PFAIL 04869 E400044F 0 969 ST R0 POWERUPLOC 0486A 59C40800 IMM 969 IORMSR MSRPFINTE 0486B 61C40007 7 IMM 970 LD R7 CIAPPBRD-1 R7 = board number 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 973 (CIADRIVER) F 48 CIA interrupt routine 0000486C 971 NXTBRDW LABEL 0486C 611CF80C 4 37 BASE 972 LD TCB R3,COMTERMS(R7) get first TCB on this board 0486D FB32488F 4 973 JNZA TCB WRITTCB jump if a TCB here 0000486E 974 NXTBRDWX LABEL 0486E FBE6486C 7 975 JDR R7 NXTBRDW process next board 976 * \ / 977 0000486F 978 DONEWRITE LABEL 979 PFAILDS disable power-fail interrupts 0486F 59840800 IMM 979 CLBMSR MSRPFINTE 04870 EC00044F 979 STZ POWERUPLOC 04871 5C00044E 980 CMZ POWERFLAG did one happen? 04872 FE0C28B7 981 JNE DISPATCH jump if yes 04873 6556C808 5 3 BASE 982 CPR R5 R3,COMOUTBUF is anything to go out? 04874 FE024771 983 JEQ SETNORM go idle if nothing to do 984 * \ / 985 986 ********************************************************************************** 987 * * 988 * Do a write to the CIA. * 989 * We come here either when we have scanned all TCBs and * 990 * constructed a complete output buffer (via fall-through) or * 991 * we have scanned some TCBs and filled up our output buffer * 992 * (via DOCIAWRITX). In the latter case, we will set up the * 993 * status so that when we return from the completion of the * 994 * write, we will return to finish processing output. * 995 * * 996 ********************************************************************************** 997 998 * \ / 04875 60040002 0 IMM 999 LD R0 COMSTWRITE get status for normal, complete write 00004876 1000 DOCIAWRITX LABEL 04876 E408F085 0 3 ZBM 1001 ST R0 R3,COMSTATE set state to writing 04877 60040001 0 IMM 1002 LD R0 1*PPUIDMAD 04878 E4001802 0 1003 ST R0 CIX(PPUSSSTAT) DMA direction = mem to dev 04879 6056C808 1 3 BASE 1004 LD R1 R3,COMOUTBUF pick up output buffer pointer 0487A 7C420004 1 IMM 1005 IOR R1 1*MONBIT*FLDABSPG create 18 bit monitor address 0487B DC404946 1006 CALLNP MAKEABSAD make into an absolute address 0487C 60D78801 3 6 BASE 1007 LD R3 SP,COMBLOCK restore control block pointer 0487D E4001805 0 1008 ST R0 CIX(PPUADDR1) source address 0487E 6016C808 0 3 BASE 1009 LD R0 R3,COMOUTBUF pick up output buffer pointer 0487F 600A1F30 0 0 CBM 1010 LD R0 R0/FLDCHARS make character address 04880 300B5F30 0 5 CBM 1011 RSB R0 R5/FLDCHARS R0=number of characters to output 04881 60820038 2 IMM 1012 LD R2 (1*CIAEOP+1*CIAAEOP+1*CIAERR)*CIASRWMSK 04882 7C920000 2 0 REG 1013 IOR R2 R0 build proper command for CIA in R2 04883 7C048000 0 IMM 1014 IOR R0 1*PPUCLAST this is the only byte count 04884 E4001804 0 1015 ST R0 CIX(PPUCNT1) start the PPU 04885 6016C804 0 3 BASE 1016 LD R0 R3,COMLASTST retrieve the status 04886 E40A8080 0 2 CBM 1017 ST R0 R2/CIASRWACK recognize the previous interrupt 04887 E4801A05 2 1018 ST R2 CIX(CIASWRITE) start the CIA 04888 FE0E47A3 1019 JMP ENABCIAI enable interrupts and return 1020 * --- 1021 1022 * This trace can be reached by NOPping the previous JMP instruction. 04889 6096C808 2 3 BASE 1023 LD R2 R3,COMOUTBUF R2 -> output buffer 0488A 62168800 012 BASE 1024 LD2 R0 R2,0 pick up the first two words of buffer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 974 (CIADRIVER) F 48 CIA interrupt routine 0488B 60968802 2 2 BASE 1025 LD R2 R2,2 and the third word, too 1026 TRACE CIATRACE,CIATSTWRT 0488C 5D401D2D 1026 XCT TRACECALL(CIATRACE) 0488D FEC0002A 1026 NOP (CIATRACE*BITS 22:26)+(CIATSTWRT*BITS 27:31) 0488E FE0E47A3 1027 JMP ENABCIAI enable interrupts and return 1028 * --- 1029 1030 ********************************************************************************** 1031 * * 1032 * A block of TCBs has been found so check to see if they * 1033 * have anything to output. * 1034 * The format for the output buffer is: * 1035 * For character output. * 1036 * Char 0 = 000 + port number * 1037 * Char 1 = count of output characters transmitted with * 1038 * this write (must be less than 128). * 1039 * Char 2... = the characters counted by Char 1. * 1040 * For command output. * 1041 * Char 0 = 000 + port number * 1042 * Char 1 = Command code (always >= 080) * 1043 * Char 2 = (optional parameters for the command) * 1044 * Note that we cleverly avoid putting out more than 128 * 1045 * characters in one element. Each TCQ that we copy into the * 1046 * CIA output buffer gets its own port number and output * 1047 * count. We limit the maximum size of the TCQs to a size * 1048 * that will hold less than 128 characters. * 1049 * * 1050 ********************************************************************************** 1051 0000488F 1052 WRITTCB LABEL 0488F E5D78802 7 6 BASE 1053 ST R7 SP,COMCCNT save the board number 04890 61C7FFF8 7 IMM 1054 LD R7 -CIAPPBRD initialize port number 00004891 1055 WRITTCBX LABEL 1056 * \ / 1057 1058 ********************************************************************************** 1059 * If the terminal was sending too many input characters * 1060 * without the user picking them up we will have XOFFed it. * 1061 * When we XOFF a terminal we increment the TERMWBUSY word so * 1062 * that we will check the terminal on a regular basis to see * 1063 * if it is time to XON it. We will XON a port when the input * 1064 * buffers are less than one fourth of the maximum size and * 1065 * the COMM buffer for the port is empty. * 1066 ********************************************************************************** 1067 1068 * \ / 04891 5C09101D 4 ZBM 1069 CMZ TCB,TCIQXOFFED has this port been XOFFed? 04892 FE0248A5 1070 JEQ NOTXOFFED if not, then no problem 04893 600400F7 0 IMM 1071 LD R0 MAXIXOFF/4 get XON threshold value 04894 640922FB 0 4 ZBM 1072 CPR R0 TCB,TCTTICNT see if it is time to XON the port 04895 FE0A48A5 1073 JLE NOTXOFFED if not then keep on going 1074 * \ / 1075 04896 600400FF 0 IMM 1076 LD R0 CIATRMBUFL-1 get size of cia terminal's buffer 04897 64091289 0 4 ZBM 1077 CPR R0 TCB,TCOUTSPACE is the terminal's buffer empty? 04898 FE0C48E5 1078 JNE CHARSMOVDX if not then skip this port 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 975 (CIADRIVER) F 48 CIA interrupt routine 1079 * \ / 1080 04899 60840011 2 IMM 1081 LD R2 XON pick up the XON character 0489A 60C40000 3 IMM 1082 LD TCQ 0 0489B DC404994 1083 CALLNP OUTTERMCH put it in its own TCQ 0489C DC004A4C 1084 CALL LINKBEGLST put at the head of our output list 0489D 41440001 IMM 1085 PARV 1 number of characters 0489E 4116C400 3 @R 1086 PAR @TCQ beginning of list 0489F 4016C400 3 @R 1087 PARL @TCQ end of list 048A0 EC09101D 4 ZBM 1088 STZ TCB,TCIQXOFFED say that we are no longer xoffed 1089 PUNLOCK TCB,TCLOCK unlock the TCB 048A1 EC170818 4 BASE 1089 STZ TCB,TCLOCK 048A2 0C800000 1089 ION 048A3 D0401F05 1090 DEC TERMWBUSY one less XOFF out there 048A4 60D78801 3 6 BASE 1091 LD R3 SP,COMBLOCK restore R3 1092 * \ / 1093 000048A5 1094 NOTXOFFED LABEL 048A5 5C091F1A 4 ZBM 1095 CMZ TCB,TCTTOBP anything to output? 048A6 FE0248E5 1096 JEQ CHARSMOVDX jump if not 048A7 5C178803 6 BASE 1097 CMZ SP,COMBUFR any buffer remaining? 048A8 FE0A4908 1098 JLE EXTRAWRIT if none, extra writes required! 1099 PLOCK TCB,TCLOCK get access to the list 048A9 0CC00000 1099 IOFF 048AA D1D70818 4 BASE 1099 SETT TCB,TCLOCK 048AB FE0C48AD 1099 JNE MA(2+DISPW MA 0) 048AC DC40308B 1099 CALLNP LOCKWAIT 000048AD 1100 CHARMOVE LABEL 048AD 60C91F1A 3 4 ZBM 1101 LD TCQ TCB,TCTTOBP get pointer to the list beginning 048AE FAF048D6 3 1102 JZA TCQ CHARSMOVD jump if empty list 048AF 5C08DC10 3 ZBM 1103 CMZ TCQ,TCQCOMND is the first a command? 048B0 FE0C48E9 1104 JNE PUTCOMND jump if it's a command 1105 * \ / 1106 048B1 6056C004 1 3 CACH 1107 LD R1 TCQ,TCQLAST get index to end character 048B2 1056C000 1 3 CACH 1108 SUB R1 TCQ,TCQFIRST R1=#characters in block 048B3 50578803 1 6 BASE 1109 MIN R1 SP,COMBUFR buffer remaining 048B4 60091289 0 4 ZBM 1110 LD R0 TCB,TCOUTSPACE get how much space is available 048B5 10170014 0 4 CACH 1111 SUB R0 TCB,TCBAUDROOM remove some dependent on baud rate 048B6 50520000 1 0 REG 1112 MIN R1 R0 don't send out more than this 048B7 FA4A48D6 1 1113 JLEZ R1 CHARSMOVD jump if nothing can be moved 048B8 6097000F 2 4 CACH 1114 LD R2 TCB,TCCIAPORT get the port number 048B9 E4974000 2 5 CACH 1115 ST R2 CACH R5,0 place in the output buffer 048BA E4574001 1 5 CACH 1116 ST R1 CACH R5,1 place the number of chars to follow 048BB 6016C000 0 3 CACH 1117 LD R0 TCQ,TCQFIRST get index to first character 048BC 601AC006 0 30 CACH 1118 LD R0 TCQ,TCQCHARS(R0+1) and pick up first char for trace 1119 TRACE CIATRACE,CIATOCH trace output character(s) 048BD 5D401D2D 1119 XCT TRACECALL(CIATRACE) 048BE FEC00026 1119 NOP (CIATRACE*BITS 22:26)+(CIATOCH*BITS 27:31) 048BF 38974002 2 5 CACH 1120 LEA R2 CACH R5,2 R2 = destination address 048C0 60165002 0 1 REG 1121 LD R0 R1+2 R0 = total length of the output 048C1 B0178803 0 6 BASE 1122 RSBM R0 SP,COMBUFR less buffer remaining 048C2 980B5F30 0 5 CBM 1123 ADDM R0 R5/FLDCHARS move the buffer pointer 048C3 B0491289 1 4 ZBM 1124 RSBM R1 TCB,TCOUTSPACE less space in output buffer 048C4 B04900FA 1 4 ZBM 1125 RSBM R1 TCB,TCTTOCNT fewer output characters 048C5 6016C000 0 3 CACH 1126 LD R0 TCQ,TCQFIRST get index to first output char 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 976 (CIADRIVER) F 48 CIA interrupt routine 048C6 9856C000 1 3 CACH 1127 ADDM R1 TCQ,TCQFIRST move up the beginning index 048C7 381AC006 0 30 CACH 1128 LEA R0 TCQ,TCQCHARS(R0+1) create source address 048C8 FE400000 1129 CMOVE move the characters 048C9 6096C000 2 3 CACH 1130 LD R2 TCQ,TCQFIRST get new beginning pointer 048CA 6496C004 2 3 CACH 1131 CPR R2 TCQ,TCQLAST is the thing empty? 048CB FE0848D4 1132 JLT NOTEMPTYB jump if some left 1133 * \ / 1134 000048CC 1135 REMOVCOMND LABEL 048CC 6008DF10 0 3 ZBM 1136 LD R0 TCQ,TCQLINK get pointer to next TCB element 048CD E4091F1A 0 4 ZBM 1137 ST R0 TCB,TCTTOBP remove the element from the list 048CE FA3248D1 0 1138 JNZA R0 NOTEMPTYQ jump if list not empty yet 048CF EC09011B 4 ZBM 1139 STZ TCB,TCTTOEP mark the queue as empty 048D0 D0401F05 1140 DEC TERMWBUSY one less writer 000048D1 1141 NOTEMPTYQ LABEL 048D1 DC002F5D 1142 CALL SFREEMEM free up the last TCQ 048D2 4148D060 3 ZBM 1143 PARV TCQ,TCQLOG log size and 048D3 4052C000 3 REG 1144 PARVL TCQ address 000048D4 1145 NOTEMPTYB LABEL 048D4 5C091289 4 ZBM 1146 CMZ TCB,TCOUTSPACE space left in CIA? 048D5 FE0C48AD 1147 JNE CHARMOVE jump if more room to try 1148 * \ / 1149 1150 ********************************************************************************** 1151 * * 1152 * The characters are all moved for this port. Finish it * 1153 * off and move to the next port. * 1154 * * 1155 ********************************************************************************** 1156 1157 * \ / 000048D6 1158 CHARSMOVD LABEL 1159 PUNLOCK TCB,TCLOCK lock access to this TCB 048D6 EC170818 4 BASE 1159 STZ TCB,TCLOCK 048D7 0C800000 1159 ION 048D8 600900FA 0 4 ZBM 1160 LD R0 TCB,TCTTOCNT get the remaining output count 048D9 640914A2 0 4 ZBM 1161 CPR R0 TCB,TCUNSUSP check against the unsuspend limit 048DA FE0648E2 1162 JGE NOUNSUSP jump if not time to release 048DB 60C91F17 3 4 ZBM 1163 LD R3 TCB,TCPCADRS get the address of the PCB 048DC FAF048E2 3 1164 JZA R3 NOUNSUSP jump if no longer a PCB there 048DD 6008D260 0 3 ZBM 1165 LD R0 R3,PCQUEUE get the PCB scheduler queue location 048DE 6404000D 0 IMM 1166 CPR R0 NQTRMOWAIT is this process waiting for the terminal? 048DF FE0C48E2 1167 JNE NOUNSUSP jump if not 048E0 DC003573 1168 CALL DQUETHIS call to release this user 048E1 40001DB6 1169 PARL SQTRMOWAIT from this queue 1170 * \ / 1171 000048E2 1172 NOUNSUSP LABEL 048E2 60D78801 3 6 BASE 1173 LD R3 SP,COMBLOCK retrieve the control block pointer 048E3 5C001F05 1174 CMZ TERMWBUSY any more writers? 048E4 FE02486F 1175 JEQ DONEWRITE if no more writers, get out of here 1176 * \ / 1177 000048E5 1178 CHARSMOVDX LABEL 048E5 1904001D 4 IMM 1179 ADD TCB TCBLNTH move to the next TCB 048E6 FBE04891 7 1180 IRJ R7 WRITTCBX loop if another TCB on board 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 977 (CIADRIVER) F 48 CIA interrupt routine 048E7 61D78802 7 6 BASE 1181 LD R7 SP,COMCCNT get the board number 048E8 FE0E486E 1182 JMP NXTBRDWX jump to check for done 1183 * --- 1184 1185 1186 ********************************************************************************** 1187 * * 1188 * The thing in the output queue is a command. Place it * 1189 * in the output buffer if there is room and character room in * 1190 * the CIA. * 1191 * * 1192 ********************************************************************************** 1193 000048E9 1194 PUTCOMND LABEL 048E9 6048C081 1 3 ZBM 1195 LD R1 TCQ,TCQCCODE pick up command code 048EA 64440090 1 IMM 1196 CPR R1 PORTPCINIT is this the initialize pseudo command? 048EB FE0C48EE 1197 JNE NOTPSEUDO jump if not 1198 * \ / 1199 048EC EC090249 4 ZBM 1200 STZ TCB,TCINTSTATE reset the interface state 048ED FE0E48CC 1201 JMP REMOVCOMND remove this command element 1202 * --- 1203 000048EE 1204 NOTPSEUDO LABEL 048EE 60840004 2 IMM 1205 LD R2 CPW must have whole word in output buffer 1206 * because of the way we do the store 048EF 64978803 2 6 BASE 1207 CPR R2 SP,COMBUFR does the output buffer have room? 048F0 FE0448D6 1208 JGT CHARSMOVD jump if no room 1209 * \ / 1210 048F1 6444008F 1 IMM 1211 CPR R1 PORTCZAP the immediate reset command? 048F2 FE0248F6 1212 JEQ OKCOMMAND if so, don't do space check 048F3 6096C000 2 3 CACH 1213 LD R2 TCQ,TCQCLNTH get the length of the command 048F4 64891289 2 4 ZBM 1214 CPR R2 TCB,TCOUTSPACE room in the CIA for the command? 048F5 FE0448D6 1215 JGT CHARSMOVD jump if no room 000048F6 1216 OKCOMMAND LABEL 048F6 6097000F 2 4 CACH 1217 LD R2 TCB,TCCIAPORT get the port number 048F7 E4974000 2 5 CACH 1218 ST R2 CACH R5,0 place in output buffer 048F8 E4574001 1 5 CACH 1219 ST R1 CACH R5,1 place the command code 048F9 D00B5F30 5 CBM 1220 INC R5/FLDCHARS advance to command code 048FA 6008D181 0 3 ZBM 1221 LD R0 TCQ,TCQCPARMS pick up parameters to the command 048FB E4095180 0 5 ZBM 1222 ST R0 ZBM R5,0/BITS 8:31 place parameters in the buffer 1223 TRACE CIATRACE,CIATSSTAT trace for sending status 048FC 5D401D2D 1223 XCT TRACECALL(CIATRACE) 048FD FEC00028 1223 NOP (CIATRACE*BITS 22:26)+(CIATSSTAT*BITS 27:31) 048FE 6016C000 0 3 CACH 1224 LD R0 TCQ,TCQCLNTH get the length of the command 048FF 980B5F30 0 5 CBM 1225 ADDM R0 R5/FLDCHARS advance buffer pointer past parameters 04900 60961001 2 0 REG 1226 LD R2 R0+1 produce total size of command (parms + 1 for comnd) 04901 B0978803 2 6 BASE 1227 RSBM R2 SP,COMBUFR a little less CIA output buffer 04902 60840004 2 IMM 1228 LD R2 TCCMNDBURD get assumed command size 04903 B08900FA 2 4 ZBM 1229 RSBM R2 TCB,TCTTOCNT and remove from current output total 04904 6444008F 1 IMM 1230 CPR R1 PORTCZAP the immediate reset command? 04905 FE0248CC 1231 JEQ REMOVCOMND if so, don't decrement available space 04906 B0091289 0 4 ZBM 1232 RSBM R0 TCB,TCOUTSPACE remove space from this ports buffer 04907 FE0E48CC 1233 JMP REMOVCOMND free up the block 1234 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 978 (CIADRIVER) F 48 CIA interrupt routine 1235 1236 ********************************************************************************** 1237 * * 1238 * It seems that not all of the characters to output fit * 1239 * into the output buffer. We therefore write this buffer and * 1240 * wait for an end-of-operation interrupt to tell us that we * 1241 * can write another bunch. * 1242 * * 1243 ********************************************************************************** 1244 00004908 1245 EXTRAWRIT LABEL 1246 PFAILDS disable power-failure interrupts 04908 59840800 IMM 1246 CLBMSR MSRPFINTE 04909 EC00044F 1246 STZ POWERUPLOC 0490A 5C00044E 1247 CMZ POWERFLAG did one happen? 0490B FE0C28B7 1248 JNE DISPATCH jump if so 0490C 60040003 0 IMM 1249 LD R0 COMSTWRIT2 continuing write state 0490D FE0E4876 1250 JMP DOCIAWRITX 1251 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 979 (CIADRIVER) F 48 CIA interrupt routine 1253 1254 ********************************************************************************** 1255 * * 1256 * Several operations handling the CIA interface require * 1257 * timing. Here we check for timing in progress and, if so, * 1258 * we find the terminals currently timing and if timing is * 1259 * complete, we go through the specified processing routine. * 1260 * The placement of this routine ( just in the write * 1261 * code ) allows it to be also used to place commands into * 1262 * the output buffer. This is done by setting timing to * 1263 * one 'tick' and specifying the address of a routine that * 1264 * will place the command in the buffer. We must make sure * 1265 * that the CIA we're interrupting for here is the one * 1266 * being timed. * 1267 * Note that since TCBs are created for an entire CIA * 1268 * at a time, they are linked together in contiguous clumps * 1269 * for each CIA. Therefore we start scanning at the beginning * 1270 * of the CIAs terminals in the TCB list, and when we reach * 1271 * some other CIA's TCBs we can stop. * 1272 * Also the timing count is a negative count so we * 1273 * can LSRCH for the sign bit (TCTIMEFLAG) through the TCBs * 1274 * to find timing terminals. * 1275 * * 1276 ********************************************************************************** 1277 1278 * R3 -> comm block for this CIA 1279 0000490E 1280 DOTIMING LABEL 0490E 6116C80B 4 3 BASE 1281 LD TCB R3,COMFRSTTRM TCB => first TCB belonging to this comm 0000490F 1282 FINDTIMER LABEL 0490F 600400FF 0 IMM 1283 LD R0 0FF should be in first char of TCTIMECNT 04910 3C17005C 0 4 CACH 1284 LSRCH R0 TCB,TCTIMEFLAG look for a timing terminal 04911 FE0C4866 1285 JNE CHECKWBUSY if not found then done here 04912 64C91F16 3 4 ZBM 1286 CPR R3 TCB,TCCIABLOCK is this timer for this CIA? 04913 FE0C4866 1287 JNE CHECKWBUSY if not, we are done 04914 D0170817 4 BASE 1288 INC TCB,TCTIMECNT count the time 04915 FE084937 1289 JLT FINDTIMERX don't do anything if more time to go 04916 EC170817 4 BASE 1290 STZ TCB,TCTIMECNT be sure to clear out counter 04917 D056C80A 3 BASE 1291 DEC R3,COMTRMTMNG indicate this guy no longer timing 04918 60090A39 0 4 ZBM 1292 LD R0 TCB,TCTIMERTN get the routine index 04919 5CA0491A 0 1293 LDPC TIMERTNT(R0) go to the timing routine 1294 * --- 1295 0000491A 1296 TIMERTNT BASE 0491A 0000491C 1297 TIMEDISC VFD ADR TIMEDISCR disconnect on timeout 0491B 00004935 1298 TIMESHUT VFD ADR TIMESHUTR end of port shutdown time 1299 DRCT 1300 1301 ********************************************************************************** 1302 * * 1303 * The timeout implies that the program must be * 1304 * disconnected. We pass the information to the process. * 1305 * The sub-code for the error passed is the unit number * 1306 * of the terminal. The sign bit is set iff the terminal * 1307 * is an absolute i/o unit. * 1308 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 980 (CIADRIVER) F 48 CIA interrupt routine 1309 ********************************************************************************** 1310 0000491C 1311 TIMEDISCR LABEL 0491C DC0030AA 1312 CALL SRCHLIST see that the process doesn't disappear 0491D 40001EB2 1313 PARL PCNTLLOCK 0491E E5578804 5 6 BASE 1314 ST R5 SP,OUTBUFPTR save output buffer pointer 1315 PLOCK TCB,TCLOCK lock TCB 0491F 0CC00000 1315 IOFF 04920 D1D70818 4 BASE 1315 SETT TCB,TCLOCK 04921 FE0C4923 1315 JNE MA(2+DISPW MA 0) 04922 DC40308B 1315 CALLNP LOCKWAIT 04923 61491F17 5 4 ZBM 1316 LD R5 TCB,TCPCADRS get ptr to PCB 04924 FB70492C 5 1317 JZA R5 NOZAP process already gone 04925 61495F13 5 5 ZBM 1318 LD R5 R5,PCPSADRS get pointer to PSA 04926 FB70492C 5 1319 JZA R5 NOZAP no PSA exists 04927 60841024 2 IMM 1320 LD R2 UINTTDISC+CMERR get error code 04928 60C91F15 3 4 ZBM 1321 LD R3 TCB,TCFCB FCB address is subcode 04929 DC4035B5 1322 CALLNP UERRSETY tell the session that terminal is disconnected 0492A 60C91F17 3 4 ZBM 1323 LD R3 TCB,TCPCADRS get pointer to PCB 0492B DC403569 1324 CALLNP ROUST get the session out of waits 1325 * \ / 1326 0000492C 1327 NOZAP LABEL 0492C 61578804 5 6 BASE 1328 LD R5 SP,OUTBUFPTR restore R5 1329 ***** check for need for following instruction 0492D D0090249 4 ZBM 1330 INC TCB,TCINTSTATE tell interface state that it's flushed 1331 PUNLOCK TCB,TCLOCK let the TCB free 0492E EC170818 4 BASE 1331 STZ TCB,TCLOCK 0492F 0C800000 1331 ION 04930 DC0030B7 1332 CALL UNSRCHLIST release process list 04931 40001EB2 1333 PARL PCNTLLOCK 04932 DC004A79 1334 CALL SETTRSMTR hang it up 04933 40440000 IMM 1335 PARVL 0*PORTSDTR+0*PORTSRTS 04934 FE0E4936 1336 JMP FINDTIMERY keep working on the TCBs 1337 * --- 1338 1339 ********************************************************************************** 1340 * * 1341 * A port that is receiving mucho unread characters is * 1342 * shut down for a minute at a time. This is the end of the * 1343 * minute so we push the port through a reset. * 1344 * * 1345 ********************************************************************************** 1346 00004935 1347 TIMESHUTR LABEL 04935 DC404AE0 1348 CALLNP OUTTSETX reset the port 00004936 1349 FINDTIMERY LABEL 04936 60D78801 3 6 BASE 1350 LD R3 SP,COMBLOCK restore control block pointer 00004937 1351 FINDTIMERX LABEL 04937 FB36490F 4 1352 LJNA TCB FINDTIMER link to next TCB 04938 FE0E4866 1353 JMP CHECKWBUSY 1354 * --- 1355 1356 ********************************************************************************** 1357 * * 1358 * Control comes here at power-fail restart time. We * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 981 (CIADRIVER) F 48 CIA interrupt routine 1359 * resume the operation of moving characters into or out of * 1360 * the CIA buffer. * 1361 * * 1362 ********************************************************************************** 1363 00004939 1364 PFAIL LABEL 04939 81530000 4 REG 1365 STCAR R4 get access to regs 0493A 60000450 0 1366 LD R0 POWERRTNPC get where to return 0493B E4091F10 0 4 ZBM 1367 ST R0 R4,CAPC save so we can return there 0493C EDC92811 4 ZBM 1368 STW R4,CAMSR/MSRPFINTEB enable future ints 0493D 01130000 4 REG 1369 LDCA R4 resume interrupted routine 1370 * --- 1371 1372 ********************************************************************************** 1373 * * 1374 * Table of TCB displacements so a multiply is not needed. * 1375 * * 1376 ********************************************************************************** 1377 0000493E 1378 TCBLENGTHS LABEL 0493E 00000000 1379 VFD TCBLNTH*(DISPW TCBLENGTHS) 0493F 0000001D 1380 VFD TCBLNTH*(DISPW TCBLENGTHS) 04940 0000003A 1381 VFD TCBLNTH*(DISPW TCBLENGTHS) 04941 00000057 1382 VFD TCBLNTH*(DISPW TCBLENGTHS) 04942 00000074 1383 VFD TCBLNTH*(DISPW TCBLENGTHS) 04943 00000091 1384 VFD TCBLNTH*(DISPW TCBLENGTHS) 04944 000000AE 1385 VFD TCBLNTH*(DISPW TCBLENGTHS) 04945 000000CB 1386 VFD TCBLNTH*(DISPW TCBLENGTHS) 1387 1388 END CIA_INT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 982 (CIADRIVER) F 48 CIA interrupt routine 1390 1391 ********************************************************************************** 1392 * * 1393 * MAKEABSAD. Routine to transform an 18 bit virtual * 1394 * address into an absolute address acceptable to the PPU. * 1395 * Call: * 1396 * * 1397 * LD R1 18 bit virtual address * 1398 * CALLNP MAKEABSAD * 1399 * ST R0 absolute address * 1400 * * 1401 * Mangles R1 and R3. * 1402 * Stack required = 1 * 1403 * * 1404 ********************************************************************************** 1405 1406 BLOCK MAKEABSAD subroutine 1407 ENTRY MAKEABSAD 1408 1409 BEGFRAME 1410 ENDFRAME 1411 04946 DD5F8001 6 STAK 1412 MAKEABSAD ENTRNP PUSH 04947 60CA5C80 3 1 CBM 1413 LD PFPTR R1/PAGEFIELD point to the page 04948 80920000 0 REG 1414 PFRD R0 get the page map value being used 04949 E40A54C0 0 1 CBM 1415 ST R0 R1/FLDABSPG 0494A E44A1560 1 0 CBM 1416 ST R1 R0/PAGEANDISP 0494B 5D1F8001 6 STAK 1417 LEAVE POP 1418 * --- 1419 1420 END MAKEABSAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 983 (CIADRIVER) F 48 CIA interrupt routine 1422 1423 ********************************************************************************** 1424 * * 1425 * CIA_RESET. Communication Interface Adaptor reset. * 1426 * This routine will do a reset and reinitialization of the * 1427 * specified CIA. It first sees if the CIA is talking by * 1428 * asking the PPU to check cabling. If the CIA talks, we will * 1429 * initialize the CIA ports and set it going again. If the * 1430 * CIA won't talk, we just flush each ports input and output * 1431 * queues and wait for human intervention. * 1432 * Call: * 1433 * SP => stack top * 1434 * LD R5 => CIA control block * 1435 * CIX => device * 1436 * LD R0 zero if CIA clammed up, 1 if alive * 1437 * CALLNP CIA_RESET * 1438 * Eats R0:R4. * 1439 * Stack required = 12 * 1440 * 4 + max ( FLUSHIQ (2), FLUSHOQ (1), OUTTSETX (8), * 1441 * TRACEPROC (3) ) * 1442 * * 1443 ********************************************************************************** 1444 1445 BLOCK CIA_RESET subroutine 1446 ENTRY CIA_RESET 1447 1448 BEGFRAME 00178801 6 BASE 1449 CRSTPORT BSS 1 holds current port number 00178802 6 BASE 1450 CRSTBRD BSS 1 holds current board number 00178803 6 BASE 1451 CRSTR7SV BSS 1 saves R7 1452 ENDFRAME 1453 0494C DD5F8004 6 STAK 1454 CIA_RESET ENTRNP PUSH 0494D E5D78803 7 6 BASE 1455 ST R7 SP,CRSTR7SV save this register 0494E FA304974 0 1456 JZA R0 NOCIATALK jump if PPU not talking 0494F 60174802 0 5 BASE 1457 LD R0 R5,COMPF "who" for trace 04950 60497085 1 5 ZBM 1458 LD R1 R5,COMSTATE what doing for trace 1459 TRACE CIATRACE,CIATRST 04951 5D401D2D 1459 XCT TRACECALL(CIATRACE) 04952 FEC00023 1459 NOP (CIATRACE*BITS 22:26)+(CIATRST*BITS 27:31) 04953 EC001801 1460 STZ CIX(PPUABORT) clean out the PPU channel 1461 * \ / 1462 * The CIA seems to be talking, so we reset him 04954 EC001A02 1463 STZ CIX(CIAINTMASK) no interrupts yet 04955 D1401A01 1464 STMW CIX(CIAINTACK) acknowledge all previous interrupts 04956 6004002D 0 IMM 1465 LD R0 CIATICKTIME use standard value 04957 E4001A06 0 1466 ST R0 CIX(CIASETTICK) set timer interval 04958 60040000 0 IMM 1467 LD R0 CIAMODEN 04959 E4001A09 0 1468 ST R0 CIX(CIAMODE) set mode for CIA 0495A 60040000 0 IMM 1469 LD R0 COMSTIDLE 0495B E4097085 0 5 ZBM 1470 ST R0 R5,COMSTATE state of the driver is "idle" 1471 * \ / 1472 1473 ********************************************************************************** 1474 * This loop checks each board position in the CIA * 1475 * by checking the base TCB pointer for each position. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 984 (CIADRIVER) F 48 CIA interrupt routine 1476 * This currently means no dynamic reconfiguration! * 1477 * Within each board, it presumes that all eight ports * 1478 * are present AND that the TCBs are arranged sequentially * 1479 * (see non-standard construction method). * 1480 ********************************************************************************** 1481 1482 * \ / 0495C 61C7FFF8 7 IMM 1483 LD R7 -CIABOARDS the number of boards to check 0000495D 1484 NEXTBRDL LABEL 0495D 611D7814 4 57 BASE 1485 LD TCB R5,COMTERMS(CIABOARDS)(R7) 0495E FB02496D 4 1486 JEQZ TCB NOBRDHERE jump if no board to initialize 0495F E5D78802 7 6 BASE 1487 ST R7 SP,CRSTBRD save board index 04960 6017D008 0 7 REG 1488 LD R0 R7+CIABOARDS make actual board number 04961 600A0600 0 0 CBM 1489 LD R0 R0*CIABRDF shift board number to make port index 04962 E4178801 0 6 BASE 1490 ST R0 SP,CRSTPORT save index 00004963 1491 NEXTTCBL LABEL 04963 6017000F 0 4 CACH 1492 LD R0 TCB,TCCIAPORT get the hardware port number 04964 60201A80 0 0 1493 LD R0 CIX(CIAPORT+R0) pick up the port's status 04965 5C0A3E10 0 CBM 1494 CMZ R0/CIAPMODM is this a modem? 04966 ED890019 4 ZBM 1495 STLNE TCB,TCMODEM keep the TCB up to date 04967 DC404AE0 1496 CALLNP OUTTSETX reset this port 04968 1904001D 4 IMM 1497 ADD TCB TCBLNTH move to next TCB 04969 BC178801 0 6 BASE 1498 INCL R0 SP,CRSTPORT move to next port number 0496A 78040007 0 IMM 1499 AND R0 (2 POWER (CIAPPBRD LOG 2))-1 all on board initialized? 0496B FA0C4963 0 1500 JNEZ R0 NEXTTCBL jump if not, scan the next 0496C 61D78802 7 6 BASE 1501 LD R7 SP,CRSTBRD if so, restore board index 0000496D 1502 NOBRDHERE LABEL 0496D FBE0495D 7 1503 IRJ R7 NEXTBRDL loop through all boards 1504 * \ / 1505 * All ports ready to go. Give the CIA its marching orders 0496E 60040013 0 IMM 1506 LD R0 1*CIATICK+1*CIAERR+1*CIAFULL 0496F E4001A02 0 1507 ST R0 CIX(CIAINTMASK) enable interrupts from CIA 04970 60040800 0 IMM 1508 LD R0 1*PPUICIA 04971 E4001802 0 1509 ST R0 CIX(PPUSSSTAT) allow the PPU to pass us the interrupts 04972 61D78803 7 6 BASE 1510 LD R7 SP,CRSTR7SV restore R7 04973 5D1F8004 6 STAK 1511 LEAVE POP 1512 * --- 1513 1514 ********************************************************************************** 1515 * * 1516 * The CIA isn't talking. Well, all that we can do is * 1517 * flush all of the ports input and output queues so that * 1518 * there will be a chance of evicting the processes. * 1519 * * 1520 ********************************************************************************** 1521 1522 00004974 1523 NOCIATALK LABEL 04974 6007FFF8 0 IMM 1524 LD R0 -CIABOARDS get number of boards possible 00004975 1525 NEXTBRDM LABEL 04975 611D4014 4 50 BASE 1526 LD TCB R5,COMTERMS(CIABOARDS)(R0) 04976 FB024980 4 1527 JEQZ TCB NOBRDHEREM jump if no board in this slot 04977 E4178802 0 6 BASE 1528 ST R0 SP,CRSTBRD save the current board index 04978 60040008 0 IMM 1529 LD R0 CIAPPBRD get the number of ports on this board 04979 E4178801 0 6 BASE 1530 ST R0 SP,CRSTPORT set number of ports on a board 0000497A 1531 NEXTTCBM LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 985 (CIADRIVER) F 48 CIA interrupt routine 0497A DC404AF8 1532 CALLNP FLUSHIQ flush all characters 0497B DC404AE3 1533 CALLNP FLUSHOQ 0497C 1904001D 4 IMM 1534 ADD TCB TCBLNTH move to next TCB 0497D D0578801 6 BASE 1535 DEC SP,CRSTPORT see if this board is done 0497E FE04497A 1536 JGT NEXTTCBM jump if still more 0497F 60178802 0 6 BASE 1537 LD R0 SP,CRSTBRD recover the board number 00004980 1538 NOBRDHEREM LABEL 04980 FA204975 0 1539 IRJ R0 NEXTBRDM move through all possible boards 04981 61D78803 7 6 BASE 1540 LD R7 SP,CRSTR7SV restore R7 04982 5D1F8004 6 STAK 1541 LEAVE POP return that sez he won't talk 1542 * --- 1543 1544 END CIA_RESET subroutine 1545 1546 1547 END CIA Driver 84 INPUT CIAOUTUTIL Output Utilities for Comm 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 986 (CIAOUTUTIL) F 49 Output utility routines for the CIA 3 4 BLOCK Comm Utility Routines 5 6 ENTRY DELAYCHS pointer to array of characters that delay 7 ENTRY FLUSHOQ flush terminal output queue 8 ENTRY GETOUTCHAR get char from output list 9 ENTRY LINK1CMND place one command in output queue 10 ENTRY LINKBEGLST link TCQ list into start of output queue 11 ENTRY LINKINTLST link TCQ list into output queue 12 ENTRY LINKTCQLST link TCQ list into output queue 13 ENTRY LNKCMNDBEG place one command at start of output queue 14 ENTRY MAKECEL make a CIA command element 15 ENTRY OUTTSET reinitialize a single port 16 ENTRY OUTTSETX reinitialize a single port 17 ENTRY OUTTERMCH special routine to put out one char 18 ENTRY PLACEOUTCH put one character in out list 19 ENTRY SETACCOPTS set output options 20 ENTRY SETTRSMTR set the ports transmitters 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 987 (CIAOUTUTIL) F 49 Output utility routines for the CIA 22 23 ********************************************************************************** 24 * * 25 * PLACEOUTCH. * 26 * Routine to place a single character into the output * 27 * queue for a specified terminal. The TCB is locked and * 28 * OUTTERMCH is called to actually link in the character. * 29 * Note that it will emplace delay elements if necessary. * 30 * If the terminal was not already outputting, we increment * 31 * the count of outputters. * 32 * Call: * 33 * * 34 * LD R2 character * 35 * LD R4 => TCB * 36 * CALLNP PLACEOUTCH * 37 * * 38 * Gets R0 thru R3. * 39 * Stack required = 6 * 40 * 1 + max ( LOCKWAIT (0), OUTTERMCH (5) ) * 41 * * 42 ********************************************************************************** 43 44 BLOCK PLACEOUTCH subroutine 45 ENTRY PLACEOUTCH 46 47 BEGFRAME 48 ENDFRAME 49 04983 DD5F8001 6 STAK 50 PLACEOUTCH ENTRNP PUSH 51 PLOCK TCB,TCLOCK get access to the list 04984 0CC00000 51 IOFF 04985 D1D70818 4 BASE 51 SETT TCB,TCLOCK 04986 FE0C4988 51 JNE MA(2+DISPW MA 0) 04987 DC40308B 51 CALLNP LOCKWAIT 04988 60C9011B 3 4 ZBM 52 LD TCQ TCB,TCTTOEP get end of output queue 04989 DC404994 53 CALLNP OUTTERMCH put the char in the list 0498A 18040001 0 IMM 54 ADD R0 1 add for the single character 0498B 980900FA 0 4 ZBM 55 ADDM R0 TCB,TCTTOCNT increase the output queue size 0498C E4C9011B 3 4 ZBM 56 ST TCQ TCB,TCTTOEP set new list element 0498D 5C091F1A 4 ZBM 57 CMZ TCB,TCTTOBP was there anything in the list? 0498E FE0C4991 58 JNE NOTNEWB jump if not a first block 0498F E4891F1A 2 4 ZBM 59 ST R2 TCB,TCTTOBP point beginning at it 04990 D0001F05 60 INC TERMWBUSY indicate one more writer 00004991 61 NOTNEWB LABEL 62 PUNLOCK TCB,TCLOCK release list 04991 EC170818 4 BASE 62 STZ TCB,TCLOCK 04992 0C800000 62 ION 04993 5D1F8001 6 STAK 63 LEAVE POP 64 * --- 65 66 END PLACEOUTCH subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 988 (CIAOUTUTIL) F 49 Output utility routines for the CIA 68 69 ********************************************************************************** 70 * * 71 * OUTTERMCH. * 72 * Routine to link a single character into the indicated * 73 * list of TCQs. If the character is delayable, a command * 74 * element with the appropriate delay command will also be * 75 * linked into the TCQ list. * 76 * This routine does not alter the TCB, so * 77 * the TCB may be locked or not. However, if the TCQ list * 78 * that we are extending is pointed to by the TCB, the TCB * 79 * must be locked. Otherwise, a flush output queue would * 80 * produce a disaster. Note also that the TCB is consulted * 81 * for information on delayable characters. * 82 * Call: * 83 * See above note about TCB being locked. * 84 * LD R4 => TCB * 85 * LD TCQ => last queue element * 86 * LD R2 character * 87 * CALLNP OUTTERMCH * 88 * TCQ -- may point to new block * 89 * R2 -- 0 or ptr to first created TCQ element * 90 * R0 -- total burden for command TCQs created * 91 * Gets R0 thru R2 and TCQ may be a new block. * 92 * It is possible for this routine to create more than * 93 * 1 TCQ block. To cover this case, R2 returns the * 94 * address of the first created block. Zero if none * 95 * created. * 96 * Stack required = 5 * 97 * 4 + max ( MAKECEL (1), SGETMEM (0) ) * 98 * * 99 ********************************************************************************** 100 101 BLOCK OUTTERMCH subroutine 102 ENTRY OUTTERMCH 103 ENTRY DELAYCHS 104 105 BEGFRAME 00178801 6 BASE 106 OUTTRMCHF BSS 1 first TCQ element 00178802 6 BASE 107 OUTTRMDLY BSS 1 save for DLY 00178803 6 BASE 108 OUTTRMCBRD BSS 1 total burden for created command elements 109 ENDFRAME 110 00000003 ABS 111 OUTTRMDSIZ EQU 8 LOG 2 default queue block size 112 04994 DD5F8004 6 STAK 113 OUTTERMCH ENTRNP PUSH 04995 EC178801 6 BASE 114 STZ SP,OUTTRMCHF indicate no TCQ elements created yet 04996 EC178803 6 BASE 115 STZ SP,OUTTRMCBRD and no commands either 04997 FAF0499A 3 116 JZA TCQ ADDNEW jump if no block 04998 5C08DC10 3 ZBM 117 CMZ TCQ,TCQCOMND is the current block a command? 04999 FE0249A5 118 JEQ PLACECHAR if not, then add char 0000499A 119 ADDNEW LABEL 0499A DC002ED0 120 CALL SGETMEM eight word block = 26 characters 0499B 40440003 IMM 121 PARVL OUTTRMDSIZ 0499C E4178801 0 6 BASE 122 ST R0 SP,OUTTRMCHF save address of first created block 0499D EE160800 0 BASE 123 STZ2 R0,0 initialize the first two words 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 989 (CIAOUTUTIL) F 49 Output utility routines for the CIA 0499E 60440003 1 IMM 124 LD R1 OUTTRMDSIZ log size in words = OUTTRMDSIZ 0499F E4481060 1 0 ZBM 125 ST R1 R0,TCQLOG save log size 049A0 6044001A 1 IMM 126 LD R1 ((2 POWER OUTTRMDSIZ)*CPW)-TCQUSED load the available size 049A1 E4560005 1 0 CACH 127 ST R1 R0,TCQSIZE number of chars in block 049A2 FAF049A4 3 128 JZA TCQ NOTCQYET jump if no existing block 049A3 E408DF10 0 3 ZBM 129 ST R0 TCQ,TCQLINK link it to the last block 000049A4 130 NOTCQYET LABEL 049A4 60D20000 3 0 REG 131 LD TCQ R0 copy the current last block ptr to TCQ 132 * \ / 133 * Place the character if there's room 000049A5 134 PLACECHAR LABEL 049A5 BC56C004 1 3 CACH 135 INCL R1 TCQ,TCQLAST get index for placing 049A6 6456C005 1 3 CACH 136 CPR R1 TCQ,TCQSIZE see if block is full 049A7 FE0A49AA 137 JLE STOREIN if not full, store char in 049A8 D056C004 3 CACH 138 DEC TCQ,TCQLAST block already full, uncount the character 049A9 FE0E499A 139 JMP ADDNEW add a new block 140 * --- 141 142 ********************************************************************************** 143 * * 144 * We have found or generated a TCQ element that has * 145 * room for the single character that we have. Place the * 146 * character into the TCQ and check for it being a * 147 * delayable character. * 148 * * 149 ********************************************************************************** 150 000049AA 151 STOREIN LABEL 049AA E49AC805 2 31 CACH 152 ST R2 TCQ,TCQCHARS(R1) place character into block 049AB 5C3449DB 2 @ 153 CMZ @DELAYCHS(R2) could this character require a delay? 049AC FE0249D0 154 JEQ OUTTEXIT jump if not, we're done 155 * \ / 156 157 ********************************************************************************** 158 * This character is one of the magic four that MAY have * 159 * a delay specified. Pick up the specified delay. * 160 ********************************************************************************** 161 049AD 7884007F 2 IMM 162 AND R2 07F mask off the parity bit 049AE 6484000D 2 IMM 163 CPR R2 CR check for a carriage return 049AF FE0C49B2 164 JNE NOTCR jump if not a CR 049B0 600928C2 0 4 ZBM 165 LD R0 TCB,TCCRDELAY load the proper delay 049B1 FE0E49BB 166 JMP DELAYER go set up delay 167 * --- 168 000049B2 169 NOTCR LABEL 049B2 6484000A 2 IMM 170 CPR R2 LF check for a line feed 049B3 FE0C49B6 171 JNE NOTLF jump if not an LF 049B4 600900C3 0 4 ZBM 172 LD R0 TCB,TCLFDELAY load the proper delay 049B5 FE0E49BB 173 JMP DELAYER go set up delay 174 * --- 175 000049B6 176 NOTLF LABEL 049B6 64840009 2 IMM 177 CPR R2 HT check for a horizontal tab 049B7 FE0C49BA 178 JNE NOTHT jump if not an HT 049B8 600900C8 0 4 ZBM 179 LD R0 TCB,TCHTDELAY load the proper delay 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 990 (CIAOUTUTIL) F 49 Output utility routines for the CIA 049B9 FE0E49BB 180 JMP DELAYER go set up the delay 181 * --- 182 000049BA 183 NOTHT LABEL 049BA 600918C3 0 4 ZBM 184 LD R0 TCB,TCFFDELAY must be form feed, get delay 000049BB 185 DELAYER LABEL 049BB FA0249D0 0 186 JEQZ R0 OUTTEXIT jump if no delay 049BC 1C091EF1 0 4 ZBM 187 MUL R0 TCB,TCORATE 049BD 1804270F 0 IMM 188 ADD R0 1000*10-1 force to next higher integer 049BE 14042710 0 IMM 189 DIV R0 1000*10 R0 = character times to delay 049BF FA0A49D0 0 190 JLEZ R0 OUTTEXIT jump if no delay to do 000049C0 191 DELAYMORE LABEL 049C0 60920000 2 0 REG 192 LD R2 R0 copy the delay value 049C1 508400FF 2 IMM 193 MIN R2 TCQMXDELAY produce a limited value in R2 049C2 10128000 0 2 REG 194 SUB R0 R2 make R0 hold the leftover value 049C3 E4178802 0 6 BASE 195 ST R0 SP,OUTTRMDLY and save it 049C4 DC404A1C 196 CALLNP MAKECEL create a command element 049C5 41440086 IMM 197 PARV PORTDWELL the command 049C6 40528000 2 REG 198 PARVL R2 pass the delay for this command 049C7 60040004 0 IMM 199 LD R0 TCCMNDBURD get assumed size for single command 049C8 98178803 0 6 BASE 200 ADDM R0 SP,OUTTRMCBRD count up total command burden 049C9 E488DF10 2 3 ZBM 201 ST R2 TCQ,TCQLINK link in the new element 049CA 60D28000 3 2 REG 202 LD TCQ R2 049CB 5C178801 6 BASE 203 CMZ SP,OUTTRMCHF check for a TCQ already created 049CC FE0C49CE 204 JNE NOTFIRSTB jump if one already exists 049CD E4D78801 3 6 BASE 205 ST TCQ SP,OUTTRMCHF save pointer if none already present 000049CE 206 NOTFIRSTB LABEL 049CE 60178802 0 6 BASE 207 LD R0 SP,OUTTRMDLY retrieve any remaining delay value 049CF FA0449C0 0 208 JGTZ R0 DELAYMORE jump if more delay left 209 * \ / 000049D0 210 OUTTEXIT LABEL 049D0 60978801 2 6 BASE 211 LD R2 SP,OUTTRMCHF return first created block 049D1 60178803 0 6 BASE 212 LD R0 SP,OUTTRMCBRD pick up total burden 049D2 5D1F8004 6 STAK 213 LEAVE POP return 214 * --- 215 216 * Bit array of the characters that can have delay times 217 * This array contains bits for both senses of the parity bit. 218 * This array contains bits for each of CR, LF, FF, and HT. 049D3 006C0000 219 DELAYCHT VFD (1*BIT CR)+(1*BIT LF)+(1*BIT FF)+(1*BIT HT) 049D4 00000000 220 VFD 0 049D5 00000000 221 VFD 0 049D6 00000000 222 VFD 0 049D7 006C0000 223 VFD (1*BIT CR)+(1*BIT LF)+(1*BIT FF)+(1*BIT HT) 049D8 00000000 224 VFD 0 049D9 00000000 225 VFD 0 049DA 00000000 226 VFD 0 227 049DB 004849D3 228 DELAYCHS PTR DELAYCHT/BIT 0 bit pointer to table 229 230 END OUTTERMCH subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 991 (CIAOUTUTIL) F 49 Output utility routines for the CIA 232 233 ********************************************************************************** 234 * * 235 * GETOUTCHAR. * 236 * Routine to fetch one character from the output * 237 * queue. Fetches the character and returns it in R2. It * 238 * ignores command blocks (freeing them as encountered) * 239 * except for breaks and dwells, so if you care you must * 240 * check before calling here. This routine also unsuspends * 241 * the writer if the number of characters drops below the * 242 * unsuspend limit. * 243 * This routine is provided solely for the SSU (RFP) * 244 * output. * 245 * Call: * 246 * LD R4 => TCB * 247 * CALLNP GETOUTCHAR * 248 * JMP * 249 * ST R2 the character * 250 * Eats R0:R3 and sets R2 * 251 * Stack required = 5 * 252 * 2 + max ( DQUETHIS (3), LOCKWAIT (0), SFREEMEM (0) ) * 253 * * 254 ********************************************************************************** 255 256 BLOCK GETOUTCHAR subroutine 257 ENTRY GETOUTCHAR 258 259 BEGFRAME 00178801 6 BASE 260 TEMP BSS 1 beats me 261 ENDFRAME 262 049DC DD5F8002 6 STAK 263 GETOUTCHAR ENTRNP PUSH 264 PLOCK TCB,TCLOCK get access to the list 049DD 0CC00000 264 IOFF 049DE D1D70818 4 BASE 264 SETT TCB,TCLOCK 049DF FE0C49E1 264 JNE MA(2+DISPW MA 0) 049E0 DC40308B 264 CALLNP LOCKWAIT 049E1 6087FFFF 2 IMM 265 LD R2 -1 no character yet 000049E2 266 NEXTLINK LABEL 049E2 60C91F1A 3 4 ZBM 267 LD TCQ TCB,TCTTOBP get first element 049E3 FAF04A19 3 268 JZA TCQ NOCHARS no characters in output queue 049E4 5C08DC10 3 ZBM 269 CMZ TCQ,TCQCOMND is this a command? 049E5 FE0249FE 270 JEQ NOTCMND if not then get the character 271 * \ / 272 049E6 60001EE4 0 273 LD R0 SSUVER can this SSU handle breaks and dwells? 049E7 FA0249F7 0 274 JEQZ R0 REMOVECMND if not then remove this command 275 * \ / 276 049E8 6016C000 0 3 CACH 277 LD R0 TCQ,TCQCLNTH get the command length 049E9 64040002 0 IMM 278 CPR R0 2 break and dwell command lengths are 2 049EA FE0C49F7 279 JNE REMOVECMND can't be one so remove the command 049EB 6008C081 0 3 ZBM 280 LD R0 TCQ,TCQWORDB/CH0 get the command code 049EC 64040086 0 IMM 281 CPR R0 PORTDWELL is it a DWELL command? 049ED FE0249F2 282 JEQ SSUDWELL 049EE 64040087 0 IMM 283 CPR R0 PORTBREAK is it a break command? 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 992 (CIAOUTUTIL) F 49 Output utility routines for the CIA 049EF FE0C49F7 284 JNE REMOVECMND if neither then remove the command 285 * \ / 286 049F0 60840100 2 IMM 287 LD R2 1*SSUBREAKB set bit indicating a break command 049F1 FE0E49F3 288 JMP BREAKJOIN share code with DWELL 289 * --- 290 000049F2 291 SSUDWELL LABEL 049F2 60840200 2 IMM 292 LD R2 1*SSUDWELLB set bit indicating a dwell command 000049F3 293 BREAKJOIN LABEL 049F3 6008D081 0 3 ZBM 294 LD R0 TCQ,TCQWORDB/CH1 get the number of characters to send 049F4 640400FF 0 IMM 295 CPR R0 SSUMAXCC only can send up to 0FF 049F5 FE0449FA 296 JGT TOOMUCH send some and decrement count 049F6 E40AB080 0 2 CBM 297 ST R0 R2/CH3 put count into our character element 298 * \ / 299 000049F7 300 REMOVECMND LABEL 049F7 60040004 0 IMM 301 LD R0 TCCMNDBURD get assumed output burden 049F8 B00900FA 0 4 ZBM 302 RSBM R0 TCB,TCTTOCNT and remove from output buffer 049F9 FE0E4A03 303 JMP FREEQUE remove the command element 304 * --- 305 000049FA 306 TOOMUCH LABEL 049FA 600400FF 0 IMM 307 LD R0 SSUMAXCC how many we can send at a time 049FB E40AB080 0 2 CBM 308 ST R0 R2/CH3 put into character element 049FC B008D081 0 3 ZBM 309 RSBM R0 TCQ,TCQWORDB/CH1 decrement the count to send 049FD FE0E4A0C 310 JMP OUTTHECHAR 311 * --- 312 313 * Not a command, get the character 000049FE 314 NOTCMND LABEL 049FE BC16C000 0 3 CACH 315 INCL R0 TCQ,TCQFIRST advance and acquire the char pointer 049FF 609AC005 2 30 CACH 316 LD R2 TCQ,TCQCHARS(R0) get the indicated character 04A00 D04900FA 4 ZBM 317 DEC TCB,TCTTOCNT reduce the count of output chars 04A01 6416C004 0 3 CACH 318 CPR R0 TCQ,TCQLAST was this the last character in this block? 04A02 FE084A0C 319 JLT OUTTHECHAR jump if not 320 * \ / 321 00004A03 322 FREEQUE LABEL current block contains a command 04A03 6008DF10 0 3 ZBM 323 LD R0 TCQ,TCQLINK get the link to the next element 04A04 E4091F1A 0 4 ZBM 324 ST R0 TCB,TCTTOBP unlink the last element 04A05 FA324A08 0 325 JNZA R0 NOTECHNG are we removing the last one? 04A06 E409011B 0 4 ZBM 326 ST R0 TCB,TCTTOEP if so, also zero list end pointer and 04A07 D0401F05 327 DEC TERMWBUSY indicate one less writer 00004A08 328 NOTECHNG LABEL 04A08 DC002F5D 329 CALL SFREEMEM free the element 04A09 4148D060 3 ZBM 330 PARV TCQ,TCQLOG length stored in the element 04A0A 4052C000 3 REG 331 PARVL TCQ indicate its address 04A0B FA8849E2 2 332 JLTZ R2 NEXTLINK jump if we don't have a character yet 00004A0C 333 OUTTHECHAR LABEL 04A0C 600900FA 0 4 ZBM 334 LD R0 TCB,TCTTOCNT get the output count 04A0D 640914A2 0 4 ZBM 335 CPR R0 TCB,TCUNSUSP check to see if time to unsuspend the user 04A0E FE064A18 336 JGE NOUNSUSPG jump if user may stay suspended 04A0F 60C91F17 3 4 ZBM 337 LD R3 TCB,TCPCADRS get the address of the PCB 04A10 FAF04A18 3 338 JZA R3 NOUNSUSPG if no process associated, skip blowing up 04A11 6008D260 0 3 ZBM 339 LD R0 R3,PCQUEUE get the queue that we are in 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 993 (CIAOUTUTIL) F 49 Output utility routines for the CIA 04A12 6404000D 0 IMM 340 CPR R0 NQTRMOWAIT verify that it's terminal wait 04A13 FE0C4A18 341 JNE NOUNSUSPG jump if stopped for some other reason 04A14 E4978801 2 6 BASE 342 ST R2 SP,TEMP save this register (character) 04A15 DC003573 343 CALL DQUETHIS call to release this process to run 04A16 40001DB6 344 PARL SQTRMOWAIT indicate which queue 04A17 60978801 2 6 BASE 345 LD R2 SP,TEMP restore R2 00004A18 346 NOUNSUSPG LABEL 04A18 19C40001 7 IMM 347 ADD R7 1 advance to the skip return 00004A19 348 NOCHARS LABEL 349 PUNLOCK TCB,TCLOCK release the list 04A19 EC170818 4 BASE 349 STZ TCB,TCLOCK 04A1A 0C800000 349 ION 04A1B 5D1F8002 6 STAK 350 LEAVE POP return 351 * --- 352 353 END GETOUTCHAR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 994 (CIAOUTUTIL) F 49 Output utility routines for the CIA 355 356 ********************************************************************************** 357 * * 358 * MAKECEL. Routine that makes a comm command element. * 359 * Call: * 360 * CALL MAKECEL * 361 * PARV * 362 * PARVL * 363 * ST R2 * 364 * Forward link in new element is clear * 365 * * 366 * Eats R0:R1, sets R2. * 367 * Zaps R0,R1 before passing parameters. * 368 * Stack required = 1 * 369 * * 370 ********************************************************************************** 371 372 BLOCK MAKECEL subroutine 373 ENTRY MAKECEL 374 375 BEGFRAME 376 ENDFRAME 377 04A1C DD9F8001 6 STAK 378 MAKECEL ENTRS PUSH 04A1D DC002ED0 379 CALL SGETMEM get block of memory 04A1E 40440001 IMM 380 PARVL 1 indicate 2 words long 04A1F EE160800 0 BASE 381 STZ2 R0,0 clear the block 04A20 EDC81060 0 ZBM 382 STW R0,TCQLOG indicate length of block 04A21 EDC81C10 0 ZBM 383 STW R0,TCQCOMND mark as command 04A22 60520000 1 0 REG 384 LD R1 R0 copy the pointer 04A23 DCD3C000 7 REG 385 EXPCS R7 go back for the parameters 04A24 C1484081 1 ZBM 386 STPV R1,TCQCCODE command code 04A25 C0520000 0 REG 387 STPVL R0 and the parameter value 04A26 60924000 2 1 REG 388 LD R2 R1 return pointer in R2 04A27 60488081 1 2 ZBM 389 LD R1 R2,TCQCCODE get the command code 04A28 60721F12 1 1 @ 390 LD R1 @TCQCLEN(R1) get length of command 04A29 E4568000 1 2 CACH 391 ST R1 R2,TCQCLNTH set length of command 04A2A 5D624A2D 1 392 XCT CMNDAJST(R1) justify the command value 04A2B E4089181 0 2 ZBM 393 ST R0 R2,TCQCPARMS leaves WORDB/CH0 = command code and 394 * value left justified in CH1:CH3 04A2C 5D1F8001 6 STAK 395 LEAVE POP return 396 * --- 397 398 * Table to left justify the value for the command 04A2D 00130213 399 CMNDAJST HALT HALTS0213 bad command code passed 04A2E FEC00000 400 NOP 0 length=1, no value 04A2F 600A3180 0 0 CBM 401 LD R0 R0/(CH3+CH0+CH1) len=2, value to first of 3 04A30 600A2180 0 0 CBM 402 LD R0 R0/(CH2+CH3+CH0) len=3, move up 1 char 04A31 FEC00000 403 NOP 0 len=4, no shifting needed 404 405 END MAKECEL subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 995 (CIAOUTUTIL) F 49 Output utility routines for the CIA 407 408 ********************************************************************************** 409 * * 410 * LINKTCQLST. * 411 * Link a list of TCQ elements onto the end of the output * 412 * queue for the specified port. We expect to get the TCB * 413 * pointer, pointers to the first and last TCQ element that we * 414 * will link in, and the count of characters. This routine will * 415 * clean up the forward link in the last element and will not * 416 * blow its mind if passed an empty list. * 417 * Call: * 418 * * 419 * LD TCB => terminal control block * 420 * * 421 * CALL LINKTCQLST * 422 * PARV number of characters going into list * 423 * PAR => first element of list * 424 * PARL => last element in list * 425 * * 426 * Gets R0 thru R3. * 427 * Stack required = 3 * 428 * 3 + max ( LOCKWAIT (0) ) * 429 * * 430 ********************************************************************************** 431 432 ********************************************************************************** 433 * * 434 * LINKINTLST. Link in a list of TCQs. This routine is * 435 * identical to LINKTCQLST except that TCLOCK is locked before * 436 * the items are inserted. Remember that the list is left * 437 * locked on return. * 438 * * 439 ********************************************************************************** 440 441 BLOCK LINKTCQLST, LINKINTLST 442 ENTRY LINKINTLST 443 ENTRY LINKTCQLST 444 445 BEGFRAME 00178801 6 BASE 446 LINKINCNT BSS 1 number of characters being inserted 00178802 6 BASE 447 FIRSTLINK BSS 1 pointer to the first element 448 ENDFRAME 449 04A32 DD1F8003 6 STAK 450 LINKINTLST ENTR PUSH 04A33 C1578801 6 BASE 451 STPV SP,LINKINCNT count of characters inserting 04A34 C1178802 6 BASE 452 STP SP,FIRSTLINK pointer to the first TCQ of new list 04A35 C012C000 3 REG 453 STPL TCQ pointer to the end 454 PLOCK TCB,TCLOCK lock the lists 04A36 0CC00000 454 IOFF 04A37 D1D70818 4 BASE 454 SETT TCB,TCLOCK 04A38 FE0C4A3A 454 JNE MA(2+DISPW MA 0) 04A39 DC40308B 454 CALLNP LOCKWAIT 04A3A FE0E4A3F 455 JMP LINKINSHR share most of the code 456 * --- 457 04A3B DD1F8003 6 STAK 458 LINKTCQLST ENTR PUSH 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 996 (CIAOUTUTIL) F 49 Output utility routines for the CIA 04A3C C1578801 6 BASE 459 STPV SP,LINKINCNT count of characters inserting 04A3D C1178802 6 BASE 460 STP SP,FIRSTLINK pointer to the first 04A3E C012C000 3 REG 461 STPL TCQ pointer to the end 00004A3F 462 LINKINSHR LABEL 04A3F 60978802 2 6 BASE 463 LD R2 SP,FIRSTLINK R2 => first in the list 04A40 FAB04A49 2 464 JZA R2 NOLINKIN jump if nothing to link in 04A41 EC08DF10 3 ZBM 465 STZ TCQ,TCQLINK zap the forward link in the new list 04A42 6009011B 0 4 ZBM 466 LD R0 TCB,TCTTOEP get the end of existing list 04A43 FA324A47 0 467 JNZA R0 LINKINY jump if list present 04A44 E4891F1A 2 4 ZBM 468 ST R2 TCB,TCTTOBP this is the whole list 04A45 D0001F05 469 INC TERMWBUSY another busy terminal 04A46 FE0E4A48 470 JMP LINKINX 471 * --- 472 00004A47 473 LINKINY LABEL 04A47 E4881F10 2 0 ZBM 474 ST R2 R0,TCQLINK link our list onto end of existing 00004A48 475 LINKINX LABEL 04A48 E4C9011B 3 4 ZBM 476 ST TCQ TCB,TCTTOEP ours is the new end of the list 00004A49 477 NOLINKIN LABEL 04A49 60178801 0 6 BASE 478 LD R0 SP,LINKINCNT get the characters being put in 04A4A 980900FA 0 4 ZBM 479 ADDM R0 TCB,TCTTOCNT put the count in the list 480 * leave the list locked 04A4B 5D1F8003 6 STAK 481 LEAVE POP 482 * --- 483 484 END LINKTCQLST, LINKINTLST 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 997 (CIAOUTUTIL) F 49 Output utility routines for the CIA 486 487 ********************************************************************************** 488 * * 489 * LINKBEGLST. * 490 * Link a list of TCQ elements into the start of the output * 491 * queue of the specified port. This routine expects the TCB * 492 * pointer, pointers to the first and last TCQ elements to be * 493 * linked in, and the count of characters. This routine is used * 494 * for sending high priority commands to the comm. It will not * 495 * blow it's mind if passed an empty list. TCLOCK is locked * 496 * before the items are inserted. Remember that the list is * 497 * left locked on return. * 498 * Call: * 499 * LD TCB => terminal control block * 500 * CALL LINKBEGLST * 501 * PARV number of characters going into list * 502 * PAR => first element of list * 503 * PARL => last element in list * 504 * * 505 * * 506 * Gets R0 thru R3. * 507 * Stack required = 3 * 508 * 3 + max ( LOCKLIST (0) ) * 509 * * 510 ********************************************************************************** 511 512 BLOCK LINKBEGLST 513 ENTRY LINKBEGLST 514 515 BEGFRAME 00178801 6 BASE 516 LINKINCNT BSS 1 number of characters being inserted 00178802 6 BASE 517 FIRSTLINK BSS 1 pointer to the first element 518 ENDFRAME 519 04A4C DD1F8003 6 STAK 520 LINKBEGLST ENTR PUSH 04A4D C1578801 6 BASE 521 STPV SP,LINKINCNT count of characters inserting 04A4E C1178802 6 BASE 522 STP SP,FIRSTLINK pointer to the first 04A4F C012C000 3 REG 523 STPL TCQ pointer to the end 524 PLOCK TCB,TCLOCK lock the lists 04A50 0CC00000 524 IOFF 04A51 D1D70818 4 BASE 524 SETT TCB,TCLOCK 04A52 FE0C4A54 524 JNE MA(2+DISPW MA 0) 04A53 DC40308B 524 CALLNP LOCKWAIT 04A54 60978802 2 6 BASE 525 LD R2 SP,FIRSTLINK R2 => first new TCQ 04A55 FAB04A5C 2 526 JZA R2 NOLINKIN jump if nothing to link in 04A56 60091F1A 0 4 ZBM 527 LD R0 TCB,TCTTOBP get the beginning of existing list 04A57 E408DF10 0 3 ZBM 528 ST R0 TCQ,TCQLINK link old list onto end of ours 04A58 FA324A5B 0 529 JNZA R0 LINKINY jump if prior list present 04A59 E4C9011B 3 4 ZBM 530 ST TCQ TCB,TCTTOEP this is the whole list 04A5A D0001F05 531 INC TERMWBUSY another busy terminal 532 * \ / 00004A5B 533 LINKINY LABEL 04A5B E4891F1A 2 4 ZBM 534 ST R2 TCB,TCTTOBP ours is the new output list beginning 00004A5C 535 NOLINKIN LABEL 04A5C 60178801 0 6 BASE 536 LD R0 SP,LINKINCNT get the characters being put in 04A5D 980900FA 0 4 ZBM 537 ADDM R0 TCB,TCTTOCNT put the count in the list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 998 (CIAOUTUTIL) F 49 Output utility routines for the CIA 538 * leave the list locked 04A5E 5D1F8003 6 STAK 539 LEAVE POP 540 * --- 541 542 END LINKBEGLST 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE 999 (CIAOUTUTIL) F 49 Output utility routines for the CIA 544 545 ********************************************************************************** 546 * * 547 * LINK1CMND. Routine that builds and links one command into * 548 * the end of the terminal's output queue. * 549 * Call: * 550 * * 551 * LD R4 => terminal control block * 552 * CALL LINK1CMND * 553 * PARV command * 554 * PARVL parameter for the command * 555 * * 556 * Eats R0:R3 Eats R2 before taking last PARM * 557 * Stack required = 4 * 558 * 1 + max ( LINKINTLST (3), MAKECEL (1) ) * 559 * * 560 ********************************************************************************** 561 562 BLOCK make and link single command element 563 ENTRY LINK1CMND 564 565 BEGFRAME 566 ENDFRAME 567 04A5F DD1F8001 6 STAK 568 LINK1CMND ENTR PUSH 04A60 C1528000 2 REG 569 STPV R2 the command to link in 04A61 C052C000 3 REG 570 STPVL R3 and its parameter 04A62 DC004A1C 571 CALL MAKECEL make the command element 04A63 41528000 2 REG 572 PARV R2 pass command 04A64 4052C000 3 REG 573 PARVL R3 and parameter 04A65 DC004A32 574 CALL LINKINTLST link it into the list 04A66 41440004 IMM 575 PARV TCCMNDBURD the "size" of the command 04A67 41168400 2 @R 576 PAR @R2 the element 04A68 40168400 2 @R 577 PARL @R2 578 PUNLOCK TCB,TCLOCK unlock the list 04A69 EC170818 4 BASE 578 STZ TCB,TCLOCK 04A6A 0C800000 578 ION 04A6B 5D1F8001 6 STAK 579 LEAVE POP 580 * --- 581 582 END LINK1CMND 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1000 (CIAOUTUTIL) F 49 Output utility routines for the CIA 584 585 ********************************************************************************** 586 * * 587 * LNKCMNDBEG. Routine that builds and links one command * 588 * onto the beginning of the terminal's output queue. This is * 589 * used for sending high priority commands to the comm. * 590 * Call: * 591 * * 592 * LD R4 => terminal control block * 593 * CALL LNKCMNDBEG * 594 * PARV command * 595 * PARVL parameter for the command * 596 * * 597 * Eats R0:R3 Eats R2 before taking last PARM * 598 * Stack required = 4 * 599 * 1 + max ( LINKBEGLST (3), MAKECEL (1) ) * 600 * * 601 ********************************************************************************** 602 603 BLOCK make and link command element on list begin 604 ENTRY LNKCMNDBEG 605 606 BEGFRAME 607 ENDFRAME 608 04A6C DD1F8001 6 STAK 609 LNKCMNDBEG ENTR PUSH 04A6D C1528000 2 REG 610 STPV R2 pick up the command 04A6E C052C000 3 REG 611 STPVL R3 and its parameter 04A6F DC004A1C 612 CALL MAKECEL make the command element 04A70 41528000 2 REG 613 PARV R2 pass the command 04A71 4052C000 3 REG 614 PARVL R3 and its parameter 04A72 DC004A4C 615 CALL LINKBEGLST link it into the beginning of the list 04A73 41440004 IMM 616 PARV TCCMNDBURD the "size" of the command 04A74 41168400 2 @R 617 PAR @R2 the element 04A75 40168400 2 @R 618 PARL @R2 619 PUNLOCK TCB,TCLOCK unlock the list 04A76 EC170818 4 BASE 619 STZ TCB,TCLOCK 04A77 0C800000 619 ION 04A78 5D1F8001 6 STAK 620 LEAVE POP 621 * --- 622 623 END LNKCMNDBEG 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1001 (CIAOUTUTIL) F 49 Output utility routines for the CIA 625 626 ********************************************************************************** 627 * * 628 * SETTRSMTR. Routine that will build and link onto the * 629 * end of the specified output queue a port command to set * 630 * the transmitters as indicated. * 631 * Call: * 632 * LD R4 => terminal control block * 633 * CALL SETTRSMTR * 634 * PARVL transmitters to set * 635 * Eats R0:R3 * 636 * Stack required = 5 * 637 * 1 + LINK1CMND(4) * 638 * * 639 ********************************************************************************** 640 641 BLOCK SETTRSMTR and SETACCOPTS subroutines 642 ENTRY SETTRSMTR 643 644 BEGFRAME 645 ENDFRAME 646 04A79 DD1F8001 6 STAK 647 SETTRSMTR ENTR PUSH 04A7A C052C000 3 REG 648 STPVL R3 the transmitters to set 04A7B DC004A5F 649 CALL LINK1CMND place at end of output queue 04A7C 41440083 IMM 650 PARV PORTCSTAT 04A7D 4052C000 3 REG 651 PARVL R3 04A7E 5D1F8001 6 STAK 652 LEAVE POP return to caller 653 * --- 654 655 END SETTRSMTR 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1002 (CIAOUTUTIL) F 49 Output utility routines for the CIA 657 658 ********************************************************************************** 659 * * 660 * SETACCOPTS. Routine that will build and link onto the * 661 * end of the specified output queue a port command to set * 662 * the options as indicated. * 663 * Call: * 664 * LD R4 => terminal control block * 665 * CALL SETACCOPTS * 666 * PARVL options to set * 667 * * 668 * Eats R0:R3 * 669 * Stack required = 5 * 670 * 1 + LINK1CMND(4) * 671 * * 672 ********************************************************************************** 673 674 BLOCK make command to select port options 675 ENTRY SETACCOPTS 676 677 BEGFRAME 678 ENDFRAME 679 04A7F DD1F8001 6 STAK 680 SETACCOPTS ENTR PUSH 04A80 C052C000 3 REG 681 STPVL R3 get the options to set 04A81 DC004A5F 682 CALL LINK1CMND place command at end of output queue 04A82 4144008D IMM 683 PARV PORTCSTAT2 04A83 4052C000 3 REG 684 PARVL R3 04A84 5D1F8001 6 STAK 685 LEAVE POP 686 * --- 687 688 END SETACCOPTS 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1003 (CIAOUTUTIL) F 49 Output utility routines for the CIA 690 691 ********************************************************************************** 692 * * 693 * OUTTSET. Output terminal setting. Given a pointer to * 694 * a TCB (unlocked), this routine will output an initializing * 695 * command followed by commands to set input and output baud * 696 * rates, the echo setting, and then the control setting * 697 * command. These commands are put at the end of the output * 698 * queue so they will not interfere with output in progress. * 699 * We also recalculate TCBAUDROOM (in case the baud rate is * 700 * changing), and send out a pseudo-command to reset the * 701 * port's interface state. * 702 * This command shares code with the OUTTSETX routine. * 703 * The primary difference is in the command used and whether * 704 * these commands go at the head of the queue (used for CIA * 705 * resets) or at the end of the queue (after current outputs, * 706 * used for logoff, etc). We also check to see if we have * 707 * XOFFed the port and if so send an XON to it. * 708 * Call: * 709 * LD TCB => a terminal control block * 710 * CALLNP OUTTSET initializes that port * 711 * Eats R0:R3 * 712 * Stack required = 8 * 713 * 3 + max ( LINKBEGLST (3), LINKINTLST (3), LOCKWAIT (0), * 714 * MAKECEL (1), OUTTERMCH (5) ) * 715 * * 716 ********************************************************************************** 717 718 BLOCK OUTTSET and OUTTSETX subroutines 719 ENTRY OUTTSET 720 ENTRY OUTTSETX 721 00000010 BYTE 722 OUTTSETP EQU BIT 0 bit in R7, 0 sez link on end, 1 sez beginning 723 BEGFRAME 00178801 6 BASE 724 OUTTSETF BSS 1 first element created 00178802 6 BASE 725 OUTSETXON BSS 1 1 sez we sent the XON character 726 ENDFRAME 727 04A85 DD5F8003 6 STAK 728 OUTTSET ENTRNP PUSH 04A86 EC0BC010 7 CBM 729 STZ R7/OUTTSETP flag to say to link on end 00004A87 730 OUTTSHARE LABEL 04A87 5C091A10 4 ZBM 731 CMZ TCB,TCRFP check for RFP terminal 04A88 FE0C4ADA 732 JNE OUTSETXIT jump out if so 733 * \ / 734 04A89 EC178802 6 BASE 735 STZ SP,OUTSETXON say we have not sent the XON 04A8A DC004A1C 736 CALL MAKECEL make the init port state command 04A8B 41440090 IMM 737 PARV PORTPCINIT an init pseudo-command 04A8C 40440000 IMM 738 PARVL 0 no additional parameters 739 * Note that this command element takes no space in the CIA buffer. 04A8D E4978801 2 6 BASE 740 ST R2 SP,OUTTSETF save pointer to first element 04A8E 60D28000 3 2 REG 741 LD TCQ R2 TCQ -> first command element 742 * (now one element) 04A8F F3C04AA6 7 743 JBF R7/OUTTSETP INQUERESET jump to link onto end 744 * \ / 745 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1004 (CIAOUTUTIL) F 49 Output utility routines for the CIA 04A90 60091F16 0 4 ZBM 746 LD R0 TCB,TCCIABLOCK R0 -> CIA control block 04A91 DC004A1C 747 CALL MAKECEL make a reset now command 04A92 4144008F IMM 748 PARV PORTCZAP a reset that happens when received 04A93 4044001F IMM 749 PARVL PORTCRALL reset all the attributes 04A94 5C09101D 4 ZBM 750 CMZ TCB,TCIQXOFFED have we XOFFed this port? 04A95 FE024AA9 751 JEQ RESETNOW if not then don't XON it 752 * \ / 753 04A96 E488DF10 2 3 ZBM 754 ST R2 TCQ,TCQLINK link created element onto chain 04A97 60D28000 3 2 REG 755 LD TCQ R2 and point to the end of the chain 756 PLOCK TCB,TCLOCK 04A98 0CC00000 756 IOFF 04A99 D1D70818 4 BASE 756 SETT TCB,TCLOCK 04A9A FE0C4A9C 756 JNE MA(2+DISPW MA 0) 04A9B DC40308B 756 CALLNP LOCKWAIT 04A9C D189101D 4 ZBM 757 CLRT TCB,TCIQXOFFED clear the bit 758 PUNLOCK TCB,TCLOCK 04A9D EC170818 4 BASE 758 STZ TCB,TCLOCK 04A9E 0C800000 758 ION 04A9F FE024AA9 759 JEQ RESETNOW in case some one else cleared it 04AA0 60840011 2 IMM 760 LD R2 XON 04AA1 DC404994 761 CALLNP OUTTERMCH put the XON in an output element 04AA2 D0401F05 762 DEC TERMWBUSY decrement for the removed XOFF 04AA3 60040004 0 IMM 763 LD R0 TCCMNDBURD command burden 04AA4 E4178802 0 6 BASE 764 ST R0 SP,OUTSETXON how much extra we put in 04AA5 FE0E4AAB 765 JMP RESETNOWX 766 * --- 767 00004AA6 768 INQUERESET LABEL 04AA6 DC004A1C 769 CALL MAKECEL make a command for reset 04AA7 4144008E IMM 770 PARV PORTCRESET indicate command 04AA8 40440018 IMM 771 PARVL PORTCRINIT we are re-initializing the port 772 * \ / 773 00004AA9 774 RESETNOW LABEL 04AA9 E488DF10 2 3 ZBM 775 ST R2 TCQ,TCQLINK remember first element created 04AAA 60D28000 3 2 REG 776 LD TCQ R2 TCQ => last element created 777 * (now two elements) 778 00004AAB 779 RESETNOWX LABEL 04AAB 608900F1 2 4 ZBM 780 LD R2 TCB,TCIRATE get the current rate 04AAC 34871F00 2 IMM 781 RDV R2 -19200*3 convert to baud rate constant 04AAD DC004A1C 782 CALL MAKECEL make command to set input rate 04AAE 41440081 IMM 783 PARV PORTCIRATE command 04AAF 40528000 2 REG 784 PARVL R2 pass the rate to set 04AB0 E488DF10 2 3 ZBM 785 ST R2 TCQ,TCQLINK link new on the end 04AB1 60D28000 3 2 REG 786 LD TCQ R2 R3 => last element created 787 * (now three elements) 788 789 * We calculate TCBAUDROOM every time that the output baud rate is set. 790 * This assures the value is current and saves the driver from computing it. 04AB2 60091EF1 0 4 ZBM 791 LD R0 TCB,TCORATE get the current rate 04AB3 14040019 0 IMM 792 DIV R0 (CIATPS*10)/4 determine how much we will allow in 793 * the output buffer at any given time 04AB4 30040100 0 IMM 794 RSB R0 CIATRMBUFL invert it 04AB5 54040000 0 IMM 795 MAX R0 0 make sure it is not negative 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1005 (CIAOUTUTIL) F 49 Output utility routines for the CIA 04AB6 E4170014 0 4 CACH 796 ST R0 TCB,TCBAUDROOM save for the driver 797 04AB7 60891EF1 2 4 ZBM 798 LD R2 TCB,TCORATE get the current rate 04AB8 34871F00 2 IMM 799 RDV R2 -19200*3 convert to baud rate constant 04AB9 DC004A1C 800 CALL MAKECEL make command for output rate 04ABA 41440082 IMM 801 PARV PORTCORATE command 04ABB 40528000 2 REG 802 PARVL R2 pass the rate to set 04ABC E488DF10 2 3 ZBM 803 ST R2 TCQ,TCQLINK link last to this one 04ABD 60D28000 3 2 REG 804 LD TCQ R2 R3 => last created element 805 * (now four elements) 806 04ABE DC004A1C 807 CALL MAKECEL make an element to set CIA options 04ABF 4144008D IMM 808 PARV PORTCSTAT2 set port options 04AC0 40570013 4 CACH 809 PARVL TCB,TCLASTCOM2 what to set them to 04AC1 E488DF10 2 3 ZBM 810 ST R2 TCQ,TCQLINK link last to this one 04AC2 60D28000 3 2 REG 811 LD TCQ R2 R3 => last element 812 * (now five elements) 813 04AC3 DC004A1C 814 CALL MAKECEL make an element to set CIA options 04AC4 41440083 IMM 815 PARV PORTCSTAT set port options 04AC5 40570012 4 CACH 816 PARVL TCB,TCLASTCOM what to set them to 04AC6 E488DF10 2 3 ZBM 817 ST R2 TCQ,TCQLINK link last to this one 04AC7 60D28000 3 2 REG 818 LD TCQ R2 R3 => last element 819 * (now six elements) 820 04AC8 60840088 2 IMM 821 LD R2 PORTECHOON get echo on command 04AC9 60093C21 0 4 ZBM 822 LD R0 TCB,TCECHO get the echo code 04ACA 64040001 0 IMM 823 CPR R0 ECHOMCIA is the CIA to do the echo? 04ACB FE024ACD 824 JEQ OUTTSETE jump if so 04ACC 60840089 2 IMM 825 LD R2 PORTECHOOF get echo off command then 00004ACD 826 OUTTSETE LABEL 04ACD DC004A1C 827 CALL MAKECEL make element for echo 04ACE 41528000 2 REG 828 PARV R2 pass command 04ACF 40440000 IMM 829 PARVL 0 no value associated 04AD0 E488DF10 2 3 ZBM 830 ST R2 TCQ,TCQLINK link it in 831 * (now seven elements) 832 04AD1 60578801 1 6 BASE 833 LD R1 SP,OUTTSETF pick up first element pointer 04AD2 F3C04ADB 7 834 JBF R7/OUTTSETP ONTOEND jump to link onto end 04AD3 60178802 0 6 BASE 835 LD R0 SP,OUTSETXON get count of extra chars being linked 04AD4 DC004A4C 836 CALL LINKBEGLST call to hook this list into TCQ 04AD5 41561018 0 REG 837 PARV R0+6*TCCMNDBURD assumed size for six commands 838 * pseudo-command has no size 04AD6 41164400 1 @R 839 PAR @R1 pointer to list beginning 04AD7 40168400 2 @R 840 PARL @R2 pointer to list end 00004AD8 841 UNDOLOCK LABEL 842 PUNLOCK TCB,TCLOCK release the locks 04AD8 EC170818 4 BASE 842 STZ TCB,TCLOCK 04AD9 0C800000 842 ION 00004ADA 843 OUTSETXIT LABEL 04ADA 5D1F8003 6 STAK 844 LEAVE POP return 845 * --- 846 847 * Link elements onto end of queue 00004ADB 848 ONTOEND LABEL 04ADB DC004A32 849 CALL LINKINTLST hook this list onto TCQ end 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1006 (CIAOUTUTIL) F 49 Output utility routines for the CIA 04ADC 41440018 IMM 850 PARV 6*TCCMNDBURD assumed size for six commands 851 * pseudo-command has no size 04ADD 41164400 1 @R 852 PAR @R1 pointer to list beginning 04ADE 40168400 2 @R 853 PARL @R2 pointer to list end 04ADF FE0E4AD8 854 JMP UNDOLOCK and go release the lock 855 * --- 856 857 ********************************************************************************** 858 * * 859 * OUTTSETX. Identical to OUTTSET (see above) except that * 860 * the generated command elements are linked onto the beginning * 861 * of the output stream and the reset command is the one that * 862 * happens when received rather then when it shuffles to the * 863 * buffer head. This will affect output in progress. * 864 * * 865 ********************************************************************************** 866 04AE0 DD5F8003 6 STAK 867 OUTTSETX ENTRNP PUSH 04AE1 EDCBC010 7 CBM 868 STW R7/OUTTSETP flag to say link on beginning 04AE2 FE0E4A87 869 JMP OUTTSHARE go share code 870 * --- 871 872 END OUTTSET and OUTTSETX subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1007 (CIAOUTUTIL) F 49 Output utility routines for the CIA 874 875 ********************************************************************************** 876 * * 877 * FLUSHOQ. Flush the output queue for the specified * 878 * terminal. This routine does not send a command to the * 879 * CIA to flush its buffer. * 880 * Call: * 881 * LD R4 => TCB * 882 * CALLNP FLUSHOQ * 883 * gets R0 thru R3 * 884 * Stack required = 1 * 885 * 1 + max ( LOCKWAIT (0), SFREEMEM (0) ) * 886 * * 887 ********************************************************************************** 888 889 BLOCK FLUSHOQ subroutine 890 ENTRY FLUSHOQ 891 892 BEGFRAME 893 ENDFRAME 894 04AE3 DD5F8001 6 STAK 895 FLUSHOQ ENTRNP PUSH 896 PLOCK TCB,TCLOCK call to lock the element 04AE4 0CC00000 896 IOFF 04AE5 D1D70818 4 BASE 896 SETT TCB,TCLOCK 04AE6 FE0C4AE8 896 JNE MA(2+DISPW MA 0) 04AE7 DC40308B 896 CALLNP LOCKWAIT 04AE8 60C91F1A 3 4 ZBM 897 LD TCQ TCB,TCTTOBP get the first of the list 04AE9 EC091F1A 4 ZBM 898 STZ TCB,TCTTOBP indicate no list any more 04AEA EC09011B 4 ZBM 899 STZ TCB,TCTTOEP kill end ptr too 04AEB EC0900FA 4 ZBM 900 STZ TCB,TCTTOCNT and count now zero, too 04AEC FAF04AEE 3 901 JZA TCQ FLUSHOQSHR jump if no list was here 04AED D0401F05 902 DEC TERMWBUSY if list, indicate one less outputter 00004AEE 903 FLUSHOQSHR LABEL 904 PUNLOCK TCB,TCLOCK call to release the element 04AEE EC170818 4 BASE 904 STZ TCB,TCLOCK 04AEF 0C800000 904 ION 04AF0 FAF04AF7 3 905 JZA TCQ FLUSHOQX jump iff no list at all 00004AF1 906 FLUSHOQL LABEL 04AF1 6088DF10 2 3 ZBM 907 LD R2 TCQ,TCQLINK save link to next block 04AF2 DC002F5D 908 CALL SFREEMEM free one block 04AF3 4148D060 3 ZBM 909 PARV TCQ,TCQLOG indicate its size 04AF4 4052C000 3 REG 910 PARVL TCQ and address 04AF5 60D28000 3 2 REG 911 LD TCQ R2 copy to next blocks address 04AF6 FAF24AF1 3 912 JNZA TCQ FLUSHOQL jump if another block 00004AF7 913 FLUSHOQX LABEL 04AF7 5D1F8001 6 STAK 914 LEAVE POP return to caller 915 * --- 916 917 END FLUSHOQ subroutine 918 919 920 END Comm Utility Routines 85 INPUT CIAINUTIL Input Utilities for Comm 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1008 (CIAINUTIL) F 50 Input utility routines for the CIA 3 4 CIAINUTIL BLOCK Comm Utility Routines 5 6 ENTRY CALCTERMC calculate terminating character count 7 ENTRY CHECKLOGD check port for logged on 8 ENTRY ECHOALL cause all input characters to echo 9 ENTRY ECHOLINE echo the first input line 10 ENTRY FILLTCQ fill TCQ with characters 11 ENTRY FLUSHIQ flush terminal input queue 12 ENTRY GETTERMPTR make pointer to TCA in use 13 ENTRY MAKTRMSTAT make status word for .TERM 14 ENTRY MOVECHARIN to move in a character string 15 ENTRY PUTINCHAR put one char in input list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1009 (CIAINUTIL) F 50 Input utility routines for the CIA 17 18 ********************************************************************************** 19 * * 20 * FLUSHIQ. Routine to flush the input queue of the * 21 * specified terminal. This routine does not send a command * 22 * to the CIA to flush its buffer. The only special processing * 23 * is done when the "read in progress" flag is on. In this * 24 * case, we cannot flush the first record, so we search for * 25 * the first terminator and free after it. * 26 * Call: * 27 * LD R4 => TCB * 28 * CALLNP FLUSHIQ * 29 * Gets R0 thru R3 * 30 * Stack required = 2. * 31 * 2 + max ( LOCKWAIT (0), SFREEMEM (0) ) * 32 * * 33 ********************************************************************************** 34 35 BLOCK FLUSHIQ subroutine 36 ENTRY FLUSHIQ 37 38 BEGFRAME 00178801 6 BASE 39 SUMC BSS 1 total keepable 40 ENDFRAME 41 04AF8 DD5F8002 6 STAK 42 FLUSHIQ ENTRNP PUSH 43 PLOCK TCB,TCLOCK lock the access list 04AF9 0CC00000 43 IOFF 04AFA D1D70818 4 BASE 43 SETT TCB,TCLOCK 04AFB FE0C4AFD 43 JNE MA(2+DISPW MA 0) 04AFC DC40308B 43 CALLNP LOCKWAIT 04AFD 60C9231C 3 4 ZBM 44 LD TCQ TCB,TCTTIBP get beginning pointer 04AFE 5C09041D 4 ZBM 45 CMZ TCB,TCREADIP is there a read in progress? 04AFF FE0C4B05 46 JNE FLSHIQRIP if so, leave first record 04B00 EC09231C 4 ZBM 47 STZ TCB,TCTTIBP indicate list no longer here 04B01 EC09011C 4 ZBM 48 STZ TCB,TCTTIEP clear the end pointer too 04B02 EC0922FB 4 ZBM 49 STZ TCB,TCTTICNT clear the count of characters 04B03 EC17080E 4 BASE 50 STZ TCB,TCTERMLOC and the terminator location 04B04 FE0E4B17 51 JMP FLUSHIQSHR so share code 52 * --- 53 54 * Read in progress, find the first terminator 55 00004B05 56 FLSHIQRIP LABEL 04B05 60040000 0 IMM 57 LD R0 0 initialize count of characters 00004B06 58 FLSHCNTL LABEL 04B06 64C91F1E 3 4 ZBM 59 CPR TCQ TCB,TCTERMTCQ does this TCQ hold the first terminator? 04B07 FE024B0C 60 JEQ FLSHTRMS if so jump to release the remainder 04B08 1816C004 0 3 CACH 61 ADD R0 TCQ,TCQLAST get end index 04B09 1016C000 0 3 CACH 62 SUB R0 TCQ,TCQFIRST add the number of characters herein to R0 04B0A FAF64B06 3 63 LJNA TCQ FLSHCNTL move to next block 04B0B 00130210 64 HALT HALTS0210 no such TCQ in queue 65 * --- 66 00004B0C 67 FLSHTRMS LABEL 04B0C E4178801 0 6 BASE 68 ST R0 SP,SUMC save number keepable 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1010 (CIAINUTIL) F 50 Input utility routines for the CIA 04B0D 604900FE 1 4 ZBM 69 LD R1 TCB,TCTERMCHLC get index for terminator 04B0E 18440001 1 IMM 70 ADD R1 1 advance so as to keep terminator 04B0F E456C004 1 3 CACH 71 ST R1 TCQ,TCQLAST make end pointer point at first terminator 04B10 1056C000 1 3 CACH 72 SUB R1 TCQ,TCQFIRST make count of characters in this TCQ 04B11 18578801 1 6 BASE 73 ADD R1 SP,SUMC produce number of 'keepers' 04B12 E44922FB 1 4 ZBM 74 ST R1 TCB,TCTTICNT save in TCB 04B13 6048DF10 1 3 ZBM 75 LD R1 TCQ,TCQLINK get link to remainder of list 04B14 EC08DF10 3 ZBM 76 STZ TCQ,TCQLINK no blocks after this 04B15 E4C9011C 3 4 ZBM 77 ST TCQ TCB,TCTTIEP new list end 04B16 60D24000 3 1 REG 78 LD TCQ R1 copy ptr to list remainder 79 * \ / 00004B17 80 FLUSHIQSHR LABEL 81 PUNLOCK TCB,TCLOCK call to release the element 04B17 EC170818 4 BASE 81 STZ TCB,TCLOCK 04B18 0C800000 81 ION 04B19 FAF04B20 3 82 JZA TCQ FLUSHIQX jump iff no list at all 00004B1A 83 FLUSHIQL LABEL 04B1A 6088DF10 2 3 ZBM 84 LD R2 TCQ,TCQLINK save link to next block 04B1B DC002F5D 85 CALL SFREEMEM free one block 04B1C 4148D060 3 ZBM 86 PARV TCQ,TCQLOG indicate its size 04B1D 4052C000 3 REG 87 PARVL TCQ and address 04B1E 60D28000 3 2 REG 88 LD TCQ R2 copy to next blocks address 04B1F FAF24B1A 3 89 JNZA TCQ FLUSHIQL jump if another block 00004B20 90 FLUSHIQX LABEL 04B20 5D1F8002 6 STAK 91 LEAVE POP return to caller 92 * --- 93 94 END FLUSHIQ subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1011 (CIAINUTIL) F 50 Input utility routines for the CIA 96 97 ********************************************************************************** 98 * * 99 * PUTINCHAR. Routine to place a character into the * 100 * input queue. It handles break, backspace, line kill, * 101 * as well as doing echo if specified. The input queue * 102 * must not be locked. * 103 * Call: * 104 * LD R2 char (BREAKMARK if break) * 105 * LD R4 => TCB * 106 * CALLNP PUTINCHAR * 107 * * 108 * Gets R0 thru R3 * 109 * Stack required = 10 * 110 * 2 + max (FLUSHIQ (2), GETTERMPTR (1), GIVEUINT (8), * 111 * INPUTERR (3), LINKBEGLST (3), LOCKWAIT (0), * 112 * OUTTERMCH (5), PLACEOUTCH (6), ROUST (4), * 113 * SETACCOPTS (5), SGETMEM (0) ) * 114 * * 115 ********************************************************************************** 116 117 BLOCK PUTINCHAR subroutine 118 ENTRY PUTINCHAR 119 120 BEGFRAME 00178801 6 BASE 121 PUTINCHART BSS 1 character temp 122 ENDFRAME 123 00000002 ABS 124 INTRMDSIZ EQU 4 LOG 2 default size for input queue elements 125 04B21 DD5F8002 6 STAK 126 PUTINCHAR ENTRNP PUSH 04B22 64840100 2 IMM 127 CPR R2 BREAKMARK is this a break? 04B23 FE024B88 128 JEQ PUTINBREAK jump if so, give to user 04B24 600AB270 0 2 CBM 129 LD R0 R2/BITS 25:31 get the right 7 bits 04B25 64170018 0 4 CACH 130 CPR R0 TCB,TCBRCH check for a 'break' character 04B26 FE024B87 131 JEQ PRCBRKCH jump to check for a valid one 132 * \ / 133 00004B27 134 NULLCHAR LABEL 04B27 604922FB 1 4 ZBM 135 LD R1 TCB,TCTTICNT get the input buffer current size 04B28 644403DD 1 IMM 136 CPR R1 MAXIXOFF have we reached the XOFF point? 04B29 FE0A4B2E 137 JLE NOTOFLOW if not then no problem 04B2A 5C091015 4 ZBM 138 CMZ TCB,TCXOFFIQ should we XOFF when input queue is full? 04B2B FE0C4BAC 139 JNE XOFFINQUE if so go do it 00004B2C 140 CHECKOFLOW LABEL 04B2C 644407BA 1 IMM 141 CPR R1 MAXINQUE check against the input buffer size limit 04B2D FE044BC2 142 JGT OVERFLOW jump if so 143 * \ / 144 00004B2E 145 NOTOFLOW LABEL 146 PLOCK TCB,TCLOCK get exclusive access to list 04B2E 0CC00000 146 IOFF 04B2F D1D70818 4 BASE 146 SETT TCB,TCLOCK 04B30 FE0C4B32 146 JNE MA(2+DISPW MA 0) 04B31 DC40308B 146 CALLNP LOCKWAIT 04B32 5C090E1D 4 ZBM 147 CMZ TCB,TCINECHO check kind of echo 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1012 (CIAINUTIL) F 50 Input utility routines for the CIA 04B33 ED8BC010 7 CBM 148 STLNE R7/BIT 0 remember delayed echo mode 04B34 60C9011C 3 4 ZBM 149 LD TCQ TCB,TCTTIEP load the current input buffer block pointer 04B35 FAF04B38 3 150 JZA TCQ OCADDNEW start a new TCQ if none exist 04B36 5C08DC10 3 ZBM 151 CMZ TCQ,TCQCOMND is this an error element 04B37 FE024B45 152 JEQ PLCCHAR if not then use this TCQ 153 * \ / 154 00004B38 155 OCADDNEW LABEL 04B38 DC002ED0 156 CALL SGETMEM four word block holds 10 characters 04B39 40440002 IMM 157 PARVL INTRMDSIZ 04B3A EE160800 0 BASE 158 STZ2 R0,0 initialize the control information 04B3B 60440002 1 IMM 159 LD R1 INTRMDSIZ log block size = 2 04B3C E4481060 1 0 ZBM 160 ST R1 R0,TCQLOG save block size 04B3D 6044000A 1 IMM 161 LD R1 ((2 POWER INTRMDSIZ)*CPW)-TCQUSED load the available size 04B3E E4560005 1 0 CACH 162 ST R1 R0,TCQSIZE and save in block 04B3F FAF04B41 3 163 JZA TCQ NOEXISTLST jump if no existing list 04B40 E408DF10 0 3 ZBM 164 ST R0 TCQ,TCQLINK link on this block 00004B41 165 NOEXISTLST LABEL 04B41 E409011C 0 4 ZBM 166 ST R0 TCB,TCTTIEP set new end pointer 04B42 FAF24B44 3 167 JNZA TCQ NOTNEWLIST jump if list already had blocks in it 04B43 E409231C 0 4 ZBM 168 ST R0 TCB,TCTTIBP otherwise, this block is new list head 00004B44 169 NOTNEWLIST LABEL 04B44 60D20000 3 0 REG 170 LD TCQ R0 copy current block pointer 171 * \ / 00004B45 172 PLCCHAR LABEL 04B45 BC56C004 1 3 CACH 173 INCL R1 TCQ,TCQLAST update and load the CPP 04B46 6456C005 1 3 CACH 174 CPR R1 TCQ,TCQSIZE is this block full? 04B47 FE0A4B4A 175 JLE OCSTOREIN jump if not, store away current char 04B48 D056C004 3 CACH 176 DEC TCQ,TCQLAST this block full, restore the counter 04B49 FE0E4B38 177 JMP OCADDNEW make a new block 178 * --- 179 180 ********************************************************************************** 181 * * 182 * We have found or generated a TCQ element that has * 183 * room for the single character that we have. Place the * 184 * character into the TCQ and check for it being a * 185 * terminator. * 186 * * 187 ********************************************************************************** 188 00004B4A 189 OCSTOREIN LABEL 04B4A E49AC805 2 31 CACH 190 ST R2 TCQ,TCQCHARS(R1) place character in 04B4B D00922FB 4 ZBM 191 INC TCB,TCTTICNT count number of characters in 04B4C E4978801 2 6 BASE 192 ST R2 SP,PUTINCHART save the received character 04B4D 5C17080E 4 BASE 193 CMZ TCB,TCTERMLOC do we already have a terminator? 04B4E FE0C4B63 194 JNE NOUNSUSP jump if so, one's enough 04B4F DC404C8B 195 CALLNP GETTERMPTR R1 => term array 04B50 5C1A5400 12 @R 196 CMZ @R1(R2) is this a terminator? 04B51 FE024B63 197 JEQ NOUNSUSP jump if not a terminator 04B52 E4C91F1E 3 4 ZBM 198 ST TCQ TCB,TCTERMTCQ save pointer to TCQ holding terminator 04B53 6056C004 1 3 CACH 199 LD R1 TCQ,TCQLAST get index to this character 04B54 10440001 1 IMM 200 SUB R1 1 back up to character just placed 04B55 E44900FE 1 4 ZBM 201 ST R1 TCB,TCTERMCHLC and save terminator index 04B56 EC090E1D 4 ZBM 202 STZ TCB,TCINECHO indicate no more echo of line 04B57 DC003457 203 CALL GIVEUINT give interrupt to trapper 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1013 (CIAINUTIL) F 50 Input utility routines for the CIA 04B58 41491F17 4 ZBM 204 PARV TCB,TCPCADRS PCB of our user 04B59 41530000 4 REG 205 PARV TCB value of PCQPARM if waiting 04B5A 4147FFFF IMM 206 PARV ONEBITS mask for PCQPARM if waiting 04B5B 4144000C IMM 207 PARV NQTERMWAIT queue in if waiting 04B5C 41420100 IMM 208 PARV 1*BIT CAIMNETERM program interrupt mask bit 04B5D 60091615 0 4 ZBM 209 LD R0 TCB,TCINTTCG terminator a trapper's? 04B5E 78091E18 0 4 ZBM 210 AND R0 TCB,TCINTE ints enabled on unit? 04B5F 41520000 0 REG 211 PARV R0 device interrupt enable bit 04B60 41440022 IMM 212 PARV UINTNETERM interrupt code 04B61 40491F15 4 ZBM 213 PARVL TCB,TCFCB interrupt subcode 04B62 60978801 2 6 BASE 214 LD R2 SP,PUTINCHART get the received char back 00004B63 215 NOUNSUSP LABEL 216 PUNLOCK TCB,TCLOCK release this list 04B63 EC170818 4 BASE 216 STZ TCB,TCLOCK 04B64 0C800000 216 ION 04B65 60093C21 0 4 ZBM 217 LD R0 TCB,TCECHO fetch the echo control field 04B66 5CA04B67 0 218 LDPC ECHOMODE(R0) do appropriate echo processing 219 * --- 220 00004B67 221 ECHOMODE LABEL 04B67 00004B6E 222 PTR CHEK4LKILL no echo 04B68 00004B6E 223 PTR CHEK4LKILL hardware echo 04B69 00004B6C 224 PTR DOECHO software echo 04B6A 00004B6B 225 PTR CHECKECHO echo when read 226 227 * See if echo because in read mode 00004B6B 228 CHECKECHO LABEL 04B6B F3C04B71 7 229 JBF R7/BIT 0 PUTLEAVE jump if not within line 230 * \ / 00004B6C 231 DOECHO LABEL 04B6C DC404983 232 CALLNP PLACEOUTCH output the character 04B6D 60978801 2 6 BASE 233 LD R2 SP,PUTINCHART get the received char back 00004B6E 234 CHEK4LKILL LABEL 04B6E 7884007F 2 IMM 235 AND R2 07F line kill is only a 7-bit char 04B6F 64891076 2 4 ZBM 236 CPR R2 TCB,TCLKILLC is the char a line kill 04B70 FE024B72 237 JEQ LKILLPROC jump if so, process line kill 238 * \ / 239 00004B71 240 PUTLEAVE LABEL 04B71 5D1F8002 6 STAK 241 LEAVE POP return 242 * --- 243 244 ********************************************************************************** 245 * A line kill character is being entered. If the * 246 * character is not a terminator then the character * 247 * processor will probably accept it as the line kill * 248 * character so if it passes that test, we here output * 249 * the line kill response. If a program is shifting * 250 * between terminating character sets or changing the * 251 * line kill character while type ahead is happening * 252 * and the terminal is not set to echo mode 3 it * 253 * is possible to get false line kill prompts, but the * 254 * kills will be processed properly. * 255 ********************************************************************************** 256 00004B72 257 LKILLPROC LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1014 (CIAINUTIL) F 50 Input utility routines for the CIA 04B72 FA824B71 2 258 JEQZ R2 PUTLEAVE null characters indicate nothing specified 04B73 6484007F 2 IMM 259 CPR R2 DEL check for a delete, it's non-printing 04B74 FE024B77 260 JEQ NONPRINT jump if it is 04B75 64840020 2 IMM 261 CPR R2 " " check to see if printing 04B76 FE064B71 262 JGE PUTLEAVE skip echoing response if printing lkill 00004B77 263 NONPRINT LABEL 264 PLOCK TCB,TCLOCK lock up the TCB 04B77 0CC00000 264 IOFF 04B78 D1D70818 4 BASE 264 SETT TCB,TCLOCK 04B79 FE0C4B7B 264 JNE MA(2+DISPW MA 0) 04B7A DC40308B 264 CALLNP LOCKWAIT 04B7B DC404C8B 265 CALLNP GETTERMPTR get the terminating character array 266 PUNLOCK TCB,TCLOCK release the TCB 04B7C EC170818 4 BASE 266 STZ TCB,TCLOCK 04B7D 0C800000 266 ION 04B7E 5C1A5400 12 @R 267 CMZ @R1(R2) see if this character is a terminator 04B7F FE0C4B71 268 JNE PUTLEAVE skip echo if terminator 04B80 6084005C 2 IMM 269 LD R2 "\" get the line kill echo character 04B81 DC404983 270 CALLNP PLACEOUTCH put into the output buffer 04B82 6084000D 2 IMM 271 LD R2 CR get a CR 04B83 DC404983 272 CALLNP PLACEOUTCH put into the output buffer 04B84 6084000A 2 IMM 273 LD R2 LF get a LF 04B85 DC404983 274 CALLNP PLACEOUTCH put into the output buffer 04B86 FE0E4B71 275 JMP PUTLEAVE and continue processing 276 * --- 277 278 ********************************************************************************** 279 * * 280 * We believe we have encountered an indication of a * 281 * terminal "break" condition (exception: "null" is not a break * 282 * character). We hereby send a user interrupt to the session * 283 * reading the terminal, if any. * 284 * * 285 ********************************************************************************** 286 00004B87 287 PRCBRKCH LABEL 04B87 FA024B27 0 288 JEQZ R0 NULLCHAR jump if break character not really set 289 * \ / 290 00004B88 291 PUTINBREAK LABEL 04B88 DC004A6C 292 CALL LNKCMNDBEG urgent command to ACC 04B89 4144008F IMM 293 PARV PORTCZAP 04B8A 40440004 IMM 294 PARVL 1*PORTCRCXON forget about any XON in effect 04B8B DC003457 295 CALL GIVEUINT tell user about the BREAK 04B8C 41491F17 4 ZBM 296 PARV TCB,TCPCADRS PCB of our user 04B8D 41440001 IMM 297 PARV 1 value of PCQPARM if waiting (can't wait) 04B8E 41440000 IMM 298 PARV 0 mask for PCQPARM (can't wait) 04B8F 4147FFFF IMM 299 PARV -1 queue in if waiting (can't wait) 04B90 41420400 IMM 300 PARV 1*BIT CAIMBREAK program interrupt mask 04B91 41440001 IMM 301 PARV 1 device interrupt enable bit (always) 04B92 41440020 IMM 302 PARV UINTBREAK interrupt code 04B93 40491F15 4 ZBM 303 PARVL TCB,TCFCB interrupt subcode 04B94 60091F17 0 4 ZBM 304 LD R0 TCB,TCPCADRS get associated process, if any 04B95 FA304BA3 0 305 JZA R0 NOTBREAKX jump if process disappeared 04B96 60081F13 0 0 ZBM 306 LD R0 R0,PCPSADRS R0=>PSA of the user 04B97 5C081214 0 ZBM 307 CMZ R0,PSCNTLMODE is he in control mode? 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1015 (CIAINUTIL) F 50 Input utility routines for the CIA 04B98 FE0C4BA3 308 JNE NOTBREAKX if he is, don't do the message thing 04B99 6084002A 2 IMM 309 LD R2 "*" 04B9A DC404983 310 CALLNP PLACEOUTCH "*BRK*" to signify break 04B9B 60840042 2 IMM 311 LD R2 "B" 04B9C DC404983 312 CALLNP PLACEOUTCH 04B9D 60840052 2 IMM 313 LD R2 "R" 04B9E DC404983 314 CALLNP PLACEOUTCH 04B9F 6084004B 2 IMM 315 LD R2 "K" 04BA0 DC404983 316 CALLNP PLACEOUTCH 04BA1 6084002A 2 IMM 317 LD R2 "*" 04BA2 DC404983 318 CALLNP PLACEOUTCH 00004BA3 319 NOTBREAKX LABEL 04BA3 6084000D 2 IMM 320 LD R2 CR get a CR 04BA4 DC404983 321 CALLNP PLACEOUTCH and place it 04BA5 6084000A 2 IMM 322 LD R2 LF get a line feed 04BA6 DC404983 323 CALLNP PLACEOUTCH place into output string 04BA7 DC404AF8 324 CALLNP FLUSHIQ dump the users input chars 04BA8 60C91F17 3 4 ZBM 325 LD R3 TCB,TCPCADRS get the PCB address for this process 04BA9 FAF04B71 3 326 JZA R3 PUTLEAVE odd to be here, but many breaks will do it 04BAA DC403569 327 CALLNP ROUST see that he processes the break 04BAB FE0E4B71 328 JMP PUTLEAVE exit 329 * --- 330 331 ********************************************************************************** 332 * * 333 * We have put many, many characters into the port's input * 334 * buffer but no one is removing them. The user wishes to be * 335 * XOFFed when this happens so that we won't flush his input * 336 * queue when the maximum input count is surpassed. We first * 337 * check to make sure we haven't already sent the XOFF before * 338 * sending one. There is likely to be a few characters coming * 339 * in after we send the XOFF. * 340 * TERMWBUSY is incremented since the check to send the XON * 341 * is in the CIA write code. This forces the CIADRIVER to scan * 342 * the TCBs for writes and possible XON sending. * 343 * * 344 ********************************************************************************** 345 00004BAC 346 XOFFINQUE LABEL 347 PLOCK TCB,TCLOCK lock up the TCB 04BAC 0CC00000 347 IOFF 04BAD D1D70818 4 BASE 347 SETT TCB,TCLOCK 04BAE FE0C4BB0 347 JNE MA(2+DISPW MA 0) 04BAF DC40308B 347 CALLNP LOCKWAIT 04BB0 D1C9101D 4 ZBM 348 SETT TCB,TCIQXOFFED say we have XOFFed the input 349 PUNLOCK TCB,TCLOCK release the TCB 04BB1 EC170818 4 BASE 349 STZ TCB,TCLOCK 04BB2 0C800000 349 ION 04BB3 FE024B2C 350 JEQ CHECKOFLOW jump if this has happened before 351 * \ / need to XOFF the port 04BB4 E4978801 2 6 BASE 352 ST R2 SP,PUTINCHART save our character 04BB5 60840013 2 IMM 353 LD R2 XOFF pick up the XOFF character 04BB6 60C40000 3 IMM 354 LD TCQ 0 04BB7 DC404994 355 CALLNP OUTTERMCH put it in its own TCQ 04BB8 DC004A4C 356 CALL LINKBEGLST put at the head of our output list 04BB9 41440001 IMM 357 PARV 1 number of characters 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1016 (CIAINUTIL) F 50 Input utility routines for the CIA 04BBA 4116C400 3 @R 358 PAR @TCQ beginning of list 04BBB 4016C400 3 @R 359 PARL @TCQ end of list 04BBC D0001F05 360 INC TERMWBUSY XOFF sent 361 PUNLOCK TCB,TCLOCK unlock the TCB 04BBD EC170818 4 BASE 361 STZ TCB,TCLOCK 04BBE 0C800000 361 ION 04BBF 604922FB 1 4 ZBM 362 LD R1 TCB,TCTTICNT restore our input count 04BC0 60978801 2 6 BASE 363 LD R2 SP,PUTINCHART restore our character 04BC1 FE0E4B2C 364 JMP CHECKOFLOW might have overflow, too 365 * --- 366 367 ********************************************************************************** 368 * * 369 * The number of input characters exceeds an arbitrary (and * 370 * rather large) limit. We check to see if this is the second * 371 * occurrence of an overflow without a successful read in * 372 * between. If it is so, we shut down that port for two minutes * 373 * in the hopes that the data generator will go away since the * 374 * program doesn't seem to be reading the data. Regardless, we * 375 * flush the buffer and queue an error element for the next read. * 376 * * 377 ********************************************************************************** 378 00004BC2 379 OVERFLOW LABEL 380 PLOCK TCB,TCLOCK lock up the TCB 04BC2 0CC00000 380 IOFF 04BC3 D1D70818 4 BASE 380 SETT TCB,TCLOCK 04BC4 FE0C4BC6 380 JNE MA(2+DISPW MA 0) 04BC5 DC40308B 380 CALLNP LOCKWAIT 04BC6 D1C9061D 4 ZBM 381 SETT TCB,TCINQFILL say we have input overrun 04BC7 FE024BCE 382 JEQ NEEDSHUTDN jump if this has already happened before 383 PUNLOCK TCB,TCLOCK release the TCB 04BC8 EC170818 4 BASE 383 STZ TCB,TCLOCK 04BC9 0C800000 383 ION 00004BCA 384 OVERFLOW1 LABEL 04BCA DC404AF8 385 CALLNP FLUSHIQ dump the users input chars 04BCB DC004D5C 386 CALL INPUTERR make an error element 04BCC 404400E2 IMM 387 PARVL DEVERPIBO pass the error code 04BCD FE0E4B71 388 JMP PUTLEAVE exit 389 * --- 390 391 * Disable input from this port for two minutes 00004BCE 392 NEEDSHUTDN LABEL 04BCE 6004000F 0 IMM 393 LD R0 STATE15 shutdown state code 04BCF E4090249 0 4 ZBM 394 ST R0 TCB,TCINTSTATE force us into shut down state 04BD0 700404B0 0 IMM 395 LDN R0 WAIT120SEC keep shut down for 2 minutes 04BD1 60440001 1 IMM 396 LD R1 TIMESHUT indicate routine to execute 04BD2 E4490A39 1 4 ZBM 397 ST R1 TCB,TCTIMERTN set it 04BD3 E0170817 0 4 BASE 398 EXCH R0 TCB,TCTIMECNT get the old timing number 04BD4 FA0C4BD7 0 399 JNEZ R0 TIMECNTOK jump if already timing 04BD5 60091F16 0 4 ZBM 400 LD R0 TCB,TCCIABLOCK get comm control element 04BD6 D016080A 0 BASE 401 INC R0,COMTRMTMNG another timer on this comm 00004BD7 402 TIMECNTOK LABEL 403 PUNLOCK TCB,TCLOCK release the TCB 04BD7 EC170818 4 BASE 403 STZ TCB,TCLOCK 04BD8 0C800000 403 ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1017 (CIAINUTIL) F 50 Input utility routines for the CIA 04BD9 60970013 2 4 CACH 404 LD R2 TCB,TCLASTCOM2 04BDA EC0AB610 2 CBM 405 STZ R2/PORTSRDE pass options with receiving turned off 04BDB DC004A7F 406 CALL SETACCOPTS send stuff to the ACC 04BDC 40528000 2 REG 407 PARVL R2 options to set 04BDD FE0E4BCA 408 JMP OVERFLOW1 rejoin code 409 * --- 410 411 END PUTINCHAR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1018 (CIAINUTIL) F 50 Input utility routines for the CIA 413 414 ********************************************************************************** 415 * * 416 * MOVECHARIN. This routine moves a string of characters * 417 * (presumably from the comm input buffer) into the input buffer * 418 * for the specified terminal. This routine is intended to be a * 419 * much faster version of PUTINCHAR for use when a block mode * 420 * device is sending at high, continuous rates. It does not * 421 * check for input buffer overrun, it does not do certain echo * 422 * modes, and it has a higher setup time. Consequently, it is * 423 * used only when these restrictions do not matter. * 424 * Timing. On a fast input port, each interrupt can supply * 425 * about 100 characters for each port. This represents the * 426 * worst case load for the comm. During testing in 1984, we * 427 * discovered that the existing routine could not handle 64 * 428 * ports at maximum rate due to the processing overhead in * 429 * MOVECHARIN. The following timings were calculated then for a * 430 * CPU3. The original routine moved one character at a time * 431 * checking each for a terminator. The original code used about * 432 * 110 usec for setup and 19 usec for each character for a total * 433 * of 2010 usec for such a port. The new code using the TSCAN * 434 * used about 110 usec for setup, 2.5 usec for each character * 435 * in the tscan, overhead of 35 usec, and .75 usec for each * 436 * character moved, to total about 470 usec for such a port. * 437 * For a comm where each port is supplying characters at * 438 * the maximum rate, 64 ports used 128 msec with the old method, * 439 * longer than the time between interrupts. With the new * 440 * method, 64 ports requires only 30 msec. * 441 * Call: * 442 * * 443 * LD R4 => TCB * 444 * CALL MOVECHARIN * 445 * PAR => the characters * 446 * PARVL number of characters * 447 * * 448 * Eats R0:R3 * 449 * Stack required = 14 * 450 * 6 + max ( GETTERMPTR (1), GIVEUINT (8), LOCKWAIT (0), * 451 * SGETMEM (0) ) * 452 * * 453 ********************************************************************************** 454 455 BLOCK MOVECHARIN subroutine 456 ENTRY MOVECHARIN move characters in mass 457 458 BEGFRAME 00178801 6 BASE 459 CHRSMOVD BSS 1 number of characters moved 00178802 6 BASE 460 THEFIRST1 BSS 1 => the first TCB created 00178803 6 BASE 461 CHARSLEFT BSS 1 characters left to process 00178804 6 BASE 462 INBUFF BSS 1 => the first char to move 00178805 6 BASE 463 SAVER5 BSS 1 to save R5 464 ENDFRAME 465 04BDE DD1F8006 6 STAK 466 MOVECHARIN ENTR PUSH 04BDF C1178804 6 BASE 467 STP SP,INBUFF save pointer to the characters 04BE0 C0578803 6 BASE 468 STPVL SP,CHARSLEFT save the characters to move 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1019 (CIAINUTIL) F 50 Input utility routines for the CIA 04BE1 E4178801 0 6 BASE 469 ST R0 SP,CHRSMOVD remember the count 04BE2 60C40000 3 IMM 470 LD TCQ 0 no blocks yet 04BE3 E5578805 5 6 BASE 471 ST R5 SP,SAVER5 save this register 472 * \ / 00004BE4 473 MORECHARS LABEL 04BE4 61578803 5 6 BASE 474 LD R5 SP,CHARSLEFT get the number left to move 04BE5 51401F0B 5 475 MIN R5 TCQMAXSIZE 04BE6 5C575005 5 REG 476 HIB R5+TCQUSED-1 04BE7 70920000 2 0 REG 477 LDN R2 R0 04BE8 1884001E 2 IMM 478 ADD R2 WORDLNTH-(CPW LOG 2) R2=log size of block (for later store) 04BE9 DC002ED0 479 CALL SGETMEM get storage for the block 04BEA 40528000 2 REG 480 PARVL R2 04BEB EE160800 0 BASE 481 STZ2 R0,0 clean out garbage 04BEC E4881060 2 0 ZBM 482 ST R2 R0,TCQLOG remember block size 04BED 60641F06 1 2 483 LD R1 TCQSIZES(R2) 04BEE E4560005 1 0 CACH 484 ST R1 R0,TCQSIZE remember the maximum chars in block 04BEF FAF04BF2 3 485 JZA TCQ THEFIRST is the new block the first? 04BF0 E408DF10 0 3 ZBM 486 ST R0 TCQ,TCQLINK not -- link new onto end 04BF1 FE0E4BF3 487 JMP NOTFIRST 488 * --- 489 00004BF2 490 THEFIRST LABEL 04BF2 E4178802 0 6 BASE 491 ST R0 SP,THEFIRST1 remember the first block 00004BF3 492 NOTFIRST LABEL 04BF3 60D20000 3 0 REG 493 LD TCQ R0 TCQ now points to new block 04BF4 E556C004 5 3 CACH 494 ST R5 TCQ,TCQLAST putting this number of chars in 04BF5 60178804 0 6 BASE 495 LD R0 SP,INBUFF get the source string pointer 04BF6 3896C006 2 3 CACH 496 LEA R2 TCQ,TCQCHARS[1] get the destination string pointer 04BF7 60534000 1 5 REG 497 LD R1 R5 and get length of source 04BF8 FE400000 498 CMOVE move 'em in 04BF9 E4178804 0 6 BASE 499 ST R0 SP,INBUFF save the advanced source pointer 04BFA B1578803 5 6 BASE 500 RSBM R5 SP,CHARSLEFT remove the count of chars moved 04BFB FE044BE4 501 JGT MORECHARS loop if more to move 04BFC 61578805 5 6 BASE 502 LD R5 SP,SAVER5 restore this register 503 * \ / 504 505 ********************************************************************************** 506 * * 507 * All of the passed characters are now in queue elements. * 508 * Link the created list into the terminal's input queue and * 509 * then check to see if the port needs a push to get the data * 510 * read. * 511 * * 512 ********************************************************************************** 513 514 * \ / 515 PLOCK TCB,TCLOCK get access to the TCB 04BFD 0CC00000 515 IOFF 04BFE D1D70818 4 BASE 515 SETT TCB,TCLOCK 04BFF FE0C4C01 515 JNE MA(2+DISPW MA 0) 04C00 DC40308B 515 CALLNP LOCKWAIT 04C01 60178801 0 6 BASE 516 LD R0 SP,CHRSMOVD 04C02 980922FB 0 4 ZBM 517 ADDM R0 TCB,TCTTICNT add in the characters being added 04C03 6009011C 0 4 ZBM 518 LD R0 TCB,TCTTIEP R0=>end of old list 04C04 60578802 1 6 BASE 519 LD R1 SP,THEFIRST1 R1=>start of list just made 04C05 FA304C08 0 520 JZA R0 WHOLELIST jump if linking onto an empty list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1020 (CIAINUTIL) F 50 Input utility routines for the CIA 04C06 E4481F10 1 0 ZBM 521 ST R1 R0,TCQLINK link new stuff onto end of old 04C07 FE0E4C09 522 JMP ADD2END 523 * --- 524 00004C08 525 WHOLELIST LABEL 04C08 E449231C 1 4 ZBM 526 ST R1 TCB,TCTTIBP ours is the whole thing 00004C09 527 ADD2END LABEL 04C09 E4C9011C 3 4 ZBM 528 ST TCQ TCB,TCTTIEP new end of the list 04C0A 5C17080E 4 BASE 529 CMZ TCB,TCTERMLOC is there already a terminator in the queue? 04C0B FE0C4C26 530 JNE NOPUSHY jump if so, one is enough 04C0C 60D78802 3 6 BASE 531 LD TCQ SP,THEFIRST1 get pointer to first new TCQ 04C0D FAF04C26 3 532 JZA TCQ NOPUSHY no blocks, obviously no terminators 04C0E DC404C8B 533 CALLNP GETTERMPTR get bit pointer to term. char array 04C0F 60924000 2 1 REG 534 LD R2 R1 copy pointer to R2 00004C10 535 TERSCAN LABEL 04C10 6056C004 1 3 CACH 536 LD R1 TCQ,TCQLAST get last index 04C11 6016C000 0 3 CACH 537 LD R0 TCQ,TCQFIRST get begin index 04C12 10520000 1 0 REG 538 SUB R1 R0 make count of characters here 04C13 381AC006 0 30 CACH 539 LEA R0 TCQ,TCQCHARS(1)(R0) make char pointer to first char 04C14 DA148800 0 21 540 SCAN R0,R2,R1 scan for terminators in this block 04C15 FE024C18 541 JEQ GIVEANINT if terminator found, save location and allow read 04C16 FAF64C10 3 542 LJNA TCQ TERSCAN advance to next block and search it 04C17 FE0E4C26 543 JMP NOPUSHY no blocks, no terms, no errors, 544 * --- and no one left on base 545 00004C18 546 GIVEANINT LABEL 04C18 3056C004 1 3 CACH 547 RSB R1 TCQ,TCQLAST make index of terminator 04C19 E44900FE 1 4 ZBM 548 ST R1 TCB,TCTERMCHLC save terminator index 04C1A E4C91F1E 3 4 ZBM 549 ST TCQ TCB,TCTERMTCQ along with its TCQ address 04C1B DC003457 550 CALL GIVEUINT pass the event to the user 04C1C 41491F17 4 ZBM 551 PARV TCB,TCPCADRS PCB of the user 04C1D 41530000 4 REG 552 PARV TCB value of PCQPARM if waiting 04C1E 4147FFFF IMM 553 PARV ONEBITS mask for PCQPARM 04C1F 4144000C IMM 554 PARV NQTERMWAIT queue in if waiting 04C20 41420100 IMM 555 PARV 1*BIT CAIMNETERM program interrupt mask bit 04C21 60091615 0 4 ZBM 556 LD R0 TCB,TCINTTCG terminator a trapper's? 04C22 78091E18 0 4 ZBM 557 AND R0 TCB,TCINTE ints enabled on unit? 04C23 41520000 0 REG 558 PARV R0 device interrupt enable bit 04C24 41440022 IMM 559 PARV UINTNETERM interrupt code 04C25 40491F15 4 ZBM 560 PARVL TCB,TCFCB interrupt subcode 00004C26 561 NOPUSHY LABEL 562 PUNLOCK TCB,TCLOCK release the TCB 04C26 EC170818 4 BASE 562 STZ TCB,TCLOCK 04C27 0C800000 562 ION 04C28 5D1F8006 6 STAK 563 LEAVE POP 564 * --- 565 566 END MOVECHARIN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1021 (CIAINUTIL) F 50 Input utility routines for the CIA 568 569 ********************************************************************************** 570 * * 571 * CHECKLOGD. * 572 * Routine that checks the status of the indicated TCB and * 573 * either sez to ignore the character or to use it. We check to * 574 * see if anyone is already logged on. If logged on, we allow * 575 * the character. * 576 * If the port is NOT already logged on, we ignore the * 577 * character under any of the following circumstances: * 578 * 1) the port state is not normal (TCINTSNORM). * 579 * 2) the port is inhibited. * 580 * 3) the system is inhibited. * 581 * 4) the character is not a break or break character. * 582 * If these conditions are all negative, a process is * 583 * created for this port, control mode is CHAINED to (by a * 584 * rather non-standard chain procedure), and the process is * 585 * started. Control mode will demand a proper log on. * 586 * Call: * 587 * LD R4 =>TCB * 588 * LD R2 character * 589 * CALLNP CHECKLOGD * 590 * JMP * 591 * * 592 * Gets R0, R1, R3, and R4. Also gets R2 if not logged. * 593 * Stack required = 6 * 594 * 3 + max ( BLDPROCESS (2), BLKLIMCHK (1), CREATEFCB (2), * 595 * CREATEUCE (2), MAPINMEM (3), SETINITRUN (1), * 596 * SETRUNNING (2) ) * 597 * * 598 ********************************************************************************** 599 600 BLOCK CHECKLOGD subroutine 601 ENTRY CHECKLOGD 602 603 BEGFRAME 00178801 6 BASE 604 TEMP BSS 1 guess 00178802 6 BASE 605 SAVER5 BSS 1 bet you can't figure this one out 606 ENDFRAME 607 04C29 DD5F8003 6 STAK 608 CHECKLOGD ENTRNP PUSH 04C2A 5C091F17 4 ZBM 609 CMZ TCB,TCPCADRS is he logged on? 04C2B FE024C2E 610 JEQ NOTLOGD jump if not, character is questionable 04C2C 19C40001 7 IMM 611 ADD R7 1 advance to skip return 04C2D 5D1F8003 6 STAK 612 LEAVE POP return 613 * --- 614 00004C2E 615 NOTLOGD LABEL 04C2E 5C001D0D 616 CMZ ALLINHIBIT check the inhibit bit 04C2F FE0C4C75 617 JNE IGNORECH jump if to ignore the character 04C30 60090249 0 4 ZBM 618 LD R0 TCB,TCINTSTATE fetch his current modem control state 04C31 64040002 0 IMM 619 CPR R0 TCINTSNORM check against normal 04C32 FE0C4C75 620 JNE IGNORECH jump if to ignore the character 04C33 600AB270 0 2 CBM 621 LD R0 R2/BITS 25:31 get seven-bit character 04C34 64170018 0 4 CACH 622 CPR R0 TCB,TCBRCH is it the fake break character? 04C35 FE024C38 623 JEQ GOODASBRK if so, fake a break 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1022 (CIAINUTIL) F 50 Input utility routines for the CIA 04C36 64840100 2 IMM 624 CPR R2 BREAKMARK check for break character 04C37 FE0C4C75 625 JNE IGNORECH only break can create a process 626 * \ / 627 00004C38 628 GOODASBRK LABEL 04C38 E5178801 4 6 BASE 629 ST TCB SP,TEMP save the TCB pointer 04C39 E5578802 5 6 BASE 630 ST R5 SP,SAVER5 save the callers input buffer pointer 04C3A DC0035D2 631 CALL BLDPROCESS create a process 04C3B 4144F000 IMM 632 PARV USERMSR supply MSR desired 04C3C 43440000 IMM 633 PARV2 0 "name" of program running 04C3D 41440000 IMM 634 PARV 0 (program counter) 04C3E 40440000 IMM 635 PARVL 0 not a system process 636 * R3 => new PSA, R4 => new PCB 04C3F 60978801 2 6 BASE 637 LD R2 SP,TEMP R2 => TCB 04C40 E5089F17 4 2 ZBM 638 ST R4 R2,TCPCADRS point TCB to PCB 04C41 6216881B 012 BASE 639 LD2 R0 R2,TCSITE 04C42 E6170805 014 BASE 640 ST2 R0 R4,PCBSITE copy the site name to the process 641 * \ / 642 643 ********************************************************************************** 644 * * 645 * We create for the user his absolute input and absolute * 646 * output units. The output terminal is created RW privilege * 647 * and access, the input terminal with RO privilege and access. * 648 * The FCBCBPTRs are initialized with the TCB pointer we * 649 * received, and the serial number is set. Note that the * 650 * FCLIMITPTR is left empty so that the routine which closes * 651 * these units does not assume that they were opened by the * 652 * normal method from a saved file. * 653 * * 654 ********************************************************************************** 655 656 * \ / 04C43 6108DF15 4 3 ZBM 657 LD R4 R3,PSPROCLIST get one and only process 04C44 FB324C46 4 658 JNZA R4 PROCOK jump if there 04C45 00130214 659 HALT HALTS0214 PSPROCLIST empty after BLDPROCESS 660 * --- 661 00004C46 662 PROCOK LABEL 04C46 DC004C77 663 CALL CREATEFCB make a new FCB and add to list 04C47 41440007 IMM 664 PARV HTYPETERM of this type 04C48 40440000 IMM 665 PARVL FSPRIVRW with this privilege and access 04C49 E4895F16 2 5 ZBM 666 ST R2 FCB,FCDCBPTR set TCB as control block 04C4A 60040007 0 IMM 667 LD R0 HTYPETERM get type code for terminal 04C4B E4174809 0 5 BASE 668 ST R0 FCB,FCSERIAL set first half of serial # 04C4C 60088890 0 2 ZBM 669 LD R0 R2,TCTNUM get port number 04C4D E417480A 0 5 BASE 670 ST R0 FCB,FCSERIAL(1) set as second half of serial # 04C4E EDC89415 2 ZBM 671 STW R2,TCACSRW terminal is being access RW 04C4F DC003635 672 CALL CREATEUCE make a UCE for it 04C50 414400CA IMM 673 PARV LUNAOUT use number for absolute output 04C51 40534000 5 REG 674 PARVL FCB FCB => newly created file control block 04C52 EC081F10 0 ZBM 675 STZ R0,UCELINK this will be list end 04C53 E408E316 0 3 ZBM 676 ST R0 R3,PSUNITS and, for now, the list head 677 * \ / 678 04C54 DC004C77 679 CALL CREATEFCB make a new FCB 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1023 (CIAINUTIL) F 50 Input utility routines for the CIA 04C55 41440007 IMM 680 PARV HTYPETERM of this type 04C56 40440001 IMM 681 PARVL FSPRIVRO with this privilege and access 04C57 60040007 0 IMM 682 LD R0 HTYPETERM get type code for terminal 04C58 E4174809 0 5 BASE 683 ST R0 FCB,FCSERIAL set first half of serial # 04C59 60978801 2 6 BASE 684 LD R2 SP,TEMP get the TCB back 04C5A 60088890 0 2 ZBM 685 LD R0 R2,TCTNUM get port number 04C5B E417480A 0 5 BASE 686 ST R0 FCB,FCSERIAL(1) set as second half of serial # 04C5C E4895F16 2 5 ZBM 687 ST R2 FCB,FCDCBPTR give terminal control block address 04C5D E5489F15 5 2 ZBM 688 ST FCB R2,TCFCB this FCB will get interrupts 04C5E EDC89E18 2 ZBM 689 STW R2,TCINTE interrupts for him 04C5F EDC89215 2 ZBM 690 STW R2,TCACSRO terminal is being access RO 04C60 DC003635 691 CALL CREATEUCE make a UCE for it 04C61 414400C9 IMM 692 PARV LUNAIN use number for absolute input 04C62 40534000 5 REG 693 PARVL FCB FCB => newly created file control block 04C63 6048E316 1 3 ZBM 694 LD R1 R3,PSUNITS fetch the list head 04C64 E4481F10 1 0 ZBM 695 ST R1 R0,UCELINK tack list behind 04C65 E408E316 0 3 ZBM 696 ST R0 R3,PSUNITS and renew list head 697 * \ / 698 04C66 EDC91011 4 ZBM 699 STW R4,UPCNETINTE enable terminal interrupts 04C67 6108DF13 4 3 ZBM 700 LD ULB R3,PSUSERLIMP get logon ULB 04C68 DC40364A 701 CALLNP BLKLIMCHK enough disk space to attempt a logon 702 * R0 <= error code if not enough disk space 04C69 60404C76 1 703 LD R1 CMENTCODE get prototype entry code 04C6A 5C120000 0 REG 704 CMZ R0 did we get an out of space error 04C6B ED8A4410 1 CBM 705 STLNE R1/CMERRIDS indicate the problem to control mode 04C6C 5C089C10 2 ZBM 706 CMZ R2,TCINHIB check the terminal bit 04C6D ED8A4610 1 CBM 707 STLNE R1/CMERRINH set bit to give Control Mode 04C6E DC003640 708 CALL SETINITRUN set initial entry 04C6F 40524000 1 REG 709 PARVL R1 pass initial entry code 04C70 6108DF12 4 3 ZBM 710 LD R4 R3,PSPROCCB pick up PCB pointer 04C71 DC402B99 711 CALLNP SETRUNNING make this new process run 04C72 DC0025EB 712 CALL MAPINMEM re-map the original caller 04C73 40400412 713 PARVL CPPSA pointer to the PSA 714 * ignore the character that created the process 04C74 61578802 5 6 BASE 715 LD R5 SP,SAVER5 restore callers register 716 * \ / 717 00004C75 718 IGNORECH LABEL 04C75 5D1F8003 6 STAK 719 LEAVE POP return 720 * --- 721 04C76 00000000 722 CMENTCODE VFD 0*CMSKAPPL+0*CMBATCHJOB+0*CMERRIDS+CMNLOGIO*CMENTRYCD 723 724 END CHECKLOGD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1024 (CIAINUTIL) F 50 Input utility routines for the CIA 726 727 ********************************************************************************** 728 * * 729 * This be a routine that creates the FCBs for the default * 730 * lun assignment. It creates a zeroed FCB save for read only * 731 * privilege, load point status, FCABSIO, and the hardware type * 732 * and lun number as passed by the caller. * 733 * * 734 * R3 => PSA * 735 * CALL CREATEFCB * 736 * PARV hardware type * 737 * PARVL access/priv * 738 * * 739 * Eats R0-R1, sets FCB => New FCB * 740 * Stack required = 2 * 741 * 1 + max ( FCGETMEM (0), ZEROIT (1) ) * 742 * * 743 ********************************************************************************** 744 745 BLOCK CREATEFCB subroutine 746 747 ENTRY CREATEFCB 748 749 BEGFRAME 750 ENDFRAME 751 04C77 DD9F8001 6 STAK 752 CREATEFCB ENTRS PUSH 04C78 DC002F0A 753 CALL FCGETMEM make the block 04C79 40440004 IMM 754 PARVL FCLOG 04C7A 61520000 5 0 REG 755 LD FCB R0 pointer to right register 04C7B DC003090 756 CALL ZEROIT clean any garbage out 04C7C 41174800 5 BASE 757 PAR FCB,0 04C7D 40440010 IMM 758 PARVL 2 POWER FCLOG 04C7E DCD3C000 7 REG 759 EXPCS R7 pick up parameters 04C7F C1496665 5 ZBM 760 STPV FCB,FCHTYPE get hardware type 04C80 C0524000 1 REG 761 STPVL R1 get access code 04C81 E4495835 1 5 ZBM 762 ST R1 FCB,FCACCESS put access into FCB 04C82 E4494E45 1 5 ZBM 763 ST R1 FCB,FCPRIV use same priv as the access 04C83 EDC96015 5 ZBM 764 STW FCB,FCABSIO say that this is an "absolute" unit 04C84 EDC94C15 5 ZBM 765 STW FCB,FCLOADPT make at load point 04C85 D157480D 5 BASE 766 STMW FCB,FCNAMEEXT for project in catalog info fetch 04C86 EDC94080 5 ZBM 767 STW FCB,FCBUSYCNT set initial busy counter 04C87 6008DF17 0 3 ZBM 768 LD R0 R3,PSFCBLIST get list head 04C88 E4095F10 0 5 ZBM 769 ST R0 FCB,FCLINK set current list behind new element 04C89 E548DF17 5 3 ZBM 770 ST FCB R3,PSFCBLIST and make new element list head 04C8A 5D1F8001 6 STAK 771 LEAVE POP 772 * --- 773 774 END CREATEFCB subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1025 (CIAINUTIL) F 50 Input utility routines for the CIA 776 777 ********************************************************************************** 778 * * 779 * GETTERMPTR * 780 * Fetches a pointer to the current terminating character * 781 * array. * 782 * The eight word array in the TCB is provided (rather * 783 * than just having the pointer point at whereever the array * 784 * actually is) because the PSA and UPC related tables may * 785 * be virtual. * 786 * Call: * 787 * LD SP => stack * 788 * LD R4 => TCB * 789 * CALLNP GETTERMPTR * 790 * ST R1 => term char array * 791 * * 792 * Eats R0:R1. * 793 * Stack required = 1 * 794 * * 795 ********************************************************************************** 796 797 BLOCK GETTERMPTR subroutine 798 ENTRY GETTERMPTR 799 800 BEGFRAME 801 ENDFRAME 802 04C8B DD5F8001 6 STAK 803 GETTERMPTR ENTRNP PUSH 04C8C 6009083D 0 4 ZBM 804 LD R0 TCB,TCTERMGRP see which group he is using 04C8D 5D604C8F 0 805 XCT GTPVECT(R0) decode group 04C8E 5D1F8001 6 STAK 806 LEAVE POP return 807 * --- 808 00004C8F 809 GTPVECT LABEL 04C8F 60404CA3 1 810 LD R1 TERMARAYP0 0 - standard 0 04C90 60404CA4 1 811 LD R1 TERMARAYP1 1 - standard 1 04C91 60404CA5 1 812 LD R1 TERMARAYP2 2 - standard 2 04C92 3849001F 1 4 ZBM 813 LEA R1 TCB,TCTERMA/BIT 0 3 - user specified 814 * --- 815 816 * The system default terminating char set -- CR and cntl-W 817 00004C93 818 TERMARRAY0 LABEL 04C93 00040100 819 VFD (1*BIT CR)+(1*BIT ETB) CR and ETB (control W) 04C94 00000000 820 VFD 0 04C95 00000000 821 VFD 0 04C96 00000000 822 VFD 0 04C97 00040100 823 VFD (1*BIT CR)+(1*BIT ETB) CR and ETB (control W) 04C98 00000000 824 VFD 0 04C99 00000000 825 VFD 0 04C9A 00000000 826 VFD 0 827 00004C9B 828 TERMARRAY1 LABEL 00004C9B 829 TERMARRAY2 LABEL 04C9B 00040000 830 VFD 1*BIT CR CR only 04C9C 00000000 831 VFD 0 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1026 (CIAINUTIL) F 50 Input utility routines for the CIA 04C9D 00000000 832 VFD 0 04C9E 00000000 833 VFD 0 04C9F 00040000 834 VFD 1*BIT CR CR only 04CA0 00000000 835 VFD 0 04CA1 00000000 836 VFD 0 04CA2 00000000 837 VFD 0 838 04CA3 00484C93 839 TERMARAYP0 PTR TERMARRAY0/BIT 0 04CA4 00484C9B 840 TERMARAYP1 PTR TERMARRAY1/BIT 0 04CA5 00484C9B 841 TERMARAYP2 PTR TERMARRAY2/BIT 0 842 843 END GETTERMPTR subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1027 (CIAINUTIL) F 50 Input utility routines for the CIA 845 846 ********************************************************************************** 847 * * 848 * CALCTERMC * 849 * Scan the input buffer until we find the first terminating * 850 * character. If none, TCTERMLOC <= 0, else TCTERMLOC gets the * 851 * location of that terminator. It is possible to have a TCQ * 852 * element that contains an error code rather than characters * 853 * so we need to check before a scan is done. * 854 * Call: * 855 * LD R4 => TCB (locked) * 856 * CALLNP CALCTERMC * 857 * * 858 * Gets R0:R3 * 859 * Stack required = 2 * 860 * 1 + GETTERMPTR (1) * 861 * * 862 ********************************************************************************** 863 864 BLOCK CALCTERMC subroutine 865 ENTRY CALCTERMC 866 867 BEGFRAME 868 ENDFRAME 869 04CA6 DD5F8001 6 STAK 870 CALCTERMC ENTRNP PUSH 04CA7 EC17080E 4 BASE 871 STZ TCB,TCTERMLOC assume no terminator in list 04CA8 60C9231C 3 4 ZBM 872 LD TCQ TCB,TCTTIBP get link to first TCQ 04CA9 FAF04CB9 3 873 JZA TCQ EXITCALC if none, quit 04CAA DC404C8B 874 CALLNP GETTERMPTR get bit pointer to term array 04CAB 60924000 2 1 REG 875 LD R2 R1 copy pointer to R2 876 * \ / 877 00004CAC 878 CALC1 LABEL 04CAC 5C08DC10 3 ZBM 879 CMZ TCQ,TCQCOMND is this an error element? 04CAD FE0C4CB4 880 JNE NEXTTCQ skip this TCQ if so 04CAE 6016C000 0 3 CACH 881 LD R0 TCQ,TCQFIRST get index to first character 04CAF 6056C004 1 3 CACH 882 LD R1 TCQ,TCQLAST get index to last character 04CB0 10520000 1 0 REG 883 SUB R1 R0 make count of characters 04CB1 381AC006 0 30 CACH 884 LEA R0 TCQ,TCQCHARS(1)(R0) produce char pointer to first char 04CB2 DA148800 0 21 885 SCAN R0,R2,R1 scan for a terminator 04CB3 FE024CB6 886 JEQ CALC2 jump if found, compute and store its location 887 * \ / 888 00004CB4 889 NEXTTCQ LABEL 04CB4 FAF64CAC 3 890 LJNA TCQ CALC1 link to next block and repeat term search 04CB5 FE0E4CB9 891 JMP EXITCALC jump if no terminators 892 * --- 893 00004CB6 894 CALC2 LABEL 04CB6 E4C91F1E 3 4 ZBM 895 ST TCQ TCB,TCTERMTCQ save address of TCQ with first terminator 04CB7 3056C004 1 3 CACH 896 RSB R1 TCQ,TCQLAST calculate index of terminator 04CB8 E44900FE 1 4 ZBM 897 ST R1 TCB,TCTERMCHLC and save in TCB 898 * \ / 899 00004CB9 900 EXITCALC LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1028 (CIAINUTIL) F 50 Input utility routines for the CIA 04CB9 5D1F8001 6 STAK 901 LEAVE POP 902 * --- 903 904 END CALCTERMC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1029 (CIAINUTIL) F 50 Input utility routines for the CIA 906 907 ********************************************************************************** 908 * * 909 * MAKTRMSTAT. This routine will create the dynamic status * 910 * for a .TERM. We check the TCB for terminators and return * 911 * the unit number given as the operand of the XREQ. For this * 912 * reason please make sure this routine is ALWAYS called from * 913 * the XREQ processor. * 914 * * 915 * FCB => FCB of a .TERM * 916 * CALLNP MAKTRMSTAT * 917 * * 918 * * 919 * Registers Used: R0:R1, TCB. * 920 * Stack Required: 1 * 921 * * 922 ********************************************************************************** 923 924 BLOCK routine to construct terminal status 925 ENTRY MAKTRMSTAT 926 927 BEGFRAME 928 ENDFRAME 929 04CBA DD5F8001 6 STAK 930 MAKTRMSTAT ENTRNP PUSH 04CBB 60040000 0 IMM 931 LD R0 0 get initial status of zero 04CBC 60494455 1 5 ZBM 932 LD R1 FCB,FCDYNSTAT get these status bits 04CBD E44A2050 1 0 CBM 933 ST R1 R0/FCDSTATPLC and put them in their place 04CBE 61095F16 4 5 ZBM 934 LD TCB FCB,FCDCBPTR get the terminal control block 04CBF FB304CC2 4 935 JZA TCB SKIPLP don't get load point status if no terminal 04CC0 5C17080E 4 BASE 936 CMZ TCB,TCTERMLOC is there another line? 04CC1 EC4A2810 0 CBM 937 STLEQ R0/FDSTATLP set LP bit appropriately 938 * \ / 939 00004CC2 940 SKIPLP LABEL 04CC2 81524000 1 REG 941 STCAR R1 pointer to console area 04CC3 6056480E 1 1 BASE 942 LD R1 R1,CAXOPERAND operand should be the unit number 04CC4 E44A0880 1 0 CBM 943 ST R1 R0/FDSTATLUN plug in unit number 04CC5 5D1F8001 6 STAK 944 LEAVE POP return 945 * --- 946 947 END of MAKTRMSTAT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1030 (CIAINUTIL) F 50 Input utility routines for the CIA 949 950 ********************************************************************************** 951 * * 952 * Routine to echo all of the characters in the input * 953 * buffer up to and including a terminator. This routine * 954 * is used by the echo mode which only echoes characters * 955 * when the program actually reads them. TCB,TCLOCK must be * 956 * locked when this is called and this returns with the list * 957 * still locked. * 958 * Call: * 959 * LD R4 =>TCB (TCB must be locked) * 960 * CALLNP ECHOLINE * 961 * * 962 * Gets R0:R3 * 963 * Stack required = 14 * 964 * 7 + max ( FILLTCQ (1), LINKTCQLST (3), LOCKWAIT (0), * 965 * OUTTERMCH (5), PROCLKILL (7), SCAN4DLY (2) ) * 966 * * 967 ********************************************************************************** 968 969 BLOCK ECHOLINE and ECHOALL subroutines 970 ENTRY ECHOLINE 971 ENTRY ECHOALL 972 00000010 BYTE 973 ELSTOPT EQU BIT 0 bit in R7, if zero, stop on term., otherwise, echo all 974 BEGFRAME 00178801 6 BASE 975 ELROOT BSS 1 root of created list 00178802 6 BASE 976 ELCHARS BSS 1 number of characters echoed 00178803 6 BASE 977 ELSAVER5 BSS 1 save for R5 00178804 6 BASE 978 ELTCQ BSS 1 temp for holding TCQ pointer 00178805 6 BASE 979 ELFIRSTPOS BSS 1 pointer to our first position 00178806 6 BASE 980 ELTCQCNT BSS 1 count of characters output from this TCQ 981 ENDFRAME 982 04CC6 DD5F8007 6 STAK 983 ECHOLINE ENTRNP PUSH 04CC7 EC0BC010 7 CBM 984 STZ R7/ELSTOPT remember to stop on terminator 00004CC8 985 ELSHARE LABEL 04CC8 E5578803 5 6 BASE 986 ST R5 SP,ELSAVER5 save this register 04CC9 60C9231C 3 4 ZBM 987 LD TCQ TCB,TCTTIBP TCQ => beginning of input string 04CCA FAF04D11 3 988 JZA TCQ ELLIDX jump if no characters 989 * \ / 990 04CCB EE178801 6 BASE 991 STZ2 SP,ELROOT indicate no list yet and no chars echoed 04CCC EC178804 6 BASE 992 STZ SP,ELTCQ no TCQ yet 993 00004CCD 994 ELNEXTTCQ LABEL 04CCD 5C08DC10 3 ZBM 995 CMZ TCQ,TCQCOMND is this an error element? 04CCE FE0C4D0B 996 JNE DONTSTOP if so then get the next TCQ 04CCF 6156C004 5 3 CACH 997 LD R5 TCQ,TCQLAST get index to last character 04CD0 6016C000 0 3 CACH 998 LD R0 TCQ,TCQFIRST and index to first character 04CD1 F7C04CD6 7 999 JBT R7/ELSTOPT NOTERM jump if not stopping at the first terminator 04CD2 64C91F1E 3 4 ZBM 1000 CPR TCQ TCB,TCTERMTCQ does this TCQ contain a terminator 04CD3 FE0C4CD6 1001 JNE NOTERM if not, skip ahead 04CD4 614900FE 5 4 ZBM 1002 LD R5 TCB,TCTERMCHLC don't go further than it 04CD5 19440001 5 IMM 1003 ADD R5 1 include the terminator 1004 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1031 (CIAINUTIL) F 50 Input utility routines for the CIA 1005 00004CD6 1006 NOTERM LABEL 04CD6 11520000 5 0 REG 1007 SUB R5 R0 R5 = number of chars 04CD7 E5578806 5 6 BASE 1008 ST R5 SP,ELTCQCNT how many characters need to go from TCQ 04CD8 381AC006 0 30 CACH 1009 LEA R0 TCQ,TCQCHARS(1)(R0) R0 -> first char we need to move 04CD9 E4178805 0 6 BASE 1010 ST R0 SP,ELFIRSTPOS save location in input buffer 1011 * \ / 1012 1013 * R5 = number of chars we want to echo, R0 -> start of chars to echo 00004CDA 1014 TCQCONT LABEL 04CDA 5C0928C2 4 ZBM 1015 CMZ TCB,TCCRDELAY is it delayable? 04CDB FE024CDE 1016 JEQ NOCRDELAY if not then don't bother 04CDC 6084000D 2 IMM 1017 LD R2 CR scan for this delayable character 04CDD DC404D33 1018 CALLNP SCAN4DLY is it in the buffer? 00004CDE 1019 NOCRDELAY LABEL 04CDE 5C0900C3 4 ZBM 1020 CMZ TCB,TCLFDELAY is it delayable? 04CDF FE024CE2 1021 JEQ NOLFDELAY if not then don't bother 04CE0 6084000A 2 IMM 1022 LD R2 LF is this a delayable character? 04CE1 DC404D33 1023 CALLNP SCAN4DLY is it in the buffer? 00004CE2 1024 NOLFDELAY LABEL 04CE2 5C0918C3 4 ZBM 1025 CMZ TCB,TCFFDELAY is it delayable? 04CE3 FE024CE6 1026 JEQ NOFFDELAY if not then don't bother 04CE4 6084000C 2 IMM 1027 LD R2 FF is this a delayable character? 04CE5 DC404D33 1028 CALLNP SCAN4DLY is it in the buffer? 00004CE6 1029 NOFFDELAY LABEL 04CE6 5C0900C8 4 ZBM 1030 CMZ TCB,TCHTDELAY is it delayable? 04CE7 FE024CEA 1031 JEQ NOHTDELAY if not then don't bother 04CE8 60840009 2 IMM 1032 LD R2 HT is this a delayable character? 04CE9 DC404D33 1033 CALLNP SCAN4DLY is it in the buffer? 00004CEA 1034 NOHTDELAY LABEL 04CEA 60891076 2 4 ZBM 1035 LD R2 TCB,TCLKILLC look for the line kill character 04CEB DC404D33 1036 CALLNP SCAN4DLY is it in the buffer? 1037 * \ / 1038 04CEC E0D78804 3 6 BASE 1039 EXCH TCQ SP,ELTCQ get pointer to output TCQ 04CED DC404D41 1040 CALLNP FILLTCQ set up to move stuff into output TCQ 04CEE 60178805 0 6 BASE 1041 LD R0 SP,ELFIRSTPOS point to our source of characters 04CEF FE400000 1042 CMOVE 04CF0 99578802 5 6 BASE 1043 ADDM R5 SP,ELCHARS update count of chars output 04CF1 E4178805 0 6 BASE 1044 ST R0 SP,ELFIRSTPOS save location in input buffer 04CF2 5C178801 6 BASE 1045 CMZ SP,ELROOT first time here? 04CF3 FE0C4CF5 1046 JNE HAVEROOT if not then we already saved the root 04CF4 E4D78801 3 6 BASE 1047 ST TCQ SP,ELROOT save the root block of TCQ chain 1048 * \ / 1049 00004CF5 1050 HAVEROOT LABEL 04CF5 6016C004 0 3 CACH 1051 LD R0 TCQ,TCQLAST check the last character 04CF6 609AC005 2 30 CACH 1052 LD R2 TCQ,TCQCHARS(R0) pick up the last character 04CF7 5C3449DB 2 @ 1053 CMZ @DELAYCHS(R2) is this a delayable character? 04CF8 FE024CFC 1054 JEQ MAYBELK maybe it is the line kill character 04CF9 D056C004 3 CACH 1055 DEC TCQ,TCQLAST remove last char from the list 04CFA DC404994 1056 CALLNP OUTTERMCH place the char in the queue element 04CFB FE0E4D01 1057 JMP ITSINX 1058 * --- 1059 00004CFC 1060 MAYBELK LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1032 (CIAINUTIL) F 50 Input utility routines for the CIA 04CFC 60128000 0 2 REG 1061 LD R0 R2 copy the character 04CFD 7804007F 0 IMM 1062 AND R0 07F only want to check 7 bits worth 04CFE 64091076 0 4 ZBM 1063 CPR R0 TCB,TCLKILLC is it the line kill character? 04CFF FE0C4D02 1064 JNE ITSIN 04D00 DC404D1D 1065 CALLNP PROCLKILL process the line kill 00004D01 1066 ITSINX LABEL 04D01 98178802 0 6 BASE 1067 ADDM R0 SP,ELCHARS add in the command burden 1068 * \ / 1069 00004D02 1070 ITSIN LABEL 04D02 E0D78804 3 6 BASE 1071 EXCH TCQ SP,ELTCQ switch TCQs (TCQ -> input) 04D03 B1578806 5 6 BASE 1072 RSBM R5 SP,ELTCQCNT count of chars in this TCQ 04D04 FE024D08 1073 JEQ TCQDONE jump if done with this TCQ 1074 * \ / 1075 04D05 60178805 0 6 BASE 1076 LD R0 SP,ELFIRSTPOS point to our source of characters 04D06 61578806 5 6 BASE 1077 LD R5 SP,ELTCQCNT how much is left in this TCQ 04D07 FE0E4CDA 1078 JMP TCQCONT continue with this TCQ 1079 * --- 1080 00004D08 1081 TCQDONE LABEL 04D08 F7C04D0B 7 1082 JBT R7/ELSTOPT DONTSTOP don't stop for terminator 04D09 64C91F1E 3 4 ZBM 1083 CPR TCQ TCB,TCTERMTCQ contain a terminator? 04D0A FE024D0C 1084 JEQ ELLINKIN if so then we are done 00004D0B 1085 DONTSTOP LABEL 04D0B FAF64CCD 3 1086 LJNA TCQ ELNEXTTCQ continue on our way 1087 * \ / 1088 1089 * SP, ELROOT => beginning, SP,ELTCQ => end, SP,ELCHARS = count 1090 * of characters echoed. Now link it in. 00004D0C 1091 ELLINKIN LABEL 04D0C 61538000 5 6 REG 1092 LD R5 SP remember my frame address 04D0D DC004A3B 1093 CALL LINKTCQLST link into the terminal list 04D0E 41574802 5 BASE 1094 PARV R5,ELCHARS the characters going in 04D0F 41174C01 5 FPVR 1095 PAR @(R5,ELROOT) the first element 04D10 40174C04 5 FPVR 1096 PARL @(R5,ELTCQ) pointer to last TCQ in output chain 00004D11 1097 ELLIDX LABEL 04D11 F3C04D14 7 1098 JBF R7/ELSTOPT ELLEAVE return if stopping for terminators 1099 PUNLOCK TCB,TCLOCK unlock the lists 04D12 EC170818 4 BASE 1099 STZ TCB,TCLOCK 04D13 0C800000 1099 ION 00004D14 1100 ELLEAVE LABEL 04D14 61578803 5 6 BASE 1101 LD R5 SP,ELSAVER5 restore this register 04D15 5D1F8007 6 STAK 1102 LEAVE POP return 1103 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1033 (CIAINUTIL) F 50 Input utility routines for the CIA 1105 1106 ********************************************************************************** 1107 * * 1108 * Routine that causes all characters in the input queue to * 1109 * be echoed. The TCB cannot be locked when this is called and * 1110 * the TCB is returned unlocked. * 1111 * Call: * 1112 * LD R4 =>TCB * 1113 * CALLNP ECHOALL * 1114 * * 1115 * See ECHOLINE for stack usage. * 1116 * * 1117 ********************************************************************************** 1118 04D16 DD5F8007 6 STAK 1119 ECHOALL ENTRNP PUSH 04D17 EDCBC010 7 CBM 1120 STW R7/ELSTOPT set flag saying to do all 1121 PLOCK TCB,TCLOCK lock access to the list 04D18 0CC00000 1121 IOFF 04D19 D1D70818 4 BASE 1121 SETT TCB,TCLOCK 04D1A FE0C4D1C 1121 JNE MA(2+DISPW MA 0) 04D1B DC40308B 1121 CALLNP LOCKWAIT 04D1C FE0E4CC8 1122 JMP ELSHARE share the rest of the code 1123 * --- 1124 1125 END ECHOLINE and ECHOALL subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1034 (CIAINUTIL) F 50 Input utility routines for the CIA 1127 1128 ********************************************************************************** 1129 * * 1130 * A line kill character is being entered. If the * 1131 * character is not a terminator then the character processor * 1132 * will probably accept it as the line kill character so if it * 1133 * passes that test, we here output the line kill response. * 1134 * Call: * 1135 * R0 = line kill character masked to 7 bits * 1136 * R2 = line kill character * 1137 * TCQ -> TCQ * 1138 * TCB -> TCB * 1139 * CALLNP PROCLKILL * 1140 * R0 = char count + command burden * 1141 * TCQ -> TCQ (May have linked on numerous TCQs.) * 1142 * * 1143 * Eats R0:R2. * 1144 * Stack required = 7 * 1145 * 2 + max ( GETTERMPTR (1), OUTTERMCH (5) ) * 1146 * * 1147 ********************************************************************************** 1148 1149 BLOCK PROCLKILL subroutine 1150 ENTRY PROCLKILL 1151 1152 BEGFRAME 00178801 6 BASE 1153 CHARCOUNT BSS 1 1154 ENDFRAME 1155 04D1D DD5F8002 6 STAK 1156 PROCLKILL ENTRNP PUSH 04D1E EC178801 6 BASE 1157 STZ SP,CHARCOUNT 04D1F FA024D31 0 1158 JEQZ R0 SKIPECHO null characters indicate nothing specified 04D20 6404007F 0 IMM 1159 CPR R0 DEL check for a delete, it's non-printing 04D21 FE024D24 1160 JEQ NONPRINT jump if it is 04D22 64040020 0 IMM 1161 CPR R0 " " check to see if printing 04D23 FE064D31 1162 JGE SKIPECHO skip echoing response if printing lkill 00004D24 1163 NONPRINT LABEL 04D24 DC404C8B 1164 CALLNP GETTERMPTR get the terminating character array 04D25 5C1A5400 12 @R 1165 CMZ @R1(R2) see if this character is a terminator 04D26 FE0C4D31 1166 JNE SKIPECHO skip echo if terminator 04D27 6084005C 2 IMM 1167 LD R2 "\" get the line kill echo character 04D28 DC404994 1168 CALLNP OUTTERMCH put into the output buffer 04D29 98178801 0 6 BASE 1169 ADDM R0 SP,CHARCOUNT keep track of chars put in 04D2A 6084000D 2 IMM 1170 LD R2 CR get a CR 04D2B DC404994 1171 CALLNP OUTTERMCH put into the output buffer 04D2C 98178801 0 6 BASE 1172 ADDM R0 SP,CHARCOUNT keep track of chars put in 04D2D 6084000A 2 IMM 1173 LD R2 LF get a LF 04D2E DC404994 1174 CALLNP OUTTERMCH put into the output buffer 04D2F 18040003 0 IMM 1175 ADD R0 3 account for the characters we put in 04D30 98178801 0 6 BASE 1176 ADDM R0 SP,CHARCOUNT keep track of chars put in 00004D31 1177 SKIPECHO LABEL 04D31 60178801 0 6 BASE 1178 LD R0 SP,CHARCOUNT return count 04D32 5D1F8002 6 STAK 1179 LEAVE POP 1180 * --- 1181 1182 END of PROCLKILL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1035 (CIAINUTIL) F 50 Input utility routines for the CIA 1184 1185 ********************************************************************************** 1186 * * 1187 * SCAN4DLY is used to scan a buffer for a delayable * 1188 * character. * 1189 * Call: * 1190 * R0 -> start of buffer * 1191 * R2 = character looking for * 1192 * R5 = how far to search * 1193 * CALLNP SCAN4DLY * 1194 * R5 = count of chars through character * 1195 * * 1196 * Eats R1:R2. * 1197 * Stack required = 2 * 1198 * * 1199 ********************************************************************************** 1200 1201 1202 BLOCK SCAN4DLY subroutine 1203 1204 ENTRY SCAN4DLY 1205 1206 BEGFRAME 00178801 6 BASE 1207 SCAN4R0 BSS 1 temp for R0 1208 ENDFRAME 1209 04D33 DD5F8002 6 STAK 1210 SCAN4DLY ENTRNP PUSH 04D34 E4178801 0 6 BASE 1211 ST R0 SP,SCAN4R0 save this register 04D35 60534000 1 5 REG 1212 LD R1 R5 get count 04D36 FE560000 1213 CSRCH look for the character 04D37 FE024D3D 1214 JEQ FOUNDIT jump if found 1215 * \ / not found, now try with the high bit on 04D38 60178801 0 6 BASE 1216 LD R0 SP,SCAN4R0 restore this register 04D39 60534000 1 5 REG 1217 LD R1 R5 get count 04D3A EDCAB010 2 CBM 1218 STW R2/BIT 24 turn on the high bit 04D3B FE560000 1219 CSRCH look for the character 04D3C FE0C4D3F 1220 JNE DONENOW jump if not found 00004D3D 1221 FOUNDIT LABEL 04D3D 11524000 5 1 REG 1222 SUB R5 R1 R5 = number of chars up to character 04D3E 19440001 5 IMM 1223 ADD R5 1 make it point past the found character 00004D3F 1224 DONENOW LABEL 04D3F 60178801 0 6 BASE 1225 LD R0 SP,SCAN4R0 restore this register 04D40 5D1F8002 6 STAK 1226 LEAVE POP 1227 * --- 1228 1229 END of SCAN4DLY 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1036 (CIAINUTIL) F 50 Input utility routines for the CIA 1231 1232 ********************************************************************************** 1233 * * 1234 * FILLTCQ * 1235 * * 1236 * FILLTCQ sets up a TCQ to be filled for output and linked * 1237 * onto the TCB for the terminal. * 1238 * * 1239 * R5 equals the MIN(length of record, free space in output * 1240 * queue, chars before any delaying char). We will set up a TCQ * 1241 * to put this number of characters into the existing TCQ, or * 1242 * create a new TCQ that will hold this number of characters. * 1243 * The TCQ that is set up for use might not hold as many * 1244 * characters as requested by the caller if we are topping off * 1245 * an existing TCQ. * 1246 * Call: * 1247 * LD R5 * 1248 * TCQ -> output TCQ or 0 if none * 1249 * CALLNP FILLTCQ * 1250 * R1 = number of characters that can go in this TCQ * 1251 * R2 -> where to move chars to * 1252 * TCQ -> current TCQ (end of list) * 1253 * R5 = number of chars to move * 1254 * * 1255 * Eats R0:R2, sets R3, R5. * 1256 * Stack required = 1 * 1257 * 1 + max ( SGETMEM(0)) * 1258 * * 1259 ********************************************************************************** 1260 1261 BLOCK FILLTCQ subroutine 1262 1263 ENTRY FILLTCQ 1264 1265 BEGFRAME 1266 ENDFRAME 1267 04D41 DD5F8001 6 STAK 1268 FILLTCQ ENTRNP PUSH 1269 * try to wedge chars into an existing block 04D42 FAF04D45 3 1270 JZA TCQ ADDNEW jump if no current block 04D43 5C08DC10 3 ZBM 1271 CMZ TCQ,TCQCOMND is this TCQ a command element? 04D44 FE024D53 1272 JEQ TRYWEDGE if not then try to wedge in more chars 00004D45 1273 ADDNEW LABEL 04D45 5C575005 5 REG 1274 HIB R5+TCQUSED-1 poor mans log base 2 04D46 70920000 2 0 REG 1275 LDN R2 R0 04D47 1884001E 2 IMM 1276 ADD R2 WORDLNTH-(CPW LOG 2) R2=log size of block to hold chars 04D48 DC002ED0 1277 CALL SGETMEM get a block 04D49 40528000 2 REG 1278 PARVL R2 of the indicated size 04D4A EE160800 0 BASE 1279 STZ2 R0,0 remove any garbage 04D4B E4881060 2 0 ZBM 1280 ST R2 R0,TCQLOG remember log size 04D4C 60641F06 1 2 1281 LD R1 TCQSIZES(R2) get number of chars possible in block 04D4D E4560005 1 0 CACH 1282 ST R1 R0,TCQSIZE and save for TCQ users 04D4E FAF04D50 3 1283 JZA TCQ GOTFIRST jump if no blocks currently in list 1284 1285 * Link the element into the list. 04D4F E408DF10 0 3 ZBM 1286 ST R0 TCQ,TCQLINK link new one onto the end 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1037 (CIAINUTIL) F 50 Input utility routines for the CIA 00004D50 1287 GOTFIRST LABEL 04D50 60D20000 3 0 REG 1288 LD TCQ R0 TCQ=>last element in the list 04D51 3896C006 2 3 CACH 1289 LEA R2 TCQ,TCQCHARS(1) place to put the first character 04D52 FE0E4D59 1290 JMP ITWILLFITX jump to put characters in 1291 * --- 1292 1293 * This block is not a command, so try to wedge as many 1294 * characters as possible into it 00004D53 1295 TRYWEDGE LABEL 04D53 6096C004 2 3 CACH 1296 LD R2 TCQ,TCQLAST get index to last char position 04D54 60528000 1 2 REG 1297 LD R1 R2 copy the index 04D55 3056C005 1 3 CACH 1298 RSB R1 TCQ,TCQSIZE R1:=char spaces left in block 04D56 FA424D45 1 1299 JEQZ R1 ADDNEW jump if no room available 04D57 51524000 5 1 REG 1300 MIN R5 R1 04D58 389AD006 2 32 CACH 1301 LEA R2 TCQ,TCQCHARS(R2)(1) R2 => place to put characters 1302 * \ / 1303 00004D59 1304 ITWILLFITX LABEL 04D59 60534000 1 5 REG 1305 LD R1 R5 R5 = number of characters to move 04D5A 9956C004 5 3 CACH 1306 ADDM R5 TCQ,TCQLAST account for the chars to be placed 04D5B 5D1F8001 6 STAK 1307 LEAVE POP 1308 * --- 1309 1310 END of FILLTCQ 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1038 (CIAINUTIL) F 50 Input utility routines for the CIA 1312 1313 ********************************************************************************** 1314 * * 1315 * INPUTERR * 1316 * * 1317 * When an input error occurs we build an error element and * 1318 * link it into the chain of input TCQs. The error element is a * 1319 * TCQ with the command bit set and the parameter is the error * 1320 * code. * 1321 * * 1322 * Note: We do not place the element if the last element in the * 1323 * existing input queue is also an error element. This is to * 1324 * prevent multitudes of errors (for example, framing error) * 1325 * from eating up free memory with error elements. One error * 1326 * should be enough anyway! * 1327 * * 1328 * Call: * 1329 * TCB -> TCB (unlocked) * 1330 * CALL INPUTERR * 1331 * PARVL error code * 1332 * * 1333 * Eats R0:R1 * 1334 * Stack Required = 3 * 1335 * 2 + max ( LOCKWAIT (0), MAKECEL (1), SFREEMEM (0) ) * 1336 * * 1337 ********************************************************************************** 1338 1339 BLOCK INPUTERR subroutine 1340 1341 ENTRY INPUTERR 1342 1343 BEGFRAME 00178801 6 BASE 1344 TEMP BSS 1 1345 ENDFRAME 1346 04D5C DD1F8002 6 STAK 1347 INPUTERR ENTR PUSH 04D5D C0578801 6 BASE 1348 STPVL SP,TEMP save the error code 04D5E E0978801 2 6 BASE 1349 EXCH R2 SP,TEMP save R2 and pick up the error code 04D5F DC004A1C 1350 CALL MAKECEL build and element 04D60 41440091 IMM 1351 PARV PORTIERR the command code 04D61 40528000 2 REG 1352 PARVL R2 the parameter 1353 1354 PLOCK TCB,TCLOCK lock the TCB 04D62 0CC00000 1354 IOFF 04D63 D1D70818 4 BASE 1354 SETT TCB,TCLOCK 04D64 FE0C4D66 1354 JNE MA(2+DISPW MA 0) 04D65 DC40308B 1354 CALLNP LOCKWAIT 04D66 6009011C 0 4 ZBM 1355 LD R0 TCB,TCTTIEP get pointer to end of input TCQs 04D67 FA324D6A 0 1356 JNZA R0 NOTFIRST jump if some elements already exist 04D68 E489231C 2 4 ZBM 1357 ST R2 TCB,TCTTIBP make us the beginning 04D69 FE0E4D70 1358 JMP JOININ merge back 1359 * --- 1360 1361 * Input queue not empty. Check for duplicate error elements. 00004D6A 1362 NOTFIRST LABEL 04D6A 5C081C10 0 ZBM 1363 CMZ R0,TCQCOMND last element a command? 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1039 (CIAINUTIL) F 50 Input utility routines for the CIA 04D6B FE024D6F 1364 JEQ SETIT jump if not 04D6C 60480081 1 0 ZBM 1365 LD R1 R0,TCQCCODE get command code 04D6D 64440091 1 IMM 1366 CPR R1 PORTIERR last element an input error? 04D6E FE024D75 1367 JEQ DUMPIT jump if so 00004D6F 1368 SETIT LABEL 04D6F E4881F10 2 0 ZBM 1369 ST R2 R0,TCQLINK link the new element on 1370 * \ / 1371 00004D70 1372 JOININ LABEL 04D70 E489011C 2 4 ZBM 1373 ST R2 TCB,TCTTIEP we are now the last in the chain 1374 PUNLOCK TCB,TCLOCK 04D71 EC170818 4 BASE 1374 STZ TCB,TCLOCK 04D72 0C800000 1374 ION 00004D73 1375 IEDONE LABEL 04D73 60978801 2 6 BASE 1376 LD R2 SP,TEMP restore R2 04D74 5D1F8002 6 STAK 1377 LEAVE POP return 1378 * --- 1379 1380 * dump would-be duplicate (addressed by R2) 00004D75 1381 DUMPIT LABEL 1382 PUNLOCK TCB,TCLOCK 04D75 EC170818 4 BASE 1382 STZ TCB,TCLOCK 04D76 0C800000 1382 ION 04D77 DC002F5D 1383 CALL SFREEMEM hand back the memory 04D78 41489060 2 ZBM 1384 PARV R2,TCQLOG log size 04D79 40528000 2 REG 1385 PARVL R2 address 04D7A FE0E4D73 1386 JMP IEDONE leave 1387 * --- 1388 1389 END of INPUTERR subroutine 1390 1391 END CIAINUTIL Comm Utility Routines 86 INPUT LPDRIVER line printer driver 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1040 (LPDRIVER) F 51 Line Printer Driver 3 4 ********************************************************************************** 5 * * 6 * This is the line printer driver. The story behind the * 7 * line printer is as follows: * 8 * * 9 * Each line printer controller (LPC) supports exactly * 10 * one line printer. This is described by an LPC element. * 11 * * 12 * When a line printer is opened, EQUIP allocates a * 13 * line printer buffer block (LPB), which can buffer up to * 14 * seven lines. A write will put a line into the buffer * 15 * (waiting if it will not fit), and will start an I/O * 16 * operation to the printer if it is not already going. * 17 * An interrupt from the printer will cause us to start * 18 * writing the next line, if any. Also, if only two lines * 19 * remain to be written, we will awaken the writer (if he * 20 * is sleeping). After the line printer is closed and all * 21 * lines are written out, we will free the line printer * 22 * buffer block. * 23 * * 24 ********************************************************************************** 25 26 BLOCK Line Printer Driver 27 28 ENTRY LPCINT LP Interrupt Routine 29 ENTRY LPCSTART Start LP (when something is put into buf) 30 ENTRY LPCRESET Reset LP (when timeout occurs) 31 32 33 * Trace Events Generated 34 00000001 ABS 35 LPTINTRPT EQU 1 Interrupt, R0=PageMap, R1=LpcStatus, R2=PpuStatus 00000002 ABS 36 LPTSTART EQU 2 Start, R0=PageMap, R1=LpcStatus, R2=PpuStatus 00000003 ABS 37 LPTRESET EQU 3 Reset, R0=PageMap, R1=LpcStatus 00000004 ABS 38 LPTENVVFU EQU 4 Enable VVFU, R0=PageMap 00000005 ABS 39 LPTLDVVFU EQU 5 Load VVFU, R0=PageMap 00000006 ABS 40 LPTDSVVFU EQU 6 Disable VVFU, R0=PageMap 00000007 ABS 41 LPTWRLINE EQU 7 Write, R0=PageMap 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1041 (LPDRIVER) F 51 Line Printer Driver 43 44 ********************************************************************************** 45 * * 46 * Line Printer Interrupt Routine. Entered with: * 47 * R2 = PPU status, R3 => LPC element, CIX is mapped to device. * 48 * * 49 * Exit to DISPATCH. * 50 * Stack required = 10 * 51 * 0 + max ( LOCKWAIT (0), PROCESSINT (10), TRACEPROC (3) ) * 52 * * 53 ********************************************************************************** 54 55 BLOCK LPCINT routine 56 ENTRY LPCINT 57 00004D7B 58 LPCINT LABEL 59 PLOCK (LPC,LPCELOCK) lock the controller 04D7B 0CC00000 59 IOFF 04D7C D1D6C805 3 BASE 59 SETT (LPC,LPCELOCK) 04D7D FE0C4D7F 59 JNE MA(2+DISPW MA 0) 04D7E DC40308B 59 CALLNP LOCKWAIT 04D7F 5C08D417 3 ZBM 60 CMZ LPC,LPCDEAD check for controller dead 04D80 FE0C4D86 61 JNE RETURN jump if controller dead 04D81 60401802 1 62 LD R1 CIX(PPUCHANS1) get LPC interrupting status 04D82 6016C801 0 3 BASE 63 LD R0 LPC,LPCPMVALUE for trace 64 TRACE LPTRACE,LPTINTRPT interrupt: R0=PageMap, R1=LpcStat, R2=PpuStat 04D83 5D401D31 64 XCT TRACECALL(LPTRACE) 04D84 FEC000A1 64 NOP (LPTRACE*BITS 22:26)+(LPTINTRPT*BITS 27:31) 65 04D85 DC404DC2 66 CALLNP PROCESSINT process the interrupt 67 00004D86 68 RETURN LABEL 69 PUNLOCK (LPC,LPCELOCK) unlock the controller 04D86 EC16C805 3 BASE 69 STZ (LPC,LPCELOCK) 04D87 0C800000 69 ION 04D88 60C40086 3 IMM 70 LD PFPTR PNCIX 04D89 80D2C000 3 REG 71 PFRC PFPTR unmap the controller 04D8A FE0E28B7 72 JMP DISPATCH and all done 73 * --- 74 75 END LPCINT routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1042 (LPDRIVER) F 51 Line Printer Driver 77 78 ********************************************************************************** 79 * * 80 * LPCSTART. This subroutine will attempt to start * 81 * a line printer write operation, if possible. It * 82 * should be called after putting a new line into * 83 * the line printer buffer. * 84 * * 85 * PLOCK LPCELOCK * 86 * LD LPC => LPC element * 87 * CALLNP LPCSTART * 88 * Eats R0-R2, R4. * 89 * Stack required = 11 * 90 * 1 + max ( PROCESSINT (10), TRACEPROC (3) ) * 91 * * 92 ********************************************************************************** 93 94 BLOCK LPCSTART subroutine 95 ENTRY LPCSTART 96 97 BEGFRAME 98 ENDFRAME 99 04D8B DD5F8001 6 STAK 100 LPCSTART ENTRNP PUSH 04D8C 5C08C217 3 ZBM 101 CMZ LPC,LPCBUSY is LP busy with write? 04D8D FE0C4DA7 102 JNE RETURN if so, can't bother it now 04D8E 5C08D417 3 ZBM 103 CMZ LPC,LPCDEAD check for controller dead 04D8F FE0C4DA7 104 JNE RETURN jump if controller dead 105 04D90 6012C000 0 3 REG 106 LD R0 LPC save register (same as PFPTR) 04D91 60C40086 3 IMM 107 LD PFPTR PNCIX 04D92 00D60801 0 BASE 108 LDPF R0,LPCPMVALUE map in the controller 04D93 60D20000 3 0 REG 109 LD LPC R0 restore register 04D94 5C001800 110 CMZ CIX(PPUCABLED) check for response 04D95 FE0C4D99 111 JNE ALIVE jump if it looks good 112 SETTBIT LPC,LPCDEAD otherwise, indicate dead 04D96 60020040 0 IMM 112 LD R0 1*BIT(((LPC,LPCDEAD) DISP (LPC,0))/BITS 0:4) 04D97 FC16C807 0 3 BASE 112 IORM R0 LPC,(((LPC,LPCDEAD) DISP (LPC,0))/BITS 15:31) 04D98 FE0E4DA3 113 JMP UNMAP and exit 114 * --- 115 00004D99 116 ALIVE LABEL 04D99 EC001A00 117 STZ CIX(LPNOP) disable LPC interrupts 118 04D9A 60801801 2 119 LD R2 CIX(PPUINTSTAT) get current PPU status 04D9B F2A84DA3 2 120 JBF R2/PPUICIA UNMAP jump if another CPU just got interrupt 04D9C 60401802 1 121 LD R1 CIX(PPUCHANS1) get LPC interrupting status 04D9D F6784D9F 1 122 JBT R1/PPUIINTC HAVEINT jump if interrupt was pending 04D9E 60401A20 1 123 LD R1 CIX(LPSTATUS) else get current LPC status 00004D9F 124 HAVEINT LABEL 125 04D9F 6016C801 0 3 BASE 126 LD R0 LPC,LPCPMVALUE for trace 127 TRACE LPTRACE,LPTSTART start LP, R0=PageMap, R1=LpcStat, R2=PpuStat 04DA0 5D401D31 127 XCT TRACECALL(LPTRACE) 04DA1 FEC000A2 127 NOP (LPTRACE*BITS 22:26)+(LPTSTART*BITS 27:31) 128 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1043 (LPDRIVER) F 51 Line Printer Driver 04DA2 DC404DC2 129 CALLNP PROCESSINT process as interrupt 130 * \ / 131 00004DA3 132 UNMAP LABEL 04DA3 6012C000 0 3 REG 133 LD R0 LPC save register 04DA4 60C40086 3 IMM 134 LD PFPTR PNCIX 04DA5 80D2C000 3 REG 135 PFRC PFPTR unmap the controller 04DA6 60D20000 3 0 REG 136 LD LPC R0 restore register 137 * \ / 138 00004DA7 139 RETURN LABEL 04DA7 5D1F8001 6 STAK 140 LEAVE POP all done 141 * --- 142 143 END LPCSTART subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1044 (LPDRIVER) F 51 Line Printer Driver 145 146 ********************************************************************************** 147 * * 148 * LPCRESET. Reset the controller after timeout. * 149 * * 150 * Call: CIX mapped to device * 151 * PLOCK LPCELOCK * 152 * LD R5 => LPC element * 153 * LD R0 0 if LPC not talking, 1 if ok * 154 * CALLNP LPCRESET * 155 * * 156 * * 157 * Eats R0-R4. * 158 * Stack required = 11 * 159 * 1 + max ( PROCESSINT (10), TRACEPROC (3) ) * 160 * * 161 ********************************************************************************** 162 163 BLOCK LPCRESET subroutine 164 ENTRY LPCRESET 165 166 BEGFRAME 167 ENDFRAME 168 04DA8 DD5F8001 6 STAK 169 LPCRESET ENTRNP PUSH 04DA9 60D34000 3 5 REG 170 LD LPC R5 get LPC pointer 04DAA FA024DB9 0 171 JEQZ R0 DEAD jump if not talking 172 CLRTBIT LPC,LPCDEAD save LPC is alive 04DAB 60020040 0 IMM 172 LD R0 1*BIT(((LPC,LPCDEAD) DISP (LPC,0))/BITS 0:4) 04DAC A816C807 0 3 BASE 172 BRSBM R0 LPC,(((LPC,LPCDEAD) DISP (LPC,0))/BITS 15:31) 04DAD 60401A20 1 173 LD R1 CIX(LPSTATUS) get current status 04DAE F66E4DB0 1 174 JBT R1/LPSTBUFRDY DORESET jump if ready for another line 04DAF F2644DBB 1 175 JBF R1/LPSTREADY WAKEUP just return if printer is offline 176 * \ / 177 00004DB0 178 DORESET LABEL 04DB0 6016C801 0 3 BASE 179 LD R0 LPC,LPCPMVALUE for trace 180 TRACE LPTRACE,LPTRESET Reset: R0=PageMap, R1=LpcStatus 04DB1 5D401D31 180 XCT TRACECALL(LPTRACE) 04DB2 FEC000A3 180 NOP (LPTRACE*BITS 22:26)+(LPTRESET*BITS 27:31) 04DB3 7C440013 1 IMM 181 IOR R1 1*LPSTBADWRT+1*LPSTIVFU+1*LPSTIRDY set misc status bits 182 04DB4 DC404DC2 183 CALLNP PROCESSINT process as interrupt 184 04DB5 5C08C217 3 ZBM 185 CMZ LPC,LPCBUSY is LP now busy? 04DB6 FE024DBB 186 JEQ WAKEUP jump if not 04DB7 61D7D001 7 7 REG 187 LD R7 R7+1 else skip return: log timeout error 04DB8 FE0E4DBB 188 JMP WAKEUP go to shake it up 189 * --- 190 00004DB9 191 DEAD LABEL 192 SETTBIT LPC,LPCDEAD indicate morbid controller 04DB9 60020040 0 IMM 192 LD R0 1*BIT(((LPC,LPCDEAD) DISP (LPC,0))/BITS 0:4) 04DBA FC16C807 0 3 BASE 192 IORM R0 LPC,(((LPC,LPCDEAD) DISP (LPC,0))/BITS 15:31) 193 * \ / 00004DBB 194 WAKEUP LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1045 (LPDRIVER) F 51 Line Printer Driver 195 CLRTBIT LPC,LPCWAITING check for process waiting 04DBB 60022000 0 IMM 195 LD R0 1*BIT(((LPC,LPCWAITING) DISP (LPC,0))/BITS 0:4) 04DBC A816C807 0 3 BASE 195 BRSBM R0 LPC,(((LPC,LPCWAITING) DISP (LPC,0))/BITS 15:31) 04DBD FE024DC1 196 JEQ RETURN if none, just return 04DBE DC00354F 197 CALL DQUEONE otherwise dequeue him 04DBF 41001DAC 198 PAR SQDIOWAIT indicate which queue 04DC0 4052C000 3 REG 199 PARVL LPC and what parameter 200 * \ / 201 00004DC1 202 RETURN LABEL 04DC1 5D1F8001 6 STAK 203 LEAVE POP all done 204 * --- 205 206 END LPCRESET subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1046 (LPDRIVER) F 51 Line Printer Driver 208 209 ********************************************************************************** 210 * * 211 * PROCESSINT. Process an LP Interrupt. * 212 * This routine is called at LP interrupt time, LP startup * 213 * time, and LP reset time. It will handle the following, * 214 * as needed: * 215 * - error logging. * 216 * - VVFU loading. * 217 * - Complaints about LP not ready. * 218 * - writing lines. * 219 * - rousting processes that are waiting. * 220 * * 221 * Call: * 222 * PLOCK LPCELOCK * 223 * LD LPC => LPC element * 224 * LD R1 LPC status * 225 * CIX mapped to controller * 226 * LPC interrupts disabled * 227 * CALLNP PROCESSINT * 228 * * 229 * Eats R0-R2,R4. * 230 * Stack required = 10. * 231 * 2 + max ( CHECKSTAT (8), DQUEONE (4), ERRORLOG (3), * 232 * LPCWRITE (1), REALADDR (2), SFREEMEM (0), * 233 * TRACEPROC (3) ) * 234 * * 235 ********************************************************************************** 236 237 BLOCK PROCESSINT subroutine 238 ENTRY PROCESSINT 239 240 BEGFRAME 00178801 6 BASE 241 SAVER5 BSS 1 save area for R5 242 ENDFRAME 243 04DC2 DD5F8002 6 STAK 244 PROCESSINT ENTRNP PUSH 245 CLRTBIT LPC,LPCTIMEOUT clear timeout flag 04DC3 60030000 0 IMM 245 LD R0 1*BIT(((LPC,LPCTIMEOUT) DISP (LPC,0))/BITS 0:4) 04DC4 A816C807 0 3 BASE 245 BRSBM R0 LPC,(((LPC,LPCTIMEOUT) DISP (LPC,0))/BITS 15:31) 04DC5 E5578801 5 6 BASE 246 ST R5 SP,SAVER5 save this register 04DC6 61524000 5 1 REG 247 LD R5 R1 R5 = LP status 248 04DC7 5C0B4840 5 CBM 249 CMZ R5/LPSTERROR has error occurred? 04DC8 FE024DCF 250 JEQ NOERROR jump if not 04DC9 6112C000 4 3 REG 251 LD R4 LPC save this register 04DCA DC005048 252 CALL ERRORLOG and log the error 04DCB 41440A23 IMM 253 PARV ERLCLPERR line printer error 04DCC 41570804 4 BASE 254 PARV R4,LPCNAME name of line printer 04DCD 40534000 5 REG 255 PARVL R5 line printer status 04DCE 60D30000 3 4 REG 256 LD LPC R4 restore register 00004DCF 257 NOERROR LABEL 258 04DCF F37C4DDF 5 259 JBF R5/LPSTIVFU AFTLDVVFU jump if NOT just finished loading VVFU 260 * \ / 261 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1047 (LPDRIVER) F 51 Line Printer Driver 262 * A load VVFU operation just completed. If it was successful, 263 * enable the VVFU. Otherwise, change our state to show that 264 * the VVFU should not be enabled. 265 266 * \ / 267 CLRTBIT LPC,LPCLDVVFU say load VVFU not in progress 04DD0 60020100 0 IMM 267 LD R0 1*BIT(((LPC,LPCLDVVFU) DISP (LPC,0))/BITS 0:4) 04DD1 A816C807 0 3 BASE 267 BRSBM R0 LPC,(((LPC,LPCLDVVFU) DISP (LPC,0))/BITS 15:31) 04DD2 FE024DDF 268 JEQ AFTLDVVFU jump if we weren't doing one (strange) 269 CLRTBIT LPC,LPCBUSY say no longer busy 04DD3 60028000 0 IMM 269 LD R0 1*BIT(((LPC,LPCBUSY) DISP (LPC,0))/BITS 0:4) 04DD4 A816C807 0 3 BASE 269 BRSBM R0 LPC,(((LPC,LPCBUSY) DISP (LPC,0))/BITS 15:31) 04DD5 F7764DDD 5 270 JBT R5/LPSTBADWRT LDVVFUBAD jump if load didn't work 04DD6 60020040 0 IMM 271 LD R0 1*LPSTVFU bit to enable VFU 04DD7 E4001A02 0 272 ST R0 CIX(LPSETCTL) turn it on 04DD8 7D520000 5 0 REG 273 IOR R5 R0 update our copy of LPC status 04DD9 6016C801 0 3 BASE 274 LD R0 LPC,LPCPMVALUE for trace 275 TRACE LPTRACE,LPTENVVFU enable VVFU, R0=PageMap 04DDA 5D401D31 275 XCT TRACECALL(LPTRACE) 04DDB FEC000A4 275 NOP (LPTRACE*BITS 22:26)+(LPTENVVFU*BITS 27:31) 04DDC FE0E4DDF 276 JMP AFTLDVVFU 277 * --- 278 00004DDD 279 LDVVFUBAD LABEL 280 CLRTBIT LPC,LPCVVFUON say VVFU can not be enabled 04DDD 60020080 0 IMM 280 LD R0 1*BIT(((LPC,LPCVVFUON) DISP (LPC,0))/BITS 0:4) 04DDE A816C807 0 3 BASE 280 BRSBM R0 LPC,(((LPC,LPCVVFUON) DISP (LPC,0))/BITS 15:31) 281 * \ / 282 00004DDF 283 AFTLDVVFU LABEL 04DDF 6116C806 4 3 BASE 284 LD R4 LPC,LPCBUFPTR R4 -> line printer buffer 04DE0 DC004E34 285 CALL CHECKSTAT check online/offline status 04DE1 40534000 5 REG 286 PARVL R5 new status 04DE2 FB304E15 4 287 JZA R4 ENABLELPC jump if no buffer (ergo no activity) 288 04DE3 F36E4E15 5 289 JBF R5/LPSTBUFRDY ENABLELPC jump if buffer not ready (can't start write) 290 CLRTBIT LPC,LPCBUSY clear busy, were we busy? 04DE4 60028000 0 IMM 290 LD R0 1*BIT(((LPC,LPCBUSY) DISP (LPC,0))/BITS 0:4) 04DE5 A816C807 0 3 BASE 290 BRSBM R0 LPC,(((LPC,LPCBUSY) DISP (LPC,0))/BITS 15:31) 04DE6 FE024DED 291 JEQ NOLINEDONE jump if we weren't busy 04DE7 F7764DED 5 292 JBT R5/LPSTBADWRT NOLINEDONE jump if last write didn't work 293 * \ / 294 295 * We have just successfully completed writing a line. 296 * Remove it from our buffer. 297 298 * \ / 04DE8 D0570801 4 BASE 299 DEC R4,LPBLINECNT one fewer line in the buffer 04DE9 BC170802 0 4 BASE 300 INCL R0 R4,LPBFIRSTLN increment index for next to do 04DEA 64040007 0 IMM 301 CPR R0 LPBMAXCNT did we wrap around? 04DEB FE084DED 302 JLT NOWRAP jump if not 04DEC EC170802 4 BASE 303 STZ R4,LPBFIRSTLN else set index to beginning 00004DED 304 NOWRAP LABEL 00004DED 305 NOLINEDONE LABEL 306 * \ / 307 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1048 (LPDRIVER) F 51 Line Printer Driver 308 * Verify that the LPC's idea of the state of the VVFU 309 * is the same as ours. If not, correct it. 310 311 * \ / 04DED 5C08D217 3 ZBM 312 CMZ LPC,LPCVVFUON should the VVFU be on? 04DEE FE024DFF 313 JEQ VVFUOFF jump if it should be off 04DEF F7544E05 5 314 JBT R5/LPSTVFU VVFUOK jump if it is on 315 * \ / 316 * The VVFU needs to be enabled. First we must load it. 317 * \ / 04DF0 6016C801 0 3 BASE 318 LD R0 LPC,LPCPMVALUE for trace 319 TRACE LPTRACE,LPTLDVVFU load VVFU: R0=PageMap 04DF1 5D401D31 319 XCT TRACECALL(LPTRACE) 04DF2 FEC000A5 319 NOP (LPTRACE*BITS 22:26)+(LPTLDVVFU*BITS 27:31) 04DF3 60040001 0 IMM 320 LD R0 1*PPUIDMAD 04DF4 E4001802 0 321 ST R0 CIX(PPUSSSTAT) set DMA direction to output 04DF5 DC004E49 322 CALL REALADDR get real address ... 04DF6 4016C80A 3 BASE 323 PARL LPC,LPCVVFUDAT ... for VVFU data buffer 04DF7 E4001805 0 324 ST R0 CIX(PPUADDR1) tell the PPU about it 04DF8 6016C809 0 3 BASE 325 LD R0 LPC,LPCVVFULNS get line count 04DF9 604A0200 1 0 CBM 326 LD R1 R0/BITS 1:0 double for byte count 04DFA E4401804 1 327 ST R1 CIX(PPUCNT1) tell PPU about byte count 04DFB E4001A8C 0 328 ST R0 CIX(LPINT+LPLOADVFU) start the load VVFU operation 04DFC 60028100 0 IMM 329 LD R0 1*BIT(LPCBUSY DISPB LPCFLAGS)+1*BIT(LPCLDVVFU DISPB LPCFLAGS) 04DFD FC16C807 0 3 BASE 330 IORM R0 LPC,LPCFLAGS set busy and loading VVFU flags 04DFE FE0E4E16 331 JMP LPNOWBUSY and exit 332 * --- 333 00004DFF 334 VVFUOFF LABEL VVFU should be disabled 04DFF F3544E05 5 335 JBF R5/LPSTVFU VVFUOK jump if VVFU is disabled 04E00 6016C801 0 3 BASE 336 LD R0 LPC,LPCPMVALUE for trace 337 TRACE LPTRACE,LPTDSVVFU disable VVFU: R0=PageMap 04E01 5D401D31 337 XCT TRACECALL(LPTRACE) 04E02 FEC000A6 337 NOP (LPTRACE*BITS 22:26)+(LPTDSVVFU*BITS 27:31) 04E03 60020040 0 IMM 338 LD R0 1*LPSTVFU 04E04 E4001A01 0 339 ST R0 CIX(LPCLRCTL) clear the VVFU bit 340 * \ / 00004E05 341 VVFUOK LABEL VVFU is now properly set 342 04E05 5C170801 4 BASE 343 CMZ R4,LPBLINECNT is there a line to write? 04E06 FE024E0E 344 JEQ NOLINE jump if not 04E07 6016C801 0 3 BASE 345 LD R0 LPC,LPCPMVALUE for trace 346 TRACE LPTRACE,LPTWRLINE starting write: R0=PageMap 04E08 5D401D31 346 XCT TRACECALL(LPTRACE) 04E09 FEC000A7 346 NOP (LPTRACE*BITS 22:26)+(LPTWRLINE*BITS 27:31) 04E0A DC404E24 347 CALLNP LPCWRITE do the write 348 SETTBIT LPC,LPCBUSY say it is now busy 04E0B 60028000 0 IMM 348 LD R0 1*BIT(((LPC,LPCBUSY) DISP (LPC,0))/BITS 0:4) 04E0C FC16C807 0 3 BASE 348 IORM R0 LPC,(((LPC,LPCBUSY) DISP (LPC,0))/BITS 15:31) 04E0D FE0E4E16 349 JMP LPNOWBUSY 350 * --- 351 00004E0E 352 NOLINE LABEL no line to write 04E0E 5C08C417 3 ZBM 353 CMZ LPC,LPCOPEN is the LP still open? 04E0F FE0C4E15 354 JNE ENABLELPC jump if so, just idle 355 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1049 (LPDRIVER) F 51 Line Printer Driver 356 357 * There are no lines left to output and the line printer 358 * is no longer open. Here we destroy the LP buffer block. 359 360 * \ / 04E10 DC002F5D 361 CALL SFREEMEM free the block 04E11 41440008 IMM 362 PARV LPBLOG log size 04E12 40530000 4 REG 363 PARVL R4 address 04E13 61040000 4 IMM 364 LD R4 0 block no longer exists 04E14 EC16C806 3 BASE 365 STZ LPC,LPCBUFPTR ditto 366 * \ / 367 00004E15 368 ENABLELPC LABEL 04E15 EC001A80 369 STZ CIX(LPINT+LPNOP) enable interrupt from LPC 370 00004E16 371 LPNOWBUSY LABEL 372 * \ / 373 374 * Now see if we can wake up a waiting process 375 * \ / 376 04E16 FB304E20 4 377 JZA R4 NOWAITER if no buffer then no waiter 04E17 60170801 0 4 BASE 378 LD R0 R4,LPBLINECNT number of lines in buffer 04E18 64040002 0 IMM 379 CPR R0 2 two or less? 04E19 FE044E20 380 JGT NOWAITER if not, don't awaken yet 381 CLRTBIT LPC,LPCWAITING is someone waiting? 04E1A 60022000 0 IMM 381 LD R0 1*BIT(((LPC,LPCWAITING) DISP (LPC,0))/BITS 0:4) 04E1B A816C807 0 3 BASE 381 BRSBM R0 LPC,(((LPC,LPCWAITING) DISP (LPC,0))/BITS 15:31) 04E1C FE024E20 382 JEQ NOWAITER jump if not 04E1D DC00354F 383 CALL DQUEONE else awaken him 04E1E 41001DAC 384 PAR SQDIOWAIT queue number 04E1F 4052C000 3 REG 385 PARVL LPC wait parameter 00004E20 386 NOWAITER LABEL 387 04E20 60040800 0 IMM 388 LD R0 1*PPUICIA 04E21 E4001802 0 389 ST R0 CIX(PPUSSSTAT) allow LPC to cause PPU interrupts 390 04E22 61578801 5 6 BASE 391 LD R5 SP,SAVER5 restore this register 04E23 5D1F8002 6 STAK 392 LEAVE POP and all done 393 * --- 394 395 END PROCESSINT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1050 (LPDRIVER) F 51 Line Printer Driver 397 398 ********************************************************************************** 399 * * 400 * LPCWRITE. Write another line to the line printer. * 401 * Call: LD R4 LP buffer block pointer * 402 * CIX mapped to controller * 403 * CALLNP LPCWRITE * 404 * Eats R0-R2. * 405 * Stack required: 1. * 406 * * 407 ********************************************************************************** 408 409 BLOCK LPCWRITE subroutine 410 ENTRY LPCWRITE 411 412 BEGFRAME 413 ENDFRAME 414 04E24 DD5F8001 6 STAK 415 LPCWRITE ENTRNP PUSH 04E25 60040001 0 IMM 416 LD R0 1*PPUIDMAD 04E26 E4001802 0 417 ST R0 CIX(PPUSSSTAT) set DMA to output 04E27 60970802 2 4 BASE 418 LD R2 R4,LPBFIRSTLN get index to first line 04E28 1C840024 2 IMM 419 MUL R2 LPBLINESZ by size of line 04E29 389D1004 2 42 BASE 420 LEA R2 R4,LPBLINES(R2) R2 -> entry for line to write 04E2A 38168801 0 2 BASE 421 LEA R0 R2,1 R0 -> first character of line 04E2B 600A2CA0 0 0 CBM 422 LD R0 R0/DISPFIELD R0 = page displacement part of addr 04E2C 7C170800 0 4 BASE 423 IOR R0 R4,LPBPHYSADR R0 = physical address of line 04E2D E4001805 0 424 ST R0 CIX(PPUADDR1) save it 04E2E 6008B080 0 2 ZBM 425 LD R0 R2,0/LPWRLNTH get byte count 04E2F 7C048000 0 IMM 426 IOR R0 1*PPUCLAST this is only one 04E30 E4001804 0 427 ST R0 CIX(PPUCNT1) ship it to PPU 04E31 60168800 0 2 BASE 428 LD R0 R2,0 get command for LP 04E32 E4001AC0 0 429 ST R0 CIX(LPWRITE+LPINT) start write, request interrupt 04E33 5D1F8001 6 STAK 430 LEAVE POP and that's all 431 * --- 432 433 END LPCWRITE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1051 (LPDRIVER) F 51 Line Printer Driver 435 436 ********************************************************************************** 437 * * 438 * CHECKSTAT. Check LP status for online and possibly complain if not. * 439 * * 440 * LPC => LPC element * 441 * CALL CHECKSTAT * 442 * PARVL new LP status * 443 * * 444 * Eats R0-R2,R4. * 445 * Stack required: 8. * 446 * 3 + max ( CANOPMSG (1), DEVNOTRDY (5) ) * 447 * * 448 ********************************************************************************** 449 450 BLOCK CHECKSTAT subroutine 451 ENTRY CHECKSTAT 452 453 BEGFRAME 00178801 6 BASE 454 SAVER3R4 BSS 2 save area for these registers 455 ENDFRAME 456 04E34 DD1F8003 6 STAK 457 CHECKSTAT ENTR PUSH 04E35 C0520000 0 REG 458 STPVL R0 R0 = LP status 04E36 F6244E43 0 459 JBT R0/LPSTREADY ONLINE jump if online 04E37 6016C806 0 3 BASE 460 LD R0 LPC,LPCBUFPTR get pointer to buffer block 04E38 FA304E48 0 461 JZA R0 RETURN jump if no buffer block - nothing pending 04E39 5C160801 0 BASE 462 CMZ R0,LPBLINECNT are any lines of output pending? 04E3A FE024E48 463 JEQ RETURN if not, no complaint is needed 04E3B 5C16C803 3 BASE 464 CMZ LPC,LPCMSGID2 have we already complained? 04E3C FE0C4E48 465 JNE RETURN if so, don't do it again 04E3D E6D78801 346 BASE 466 ST2 R3 SP,SAVER3R4 save registers 04E3E DC004FBE 467 CALL DEVNOTRDY generate device not ready message 04E3F 4056C804 3 BASE 468 PARVL LPC,LPCNAME 04E40 62D78801 346 BASE 469 LD2 R3 SP,SAVER3R4 restore registers 04E41 E416C803 0 3 BASE 470 ST R0 LPC,LPCMSGID2 save message id of complaint 04E42 FE0E4E48 471 JMP RETURN and all done 472 * --- 473 00004E43 474 ONLINE LABEL 04E43 5C16C803 3 BASE 475 CMZ LPC,LPCMSGID2 is a complaint outstanding? 04E44 FE024E48 476 JEQ RETURN if not, no action 04E45 DC004713 477 CALL CANOPMSG else cancel the complaint 04E46 4056C803 3 BASE 478 PARVL LPC,LPCMSGID2 04E47 EC16C803 3 BASE 479 STZ LPC,LPCMSGID2 say no complaints now 480 * \ / 481 00004E48 482 RETURN LABEL 04E48 5D1F8003 6 STAK 483 LEAVE POP return, all done 484 * --- 485 486 END CHECKSTAT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1052 (LPDRIVER) F 51 Line Printer Driver 488 489 ********************************************************************************** 490 * * 491 * REALADDR - Convert virtual address to real address. * 492 * * 493 * CALL REALADDR * 494 * PARL virtual address * 495 * ST R0 real address (PPU format) * 496 * * 497 * Eats R0-R1. * 498 * Stack required = 2. * 499 * * 500 ********************************************************************************** 501 502 BLOCK REALADDR subroutine 503 ENTRY REALADDR 504 505 BEGFRAME 00178801 6 BASE 506 SAVER3 BSS 1 save area for this register 507 ENDFRAME 508 04E49 DD1F8002 6 STAK 509 REALADDR ENTR PUSH 04E4A C0124000 1 REG 510 STPL R1 R1 = virtual address 04E4B E4D78801 3 6 BASE 511 ST R3 SP,SAVER3 save this register 04E4C 60CA5C80 3 1 CBM 512 LD PFPTR R1/PAGEFIELD get virtual page number 04E4D 7CC40080 3 IMM 513 IOR PFPTR MONPF make it in monitor 04E4E 80920000 0 REG 514 PFRD R0 set R0 = page map value 04E4F 60CA28C0 3 0 CBM 515 LD R3 R0/PFPAGENUM R3 = page number 04E50 E4CA14C0 3 0 CBM 516 ST R3 R0/FLDABSPG put it into absolute address place 04E51 E44A2CA0 1 0 CBM 517 ST R1 R0/DISPFIELD save displacement 04E52 60D78801 3 6 BASE 518 LD R3 SP,SAVER3 restore this register 04E53 5D1F8002 6 STAK 519 LEAVE POP and all done 520 * --- 521 522 END REALADDR subroutine 523 524 525 END Line Printer Driver 87 INPUT IAPRINT associated process interrupt processor 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1053 (IAPRINT) F 52 Associated Processor Interrupt Processing 3 4 ********************************************************************************** 5 * * 6 * This routine handles interrupts that another processor * 7 * can force upon this processor. This interrupt is only used * 8 * to signal the end of a quantum. Note that a stack pointer * 9 * is not setup since no subroutine calls are made. * 10 * * 11 ********************************************************************************** 12 13 BLOCK OTHERTALK routine 14 ENTRY OTHERTALK process IAPR 15 16 * R4 => previous console area 00004E54 17 OTHERTALK LABEL 04E54 60400412 1 18 LD R1 CPPSA pointer to current process 04E55 FA7028B7 1 19 JZA R1 DISPATCH if none, then already shutdown 20 PLOCK R1,PSLOCK lock for access to PSUERROR word 04E56 0CC00000 20 IOFF 04E57 D1D6480C 1 BASE 20 SETT R1,PSLOCK 04E58 FE0C4E5A 20 JNE MA(2+DISPW MA 0) 04E59 DC40308B 20 CALLNP LOCKWAIT 04E5A EDC85A1D 1 ZBM 21 STW R1,PSUERROR/RTSWITCHB set switch bit in PSA 22 PUNLOCK R1,PSLOCK release lock 04E5B EC16480C 1 BASE 22 STZ R1,PSLOCK 04E5C 0C800000 22 ION 04E5D FE0E28B7 23 JMP DISPATCH go directly to dispatch, do not collect $200 24 * --- 25 26 END OTHERTALK routine 88 INPUT DEADMAN I/O deadman timer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1054 (DEADMAN) F 53 Deadman Timer 3 4 BLOCK Dead Man Timer Routines 5 ENTRY DEADMAN check all devices 6 ENTRY DEVNOTRDY complain about device not ready 7 8 ********************************************************************************** 9 * * 10 * Dead Man Timer Routines * 11 * * 12 * This block contains the dead man timer and associated * 13 * routines. DEADMAN is called via a timer interrupt once every 10 * 14 * seconds, and checks to see that everything is still alive. * 15 * * 16 * If the timer dies we don't get here. The code to restart * 17 * the time interrupts is to be found in the dispatcher. * 18 * * 19 * DEVNOTRDY is a utility routine that can be called from * 20 * device drivers to generate a message to the operator saying * 21 * that a device is not ready. It is included in this file for * 22 * want of a better place. * 23 * * 24 ********************************************************************************** 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1055 (DEADMAN) F 53 Deadman Timer 26 27 ********************************************************************************** 28 * * 29 * DEADMAN. I/O deadman timer. * 30 * Since dead men say nothing (as well as no tales) we must * 31 * periodically wander over and kick the bodies in the system to * 32 * make sure that they're still animate. Every device control * 33 * block has a bit in it that this routine will set if the device * 34 * is busy and that the driver will clear when it gets an * 35 * interrupt from the device. If this routine discovers that the * 36 * bit is set and that the device is still busy, then the device * 37 * has taken over 10 seconds to respond so this routine willl * 38 * invoke recovery for that device. * 39 * This routine is called every 10 seconds so it may take up * 40 * to 20 seconds to notice that a device is dead, but it is not * 41 * supposed to happen often. * 42 * This routine does not attempt to restart the SSU because: * 43 * 1) if it is not working, how did we get here? and 2) the call * 44 * to timeset at the beginning of this could cause problems. * 45 * * 46 * Call: * 47 * LD SP => stack top * 48 * IOFF * 49 * CALLNP DEADMAN * 50 * * 51 * Eats R0:R5. * 52 * Stack required = 16 * 53 * 3 + max ( CHECKDISK (10), CHECKCIA (13), CHECKLP (12), * 54 * CHECKMTC (10), LOGPPUBAD ( 5), LOGPPUGOOD( 4), * 55 * SMUCHECK ( 5), TIMESET ( 2) ) * 56 * * 57 ********************************************************************************** 58 59 BLOCK DEADMAN subroutine 60 ENTRY DEADMAN 61 62 BEGFRAME 00178004 6 CACH 63 DEADMSLOT BSSC 1 slot being examined 00178005 6 CACH 64 DEADMCHAN BSSC 1 channel being examined 00178006 6 CACH 65 DEADMPPUT BSSC 1 non-zero if PPU talking 00178802 6 BASE 66 DEADMR7 BSS 1 R7 save 67 ENDFRAME 68 04E5E DD5F8003 6 STAK 69 DEADMAN ENTRNP PUSH 04E5F E5D78802 7 6 BASE 70 ST R7 SP,DEADMR7 save R7 04E60 DC0044F8 71 CALL TIMESET set up for our next interrupt 04E61 43442710 IMM 72 PARV2 10*MSECSS indicate interval 04E62 41440000 IMM 73 PARV 0 don't care which CPU 04E63 41004E5E 74 PAR DEADMAN come back here 04E64 40440000 IMM 75 PARVL 0 parameter unused 04E65 E5001EF3 4 76 ST TMR DEADMANTMR save the serial number of element 77 * \ / ... for use during power fail recovery 78 79 ********************************************************************************** 80 * The SMUs keep a log of errors on the board. We want to * 81 * occasionally check this log and report any errors in the system * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1056 (DEADMAN) F 53 Deadman Timer 82 * error log. Since reading this log is a rather slow activity we * 83 * choose to do it once a minute or every sixth time through * 84 * DEADMAN. For this purpose we keep a counter which is initially * 85 * set to 6 and is decremented each time through here. When it * 86 * reaches 0 we read all SMU error logs, record any errors, and * 87 * reset the counter. * 88 ********************************************************************************** 89 90 * \ / 04E66 D0401EFF 91 DEC SMUCHKCNT one more time though DEADMAN 04E67 FE044E6B 92 JGT DOSLOTS if more than zero then not time to check SMUs 04E68 DC404EAA 93 CALLNP SMUCHECK check the SMU error logs 04E69 60040006 0 IMM 94 LD R0 SMUCHKINTV pick up initial counter value 04E6A E4001EFF 0 95 ST R0 SMUCHKCNT reset counter 96 * \ / 97 00004E6B 98 DOSLOTS LABEL 04E6B 6104000F 4 IMM 99 LD R4 NUMSLOTS-1 do each slot on VRA bus 00004E6C 100 NEXTDSLOT LABEL 04E6C 61E81ECE 7 4 101 LD R7 SLOTTABLE(R4) get a slot descriptor 04E6D 600BC030 0 7 CBM 102 LD R0 R7/SLOTTYPE get type of device here 04E6E E5178004 4 6 CACH 103 ST R4 SP,DEADMSLOT save slot looking at 04E6F 5CA04E70 0 104 LDPC DEADCHECK(R0) do the checking 105 * --- 106 00004E70 107 DEADCHECK LABEL 04E70 00004E79 108 ADR NOCHECK 0 - empty slot 04E71 00004E79 109 ADR NOCHECK 1 - MCU, can't interrupt 04E72 00004E79 110 ADR NOCHECK 2 - CPU, shouldn't interrupt 04E73 00004E7C 111 ADR CHECKPPU 3 - PPU 04E74 00004E79 112 ADR NOCHECK 4 - SSU, check is futile 04E75 00004E79 113 ADR NOCHECK 5 - undefined type 04E76 00004E79 114 ADR NOCHECK 6 - undefined type 04E77 00004E79 115 ADR NOCHECK 7 - undefined type 116 117 * Done with the checking of this slot 00004E78 118 DONECHECK LABEL 04E78 61178004 4 6 CACH 119 LD R4 SP,DEADMSLOT restore the slot index 00004E79 120 NOCHECK LABEL 04E79 FB264E6C 4 121 JDR R4 NEXTDSLOT count on to the next slot 122 * \ / 04E7A 61D78802 7 6 BASE 123 LD R7 SP,DEADMR7 restore R7 04E7B 5D1F8003 6 STAK 124 LEAVE POP done checking, return 125 * --- 126 127 * A PPU. Check each of the devices here. 00004E7C 128 CHECKPPU LABEL 04E7C 79C5FFFF 7 IMM 129 AND R7 ONEBITS/SLOTPTR R7 => PPU control block 04E7D EDD78006 6 CACH 130 STW SP,DEADMPPUT indicate PPU talking 04E7E 60828000 2 IMM 131 LD R2 BUSCWRU+0 get a WRU command 04E7F 6049C840 1 7 ZBM 132 LD R1 R7,PPUPF/PFSLOT get the PPU slot number 04E80 0C128000 2 REG 133 LDFB R2 find out if PPU answering 04E81 FE164E84 134 JOS PPUZAPPED jump if abnormal data 04E82 FE104E86 135 JCC PPUTALKING jump if response received okay 04E83 EC178006 6 CACH 136 STZ SP,DEADMPPUT indicate no response 00004E84 137 PPUZAPPED LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1057 (DEADMAN) F 53 Deadman Timer 04E84 DC404F13 138 CALLNP LOGPPUBAD log that PPU is bad if needed 04E85 FE0E4E87 139 JMP LOOKCHANS 140 * --- 141 00004E86 142 PPUTALKING LABEL 04E86 DC404F43 143 CALLNP LOGPPUGOOD log that PPU is ok if needed 144 * \ / 145 00004E87 146 LOOKCHANS LABEL 04E87 61040003 4 IMM 147 LD R4 PPUCHANS-1 check each channel on PPU 00004E88 148 NEXTCHAN LABEL 04E88 615DE004 5 74 BASE 149 LD R5 R7,PPUCNTLPTR(R4) get the device control block 04E89 FB424E97 5 150 JEQZ R5 NODEV jump off if no device 151 * \ / 152 04E8A 608B0C00 2 4 CBM 153 LD R2 R4*PPUCHAN position the real channel number 04E8B 7C97C800 2 7 BASE 154 IOR R2 R7,PPUPF make composite page map value 04E8C 60C40086 3 IMM 155 LD PFPTR PNCIX get the I/O window number 04E8D 00D28000 2 REG 156 LDPF R2 and load up the page file 04E8E 600B4080 0 5 CBM 157 LD R0 R5/DEVTYPE see what type device on this channel 04E8F 5004000F 0 IMM 158 MIN R0 0F catch invalid types 04E90 7945FFFF 5 IMM 159 AND R5 ONEBITS/DEVPTR mask off pointer 04E91 60204E99 0 0 160 LD R0 CHECKDEV(R0) get address of appropriate routine 04E92 FA304E97 0 161 JZA R0 NODEV jump if unknown type 162 * \ / 163 04E93 60578006 1 6 CACH 164 LD R1 SP,DEADMPPUT flag whether PPU is talking 04E94 E5178005 4 6 CACH 165 ST R4 SP,DEADMCHAN save the channel index 04E95 DC560400 0 @R 166 CALLNP @R0 call the routine 167 * \ / 168 04E96 61178005 4 6 CACH 169 LD R4 SP,DEADMCHAN restore the channel index 00004E97 170 NODEV LABEL 04E97 FB264E88 4 171 JDR R4 NEXTCHAN continue on with next channel 04E98 FE0E4E78 172 JMP DONECHECK done with all PPU channels 173 * --- 174 175 ********************************************************************************** 176 * * 177 * Routine called with: * 178 * R1 = 1 if PPU is talking, 0 if not * 179 * R2 = page map value * 180 * R5 => control block * 181 * SP = stack pointer * 182 * * 183 * Routines may mangle R0:R4. * 184 * * 185 ********************************************************************************** 186 00004E99 187 CHECKDEV LABEL 04E99 00000000 188 VFD 0 00 - not used 04E9A 00004EC8 189 ADR CHECKDISK 01 - mass storage controller 04E9B 00004EDD 190 ADR CHECKLP 02 - line printer controller 04E9C 00000000 191 VFD 0 03 - not used 04E9D 00000000 192 VFD 0 04 - not used 04E9E 00000000 193 VFD 0 05 - not used 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1058 (DEADMAN) F 53 Deadman Timer 04E9F 00000000 194 VFD 0 06 - not used 04EA0 00000000 195 VFD 0 07 - not used 04EA1 00004EB9 196 ADR CHECKCIA 08 - async comm. controller 04EA2 00004EF3 197 ADR CHECKMTC 09 - magnetic tape controller 04EA3 00004EF3 198 ADR CHECKMTC 0A - cartridge tape controller 04EA4 00004EF3 199 ADR CHECKMTC 0B - video tape controller 04EA5 00004EC8 200 ADR CHECKDISK 0C - mass storage controller (SDC) 04EA6 00000000 201 VFD 0 0D - not used 04EA7 00000000 202 VFD 0 0E - not used 04EA8 00000000 203 VFD 0 0F - not used 204 205 END DEADMAN subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1059 (DEADMAN) F 53 Deadman Timer 207 208 ********************************************************************************** 209 * * 210 * SMUCHECK -- Read the SMU Error Log * 211 * * 212 * Once a minute we come here to read the error logs on * 213 * any SMUs on the system. SMULIST is scanned and for each * 214 * entry a bus command is sent to the SMU to fetch the most * 215 * recent error log entry. If there is an error we log it, * 216 * otherwise we continue on our merry way. Note that we only * 217 * attempt a single read. This is to prevent a major problem * 218 * from flooding the error log. * 219 * Call: * 220 * IOFF * 221 * CALLNP SMUCHECK * 222 * * 223 * Eats R0:R4. * 224 * Stack required = 5. * 225 * 2 + max (ERRORLOG (3) ) * 226 * * 227 ********************************************************************************** 228 229 BLOCK SMUCHECK subroutine 230 ENTRY SMUCHECK 231 232 BEGFRAME 00178801 6 BASE 233 SAVER3 BSS 1 you guess 234 ENDFRAME 235 04EA9 22020000 236 ERRLOGCMND VFD BUSCREAD+SMUPCRCEL*SMUPCC+1*SMUPCMND bus command to read 04EA9 22020000 237 SMU current error log 238 04EAA DD5F8002 6 STAK 239 SMUCHECK ENTRNP PUSH 04EAB 60C01EFE 3 240 LD R3 SMULIST R3 -> list of SMUs 04EAC FAF04EB8 3 241 JZA R3 NOSMUS if nothing to read 242 * \ / 243 00004EAD 244 SMULOOP LABEL 04EAD 6048C040 1 3 ZBM 245 LD R1 R3,SMUSLOT pick up the slot number 04EAE 0C004EA9 246 LDFB ERRLOGCMND request the error log information 04EAF FA024EB7 0 247 JEQZ R0 NOERROR no error if all zero 04EB0 61120000 4 0 REG 248 LD R4 R0 move to safe register for parameter passing 04EB1 E4D78801 3 6 BASE 249 ST R3 SP,SAVER3 keep safe from subroutine 04EB2 DC005048 250 CALL ERRORLOG log the error 04EB3 41440A35 IMM 251 PARV ERLCSMU a SMU error 04EB4 4148C040 3 ZBM 252 PARV R3,SMUSLOT SMU slot number 04EB5 40530000 4 REG 253 PARVL R4 the error information 04EB6 60D78801 3 6 BASE 254 LD R3 SP,SAVER3 restore pointer to list 255 * \ / 256 00004EB7 257 NOERROR LABEL 04EB7 FAF64EAD 3 258 LJNA R3 SMULOOP keep on going 259 * \ / 00004EB8 260 NOSMUS LABEL 04EB8 5D1F8002 6 STAK 261 LEAVE POP 262 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1060 (DEADMAN) F 53 Deadman Timer 263 264 END of SMUCHECK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1061 (DEADMAN) F 53 Deadman Timer 266 267 ********************************************************************************** 268 * * 269 * CHECKCIA - Check comm controller for signs of life. * 270 * * 271 * R5 => CIA control block * 272 * CIX => device * 273 * R1 = 0 if PPU not talking * 274 * CALLNP CHECKCIA * 275 * * 276 * Eats R0:R4. * 277 * Stack required = 13. * 278 * 1 + max ( CHECKTALK (9), CIA_RESET (12), ERRORLOG (3) ) * 279 * * 280 ********************************************************************************** 281 282 BLOCK CHECKCIA subroutine 283 ENTRY CHECKCIA 284 285 BEGFRAME 286 ENDFRAME 287 04EB9 DD5F8001 6 STAK 288 CHECKCIA ENTRNP PUSH 289 SETTBIT R5,COMTIMEOUT the CIA is always busy, so save check 04EBA 60028000 0 IMM 289 LD R0 1*BIT(((R5,COMTIMEOUT) DISP (R5,0))/BITS 0:4) 04EBB FC174805 0 5 BASE 289 IORM R0 R5,(((R5,COMTIMEOUT) DISP (R5,0))/BITS 15:31) 04EBC FE0C4EC7 290 JNE RETURN if it was off, device is running 04EBD DC004F4F 291 CALL CHECKTALK see if comm is alive 04EBE 4147FFFF IMM 292 PARV ONEBITS mask for WRU response 04EBF 41574801 5 BASE 293 PARV R5,COMWRU expected value for WRU response 04EC0 40174803 5 BASE 294 PARL R5,COMOPMSGID place for id of operator message 04EC1 FA024EC6 0 295 JEQZ R0 NOCOMTALK jump if comm is dead 04EC2 DC005048 296 CALL ERRORLOG log the timed out error 04EC3 4144060F IMM 297 PARV ERLCCIATO error code 04EC4 40574802 5 BASE 298 PARVL R5,COMPF PF of the device 04EC5 60040001 0 IMM 299 LD R0 1 say PPU is talking 300 * \ / 00004EC6 301 NOCOMTALK LABEL 04EC6 DC40494C 302 CALLNP CIA_RESET restart comm (if comm silent, flushes buffers) 303 * \ / 00004EC7 304 RETURN LABEL 04EC7 5D1F8001 6 STAK 305 LEAVE POP 306 * --- 307 308 END CHECKCIA subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1062 (DEADMAN) F 53 Deadman Timer 310 311 ********************************************************************************** 312 * * 313 * CHECKDISK - Check a disk controller. * 314 * * 315 * R5 => MCT element * 316 * CIX => device * 317 * R1 = 0 if PPU not talking * 318 * CALLNP CHECKDISK * 319 * * 320 * Eats R0:R4 * 321 * Stack required = 10 * 322 * 1 + max ( CHECKTALK (9), ERRORLOG (3), LOCKWAIT (0), * 323 * MS_RESET (6) ) * 324 * * 325 ********************************************************************************** 326 327 BLOCK CHECKDISK subroutine 328 ENTRY CHECKDISK 329 330 BEGFRAME 331 ENDFRAME 332 04EC8 DD5F8001 6 STAK 333 CHECKDISK ENTRNP PUSH 334 PLOCK (R5,MCTELOCK) lock the controller 04EC9 0CC00000 334 IOFF 04ECA D1D74803 5 BASE 334 SETT (R5,MCTELOCK) 04ECB FE0C4ECD 334 JNE MA(2+DISPW MA 0) 04ECC DC40308B 334 CALLNP LOCKWAIT 335 SETTBIT R5,MCTTIMEOUT check the timeout flag 04ECD 60021000 0 IMM 335 LD R0 1*BIT(((R5,MCTTIMEOUT) DISP (R5,0))/BITS 0:4) 04ECE FC174804 0 5 BASE 335 IORM R0 R5,(((R5,MCTTIMEOUT) DISP (R5,0))/BITS 15:31) 04ECF FE0C4EDA 336 JNE RETURN jump if it's been busy recently 337 04ED0 DC004F4F 338 CALL CHECKTALK see if DISK is talking today 04ED1 4140395D 339 PARV DISKWRUMASK mask for WRU response 04ED2 4140395E 340 PARV DISKWRUVAL value for WRU response after masking 04ED3 40174802 5 BASE 341 PARL R5,MCTOPMSGID place for message id 04ED4 DC4039A9 342 CALLNP MS_RESET start the controller 04ED5 FE0E4EDA 343 JMP RETURN jump if no error logging needed 344 * \ / 345 346 * R4 = unit plug number of a lazy disk 04ED6 DC005048 347 CALL ERRORLOG log the somnambulant disk 04ED7 41440A10 IMM 348 PARV ERLCDSKTO error type 04ED8 41574801 5 BASE 349 PARV R5,MCTPMVALUE page file of controller 04ED9 40530000 4 REG 350 PARVL R4 unit number 351 * \ / 352 00004EDA 353 RETURN LABEL 354 PUNLOCK (R5,MCTELOCK) unlock the controller 04EDA EC174803 5 BASE 354 STZ (R5,MCTELOCK) 04EDB 0C800000 354 ION 04EDC 5D1F8001 6 STAK 355 LEAVE POP 356 * --- 357 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1063 (DEADMAN) F 53 Deadman Timer 358 END CHECKDISK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1064 (DEADMAN) F 53 Deadman Timer 360 361 ********************************************************************************** 362 * * 363 * CHECKLP - Check line printer controller for signs of life. * 364 * * 365 * R5 => LPC block * 366 * CIX => device * 367 * R1 = 0 if PPU not talking * 368 * CALLNP CHECKLP * 369 * * 370 * Eats R0:R4. * 371 * Stack required = 12 * 372 * 1 + max ( CHECKTALK (9), ERRORLOG (3), LOCKWAIT (0), * 373 * LPCRESET (11) ) * 374 * * 375 ********************************************************************************** 376 377 BLOCK CHECKLP subroutine 378 ENTRY CHECKLP 379 380 BEGFRAME 381 ENDFRAME 382 04EDD DD5F8001 6 STAK 383 CHECKLP ENTRNP PUSH 384 PLOCK (R5,LPCELOCK) lock the region 04EDE 0CC00000 384 IOFF 04EDF D1D74805 5 BASE 384 SETT (R5,LPCELOCK) 04EE0 FE0C4EE2 384 JNE MA(2+DISPW MA 0) 04EE1 DC40308B 384 CALLNP LOCKWAIT 385 SETTBIT R5,LPCTIMEOUT check on the time out bit 04EE2 60030000 0 IMM 385 LD R0 1*BIT(((R5,LPCTIMEOUT) DISP (R5,0))/BITS 0:4) 04EE3 FC174807 0 5 BASE 385 IORM R0 R5,(((R5,LPCTIMEOUT) DISP (R5,0))/BITS 15:31) 04EE4 FE0C4EEE 386 JNE RETURN if it was not previously set, done 387 04EE5 DC004F4F 388 CALL CHECKTALK see if LPC is talking 04EE6 41404EF1 389 PARV LPCWRUMASK mask for WRU response 04EE7 41404EF2 390 PARV LPCWRUVAL value for WRU response, after masking 04EE8 40174802 5 BASE 391 PARL R5,LPCMSGID1 place for id of msg to operator 04EE9 DC404DA8 392 CALLNP LPCRESET try to revive device 04EEA FE0E4EEE 393 JMP NOLPTO jump if intervention required, no answer 04EEB DC005048 394 CALL ERRORLOG call to log the restart 04EEC 41440625 IMM 395 PARV ERLCLPTO indicate line printer time out 04EED 40574804 5 BASE 396 PARVL R5,LPCNAME indicate which one 00004EEE 397 NOLPTO LABEL 398 * \ / 399 00004EEE 400 RETURN LABEL 401 PUNLOCK (R5,LPCELOCK) release the critical region 04EEE EC174805 5 BASE 401 STZ (R5,LPCELOCK) 04EEF 0C800000 401 ION 04EF0 5D1F8001 6 STAK 402 LEAVE POP 403 * --- 404 04EF1 FF000000 405 LPCWRUMASK VFD ONEBITS/DWRUTYPE*DWRUTYPE 04EF2 02000000 406 LPCWRUVAL VFD DVCTLPC*DWRUTYPE 407 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1065 (DEADMAN) F 53 Deadman Timer 408 END CHECKLP subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1066 (DEADMAN) F 53 Deadman Timer 410 411 ********************************************************************************** 412 * * 413 * CHECKMTC - Check magnetic tape for signs of life. * 414 * * 415 * R5 => MTC control block * 416 * CIX => device * 417 * R1 = 0 if PPU not talking * 418 * CALLNP CHECKMTC * 419 * * 420 * Eats R0:R4. * 421 * Stack required = 10. * 422 * 1 + max ( CHECKTALK (9), ERRORLOG (3), LOCKWAIT (0), * 423 * MT_RESET (7) ) * 424 * * 425 ********************************************************************************** 426 427 BLOCK CHECKMTC subroutine 428 ENTRY CHECKMTC 429 430 BEGFRAME 431 ENDFRAME 432 04EF3 DD5F8001 6 STAK 433 CHECKMTC ENTRNP PUSH 434 PLOCK (R5,MTCELOCK) lock the controller 04EF4 0CC00000 434 IOFF 04EF5 D1D74803 5 BASE 434 SETT (R5,MTCELOCK) 04EF6 FE0C4EF8 434 JNE MA(2+DISPW MA 0) 04EF7 DC40308B 434 CALLNP LOCKWAIT 04EF8 D0574804 5 BASE 435 DEC R5,MTCTIMEOUT decrement the timeout counter 04EF9 FE064F04 436 JGE RETURN jump if not time yet 437 04EFA DC004F4F 438 CALL CHECKTALK see if the MTC is talking 04EFB 41404F07 439 PARV MTCWRUMASK mask for WRU response 04EFC 60094426 0 5 ZBM 440 LD R0 R5,MTCTYPE 0 if CT, 1 if MT, 2 if VT 04EFD 41604F08 0 441 PARV MTCWRUVAL(R0) value for WRU response 04EFE 40174802 5 BASE 442 PARL R5,MTCOPMSGID place for id of operator message 443 04EFF DC4041CB 444 CALLNP MT_RESET call to restart magnetic tape 04F00 FE0E4F04 445 JMP RETURN jump if we shouldn't log a timeout 446 * \ / 447 04F01 DC005048 448 CALL ERRORLOG mag tape controller timeout 04F02 4144062E IMM 449 PARV ERLCMTCTO time out 04F03 40574801 5 BASE 450 PARVL R5,MTCPMVALUE page map value 451 * \ / 452 00004F04 453 RETURN LABEL 454 PUNLOCK (R5,MTCELOCK) unlock the controller 04F04 EC174803 5 BASE 454 STZ (R5,MTCELOCK) 04F05 0C800000 454 ION 04F06 5D1F8001 6 STAK 455 LEAVE POP 456 * --- 457 04F07 FF00FF00 458 MTCWRUMASK VFD ONEBITS/DWRUTYPE*DWRUTYPE+ONEBITS/MTIDSTEST*MTIDSTEST 00004F08 459 MTCWRUVAL LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1067 (DEADMAN) F 53 Deadman Timer 04F08 0A000000 460 VFD DVCTCTC*DWRUTYPE+0*MTIDSTEST value for CT 04F09 09000000 461 VFD DVCTMTC*DWRUTYPE+0*MTIDSTEST value for MT 04F0A 0B000000 462 VFD DVCTVTC*DWRUTYPE+0*MTIDSTEST value for VT 463 464 END CHECKMTC subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1068 (DEADMAN) F 53 Deadman Timer 466 467 ********************************************************************************** 468 * * 469 * SETPPU3WRD * 470 * * 471 * This subroutine will check to see if a given PPU should * 472 * have triple word transfers enabled and if so will enable * 473 * them. * 474 * Call: * 475 * R4 -> PPU control element * 476 * CALLNP SETPPU3WRD * 477 * * 478 * Eats R3. * 479 * Stack required = 1 * 480 * * 481 ********************************************************************************** 482 483 BLOCK SETPPU3WRD subroutine 484 485 ENTRY SETPPU3WRD 486 487 BEGFRAME 488 ENDFRAME 489 04F0B DD5F8001 6 STAK 490 SETPPU3WRD ENTRNP PUSH 04F0C 5C170803 4 BASE 491 CMZ R4,PPU3WORD is this a triple word PPU? 04F0D FE024F12 492 JEQ OUTOFHERE get out of here if not 493 * \ / 494 04F0E 60C40086 3 IMM 495 LD PFPTR PNCIX i/o page 04F0F 00D70800 4 BASE 496 LDPF R4,PPUPF map in the PPU 04F10 EDC01808 497 STW CIX(PPU3WRD) enable triple word transfers 04F11 80D2C000 3 REG 498 PFRC PFPTR unmap the page 499 * \ / 500 00004F12 501 OUTOFHERE LABEL 04F12 5D1F8001 6 STAK 502 LEAVE POP 503 * --- 504 505 END of SETPPU3WRD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1069 (DEADMAN) F 53 Deadman Timer 507 508 ********************************************************************************** 509 * * 510 * LOGPPUBAD - Called when we notice that a PPU is not * 511 * working. If it used to be working, we log that it went bad * 512 * and generate a message to tell the operator about it. * 513 * * 514 * R7 => PPU element * 515 * CALLNP LOGPPUBAD * 516 * * 517 * Eats R0:R5. * 518 * Stack required = 5. * 519 * 1 + max ( ERRORLOG (3), GENOPMSG (1), HEXTOCHAR (4), * 520 * SGETMEM (0) ) * 521 * * 522 ********************************************************************************** 523 524 BLOCK LOGPPUBAD subroutine 525 ENTRY LOGPPUBAD 526 527 BEGFRAME 528 ENDFRAME 529 04F13 DD5F8001 6 STAK 530 LOGPPUBAD ENTRNP PUSH 04F14 61578800 5 6 BASE 531 LD R5 SP,0 R5 => PPU element 04F15 5C174801 5 BASE 532 CMZ R5,PPUOPMSGID have we already told people it's bad? 04F16 FE0C4F37 533 JNE RETURN jump if so 534 04F17 DC005048 535 CALL ERRORLOG else log the error 04F18 41440626 IMM 536 PARV ERLCPPUBAD PPU is bad 04F19 40494840 5 ZBM 537 PARVL R5,PPUPF/PFSLOT slot number 538 04F1A DC002ED0 539 CALL SGETMEM get an OPMSG block 04F1B 40440005 IMM 540 PARVL OPMSGLOG size of block 04F1C 61120000 4 0 REG 541 LD R4 R0 R4 -> OPMSG block 542 04F1D 38970802 2 4 BASE 543 LEA R2 R4,OPMSGTEXT put "PPU " into message 04F1E 60044F38 0 IMM 544 LD R0 ADR MSGPART1 04F1F 60440004 1 IMM 545 LD R1 MSG1LEN 04F20 FE400000 546 CMOVE 547 04F21 DC0058D1 548 CALL HEXTOCHAR put slot number into message 04F22 41494840 5 ZBM 549 PARV R5,PPUPF/PFSLOT 04F23 41440001 IMM 550 PARV 1 04F24 40168000 2 CACH 551 PARL CACH R2,0 552 * \ / R2 => null at end of string 553 04F25 60044F39 0 IMM 554 LD R0 ADR MSGPART2 put " PPU is slot " into message 04F26 60440011 1 IMM 555 LD R1 MSG2LEN 04F27 FE400000 556 CMOVE 557 04F28 DC0058D1 558 CALL HEXTOCHAR put slot number into message 04F29 41494840 5 ZBM 559 PARV R5,PPUPF/PFSLOT 04F2A 41440001 IMM 560 PARV 1 04F2B 40168000 2 CACH 561 PARL CACH R2,0 562 * \ / R2 => null at end of string 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1070 (DEADMAN) F 53 Deadman Timer 563 04F2C 60044F3E 0 IMM 564 LD R0 ADR MSGPART3 put " is not responding." into message 04F2D 60440013 1 IMM 565 LD R1 MSG3LEN 04F2E FE400000 566 CMOVE 567 04F2F 38170802 0 4 BASE 568 LEA R0 R4,OPMSGTEXT R0 -> beginning of text 04F30 608A9F30 2 2 CBM 569 LD R2 R2/FLDCHARS 04F31 108A1F30 2 0 CBM 570 SUB R2 R0/FLDCHARS R2 = message length 04F32 E4970007 2 4 CACH 571 ST R2 R4,OPMSGLEN save it 04F33 EC0902E0 4 ZBM 572 STZ R4,OPMSGPROC no process number 04F34 DC0046F3 573 CALL GENOPMSG generate the message 04F35 40530000 4 REG 574 PARVL R4 address of block 04F36 E4174801 0 5 BASE 575 ST R0 R5,PPUOPMSGID save id of message 576 * \ / 577 00004F37 578 RETURN LABEL 04F37 5D1F8001 6 STAK 579 LEAVE POP 580 * --- 581 04F38 50505520 582 MSGPART1 TEXT "PPU " 00000004 ABS 583 MSG1LEN EQU 4 04F39 20202020 584 MSGPART2 TEXT " PPU in slot " 00000011 ABS 585 MSG2LEN EQU 17 04F3E 20697320 586 MSGPART3 TEXT " is not responding." 00000013 ABS 587 MSG3LEN EQU 19 588 589 END LOGPPUBAD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1071 (DEADMAN) F 53 Deadman Timer 591 592 ********************************************************************************** 593 * * 594 * LOGPPUGOOD - Called when we notice that the PPU is * 595 * working. If it used to be wedged, we log that it has come * 596 * back to life, and kill the operator message complaining * 597 * about it. * 598 * * 599 * R7 => PPU element * 600 * CALLNP LOGPPUGOOD * 601 * * 602 * Eats R0:R4. * 603 * Stack required = 4. * 604 * 1 + max ( CANOPMSG (1), ERRORLOG (3), SETPPU3WRD(1) ) * 605 * * 606 ********************************************************************************** 607 608 BLOCK LOGPPUGOOD subroutine 609 ENTRY LOGPPUGOOD 610 611 BEGFRAME 612 ENDFRAME 613 04F43 DD5F8001 6 STAK 614 LOGPPUGOOD ENTRNP PUSH 04F44 61178800 4 6 BASE 615 LD R4 SP,0 R4 -> PPU element 04F45 5C170801 4 BASE 616 CMZ R4,PPUOPMSGID did PPU used to work? 04F46 FE024F4E 617 JEQ RETURN if so, all done 618 * \ / 619 04F47 DC005048 620 CALL ERRORLOG log the event 04F48 41440427 IMM 621 PARV ERLCPPUOK PPU came back to life 04F49 40490840 4 ZBM 622 PARVL R4,PPUPF/PFSLOT slot number of PPU 623 04F4A DC004713 624 CALL CANOPMSG cancel complaint to operator 04F4B 40570801 4 BASE 625 PARVL R4,PPUOPMSGID id of complaint 04F4C EC170801 4 BASE 626 STZ R4,PPUOPMSGID remember that it's good 04F4D DC404F0B 627 CALLNP SETPPU3WRD reset PPU to do triple word transfers 628 * \ / 629 00004F4E 630 RETURN LABEL 04F4E 5D1F8001 6 STAK 631 LEAVE POP 632 * --- 633 634 END LOGPPUGOOD subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1072 (DEADMAN) F 53 Deadman Timer 636 637 ********************************************************************************** 638 * * 639 * CHECKTALK - See whether a controller is talking. * 640 * * 641 * If it isn't talking, and we have not already told the * 642 * operator about it, log the error and tell the operator. If * 643 * it is talking, and we have told the operator that it isn't, * 644 * log the controller's resurrection and cancel our complaint * 645 * to the operator. Simple, huh? Also, if it isn't talking, * 646 * we send it a reset command that will reset the hardware and * 647 * the PPU interface in the hopes that that will make it * 648 * happier (we still say it's dead because a controller reset * 649 * takes up to two seconds). * 650 * * 651 * CIX mapped to the device * 652 * R1 = 0 if PPU is dead * 653 * CALL CHECKTALK * 654 * PARV mask for device WRU response * 655 * PARV expected value for device WRU response, after masking * 656 * PARL location for id of operator message * 657 * JEQZ R0 controller is not talking * 658 * * 659 * Eats R0:R3. Sets R0=0 if not talking, R0=1 if talking. * 660 * Stack required = 9. * 661 * 5 + max ( CANOPMSG (1), ERRORLOG (3), GENOPMSG (1), * 662 * HEXTOCHAR(4), SGETMEM (0) ) * 663 * * 664 ********************************************************************************** 665 666 BLOCK CHECKTALK subroutine 667 ENTRY CHECKTALK 668 669 BEGFRAME 00178801 6 BASE 670 PFILE BSS 1 page file for device 00178802 6 BASE 671 WRUMASK BSS 1 mask for device WRU response 00178802 6 BASE 672 SAVER4 EQU WRUMASK save area for R4 00178803 6 BASE 673 WRUVALUE BSS 1 expected WRU response, after masking 00178804 6 BASE 674 MSGIDPTR BSS 1 pointer to location for message id 675 ENDFRAME 676 04F4F DD1F8005 6 STAK 677 CHECKTALK ENTR PUSH 04F50 C1578802 6 BASE 678 STPV SP,WRUMASK save WRU mask 04F51 C1578803 6 BASE 679 STPV SP,WRUVALUE save WRU value 04F52 C0178804 6 BASE 680 STPL SP,MSGIDPTR save pointer to message id 04F53 FA424FA7 1 681 JEQZ R1 PPUNOTALK jump if PPU is not talking 04F54 60C40086 3 IMM 682 LD PFPTR PNCIX load index for page file CIX window 04F55 80978801 6 BASE 683 PFRD SP,PFILE read what's in the PF for the IO device 684 04F56 60824000 2 IMM 685 LD R2 BUSCREAD construct read of device WRU info 04F57 6009B021 0 6 ZBM 686 LD R0 SP,PFILE/PPUCHAN 04F58 E40A9C20 0 2 CBM 687 ST R0 R2/BITS 14:15 04F59 18840000 2 IMM 688 ADD R2 PPUCABLED R2 = read command 04F5A 60498841 1 6 ZBM 689 LD R1 SP,PFILE/PFSLOT R1 = slot number 04F5B 0C128000 2 REG 690 LDFB R2 do command (R0 = response) 04F5C FE164F6E 691 JOS NOTALK jump if abnormal data 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1073 (DEADMAN) F 53 Deadman Timer 04F5D FE124F6E 692 JCS NOTALK jump if no response 04F5E 78178802 0 6 BASE 693 AND R0 SP,WRUMASK mask the response 04F5F 64178803 0 6 BASE 694 CPR R0 SP,WRUVALUE is it what we wanted? 04F60 FE0C4F6E 695 JNE NOTALK if not, device doesn't talk right 696 * \ / 697 698 * The controller seems to be talking. See if it just 699 * recently came alive. 700 701 * \ / 04F61 5C178C04 6 FPVR 702 CMZ @(SP,MSGIDPTR) is a complaint outstanding? 04F62 FE024F6C 703 JEQ RETURN1 if not, all is well 04F63 60040000 0 IMM 704 LD R0 0 04F64 E0178C04 0 6 FPVR 705 EXCH R0 @(SP,MSGIDPTR) R0 := msg id, clear his variable 04F65 DC004713 706 CALL CANOPMSG cancel the message 04F66 40520000 0 REG 707 PARVL R0 708 04F67 60D78801 3 6 BASE 709 LD R3 SP,PFILE 04F68 DC005048 710 CALL ERRORLOG log the event 04F69 41440829 IMM 711 PARV ERLCCTLOK controller has come back to life 04F6A 414AC840 3 CBM 712 PARV R3/PFSLOT slot number 04F6B 404AF020 3 CBM 713 PARVL R3/PPUCHAN channel number 714 * \ / 715 00004F6C 716 RETURN1 LABEL 04F6C 60040001 0 IMM 717 LD R0 1 flag: controller is talking 04F6D FE0E4FAD 718 JMP RETURN 719 * --- 720 721 * The controller is not talking. See if it just died, and 722 * if so, notify the operator. 723 00004F6E 724 NOTALK LABEL 04F6E EC001800 725 STZ CIX(PPURESET) wang the hardware and software 726 * \ / 04F6F 5C178C04 6 FPVR 727 CMZ @(SP,MSGIDPTR) is message already outstanding? 04F70 FE0C4FAC 728 JNE RETURN0 if so, we were dead last time, too 729 04F71 60D78801 3 6 BASE 730 LD R3 SP,PFILE 04F72 DC005048 731 CALL ERRORLOG log the event 04F73 41440A28 IMM 732 PARV ERLCCTLBAD controller is dead 04F74 414AC840 3 CBM 733 PARV R3/PFSLOT slot number 04F75 404AF020 3 CBM 734 PARVL R3/PPUCHAN channel number 735 04F76 E5178802 4 6 BASE 736 ST R4 SP,SAVER4 save volatile register 04F77 DC002ED0 737 CALL SGETMEM get an OPMSG block 04F78 40440005 IMM 738 PARVL OPMSGLOG 04F79 61120000 4 0 REG 739 LD R4 R0 R4 -> the block 740 04F7A 38970802 2 4 BASE 741 LEA R2 R4,OPMSGTEXT put "CTLR " into message 04F7B 60044FAE 0 IMM 742 LD R0 ADR MSGPART1 04F7C 60440005 1 IMM 743 LD R1 MSG1LEN 04F7D FE400000 744 CMOVE 745 04F7E 60098841 0 6 ZBM 746 LD R0 SP,PFILE/PFSLOT 04F7F DC0058D1 747 CALL HEXTOCHAR put slot number into message 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1074 (DEADMAN) F 53 Deadman Timer 04F80 41520000 0 REG 748 PARV R0 04F81 41440001 IMM 749 PARV 1 04F82 40168000 2 CACH 750 PARL CACH R2,0 751 * \ / R2 => null at end of string 752 04F83 60040020 0 IMM 753 LD R0 " " put space into message 04F84 E4168000 0 2 CACH 754 ST R0 CACH R2,0 755 04F85 6009B021 0 6 ZBM 756 LD R0 SP,PFILE/PPUCHAN 04F86 DC0058D1 757 CALL HEXTOCHAR put channel number into message 04F87 41520000 0 REG 758 PARV R0 04F88 41440001 IMM 759 PARV 1 04F89 40168001 2 CACH 760 PARL CACH R2,1 761 * \ / R2 => null at end of string 762 04F8A 60044FB0 0 IMM 763 LD R0 ADR MSGPART2 put " Controller at slot " into message 04F8B 60440015 1 IMM 764 LD R1 MSG2LEN 04F8C FE400000 765 CMOVE 766 04F8D 60098841 0 6 ZBM 767 LD R0 SP,PFILE/PFSLOT 04F8E DC0058D1 768 CALL HEXTOCHAR put slot number into message 04F8F 41520000 0 REG 769 PARV R0 04F90 41440001 IMM 770 PARV 1 04F91 40168000 2 CACH 771 PARL CACH R2,0 772 * \ / R2 => null at end of string 773 04F92 60044FB6 0 IMM 774 LD R0 ADR MSGPART3 put ", channel " into message 04F93 6044000A 1 IMM 775 LD R1 MSG3LEN 04F94 FE400000 776 CMOVE 777 04F95 6009B021 0 6 ZBM 778 LD R0 SP,PFILE/PPUCHAN 04F96 DC0058D1 779 CALL HEXTOCHAR put channel number into message 04F97 41520000 0 REG 780 PARV R0 04F98 41440001 IMM 781 PARV 1 04F99 40168000 2 CACH 782 PARL CACH R2,0 783 * \ / R2 => null at end of string 784 04F9A 60044FB9 0 IMM 785 LD R0 ADR MSGPART4 put " is not responding." into message 04F9B 60440013 1 IMM 786 LD R1 MSG4LEN 04F9C FE400000 787 CMOVE 788 04F9D 38170802 0 4 BASE 789 LEA R0 R4,OPMSGTEXT R0 -> beginning of message 04F9E 608A9F30 2 2 CBM 790 LD R2 R2/FLDCHARS 04F9F 108A1F30 2 0 CBM 791 SUB R2 R0/FLDCHARS R2 = length of message 04FA0 E4970007 2 4 CACH 792 ST R2 R4,OPMSGLEN save length in block 793 04FA1 EC0902E0 4 ZBM 794 STZ R4,OPMSGPROC no process number for this message 04FA2 DC0046F3 795 CALL GENOPMSG generate the message 04FA3 40530000 4 REG 796 PARVL R4 04FA4 E4178C04 0 6 FPVR 797 ST R0 @(SP,MSGIDPTR) save id of message 04FA5 61178802 4 6 BASE 798 LD R4 SP,SAVER4 restore this regiser 04FA6 FE0E4FAC 799 JMP RETURN0 and all done - not talking 800 * --- 801 802 * The PPU is not talking. Cancel any message that says 803 * that the controller is not talking. 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1075 (DEADMAN) F 53 Deadman Timer 804 00004FA7 805 PPUNOTALK LABEL 04FA7 60040000 0 IMM 806 LD R0 0 04FA8 E0178C04 0 6 FPVR 807 EXCH R0 @(SP,MSGIDPTR) R0 = message id, clear it 04FA9 FA024FAC 0 808 JEQZ R0 RETURN0 jump if message not pending 04FAA DC004713 809 CALL CANOPMSG else cancel the message 04FAB 40520000 0 REG 810 PARVL R0 811 * \ / 812 00004FAC 813 RETURN0 LABEL 04FAC 60040000 0 IMM 814 LD R0 0 controller (or PPU) not talking 815 * \ / 816 00004FAD 817 RETURN LABEL 04FAD 5D1F8005 6 STAK 818 LEAVE POP 819 * --- 820 04FAE 43544C52 821 MSGPART1 TEXT "CTLR " 00000005 ABS 822 MSG1LEN EQU 5 04FB0 2020436F 823 MSGPART2 TEXT " Controller at slot " 00000015 ABS 824 MSG2LEN EQU 21 04FB6 2C206368 825 MSGPART3 TEXT ", channel " 0000000A ABS 826 MSG3LEN EQU 10 04FB9 20697320 827 MSGPART4 TEXT " is not responding." 00000013 ABS 828 MSG4LEN EQU 19 829 830 END CHECKTALK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1076 (DEADMAN) F 53 Deadman Timer 832 833 ********************************************************************************** 834 * * 835 * DEVNOTRDY - Complain about device not ready. * 836 * * 837 * This routine will generate a message to the operator * 838 * saying that a device is not ready. * 839 * * 840 * CALL DEVNOTRDY * 841 * PARVL pak6 device name * 842 * ST R0 message serial number * 843 * * 844 * Eats R0:R4. * 845 * Stack required = 5. * 846 * 2 + max ( GENOPMSG (1), P6TOCHAR (3), SGETMEM (0) ) * 847 * * 848 ********************************************************************************** 849 850 BLOCK DEVNOTRDY subroutine 851 ENTRY DEVNOTRDY 852 853 BEGFRAME 00178801 6 BASE 854 DEVNAME BSS 1 855 ENDFRAME 856 04FBE DD1F8002 6 STAK 857 DEVNOTRDY ENTR PUSH 04FBF C0578801 6 BASE 858 STPVL SP,DEVNAME save device name 859 04FC0 DC002ED0 860 CALL SGETMEM get an OPMSG block 04FC1 40440005 IMM 861 PARVL OPMSGLOG 04FC2 61120000 4 0 REG 862 LD R4 R0 R4 -> OPMSG block 863 04FC3 38970802 2 4 BASE 864 LEA R2 R4,OPMSGTEXT put "DEV " into message 04FC4 60044FDE 0 IMM 865 LD R0 ADR MSGPART1 04FC5 60440004 1 IMM 866 LD R1 MSG1LEN 04FC6 FE400000 867 CMOVE 868 04FC7 60178801 0 6 BASE 869 LD R0 SP,DEVNAME 04FC8 DC00593E 870 CALL P6TOCHAR put device name into message 04FC9 41520000 0 REG 871 PARV R0 04FCA 41440006 IMM 872 PARV 6 04FCB 40168000 2 CACH 873 PARL CACH R2,0 874 * \ / R2 => null at end of string 875 04FCC 60044FDF 0 IMM 876 LD R0 ADR MSGPART2 put "Device " into message 04FCD 60440007 1 IMM 877 LD R1 MSG2LEN 04FCE FE400000 878 CMOVE 879 04FCF 60178801 0 6 BASE 880 LD R0 SP,DEVNAME 04FD0 DC00593E 881 CALL P6TOCHAR put device name into message 04FD1 41520000 0 REG 882 PARV R0 04FD2 40168000 2 CACH 883 PARL CACH R2,0 884 * \ / R2 => null at end of string 885 04FD3 60044FE1 0 IMM 886 LD R0 ADR MSGPART3 put " is not ready." into message 04FD4 6044000E 1 IMM 887 LD R1 MSG3LEN 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1077 (DEADMAN) F 53 Deadman Timer 04FD5 FE400000 888 CMOVE 889 04FD6 38170802 0 4 BASE 890 LEA R0 R4,OPMSGTEXT R0 -> beginning of text 04FD7 608A9F30 2 2 CBM 891 LD R2 R2/FLDCHARS 04FD8 108A1F30 2 0 CBM 892 SUB R2 R0/FLDCHARS R2 = message length 04FD9 E4970007 2 4 CACH 893 ST R2 R4,OPMSGLEN save length in OPMSG block 894 04FDA EC0902E0 4 ZBM 895 STZ R4,OPMSGPROC no process number for this message 04FDB DC0046F3 896 CALL GENOPMSG generate the message 04FDC 40530000 4 REG 897 PARVL R4 898 04FDD 5D1F8002 6 STAK 899 LEAVE POP return, R0 = message serial number 900 * --- 901 04FDE 44455620 902 MSGPART1 TEXT "DEV " 00000004 ABS 903 MSG1LEN EQU 4 04FDF 44657669 904 MSGPART2 TEXT "Device " 00000007 ABS 905 MSG2LEN EQU 7 04FE1 20697320 906 MSGPART3 TEXT " is not ready." 0000000E ABS 907 MSG3LEN EQU 14 908 909 END DEVNOTRDY subroutine 910 911 END Dead Man Timer Routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1078 F 0 Deadman Timer 90 91 ********************************************************************************** 92 * * 93 * Place to break the listing. * 94 * * 95 ********************************************************************************** 96 97 INPUT SPROCSTART element queuers for system processes 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1079 (SPROCSTART) F 54 System Process Start Routine 3 4 PROCSTART BLOCK routines that start other processes 5 6 ENTRY ACCOUNT get accounting element 7 ENTRY ACCTREQUE requeueing of accounting records 8 ENTRY DISMOUNT check if volume requires dismounting 9 ENTRY ERRORLOG log errors 10 ENTRY FREEFILE return a file structure 11 ENTRY FREESPEC return a file structure 12 ENTRY PUTADT put a single block into the ADT 13 ENTRY SUBSTITUTE substitute a block 14 ENTRY UNSUBS unsubstitute a block 15 16 ********************************************************************************** 17 * * 18 * FREESPEC * 19 * This is a special version of FREEFILE that places * 20 * the new queue element at the beginning of the queue. * 21 * This call is used when an element being freed generates * 22 * many other elements. It ensures that the growth of the * 23 * free element queue is somewhat controlled when freeing * 24 * complex structures. * 25 * Same call as FREEFILE. * 26 * * 27 * Eats R0:R3. * 28 * Stack required = 3 * 29 * 2 + max ( GETDATE (1), LOCKLIST (1), LOCKWAIT (0), * 30 * SGETMEM (0), UNLOCKLIST (1) ) * 31 * * 32 ********************************************************************************** 33 34 BLOCK FREESPEC, FREEFILE, ACCTQUE, PUTADT, ERRORLOG, DISMOUNT 35 ENTRY DISMOUNT 36 ENTRY FREESPEC 37 ENTRY FREEFILE 38 ENTRY ACCTQUE 39 ENTRY ACCTREQUE 40 ENTRY PUTADT 41 ENTRY ERRORLOG 42 43 BEGFRAME 00178801 6 BASE 44 FREEFILET BSS 1 temp location 45 ENDFRAME 46 04FE5 DD9F8002 6 STAK 47 FREESPEC ENTRS PUSH 04FE6 EDD78801 6 BASE 48 STW SP,FREEFILET indicate special routine 04FE7 FE0E4FEC 49 JMP FREESHR go share code 50 * --- 51 52 ********************************************************************************** 53 * * 54 * FREEFILE. * 55 * This routine is called with the root of some disk structure * 56 * and it causes a process to be started up (if it is not already * 57 * running) that will return the disk blocks in that * 58 * structure to the free block pool. Call: * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1080 (SPROCSTART) F 54 System Process Start Routine 59 * * 60 * SP = stack area * 61 * CALL FREEFILE * 62 ** Eats R0, R1, and R3 before the parameters are passed. Therefore * 63 ** the caller must not destroy R3. * 64 * PARV first disk addr (includes volume number) * 65 * PARVL type of structure freeing * 66 * * 67 * Eats R0:R3. * 68 * Stack required = 3, See FREESPEC. * 69 * * 70 ********************************************************************************** 71 04FE8 0000000A 72 FFMAXPROC VFD 10 maximum number of FF processes 04FE9 0000001E 73 FFELPPROC VFD 30 number of FFLIST elements per process 74 04FEA DD9F8002 6 STAK 75 FREEFILE ENTRS PUSH 04FEB EC178801 6 BASE 76 STZ SP,FREEFILET indicate normal free file call 00004FEC 77 FREESHR LABEL 04FEC DC002ED0 78 CALL SGETMEM get a queue element 04FED 40440002 IMM 79 PARVL FFLOG 04FEE E412C000 0 3 REG 80 ST R0 R3 04FEF DCD3C000 7 REG 81 EXPCS R7 go get parameters 04FF0 C156C801 3 BASE 82 STPV R3,FFBLOCK save the free items root address 04FF1 C048C080 3 ZBM 83 STPVL R3,FFTYPE store structure to free 84 * \ / 85 86 ********************************************************************************** 87 * * 88 * Search the volume name list for this volume and count the * 89 * entry busy word. * 90 * * 91 ********************************************************************************** 92 93 * \ / 04FF2 6008C081 0 3 ZBM 94 LD R0 R3,FFDRIVE get drive number we'll be looking for 04FF3 60601F22 1 0 95 LD R1 VOLNTABLE(R0) get VOLN element pointer 04FF4 38164815 0 1 BASE 96 LEA R0 R1,VOLNBUSY make address of busy counter 04FF5 D0160400 0 @R 97 INC @R0 make the volume busy for this element 04FF6 E416C802 0 3 BASE 98 ST R0 R3,FFVOLBPTR save the address of the busy counter 99 * \ / 100 101 ********************************************************************************** 102 * * 103 * List element is prepared. Queue it and start the consumer * 104 * process if it is not already busy. * 105 * * 106 ********************************************************************************** 107 108 * \ / 04FF7 D0001D81 109 INC FFLISTSIZ indicate another list entry 04FF8 60441D7A 1 IMM 110 LD R1 ADR FFLOCK get the address of the list 04FF9 5C178801 6 BASE 111 CMZ SP,FREEFILET check for special free file call 04FFA FE025005 112 JEQ FREFILSHAR share some code to queue element 113 * \ / 04FFB E5178801 4 6 BASE 114 ST R4 SP,FREEFILET save callers R4 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1081 (SPROCSTART) F 54 System Process Start Routine 04FFC 61124000 4 1 REG 115 LD R4 R1 copy the control element pointer 116 PLOCK R4,FFCPCLOCK call to lock the file freers list 04FFD 0CC00000 116 IOFF 04FFE D1D70800 4 BASE 116 SETT R4,FFCPCLOCK 04FFF FE0C5001 116 JNE MA(2+DISPW MA 0) 05000 DC40308B 116 CALLNP LOCKWAIT 05001 60170801 0 4 BASE 117 LD R0 R4,FFCPCLIST load the current list pointer 05002 E408DF10 0 3 ZBM 118 ST R0 R3,FFLINK link after our list 05003 E4D70801 3 4 BASE 119 ST R3 R4,FFCPCLIST make our element new list head 05004 FE0E5010 120 JMP FREFILENS go share code 121 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1082 (SPROCSTART) F 54 System Process Start Routine 123 124 ********************************************************************************** 125 * * 126 * This routine is shared by the assorted consumer * 127 * process feeders to queue the element in the proper list and * 128 * start the consumer process if it is not busy. * 129 * * 130 * R1=>consumer process control triplet * 131 * R3=> list element * 132 * SP=> stack frame of size FREEFILES * 133 * JMP FREFILSHAR * 134 * * 135 ********************************************************************************** 136 00005005 137 FREFILSHAR LABEL 05005 EC08DF10 3 ZBM 138 STZ R3,0/FLDADRS clear the forward link 05006 E5178801 4 6 BASE 139 ST R4 SP,FREEFILET save R4 05007 61124000 4 1 REG 140 LD R4 R1 make R4 point to list control triplet 141 PLOCK R4,FFCPCLOCK call to lock the list 05008 0CC00000 141 IOFF 05009 D1D70800 4 BASE 141 SETT R4,FFCPCLOCK 0500A FE0C500C 141 JNE MA(2+DISPW MA 0) 0500B DC40308B 141 CALLNP LOCKWAIT 0500C 60040000 0 IMM 142 LD R0 0 0500D 38570801 1 4 BASE 143 LEA R1 R4,FFCPCLIST search the list pointed to 0500E 3C085F10 0 1 ZBM 144 LSRCH R0 R1,0/FLDADRS find the end of the list 0500F E4C85F10 3 1 ZBM 145 ST R3 R1,0/FLDADRS link element to the end of the list 146 * \ / 147 00005010 148 FREFILENS LABEL 05010 5C001C6B 149 CMZ BOOTFLAG are we still in the bootstrap? 05011 FE0C5018 150 JNE FREFILDN if so, don't start process 05012 65041D7A 4 IMM 151 CPR R4 ADR FFLOCK is this free file? 05013 FE02501C 152 JEQ CHKFFMANY if so, special check to allow more than one 05014 D1D70802 4 BASE 153 SETT R4,FFCPCBUSY see if consumer process already running 05015 FE025018 154 JEQ FREFILDN jump if process already running 155 * \ / 156 00005016 157 FREFILBLD LABEL 05016 60970806 2 4 BASE 158 LD R2 R4,FFCPCPROC get flag for the process to start 05017 FC801CF6 2 159 IORM R2 FLAGS tell the dispatcher to start it 160 * \ / 161 00005018 162 FREFILDN LABEL 163 PUNLOCK R4,FFCPCLOCK call to unlock the list 05018 EC170800 4 BASE 163 STZ R4,FFCPCLOCK 05019 0C800000 163 ION 0501A 61178801 4 6 BASE 164 LD R4 SP,FREEFILET restore R4 0501B 5D1F8002 6 STAK 165 LEAVE POP return 166 * --- 167 168 ********************************************************************************** 169 * * 170 * Due to its high usage there may be many free file processes. * 171 * Here we check to see how many there are and to add another if * 172 * needed. * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1083 (SPROCSTART) F 54 System Process Start Routine 173 * * 174 ********************************************************************************** 175 0000501C 176 CHKFFMANY LABEL 0501C 60001D81 0 177 LD R0 FFLISTSIZ R0 = number of elements in list 0501D 14004FE9 0 178 DIV R0 FFELPPROC divide by number of elements per process 0501E 18040001 0 IMM 179 ADD R0 1 R0 = number of processes required 0501F 64001D82 0 180 CPR R0 FFPROCS enough processes already exist? 05020 FE085018 181 JLT FREFILDN jump if enough 05021 60401D82 1 182 LD R1 FFPROCS get the number that there are now 05022 64404FE8 1 183 CPR R1 FFMAXPROC too many already? 05023 FE045018 184 JGT FREFILDN if so, don't make more 05024 FE0E5016 185 JMP FREFILBLD build a free file process 186 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1084 (SPROCSTART) F 54 System Process Start Routine 188 189 ********************************************************************************** 190 * * 191 * ACCTQUE is called when an accounting record is ready to be * 192 * put in the queue. We simply set up the pointers to the queue to * 193 * use and jump to some code sharing. * 194 * Call: * 195 * R3 = ADR accounting record * 196 * CALLNP ACCTQUE * 197 * Eats R0:R3. * 198 * Stack required = 3. See FREESPEC. * 199 * * 200 ********************************************************************************** 201 05025 DD5F8002 6 STAK 202 ACCTQUE ENTRNP PUSH 05026 60441D99 1 IMM 203 LD R1 ADR APLOCK make pointer to lock and list 05027 FE0E5005 204 JMP FREFILSHAR go share the queuer code 205 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1085 (SPROCSTART) F 54 System Process Start Routine 207 208 ********************************************************************************** 209 * * 210 * ACCTREQUE. Since the account logging files may be * 211 * busy, and since the account logger must be multi-threaded * 212 * ( as they say in IBMness ), when a busy file is found, * 213 * the accounting element is queued as a time element * 214 * waiting some amount of time and then coming here to get * 215 * requeued into the accounting list. * 216 * This routine call is from the clock interrupt routine * 217 * and R3 (the clock queue parameter) points to the element * 218 * to requeue. * 219 * * 220 ********************************************************************************** 221 05028 DD5F8002 6 STAK 222 ACCTREQUE ENTRNP PUSH 05029 60441D99 1 IMM 223 LD R1 ADR APLOCK R1 => accounting process control stuff 0502A D0401DA0 224 DEC APREQUE indicate one less requeued element 0502B FE0E5005 225 JMP FREFILSHAR link in and start process 226 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1086 (SPROCSTART) F 54 System Process Start Routine 228 229 ********************************************************************************** 230 * * 231 * PUTADT. This process provides a skeleton from which the * 232 * PUTFREEBLK routine may be called. We use this process because * 233 * we may not free blocks until the mass storage driver is done * 234 * with them, and when that occurs we are not running a * 235 * suspendable process. Therefore, when the DONEPPL routine * 236 * recognizes a block that has been freed ( by the PPPUTADT bit ) * 237 * it queues up an element to call this process. One special note * 238 * being that the volume that the ADT block is to be written has * 239 * its busy count incremented when the PPPUTADT bit is set and * 240 * NOT when we create the element here. * 241 * * 242 * Eats R0:R3 * 243 * Stack required: 3, See FREESPEC. * 244 * * 245 ********************************************************************************** 246 0502C DD1F8002 6 STAK 247 PUTADT ENTR PUSH 0502D C052C000 3 REG 248 STPVL R3 pick up the block number 0502E DC002ED0 249 CALL SGETMEM call for a piece of storage 0502F 40440001 IMM 250 PARVL PADTLOG indicate its length 05030 E4D60801 3 0 BASE 251 ST R3 R0,PADTBLOCK save block number in block 05031 60D20000 3 0 REG 252 LD R3 R0 place element pointer in proper register 05032 60441D83 1 IMM 253 LD R1 ADR PADTLOCK get pointer to the control triplet 05033 FE0E5005 254 JMP FREFILSHAR go share the queuer code 255 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1087 (SPROCSTART) F 54 System Process Start Routine 257 258 ********************************************************************************** 259 * * 260 * DISMOUNT * 261 * This subroutine is called whenever the busy count for * 262 * a volume goes to zero. All we check is if the VOLNAWAY * 263 * bit is set, indicating to dismount this volume. One * 264 * special note being that we also check the VOLNMOUNT bit, * 265 * which indicates somebody is already fooling with this * 266 * volume. Call: * 267 * * 268 * CALL DISMOUNT * 269 * PARVL * 270 * * 271 * Eats R0:R3 * 272 * Stack required = 3. See FREESPEC * 273 * * 274 ********************************************************************************** 275 05034 DD1F8002 6 STAK 276 DISMOUNT ENTR PUSH 05035 C0528000 2 REG 277 STPVL R2 get pointer to VOLN element 05036 5C088E10 2 ZBM 278 CMZ R2,VOLNMAIM is this volume maintenance mounted 05037 FE025047 279 JEQ NODISMNT jump if not 05038 DC003096 280 CALL LOCKLIST gain access to volume list 05039 40001F22 281 PARL VOLNLOCK lock associate with this list 0503A D1C88810 2 ZBM 282 SETT R2,VOLNAWAY is someone already fooling with 0503B FE025045 283 JEQ DISMNTXIT jump if we are too late 0503C DC0030A4 284 CALL UNLOCKLIST release hold on the list 0503D 40001F22 285 PARL VOLNLOCK lock to unlock 0503E DC002ED0 286 CALL SGETMEM get a chuck of memory 0503F 40440001 IMM 287 PARVL DMNTLOG log base 2 of the block size 05040 60D20000 3 0 REG 288 LD R3 R0 put element pointer in proper register 05041 60088086 0 2 ZBM 289 LD R0 R2,VOLNNUM get the volume number 05042 E416C801 0 3 BASE 290 ST R0 R3,DMNTVOLN and place into the element 05043 60441D8A 1 IMM 291 LD R1 ADR DMNTLOCK dismount control information 05044 FE0E5005 292 JMP FREFILSHAR go share code 293 * --- 294 00005045 295 DISMNTXIT LABEL 05045 DC0030A4 296 CALL UNLOCKLIST release the list 05046 40001F22 297 PARL VOLNLOCK 298 * \ / 299 00005047 300 NODISMNT LABEL 05047 5D1F8002 6 STAK 301 LEAVE POP just leave 302 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1088 (SPROCSTART) F 54 System Process Start Routine 304 305 ********************************************************************************** 306 * * 307 * ERRORLOG * 308 * This subroutine places an element into the error log * 309 * list and starts the process that will write it to mass * 310 * storage. It eats R0 thru R3 ( R0 thru R2 before fetching * 311 * the parameters ) and accepts a variable number of parameters * 312 * ( depending on the error ). * 313 * Note: this routine (or the process) needs to be fixed * 314 * so that FBI errors in the error log file don't create * 315 * an infinite number of calls! Also, a secondary log * 316 * file may be provided so that errors are not totally * 317 * lost when the first file goes bad. * 318 * Call: * 319 * SP => stack pointer * 320 * CALL ERRORLOG * 321 ** eats R0-R2 before PARMS are passed * 322 * PARV ERLCxxxx length and type * 323 * PARV param1 * 324 * ... * 325 * PARVL paramn * 326 * * 327 * Eats R0:R3. * 328 * Stack required: 3, See FREESPEC. * 329 * * 330 ********************************************************************************** 331 00178801 6 BASE 332 ERRORLOGT EQU FREEFILET temp for number of parameters 333 05048 DD1F8002 6 STAK 334 ERRORLOG ENTR PUSH 05049 E4178801 0 6 BASE 335 ST R0 SP,ERRORLOGT save the first parameter 0504A F22C504C 0 336 JBF R0/ERERROR NOTERROR jump if code for information rather than error 0504B D0001D98 337 INC ERRLOGCNT indicate that another error occurred 0000504C 338 NOTERROR LABEL 0504C 604A2250 1 0 CBM 339 LD R1 R0/ERLLEN get the number of parameters 0504D 5C565002 1 REG 340 HIB R1+ERLFUNK calculate size of block to hold it 0504E 70920000 2 0 REG 341 LDN R2 R0 copy result of HIB 0504F DC002ED0 342 CALL SGETMEM get a block for the error 05050 40569020 2 REG 343 PARVL R2+WORDLNTH specify its size 05051 60520000 1 0 REG 344 LD R1 R0 copy pointer to R1 05052 E0178801 0 6 BASE 345 EXCH R0 SP,ERRORLOGT save pointer and get back R0 05053 708A2250 2 0 CBM 346 LDN R2 R0/ERLLEN get number of parameters 05054 10528000 1 2 REG 347 SUB R1 R2 05055 C15C5002 12 BASE 348 ERRLOGLOOP STPV R1,ERLFUNK(R2) fetch for each of the parameters 05056 FAA05055 2 349 IRJ R2 ERRLOGLOOP process each parameter 05057 C0564802 1 BASE 350 STPVL R1,ERLFUNK store the last parameter 05058 60D78801 3 6 BASE 351 LD R3 SP,ERRORLOGT get element pointer in R3 05059 6016C802 0 3 BASE 352 LD R0 R3,ERLFUNK 0505A E408C0F0 0 3 ZBM 353 ST R0 R3,ERLTYPE place code in right place 0505B DC404549 354 CALLNP GETDATE get the current time 0505C E616C801 013 BASE 355 ST2 R0 R3,ERLDATE and time stamp the entry 0505D 60441D91 1 IMM 356 LD R1 ADR ERRLOGLOCK make pointer to list and lock 0505E FE0E5005 357 JMP FREFILSHAR place in list and set consumer process running 358 * --- 359 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1089 (SPROCSTART) F 54 System Process Start Routine 360 END FREESPEC, FREEFILE, ACCTQUE, PUTADT, ERRORLOG, DISMOUNT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1090 (SPROCSTART) F 54 System Process Start Routine 362 363 ********************************************************************************** 364 * * 365 * ACCOUNT * 366 * This routine is called on the occurrence of * 367 * various events of significance to accounting and * 368 * auditing. We get an empty element to use for the * 369 * accounting file entry, set the type, length, and * 370 * time fields, then return to the caller to allow him * 371 * to finish building the element. * 372 * Call: * 373 * SP => stack pointer * 374 * CALL ACCOUNT * 375 ** Eats R0, R1, and R3 before the parameters are passed. * 376 * PARV type code * 377 * PARV length of record in chars * 378 * PARVL * 379 * * 380 * Eats R0:R3. * 381 * Stack required = 2 * 382 * 1 + max ( GETDATE (1), SGETMEM (0), ZEROIT (1) ) * 383 * * 384 ********************************************************************************** 385 386 BLOCK ACCOUNT subroutine 387 ENTRY ACCOUNT 388 389 BEGFRAME 390 ENDFRAME 391 0505F DD9F8001 6 STAK 392 ACCOUNT ENTRS PUSH 05060 DC002ED0 393 CALL SGETMEM call for a piece of storage 05061 40440004 IMM 394 PARVL APLOG of this length 05062 60D20000 3 0 REG 395 LD R3 R0 copy the block pointer 05063 DC003090 396 CALL ZEROIT clean up our block 05064 41160800 0 BASE 397 PAR R0,0 where the block is 05065 4044000E IMM 398 PARVL APLNTH how much to zero 399 05066 DCD3C000 7 REG 400 EXPCS R7 get the parameters 05067 C148C051 3 ZBM 401 STPV R3,APRECORD/AFRTYPE first parameter is type 05068 C148DF11 3 ZBM 402 STPV R3,APRECORD/AFRLEN save the length 05069 C048C050 3 ZBM 403 STPVL R3,APWHOGETS put in the bits indicating where to file this entry 404 0506A D148CAA1 3 ZBM 405 STMW R3,APRECORD/AFRPORTNUM assume no port 0506B DC404549 406 CALLNP GETDATE get the current time 0506C E616C806 013 BASE 407 ST2 R0 R3,APRECORD/AFRTIME tell when event occurred 0506D 5D1F8001 6 STAK 408 LEAVE POP 409 * --- 410 411 END of ACCOUNT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1091 (SPROCSTART) F 54 System Process Start Routine 413 414 415 ********************************************************************************** 416 * * 417 * SUBSTITUTE * 418 * This subroutine is called only by the disk driver * 419 * when a recoverable error ( data intact ) has occurred * 420 * during a disk read or write operation. The actual disk * 421 * block substitution does not happen here, because in * 422 * order to get a new block for the substitution, a call * 423 * to GETFREEBLK is required, and this routine may suspend * 424 * the caller ( disk driver ). Please note the following, * 425 * they are crucial to substitution process. * 426 * * 427 * - The PPL busy count is incremented. This guarantees * 428 * that the block will remain RESIDENT until the count * 429 * reaches zero. Note that the decrement will happen * 430 * within the actual substitution process. * 431 * * 432 * - A substitution queue element is created and linked * 433 * onto the list contained in the VOLN element. * 434 * * 435 * - If a substitution process does not already exists then * 436 * one is created. * 437 * * 438 * Call: * 439 * LD PPL <=> PPAGE element> * 440 * CALLNP SUBSTITUTE * 441 * * 442 * Eats R0:R2. * 443 * Stack required = 7 * 444 * 4 + max ( BLDPROCESS (2), LOCKWAIT (0), MAPINMEM (3), * 445 * SETRUNNING (2), SGETMEM (0), TRACEPROC(3) ) * 446 * * 447 ********************************************************************************** 448 449 BLOCK SUBSTITUTE and UNSUBS subroutines 450 ENTRY SUBSTITUTE substitute a block 451 ENTRY UNSUBS unsubstitute a block 452 453 BEGFRAME stack frame for SUBSTITUTE and UNSUBS 00178801 6 BASE 454 SUBSR34 BSS 2 save area for R3,R4 00178803 6 BASE 455 SUBSBLK BSS 1 block number to (un)substitute 456 ENDFRAME 457 0506E DD5F8004 6 STAK 458 SUBSTITUTE ENTRNP PUSH 0506F 60490081 1 4 ZBM 459 LD R1 PPL,PPBLOCK/VOLFIELD fetch the volume number 05070 FA4250B2 1 460 JEQZ R1 RETURN jump if no volume number given 05071 60621F22 1 1 461 LD R1 VOLNTABLE(R1) get the VOLN ptr 05072 5C084A10 1 ZBM 462 CMZ R1,VOLNMOUNT is this volume mounted? 05073 FE0C50B2 463 JNE RETURN do not substitute if not 05074 5C087181 1 ZBM 464 CMZ R1,VOLNSUBBLK substitutions allowed on this volume 05075 FE0250B2 465 JEQ RETURN no subs block, skip starting this process 05076 60893461 2 4 ZBM 466 LD R2 PPL,PPBLOCK/PPHASHFLD get proper hash code 467 PLOCK PPAGELOCK(R2) lock the list 05077 0CC00000 467 IOFF 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1092 (SPROCSTART) F 54 System Process Start Routine 05078 D1E41E21 2 467 SETT PPAGELOCK(R2) 05079 FE0C507B 467 JNE MA(2+DISPW MA 0) 0507A DC40308B 467 CALLNP LOCKWAIT 0507B D0170802 4 BASE 468 INC PPL,PPBUSYWORD say we are using it 469 PUNLOCK PPAGELOCK(R2) release the list 0507C EC241E21 2 469 STZ PPAGELOCK(R2) 0507D 0C800000 469 ION 0507E 60170801 0 4 BASE 470 LD R0 PPL,PPBLOCK 0507F E4178803 0 6 BASE 471 ST R0 SP,SUBSBLK save block number 05080 EC0BC010 7 CBM 472 STZ R7/BIT 0 flag for substitute 05081 FE0E5085 473 JMP SUBSCOMMON go to common routine 474 * --- 475 476 ********************************************************************************** 477 * * 478 * UNSUBS * 479 * This routine initiates the unsubstitution of a * 480 * substituted block. PUTFREEBLK calls this routine if * 481 * the MS address being freed is in the global substitution * 482 * list. Since the address is no longer in use and the bad * 483 * block is already in the bad tracks list, this process just * 484 * removes the substitution list entry and returns the good * 485 * block to the ADT. This is done in a separate process from * 486 * PUTFREEBLK (PUTADT) so that it can suspend. * 487 * * 488 * Call: * 489 * CALL UNSUBS * 490 * PARVL block number (including volume) * 491 * * 492 * Eats R0:R2. * 493 * Stack required = 7, See SUBSTITUTE. * 494 * * 495 ********************************************************************************** 496 05082 DD1F8004 6 STAK 497 UNSUBS ENTR PUSH 05083 C0578803 6 BASE 498 STPVL SP,SUBSBLK save block number 05084 EDCBC010 7 CBM 499 STW R7/BIT 0 flag for unsubstitute 500 * \ / 501 00005085 502 SUBSCOMMON LABEL 05085 E6D78801 346 BASE 503 ST2 R3 SP,SUBSR34 save bothersome registers 05086 DC002ED0 504 CALL SGETMEM get a substitution queue element 05087 40440001 IMM 505 PARVL SUBQLOG size of element 05088 EC160800 0 BASE 506 STZ R0,SUBQWORDA clear request code and chain link 05089 604BC010 1 7 CBM 507 LD R1 R7/BIT 0 get request code 0508A E4480080 1 0 ZBM 508 ST R1 R0,SUBQREQ save it 0508B 60920000 2 0 REG 509 LD R2 R0 R2 = ADR SUBQ element 0508C 60178803 0 6 BASE 510 LD R0 SP,SUBSBLK 0508D E4168801 0 2 BASE 511 ST R0 R2,SUBQBLOCK save block number 512 TRACE SUBSTRACE,SUBTELEM 0508E 5D401D32 512 XCT TRACECALL(SUBSTRACE) 0508F FEC000C2 512 NOP (SUBSTRACE*BITS 22:26)+(SUBTELEM*BITS 27:31) 513 05090 60088081 0 2 ZBM 514 LD R0 R2,SUBQBLOCK/VOLFIELD R0 = volume number 05091 61201F22 4 0 515 LD VLN VOLNTABLE(R0) get the VOLN element pointer 516 PLOCK (VLN,VOLNSUBQL) lock the substitution queue 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1093 (SPROCSTART) F 54 System Process Start Routine 05092 0CC00000 516 IOFF 05093 D1D7080B 4 BASE 516 SETT (VLN,VOLNSUBQL) 05094 FE0C5096 516 JNE MA(2+DISPW MA 0) 05095 DC40308B 516 CALLNP LOCKWAIT 05096 60040000 0 IMM 517 LD R0 0 value of nil pointer 05097 3857080A 1 4 BASE 518 LEA R1 VLN,VOLNSUBQ address of list pointer 05098 3C085F10 0 1 ZBM 519 LSRCH R0 R1,SUBQLINK R1 = ADR last element on list (can't fail) 05099 E4885F10 2 1 ZBM 520 ST R2 R1,SUBQLINK put new element at end of list 521 PUNLOCK (VLN,VOLNSUBQL) unlock the list 0509A EC17080B 4 BASE 521 STZ (VLN,VOLNSUBQL) 0509B 0C800000 521 ION 522 0509C 5C001C6B 523 CMZ BOOTFLAG are we still in the bootstrap 0509D FE0C50B1 524 JNE SUBSDONE don't start process if booting 525 SETTBIT VLN,VOLNSBFLAG say substitution process exists 0509E 60022000 0 IMM 525 LD R0 1*BIT(((VLN,VOLNSBFLAG) DISP (VLN,0))/BITS 0:4) 0509F FC170800 0 4 BASE 525 IORM R0 VLN,(((VLN,VOLNSBFLAG) DISP (VLN,0))/BITS 15:31) 050A0 FE0250B1 526 JEQ SUBSDONE jump if already existed 050A1 D0170815 4 BASE 527 INC VLN,VOLNBUSY subs process is using volume 050A2 0CC00000 528 IOFF disallow any interrupts 050A3 DC0035D2 529 CALL BLDPROCESS build the process 050A4 4144F1F0 IMM 530 PARV MONMSR runs in monitor state 050A5 434050B3 531 PARV2 RADSUBNAME pass the process name 050A6 414453AC IMM 532 PARV ADR SUBSPROC initial PC 050A7 40440001 IMM 533 PARVL 1 it is a system process 050A8 6088DF10 2 3 ZBM 534 LD R2 R3,PSCACHN R2 = ADR process's console area 050A9 60098083 0 6 ZBM 535 LD R0 SP,SUBSBLK/VOLFIELD 050AA E4168806 0 2 BASE 536 ST R0 R2,CAR4 initialize process's R4 537 TRACE SUBSTRACE,SUBTBPROC 050AB 5D401D32 537 XCT TRACECALL(SUBSTRACE) 050AC FEC000C3 537 NOP (SUBSTRACE*BITS 22:26)+(SUBTBPROC*BITS 27:31) 050AD DC402B99 538 CALLNP SETRUNNING set process running 050AE DC0025EB 539 CALL MAPINMEM re-map original caller 050AF 40400412 540 PARVL CPPSA pointer to his PSA 050B0 0C800000 541 ION restore interrupts 000050B1 542 SUBSDONE LABEL 050B1 62D78801 346 BASE 543 LD2 R3 SP,SUBSR34 restore bothersome registers 000050B2 544 RETURN LABEL 050B2 5D1F8004 6 STAK 545 LEAVE POP and return 546 * --- 547 050B3 B674FA67 548 RADSUBNAME PAK12 SYS_SUBSPROC 549 550 END SUBSTITUTE and UNSUBS subroutines 551 552 END PROCSTART routines that start other processes 98 INPUT SYSPROCESS system housekeeping processes 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1094 (SYSPROCESS) F 55 Disk Structure Freeing Process 3 4 BLOCK System Processes 5 6 ENTRY DMNTSTRT volume dismount 7 ENTRY ELPRESTART error logger 8 ENTRY FFPRESTART freefiler 9 ENTRY PADTRSTRT ADT get/put 10 ENTRY PATCHPROC CPU u-code patch 11 ENTRY REMOVECPU disengage CPU 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1095 (SYSPROCESS) F 55 Disk Structure Freeing Process 13 14 BLOCK SYS_FREEFILE process 15 16 ENTRY FFPRESTART 17 18 ********************************************************************************** 19 * * 20 * This separate process runs whenever there is an element * 21 * in the list of structures to be freed. This process takes * 22 * elements off of the list and sets each free block to ones. * 23 * The mass storage driver is told to free the blocks after * 24 * they have been written out. * 25 * * 26 ********************************************************************************** 27 000050B5 28 FFPTMPP BASE R5 temp area used by free file process 29 BSS FFLNTH first is like queue element 00094183 5 ZBM 30 LASTBLOCK BSSB MSBLKLOG last block referenced 00097183 5 ZBM 31 MAJORACS BSSB MSBLKLOG major access 00096184 5 ZBM 32 MINORACS BSSB MSBLKLOG minor access block of subtree 00174015 5 CACH 33 MINACSTYP BSSB 8 type of minor access block freeing 34 DRCT 00000003 ABS 35 FFTEMPLOG EQU (DISP FFPTMPP) LOG 2 36 ORG FFPTMPP 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1096 (SYSPROCESS) F 55 Disk Structure Freeing Process 38 39 ********************************************************************************** 40 * * 41 * SYS_FREEFILE - free file process * 42 * * 43 * Stack required = 11. WARNING!!! See STACKSIZE below. * 44 * 0 + max ( DISMOUNT (3), DODIR (11), ERRORLOG (3), * 45 * FREEFILE (3), FREESTACK (0), GETSTACK (0), * 46 * GRUBWNDOx (7), LIQUIDATE (7), LOCKWAIT (0), * 47 * MAPOUTFBI (2), RAFSUBTREE (11), SETWNDOx (4), * 48 * SFREEMEM (0), SGETMEM (0), ZOTBLOCK (8), * 49 * ZOTRAFBLK (10) ) * 50 * * 51 ********************************************************************************** 52 53 BLOCK SYS_FREEFILE process 54 ENTRY FFPRESTART 55 0000000F ABS 56 STACKSIZE EQU 15 size of stack to get 57 000050B5 58 FFPRESTART LABEL 050B5 DC00286A 59 CALL GETSTACK acquire a stack 050B6 4044000F IMM 60 PARVL STACKSIZE 050B7 61440000 5 IMM 61 LD R5 0 no temp allocated 62 * \ / 63 000050B8 64 FFPAGAIN LABEL the loop -- get the next structure 65 PLOCK FFLOCK lock the free file list => lock word 050B8 0CC00000 65 IOFF 050B9 D1C01D7A 65 SETT FFLOCK 050BA FE0C50BC 65 JNE MA(2+DISPW MA 0) 050BB DC40308B 65 CALLNP LOCKWAIT 050BC 61001D7B 4 66 LD R4 FFLIST get pointer to a structure 050BD FB30518A 4 67 JZA R4 FFPDONE jump if nothing to do 050BE 60091F10 0 4 ZBM 68 LD R0 R4,FFLINK get pointer to next one 050BF E4001D7B 0 69 ST R0 FFLIST unlink ours 050C0 D0401D81 70 DEC FFLISTSIZ one less element in list 71 PUNLOCK FFLOCK unlock the free file list => lock word 050C1 EC001D7A 71 STZ FFLOCK 050C2 0C800000 71 ION 72 * \ / 73 74 ********************************************************************************** 75 * * 76 * A structure to free has been found. See if our temp * 77 * region has been allocated. * 78 * * 79 ********************************************************************************** 80 81 * \ / 050C3 FB7250C7 5 82 JNZA R5 FFPTMPGOT jump if already allocated 050C4 DC002ED0 83 CALL UGETMEM get our temp area 050C5 40440003 IMM 84 PARVL FFTEMPLOG 050C6 E4134000 0 5 REG 85 ST R0 R5 000050C7 86 FFPTMPGOT LABEL 050C7 60130000 0 4 REG 87 LD R0 R4 get pointer to the free file queue element 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1097 (SYSPROCESS) F 55 Disk Structure Freeing Process 050C8 6044000C 1 IMM 88 LD R1 FFLNTH*CPW get the length of the information 050C9 60934000 2 5 REG 89 LD R2 R5 get pointer to this process temp element 050CA FE400000 90 CMOVE copy the freeing information 050CB DC002F5D 91 CALL SFREEMEM free the queue element 050CC 41440002 IMM 92 PARV FFLOG 050CD 40530000 4 REG 93 PARVL R4 050CE EC094183 5 ZBM 94 STZ R5,LASTBLOCK last block was not there 050CF 60094080 0 5 ZBM 95 LD R0 R5,FFTYPE get the type we're freeing 050D0 64040016 0 IMM 96 CPR R0 FFTMAX reasonable value? 050D1 FE0850D3 97 JLT FFPDOIT jump if good 050D2 001310B0 98 HALT HALTS10B0 passed garbage for type to free 99 * --- 100 000050D3 101 FFPDOIT LABEL 050D3 60574801 1 5 BASE 102 LD R1 R5,FFBLOCK R1 holds block number 050D4 5CA050D5 0 103 LDPC FFPSTRUCT(R0) 104 * --- 105 000050D5 106 FFPSTRUCT LABEL 050D5 00005133 107 ADR FFPUNKNOWN 000 - type of block unknown 050D6 0000513B 108 ADR FFPSINGLE 001 - pack label 050D7 0000513B 109 ADR FFPSINGLE 002 - bad trax list 050D8 0000513B 110 ADR FFPSINGLE 003 - bootstrap 050D9 0000513B 111 ADR FFPSINGLE 004 - volume label 050DA 0000513B 112 ADR FFPSINGLE 005 - substitution list 050DB 0000513B 113 ADR FFPSINGLE 006 - security block 050DC 0000513B 114 ADR FFPSINGLE 007 - single ADT block 050DD 0000513B 115 ADR FFPSINGLE 008 - IDX block 050DE 00005147 116 ADR FFPDIR 009 - UDIR and subsidiary elements 050DF 0000516F 117 ADR FFPUDIR2 00A - UDIR2 and subsidiary elements 050E0 00005146 118 ADR FFPSYS 00B - swapping block 050E1 000050EB 119 ADR FFPSAF 00C - entire SAF 050E2 00005115 120 ADR FFPLRAF 00D - RAF major access and subsidiary elements 050E3 0000510D 121 ADR FFPSRAF 00E - RAF minor access and subsidiary data blocks 050E4 0000513B 122 ADR FFPSINGLE 00F - RAF data block 050E5 0000513B 123 ADR FFPSINGLE 010 - AFT 050E6 0000513B 124 ADR FFPSINGLE 011 - account share list block 050E7 0000513B 125 ADR FFPSINGLE 012 - file share list block 050E8 00005111 126 ADR FFPCODE 013 - CCB and subsidiary blocks 050E9 0000513B 127 ADR FFPSINGLE 014 - code data block 050EA 0000513B 128 ADR FFPSINGLE 015 - auth list block 00000016 ABS 129 FFTMAX EQU DISPW FFPSTRUCT size of the table 130 131 ********************************************************************************** 132 * * 133 * Free a sequential file. * 134 * * 135 ********************************************************************************** 136 000050EB 137 FFPSAF LABEL 050EB 5C095181 5 ZBM 138 CMZ R5,FFMSBLK another block to free 050EC FE025185 139 JEQ FFPFREED jump if none 050ED DC003205 140 CALL SETWNDO1 get this block in 050EE 41440002 IMM 141 PARV VPCNTLLK+VPCNTLW 050EF 41440000 IMM 142 PARV VPNOFCB indicate no lun associated with us 050F0 410050FC 143 PAR FFBWERROR 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1098 (SYSPROCESS) F 55 Disk Structure Freeing Process 050F1 41574801 5 BASE 144 PARV R5,FFBLOCK 050F2 4044067F IMM 145 PARVL FBITSAF*VPFBIOLDB+FBITFREE*VPFBINEWB 050F3 60095181 0 5 ZBM 146 LD R0 R5,FFMSBLK get current block number 050F4 E0094183 0 5 ZBM 147 EXCH R0 R5,LASTBLOCK exchange with the last block 050F5 FA0250F8 0 148 JEQZ R0 FFPFILEBG jump if no last block to check 050F6 64089182 0 2 ZBM 149 CPR R0 R2,FBIBLINK check backward link 050F7 FE0C5102 150 JNE FFPFILEE jump if bad link 000050F8 151 FFPFILEBG LABEL 050F8 60089180 0 2 ZBM 152 LD R0 R2,FBIFLINK 050F9 E4095181 0 5 ZBM 153 ST R0 R5,FFMSBLK save forward link 050FA DC4051B2 154 CALLNP ZOTBLOCK make the block free, unmaps FBI 050FB FE0E50EB 155 JMP FFPSAF 156 * --- 157 158 * Error in referencing the block 000050FC 159 FFBWERROR LABEL 050FC DC40261B 160 CALLNP MAPOUTFBI unmap FBI, ION 050FD DC403150 161 CALLNP GRUBWNDO1 release this window 050FE DC005048 162 CALL ERRORLOG out with an error message 050FF 4144060A IMM 163 PARV ERLCFSAF error while freeing .SAF 05100 40574801 5 BASE 164 PARVL R5,FFBLOCK indicate the ms address 05101 FE0E5185 165 JMP FFPFREED fake like we're done 166 * --- 167 168 * Links bad on freeing sequential file - error message 00005102 169 FFPFILEE LABEL 05102 E4094183 0 5 ZBM 170 ST R0 R5,LASTBLOCK save the block number 05103 61089182 4 2 ZBM 171 LD R4 R2,FBIBLINK get the back pointer 05104 DC40261B 172 CALLNP MAPOUTFBI unmap FBI, ION 05105 60840000 2 IMM 173 LD R2 0 DEBUG safety, kill pointer 05106 DC403150 174 CALLNP GRUBWNDO1 release the block 05107 DC005048 175 CALL ERRORLOG queue up an error message 05108 41440E09 IMM 176 PARV ERLCBLNK indicate type of error 05109 41574801 5 BASE 177 PARV R5,FFBLOCK indicate the ms address 0510A 41494183 5 ZBM 178 PARV R5,LASTBLOCK ms address of who pointed here 0510B 40530000 4 REG 179 PARVL R4 and our backward link 0510C FE0E5185 180 JMP FFPFREED fake like we're done 181 * --- 182 183 184 ********************************************************************************** 185 * * 186 * Free a small RAF. * 187 * * 188 ********************************************************************************** 189 0000510D 190 FFPSRAF LABEL 0510D DC0051CC 191 CALL RAFSUBTREE free the structure 0510E 4144000E IMM 192 PARV FBITSRAF 0510F 40495181 5 ZBM 193 PARVL R5,FFMSBLK 05110 FE0E5185 194 JMP FFPFREED get next structure to free 195 * --- 196 197 198 ********************************************************************************** 199 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1099 (SYSPROCESS) F 55 Disk Structure Freeing Process 200 * Free a CODE file. * 201 * * 202 ********************************************************************************** 203 00005111 204 FFPCODE LABEL 05111 DC0051CC 205 CALL RAFSUBTREE free the structure 05112 41440013 IMM 206 PARV FBITCCB 05113 40495181 5 ZBM 207 PARVL R5,FFMSBLK 05114 FE0E5185 208 JMP FFPFREED find next thing to free 209 * --- 210 211 212 ********************************************************************************** 213 * * 214 * Free a large RAF * 215 * * 216 ********************************************************************************** 217 00005115 218 FFPLRAF LABEL 05115 60095181 0 5 ZBM 219 LD R0 R5,FFMSBLK 05116 E4097183 0 5 ZBM 220 ST R0 R5,MAJORACS save the major access block number 05117 DC003205 221 CALL SETWNDO1 get the major access block in 05118 41440001 IMM 222 PARV VPCNTLRO indicate read only 05119 41440000 IMM 223 PARV VPNOFCB indicate no lun associated with us 0511A 41005131 224 PAR FFPLRAFMER pass the error return address 0511B 41574801 5 BASE 225 PARV R5,FFBLOCK pass the MS address 0511C 4044000D IMM 226 PARVL FBITLRAF indicate type of block expected 0511D 610403FF 4 IMM 227 LD R4 WPP-1 number of pointers in an access block 0000511E 228 FFPLRAFLP LABEL 0511E 60280800 0 4 229 LD R0 WNDO1(R4) get a possible pointer 0511F 7800254F 0 230 AND R0 MSBLKMASK isolate a clean block number 05120 FA025125 0 231 JEQZ R0 FFPLRAFEL jump if no block indicated 05121 E4095181 0 5 ZBM 232 ST R0 R5,FFMSBLK make complete MS address of minor access block 05122 DC004FEA 233 CALL FREEFILE call to free the subtree 05123 41574801 5 BASE 234 PARV R5,FFBLOCK indicate MS address 05124 4044000E IMM 235 PARVL FBITSRAF and type 00005125 236 FFPLRAFEL LABEL 05125 FB26511E 4 237 JDR R4 FFPLRAFLP try next pointer or quit 238 * \ / 239 05126 60097183 0 5 ZBM 240 LD R0 R5,MAJORACS 05127 E4095181 0 5 ZBM 241 ST R0 R5,FFMSBLK restore the address in major block 05128 DC003205 242 CALL SETWNDO1 get the block in locked 05129 41440002 IMM 243 PARV VPCNTLW+VPCNTLLK this time with write access 0512A 41440000 IMM 244 PARV VPNOFCB indicate no lun associated with us 0512B 41005130 245 PAR FFPLRAFMR1 0512C 41574801 5 BASE 246 PARV R5,FFBLOCK 0512D 404406FF IMM 247 PARVL FBITLRAF*VPFBIOLDB+FBITFREE*VPFBINEWB 0512E DC4051B2 248 CALLNP ZOTBLOCK free the major access block, unmaps FBI 0512F FE0E5185 249 JMP FFPFREED 250 * --- 251 252 * Error referencing the major access block 253 00005130 254 FFPLRAFMR1 LABEL 05130 DC40261B 255 CALLNP MAPOUTFBI unmap FBI, ION 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1100 (SYSPROCESS) F 55 Disk Structure Freeing Process 00005131 256 FFPLRAFMER LABEL 05131 DC403150 257 CALLNP GRUBWNDO1 release grip on this window 258 * Error message out 05132 FE0E5185 259 JMP FFPFREED 260 * --- 261 262 263 ********************************************************************************** 264 * * 265 * Free a single block of unspecified type. We use the control * 266 * bit that causes the disk driver to forego any FBI checking * 267 * so this may be used to free very screwed up blocks. * 268 * * 269 ********************************************************************************** 270 00005133 271 FFPUNKNOWN LABEL 05133 DC003205 272 CALL SETWNDO1 get the block in core 05134 4144001A IMM 273 PARV VPCNTLLK+VPCNTLNR locked and dont actually read page 05135 41440000 IMM 274 PARV VPNOFCB indicate no lun associated with us 05136 41005182 275 PAR FFPBLKBAD if the block comes in bad 05137 41574801 5 BASE 276 PARV R5,FFBLOCK 05138 40440000 IMM 277 PARVL 0 indicate that the FBI is not to be checked 05139 DC4051B2 278 CALLNP ZOTBLOCK make the block virgin, unmaps FBI 0513A FE0E5185 279 JMP FFPFREED try for another 280 * --- 281 282 283 ********************************************************************************** 284 * * 285 * Routine to free a single block. The FBI type of the * 286 * block is the same as the structure type that we were told * 287 * to free. * 288 * * 289 ********************************************************************************** 290 0000513B 291 FFPSINGLE LABEL 0513B DC003205 292 CALL SETWNDO1 make the block resident 0513C 41440002 IMM 293 PARV VPCNTLLK+VPCNTLW locked and writable 0513D 41440000 IMM 294 PARV VPNOFCB indicate no lun associated with us 0513E 41005182 295 PAR FFPBLKBAD if the block comes in bad 0513F 41574801 5 BASE 296 PARV R5,FFBLOCK specify MS address 05140 60094080 0 5 ZBM 297 LD R0 R5,FFTYPE get the current block type 05141 600A0E00 0 0 CBM 298 LD R0 R0*VPFBIOLDB move to old type position 05142 1804007F 0 IMM 299 ADD R0 FBITFREE*VPFBINEWB indicate the new type 05143 40520000 0 REG 300 PARVL R0 pass the FBI type indicating conversion 05144 DC4051B2 301 CALLNP ZOTBLOCK make the block virgin, unmaps FBI 05145 FE0E5185 302 JMP FFPFREED try for another element 303 * --- 304 305 ********************************************************************************** 306 * * 307 * Request to free a swapping block. Execution should * 308 * never get here because swapping blocks need never be * 309 * written out since they cannot be part of any * 310 * MS structure. The security problems are insignificant, since * 311 * even if one becomes part of a file ( which can happen in a * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1101 (SYSPROCESS) F 55 Disk Structure Freeing Process 312 * crash ), the FBI type would not match when it was read in. * 313 * The routine that finds a swapping block free will set * 314 * the PPUTADT bit in the PPL and then release its PAL which * 315 * will cause the block number to become free without any * 316 * more mass storage transfers. * 317 * * 318 ********************************************************************************** 319 00005146 320 FFPSYS LABEL 05146 001310B2 321 HALT HALTS10B2 FREEFILE called to free swapping block 322 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1102 (SYSPROCESS) F 55 Disk Structure Freeing Process 324 325 ********************************************************************************** 326 * * 327 * Free a UDIR * 328 * Section to get rid of a UDIR. If the directory is * 329 * a small type, we call DODIR to dump the files, then * 330 * free the rest. If a large dir, we free all of the * 331 * UDIR2 elements, then free the rest. * 332 * * 333 ********************************************************************************** 334 00005147 335 FFPDIR LABEL 05147 E4496184 1 5 ZBM 336 ST R1 R5,MINORACS save address of UDIR 05148 DC0031FF 337 CALL SETWNDO2 get in the UDIR1 block 05149 41440001 IMM 338 PARV VPCNTLRO only reading this time 0514A 41440000 IMM 339 PARV VPNOFCB indicate no lun associated with us 0514B 41005160 340 PAR UD1MSER error address 0514C 41574801 5 BASE 341 PARV R5,FFBLOCK pass the MS address 0514D 40440009 IMM 342 PARVL FBITUDIR1 indicate type of block 0514E 60C40C00 3 IMM 343 LD R3 ADR WNDO2 get address of block 0514F 61040C60 4 IMM 344 LD R4 ADR WNDO2(UDFDLIST) point to FD or index part 05150 5C08C01A 3 ZBM 345 CMZ R3,UDTYPE check to see if small or large 05151 FE0C5165 346 JNE BIGDIR jump if large - free UDIR2 blocks 05152 DC405194 347 CALLNP DODIR small dir - free all files 00005153 348 DIRSHL LABEL 05153 60800C3C 2 349 LD R2 WNDO2(UDSHLLIST)/SHLFLAGW check for MS resident share list 05154 F2805157 2 350 JBF R2/SHLDSKFLGB NOSHLIST jump if none on MS 05155 DC0051EE 351 CALL ZOTRAFBLK call to dump the block 05156 40440011 IMM 352 PARVL FBITASLB type is account share list 00005157 353 NOSHLIST LABEL 05157 60800C40 2 354 LD R2 WNDO2(UDAUTHLIST) check for auth list 05158 FA82515B 2 355 JEQZ R2 NOAUTHLIST jump if not 356 * (should be released before here by destroy account) 05159 DC0051EE 357 CALL ZOTRAFBLK destroy a single block 0515A 40440015 IMM 358 PARVL FBITAUTLB indicate its type 0000515B 359 NOAUTHLIST LABEL 0515B 60896184 2 5 ZBM 360 LD R2 R5,MINORACS get address of this UDIR 0515C DC0051EE 361 CALL ZOTRAFBLK destroy it 0515D 40440009 IMM 362 PARVL FBITUDIR1 indicate type 0515E DC403153 363 CALLNP GRUBWNDO2 release the window 0515F FE0E5185 364 JMP FFPFREED jump off, structure completed 365 * --- 366 00005160 367 UD1MSER LABEL MS error in block 05160 DC403153 368 CALLNP GRUBWNDO2 free up the window 05161 DC005048 369 CALL ERRORLOG call to log the error 05162 4144060B IMM 370 PARV ERLCFUD1 pass error code 05163 40574801 5 BASE 371 PARVL R5,FFBLOCK indicate MS address in error 05164 FE0E5185 372 JMP FFPFREED pretend success 373 * --- 374 375 ********************************************************************************** 376 * * 377 * We have the UDIR1 of a large DIR in window 2. * 378 * Call FREEFILE for each of the UDIR2 blocks in it. * 379 * We don't use FREESPEC here. This way, we get rid * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1103 (SYSPROCESS) F 55 Disk Structure Freeing Process 380 * of UDIR1 blocks as rapidly as possible (good, since * 381 * they can be confusing on a system rebuild). * 382 * * 383 ********************************************************************************** 384 00005165 385 BIGDIR LABEL 00005165 386 NEXTINDX LABEL 05165 60C91183 3 4 ZBM 387 LD R3 R4,UDINDXADR get the MS address of the next block 05166 FAC25153 3 388 JEQZ R3 DIRSHL jump if end of UDIR1 index 05167 E4C95181 3 5 ZBM 389 ST R3 R5,FFMSBLK combine with volume 05168 DC004FEA 390 CALL FREEFILE call to free the structure 05169 41574801 5 BASE 391 PARV R5,FFBLOCK pass the MS address 0516A 4044000A IMM 392 PARVL FBITUDIR2 and type 0516B 19040005 4 IMM 393 ADD R4 UDINDXLEN advance to next UDIR1 index entry 0516C 65040FF8 4 IMM 394 CPR R4 ADR WNDO2(UD1LINDX) check for done 0516D FE0A5165 395 JLE NEXTINDX jump back if more elements 0516E FE0E5153 396 JMP DIRSHL go free up account share list and UDIR1 397 * --- 398 399 ********************************************************************************** 400 * * 401 * Free a UDIR2 * 402 * Section called to destroy all of the entries in a UDIR2 * 403 * by calling FREESPEC for each file in it. Afterwards, the * 404 * UDIR2 block itself is destroyed. * 405 * FREESPEC is used so that a very large directory * 406 * does not have all of its UDIR2 elements freed, then * 407 * have all files in each one of them freed. This could * 408 * lead to 12000 elements in the free list. Instead, * 409 * all of the UDIR2 elements are freed (max of 185 free * 410 * list elements), then one of those is freed (max of * 411 * 42 more free list elements), then all of those 42 * 412 * files are freed before we continue. This limits the * 413 * maximum size of the free file list to no more than * 414 * about 230 for each directory freed. * 415 * * 416 ********************************************************************************** 417 0000516F 418 FFPUDIR2 LABEL 0516F E4496184 1 5 ZBM 419 ST R1 R5,MINORACS save address of structure head 05170 DC0031FF 420 CALL SETWNDO2 get in the UDIR2 block 05171 41440001 IMM 421 PARV VPCNTLRO only reading now 05172 41440000 IMM 422 PARV VPNOFCB indicate no lun associated with us 05173 4100517D 423 PAR UD2MSER error address 05174 41574801 5 BASE 424 PARV R5,FFBLOCK pass the MS address 05175 4044000A IMM 425 PARVL FBITUDIR2 indicate type of block expected 426 05176 61040C00 4 IMM 427 LD R4 ADR WNDO2 load address of FD part 05177 DC405194 428 CALLNP DODIR release all of the files 05178 60896184 2 5 ZBM 429 LD R2 R5,MINORACS get MS address of UDIR2 05179 DC0051EE 430 CALL ZOTRAFBLK free it 0517A 4044000A IMM 431 PARVL FBITUDIR2 indicate type 0517B DC403153 432 CALLNP GRUBWNDO2 remove from VM list 0517C FE0E5185 433 JMP FFPFREED done with current element 434 * --- 435 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1104 (SYSPROCESS) F 55 Disk Structure Freeing Process 0000517D 436 UD2MSER LABEL 0517D DC403153 437 CALLNP GRUBWNDO2 release the window 0517E DC005048 438 CALL ERRORLOG record the error 0517F 4144060C IMM 439 PARV ERLCFUD2 indicate the type of error 05180 40574801 5 BASE 440 PARVL R5,FFBLOCK indicate MS address at fault 05181 FE0E5185 441 JMP FFPFREED pretend done 442 * --- 443 444 ********************************************************************************** 445 * An individual block was found to be bad. Output an * 446 * error message and ignore the problem. * 447 ********************************************************************************** 448 00005182 449 FFPBLKBAD LABEL 450 * call ERRORLOG 05182 DC40261B 451 CALLNP MAPOUTFBI unmap FBI, ION 05183 DC403150 452 CALLNP GRUBWNDO1 release this window for swapping 05184 FE0E5185 453 JMP FFPFREED get the next thing to free 454 * --- 455 456 ********************************************************************************** 457 * * 458 * The last structure finished - free usage of the volume * 459 * and see if there is more to free. * 460 * * 461 ********************************************************************************** 462 00005185 463 FFPFREED LABEL 05185 D0574C02 5 FPVR 464 DEC @(R5,FFVOLBPTR) remove busy count for FF element 05186 FE0C50B8 465 JNE FFPAGAIN skip dismount volume check 05187 DC005034 466 CALL DISMOUNT check if volume needs dismounting 05188 40574802 5 BASE 467 PARVL R5,FFVOLBPTR pointer to the VOLN element 05189 FE0E50B8 468 JMP FFPAGAIN try for something new to free 469 * --- 470 471 472 ********************************************************************************** 473 * * 474 * Nothing in free list, stop myself * 475 * * 476 ********************************************************************************** 477 0000518A 478 FFPDONE LABEL 0518A FB70518E 5 479 JZA R5 FFPDONENT jump if no temp area allocated 0518B DC002F5D 480 CALL UFREEMEM return my temp area 0518C 41440003 IMM 481 PARV FFTEMPLOG 0518D 40534000 5 REG 482 PARVL R5 0000518E 483 FFPDONENT LABEL 0518E D0401D82 484 DEC FFPROCS one less free file process 485 PUNLOCK FFLOCK release the list 0518F EC001D7A 485 STZ FFLOCK 05190 0C800000 485 ION 05191 DC002875 486 CALL FREESTACK free our stack 05192 4044000F IMM 487 PARVL STACKSIZE 05193 FE0E2DAC 488 JMP LIQUIDATE destroy this process 489 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1105 (SYSPROCESS) F 55 Disk Structure Freeing Process 490 491 END FFPINIT and FFPRESTART routines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1106 (SYSPROCESS) F 55 Disk Structure Freeing Process 493 494 ********************************************************************************** 495 * * 496 * This section scans a file directory and produces * 497 * a FFPLIST entry for each element that it finds. * 498 * Enter with R4 => first FD element. * 499 * * 500 * Stack required = 11 * 501 * 1 + max ( FREESPEC (3), ZOTRAFBLK (10) ) * 502 * * 503 ********************************************************************************** 504 505 BLOCK DODIR subroutine 506 ENTRY DODIR 507 508 BEGFRAME 509 ENDFRAME 510 05194 DD5F8001 6 STAK 511 DODIR ENTRNP PUSH 00005195 512 DODLOOP LABEL 513 * do the share list 05195 60970814 2 4 BASE 514 LD R2 R4,FDSHL/SHLFLAGW get the indicator word 05196 F2805199 2 515 JBF R2/SHLDSKFLGB SHSHLIST jump if no MS block 05197 DC0051EE 516 CALL ZOTRAFBLK dump this block 05198 40440012 IMM 517 PARVL FBITFSLB indicate file share list block 00005199 518 SHSHLIST LABEL 05199 60092A60 0 4 ZBM 519 LD R0 R4,FDET get the entry type 0519A 64040003 0 IMM 520 CPR R0 MAXTYPE check for odd ball 0519B FE0451AD 521 JGT IGNORE skip entry if not understood 0519C 5CA0519D 0 522 LDPC DODTAB(R0) jump to appropriate handler 523 * --- 524 0000519D 525 DODTAB LABEL 0519D 000051B0 526 ADR DONE 0 - end of list 0519E 000051A1 527 ADR SEQFILE 1 - sequential file 0519F 000051A3 528 ADR RAFFIL 2 - .RAF 051A0 000051A7 529 ADR CODEFIL 3 - .CODE 00000003 ABS 530 MAXTYPE EQU 3 largest freeable type 531 000051A1 532 SEQFILE LABEL 051A1 6084000C 2 IMM 533 LD R2 FBITSAF get proper code for freer 051A2 FE0E51A8 534 JMP DODSHR go to shared code 535 * --- 536 000051A3 537 RAFFIL LABEL 051A3 60493C20 1 4 ZBM 538 LD R1 R4,FDRAFTYPE pick up the type of the RAF 051A4 60B2637F 2 1 @ 539 LD R2 @RAFFBITABP(R1) get the matching FBI type 051A5 FA8251AD 2 540 JEQZ R2 IGNORE ignore this if an empty RAF 051A6 FE0E51A8 541 JMP DODSHR go share code 542 * --- 543 000051A7 544 CODEFIL LABEL 051A7 60840013 2 IMM 545 LD R2 FBITCCB get proper code for code file 546 * \ / 000051A8 547 DODSHR LABEL 051A8 60091185 0 4 ZBM 548 LD R0 R4,FDDA get MS address of structure head 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1107 (SYSPROCESS) F 55 Disk Structure Freeing Process 051A9 E4095181 0 5 ZBM 549 ST R0 R5,FFMSBLK combine with volume 550 551 ********************************************************************************** 552 * We call a special routine to free these elements. This * 553 * is so that a huge directory doesn't put 12000 elements into * 554 * the free file list! * 555 ********************************************************************************** 556 051AA DC004FE5 557 CALL FREESPEC call to free element 051AB 41574801 5 BASE 558 PARV R5,FFBLOCK pass MS address 051AC 40528000 2 REG 559 PARVL R2 pass type 000051AD 560 IGNORE LABEL 051AD 19040018 4 IMM 561 ADD R4 FDLNTH advance to next entry 051AE 65040FE8 4 IMM 562 CPR R4 ADR WNDO2(UDLFDE) check for end of block 051AF FE0A5195 563 JLE DODLOOP return if more 000051B0 564 DONE LABEL 051B0 5D1F8001 6 STAK 565 LEAVE POP return to caller 566 * --- 567 568 END DODIR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1108 (SYSPROCESS) F 55 Disk Structure Freeing Process 570 571 ********************************************************************************** 572 * * 573 * ZOTBLOCK * 574 * Routine to make a free block. * 575 * Call: * 576 * SP => stack * 577 * R5 => FFTEMP block * 578 * R3 => PPL * 579 * associated page locked in window 1 * 580 * block for pages FBI mapped and IOFF * 581 * CALLNP ZOTBLOCK * 582 * * 583 * * 584 * Eats R0:R3. * 585 * Stack required = 8 * 586 * 1 + max ( GRUBWNDO1 (7), MAPOUTFBI (2) ) * 587 * * 588 * NOTE: It is possible that the disk driver is doing an idle-write * 589 * operation on the page at the same time that we are freeing * 590 * it. Therefore, the FBIDA field must be correct at all times. * 591 * Also, since this is possible, we clear the data before clearing * 592 * the FBI, so that there will never be a page on the disk that * 593 * appears to be free, but actually contains residual user data. * 594 * * 595 ********************************************************************************** 596 597 BLOCK ZOTBLOCK subroutine 598 ENTRY ZOTBLOCK 599 600 BEGFRAME 601 ENDFRAME 602 051B1 0000000C 603 FFWRITEMAX VFD 12 greatest number of disk writes before... 604 * ...FreeFile suspends 605 051B2 DD5F8001 6 STAK 606 ZOTBLOCK ENTRNP PUSH 051B3 60128000 0 2 REG 607 LD R0 R2 save loc of FBI 051B4 60441000 1 IMM 608 LD R1 CPP number of characters on the page 051B5 60840800 2 IMM 609 LD R2 ADR WNDO1 address of page 051B6 FE5800FF 610 CFILL 0FF fill it up with ones 051B7 60440024 1 IMM 611 LD R1 (FBILNTH-2)*CPW to clear FBI 051B8 38960802 2 0 BASE 612 LEA R2 R0,2 except for first two words 051B9 FE580000 613 CFILL 000 which must be treated specially 051BA 6042FE00 1 IMM 614 LD R1 FBITFREE*BITS 0:7 value for FBI word 0 051BB 6088D181 2 3 ZBM 615 LD R2 R3,PPBLOCK/MSBLKFIELD value for FBI word 1 051BC E6560800 120 BASE 616 ST2 R1 R0,0 clear first two words of FBI 617 SETTBIT R3,PPPUTADT cause the block number to... 051BD 60024000 0 IMM 617 LD R0 1*BIT(((R3,PPPUTADT) DISP (R3,0))/BITS 0:4) 051BE FC16C802 0 3 BASE 617 IORM R0 R3,(((R3,PPPUTADT) DISP (R3,0))/BITS 15:31) 618 * ...be put into ADT after writing 051BF 6008C081 0 3 ZBM 619 LD R0 R3,PPBLOCK/VOLFIELD get volume number for this block 051C0 60201F22 0 0 620 LD R0 VOLNTABLE(R0) get access to the VOLN element 051C1 D0160815 0 BASE 621 INC R0,VOLNBUSY busy volume for ADT element to be created later 051C2 DC40261B 622 CALLNP MAPOUTFBI unmap FBI, ION 051C3 DC403150 623 CALLNP GRUBWNDO1 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1109 (SYSPROCESS) F 55 Disk Structure Freeing Process 624 * \ / 625 626 ********************************************************************************** 627 * * 628 * If the free filer is handed a file that is mostly resident, we * 629 * create hundreds of disk writes while we're freeing. We then * 630 * control that many pages forever because we get one read of a new * 631 * page for every disk write that takes place. We prevent this * 632 * by suspending if the number of pending disk writes seems excessive. * 633 * * 634 ********************************************************************************** 635 636 * \ / 051C4 60001F19 0 637 LD R0 DISKWBUSY get the number of disk writes waiting 051C5 640051B1 0 638 CPR R0 FFWRITEMAX above the suspend threshold? 051C6 FE0A51CB 639 JLE ZOTEXIT jump if we keep going 051C7 60040140 0 IMM 640 LD R0 URDELAY a suspend request 051C8 60440002 1 IMM 641 LD R1 2 a little time 051C9 60840000 2 IMM 642 LD R2 0 051CA 09040000 IMM 643 UREQ 0 wait for the two seconds 644 * \ / 645 000051CB 646 ZOTEXIT LABEL 051CB 5D1F8001 6 STAK 647 LEAVE POP 648 * --- 649 650 END ZOTBLOCK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1110 (SYSPROCESS) F 55 Disk Structure Freeing Process 652 653 ********************************************************************************** 654 * * 655 * Routine to free a RAF subtree * 656 * Call: * 657 * SP => stack * 658 * R5 => FF temp block * 659 * CALL RAFSUBTREE * 660 * PARV * 661 * PARVL * 662 * * 663 * Uses window 2 to hold the root block and window * 664 * 1 for zotting. * 665 * * 666 * Eats R0:R3. * 667 * Stack required = 11 * 668 * 1 + max ( GRUBWNDOx (7), SETWNDO2 (4), ZOTRAFBLK (10) ) * 669 * * 670 ********************************************************************************** 671 672 BLOCK RAFSUBTREE subroutine 673 ENTRY RAFSUBTREE 674 675 BEGFRAME 676 ENDFRAME 677 051CC DD1F8001 6 STAK 678 RAFSUBTREE ENTR PUSH 051CD C1574015 5 CACH 679 STPV R5,MINACSTYP first param is type of root block 051CE C0495181 5 ZBM 680 STPVL R5,FFMSBLK second is addr of root block 051CF E4096184 0 5 ZBM 681 ST R0 R5,MINORACS save addr of root block 051D0 DC0031FF 682 CALL SETWNDO2 get root block in 051D1 41440001 IMM 683 PARV VPCNTLRO indicate read-only 051D2 41440000 IMM 684 PARV VPNOFCB indicate no lun associated with us 051D3 410051EB 685 PAR FFPMACSER error address 051D4 41574801 5 BASE 686 PARV R5,FFBLOCK 051D5 40574015 5 CACH 687 PARVL R5,MINACSTYP 051D6 610403E7 4 IMM 688 LD R4 CCBMAXPAGE-1 number of ptrs in CCB 051D7 60174015 0 5 CACH 689 LD R0 R5,MINACSTYP get type of root block 051D8 64040013 0 IMM 690 CPR R0 FBITCCB check for a code control block 051D9 FE0251DB 691 JEQ FFPSRAFLP jump if this is a CCB 051DA 610403FF 4 IMM 692 LD R4 WPP-1 otherwise, load number of ptrs in RAF minor access 000051DB 693 FFPSRAFLP LABEL 051DB 60A80C00 2 4 694 LD R2 WNDO2(R4) get a possible pointer 051DC 7880254F 2 695 AND R2 MSBLKMASK mask down to block number only 051DD FA8251E5 2 696 JEQZ R2 FFPSRAFNO jump if no block here 051DE DC0051EE 697 CALL ZOTRAFBLK free this block 051DF 60174015 0 5 CACH 698 LD R0 R5,MINACSTYP get type of minor access block 051E0 60440014 1 IMM 699 LD R1 FBITCODED get type for code data block 051E1 6404000E 0 IMM 700 CPR R0 FBITSRAF is minor access block a short .RAF? 051E2 FE0C51E4 701 JNE ITSACODE jump if not 051E3 6044000F 1 IMM 702 LD R1 FBITRAFD load type for .RAF data 051E4 40524000 1 REG 703 ITSACODE PARVL R1 pass type determined 000051E5 704 FFPSRAFNO LABEL 051E5 FB2651DB 4 705 JDR R4 FFPSRAFLP try the next pointer 051E6 60896184 2 5 ZBM 706 LD R2 R5,MINORACS get the addr of the root block 051E7 DC0051EE 707 CALL ZOTRAFBLK call to dump the access block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1111 (SYSPROCESS) F 55 Disk Structure Freeing Process 051E8 40574015 5 CACH 708 PARVL R5,MINACSTYP indicate the type 051E9 DC403153 709 CALLNP GRUBWNDO2 take page out of VM list 051EA 5D1F8001 6 STAK 710 LEAVE POP 711 * --- 712 713 * error while fooling with minor access block 000051EB 714 FFPMACSER LABEL 051EB DC403150 715 CALLNP GRUBWNDO1 remove from VM list 051EC DC403153 716 CALLNP GRUBWNDO2 remove from VM list 051ED 5D1F8001 6 STAK 717 LEAVE POP return nonchalantly 718 * --- 719 720 END RAFSUBTREE subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1112 (SYSPROCESS) F 55 Disk Structure Freeing Process 722 723 ********************************************************************************** 724 * * 725 * Free an individual block. * 726 * Call: * 727 * SP => stack * 728 * R5 => FF temp block * 729 * R2 = disk address * 730 * CALL ZOTRAFBLK * 731 * PARVL * 732 * Uses window 1 * 733 * * 734 * Eats R0:R3. * 735 * Stack required = 10 * 736 * 2 + max ( GRUBWNDO1 (7), MAPOUTFBI (2), SETWNDO1 (4), * 737 * ZOTBLOCK (8) ) * 738 * * 739 ********************************************************************************** 740 741 BLOCK ZOTRAFBLK subroutine 742 ENTRY ZOTRAFBLK 743 744 BEGFRAME 00178801 6 BASE 745 SAVER4 BSS 1 746 ENDFRAME 747 051EE DD1F8002 6 STAK 748 ZOTRAFBLK ENTR PUSH 051EF E5178801 4 6 BASE 749 ST R4 SP,SAVER4 save callers register 051F0 C0530000 4 REG 750 STPVL R4 051F1 610B0E00 4 4 CBM 751 LD R4 R4*VPFBIOLDB 051F2 1904007F 4 IMM 752 ADD R4 FBITFREE*VPFBINEWB 051F3 E4895181 2 5 ZBM 753 ST R2 R5,FFMSBLK construct a whole mass storage address 051F4 DC003205 754 CALL SETWNDO1 map in the block to be zotted 051F5 41440002 IMM 755 PARV VPCNTLW+VPCNTLLK 051F6 41440000 IMM 756 PARV VPNOFCB 051F7 410051FD 757 PAR ZOTRBLKERR 051F8 41574801 5 BASE 758 PARV R5,FFBLOCK 051F9 40530000 4 REG 759 PARVL R4 051FA DC4051B2 760 CALLNP ZOTBLOCK 051FB 61178801 4 6 BASE 761 LD R4 SP,SAVER4 051FC 5D1F8002 6 STAK 762 LEAVE POP 763 * --- 764 765 766 * Error while fooling with RAF data block - give 767 * error message but otherwise ignore. 000051FD 768 ZOTRBLKERR LABEL 051FD DC40261B 769 CALLNP MAPOUTFBI unmap FBI, ION 051FE DC403150 770 CALLNP GRUBWNDO1 get rid of PAL for page with error 771 * call ERRORLOG 051FF 61178801 4 6 BASE 772 LD R4 SP,SAVER4 restore this register 05200 5D1F8002 6 STAK 773 LEAVE POP 774 * --- 775 776 END ZOTRAFBLK subroutine 777 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1113 (SYSPROCESS) F 55 Disk Structure Freeing Process 778 779 END SYS_FREEFILE process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1114 (SYSPROCESS) F 55 Put ADT process 782 783 ********************************************************************************** 784 * * 785 * SYS_PUTADT - put ADT process * 786 * This separate process runs whenever there is a single * 787 * block known to be free on mass storage. We merely take * 788 * elements off of the queue and call PUTFREEBLK for each * 789 * block represented. * 790 * * 791 * Stack required = 15 * 792 * WARNING see STACKSIZE below. * 793 * 0 + max ( DISMOUNT (3), FREESTACK (0), GETSTACK (0), * 794 * LIQUIDATE (7), LOCKWAIT (0), PUTFREEBLK (15), * 795 * SFREEMEM (0) ) * 796 * * 797 ********************************************************************************** 798 799 BLOCK SYS_PUTADT process 800 ENTRY PADTRSTRT 801 0000000F ABS 802 STACKSIZE EQU 15 size of stack to get 803 00005201 804 PADTRSTRT LABEL 05201 DC00286A 805 CALL GETSTACK 05202 4044000F IMM 806 PARVL STACKSIZE 00005203 807 PADTAGAIN LABEL 808 PLOCK PADTLOCK lock the put adt list 05203 0CC00000 808 IOFF 05204 D1C01D83 808 SETT PADTLOCK 05205 FE0C5207 808 JNE MA(2+DISPW MA 0) 05206 DC40308B 808 CALLNP LOCKWAIT 05207 61001D84 4 809 LD R4 PADTLIST get pointer to the first element 05208 FB30521B 4 810 JZA R4 PADTDONE jump if nothing to do 05209 60091F10 0 4 ZBM 811 LD R0 R4,PADTLINK get pointer to next element 0520A E4001D84 0 812 ST R0 PADTLIST and remove us from the list 813 PUNLOCK PADTLOCK release the put adt list 0520B EC001D83 813 STZ PADTLOCK 0520C 0C800000 813 ION 0520D 60170801 0 4 BASE 814 LD R0 R4,PADTBLOCK get the block number requested 0520E DC0036B9 815 CALL PUTFREEBLK call to return the space 0520F 41491181 4 ZBM 816 PARV R4,PADTMSBLK pass the relative address 05210 40490081 4 ZBM 817 PARVL R4,PADTDRIVE and the volume number 05211 60090081 0 4 ZBM 818 LD R0 R4,PADTDRIVE get the volume number 05212 60201F22 0 0 819 LD R0 VOLNTABLE(R0) get pointer to VOLN element 05213 D0560815 0 BASE 820 DEC R0,VOLNBUSY remove busy count for this element 05214 FE0C5217 821 JNE PADTVBSY if busy skip volume dismount check 05215 DC005034 822 CALL DISMOUNT check if volume needs dismounting 05216 40520000 0 REG 823 PARVL R0 address of the VOLN element 824 * \ / 825 00005217 826 PADTVBSY LABEL 05217 DC002F5D 827 CALL SFREEMEM call to free the element 05218 41440001 IMM 828 PARV PADTLOG indicate length 05219 40530000 4 REG 829 PARVL R4 and address 0521A FE0E5203 830 JMP PADTAGAIN go check for more elements 831 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1115 (SYSPROCESS) F 55 Put ADT process 832 833 ********************************************************************************** 834 * * 835 * Nothing remains in our list of elements, so stop myself. * 836 * * 837 ********************************************************************************** 838 0000521B 839 PADTDONE LABEL 0521B EC001D85 840 STZ PADTBUSY say I no longer exist 841 PUNLOCK PADTLOCK let others use the list 0521C EC001D83 841 STZ PADTLOCK 0521D 0C800000 841 ION 0521E DC002875 842 CALL FREESTACK 0521F 4044000F IMM 843 PARVL STACKSIZE 05220 FE0E2DAC 844 JMP LIQUIDATE flush my existence 845 * --- 846 847 END SYS_PUTADT process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1116 (SYSPROCESS) F 55 Volume dismount process 850 851 ********************************************************************************** 852 * * 853 * SYS_DISMOUNT - volume dismount process * 854 * This process simply dismounts the volumes given * 855 * to it by the DISMOUNT routine. The volumes we dismount are * 856 * strictly of the maintenance mounted type. At times when we * 857 * close the .VOL for a maintenance mounted volume and we attempt * 858 * to dismount the volume there are still system processes still * 859 * busy. When this happens we set a bit in the VOLN element and * 860 * when the volume busy count reaches zero we call the DISMOUNT * 861 * routine which in turns tells the dispatcher to start this * 862 * process. * 863 * * 864 * Stack required = 18 * 865 * WARNING!!! See stacksize below. * 866 * 0 + max ( DISMTDUMMY (4), DISMTIDX (18), DISMTNAME (16), * 867 * ERRORLOG (3), FREESTACK (0), GETSTACK (0), * 868 * LIQUIDATE (7), LOCKWAIT (0), SFREEMEM (0) ) * 869 * * 870 ********************************************************************************** 871 872 BLOCK SYS_DISMOUNT process 873 ENTRY DMNTSTRT 874 0000001F ABS 875 STACKSIZE EQU 31 876 00005221 877 DMNTSTRT LABEL 05221 DC00286A 878 CALL GETSTACK get stack and CA for this process 05222 4044001F IMM 879 PARVL STACKSIZE number of words required 880 * \ / 881 00005223 882 DMNTAGAIN LABEL 883 PLOCK DMNTLOCK gain access to the list 05223 0CC00000 883 IOFF 05224 D1C01D8A 883 SETT DMNTLOCK 05225 FE0C5227 883 JNE MA(2+DISPW MA 0) 05226 DC40308B 883 CALLNP LOCKWAIT 05227 61401D8B 5 884 LD R5 DMNTLIST check if any volumes to dismount 05228 FB70523B 5 885 JZA R5 DMNTDONE jump if nothing more to do here 05229 60095F10 0 5 ZBM 886 LD R0 R5,DMNTLINK pointer to next in line 0522A E4001D8B 0 887 ST R0 DMNTLIST this unlinks the first element 888 PUNLOCK DMNTLOCK release the list for others to use 0522B EC001D8A 888 STZ DMNTLOCK 0522C 0C800000 888 ION 0522D 60174801 0 5 BASE 889 LD R0 R5,DMNTVOLN volume number to dismount 0522E 61201F22 4 0 890 LD VLN VOLNTABLE(R0) pointer to the VOLN element 0522F DC002F5D 891 CALL SFREEMEM call to free the block 05230 41440001 IMM 892 PARV DMNTLOG log of the block size 05231 40534000 5 REG 893 PARVL R5 address of the block 05232 DC005048 894 CALL ERRORLOG log dismounting of the volume 05233 41440418 IMM 895 PARV ERLCDMOUNT code indicating a dismount 05234 40490086 4 ZBM 896 PARVL VLN,VOLNNUM volume number 05235 5C091F19 4 ZBM 897 CMZ VLN,VOLNIDXPTR IDX table associated 05236 FE025239 898 JEQ NOIDX jump if not 05237 DC409FC1 899 CALLNP DISMTIDX get rid of the entries 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1117 (SYSPROCESS) F 55 Volume dismount process 05238 DC409FF4 900 CALLNP DISMTNAME down to the bare necessities 901 * \ / 902 00005239 903 NOIDX LABEL 05239 DC40A039 904 CALLNP DISMTDUMMY and leave no more trace 0523A FE0E5223 905 JMP DMNTAGAIN see if more work to do 906 * --- 907 0000523B 908 DMNTDONE LABEL 0523B EC001D8C 909 STZ DMNTBUSY indicate process going away 910 PUNLOCK DMNTLOCK release critical region 0523C EC001D8A 910 STZ DMNTLOCK 0523D 0C800000 910 ION 0523E DC002875 911 CALL FREESTACK we have no need for a stack 0523F 4044001F IMM 912 PARVL STACKSIZE number of words to return 05240 FE0E2DAC 913 JMP LIQUIDATE our days are numbered now! 914 * --- 915 916 END SYS_DISMOUNT process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1118 (SYSPROCESS) F 55 Error log writer process 919 920 ********************************************************************************** 921 * * 922 * SYS_ERRORLOG - Error log process. * 923 * This process takes errors logged by the various parts of * 924 * the system and writes them into a file on the system * 925 * maintenance account. This will provide a permanent record * 926 * of the errors for field service personnel. The file is a * 927 * RAF mainly for compactness but also for security through * 928 * obscurity. * 929 * * 930 * Stack required = 7 * 931 * WARNING!!! See STACKSIZE below. * 932 * 0 + max ( FREESTACK (0), GETSTACK (0), LIQUIDATE (7), * 933 * LOCKWAIT (0), SFREEMEM (0), SGETMEM (0) ) * 934 * * 935 ********************************************************************************** 936 937 BLOCK SYS_ERRORLOG process 938 ENTRY ELPRESTART 939 00000007 ABS 940 STACKSIZE EQU 7 size of stack to get 941 942 * Temp block allocated herein 00005241 943 ELTPROTO BASE R5 00174800 5 BASE 944 ELTBASE BSS 1 00174801 5 BASE 945 ELTEND BSS 1 946 DRCT 00000001 ABS 947 ELTLOG EQU (DISPW ELTPROTO) LOG 2 length of element 948 ORG ELTPROTO recover lost space 0000000A ABS 949 ELPLUN EQU 10 my personal lun 00000010 BYTE 950 FILELINK EQU BIT 0 bit in R7 to say file linked 951 00005241 952 ELPRESTART LABEL normal creation start 05241 60000412 0 953 LD R0 CPPSA 05242 D1560813 0 BASE 954 STMW R0,PSSESLIM allow room to write 05243 DC00286A 955 CALL GETSTACK 05244 40440007 IMM 956 PARVL STACKSIZE 00005245 957 ELPAGAIN0 LABEL 05245 61440000 5 IMM 958 LD R5 0 indicate no temp block yet 05246 EC0BC010 7 CBM 959 STZ R7/FILELINK say file not linked 00005247 960 ELPAGAIN LABEL get next element in list 961 PLOCK ERRLOGLOCK get access to the list roots 05247 0CC00000 961 IOFF 05248 D1C01D91 961 SETT ERRLOGLOCK 05249 FE0C524B 961 JNE MA(2+DISPW MA 0) 0524A DC40308B 961 CALLNP LOCKWAIT 0524B 61001D92 4 962 LD R4 ERRLOGLIST get pointer to first element 0524C FB305292 4 963 JZA R4 ELPDONE jump if nothing to do 0524D 60091F10 0 4 ZBM 964 LD R0 R4,ERLLINK get link to remainder of error log list 0524E E4001D92 0 965 ST R0 ERRLOGLIST remove this element from the list 966 PUNLOCK ERRLOGLOCK release the list 0524F EC001D91 966 STZ ERRLOGLOCK 05250 0C800000 966 ION 967 * \ / 05251 FB725255 5 968 JNZA R5 OK2TEMP jump if temp block allocated 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1119 (SYSPROCESS) F 55 Error log writer process 05252 DC002ED0 969 CALL UGETMEM allocate temp block 05253 40440001 IMM 970 PARVL ELTLOG of this size 05254 61520000 5 0 REG 971 LD R5 R0 R5 => temp block 00005255 972 OK2TEMP LABEL 05255 F7C05260 7 973 JBT R7/FILELINK OK2FILE jump if file already linked 05256 60040050 0 IMM 974 LD R0 FREQUIPW equip request for write 05257 60445282 1 IMM 975 LD R1 ADR LOGFILNAME => block for file name 05258 0884000A IMM 976 FREQ ELPLUN link the file 05259 FA08527A 0 977 JLTZ R0 CHKBUSY see if maybe busy 0525A EDCBC010 7 CBM 978 STW R7/FILELINK indicate that the file is equipped 0525B 60040031 0 IMM 979 LD R0 FRREADB get the code for read 0525C 60440008 1 IMM 980 LD R1 2*CPW get character count for read 0525D 38974800 2 5 BASE 981 LEA R2 R5,ELTBASE make address of input buffer 0525E 0884000A IMM 982 FREQ ELPLUN read in the begin/end pointers 0525F FA085273 0 983 JLTZ R0 ABNORMAL jump if some error 984 * \ / 00005260 985 OK2FILE LABEL 05260 60574801 1 5 BASE 986 LD R1 R5,ELTEND get pointer to end of the file 05261 6847FFC0 1 IMM 987 UCPR R1 -((ERLMAXLEN+3)*CPW) is there enough room to write our data? 05262 FE045265 988 JGT NOROOM jump if not, wrap around 05263 68440008 1 IMM 989 UCPR R1 2*CPW maybe the file is empty? 05264 FE065267 990 JGE POSITIONOK jump if looks good, we use the pointer 00005265 991 NOROOM LABEL 05265 60440008 1 IMM 992 LD R1 2*CPW file begins after the base and end pointers 05266 E4574801 1 5 BASE 993 ST R1 R5,ELTEND save as new end pointer 00005267 994 POSITIONOK LABEL 05267 60040090 0 IMM 995 LD R0 FRPOSITION do the seek in the RAF 05268 0884000A IMM 996 FREQ ELPLUN 05269 FA085273 0 997 JLTZ R0 ABNORMAL bail out if error 998 0526A 60490050 1 4 ZBM 999 LD R1 R4,ERLTYPE/ERLLEN R1 = number of parameters 0526B 18440003 1 IMM 1000 ADD R1 ERLFUNK+1 R1 = length of stuff in words 0526C E4491F10 1 4 ZBM 1001 ST R1 R4,ERLLINK place length in record being written 0526D 604A4400 1 1 CBM 1002 LD R1 R1*BIT 29 R1 = length of record in characters 0526E 98574801 1 5 BASE 1003 ADDM R1 R5,ELTEND move the files end pointer 0526F 38970800 2 4 BASE 1004 LEA R2 R4,0 R2 => record 05270 60040042 0 IMM 1005 LD R0 FRWRITEB get code for write 05271 0884000A IMM 1006 FREQ ELPLUN write it in the RAF 05272 FA065273 0 1007 JGEZ R0 WRITEWORKD jump if write okay 1008 * \ / 1009 1010 ********************************************************************************** 1011 * * 1012 * What to do if the file won't work for us. I really * 1013 * don't know. * 1014 * * 1015 ********************************************************************************** 1016 1017 * \ / 00005273 1018 ABNORMAL LABEL 1019 *** LOG error somewhere 1020 * \ / 00005273 1021 WRITEWORKD LABEL 1022 * Write message to operator too? 00005273 1023 FLUSHERR LABEL 05273 60C90050 3 4 ZBM 1024 LD R3 R4,ERLTYPE/ERLLEN get the message length 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1120 (SYSPROCESS) F 55 Error log writer process 05274 5C56D002 3 REG 1025 HIB R3+ERLFUNK calculate size of block 05275 70D20000 3 0 REG 1026 LDN R3 R0 05276 DC002F5D 1027 CALL SFREEMEM release the queue element 05277 4156D020 3 REG 1028 PARV R3+32 indicate log size of block 05278 40530000 4 REG 1029 PARVL R4 and its address 05279 FE0E5247 1030 JMP ELPAGAIN try for more entries 1031 * --- 1032 1033 ********************************************************************************** 1034 * * 1035 * The file is not equippable. We here check to see if we * 1036 * cannot get at it because it's busy. If this is true, then we * 1037 * wait a while to see if it will become available. * 1038 * For now, the equip request sez suspend if file busy, so this * 1039 * code ( which is left over from before suspension ) will never * 1040 * be invoked for a busy file. * 1041 * * 1042 ********************************************************************************** 1043 0000527A 1044 CHKBUSY LABEL 0527A 600A2AB0 0 0 CBM 1045 LD R0 R0/FDSTATERR extract the error code 0527B 6404008A 0 IMM 1046 CPR R0 XREQERFBZ is it a busy error? 0527C FE0C5273 1047 JNE FLUSHERR if not, we can only throw it away 0527D 60040140 0 IMM 1048 LD R0 URDELAY wait some time 0527E 60440005 1 IMM 1049 LD R1 5 5 seconds will do 0527F 60840000 2 IMM 1050 LD R2 0 only time event 05280 09040000 IMM 1051 UREQ 0 wait 05281 FE0E5255 1052 JMP OK2TEMP try equip again 1053 * --- 1054 00005282 1055 LOGFILNAME LABEL 05282 00000000 1056 PAK12 05284 00000000 1057 PAK6 05285 00000000 1058 PAK12 05287 B674BFEF 1059 PAK12 SYSTEM account name 05289 E79DF200 1060 PAK6 !!! and extension 0528A 00000000 1061 PAK12 0528C 5FEF38B6 1062 PAK12 ERRORLOG log file name 0528E 8A28910E 1063 PAK6 LOGFIL and extension 0528F 00000000 1064 PAK12 05291 00000000 1065 VFD 0 1066 1067 ********************************************************************************** 1068 * * 1069 * Nothing more in the queue. Release the file and temp * 1070 * block and go away. * 1071 * * 1072 ********************************************************************************** 1073 00005292 1074 ELPDONE LABEL 1075 PUNLOCK ERRLOGLOCK release the list 05292 EC001D91 1075 STZ ERRLOGLOCK 05293 0C800000 1075 ION 05294 F3C052A2 7 1076 JBF R7/FILELINK NOFILE jump if file never linked 05295 60040090 0 IMM 1077 LD R0 FRPOSITION get a RAF position request 05296 60440004 1 IMM 1078 LD R1 EFEND get ready to write end pointer back 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1121 (SYSPROCESS) F 55 Error log writer process 05297 0884000A IMM 1079 FREQ ELPLUN position to the end pointer in the file 05298 FA08529E 0 1080 JLTZ R0 ENDNOPOS jump if error 05299 60040042 0 IMM 1081 LD R0 FRWRITEB get the code for write 0529A 60440004 1 IMM 1082 LD R1 1*CPW get the write length 0529B 38974801 2 5 BASE 1083 LEA R2 R5,ELTEND and the buffer pointr 0529C 0884000A IMM 1084 FREQ ELPLUN write the new end pointer 0529D FA06529E 0 1085 JGEZ R0 ENDWRITN jump if successful write 1086 * \ / 1087 * This file won't work 0000529E 1088 ENDNOPOS LABEL 1089 *** Can we log the error somewhere? 0000529E 1090 ENDWRITN LABEL 0529E 60040060 0 IMM 1091 LD R0 FRUNEQUIP unequip the file 0529F 0884000A IMM 1092 FREQ ELPLUN 052A0 FA0652A2 0 1093 JGEZ R0 UNEQPOK jump if successful 052A1 001310B1 1094 HALT HALTS10B1 stop when log file totally unmanageable 1095 * --- 1096 000052A2 1097 UNEQPOK LABEL 000052A2 1098 NOFILE LABEL 052A2 FB7052A6 5 1099 JZA R5 NOTBLOCK jump if no temp block allocated 052A3 DC002F5D 1100 CALL UFREEMEM free it if here 052A4 41440001 IMM 1101 PARV ELTLOG indicate size of temp block 052A5 40534000 5 REG 1102 PARVL R5 and its address 000052A6 1103 NOTBLOCK LABEL 1104 PLOCK ERRLOGLOCK lock the list 052A6 0CC00000 1104 IOFF 052A7 D1C01D91 1104 SETT ERRLOGLOCK 052A8 FE0C52AA 1104 JNE MA(2+DISPW MA 0) 052A9 DC40308B 1104 CALLNP LOCKWAIT 052AA 5C001D92 1105 CMZ ERRLOGLIST did stuff come in while I wasn't looking? 052AB FE0C52B2 1106 JNE NOFLUSH if so, we cannot flush us 052AC EC001D93 1107 STZ ERRLOGBUSY say I'm no longer here 1108 PUNLOCK ERRLOGLOCK Release the list 052AD EC001D91 1108 STZ ERRLOGLOCK 052AE 0C800000 1108 ION 052AF DC002875 1109 CALL FREESTACK 052B0 40440007 IMM 1110 PARVL STACKSIZE 052B1 FE0E2DAC 1111 JMP LIQUIDATE zap my form 1112 * --- 1113 1114 * There be stuff again in the list. 000052B2 1115 NOFLUSH LABEL 1116 PUNLOCK ERRLOGLOCK release the list 052B2 EC001D91 1116 STZ ERRLOGLOCK 052B3 0C800000 1116 ION 052B4 FE0E5245 1117 JMP ELPAGAIN0 process list 1118 * --- 1119 1120 END SYS_ERRORLOG process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1122 (SYSPROCESS) F 55 CPU microcode patcher process 1123 1124 ********************************************************************************** 1125 * * 1126 * This process causes the CPU running it to reload its * 1127 * CPU microcode patches. * 1128 * * 1129 * Stack required = 0 * 1130 * 1 + max ( LOCKWAIT (0) ) * 1131 ********************************************************************************** 1132 1133 BLOCK PATCHPROC routine 1134 ENTRY PATCHPROC 1135 000052B5 1136 PATCHPROC LABEL 052B5 60400415 1 1137 LD R1 OURSLOT pick up our slot number 052B6 60221ECE 0 1 1138 LD R0 SLOTTABLE(R1) get some info about ourself 052B7 600A3080 0 0 CBM 1139 LD R0 R0/WRU0MREV our microcode revision 052B8 60801DA1 2 1140 LD R2 PATCHLIST R2 -> list of patches 052B9 3C168000 0 2 CACH 1141 LSRCH R0 R2,CPUPREV look for the correct patch revision 052BA FE0252BC 1142 JEQ HAVEIT 052BB 001310A0 1143 HALT HALTS10A0 patch disappeared for this CPU 1144 * --- 1145 000052BC 1146 HAVEIT LABEL 052BC 38968801 2 2 BASE 1147 LEA R2 R2,CPUPLNTH point to start of the patch 052BD 60CA9C80 3 2 CBM 1148 LD PFPTR R2/PAGEFIELD get page number of the patch 052BE 7CC40080 3 IMM 1149 IOR PFPTR 1*MONBIT make sure it is in monitor 1150 PLOCK CPUCOMLOCK 052BF 0CC00000 1150 IOFF 052C0 D1C01CF5 1150 SETT CPUCOMLOCK 052C1 FE0C52C3 1150 JNE MA(2+DISPW MA 0) 052C2 DC40308B 1150 CALLNP LOCKWAIT 1151 * (PLOCK may destroy R0) 052C3 80920000 0 REG 1152 PFRD R0 pick up page file for patch location 052C4 60CA28C0 3 0 CBM 1153 LD R3 R0/PFPAGENUM fetch physical page number... 052C5 E4CA14C0 3 0 CBM 1154 ST R3 R0/FLDABSPG ...and put into actual address 052C6 E48A2CA0 2 0 CBM 1155 ST R2 R0/DISPFIELD make physical location of patch 052C7 0C4052CB 1156 STTB PATCHCMND send out the command to patch 1157 * R1 still contains our slot number 1158 * R0 contains the MA of the patch buffer 1159 PUNLOCK CPUCOMLOCK 052C8 EC001CF5 1159 STZ CPUCOMLOCK 052C9 0C800000 1159 ION 052CA FE0E2DAC 1160 JMP LIQUIDATE 1161 * --- 1162 052CB 00030703 1163 PATCHCMND VFD BUSCWRITE+CPUCOFFSET+CPUPTCHCMD 1164 1165 END of PATCHPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1123 (SYSPROCESS) F 55 CPU remover process 1168 1169 ********************************************************************************** 1170 * * 1171 * REMOVECPU * 1172 * * 1173 * When a CPU is to be taken out of the system we * 1174 * come to this routine. An element has already been * 1175 * built for the CPU and is in the IDLECPULST. * 1176 * Here the CPU number is removed from the CPU slot table, * 1177 * and then it just sits around waiting to be called * 1178 * back to action. ICSTART is checked periodically * 1179 * and when it is set, we return to normal work. * 1180 * Call: * 1181 * JMP REMOVECPU * 1182 * Eats R0:R4 * 1183 * Stack required = 14 * 1184 * 0 + max ( FREESTACK (0), FREEZE (14), GETSTACK (0), * 1185 * LOCKWAIT (0), MAPINMEM (3), SFREEMEM (0) * 1186 * UNFREEZE (1) ) * 1187 * * 1188 ********************************************************************************** 1189 1190 BLOCK REMOVECPU routine 1191 ENTRY REMOVECPU 1192 0000000E ABS 1193 STACKSIZE EQU 14 size of stack needed 1194 000052CC 1195 REMOVECPU LABEL 052CC DC00286A 1196 CALL GETSTACK get stack for this process 052CD 4044000E IMM 1197 PARVL STACKSIZE number of words desired 1198 1199 * Remove us from list of active CPUs 052CE 61000412 4 1200 LD R4 CPPSA R4 -> our PSA 052CF DC402D79 1201 CALLNP FREEZE freeze the system 052D0 D0401CF7 1202 DEC CPUCOUNT one fewer CPUs 052D1 D0401CF8 1203 DEC CPUCOUNT1 one fewer unfrozen CPU 052D2 60040000 0 IMM 1204 LD R0 0 052D3 61400415 5 1205 LD R5 OURSLOT our slot number will stay in R5 000052D4 1206 FINDCPU LABEL 052D4 65601CFB 5 0 1207 CPR R5 CPUSLOTS(R0) is this our entry? 052D5 FE0252D7 1208 JEQ FOUNDCPU jump if yes 052D6 FA2052D4 0 1209 IRJ R0 FINDCPU else search more 1210 * --- 1211 000052D7 1212 FOUNDCPU LABEL 052D7 60801CF7 2 1213 LD R2 CPUCOUNT 052D8 60641CFB 1 2 1214 LD R1 CPUSLOTS(R2) pick up last entry in table 052D9 E4601CFB 1 0 1215 ST R1 CPUSLOTS(R0) overlay our entry 052DA EC241CFB 2 1216 STZ CPUSLOTS(R2) and remove last entry 052DB 0CC00000 1217 IOFF so we will not get interrupted 052DC DC402D95 1218 CALLNP UNFREEZE allow the system to continue 1219 * \ / 1220 1221 * Get us out of the runnable queue and back into the running. 052DD 60841DAA 2 IMM 1222 LD R2 ADR SQRUNNABLE set up for RLSRCH 1223 PLOCK SQLOCKS(NQRUNNABLE) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1124 (SYSPROCESS) F 55 CPU remover process 052DE 0CC00000 1223 IOFF 052DF D1C01DBB 1223 SETT SQLOCKS(NQRUNNABLE) 052E0 FE0C52E2 1223 JNE MA(2+DISPW MA 0) 052E1 DC40308B 1223 CALLNP LOCKWAIT 052E2 60401DAA 1 1224 LD R1 SQRUNNABLE get the root of the list 052E3 49085F13 4 1 ZBM 1225 RLSRCH R4 R1,PCPSADRS look for us in the queue 052E4 60085F10 0 1 ZBM 1226 LD R0 R1,PCQLINK get link to remainder of list 052E5 E4089F10 0 2 ZBM 1227 ST R0 R2,PCQLINK remove our element from the list 1228 PUNLOCK SQLOCKS(NQRUNNABLE) call to release the runnable queue 052E6 EC001DBB 1228 STZ SQLOCKS(NQRUNNABLE) 052E7 0C800000 1228 ION 1229 1230 * Set up PCB information for new queue. 052E8 E5564801 5 1 BASE 1231 ST R5 R1,PCQPARM our slot number is the parameter 052E9 60040000 0 IMM 1232 LD R0 NQRUNNING get queue number 052EA E4085260 0 1 ZBM 1233 ST R0 R1,PCQUEUE set our new queue number 1234 PLOCK SQLOCKS(NQRUNNING) lock the list of running processes 052EB 0CC00000 1234 IOFF 052EC D1C01DBA 1234 SETT SQLOCKS(NQRUNNING) 052ED FE0C52EF 1234 JNE MA(2+DISPW MA 0) 052EE DC40308B 1234 CALLNP LOCKWAIT 052EF 60001DA9 0 1235 LD R0 SQRUNNING get pointer to head of list 052F0 E4085F10 0 1 ZBM 1236 ST R0 R1,PCQLINK put existing queue behind us 052F1 E4401DA9 1 1237 ST R1 SQRUNNING put us at head of queue 1238 PUNLOCK SQLOCKS(NQRUNNING) unlock the queue 052F2 EC001DBA 1238 STZ SQLOCKS(NQRUNNING) 052F3 0C800000 1238 ION 1239 052F4 60885F13 2 1 ZBM 1240 LD R2 R1,PCPSADRS R2 -> PSA 052F5 60088116 0 2 ZBM 1241 LD R0 R2,PSCURRPROC get current UPC pointer for this user 052F6 E4000414 0 1242 ST R0 CPCUPC assign as current UPC for this CPU 052F7 E4800412 2 1243 ST R2 CPPSA indicate new current user 052F8 DC0025EB 1244 CALL MAPINMEM map in our virtual monitor memory 052F9 40528000 2 REG 1245 PARVL R2 PSA associated with it 1246 052FA 60401DA5 1 1247 LD R1 IDLECPULST R1 -> first of idle CPU list 052FB 3D484840 5 1 ZBM 1248 LSRCH R5 R1,ICSLOT search for our element 1249 * \ / 1250 1251 * R1 -> our element, R5 = our slot number 000052FC 1252 IDLELOOP LABEL 052FC 00442710 IMM 1253 WAIT IDLETIME wait a bit 052FD 5C085210 1 ZBM 1254 CMZ R1,ICSTART time to start back to work? 052FE FE0252FC 1255 JEQ IDLELOOP keep looping if not 1256 * \ / 1257 052FF 60841DA5 2 IMM 1258 LD R2 ADR IDLECPULST R2 -> idle CPU list 1259 PLOCK IDLECPULCK 05300 0CC00000 1259 IOFF 05301 D1C01DA4 1259 SETT IDLECPULCK 05302 FE0C5304 1259 JNE MA(2+DISPW MA 0) 05303 DC40308B 1259 CALLNP LOCKWAIT 05304 60401DA5 1 1260 LD R1 IDLECPULST R1 -> first of idle CPU list 05305 49484840 5 1 ZBM 1261 RLSRCH R5 R1,ICSLOT search for our element 05306 60085F10 0 1 ZBM 1262 LD R0 R1,ICLINK R0 -> next element in list 05307 E4089F10 0 2 ZBM 1263 ST R0 R2,ICLINK take us out of the list 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1125 (SYSPROCESS) F 55 CPU remover process 1264 PUNLOCK IDLECPULCK 05308 EC001DA4 1264 STZ IDLECPULCK 05309 0C800000 1264 ION 0530A D0401DA6 1265 DEC IDLECPUCNT one less idle CPU 0530B DC002F5D 1266 CALL SFREEMEM 0530C 41440000 IMM 1267 PARV ICBLKLOG how much to return 0530D 40524000 1 REG 1268 PARVL R1 where it is 1269 1270 * Return us to the list of CPUs. 0530E 60401CF7 1 1271 LD R1 CPUCOUNT how many other CPUs 0530F E5621CFB 5 1 1272 ST R5 CPUSLOTS(R1) put us onto end of table 05310 D0001CF7 1273 INC CPUCOUNT indicate back into the running 05311 D0001CF8 1274 INC CPUCOUNT1 05312 0C800000 1275 ION restore interrupts 05313 DC002875 1276 CALL FREESTACK return our stack 05314 4044000E IMM 1277 PARVL STACKSIZE 05315 FE0E2DAC 1278 JMP LIQUIDATE the break is over 1279 * --- 1280 1281 END of REMOVECPU routine 1282 1283 END System Processes 99 INPUT ACCPROCESS accounting process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1126 (ACCPROCESS) F 56 Accounting Process 3 4 ********************************************************************************** 5 * * 6 * This code represents the process that takes * 7 * enqueued accounting file messages and actually * 8 * gets them out to the accounting file (or files). * 9 * * 10 * Stack required: 7 * 11 * WARNING!!! See STACKSIZE below. * 12 * 0 + max ( FREESTACK (0), GETSTACK (0), LIQUIDATE (7), * 13 * LOCKWAIT (0), SFREEMEM (0), SGETMEM (0), * 14 * TIMESET (2) ) * 15 * * 16 ********************************************************************************** 17 18 BLOCK ACCTINIT and ACCTRESTRT routines 19 ENTRY ACCTINIT initialize accounting process 20 ENTRY ACCTRESTRT 21 00000000 ABS 22 WHICHFILE EQU 0 holds ptr to file indicator 00000001 ABS 23 LOCALSSIZE EQU 1 size of local stack usage 00000003 ABS 24 STACKSIZE EQU 3 size of stack to get 0000000C ABS 25 ACLUN EQU 12 lun where work takes place 26 27 ********************************************************************************** 28 * * 29 * This temp area is used by the accounting process and * 30 * freed when no longer needed. * 31 * * 32 ********************************************************************************** 33 00005316 34 APTMPP BASE R5 temp area used by acct process 00174800 5 BASE 35 APTMVNM BSS2 1 volume name 00174802 5 BASE 36 APTMSYS BSS 1 system name 00174803 5 BASE 37 APTMSPW BSS2 1 volume password 00174805 5 BASE 38 APTMACCT BSS2 1 account name 00174807 5 BASE 39 APTMDIVPRJ BSS 1 division-project 00174808 5 BASE 40 APTMACPW BSS2 1 account password (to fit equip block format) 0017480A 5 BASE 41 APTMLOGNM BSS2 1 log file name 0017480C 5 BASE 42 APTMLOGEX BSS 1 log file name extension 0017480D 5 BASE 43 APTMFPW BSS2 1 file password (to fit equip block format) 0017480F 5 BASE 44 APTACS BSS 1 equip access 45 DRCT 00000010 DISP 46 APTEMPSIZE EQU DISP APTMPP size of temp block 00000004 ABS 47 APTEMPLOG EQU APTEMPSIZE LOG 2 log size for free memory routines 48 ORG APTMPP recover lost space 49 00005316 50 ACCTINIT LABEL 00005316 51 ACCTRESTRT LABEL 05316 60000412 0 52 LD R0 CPPSA get our PSA pointer 05317 D1560813 0 BASE 53 STMW R0,PSSESLIM make session limit unlimited 05318 DC00286A 54 CALL GETSTACK get our stack 05319 40440003 IMM 55 PARVL STACKSIZE 0531A 11840001 6 IMM 56 SUB SP LOCALSSIZE allocate stack space for our variables 0531B 61440000 5 IMM 57 LD R5 0 indicate no temp block 58 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1127 (ACCPROCESS) F 56 Accounting Process 59 0000531C 60 ACCTAGAIN LABEL 61 PLOCK APLOCK lock the accounting process 0531C 0CC00000 61 IOFF 0531D D1C01D99 61 SETT APLOCK 0531E FE0C5320 61 JNE MA(2+DISPW MA 0) 0531F DC40308B 61 CALLNP LOCKWAIT 05320 61001D9A 4 62 LD R4 APLIST => first element in list 05321 FB30539F 4 63 JZA R4 ACTDONE jump if nothing left there 05322 60091F10 0 4 ZBM 64 LD R0 R4,APLINK get pointer to next one 05323 E4001D9A 0 65 ST R0 APLIST and remove current element from list 66 PUNLOCK APLOCK unlock the accounting process list 05324 EC001D99 66 STZ APLOCK 05325 0C800000 66 ION 05326 FB725333 5 67 JNZA R5 HAVETEMPB jump if a temp block exists 05327 DC002ED0 68 CALL UGETMEM otherwise, call for one 05328 40440004 IMM 69 PARVL APTEMPLOG indicating its length 05329 61520000 5 0 REG 70 LD R5 R0 copy the block pointer 0532A EC174802 5 BASE 71 STZ R5,APTMSYS now do some initialization 0532B EE174803 5 BASE 72 STZ2 R5,APTMSPW 0532C EE174808 5 BASE 73 STZ2 R5,APTMACPW clear the account password 0532D EE17480D 5 BASE 74 STZ2 R5,APTMFPW clear the file password 0532E EC17480F 5 BASE 75 STZ R5,APTACS clear access word 0532F 620053A9 01 76 LD2 R0 LOGFILENAM get the name of a log file 05330 E617480A 015 BASE 77 ST2 R0 R5,APTMLOGNM and set into equip block 05331 600053AB 0 78 LD R0 LOGFILEEXT similarly for the extension 05332 E417480C 0 5 BASE 79 ST R0 R5,APTMLOGEX 80 * \ / 81 82 ********************************************************************************** 83 * * 84 * We now have a log file record (ptr to element in * 85 * R4) that requires an entry to be made in a log file * 86 * (unless APWHOGETS is 0, an unlikely possibility). * 87 * We need to decide the account names of those who * 88 * get this information. All records use the primary * 89 * account name except the file type records which * 90 * use the secondary (file owner) account name. This * 91 * small kludge was done so that the accounting files * 92 * themselves remain consistent. * 93 * * 94 ********************************************************************************** 95 96 * \ / 00005333 97 HAVETEMPB LABEL 05333 62170803 014 BASE 98 LD2 R0 R4,APRECORD/AFRACCT get the account 05334 E6174805 015 BASE 99 ST2 R0 R5,APTMACCT save in temp block for equip 05335 60170805 0 4 BASE 100 LD R0 R4,APRECORD/AFRPROJ and the project 05336 E4174807 0 5 BASE 101 ST R0 R5,APTMDIVPRJ place into equip block 102 * \ / 103 104 ********************************************************************************** 105 * * 106 * Here we test the bits in the APWHOGETS field to * 107 * see which accounts get a log file entry. There are three * 108 * special checks for the following cases: * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1128 (ACCPROCESS) F 56 Accounting Process 109 * 1) The log entry is for a manager. We ensure that only * 110 * one entry shows up in Manager.XxxYxx:Accounting.Logfil * 111 * rather than one each for user and project manager. * 112 * 2) The log entry is on a null project. We ensure that only * 113 * one entry shows up in Manager.Xxx:Accounting.Logfil * 114 * rather than one each for project manager and division * 115 * manager. * 116 * 3) The log entry is on the system division. We ensure that * 117 * only one entry shows up in Manager.Sys:Accounting.Logfil * 118 * rather than one each for division manager and system * 119 * manager. * 120 * These cases may happen together. There will never be more * 121 * than one log file entry for a single event. * 122 * * 123 ********************************************************************************** 124 125 * \ / 00005337 126 DONEXT LABEL 05337 62002556 01 127 LD2 R0 RADMANAGER get the name of all managers 05338 66174805 015 BASE 128 CPR2 R0 R5,APTMACCT is this guy a manager? 05339 FE0C533D 129 JNE NORMPROC1 jump if no special case 0533A 60890010 2 4 ZBM 130 LD R2 R4,APWHOGETS/LIMACSUSR pick up this log file bit 0533B EC090010 4 ZBM 131 STZ R4,APWHOGETS/LIMACSUSR clear to prevent duplicate log file entries 0533C FC890210 2 4 ZBM 132 IORM R2 R4,APWHOGETS/LIMACSPROJ combine user and project bits 133 * \ / 134 0000533D 135 NORMPROC1 LABEL 0533D 38890010 2 4 ZBM 136 LEA R2 R4,APWHOGETS/LIMACSUSR point to user log file bit 0533E 5C168400 2 @R 137 CMZ @R2 check the current bit 0533F FE0C535D 138 JNE DOFILEHERE jump if bit was set 05340 E6174805 015 BASE 139 ST2 R0 R5,APTMACCT set account name to make project manager 05341 60040000 0 IMM 140 LD R0 0 05342 60574807 1 5 BASE 141 LD R1 R5,APTMDIVPRJ get the users div-proj 05343 58C40010 IMM 142 IORPSR PSRMODIF set funny arithmetic 05344 1404FA00 0 IMM 143 DIV R0 DVSNDISP separate division from project part 05345 1C04FA00 0 IMM 144 MUL R0 DVSNDISP put division back to correct space 05346 58840010 IMM 145 CLBPSR PSRMODIF restore normal arithmetic 05347 64574807 1 5 BASE 146 CPR R1 R5,APTMDIVPRJ is division-project same as division? 05348 FE0C534C 147 JNE NORMPROC2 jump if not 05349 60890210 2 4 ZBM 148 LD R2 R4,APWHOGETS/LIMACSPROJ pick up this log file bit 0534A EC090210 4 ZBM 149 STZ R4,APWHOGETS/LIMACSPROJ and clear to prevent duplicates 0534B FC890410 2 4 ZBM 150 IORM R2 R4,APWHOGETS/LIMACSDIV combine project and division bits 151 * \ / 152 0000534C 153 NORMPROC2 LABEL 0534C 38890210 2 4 ZBM 154 LEA R2 R4,APWHOGETS/LIMACSPROJ point to project manager log file bit 0534D 5C168400 2 @R 155 CMZ @R2 check the current bit 0534E FE0C535D 156 JNE DOFILEHERE jump if bit was set 0534F E4574807 1 5 BASE 157 ST R1 R5,APTMDIVPRJ set division into equip block 05350 60002555 0 158 LD R0 DOTSYS get extension for system manager 05351 64174807 0 5 BASE 159 CPR R0 R5,APTMDIVPRJ check for the div-proj already system manager 05352 FE0C5356 160 JNE NORMPROC3 jump if not 05353 60890410 2 4 ZBM 161 LD R2 R4,APWHOGETS/LIMACSDIV pick up this log file bit 05354 EC090410 4 ZBM 162 STZ R4,APWHOGETS/LIMACSDIV and clear to prevent duplicates 05355 FC890610 2 4 ZBM 163 IORM R2 R4,APWHOGETS/LIMACSSYS combine division and system mgr bits 164 * \ / 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1129 (ACCPROCESS) F 56 Accounting Process 165 00005356 166 NORMPROC3 LABEL 05356 38890410 2 4 ZBM 167 LEA R2 R4,APWHOGETS/LIMACSDIV point to division manager log file bit 05357 5C168400 2 @R 168 CMZ @R2 check the current bit 05358 FE0C535D 169 JNE DOFILEHERE jump if it was set 05359 E4174807 0 5 BASE 170 ST R0 R5,APTMDIVPRJ set system mgr div-proj into equip block 0535A 38890610 2 4 ZBM 171 LEA R2 R4,APWHOGETS/LIMACSSYS point to system manager log file bit 0535B 5C168400 2 @R 172 CMZ @R2 check the current bit 0535C FE025391 173 JEQ ENTDONE jump if not, we are done 174 * \ / 175 0000535D 176 DOFILEHERE LABEL 0535D E4978800 2 6 BASE 177 ST R2 SP,WHICHFILE save pointer to current log bit 0535E EC178C00 6 FPVR 178 STZ @(SP,WHICHFILE) indicate record written for this file 0535F EE174800 5 BASE 179 STZ2 R5,APTMVNM clear the volume name 05360 60048050 0 IMM 180 LD R0 XRSUSPERR+FREQUIPW attempt to equip the requested log file 05361 60534000 1 5 REG 181 LD R1 R5 copy the pointer to the equip block 05362 0884000C IMM 182 FREQ ACLUN try for an equip 05363 FA085386 0 183 JLTZ R0 CHKBUSY check for a busy file 184 05364 60040030 0 IMM 185 LD R0 FRREAD get the read request code 05365 60440008 1 IMM 186 LD R1 2*CPW read first two words from file 05366 38974800 2 5 BASE 187 LEA R2 R5,APTMVNM over top of volume name 05367 0884000C IMM 188 FREQ ACLUN try read 05368 FA085382 0 189 JLTZ R0 ABNORMAL jump if error 05369 60574801 1 5 BASE 190 LD R1 R5,APTMVNM(1) get our store pointer 0536A 6847FFCC 1 IMM 191 UCPR R1 -AFRMAXLEN enough room left before end? 0536B FE04536E 192 JGT NOROOM jump if not, start file over 0536C 68440008 1 IMM 193 UCPR R1 2*CPW pointing at pointer words? 0536D FE065370 194 JGE AFPTROK jump if okay 0000536E 195 NOROOM LABEL otherwise, must reset output pointer 0536E 60440008 1 IMM 196 LD R1 2*CPW 0536F E4574801 1 5 BASE 197 ST R1 R5,APTMVNM(1) 00005370 198 AFPTROK LABEL 05370 60040090 0 IMM 199 LD R0 FRPOSITION load a seek request 05371 0884000C IMM 200 FREQ ACLUN (seek addr in R1) do a position 05372 FA085382 0 201 JLTZ R0 ABNORMAL jump on error 05373 60491F11 1 4 ZBM 202 LD R1 R4,APRECORD/AFRLEN get the record length 05374 98574801 1 5 BASE 203 ADDM R1 R5,APTMVNM(1) advance the store pointer 05375 60040042 0 IMM 204 LD R0 FRWRITEB get code for binary write 05376 38970801 2 4 BASE 205 LEA R2 R4,APRECORD make address of record 05377 0884000C IMM 206 FREQ ACLUN out onto our trusty unit 05378 FA085382 0 207 JLTZ R0 ABNORMAL jump on error 05379 60040090 0 IMM 208 LD R0 FRPOSITION get the seek request code 0537A 60440004 1 IMM 209 LD R1 AFEND address of end pointer word 0537B 0884000C IMM 210 FREQ ACLUN do a position 0537C FA085382 0 211 JLTZ R0 ABNORMAL jump on any error 0537D 60040042 0 IMM 212 LD R0 FRWRITEB get the code for binary write 0537E 60440004 1 IMM 213 LD R1 1*CPW get the record size 0537F 38974801 2 5 BASE 214 LEA R2 R5,APTMVNM(1) and address 05380 0884000C IMM 215 FREQ ACLUN write the new end pointer out 05381 FA065382 0 216 JGEZ R0 WRITE2OK jump on good status 217 * \ / 218 219 ********************************************************************************** 220 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1130 (ACCPROCESS) F 56 Accounting Process 221 * Come here if the log file that we were trying to access * 222 * is A/U, DSE, write protected, etc. Note that because log * 223 * files are repeatedly accessed, we may come here LOTS for * 224 * a single bad file. * 225 * * 226 ********************************************************************************** 227 228 * \ / 00005382 229 ABNORMAL LABEL 230 *** LOG error if deemed appropriate 00005382 231 WRITE2OK LABEL 05382 60040060 0 IMM 232 LD R0 FRUNEQUIP load code for unequip 05383 0884000C IMM 233 FREQ ACLUN free up our unit 05384 FA065337 0 234 JGEZ R0 DONEXT jump to continue 05385 001310C0 235 HALT HALTS10C0 couldn't unequip work unit 236 * --- 237 238 ********************************************************************************** 239 * * 240 * If the required logging file was unaccessable because * 241 * it was busy, we suspend the accounting of this event for * 242 * some short time (5 sec) and then we re-try access to the * 243 * file. This allows the waiting on busy files without tying * 244 * up this process so that other accounting backs up. * 245 * * 246 ********************************************************************************** 247 00005386 248 CHKBUSY LABEL 05386 600A2AB0 0 0 CBM 249 LD R0 R0/FDSTATERR get the error code 05387 6404008A 0 IMM 250 CPR R0 XREQERFBZ is it file busy? 05388 FE0C5337 251 JNE DONEXT on unavailable file, causes accting to be forgotten 00005389 252 REQUEUE LABEL 05389 EDD78C00 6 FPVR 253 STW @(SP,WHICHFILE) don't forget this one next time 0538A D0001DA0 254 INC APREQUE count how many elements in this state 0538B DC0044F8 255 CALL TIMESET suspend this accounting element 0538C 43441388 IMM 256 PARV2 5*MSECSS give 5 seconds 0538D 41440000 IMM 257 PARV 0 any CPU can handle this 0538E 41005028 258 PAR ACCTREQUE indicate who to call 0538F 40530000 4 REG 259 PARVL R4 pass pointer to queue block 05390 FE0E531C 260 JMP ACCTAGAIN go on to next queue element 261 * --- 262 263 ********************************************************************************** 264 * The accounting files have all had this entry made in * 265 * them. Get rid of this element and go see if there are * 266 * more. * 267 ********************************************************************************** 268 00005391 269 ENTDONE LABEL 05391 60890051 2 4 ZBM 270 LD R2 R4,APRECORD/AFRTYPE get the type of the record 05392 FA8C5397 2 271 JNEZ R2 ENTDONEY jump if not sleep 05393 5C001DA0 272 CMZ APREQUE are there any suspended elements? 05394 FE0C5389 273 JNE REQUEUE if so, we can't sleep yet 05395 5C001D9A 274 CMZ APLIST is there a requeued element in the list behind us? 05396 FE0C5389 275 JNE REQUEUE wait for it if so 00005397 276 ENTDONEY LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1131 (ACCPROCESS) F 56 Accounting Process 05397 DC002F5D 277 CALL SFREEMEM free up the element 05398 41440004 IMM 278 PARV APLOG indicate length 05399 40530000 4 REG 279 PARVL R4 and address 0539A FA8C531C 2 280 JNEZ R2 ACCTAGAIN jump if not a sleep marker 281 * \ / 282 PLOCK APLOCK lock the list for proper exit 0539B 0CC00000 282 IOFF 0539C D1C01D99 282 SETT APLOCK 0539D FE0C539F 282 JNE MA(2+DISPW MA 0) 0539E DC40308B 282 CALLNP LOCKWAIT 283 0000539F 284 ACTDONE LABEL 0539F FB7053A3 5 285 JZA R5 NOTEMB jump if no temp block assigned 053A0 DC002F5D 286 CALL UFREEMEM otherwise, free 053A1 41440004 IMM 287 PARV APTEMPLOG indicate its length 053A2 40534000 5 REG 288 PARVL R5 and address 000053A3 289 NOTEMB LABEL 053A3 EC001D9B 290 STZ APBUSY indicate that I no longer exist 291 PUNLOCK APLOCK let others see the list 053A4 EC001D99 291 STZ APLOCK 053A5 0C800000 291 ION 053A6 DC002875 292 CALL FREESTACK 053A7 40440003 IMM 293 PARVL STACKSIZE 053A8 FE0E2DAC 294 JMP LIQUIDATE I'm gone 295 * --- 296 053A9 452CA330 297 LOGFILENAM PAK12 ACCOUNTING file name for log file 053AB 8A28910E 298 LOGFILEEXT PAK6 LOGFIL and its extension 299 300 END ACCTINIT and ACCTRESTRT routines 100 INPUT SUBSPROCESS substitution process 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1132 (SUBSPROCESS) F 57 Disk Block Substitution Process 3 4 BLOCK Substitution Process 5 6 ENTRY SUBSPROC MS block substitute/unsubstitute 7 trace events invoked elsewhere 8 ENTRY SUBTCALL (substitute required) 9 ENTRY SUBTCALLU (unsubstitute required) 10 ENTRY SUBTELEM (subs/unsubs request element built) 11 ENTRY SUBTBPROC (subs/unsubs process is built) 12 13 ********************************************************************************** 14 * * 15 * This is the code for the disk block substitution process. Its * 16 * job is to substitute blocks when a soft I/O error is encountered, * 17 * and to unsubstitute blocks when a substituted block is freed. * 18 * * 19 * There may be one copy of this process for each volume. When a * 20 * soft I/O error occurs or a substituted block is freed, the system * 21 * checks to see if a substitution process already exists for the * 22 * affected volume, and if not, it creates one. The substitution * 23 * process satisfies all queued requests for it, then liquidates * 24 * itself. * 25 * * 26 * When this routine is entered, R4 = the volume number of the volume * 27 * on which we will operate. That volume's VOLNBUSY counter has been * 28 * incremented to account for our presence, this prevents the volume * 29 * from being dismounted. * 30 * * 31 * Please see the comments with the substitution and unsubstitution * 32 * routines. * 33 * * 34 * Window usage is as follows: * 35 * WNDO1 - bad tracks block * 36 * WNDO2 - substitution block * 37 * WNDO3 - user's block that needs substitution * 38 * * 39 ********************************************************************************** 40 41 * The following are trace events associated with the substitution process 00000000 ABS 42 SUBTCALL EQU 0 call to substitute a block 00000001 ABS 43 SUBTCALLU EQU 1 call to unsubstitute a block 00000002 ABS 44 SUBTELEM EQU 2 element to link onto VOLN element is built 00000003 ABS 45 SUBTBPROC EQU 3 process to do sub/unsub is built 00000004 ABS 46 SUBTENTR EQU 4 sub process entered 00000005 ABS 47 SUBTHELM EQU 5 have element from VOLN 00000006 ABS 48 SUBTUHALT EQU 6 HALTS10D8 encountered 00000007 ABS 49 SUBTUFND EQU 7 block to unsub found in SUBSLIST 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1133 (SUBSPROCESS) F 57 Disk Block Substitution Process 51 52 ********************************************************************************** 53 * * 54 * SUBSPROC - Main Routine. * 55 * * 56 * Stack required = 20. * 57 * WARNING!!! See STACKSIZE below. * 58 * 0 + max ( DISMOUNT (3), FREESTACK (0), GETSTACK (0), * 59 * GRUBWNDOx (7), LIQUIDATE (7), LOCKWAIT (0), * 60 * MAPOUTFBI (2), SETWNDOx (4), SFREEMEM (0), * 61 * SUBBLOCK (20), TRACEPROC (3), UNSUBBLOCK (8) ) * 62 * * 63 ********************************************************************************** 64 65 BLOCK SUBSPROC routine 66 ENTRY SUBSPROC 67 0000001F ABS 68 STACKSIZE EQU 31 size of stack to get 69 000053AC 70 SUBSPROC LABEL 71 * R4 = volume number 053AC 60130000 0 4 REG 72 LD R0 R4 set up for TRACE 73 TRACE SUBSTRACE,SUBTENTR 053AD 5D401D32 73 XCT TRACECALL(SUBSTRACE) 053AE FEC000C4 73 NOP (SUBSTRACE*BITS 22:26)+(SUBTENTR*BITS 27:31) 74 * \ / 053AF DC00286A 75 CALL GETSTACK get a stack for this routine 053B0 4044001F IMM 76 PARVL STACKSIZE indicate its size 053B1 61281F22 4 4 77 LD VLN VOLNTABLE(R4) convert volume number to VOLN element pointer 78 * \ / 79 * Map in the bad tracks and substitution blocks 053B2 DC003205 80 CALL SETWNDO1 map in bad tracks block 053B3 41440002 IMM 81 PARV VPCNTLW+VPCNTLLK window will be locked 053B4 41440000 IMM 82 PARV VPNOFCB not from a file 053B5 410053F9 83 PAR BTRXBLKERR where to go if error 053B6 60170806 0 4 BASE 84 LD R0 VLN,VOLNBLOCK get prototype disk address 053B7 EC0A1180 0 CBM 85 STZ R0/MSBLKFIELD leave volume number while clearing block addr 053B8 18090181 0 4 ZBM 86 ADD R0 VLN,VOLNBTRXBK combine btrx address with volume number 053B9 41520000 0 REG 87 PARV R0 block number of bad tracks block 053BA 40440002 IMM 88 PARVL FBITBTRX fbi type expected 053BB DC40261B 89 CALLNP MAPOUTFBI unmap FBI, ION 90 * \ / 053BC DC0031FF 91 CALL SETWNDO2 map in the substitution block 053BD 41440002 IMM 92 PARV VPCNTLW+VPCNTLLK window will be locked 053BE 41440000 IMM 93 PARV VPNOFCB not from a file 053BF 410053FA 94 PAR SUBSBLKERR where to go if error 053C0 60170806 0 4 BASE 95 LD R0 VLN,VOLNBLOCK 053C1 EC0A1180 0 CBM 96 STZ R0/MSBLKFIELD 053C2 18093181 0 4 ZBM 97 ADD R0 VLN,VOLNSUBBLK 053C3 41520000 0 REG 98 PARV R0 block number of substitution block 053C4 40440005 IMM 99 PARVL FBITSUBS FBI type expected 053C5 DC40261B 100 CALLNP MAPOUTFBI unmap FBI, ION 101 * \ / 102 103 ********************************************************************************** 104 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1134 (SUBSPROCESS) F 57 Disk Block Substitution Process 105 * Finding the bad tracks block or substitution block in * 106 * the substitution list would mean there was an error with one * 107 * of those blocks, and the disk drive or controller is very * 108 * probably sick. Check for this. If it is the case, we have * 109 * no choice but to punt (HALT). * 110 * * 111 ********************************************************************************** 112 113 * \ / 114 PLOCK (VLN,VOLNSUBQL) lock queue of requests 053C6 0CC00000 114 IOFF 053C7 D1D7080B 4 BASE 114 SETT (VLN,VOLNSUBQL) 053C8 FE0C53CA 114 JNE MA(2+DISPW MA 0) 053C9 DC40308B 114 CALLNP LOCKWAIT 053CA 6017080A 0 4 BASE 115 LD R0 VLN,VOLNSUBQ R0 -> queue of requests 053CB 60490181 1 4 ZBM 116 LD R1 VLN,VOLNBTRXBK R1 = bad tracks block number (w/o vol) 053CC 3C481181 1 0 ZBM 117 LSRCH R1 R0,SUBQBLOCK/MSBLKFIELD 053CD FE0253D2 118 JEQ DISKBAD jump if bad tracks block request found 053CE 6017080A 0 4 BASE 119 LD R0 VLN,VOLNSUBQ R0 -> queue of requests 053CF 60493181 1 4 ZBM 120 LD R1 VLN,VOLNSUBBLK R1 = substitution block num (w/o vol) 053D0 3C481181 1 0 ZBM 121 LSRCH R1 R0,SUBQBLOCK/MSBLKFIELD 053D1 FE0C53D3 122 JNE DISKGOOD jump if not found 123 * \ / 053D2 009010D1 124 DISKBAD STOP STOPP10D1 many hardware errors on disk. GO will 125 * \ / attempt to continue. 000053D3 126 DISKGOOD LABEL 127 PUNLOCK (VLN,VOLNSUBQL) unlock the queue 053D3 EC17080B 4 BASE 127 STZ (VLN,VOLNSUBQL) 053D4 0C800000 127 ION 128 * \ / 129 130 ********************************************************************************** 131 * * 132 * Process the first request. * 133 * * 134 ********************************************************************************** 135 136 * \ / 000053D5 137 SUBSAGAIN LABEL 138 PLOCK (VLN,VOLNSUBQL) lock queue of requests 053D5 0CC00000 138 IOFF 053D6 D1D7080B 4 BASE 138 SETT (VLN,VOLNSUBQL) 053D7 FE0C53D9 138 JNE MA(2+DISPW MA 0) 053D8 DC40308B 138 CALLNP LOCKWAIT 053D9 6157080A 5 4 BASE 139 LD R5 VLN,VOLNSUBQ R5 -> a request 053DA FB4253EC 5 140 JEQZ R5 NOREQUESTS jump if all done 053DB 60095F10 0 5 ZBM 141 LD R0 R5,SUBQLINK get link to next element 053DC E417080A 0 4 BASE 142 ST R0 VLN,VOLNSUBQ remove request from queue 143 PUNLOCK (VLN,VOLNSUBQL) unlock the queue 053DD EC17080B 4 BASE 143 STZ (VLN,VOLNSUBQL) 053DE 0C800000 143 ION 053DF 60894080 2 5 ZBM 144 LD R2 R5,SUBQREQ R2 = request code 053E0 60D74801 3 5 BASE 145 LD R3 R5,SUBQBLOCK R3 = block number 053E1 DC002F5D 146 CALL SFREEMEM free the queue element 053E2 41440001 IMM 147 PARV SUBQLOG size of element 053E3 40534000 5 REG 148 PARVL R5 address of block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1135 (SUBSPROCESS) F 57 Disk Block Substitution Process 053E4 6012C000 0 3 REG 149 LD R0 R3 block number in R0 150 TRACE SUBSTRACE,SUBTHELM 053E5 5D401D32 150 XCT TRACECALL(SUBSTRACE) 053E6 FEC000C5 150 NOP (SUBSTRACE*BITS 22:26)+(SUBTHELM*BITS 27:31) 053E7 FA8C53EA 2 151 JNEZ R2 UNDOSUB jump if unsubstitute request 152 * \ / 153 154 * request is to substitute 053E8 DC4053FB 155 CALLNP SUBBLOCK substitute a block 053E9 FE0E53D5 156 JMP SUBSAGAIN and try again 157 * --- 158 159 * request is to unsubstitute 000053EA 160 UNDOSUB LABEL 053EA DC405485 161 CALLNP UNSUBBLOCK unsubstitute a block 053EB FE0E53D5 162 JMP SUBSAGAIN and try again 163 * --- 164 165 ********************************************************************************** 166 * * 167 * Request list is empty. Try to dismount the volume if no * 168 * one else is using it. Then go away. * 169 * * 170 ********************************************************************************** 171 000053EC 172 NOREQUESTS LABEL 053EC EC090610 4 ZBM 173 STZ VLN,VOLNSBFLAG say process no longer active 053ED D0570815 4 BASE 174 DEC VLN,VOLNBUSY decrement volume use count 175 PUNLOCK (VLN,VOLNSUBQL) unlock the request queue 053EE EC17080B 4 BASE 175 STZ (VLN,VOLNSUBQL) 053EF 0C800000 175 ION 053F0 DC403150 176 CALLNP GRUBWNDO1 get rid of the bad tracks block 053F1 DC403153 177 CALLNP GRUBWNDO2 get rid of the substitution block 053F2 5C170815 4 BASE 178 CMZ VLN,VOLNBUSY check for zero busy count 053F3 FE0C53F6 179 JNE SUBSVBSY if volume busy, skip dismount check 053F4 DC005034 180 CALL DISMOUNT try to dismount this volume 053F5 40530000 4 REG 181 PARVL VLN pointer to the VOLN element 000053F6 182 SUBSVBSY LABEL 053F6 DC002875 183 CALL FREESTACK return stack and console area 053F7 4044001F IMM 184 PARVL STACKSIZE word length of stack 053F8 FE0E2DAC 185 JMP LIQUIDATE fall on our own sword 186 * --- 187 188 ********************************************************************************** 189 * * 190 * We come here if an I/O error occurs on any window. * 191 * Since we are trying to substitute a block on which an I/O * 192 * error occurred, any furthur errors in this code mean that * 193 * the disk is very probably sick. Therefore, we bare the ol' * 194 * bodkin. * 195 * * 196 ********************************************************************************** 197 053F9 001010D2 198 BTRXBLKERR HALT HALTP10D2 error on bad tracks block 199 * --- VLN -> voln element 200 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1136 (SUBSPROCESS) F 57 Disk Block Substitution Process 053FA 001010D3 201 SUBSBLKERR HALT HALTP10D3 error on substitution block 202 * --- VLN -> voln element 203 204 END SUBSPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1137 (SUBSPROCESS) F 57 Disk Block Substitution Process 206 207 ********************************************************************************** 208 * * 209 * Routine to substitute a block. * 210 * Call: * 211 * LD R3 failing block number * 212 * LD VLN PTR VOLN element * 213 * CALLNP SUBBLOCK * 214 * * 215 * Eats R0:R3. * 216 * Stack required = 21. * 217 * 6 + max ( ERRORLOG/VOLTODISK (4), FORCEWRWx (7), * 218 * GETFREEBLK (15), GRUBWNDO3 (7), LOCKPAGE (1), * 219 * LOCKWAIT (0), MAPINFBI (2), MAPOUTFBI (2), * 220 * SETERRW3 (1), SETWNDO3 (4), SGETMEM (0) ) * 221 * * 222 * The bad block should already be resident on a PPAGELIST, and its * 223 * PPBUSYWORD has been incremented to account for our activity. * 224 * WNDO1 and WNDO2 should already have the bad tracks list and the * 225 * substitution block locked into them. * 226 * * 227 * If the bad block is already substituted, that means that the * 228 * substitute block is bad, too, and we should re-substitute it. * 229 * We proceed as follows: * 230 * 1. Make an entry in the bad tracks block and force-write it. * 231 * 2. Check the block's FBI. If the block is not substitutable, * 232 * then we don't substitute it. * 233 * 3. Get a new block and update the resident substitution list. * 234 * 4. Map in the user's block, decrement its PPBUSYWORD, then * 235 * force-write it (it will go to its substitute location). * 236 * 5. Update and force-write the substitution block. * 237 * * 238 ********************************************************************************** 239 240 BLOCK SUBBLOCK subroutine 241 ENTRY SUBBLOCK 242 00128000 2 REG 243 FBI EQU R2 244 245 BEGFRAME 00178801 6 BASE 246 PPLADDR BSS 1 ptr to block's PPL 00178802 6 BASE 247 VIRTBLK BSS 1 virtual block number (the number that 248 * the rest of the system knows) 00178803 6 BASE 249 REALBLK BSS 1 real block number (after any previous 250 * substitutions), this loc also used to 251 * hold FBI type for SETWNDO3 at MOVEBLOCK 00178804 6 BASE 252 NEWBLK BSS 1 new place to put block 253 * If the volume number field is zero, 254 * then this is the error code: 255 * 1 - block is not substitutable 256 * 2 - no free space on volume 257 * 3 - block is a free block 258 ENDFRAME 259 053FB DD5F8005 6 STAK 260 SUBBLOCK ENTRNP PUSH 053FC 61538000 5 6 REG 261 LD R5 SP R5 -> our stack frame 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1138 (SUBSPROCESS) F 57 Disk Block Substitution Process 053FD E4D74802 3 5 BASE 262 ST R3 R5,VIRTBLK save input block number 053FE E4D74803 3 5 BASE 263 ST R3 R5,REALBLK assume it is not substituted 264 * \ / 265 266 ********************************************************************************** 267 * * 268 * See if bad block already has a substitute. If so, * 269 * the substitute is now bad, so save its address, too. * 270 * * 271 ********************************************************************************** 272 273 * \ / 274 PLOCK SUBSLOCK lock the substitution list 053FF 0CC00000 274 IOFF 05400 D1C01F62 274 SETT SUBSLOCK 05401 FE0C5403 274 JNE MA(2+DISPW MA 0) 05402 DC40308B 274 CALLNP LOCKWAIT 05403 60001F63 0 275 LD R0 SUBSLIST R0 -> substitution list 05404 3CD60801 3 0 BASE 276 LSRCH R3 R0,SUBLBAD see if already substituted 05405 FE0C5408 277 JNE NOTSUBD jump if not 05406 60160802 0 0 BASE 278 LD R0 R0,SUBLGOOD get substitute block number 05407 E4174803 0 5 BASE 279 ST R0 R5,REALBLK and save it 00005408 280 NOTSUBD LABEL 281 PUNLOCK SUBSLOCK unlock the substitution list 05408 EC001F62 281 STZ SUBSLOCK 05409 0C800000 281 ION 282 * \ / 283 284 ********************************************************************************** 285 * * 286 * Update and write the bad tracks block * 287 * * 288 ********************************************************************************** 289 290 * \ / 0540A 60174803 0 5 BASE 291 LD R0 R5,REALBLK R0 is the bad block number 0540B 7800254F 0 292 AND R0 MSBLKMASK strip the volume number 0540C 60440800 1 IMM 293 LD R1 ADR WNDO1 R1 -> beginning of bad tracks block 0000540D 294 SEARCHBTRX LABEL 0540D 5C084080 1 ZBM 295 CMZ R1,BTRXEL/BTRXREASON 0540E FE025416 296 JEQ NOTINBTRX jump if end of data in btrx block 0540F 64085180 0 1 ZBM 297 CPR R0 R1,BTRXEL/MSBLKFIELD 05410 FE02541E 298 JEQ INBTRX jump if already in btrx block 05411 18440002 1 IMM 299 ADD R1 BTRXLNTH point to next entry 05412 64440BFE 1 IMM 300 CPR R1 ADR WNDO1(WPP)(-BTRXLNTH) 05413 FE0A540D 301 JLE SEARCHBTRX jump if not off end of block 302 * \ / 05414 008610D4 303 STOP STOPF10D4 bad tracks block is full. GO will 304 * \ / not put new entry into list. 05415 FE0E541E 305 JMP INBTRX 306 * --- 307 00005416 308 NOTINBTRX LABEL 05416 E4164800 0 1 BASE 309 ST R0 R1,BTRXEL save block number 05417 60040020 0 IMM 310 LD R0 BTRXRTDE get reason code 05418 E4084080 0 1 ZBM 311 ST R0 R1,BTRXEL/BTRXREASON save it 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1139 (SUBSPROCESS) F 57 Disk Block Substitution Process 05419 60101EE7 0 @ 312 LD R0 @FDATEPTR get current date (more or less) 0541A E4164801 0 1 BASE 313 ST R0 R1,BTRXDATE say when found 0541B DC40319D 314 CALLNP FORCEWRW1 write the bad tracks block 0541C 60040082 0 IMM 315 LD R0 PNWNDO1 page number holding bad trax block 0541D DC4031DE 316 CALLNP LOCKPAGE reference the page to wait for write completion 317 * \ / 318 319 ********************************************************************************** 320 * * 321 * Find the page's PPL and see if the block is substitutable * 322 * * 323 ********************************************************************************** 324 325 * \ / 0000541E 326 INBTRX LABEL 0541E 60974802 2 5 BASE 327 LD R2 R5,VIRTBLK Get the system's MS address 0541F 604AB460 1 2 CBM 328 LD R1 R2/PPHASHFLD R1 = index of PP list 329 PLOCK PPAGELOCK(R1) lock the list 05420 0CC00000 329 IOFF 05421 D1E21E21 1 329 SETT PPAGELOCK(R1) 05422 FE0C5424 329 JNE MA(2+DISPW MA 0) 05423 DC40308B 329 CALLNP LOCKWAIT 05424 60221E61 0 1 330 LD R0 PPAGELIST(R1) R0 -> first element on list 05425 3C960801 2 0 BASE 331 LSRCH R2 R0,PPBLOCK find the PPL 05426 FE025428 332 JEQ FOUNDPPL 05427 001310D5 333 HALT HALTS10D5 PPL not found 334 * --- 335 00005428 336 FOUNDPPL LABEL 05428 E4174801 0 5 BASE 337 ST R0 R5,PPLADDR save the address 338 PUNLOCK PPAGELOCK(R1) unlock the list 05429 EC221E21 1 338 STZ PPAGELOCK(R1) 0542A 0C800000 338 ION 0542B DC002606 339 CALL MAPINFBI get access to FBI, IOFF 0542C 40520000 0 REG 340 PARVL R0 pass physical page element 0542D 60084411 0 1 ZBM 341 LD R0 R1,FBINOSUB Check the No-Substitute marker bit 0542E 60484080 1 1 ZBM 342 LD R1 R1,FBITYPE get the type of block 0542F DC40261B 343 CALLNP MAPOUTFBI unmap FBI, ION 05430 FA0C547E 0 344 JNEZ R0 CANTSUB jump if block is not substitutable 05431 6444007F 1 IMM 345 CPR R1 FBITFREE is this a free block? 05432 FE025482 346 JEQ NODATAHERE jump if so, no actual substitution to do 347 * \ / 348 349 ********************************************************************************** 350 * * 351 * Get a free block and update the resident substitution list. * 352 * * 353 ********************************************************************************** 354 355 * \ / 05433 DC003654 356 CALL GETFREEBLK get a free block 05434 41440000 IMM 357 PARV 0 fbi type - how should I know? 05435 40490086 4 ZBM 358 PARVL VLN,VOLNNUM volume number 05436 FE0C5480 359 JNE NOSPACE jump if no space left 05437 E4174804 0 5 BASE 360 ST R0 R5,NEWBLK save new block number 361 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1140 (SUBSPROCESS) F 57 Disk Block Substitution Process 362 PLOCK SUBSLOCK lock the substitution list 05438 0CC00000 362 IOFF 05439 D1C01F62 362 SETT SUBSLOCK 0543A FE0C543C 362 JNE MA(2+DISPW MA 0) 0543B DC40308B 362 CALLNP LOCKWAIT 0543C 60174802 0 5 BASE 363 LD R0 R5,VIRTBLK virtual block number 0543D 64174803 0 5 BASE 364 CPR R0 R5,REALBLK Check against actual location 0543E FE025446 365 JEQ NEWSUB jump if block is a first timer 366 367 * block is already substituted 0543F 60401F63 1 368 LD R1 SUBSLIST get head of substitution list 05440 3C164801 0 1 BASE 369 LSRCH R0 R1,SUBLBAD find entry on list 05441 FE025443 370 JEQ GOTENTRY jump if found 05442 001310D6 371 HALT HALTS10D6 substitution list entry not found 372 * --- 373 00005443 374 GOTENTRY LABEL 05443 60174804 0 5 BASE 375 LD R0 R5,NEWBLK Get number of new block 05444 E4164802 0 1 BASE 376 ST R0 R1,SUBLGOOD set new substitution for block 05445 FE0E544F 377 JMP DIDREZSUB now done with resident list 378 * --- 379 00005446 380 NEWSUB LABEL 05446 DC002ED0 381 CALL SGETMEM get space for SUBLIST element 05447 40440002 IMM 382 PARVL SUBLLOG size of element 05448 60574802 1 5 BASE 383 LD R1 R5,VIRTBLK 05449 E4560801 1 0 BASE 384 ST R1 R0,SUBLBAD set bad block number 0544A 60574804 1 5 BASE 385 LD R1 R5,NEWBLK 0544B E4560802 1 0 BASE 386 ST R1 R0,SUBLGOOD set good block number 0544C 60401F63 1 387 LD R1 SUBSLIST 0544D E4560800 1 0 BASE 388 ST R1 R0,SUBLLINK link this element at top of list 0544E E4001F63 0 389 ST R0 SUBSLIST set new list pointer 390 * \ / 391 0000544F 392 DIDREZSUB LABEL 393 PUNLOCK SUBSLOCK unlock the substitution list 0544F EC001F62 393 STZ SUBSLOCK 05450 0C800000 393 ION 394 * \ / 395 396 ********************************************************************************** 397 * * 398 * Bad tracks block and resident substitution list entries * 399 * have been made. Now it's time to cause the resident data * 400 * to be written to the fresh disk block. * 401 * * 402 * Since the block is resident, the SETWNDO3 will get us the * 403 * block's data without going through the disk driver. * 404 * * 405 * N.B. We purposely map the page without specifying an FBI * 406 * type. This is required in case it is a swapping page for * 407 * the real user of the block. Since grubbing a substituted * 408 * swapping page causes an unsubstitution to be queued, a * 409 * duplicate unsubs would occur if we also held the block as * 410 * a swapping page (in turn leading to a HALT S10D8 when the * 411 * subs entry isn't found on the second unsubs). * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1141 (SUBSPROCESS) F 57 Disk Block Substitution Process 412 * * 413 ********************************************************************************** 414 415 * \ / 00005451 416 MOVEBLOCK LABEL 05451 DC003202 417 CALL SETWNDO3 map in the user block 05452 41440003 IMM 418 PARV VPCNTLRO+VPCNTLLK read/only 05453 41440000 IMM 419 PARV VPNOFCB not from a file 05454 41005457 420 PAR USERBLKERR where to go if error 05455 41574802 5 BASE 421 PARV R5,VIRTBLK block number 05456 40440000 IMM 422 PARVL 0 ignore fbi type 423 424 * \ / 00005457 425 USERBLKERR LABEL 05457 DC40261B 426 CALLNP MAPOUTFBI unmap FBI, ION 05458 60040000 0 IMM 427 LD R0 0 05459 DC40318A 428 CALLNP SETERRW3 clear error trap 429 * \ / 0545A 60D74801 3 5 BASE 430 LD R3 R5,PPLADDR R3 -> block's PPL 0545B D056C802 3 BASE 431 DEC R3,PPBUSYWORD undo INC that happened long ago 0545C 5C094084 5 ZBM 432 CMZ R5,NEWBLK/VOLFIELD did we really substitute? 0545D FE02546B 433 JEQ AFTERSUBS jump if not, must skip force 434 * \ / 0545E DC4031A3 435 CALLNP FORCEWRW3 force-write the data to new location 0545F DC403156 436 CALLNP GRUBWNDO3 unmap the window 437 * \ / 438 439 ********************************************************************************** 440 * * 441 * Update the substitution list on the disk. * 442 * * 443 ********************************************************************************** 444 445 446 * search subs block for insertion point 447 * (same as existing on re-substitute) 05460 60174802 0 5 BASE 448 LD R0 R5,VIRTBLK MS address of bad block 05461 7800254F 0 449 AND R0 MSBLKMASK strip the volume number 05462 60440C00 1 IMM 450 LD R1 ADR WNDO2 R1 -> first element in substitution blk 00005463 451 SEARCHSUBS LABEL 05463 5C164800 1 BASE 452 CMZ R1,SUBSBADDY end of info in subs block? 05464 FE02546E 453 JEQ FOUNDPLACE jump if yes 05465 64164800 0 1 BASE 454 CPR R0 R1,SUBSBADDY found our entry? 05466 FE02546E 455 JEQ FOUNDPLACE jump if yes 05467 18440002 1 IMM 456 ADD R1 SUBSLNTH point to next entry 05468 64440FFE 1 IMM 457 CPR R1 ADR WNDO2(WPP)(-SUBSLNTH) off end of block? 05469 FE0A5463 458 JLE SEARCHSUBS jump if room left 0546A 008610D7 459 STOP STOPF10D7 substitution block is full 460 * \ / GO will not put new entry anywhere 0000546B 461 AFTERSUBS LABEL 0546B DC403156 462 CALLNP GRUBWNDO3 unmap the window 0546C 60C40E3B 3 IMM 463 LD R3 ERLCNOSUB say we didn't substitute 0546D FE0E5476 464 JMP CALLLOG jump to make log entry 465 * --- 466 467 * R1 => insertion point in WNDO2 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1142 (SUBSPROCESS) F 57 Disk Block Substitution Process 0000546E 468 FOUNDPLACE LABEL 0546E E4164800 0 1 BASE 469 ST R0 R1,SUBSBADDY save bad block number 0546F 60174804 0 5 BASE 470 LD R0 R5,NEWBLK get good block number 05470 7800254F 0 471 AND R0 MSBLKMASK strip volume number 05471 E4164801 0 1 BASE 472 ST R0 R1,SUBSSUB save result 05472 DC4031A0 473 CALLNP FORCEWRW2 write the substitution block 05473 60040083 0 IMM 474 LD R0 PNWNDO2 page number holding subs block 05474 DC4031DE 475 CALLNP LOCKPAGE wait for write to complete 476 05475 60C40E3A 3 IMM 477 LD R3 ERLCSUB say we substituted a block 478 * \ / 00005476 479 CALLLOG LABEL 05476 DC005048 480 CALL ERRORLOG make a log entry for our activity 05477 4152C000 3 REG 481 PARV R3 ERLCSUB or ERLCNOSUB 05478 DC00417D 482 CALL VOLTODISK find disk name 05479 40494082 5 ZBM 483 PARVL R5,VIRTBLK/VOLFIELD volume number 0547A 41520000 0 REG 484 PARV R0 PAK6 drive name 0547B 41574802 5 BASE 485 PARV R5,VIRTBLK logical block number 0547C 40574804 5 BASE 486 PARVL R5,NEWBLK substitute block number 0547D 5D1F8005 6 STAK 487 LEAVE POP and exit 488 * --- 489 490 * the block is not substitutable 0000547E 491 CANTSUB LABEL 0547E 60040001 0 IMM 492 LD R0 1 error code 0547F FE0E5483 493 JMP SETERRCODE 494 * --- 495 496 * no room for substitute block 00005480 497 NOSPACE LABEL 05480 60040002 0 IMM 498 LD R0 2 error code 05481 FE0E5483 499 JMP SETERRCODE 500 * --- 501 502 * the block should not be substituted since it is now free 00005482 503 NODATAHERE LABEL 05482 60040003 0 IMM 504 LD R0 3 error code 00005483 505 SETERRCODE LABEL 05483 E4174804 0 5 BASE 506 ST R0 R5,NEWBLK save the reason code 05484 FE0E5451 507 JMP MOVEBLOCK go do work to decrement PPL busy word 508 * --- 509 510 END SUBBLOCK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1143 (SUBSPROCESS) F 57 Disk Block Substitution Process 512 513 ********************************************************************************** 514 * * 515 * Routine to unsubstitute a block. * 516 * Call: * 517 * LD R3 block number to unsubstitute * 518 * LD VLN PTR VOLN element * 519 * CALLNP UNSUBBLOCK * 520 * * 521 * Eats R0:R3. * 522 * Stack required = 8. * 523 * 3 + max ( ERRORLOG/VOLTODISK (4), FORCEWRW2 (5), * 524 * FREEFILE (3), LOCKPAGE (1), LOCKWAIT (0), * 525 * SFREEMEM (0), TRACEPROC(3) ) * 526 * * 527 * The substitution block should already be locked in * 528 * WNDO2. This routine will unsubstitute the given block, and * 529 * free its substitute. We do the following: * 530 * 1. Remove the entry from the resident substitution list. * 531 * 2. Remove the entry from the substitution block. * 532 * 3. Forcewrite the substitution block. * 533 * 4. Call FREEFILE to free the substituted block. * 534 * * 535 ********************************************************************************** 536 537 BLOCK UNSUBBLOCK subroutine 538 ENTRY UNSUBBLOCK 539 540 BEGFRAME 00178801 6 BASE 541 VIRTBLK BSS 1 virtual block number 00178802 6 BASE 542 REALBLK BSS 1 substituted block number 543 ENDFRAME 544 05485 DD5F8003 6 STAK 545 UNSUBBLOCK ENTRNP PUSH 05486 61538000 5 6 REG 546 LD R5 SP R5 -> our stack frame 05487 E4D74801 3 5 BASE 547 ST R3 R5,VIRTBLK save virtual block number 548 549 * Remove element from resident substitution list 550 PLOCK SUBSLOCK lock the list 05488 0CC00000 550 IOFF 05489 D1C01F62 550 SETT SUBSLOCK 0548A FE0C548C 550 JNE MA(2+DISPW MA 0) 0548B DC40308B 550 CALLNP LOCKWAIT 0548C 60401F63 1 551 LD R1 SUBSLIST R1 => first subs element 0548D 38801F63 2 552 LEA R2 SUBSLIST R2 => list head pointer 0548E 48D64801 3 1 BASE 553 RLSRCH R3 R1,SUBLBAD find substitution list element 0548F FE025497 554 JEQ FOUND jump if found 05490 001310D8 555 HALT HALTS10D8 substitution list element not found 556 * --- 557 * To recover we unlock the lock, trace the event, and leave. 558 PUNLOCK SUBSLOCK release lock 05491 EC001F62 558 STZ SUBSLOCK 05492 0C800000 558 ION 05493 6012C000 0 3 REG 559 LD R0 R3 copy block we are looking for 560 TRACE SUBSTRACE,SUBTUHALT 05494 5D401D32 560 XCT TRACECALL(SUBSTRACE) 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1144 (SUBSPROCESS) F 57 Disk Block Substitution Process 05495 FEC000C6 560 NOP (SUBSTRACE*BITS 22:26)+(SUBTUHALT*BITS 27:31) 05496 5D1F8003 6 STAK 561 LEAVE POP 562 * --- 563 00005497 564 FOUND LABEL 05497 60164800 0 1 BASE 565 LD R0 R1,SUBLLINK get link to next element 05498 E4168800 0 2 BASE 566 ST R0 R2,SUBLLINK remove element from list 567 PUNLOCK SUBSLOCK unlock the list 05499 EC001F62 567 STZ SUBSLOCK 0549A 0C800000 567 ION 0549B 60164802 0 1 BASE 568 LD R0 R1,SUBLGOOD 0549C E4174802 0 5 BASE 569 ST R0 R5,REALBLK save real block number 570 571 TRACE SUBSTRACE,SUBTUFND 0549D 5D401D32 571 XCT TRACECALL(SUBSTRACE) 0549E FEC000C7 571 NOP (SUBSTRACE*BITS 22:26)+(SUBTUFND*BITS 27:31) 572 0549F DC002F5D 573 CALL SFREEMEM free the substitution list element 054A0 41440002 IMM 574 PARV SUBLLOG 054A1 40524000 1 REG 575 PARVL R1 576 577 * Remove item from the substitution block 054A2 60174801 0 5 BASE 578 LD R0 R5,VIRTBLK get the address by which the system knows it 054A3 7800254F 0 579 AND R0 MSBLKMASK mask off the volume number 054A4 60840C00 2 IMM 580 LD R2 ADR WNDO2 R2 -> start of substitution block 000054A5 581 FINDENTRY LABEL 054A5 64168800 0 2 BASE 582 CPR R0 R2,SUBSBADDY see if this entry matches 054A6 FE0254AD 583 JEQ FOUNDENTRY jump if found our entry 054A7 5C168800 2 BASE 584 CMZ R2,SUBSBADDY check for empty entry 054A8 FE0254BA 585 JEQ NOENTRY jump if no more entries 054A9 18840002 2 IMM 586 ADD R2 SUBSLNTH advance to next entry 054AA 64840FFE 2 IMM 587 CPR R2 ADR WNDO2(WPP)(-SUBSLNTH) 054AB FE0A54A5 588 JLE FINDENTRY jump if more to search 054AC FE0E54BA 589 JMP NOENTRY else no entry in substitution block 590 * --- 591 000054AD 592 FOUNDENTRY LABEL 054AD 60D28000 3 2 REG 593 LD R3 R2 copy pointer for search to end 000054AE 594 FINDLAST LABEL 054AE 18C40002 3 IMM 595 ADD R3 SUBSLNTH R3 -> next entry 054AF 64C40FFE 3 IMM 596 CPR R3 ADR WNDO2(WPP)(-SUBSLNTH) at end of block? 054B0 FE0454B3 597 JGT FOUNDLAST jump if at hard end 054B1 5C16C800 3 BASE 598 CMZ R3,SUBSBADDY are we past the last actual entry? 054B2 FE0C54AE 599 JNE FINDLAST jump if not 600 * \ / 000054B3 601 FOUNDLAST LABEL 054B3 10C40002 3 IMM 602 SUB R3 SUBSLNTH R3 -> last used entry in block 054B4 6216C800 013 BASE 603 LD2 R0 R3,0 pick it up 054B5 E6168800 012 BASE 604 ST2 R0 R2,0 put it on top of deleted one 054B6 EE16C800 3 BASE 605 STZ2 R3,0 zero out last entry 054B7 DC4031A0 606 CALLNP FORCEWRW2 write the substitution block 054B8 60040083 0 IMM 607 LD R0 PNWNDO2 page number holding subs block 054B9 DC4031DE 608 CALLNP LOCKPAGE and wait for write to complete 000054BA 609 NOENTRY LABEL 610 054BA DC004FEA 611 CALL FREEFILE free the block 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1145 (SUBSPROCESS) F 57 Disk Block Substitution Process 054BB 41574802 5 BASE 612 PARV R5,REALBLK block number 054BC 40440000 IMM 613 PARVL FFTUNKNOWN fbi type - indicate single block 614 054BD DC005048 615 CALL ERRORLOG log the unsubstitution 054BE 41440C3C IMM 616 PARV ERLCUNSUB code 054BF DC00417D 617 CALL VOLTODISK find disk name 054C0 40494081 5 ZBM 618 PARVL R5,VIRTBLK/VOLFIELD volume number 054C1 41520000 0 REG 619 PARV R0 PAK6 drive name 054C2 41574801 5 BASE 620 PARV R5,VIRTBLK now block 054C3 40574802 5 BASE 621 PARVL R5,REALBLK bad block 622 054C4 5D1F8003 6 STAK 623 LEAVE POP return happily 624 * --- 625 626 END UNSUBBLOCK subroutine 627 628 629 END Substitution Process 101 INPUT HOURPROC routine to do hour interrupt processing 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1146 (HOURPROC) F 58 Hour processing 3 4 BLOCK hour process 5 ENTRY HOURPROC one hour processing 6 ENTRY TIME2DISK force time variables to disk 7 ENTRY LOGDISKS log all disk activity counts 8 ENTRY SETNVMTIME set time into NVM 9 10 ********************************************************************************** 11 * * 12 * This virtual routine is run as a process once an hour. * 13 * Its main job is to copy the current time and clock correction * 14 * values to the security block on mass storage. This is done * 15 * so that a crash does not lose too much information - * 16 * especially the clock correction values. It also logs the * 17 * counts of disk activity, so we can have some measure of the * 18 * reliability of our disk drives. * 19 * * 20 * Stack required = 8 * 21 * 0 + max ( FREESTACK (0), GETSTACK (0), LIQUIDATE (7), * 22 * LOGDISKS (2), TIME2DISK (8), UPDATENVM (8) ) * 23 * * 24 ********************************************************************************** 25 26 BLOCK HOURPROC routine 27 ENTRY HOURPROC 28 0000000F ABS 29 STACKSIZE EQU 15 size of stack to get 30 000054C5 31 HOURPROC LABEL 054C5 DC00286A 32 CALL GETSTACK get a stack 054C6 4044000F IMM 33 PARVL STACKSIZE 054C7 DC4054D2 34 CALLNP TIME2DISK force time variables to disk 054C8 DC4054F2 35 CALLNP LOGDISKS log disk activity 054C9 DC4054FF 36 CALLNP UPDATENVM update clock value in NVM 37 054CA 60040055 0 IMM 38 LD R0 URMAYIRUN see if OS is still allowed to run 054CB 60440000 1 IMM 39 LD R1 0 (code for OS) 054CC 09040000 IMM 40 UREQ 0 054CD FA0854D1 0 41 JLTZ R0 DEATHHALT go die if not 42 054CE DC002875 43 CALL FREESTACK free our stack 054CF 4044000F IMM 44 PARVL STACKSIZE 054D0 FE0E2DAC 45 JMP LIQUIDATE destroy my process 46 * --- 47 054D1 002A1270 48 DEATHHALT HALT HLTSV1270 user no longer authorized to use system 49 50 END HOURPROC routine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1147 (HOURPROC) F 58 Hour processing 52 53 ********************************************************************************** 54 * * 55 * TIME2DISK. Routine that finds the security block and * 56 * places assorted time related variables on mass storage. * 57 * Call: * 58 * SP => stack * 59 * CALLNP TIME2DISK * 60 * Gets R0:R4 * 61 * Stack required = 8 * 62 * 1 + max ( DUALWRITE (7), GETDATE (1), GRUBWNDO1 (7), * 63 * SETWNDO1 (4) ) * 64 * * 65 ********************************************************************************** 66 67 BLOCK TIME2DISK subroutine 68 ENTRY TIME2DISK 69 70 BEGFRAME 71 ENDFRAME 72 054D2 DD5F8001 6 STAK 73 TIME2DISK ENTRNP PUSH 054D3 61001F23 4 74 LD VLN VOLNTABLE(1) get pointer to system volume 054D4 60092182 0 4 ZBM 75 LD R0 VLN,VOLNSECBK1 get the security block pointer 76 * \ / 77 000054D5 78 TRYSECAGN LABEL 054D5 E4091187 0 4 ZBM 79 ST R0 VLN,VOLNSMSBLK create security block address 054D6 DC003205 80 CALL SETWNDO1 map the block into window 1 054D7 41440000 IMM 81 PARV VPCNTLW with write access 054D8 41440000 IMM 82 PARV VPNOFCB indicate no lun associated with this page 054D9 410054EE 83 PAR BADSEC2BLK MS error address 054DA 41570807 4 BASE 84 PARV VLN,VOLNSECAD pass the complete MS address 054DB 40440006 IMM 85 PARVL FBITSEC expecting a security block 86 * \ / 054DC DC404549 87 CALLNP GETDATE get the current date 054DD E6000A29 01 88 ST2 R0 WNDO1(SECLASTDT) set the last known date 054DE 60001EEF 0 89 LD R0 TIMEZONE get the time zone information 054DF E4000A26 0 90 ST R0 WNDO1(SECTZONE) remember time zone 054E0 60001EED 0 91 LD R0 FDATERROR 054E1 E4000A2D 0 92 ST R0 WNDO1(SECDATERR) remember date error in MS 054E2 60001EEE 0 93 LD R0 FDATEDRFT 054E3 E4000A2E 0 94 ST R0 WNDO1(SECDATDRFT) remember clock drift in ppb 054E4 62001EEB 01 95 LD2 R0 LASTCORR get the date of the last correction 054E5 E6000A2F 01 96 ST2 R0 WNDO1(SECDATCOR) remember last correction time 054E6 60C40082 3 IMM 97 LD R3 PNWNDO1 get page number of window we're using 054E7 DC0031A6 98 CALL DUALWRITE write security block out twice 054E8 60170807 0 4 BASE 99 LD R0 VLN,VOLNSECAD get the address where we succeeded 054E9 74092182 0 4 ZBM 100 XOR R0 VLN,VOLNSECBK1 take out the right one 054EA 74091183 0 4 ZBM 101 XOR R0 VLN,VOLNSECBK2 and create the other sec blk addr 054EB 40520000 0 REG 102 PARVL R0 pass the other address 054EC DC403150 103 CALLNP GRUBWNDO1 now free up the window 104 * \ / 054ED 5D1F8001 6 STAK 105 LEAVE POP done 106 * --- 107 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1148 (HOURPROC) F 58 Hour processing 108 * Primary security block is bad, try the other. 000054EE 109 BADSEC2BLK LABEL 054EE 60091183 0 4 ZBM 110 LD R0 VLN,VOLNSECBK2 get the second sec blocks address 054EF 64091187 0 4 ZBM 111 CPR R0 VLN,VOLNSMSBLK did we already try it? 054F0 FE0C54D5 112 JNE TRYSECAGN no, so go try it 113 * \ / 114 * Neither security block worked for us 054F1 00041261 115 HALT HALTD1261 dead in the water, both security blocks bad 116 * --- 117 118 END TIME2DISK subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1149 (HOURPROC) F 58 Hour processing 120 121 ********************************************************************************** 122 * * 123 * LOGDISKS. This routine will set the flags that cause * 124 * the disk activity to be logged. It does this for all disk * 125 * drives. Call: * 126 * SP => stack * 127 * CALLNP LOGDISKS * 128 * Eats R0-R5. * 129 * Stack required = 2 * 130 * 1 + max ( SRCHLIST (1), UNSRCHLIST (1) ) * 131 * * 132 ********************************************************************************** 133 134 BLOCK LOGDISKS subroutine 135 ENTRY LOGDISKS 136 137 BEGFRAME 138 ENDFRAME 139 054F2 DD5F8001 6 STAK 140 LOGDISKS ENTRNP PUSH 054F3 DC0030AA 141 CALL SRCHLIST lock the MDV list 054F4 40001F14 142 PARL MDVLOCK 054F5 61401F15 5 143 LD MDV MDVLIST get first MDV element 054F6 FB7054FA 5 144 JZA MDV DONE jump if none 145 * \ / 146 000054F7 147 LOOP LABEL 148 SETTBIT MDV,MDVLOGCNT set the flag - MSPROC does the rest 054F7 60020040 0 IMM 148 LD R0 1*BIT(((MDV,MDVLOGCNT) DISP (MDV,0))/BITS 0:4) 054F8 FC174800 0 5 BASE 148 IORM R0 MDV,(((MDV,MDVLOGCNT) DISP (MDV,0))/BITS 15:31) 054F9 FB7654F7 5 149 LJNA MDV LOOP do it for each of them 150 * \ / 151 000054FA 152 DONE LABEL 054FA DC0030B7 153 CALL UNSRCHLIST release the MDV list 054FB 40001F14 154 PARL MDVLOCK 054FC 60040001 0 IMM 155 LD R0 1*BIT FLMSPROC get the appropriate dispatcher bit 054FD FC001CF6 0 156 IORM R0 FLAGS and tell the dispatcher to run MS proc 054FE 5D1F8001 6 STAK 157 LEAVE POP return 158 * --- 159 160 END LOGDISKS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1150 (HOURPROC) F 58 Hour processing 162 163 ********************************************************************************** 164 * * 165 * Once an hour we come here to update the last known * 166 * time in the NVM clock. We do this very carefully, so * 167 * that the NVM time may be used as a reliable check on the * 168 * date in the real clock. * 169 * * 170 * Stack required = 8 * 171 * 1 + max ( GETFDATE (1), READNVM (6), SETNVMTIME (7) ) * 172 * * 173 ********************************************************************************** 174 175 BLOCK UPDATENVM subroutine 176 ENTRY UPDATENVM routine to update the NVM values 177 178 BEGFRAME 179 ENDFRAME 180 054FF DD5F8001 6 STAK 181 UPDATENVM ENTRNP PUSH 05500 60401EF9 1 182 LD R1 NVMCLKINDX get index for current clock value 05501 78401EF8 1 183 AND R1 NVMCLKMASK mask off unused bits 05502 1C440004 1 IMM 184 MUL R1 NVMCLKBYTS convert to byte index 05503 18401EF6 1 185 ADD R1 NVMCLOCKS and add in base value 05504 DC0045EA 186 CALL READNVM call to read NVM 05505 41440004 IMM 187 PARV NVMCLKBYTS number of bytes to read 05506 40524000 1 REG 188 PARVL R1 byte address to fetch 189 * \ / 05507 18005514 0 190 ADD R0 X1HOUR advance the time by one hour 05508 60920000 2 0 REG 191 LD R2 R0 make a copy (for the store) 05509 DC40454F 192 CALLNP GETFDATE get the time that the system believes in 0550A 10128000 0 2 REG 193 SUB R0 R2 find the difference 0550B FA085511 0 194 JLTZ R0 DOWRITE jump if NVM time greater (shouldn't happen) 0550C 68005515 0 195 UCPR R0 X36DAYS check to see if roughly correct 0550D FE065511 196 JGE DOWRITE jump if too far away 0550E 68005516 0 197 UCPR R0 X5MINS check to see if within 5 minutes 0550F FE0A5511 198 JLE DOWRITE jump if almost right on 05510 18805516 2 199 ADD R2 X5MINS make the NVM time creep up on the real time 200 * \ / 201 00005511 202 DOWRITE LABEL 05511 DC005517 203 CALL SETNVMTIME set new NVM time 05512 40528000 2 REG 204 PARVL R2 pass new time as parameter 05513 5D1F8001 6 STAK 205 LEAVE POP return 206 * --- 207 05514 0000036E 208 X1HOUR VFD 1*FOURSECSH 1 hour (in 32 bit time format) 05515 000B9634 209 X36DAYS VFD 36*FOURSECSD 36 days (in 32 bit time format) 05516 00000046 210 X5MINS VFD 5*FOURSECSM 5 minutes (in 32 bit time format) 211 212 END UPDATENVM subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1151 (HOURPROC) F 58 Hour processing 214 215 ********************************************************************************** 216 * * 217 * SETNVMTIME. This routine copies the time passed to * 218 * it into the next NVM clock location. The number of times * 219 * (4 bytes each) kept in the NVM depends on the SSU version. * 220 * The times are indexed by a variable on the head page, * 221 * NVMCLKINDX. * 222 * Call: * 223 * CALL SETNVMTIME * 224 * PARVL <32 bit time> * 225 * * 226 * Eats R0:R3 * 227 * Stack required = 7 * 228 * 1 + max ( WRITENVM (6) ) * 229 * * 230 ********************************************************************************** 231 232 BLOCK SETNVMTIME subroutine 233 ENTRY SETNVMTIME 234 235 BEGFRAME 236 ENDFRAME 237 05517 DD1F8001 6 STAK 238 SETNVMTIME ENTR PUSH 05518 C0528000 2 REG 239 STPVL R2 get new 32 bit time 240 * \ / 05519 BC401EF9 1 241 INCL R1 NVMCLKINDX advance to next indexed time 0551A 78401EF8 1 242 AND R1 NVMCLKMASK don't let it get too large 0551B 1C440004 1 IMM 243 MUL R1 NVMCLKBYTS calculate proper index 0551C 18401EF6 1 244 ADD R1 NVMCLOCKS and add in base 0551D DC0045F9 245 CALL WRITENVM write time to NVM 0551E 41440004 IMM 246 PARV NVMCLKBYTS number of bytes to write 0551F 40524000 1 REG 247 PARVL R1 and byte address 05520 5D1F8001 6 STAK 248 LEAVE POP exit this subroutine 249 * --- 250 251 END SETNVMTIME subroutine 252 253 254 END hour process 102 INPUT ULBTWIDDLE ULB finders and returners 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1152 (ULBTWIDDLE) F 59 User Limit Block Managers 3 4 ULBTWIDDLE BLOCK User Limit Block Manager 5 6 ENTRY FINDULB look up an ULB 7 ENTRY USEULB add another user of ULB 8 ENTRY FETCHDIR lock directory 9 ENTRY FREEDIR unlock directory 10 ENTRY FREEULB return a usage of an ULB 11 ENTRY FREEULBC same as above but info copied to directory 12 ENTRY FREEULBLK same as FREEULB, but dir locked 13 ENTRY FINDVOLUME find VOLN element given volume name 14 ENTRY ULTRLOCK trace code for FETCHDIR (locking) 15 ENTRY ULTRUNLOCK trace code for FREEDIR (unlocking) 16 17 ********************************************************************************** 18 * * 19 * The UDIR for an account is the disk resident table that * 20 * contains all of the information about the account, including * 21 * its limits and its file directory. However, while an account * 22 * is being actively used, it is necessary to retain some type * 23 * of resident central control element. These control elements * 24 * are called User Limit Blocks. The routines following are the * 25 * routines that manipulate these blocks. * 26 * * 27 ********************************************************************************** 28 29 * The ULB managers generate the following trace entries. 30 * code event R0 R1 R2 31 * ---- ----- -- -- -- 00000001 ABS 32 ULTRCREATE EQU 01 create ULB ULB ptr acct(0) project name 00000002 ABS 33 ULTRFIND EQU 02 find ULB ULB ptr return adr ULBUSYWORD 00000003 ABS 34 ULTRFIND2 EQU 03 find ULB ULB ptr return adr ULBUSYWORD 00000004 ABS 35 ULTRFIND3 EQU 04 find ULB ULB ptr return adr ULBUSYWORD 00000005 ABS 36 ULTRNOFIND EQU 05 no find return adr acct(0) project name 00000006 ABS 37 ULTRUSE EQU 06 use ULB ULB ptr return adr ULBUSYWORD 00000007 ABS 38 ULTRFREE EQU 07 free ULB ULB ptr return adr ULBUSYWORD 00000008 ABS 39 ULTRDSTROY EQU 08 destroy ULB ULB ptr 00000009 ABS 40 ULTRLOCK EQU 09 lock dir ULB ptr return adr previous return adr 0000000A ABS 41 ULTRUNLOCK EQU 0A unlock dir ULB ptr return adr previous return adr 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1153 (ULBTWIDDLE) F 59 User Limit Block Managers 43 44 ********************************************************************************** 45 * * 46 * FREEULB. Free a user limit block. Routine to count * 47 * down the ULB busy counter in a user limit block pointed * 48 * to by R4 and if it becomes zero it will free it by * 49 * copying its information to the disk. * 50 * Note that FREEULB and FREEULBC lock the ULB (FETCHDIR) * 51 * on entry. They must not be called with the directory * 52 * locked or a deadlock will result. Use FREEULBLK if the * 53 * directory is already locked. FREEULBLK will unlock the * 54 * directory on return. * 55 * Call: * 56 * LD R4 * 57 * CALLNP FREEULB * 58 * * 59 * Eats R0:R4 * 60 * Stack required = 11 * 61 * 1 + max ( DISMOUNT (3), FETCHDIR (4), FORCEWRW1 (5), * 62 * FREEDIR (5), GRUBWNDO1 (7), LOCKLIST (1), * 63 * MAPOUTFBI (2), SETWNDO1 (4), SFREEMEM (0), * 64 * TRACEPROC (3), UNLOCKLIST (1), WSXCLNALL(10) ) * 65 * * 66 ********************************************************************************** 67 68 BLOCK FREEULB and FREEULBC subroutines 69 ENTRY FREEULB 70 ENTRY FREEULBC 71 ENTRY FREEULBLK same as FREEULB, but dir locked 72 73 BEGFRAME 74 ENDFRAME 75 05521 DD5F8001 6 STAK 76 FREEULBLK ENTRNP PUSH 05522 600908B0 0 4 ZBM 77 LD R0 ULB,ULIDENT get ULB identifier 05523 64040765 0 IMM 78 CPR R0 ULIDVAL is this ULB good? 05524 FE02552C 79 JEQ FREEULB3 jump if yes 05525 001310E2 80 HALT HALTS10E2 bad ULB pointer given to FREEULBLK 81 * --- 82 05526 DD5F8001 6 STAK 83 FREEULB ENTRNP PUSH 00005527 84 FREEULB1 LABEL 05527 600908B0 0 4 ZBM 85 LD R0 ULB,ULIDENT get ULB identifier 05528 64040765 0 IMM 86 CPR R0 ULIDVAL is this ULB good? 05529 FE02552B 87 JEQ FREEULB2 jump if yes 0552A 001310E0 88 HALT HALTS10E0 bad ULB pointer given to FREEULB 89 * --- 90 0000552B 91 FREEULB2 LABEL 0552B DC405667 92 CALLNP FETCHDIR link up to the directory 0000552C 93 FREEULB3 LABEL 0552C 6087FFFF 2 IMM 94 LD R2 -1 this is used to decrement the busy word, 0552D B8970805 2 4 BASE 95 ADDB R2 ULB,ULBUSYWORD and we save value for trace and test 0552E 60130000 0 4 REG 96 LD R0 ULB copy ULB pointer for trace 0552F 6053C000 1 7 REG 97 LD R1 R7 copy return address for trace 98 TRACE ULBTRACE,ULTRFREE trace the event 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1154 (ULBTWIDDLE) F 59 User Limit Block Managers 05530 5D401D2E 98 XCT TRACECALL(ULBTRACE) 05531 FEC00047 98 NOP (ULBTRACE*BITS 22:26)+(ULTRFREE*BITS 27:31) 05532 F7C05538 7 99 JBT R7/BIT 0 FULBCOPY jump if FREEULBC called 05533 7885FFFF 2 IMM 100 AND R2 01FFFF leave only the count part 101 * note that we have an extra count from FETCHDIR 05534 64840001 2 IMM 102 CPR R2 1 check for exactly us left 05535 FE025538 103 JEQ FULBCOPY if so, copy stuff to mass storage 05536 DC405685 104 CALLNP FREEDIR otherwise, release the DIR 05537 FE0E5563 105 JMP FREEULBXT and exit 106 * --- 107 00005538 108 FULBCOPY LABEL 05538 DC003205 109 CALL SETWNDO1 get resident copy of directory 05539 41440002 IMM 110 PARV VPCNTLW+VPCNTLLK write access and locked 0553A 41440000 IMM 111 PARV VPNOFCB indicate no LUN associated with this block 0553B 41005564 112 PAR FREEULBDE indicate error address 0553C 41570801 4 BASE 113 PARV ULB,ULBLOCK indicate the block number 0553D 40440009 IMM 114 PARVL FBITUDIR1 and block type expected 0553E DC40261B 115 CALLNP MAPOUTFBI unmap FBI, ION 0553F 38170806 0 4 BASE 116 LEA R0 ULB,ULLIMITS get address of limit field 05540 60440024 1 IMM 117 LD R1 LIMITSIZE*CPW get its size 05541 6084082B 2 IMM 118 LD R2 ADR WNDO1(UDLIMITS) and location in UDIR1 05542 FE400000 119 CMOVE copy limit field into directory 05543 DC40319D 120 CALLNP FORCEWRW1 force modification to disk 00005544 121 FREEULB01 LABEL 05544 DC403150 122 CALLNP GRUBWNDO1 and unmap the window 05545 DC405685 123 CALLNP FREEDIR release hold on the directory 05546 60C40000 3 IMM 124 LD R3 0 marker for all pages 05547 DC4032EA 125 CALLNP WSXCLNALL flush the working set extension list 126 05548 DC003096 127 CALL LOCKLIST ensure list not busy 05549 40001EAC 128 PARL ULLOCK 0554A 60441EAB 1 IMM 129 LD R1 ADR ULLIST get address of ULB list head 0554B 3D085F10 4 1 ZBM 130 LSRCH ULB R1,ULLINK look for guy pointing here 0554C FE0C5561 131 JNE FREEULGO jump if not found... someone else got it 0554D 5C091F15 4 ZBM 132 CMZ ULB,ULBUSYCTR found - is it being used? 0554E FE0C5561 133 JNE FREEULGO yes - don't destroy this block 0554F 60091F10 0 4 ZBM 134 LD R0 ULB,ULLINK get forward link from this entry 05550 E4085F10 0 1 ZBM 135 ST R0 R1,ULLINK and unlink this entry 05551 EC0908B0 4 ZBM 136 STZ ULB,ULIDENT say this is no longer a ULB 05552 60130000 0 4 REG 137 LD R0 ULB for trace 138 TRACE ULBTRACE,ULTRDSTROY say we destroyed ULB 05553 5D401D2E 138 XCT TRACECALL(ULBTRACE) 05554 FEC00048 138 NOP (ULBTRACE*BITS 22:26)+(ULTRDSTROY*BITS 27:31) 05555 60890081 2 4 ZBM 139 LD R2 ULB,ULDRIVE get volume wherein lies the account 05556 DC002F5D 140 CALL SFREEMEM give the storage back to the system 05557 41440004 IMM 141 PARV ULLOG 05558 40530000 4 REG 142 PARVL ULB 143 * \ / 144 145 ********************************************************************************** 146 * * 147 * Every ULB creation increments its volume busy counter * 148 * (so that the volume doesn't get dismounted). * 149 * This section is to reduce that count. * 150 * * 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1155 (ULBTWIDDLE) F 59 User Limit Block Managers 151 ********************************************************************************** 152 153 * \ / 05559 DC0030A4 154 CALL UNLOCKLIST let go the UL list 0555A 40001EAC 155 PARL ULLOCK 0555B 60241F22 0 2 156 LD R0 VOLNTABLE(R2) get the VOLN element pointer 0555C D0560815 0 BASE 157 DEC R0,VOLNBUSY indicate not busy by this ULB 0555D FE0C5563 158 JNE FREEULBXT if volume busy skip dismount check 0555E DC005034 159 CALL DISMOUNT check if volume needs dismounting 0555F 40520000 0 REG 160 PARVL R0 address of the VOLN element 05560 FE0E5563 161 JMP FREEULBXT exit 162 * --- 163 00005561 164 FREEULGO LABEL 05561 DC0030A4 165 CALL UNLOCKLIST allow others to use the list 05562 40001EAC 166 PARL ULLOCK 00005563 167 FREEULBXT LABEL 05563 5D1F8001 6 STAK 168 LEAVE POP return to caller 169 * --- 170 171 * Disk error copying to disk block - give up on the data 172 * because the directory is lost 00005564 173 FREEULBDE LABEL 05564 DC40261B 174 CALLNP MAPOUTFBI unmap FBI, ION 05565 FE0E5544 175 JMP FREEULB01 and go release the window 176 * --- 177 178 * Decrement ULB use count and copy limit information to the 179 * disk no matter what. Used to keep disk limits as up to the 180 * moment as possible 181 05566 DD5F8001 6 STAK 182 FREEULBC ENTRNP PUSH 05567 EDCBC010 7 CBM 183 STW R7/BIT 0 say that we must copy to UDIR1 05568 FE0E5527 184 JMP FREEULB1 go share code 185 * --- 186 187 END FREEULB and FREEULBC subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1156 (ULBTWIDDLE) F 59 User Limit Block Managers 189 190 ********************************************************************************** 191 * * 192 * USEULB. Given that we already have a ULB, increment * 193 * the busy count to account for another user. * 194 * Call: * 195 * LD ULB * 196 * CALLNP USEULB * 197 * * 198 * Eats R0:R2 * 199 * Stack required = 4 * 200 * 1 + max ( TRACEPROC (3) ) * 201 * * 202 ********************************************************************************** 203 204 BLOCK USEULB subroutine 205 ENTRY USEULB 206 207 BEGFRAME 208 ENDFRAME 209 05569 DD5F8001 6 STAK 210 USEULB ENTRNP PUSH 0556A 600908B0 0 4 ZBM 211 LD R0 ULB,ULIDENT get identifier word 0556B 64040765 0 IMM 212 CPR R0 ULIDVAL is this really a ULB? 0556C FE02556E 213 JEQ USEULB1 jump if this is real 0556D 001310E1 214 HALT HALTS10E1 bad ULB pointer passed to USEULB 215 * --- 216 0000556E 217 USEULB1 LABEL 0556E BC970805 2 4 BASE 218 INCL R2 ULB,ULBUSYWORD increment the use count, remember value 0556F 60130000 0 4 REG 219 LD R0 ULB for trace 05570 6053C000 1 7 REG 220 LD R1 R7 return address, for trace 221 TRACE ULBTRACE,ULTRUSE say we are using ULB 05571 5D401D2E 221 XCT TRACECALL(ULBTRACE) 05572 FEC00046 221 NOP (ULBTRACE*BITS 22:26)+(ULTRUSE*BITS 27:31) 05573 5D1F8001 6 STAK 222 LEAVE POP return to caller 223 * --- 224 225 END USEULB subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1157 (ULBTWIDDLE) F 59 User Limit Block Managers 227 228 ********************************************************************************** 229 * * 230 * FINDULB. Routine to find a user limit block. It checks * 231 * resident and if not there it reads in the directory from the * 232 * disk (WNDO1) and creates it. * 233 * Call: * 234 * LD EQT => parameter block * 235 * CALLNP FINDULB * 236 * returns with ULB => element or zero if the directory * 237 * was not found. ULBUSYWORD is incremented once for * 238 * this call. * 239 * You must fetch access to the directory yourself. * 240 * * 241 * Eats R0:R3, returns ULB * 242 * Stack required = 14 * 243 * 2 + max ( DISMOUNT (3), DMOTEWNDO1 (7), FINDVOLUME (1), * 244 * FREEIDXACS (5), GETIDXACS (3), GRUBWNDO1 (7), * 245 * LOCKLIST (1), MAPOUTFBI (2), SETWNDO1 (4), * 246 * SFREEMEM (0), SGETMEM (0), SRCHAFT (12), * 247 * SRCHAFTIDX (11), SRCHLIST (1), TRACEPROC (3), * 248 * UNLOCKLIST (1), UNSRCHLIST (1) ) * 249 * * 250 ********************************************************************************** 251 252 BLOCK FINDULB subroutine 253 ENTRY FINDULB findulb utility 254 255 BEGFRAME 00178801 6 BASE 256 SAVER3 BSS 1 holds MS address while searching AFT 257 ENDFRAME 00000010 BYTE 258 SHADOW EQU BIT 0 bit in R7, 1 => acct is shadow 259 05574 DD5F8002 6 STAK 260 FINDULB ENTRNP PUSH 05575 EC0BC010 7 CBM 261 STZ R7/SHADOW assume the best about the acct 05576 60174803 0 5 BASE 262 LD R0 EQT,EQSYSTEM is an alternate system specified? 05577 FA0C564A 0 263 JNEZ R0 FINDULBSYS jump if not ourselves 00005578 264 FNDSYSOK LABEL 05578 5E174801 5 BASE 265 CMZ2 EQT,EQVOLUME was a volume specified too? 05579 FE0C5620 266 JNE FINDULBVOL jump if so 0557A DC0030AA 267 CALL SRCHLIST check lockout for searching 0557B 40001EAC 268 PARL ULLOCK 0557C 62174806 015 BASE 269 LD2 R0 EQT,EQACCT get account name 0557D 60974808 2 5 BASE 270 LD R2 EQT,EQACCTPROJ and project 0557E 61001EAB 4 271 LD ULB ULLIST get ULB list head 0000557F 272 SRCHULNS LABEL 0557F 3C170802 0 4 BASE 273 LSRCH R0 ULB,ULACCNM search for an account match 05580 FE0C5588 274 JNE ACTNOTINUL jump if acct not here 05581 64570803 1 4 BASE 275 CPR R1 ULB,ULACCNM(1) does second half match 05582 FE0C5587 276 JNE SRCHULNSX jump if not 05583 64970804 2 4 BASE 277 CPR R2 ULB,ULACCPROJ does the project match? 05584 FE0C5587 278 JNE SRCHULNSX jump if not 05585 5C090010 4 ZBM 279 CMZ ULB,ULSHADOW is this a shadow account? 05586 FE025613 280 JEQ ACCTINULL2 jump if not - it's found 00005587 281 SRCHULNSX LABEL this entry unsatisfactory - 05587 FB36557F 4 282 LJNA ULB SRCHULNS try next entry 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1158 (ULBTWIDDLE) F 59 User Limit Block Managers 283 * \ / 284 00005588 285 ACTNOTINUL LABEL 05588 DC0030B7 286 CALL UNSRCHLIST indicate that we're no longer looking 05589 40001EAC 287 PARL ULLOCK 0558A DC405657 288 CALLNP SRCHAFT search the account finder table 0558B FAC2560C 3 289 JEQZ R3 FNDULBNAC jump if no such account 290 * \ / 291 292 ********************************************************************************** 293 * * 294 * Check for inhibited access to this volume. * 295 * Otherwise, mark access in the volume control block. Note * 296 * the funny check to see if the volume has gone away. * 297 * Unfortunately, somewhere between the SRCHAFT and SRCHLIST * 298 * below another CPU (a fast one) could have pulled the * 299 * volume out from underneath us. The main flag here is * 300 * VOLNMOUNT, which tells us whether or not the volume is * 301 * in the process of being dismounted. If not then we will * 302 * increment the busy counter and prevent the dismount. * 303 * If the volume is in the process of being (or has been) * 304 * dismounted the absence of a VOLN element or the VOLNMOUNT * 305 * flag being set will let us know. * 306 * * 307 ********************************************************************************** 308 309 * \ / R3 = UDIR1 address with volume # 0000558C 310 CHECKIT LABEL 0558C 604AC080 1 3 CBM 311 LD R1 R3/VOLFIELD get the number of the volume 0558D DC0030AA 312 CALL SRCHLIST get access to the volume list 0558E 40001F22 313 PARL VOLNLOCK ptr to the lock word 0558F 60A21F22 2 1 314 LD R2 VOLNTABLE(R1) convert volume number into VOLN element pointer 05590 FA82561D 2 315 JEQZ R2 FNDULBNV jump if volume gone 05591 5C088840 2 ZBM 316 CMZ R2,VOLNNOUSE check for availability 05592 FE0255A9 317 JEQ NOINHIB jump if okay 05593 5C088A10 2 ZBM 318 CMZ R2,VOLNMOUNT is it not completely mounted? 05594 FE0C561D 319 JNE FNDULBNV jump if so, we don't get it 05595 64440001 1 IMM 320 CPR R1 SYSVOLNUM is this the system volume? 05596 FE0C55A4 321 JNE MAYBEBKUP if not, nothing special 05597 60400412 1 322 LD R1 CPPSA get the current PSA pointer 05598 60485F13 1 1 ZBM 323 LD R1 R1,PSUSERLIMP get the current ULB pointer 05599 60084174 0 1 ZBM 324 LD R0 R1,ULACCPROJ/DVSNPART1 get group of caller 0559A 64401EAE 1 325 CPR R1 SYSTEMULB is this the system ULB? 0559B FE0C559D 326 JNE HESLOGGED jump if he's logged on 0559C 60094178 0 5 ZBM 327 LD R0 EQT,EQACCTPROJ/DVSNPART1 otherwise, see who's trying to log on 0000559D 328 HESLOGGED LABEL 0559D 1404007D 0 IMM 329 DIV R0 DVSNPART2 extract project 0559E 1C04007D 0 IMM 330 MUL R0 DVSNPART2 and back to normal format 0559F 600A1200 0 0 CBM 331 LD R0 R0*DVSNPART1 restore to normal format 055A0 68002551 0 332 UCPR R0 DOTBTI system accounts may... 055A1 FE0255A9 333 JEQ NOINHIB ...access an inhibited... 055A2 68002555 0 334 UCPR R0 DOTSYS ...system volume 055A3 FE0255A9 335 JEQ NOINHIB jump if enough privs 336 * \ / 337 338 * Backup can access maintenance mounted volumes 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1159 (ULBTWIDDLE) F 59 User Limit Block Managers 000055A4 339 MAYBEBKUP LABEL 055A4 5C088E10 2 ZBM 340 CMZ R2,VOLNMAIM is this a maint volume? 055A5 FE02561D 341 JEQ FNDULBNV jump if not -- other reasons good enough 055A6 60000414 0 342 LD R0 CPCUPC 055A7 5C080C10 0 ZBM 343 CMZ R0,UPBACKUP is this the backup program? 055A8 FE0C561D 344 JNE FNDULBNV jump if not -- no privs to access 345 * \ / 346 000055A9 347 NOINHIB LABEL 055A9 D0168815 2 BASE 348 INC R2,VOLNBUSY say that we wish to use it 055AA DC0030B7 349 CALL UNSRCHLIST indicate done with volume list pointers 055AB 40001F22 350 PARL VOLNLOCK 351 352 * R2 => VOLN element, R3=DIRDA, R5=>EQT 055AC DC002ED0 353 CALL SGETMEM get room for a ULB 055AD 40440004 IMM 354 PARVL ULLOG 055AE E4130000 0 4 REG 355 ST R0 ULB put pointer in its usual place 055AF EC170800 4 BASE 356 STZ ULB,ULWORDA initialize this words flags 055B0 E4D70801 3 4 BASE 357 ST R3 ULB,ULBLOCK give acct its directory address 055B1 62174806 015 BASE 358 LD2 R0 EQT,EQACCT 055B2 E6170802 014 BASE 359 ST2 R0 ULB,ULACCNM give it an account number 055B3 60174808 0 5 BASE 360 LD R0 EQT,EQACCTPROJ 055B4 E4170804 0 4 BASE 361 ST R0 ULB,ULACCPROJ give the account its project 055B5 600BC010 0 7 CBM 362 LD R0 R7/SHADOW 055B6 E4090010 0 4 ZBM 363 ST R0 ULB,ULSHADOW say whether a shadow or not 055B7 60088215 0 2 ZBM 364 LD R0 R2,VOLNFOREN pick up foreign bit 055B8 E4090210 0 4 ZBM 365 ST R0 ULB,ULFOREIGN save whether a system outsider 055B9 EDD70805 4 BASE 366 STW ULB,ULBUSYWORD say block in use once 367 368 * In rare circumstances, this may get an FBI type mismatch 369 * because the ACCOUNT is being destroyed. Awkward, but safe, 370 * as are the other variants of the problem. 371 055BA DC003205 372 CALL SETWNDO1 get the directory in 055BB 41440003 IMM 373 PARV VPCNTLRO+VPCNTLLK specify read only and locked 055BC 41440000 IMM 374 PARV VPNOFCB indicate that no lun is associated 055BD 410055E7 375 PAR FNDULBNACD pass error address 055BE 41570801 4 BASE 376 PARV ULB,ULBLOCK disk address to read 055BF 40440009 IMM 377 PARVL FBITUDIR1 and type expected 378 379 * If the directory that we find is not for the proper account, 380 * we say mass storage error. This is partly a security 381 * related check (to detect alterations by penetrators). 382 055C0 62000800 01 383 LD2 R0 WNDO1/UDACCT get the directories account 055C1 66170802 014 BASE 384 CPR2 R0 ULB,ULACCNM compare against the ULB 055C2 FE0C55E7 385 JNE FNDULBNACD jump on unusual switch to fake disk error 055C3 60000802 0 386 LD R0 WNDO1/UDPROJ get the division-project 055C4 64170804 0 4 BASE 387 CPR R0 ULB,ULACCPROJ and give it the same check 055C5 FE0C55E7 388 JNE FNDULBNACD and the same treatment 055C6 DC40261B 389 CALLNP MAPOUTFBI unmap FBI, ION 055C7 60040800 0 IMM 390 LD R0 ADR WNDO1 get a pointer to our window 055C8 6048001A 1 0 ZBM 391 LD R1 R0,UDTYPE check the directory type 055C9 E4490410 1 4 ZBM 392 ST R1 ULB,ULRAFDIR remember the directory format 393 * \ / 394 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1160 (ULBTWIDDLE) F 59 User Limit Block Managers 055CA 6004082B 0 IMM 395 LD R0 ADR WNDO1(UDLIMITS) get address in UDIR1 055CB 60440024 1 IMM 396 LD R1 LIMITSIZE*CPW get size of limit block 055CC 38970806 2 4 BASE 397 LEA R2 ULB,ULLIMITS get address in ULB 055CD FE400000 398 CMOVE copy limit field into ULB 055CE EC17080F 4 BASE 399 STZ ULB,ULSCRDSK clear scratch disk space total 055CF DC40315C 400 CALLNP DMOTEWNDO1 release the window 055D0 DC003096 401 CALL LOCKLIST get access to the ULB list 055D1 40001EAC 402 PARL ULLOCK 403 * \ / 404 055D2 60170801 0 4 BASE 405 LD R0 ULB,ULBLOCK get the directory MS address 055D3 60C01EAB 3 406 LD R3 ULLIST get the list head 055D4 3C16C801 0 3 BASE 407 LSRCH R0 R3,ULBLOCK look for this ACCT already in ULB list 055D5 FE0255F3 408 JEQ FNDULBDUP jump if a duplicate found 055D6 60040765 0 IMM 409 LD R0 ULIDVAL get a code 055D7 E40908B0 0 4 ZBM 410 ST R0 ULB,ULIDENT indicate this is a valid ULB 055D8 60130000 0 4 REG 411 LD R0 ULB for trace 055D9 60574806 1 5 BASE 412 LD R1 EQT,EQACCT for trace 055DA 60974808 2 5 BASE 413 LD R2 EQT,EQACCTPROJ get project for trace 414 TRACE ULBTRACE,ULTRCREATE say we created a block 055DB 5D401D2E 414 XCT TRACECALL(ULBTRACE) 055DC FEC00041 414 NOP (ULBTRACE*BITS 22:26)+(ULTRCREATE*BITS 27:31) 055DD 6053C000 1 7 REG 415 LD R1 R7 for trace 055DE 60970805 2 4 BASE 416 LD R2 ULB,ULBUSYWORD for trace 417 TRACE ULBTRACE,ULTRFIND say we found ULB (by making it) 055DF 5D401D2E 417 XCT TRACECALL(ULBTRACE) 055E0 FEC00042 417 NOP (ULBTRACE*BITS 22:26)+(ULTRFIND*BITS 27:31) 055E1 60401EAB 1 418 LD R1 ULLIST get pointer to the list 055E2 E4491F10 1 4 ZBM 419 ST R1 ULB,ULLINK put existing list behind our new element 055E3 E5001EAB 4 420 ST ULB ULLIST new element now the list head 055E4 DC0030A4 421 CALL UNLOCKLIST release access to the list 055E5 40001EAC 422 PARL ULLOCK 423 * \ / 424 055E6 5D1F8002 6 STAK 425 LEAVE POP 426 * --- 427 428 * The directory went bad -- free everything remaining and freak out. 000055E7 429 FNDULBNACD LABEL 055E7 DC40261B 430 CALLNP MAPOUTFBI unmap FBI, ION 055E8 DC403150 431 CALLNP GRUBWNDO1 just in case 055E9 60890081 2 4 ZBM 432 LD R2 ULB,ULDRIVE remember the drive it came from 055EA DC002F5D 433 CALL SFREEMEM remove allocated ULB 055EB 41440004 IMM 434 PARV ULLOG 055EC 40530000 4 REG 435 PARVL ULB 436 * \ / 437 438 ********************************************************************************** 439 * * 440 * We have managed to increment the volume busy word once too * 441 * often, here we undo it. * 442 * * 443 ********************************************************************************** 444 445 * \ / 055ED 60241F22 0 2 446 LD R0 VOLNTABLE(R2) get the VOLN element pointer 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1161 (ULBTWIDDLE) F 59 User Limit Block Managers 055EE D0560815 0 BASE 447 DEC R0,VOLNBUSY remove the extra access 055EF FE0C560C 448 JNE FNDULBNAC if volume busy, skip dismount check 055F0 DC005034 449 CALL DISMOUNT check if volume needs dismounting 055F1 40520000 0 REG 450 PARVL R0 address of the VOLN element 055F2 FE0E560C 451 JMP FNDULBNAC share no find code 452 * --- 453 454 ********************************************************************************** 455 * * 456 * We have created a ULB for an account that didn't * 457 * have one a moment ago. We are now trying to link * 458 * it into the ULLIST and we find that a ULB exists * 459 * now. Rather than panic, we presume that a different * 460 * process needed one about the same time as we did, * 461 * and won the race to put one into the list. We just * 462 * destroy the one we created and give back a pointer * 463 * to the one in the list. * 464 * * 465 ********************************************************************************** 466 000055F3 467 FNDULBDUP LABEL 055F3 60890081 2 4 ZBM 468 LD R2 ULB,ULDRIVE get the volume number 055F4 DC002F5D 469 CALL SFREEMEM release the ULB that we were constructing 055F5 41440004 IMM 470 PARV ULLOG indicate its length 055F6 40530000 4 REG 471 PARVL ULB and address 055F7 6112C000 4 3 REG 472 LD ULB R3 get pointer to the one that we found 055F8 60241F22 0 2 473 LD R0 VOLNTABLE(R2) get VOLN pointer 055F9 D0560815 0 BASE 474 DEC R0,VOLNBUSY remove busy count for the one we were making 055FA FE0C55FD 475 JNE FNDULBVBSY skip dismount check if volume busy 055FB DC005034 476 CALL DISMOUNT check if volume needs dismounting 055FC 40520000 0 REG 477 PARVL R0 address of the VOLN element 478 * \ / 479 000055FD 480 FNDULBVBSY LABEL 055FD 5C090610 4 ZBM 481 CMZ ULB,ULNOTHERE test for account being destroyed 055FE FE0C5607 482 JNE ACCTZOTA jump if account being destroyed 055FF BC970805 2 4 BASE 483 INCL R2 ULB,ULBUSYWORD increment busy counter 05600 60130000 0 4 REG 484 LD R0 ULB for trace 05601 6053C000 1 7 REG 485 LD R1 R7 for trace 486 TRACE ULBTRACE,ULTRFIND2 found a ULB (by finding duplicate) 05602 5D401D2E 486 XCT TRACECALL(ULBTRACE) 05603 FEC00043 486 NOP (ULBTRACE*BITS 22:26)+(ULTRFIND2*BITS 27:31) 05604 DC0030A4 487 CALL UNLOCKLIST release the list 05605 40001EAC 488 PARL ULLOCK 05606 5D1F8002 6 STAK 489 LEAVE POP return 490 * --- 491 00005607 492 ACCTZOTA LABEL 05607 DC0030A4 493 CALL UNLOCKLIST release the list 05608 40001EAC 494 PARL ULLOCK 05609 FE0E560C 495 JMP FNDULBNAC indicate no account found 496 * --- 497 498 499 * Account being destroyed -- fake innocence 0000560A 500 ACCTZOTTNG LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1162 (ULBTWIDDLE) F 59 User Limit Block Managers 0560A DC0030B7 501 CALL UNSRCHLIST 0560B 40001EAC 502 PARL ULLOCK 503 * \ / 504 505 * account/volume does not exist - return error code 0000560C 506 FNDULBNAC LABEL 0560C 6013C000 0 7 REG 507 LD R0 R7 copy return adr for trace 0560D 60574806 1 5 BASE 508 LD R1 EQT,EQACCT first word of account 0560E 60974808 2 5 BASE 509 LD R2 EQT,EQACCTPROJ and project 510 TRACE ULBTRACE,ULTRNOFIND could not find a account 0560F 5D401D2E 510 XCT TRACECALL(ULBTRACE) 05610 FEC00045 510 NOP (ULBTRACE*BITS 22:26)+(ULTRNOFIND*BITS 27:31) 05611 61040000 4 IMM 511 LD ULB 0 05612 5D1F8002 6 STAK 512 LEAVE POP return to caller 513 * --- 514 515 * A ULB is resident for this account. Just clean 516 * up lists that we have locked, etc. 517 00005613 518 ACCTINULL2 LABEL 05613 5C090610 4 ZBM 519 CMZ ULB,ULNOTHERE is the account being destroyed? 05614 FE0C560A 520 JNE ACCTZOTTNG jump if so - not found 05615 BC970805 2 4 BASE 521 INCL R2 ULB,ULBUSYWORD increment the busy counter 05616 60130000 0 4 REG 522 LD R0 ULB copy ULB pointer for trace 05617 6053C000 1 7 REG 523 LD R1 R7 return address for trace 524 TRACE ULBTRACE,ULTRFIND3 found a ULB (already resident) 05618 5D401D2E 524 XCT TRACECALL(ULBTRACE) 05619 FEC00044 524 NOP (ULBTRACE*BITS 22:26)+(ULTRFIND3*BITS 27:31) 0561A DC0030B7 525 CALL UNSRCHLIST indicate that we're done 0561B 40001EAC 526 PARL ULLOCK 0561C 5D1F8002 6 STAK 527 LEAVE POP return to caller 528 * --- 529 530 * It seems that the volume does not allow us access to it. 531 * Clean up this and that and say no access given. 532 0561D DC0030B7 533 FNDULBNV CALL UNSRCHLIST let go of the list pointers 0561E 40001F22 534 PARL VOLNLOCK ptr to the list lock word 0561F FE0E560C 535 JMP FNDULBNAC say that the ULB was not found 536 * --- 537 538 ********************************************************************************** 539 * * 540 * Alternate volume specified. We proceed by searching * 541 * the volume name list to find the volume and then we search * 542 * the IDX on that volume to find the account. Even after the * 543 * account is found there, we must search the AFT to see if it * 544 * is to be a shadow account. * 545 * * 546 ********************************************************************************** 547 00005620 548 FINDULBVOL LABEL 05620 DC0030AA 549 CALL SRCHLIST get access to the volume name list 05621 40001F22 550 PARL VOLNLOCK 05622 DC00564D 551 CALL FINDVOLUME look for ours there 05623 42574801 5 BASE 552 PARV2L EQT,EQVOLUME 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1163 (ULBTWIDDLE) F 59 User Limit Block Managers 05624 FA30562C 0 553 JZA R0 FNDULNOVOL jump if ours wasn't found 05625 5C080840 0 ZBM 554 CMZ R0,VOLNNOUSE is it completely mounted and uninhibited? 05626 FE02562F 555 JEQ FNDULNAMF jump if not 556 * \ / 05627 5C080E10 0 ZBM 557 CMZ R0,VOLNMAIM maint mount? 05628 FE02562C 558 JEQ FNDULNOVOL if not, no hope for access 559 * \ / 05629 60400414 1 560 LD R1 CPCUPC 0562A 5C084C10 1 ZBM 561 CMZ R1,UPBACKUP is the asker backup? 0562B FE02562F 562 JEQ FNDULNAMF if so, let him have it 563 * \ / 0000562C 564 FNDULNOVOL LABEL volume not found 0562C DC0030B7 565 CALL UNSRCHLIST remove access to the list 0562D 40001F22 566 PARL VOLNLOCK 0562E FE0E560C 567 JMP FNDULBNAC say not found 568 * --- 569 570 * Volume name found 0000562F 571 FNDULNAMF LABEL 0562F 61080086 4 0 ZBM 572 LD R4 R0,VOLNNUM get the index number of the volume 05630 DC0030B7 573 CALL UNSRCHLIST remove access to VOLN entries 05631 40001F22 574 PARL VOLNLOCK 575 05632 DC00580B 576 CALL GETIDXACS get access to the IDX of that volume 05633 41440000 IMM 577 PARV AFTACSRO value to indicate just looking 05634 40530000 4 REG 578 PARVL R4 pass volume number 05635 6108DF19 4 3 ZBM 579 LD R4 R3,VOLNIDXPTR save pointer to IDX control block 05636 DC0056E2 580 CALL SRCHAFTIDX look for the account 05637 40174806 5 BASE 581 PARL EQT,EQACCT pass account name triple 05638 FE0E5647 582 JMP SRCHIDXNF1 disk error 05639 FE0E5646 583 JMP SRCHIDXNF no such entry 0563A 60D20000 3 0 REG 584 LD R3 R0 R3:=directory address 0563B 60090080 0 4 ZBM 585 LD R0 R4,IDXTVOL get volume number 0563C E40AC080 0 3 CBM 586 ST R0 R3/VOLFIELD set volume number with address 0563D E4D78801 3 6 BASE 587 ST R3 SP,SAVER3 save the disk address 0563E DC403150 588 CALLNP GRUBWNDO1 done with this block 0563F DC005829 589 CALL FREEIDXACS release grip on IDX 05640 40490080 4 ZBM 590 PARVL R4,IDXTVOL 05641 DC405657 591 CALLNP SRCHAFT see if the account is a shadow 05642 64D78801 3 6 BASE 592 CPR R3 SP,SAVER3 the same disk address? 05643 ED8BC010 7 CBM 593 STLNE R7/SHADOW mark whether shadow account or not 05644 60D78801 3 6 BASE 594 LD R3 SP,SAVER3 restore the directory address 05645 FE0E558C 595 JMP CHECKIT enter it in 596 * --- 597 598 * We arrive here for either entry not found or a disk 599 * error. In either event, we just return a not found 600 * status. 601 00005646 602 SRCHIDXNF LABEL 05646 DC403150 603 CALLNP GRUBWNDO1 release the window with IDX 00005647 604 SRCHIDXNF1 LABEL 05647 DC005829 605 CALL FREEIDXACS release list that we hold 05648 40490080 4 ZBM 606 PARVL R4,IDXTVOL 05649 FE0E560C 607 JMP FNDULBNAC say not found 608 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1164 (ULBTWIDDLE) F 59 User Limit Block Managers 609 610 ********************************************************************************** 611 * Alternate system specified. Since networks don't * 612 * exist yet, we just check for our own name. If not our * 613 * own name, we fake account not found. * 614 ********************************************************************************** 615 0000564A 616 FINDULBSYS LABEL 0564A 64001EFB 0 617 CPR R0 SYSTEMNM is this our own name? 0564B FE025578 618 JEQ FNDSYSOK if it is, accept it 0564C FE0E560C 619 JMP FNDULBNAC if not, fake innocence 620 * --- 621 622 END FINDULB subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1165 (ULBTWIDDLE) F 59 User Limit Block Managers 624 625 ********************************************************************************** 626 * * 627 * FINDVOLUME - Find a VOLN element, given a volume name * 628 * Call: * 629 * CALL FINDVOLUME * 630 * PARV2L volume name (pak 12) * 631 * On return, R0 -> VOLN, or zero if not found * 632 * Original name returned in R2:R3. * 633 * * 634 * The caller is responsible for locking and unlocking the VOLN * 635 * table. * 636 * * 637 * Eats R0:R3. Values returned in R0, R2:R3. * 638 * Stack required: 1 * 639 * * 640 ********************************************************************************** 641 642 BLOCK FINDVOLUME subroutine 643 ENTRY FINDVOLUME 644 645 BEGFRAME 646 ENDFRAME 647 0564D DD1F8001 6 STAK 648 FINDVOLUME ENTR PUSH 0564E C2548000 23 PAIR 649 STPV2L PAIR R2 R2, R3 = volume name 0564F 6047FFC1 1 IMM 650 LD R1 -MAXVOLNUM+1 index into table 00005650 651 LOOP LABEL 05650 60221F62 0 1 652 LD R0 VOLNTABLE(R1+MAXVOLNUM) R0 -> a VOLN element 05651 FA305654 0 653 JZA R0 NEXT jump if none here 05652 66960811 230 BASE 654 CPR2 R2 R0,VOLNNAME is this one us? 05653 FE025656 655 JEQ FOUND jump if so 656 * \ / 00005654 657 NEXT LABEL 05654 FA605650 1 658 IRJ R1 LOOP look at all volumes 659 * \ / 05655 60040000 0 IMM 660 LD R0 0 flag: not found 661 * \ / 00005656 662 FOUND LABEL 05656 5D1F8001 6 STAK 663 LEAVE POP all done 664 * --- 665 666 END FINDVOLUME subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1166 (ULBTWIDDLE) F 59 User Limit Block Managers 668 669 ********************************************************************************** 670 * * 671 * SRCHAFT. Routine to search the account finder table for the * 672 * given account. * 673 * Call: * 674 * LD SP => return addr stack * 675 * LD EQT => EQT block containing account name * 676 * CALLNP SRCHAFT * 677 * JEQZ R3 no such account * 678 * ST R3 directory address * 679 * * 680 * Eats R0:R4. * 681 * Stack required = 12 * 682 * 1 + max ( FREEAFTACS (5), GETAFTACS (1), GRUBWNDO1 (7) * 683 * SRCHAFTIDX (11) ) * 684 * * 685 ********************************************************************************** 686 687 BLOCK SRCHAFT subroutine 688 ENTRY SRCHAFT 689 690 BEGFRAME 691 ENDFRAME 692 05657 DD5F8001 6 STAK 693 SRCHAFT ENTRNP PUSH 05658 DC0056E6 694 CALL GETAFTACS get looking access to the AFT 05659 40440000 IMM 695 PARVL AFTACSRO 0565A 61001F64 4 696 LD R4 AFTINDEX 0565B DC0056E2 697 CALL SRCHAFTIDX search the AFT 0565C 40174806 5 BASE 698 PARL EQT,EQACCT pass account name triple 0565D FE0E5665 699 JMP SRCHAFTNT disk error 0565E 60040000 0 IMM 700 LD R0 0 no such entry 0565F 61120000 4 0 REG 701 LD R4 R0 save disk address 05660 DC403150 702 CALLNP GRUBWNDO1 release the window 00005661 703 SRCHAFTXIT LABEL 05661 DC005701 704 CALL FREEAFTACS let go of AFT 05662 40440000 IMM 705 PARVL AFTACSRO 05663 60D30000 3 4 REG 706 LD R3 R4 return disk address in R3 05664 5D1F8001 6 STAK 707 LEAVE POP 708 * --- 709 710 * Had a disk error -- return failure 00005665 711 SRCHAFTNT LABEL 05665 61040000 4 IMM 712 LD R4 0 return a zero saying not found 05666 FE0E5661 713 JMP SRCHAFTXIT 714 * --- 715 716 END SRCHAFT subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1167 (ULBTWIDDLE) F 59 User Limit Block Managers 718 719 ********************************************************************************** 720 * * 721 * Routine to get access to the directory by interlocking * 722 * with bits in the user limit block. The calling process * 723 * is possibly queued until the current user is finished with * 724 * his access. * 725 * Call: * 726 * SP = stack pointer * 727 * ULB => user limit block * 728 * CALLNP FETCHDIR * 729 * * 730 * Eats R0. * 731 * Stack required = 4 * 732 * 1 + max ( LOCKWAIT (0), SUSPENDME (0), TRACEPROC (3) ) * 733 * * 734 ********************************************************************************** 735 736 BLOCK FETCHDIR subroutine 737 ENTRY FETCHDIR to fetch access to a directory 738 739 BEGFRAME 740 ENDFRAME 741 05667 DD5F8001 6 STAK 742 FETCHDIR ENTRNP PUSH 05668 600908B0 0 4 ZBM 743 LD R0 ULB,ULIDENT get the marker field 05669 64040765 0 IMM 744 CPR R0 ULIDVAL is it a good marker? 0566A FE0C5684 745 JNE BADULB jump if something other than a ULB 0566B D0170805 4 BASE 746 INC ULB,ULBUSYWORD make busy so it won't be deleted 0000566C 747 FTCHDIRWTR LABEL 748 PLOCK DIRLOCKING no one else diddles directories 0566C 0CC00000 748 IOFF 0566D D1C01EAD 748 SETT DIRLOCKING 0566E FE0C5670 748 JNE MA(2+DISPW MA 0) 0566F DC40308B 748 CALLNP LOCKWAIT 05670 60030000 0 IMM 749 LD R0 ULBLOCKING get this locking bit 05671 FC170805 0 4 BASE 750 IORM R0 ULB,ULBUSYWORD is the directory in use? 05672 FE02567F 751 JEQ FTCHDIRQUE jump if it is - queue me 05673 60000412 0 752 LD R0 CPPSA get the current PSA pointer 05674 D0080230 0 ZBM 753 INC R0,PSLOCKCNTR indicate a critical region is locked 05675 60130000 0 4 REG 754 LD R0 ULB copy the ULB pointer 05676 E053C000 1 7 REG 755 EXCH R1 R7 move return address down for trace 05677 E0978800 2 6 BASE 756 EXCH R2 SP,0 and previous R7 also 757 TRACE ULBTRACE,ULTRLOCK make a trace entry 05678 5D401D2E 757 XCT TRACECALL(ULBTRACE) 05679 FEC00049 757 NOP (ULBTRACE*BITS 22:26)+(ULTRLOCK*BITS 27:31) 0567A E0978800 2 6 BASE 758 EXCH R2 SP,0 restore registers 0567B E053C000 1 7 REG 759 EXCH R1 R7 760 PUNLOCK DIRLOCKING 0567C EC001EAD 760 STZ DIRLOCKING 0567D 0C800000 760 ION 0567E 5D1F8001 6 STAK 761 LEAVE POP 762 * --- 763 764 * The directory is busy - queue this process 0000567F 765 FTCHDIRQUE LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1168 (ULBTWIDDLE) F 59 User Limit Block Managers 0567F DC00351C 766 CALL SUSPENDME call to suspend this process 05680 4100566C 767 PAR FTCHDIRWTR indicate the restart address 05681 41530000 4 REG 768 PARV ULB this is the parameter for shutdown 05682 41001DAD 769 PAR SQDIRWAIT this is the list to suspend in 05683 40001EAD 770 PARL DIRLOCKING this is the lock field 771 * --- 772 05684 001300E0 773 BADULB HALT HALTS00E0 dir fetch against something not a ULB 774 * --- 775 776 END FETCHDIR subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1169 (ULBTWIDDLE) F 59 User Limit Block Managers 778 779 ********************************************************************************** 780 * * 781 * Routine to give up access to directory and set going anyone * 782 * who was stopped by my being in the way. * 783 * Call: * 784 * SP = stack pointer * 785 * ULB => user limit block * 786 * CALLNP FREEDIR * 787 * * 788 * Eats R0:R2. * 789 * Stack required = 5 * 790 * 1 + max ( DQUEONE (4), LOCKWAIT (0), TRACEPROC (3) ) * 791 * * 792 ********************************************************************************** 793 794 BLOCK FREEDIR subroutine 795 ENTRY FREEDIR routine to release directory access 796 797 BEGFRAME 798 ENDFRAME 799 05685 DD5F8001 6 STAK 800 FREEDIR ENTRNP PUSH 05686 600908B0 0 4 ZBM 801 LD R0 ULB,ULIDENT get the marker field 05687 64040765 0 IMM 802 CPR R0 ULIDVAL is it a good marker? 05688 FE0C569E 803 JNE BADULB jump if this isn't a ULB 804 PLOCK DIRLOCKING exclusive access to dir locks 05689 0CC00000 804 IOFF 0568A D1C01EAD 804 SETT DIRLOCKING 0568B FE0C568D 804 JNE MA(2+DISPW MA 0) 0568C DC40308B 804 CALLNP LOCKWAIT 0568D 60130000 0 4 REG 805 LD R0 ULB copy the ULB pointer 0568E 6053C000 1 7 REG 806 LD R1 R7 copy the return address 0568F 60978800 2 6 BASE 807 LD R2 SP,0 and the callers R7 808 TRACE ULBTRACE,ULTRUNLOCK and make a trace entry with them 05690 5D401D2E 808 XCT TRACECALL(ULBTRACE) 05691 FEC0004A 808 NOP (ULBTRACE*BITS 22:26)+(ULTRUNLOCK*BITS 27:31) 809 * check to see if anybody queued 05692 DC00354F 810 CALL DQUEONE call to remove user from a queue 05693 41001DAD 811 PAR SQDIRWAIT specify the queue 05694 40530000 4 REG 812 PARVL ULB specify the parameter 05695 60030000 0 IMM 813 LD R0 ULBLOCKING get directory busy bit 05696 A8170805 0 4 BASE 814 BRSBM R0 ULB,ULBUSYWORD remove with interlocked instruction 05697 FE02569F 815 JEQ FREEALRDY jump if ULB already unlocked 05698 60000412 0 816 LD R0 CPPSA get the current PSA pointer 05699 D0480230 0 ZBM 817 DEC R0,PSLOCKCNTR indicate a critical region is unlocked 0569A D0570805 4 BASE 818 DEC ULB,ULBUSYWORD directory now not busy 819 PUNLOCK DIRLOCKING allow others to lock dirs 0569B EC001EAD 819 STZ DIRLOCKING 0569C 0C800000 819 ION 0569D 5D1F8001 6 STAK 820 LEAVE POP return 821 * --- 822 0000569E 823 BADULB LABEL 0569E 001300E1 824 HALT HALTS00E1 attempt to free dir access with a non-ULB 825 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1170 (ULBTWIDDLE) F 59 User Limit Block Managers 0000569F 826 FREEALRDY LABEL 0569F 001300E2 827 HALT HALTS00E2 attempt to free already free ULB 828 829 END FREEDIR subroutine 830 831 832 END ULBTWIDDLE User Limit Block Manager 103 INPUT IDXMANGLE routines to search IDX 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1171 (IDXMANGLE) F 60 often used AFT and IDX handlers 3 4 BLOCK AFT and IDX Managers 5 6 ENTRY DELAFTIDX delete an entry from IDX or AFT 7 ENTRY FREEAFTACS 8 ENTRY GETAFTACS 9 ENTRY SRCHAFTIDX search IDX or AFT 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1172 (IDXMANGLE) F 60 often used AFT and IDX handlers 11 12 ********************************************************************************** 13 * * 14 * DELAFTIDX. Routine to delete an entry from either the AFT * 15 * or a particular IDX. The disk table is searched and if the * 16 * entry exactly matches then the entry is removed. Resulting * 17 * empty blocks are not freed so that the disk need not be * 18 * updated. Maybe that is a good idea someday. Routine assumes * 19 * that search access to the table has already been granted to * 20 * the caller. * 21 * Note that this routine leaves the GRUB (or possibly * 22 * DMOTE) of the window up to the caller (except for disk error). * 23 * This is so that this routine can be used by MOUNTIDX and * 24 * DISMNTIDX without causing a disk write for each entry * 25 * processed. * 26 * Call: * 27 * LD SP => return addr stack * 28 * LD R4 => IDXT for the table to change * 29 * CALL DELAFTIDX * 30 * PARV MS addr of dir for entry to delete * 31 * PARL account name triple * 32 * JMP * 33 * JMP * 34 * * 35 * * 36 * Eats R0:R3 and WNDO1. * 37 * Stack required = 11 * 38 * 4 + max ( GRUBWNDO1 (7), SETWNDO1 (4) ) * 39 * * 40 ********************************************************************************** 41 42 BLOCK DELAFTIDX and SRCHAFTIDX subroutines 43 44 ENTRY DELAFTIDX delete an entry from IDX or AFT 45 ENTRY SRCHAFTIDX search IDX or AFT 46 47 BEGFRAME 00178004 6 CACH 48 DELIDXNDX BSSB 8 bucket currently looking in 49 BSSB 7 filler 00099F11 6 ZBM 50 DELIDXACCT BSSB 17 pointer to account name triple 00178802 6 BASE 51 DELIDXVAL BSS 1 value of entry (MS address) to delete 00178803 6 BASE 52 SAVER5 BSS 1 temp for keeping R5 53 ENDFRAME 54 056A0 DD1F8004 6 STAK 55 DELAFTIDX ENTR PUSH 056A1 C1578802 6 BASE 56 STPV SP,DELIDXVAL directory address 056A2 C0099F11 6 ZBM 57 STPL SP,DELIDXACCT pointer to account name triple 056A3 EDCBC010 7 CBM 58 STW R7/BIT 0 say I'm deleting 000056A4 59 SHARECODE LABEL 60 * \ / 61 056A4 E5578803 5 6 BASE 62 ST R5 SP,SAVER5 put register away for safe keeping 63 * Use macro to calculate IDX hashing function in R1. 056A5 60899F11 2 6 ZBM 64 LD R2 SP,DELIDXACCT get pointer to account name triple 65 IDXHASH R0,R1,(R2,0),(R2,2),(R4,IDXTBNUM) 056A6 62168800 012 BASE 65 LD2 R0 (R2,0) get the account name into R0 and R1 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1173 (IDXMANGLE) F 60 often used AFT and IDX handlers 056A7 744A1000 1 0 CBM 65 XOR R1 R0/BITS 8:7 mix up the account number 056A8 60168802 0 2 BASE 65 LD R0 (R2,2) fetch up the project 056A9 744A2000 1 0 CBM 65 XOR R1 R0/BITS 16:15 mix in the project shifted 056AA 60040000 0 IMM 65 LD R0 0 initialize register for marth 056AB 58C40010 IMM 65 IORPSR PSRMODIF say that we want the remainder 056AC 14170005 0 4 CACH 65 DIV R0 (R4,IDXTBNUM) divide by number of buckets 056AD 58840010 IMM 65 CLBPSR PSRMODIF restore normalcy 056AE EC0BC210 7 CBM 66 STZ R7/BIT 1 flag to catch looping 67 * \ / 000056AF 68 INTONEXT LABEL 056AF E4578004 1 6 CACH 69 ST R1 SP,DELIDXNDX remember bucket hashed into 000056B0 70 INTONEXTY LABEL 056B0 615D0804 5 41 BASE 71 LD R5 R4,IDXTBUCKET(R1) get MS address of bucket 056B1 7940254F 5 72 AND R5 MSBLKMASK remove any upper garbage 056B2 FB4256DC 5 73 JEQZ R5 NOTTHERE jump if an empty bucket 056B3 60090080 0 4 ZBM 74 LD R0 R4,IDXTVOL get our volume number 056B4 E40B4080 0 5 CBM 75 ST R0 R5/VOLFIELD set in volume number field 056B5 DC003205 76 CALL SETWNDO1 get the block mapped in 056B6 41440000 IMM 77 PARV VPCNTLW indicate write access 056B7 41440000 IMM 78 PARV VPNOFCB indicate no lun associated with this block 056B8 410056DD 79 PAR BLOCKBAD pass error address 056B9 41534000 5 REG 80 PARV R5 pass MS address of bucket 056BA 40570004 4 CACH 81 PARVL R4,IDXTFBIT pass FBI type of block 056BB 60C40800 3 IMM 82 LD R3 ADR WNDO1 the place to start searching 000056BC 83 TRYNEXT LABEL 056BC 5E16C800 3 BASE 84 CMZ2 R3,IDXACNO an empty entry? 056BD FE0C56C0 85 JNE CHECKENTRY jump if not 056BE 5C16C802 3 BASE 86 CMZ R3,IDXACNOP to be empty both acct and proj are zero 056BF FE0256DC 87 JEQ NOTTHERE jump if entry not found 000056C0 88 CHECKENTRY LABEL 056C0 60899F11 2 6 ZBM 89 LD R2 SP,DELIDXACCT get pointer to account name triple 056C1 6044000C 1 IMM 90 LD R1 3*CPW get comparison length 056C2 3816C800 0 3 BASE 91 LEA R0 R3,IDXACNO get pointer to IDX triple 056C3 DA108800 0 21 92 CMSTR R0 R2 R1 check for match 056C4 FE0256D0 93 JEQ MAYBETHIS jump if a match 000056C5 94 MOVE2NEXT LABEL 056C5 18C40005 3 IMM 95 ADD R3 IDXLNTH move pointer to the next entry 056C6 64C40BFC 3 IMM 96 CPR R3 ADR WNDO1(IDXECNT*IDXLNTH) are we at the end? 056C7 FE0856BC 97 JLT TRYNEXT jump if more to search 98 * \ / 99 100 ********************************************************************************** 101 * This block seems full so we follow the overflow into * 102 * the next block. * 103 ********************************************************************************** 104 105 * \ / 056C8 DC403150 106 CALLNP GRUBWNDO1 free up window, prevent WSX use 056C9 BC578004 1 6 CACH 107 INCL R1 SP,DELIDXNDX get the bucket we're in 056CA 64570005 1 4 CACH 108 CPR R1 R4,IDXTBNUM check for wrap around 056CB FE0856B0 109 JLT INTONEXTY jump and try next block if not 056CC F7C256DC 7 110 JBT R7/BIT 1 NOTTHERE jump if around twice 056CD 60440000 1 IMM 111 LD R1 0 056CE 7DC28000 7 IMM 112 IOR R7 1*BIT 1 remember once around 056CF FE0E56AF 113 JMP INTONEXT 114 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1174 (IDXMANGLE) F 60 often used AFT and IDX handlers 115 116 * The name matches -- be extra careful if deleting. 000056D0 117 MAYBETHIS LABEL 056D0 6016C803 0 3 BASE 118 LD R0 R3,IDXDIRDA pick up the tables UDIR address 056D1 F3C056DB 7 119 JBF R7/BIT 0 ONLYSRCH jump if searching and not deleting 120 * \ / for a delete even the value must match 056D2 74178802 0 6 BASE 121 XOR R0 SP,DELIDXVAL match up against requested value 056D3 60440010 1 IMM 122 LD R1 FBITAFT get type code for an AFT block 056D4 64570004 1 4 CACH 123 CPR R1 R4,IDXTFBIT is this an AFT? 056D5 FE0256D7 124 JEQ NOMASKAFT do NOT mask off volume for AFTs 056D6 7800254F 0 125 AND R0 MSBLKMASK isolate the significant part 000056D7 126 NOMASKAFT LABEL 056D7 FA0C56C5 0 127 JNEZ R0 MOVE2NEXT try it with the next entry 128 * \ / 129 130 ********************************************************************************** 131 * * 132 * An entry had been found to delete so fill the entry * 133 * with garbage. This ensures that subsequent searches for * 134 * entries that have overflowed into the next block are * 135 * still looked for there. * 136 * * 137 ********************************************************************************** 138 139 * \ / 056D8 D356C800 3 BASE 140 STMW2 R3,IDXACNO clear the account name 056D9 D156C802 3 BASE 141 STMW R3,IDXACNOP and the division-project 056DA D0492101 4 ZBM 142 DEC R4,IDXTENTS one less account herein 000056DB 143 ONLYSRCH LABEL success on search, UDIR addr in R0 056DB FBE056DC 7 144 IRJ R7 NOTTHERE success, add two to return address 145 * --- 146 147 148 ********************************************************************************** 149 * * 150 * NOTTHERE... Arrive here when we have found an empty entry or block. * 151 * That means that the account could never have hashed to * 152 * to this point -- that means that the entry is not found. * 153 * BLOCKBAD... We have gotten some type of disk error. Error code * 154 * is passed back in R0. Window one is unmapped. * 155 * * 156 ********************************************************************************** 157 000056DC 158 NOTTHERE LABEL 056DC FBE056E0 7 159 IRJ R7 NORMEXIT give another skip 160 * --- 161 000056DD 162 BLOCKBAD LABEL Disk error, give error return 056DD 61520000 5 0 REG 163 LD R5 R0 save the error code 056DE DC403150 164 CALLNP GRUBWNDO1 release this window 056DF 60134000 0 5 REG 165 LD R0 R5 restore the error code 000056E0 166 NORMEXIT LABEL 056E0 61578803 5 6 BASE 167 LD R5 SP,SAVER5 restore this register 056E1 5D1F8004 6 STAK 168 LEAVE POP return 169 * --- 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1175 (IDXMANGLE) F 60 often used AFT and IDX handlers 171 172 ********************************************************************************** 173 * * 174 * SRCHAFTIDX. Routine to search the specified table to find an * 175 * account therein. * 176 * Call: * 177 * LD SP => return address stack * 178 * LD R4 => IDXT block for that disk table * 179 * CALL SRCHAFTIDX * 180 * PARL account name triple * 181 * JMP * 182 * JMP * 183 * ST R0 disk address for found entry UDIR1 * 184 * * 185 * * 186 * Eats R0:R3. * 187 * Stack required = 11. See DELAFTIDX. * 188 * * 189 ********************************************************************************** 190 056E2 DD1F8004 6 STAK 191 SRCHAFTIDX ENTR PUSH 056E3 C0099F11 6 ZBM 192 STPL SP,DELIDXACCT save pointer to account name triple 056E4 EC0BC010 7 CBM 193 STZ R7/BIT 0 say we are searching 056E5 FE0E56A4 194 JMP SHARECODE almost like a delete without the blood 195 * --- 196 197 END DELAFTIDX and SRCHAFTIDX subroutines 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1176 (IDXMANGLE) F 60 often used AFT and IDX handlers 199 200 ********************************************************************************** 201 * * 202 * GETAFTACS. Get access to the AFT. Depending on whether * 203 * the caller wishes to modify the AFT or just look, this code * 204 * gives exclusive access or shared access. Two counters on the * 205 * head page count the number of modifiers and lookers and if * 206 * the user's requested access conflicts then he is suspended * 207 * until access can be allowed. * 208 * If this user is a looker and there are no modifiers, * 209 * then give it to him. * 210 * If this user is a looker and there are modifiers, * 211 * then queue him. * 212 * If this user is a modifier and there are other users, * 213 * then queue him. * 214 * Call: * 215 * LD SP => return addr stack * 216 * CALL GETAFTACS * 217 * PARVL zero if looking and one if modifying * 218 * * 219 * Routine gets R0 and R1. * 220 * Stack required = 1 * 221 * 1 + max ( LOCKWAIT (0), SUSPENDME (0) ) * 222 * * 223 ********************************************************************************** 224 225 BLOCK GETAFTACS subroutine 226 227 ENTRY GETAFTACS 228 229 BEGFRAME 230 ENDFRAME 231 056E6 DD1F8001 6 STAK 232 GETAFTACS ENTR PUSH 056E7 C0524000 1 REG 233 STPVL R1 place look/modify indicator in R1 234 * \ / 235 236 * Get access to the access counters 000056E8 237 TRYAGAIN LABEL 238 PLOCK AFTLOCK call to lock the AFT => lock word 056E8 0CC00000 238 IOFF 056E9 D1C01F65 238 SETT AFTLOCK 056EA FE0C56EC 238 JNE MA(2+DISPW MA 0) 056EB DC40308B 238 CALLNP LOCKWAIT 239 * Note that PLOCK and SUSPENDME both restore R1 056EC FA4256F6 1 240 JEQZ R1 JUSTLOOK jump if I'm a just a looker 056ED BC001F67 0 241 INCL R0 AFTMODIFY count up the modifiers 056EE FA2256F1 0 242 DRJ R0 NOMODIFY jump if I must wait 056EF 5C001F66 243 CMZ AFTLOOKERS are there lookers looking? 056F0 FE0256FE 244 JEQ GAAXIT jump if no lookers, he gets it 245 * \ / 246 247 * Either there are other lookers or there are other modifiers 248 * so I, a modifier, must wait. 249 * \ / 000056F1 250 NOMODIFY LABEL 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1177 (IDXMANGLE) F 60 often used AFT and IDX handlers 056F1 DC00351C 251 CALL SUSPENDME put me in a queue 056F2 41005700 252 PAR GOMOD when restarted, we've got it 056F3 41430000 IMM 253 PARV 080000000 flag for a AFT modifier 056F4 41001DAF 254 PAR SQIDXWAIT 056F5 40001F65 255 PARL AFTLOCK 256 * --- 257 258 * A looker trying to get at the AFT 000056F6 259 JUSTLOOK LABEL 056F6 5C001F67 260 CMZ AFTMODIFY are there modifiers? 056F7 FE0256FD 261 JEQ LOOKATIT jump if not -- I may access 056F8 DC00351C 262 CALL SUSPENDME wait for the modifer to finish 056F9 410056E8 263 PAR TRYAGAIN 056FA 41440000 IMM 264 PARV 0 flag for an AFT looker 056FB 41001DAF 265 PAR SQIDXWAIT 056FC 40001F65 266 PARL AFTLOCK 267 * --- 268 269 * Looking privilege is granted 000056FD 270 LOOKATIT LABEL 056FD D0001F66 271 INC AFTLOOKERS count a new looker 000056FE 272 GAAXIT LABEL 273 PUNLOCK AFTLOCK unlock the AFT counters => lock word 056FE EC001F65 273 STZ AFTLOCK 056FF 0C800000 273 ION 00005700 274 GOMOD LABEL 05700 5D1F8001 6 STAK 275 LEAVE POP 276 * --- 277 278 END GETAFTACS subroutine 1 Assembler C9208 VRM, System C9303 (18 Mar 93) 12-May-93 12:30 PAGE1178 (IDXMANGLE) F 60 often used AFT and IDX handlers 280 281 *******************************************