1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 1 (PROP) F 2 2 INPUT SOURCE.OPSYS:PROP 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 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 3 4 5 6 * PPPP RRRR OOO M M BBBB OOO OOO TTTTT 7 * P P R R O O MM MM B B O O O O T 8 * P P R R O O MM MM B B O O O O T 9 * PPPP RRRR O O M M M BBBB O O O O T 10 * P R R O O M M B B O O O O T 11 * P R R O O M M B B O O O O T 12 * P R R OOO M M BBBB OOO OOO T 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 2 F 0 14 15 ********************************************************************************** 16 * * 17 * revision date * 18 * -------- ---- * 19 * 6.1 10 Mar 1982 * 20 * Misc clean ups. Boot buttons for tape * 21 * boot changed to 8:A to allow 4:7 to go * 22 * to OPL if needed. * 23 * * 24 * 6.2 28 Jun 1982 * 25 * Changes to Tape Boot protocol. * 26 * * 27 * 6.3 27 Sep 1982 * 28 * Major fixes to error detection, correction, * 29 * and reporting in the tape driver. * 30 * * 31 * 6.4 18 Apr 1984 * 32 * WRUTYPE now WRU0TYPE (changed ZBM also) * 33 * Did not release, since change not significant. * 34 * * 35 * 6.5 14 Feb 1985 * 36 * Rename decryptor variables and include * 37 * PBCRYPDEFS to define them. * 38 * * 39 * 6.6 16 Dec 1986 * 40 * Mods to clear parity errors from unused * 41 * variable area (necessary for subsequent * 42 * crashdump operations). Changes to * 43 * PPUIWAIT and its callers. Tape booting * 44 * will now read several more records while * 45 * looking for a file mark to allow for * 46 * minor format changes to backup tapes. * 47 * PFRD now used to set PHPNAV. Slot number * 48 * test modified to use NUMSLOTS and JLT. * 49 * Several minor changes to conform to * 50 * current coding standards. TapeBoot no * 51 * longer verifies that the boot unit is * 52 * unit zero. Eliminated ST2 instructions * 53 * that stored to the SSU. * 54 * * 55 * 7.0 23 Mar 1989 * 56 * Mods to allow boot from video tape. RC * 57 * * 58 * 8.0 09 Sep 1991 * 59 * Mods to allow boot from SCSI disk. This * 60 * includes various subterfuges to save enough * 61 * space so the SCSI driver can be added in. RC * 62 * 8.1 31 Mar 1992 * 63 * Revision number update to eliminate several * 64 * different versions all assembled as 8.0. RC * 65 * * 66 ********************************************************************************** 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 3 F 0 68 69 ********************************************************************************** 70 * * 71 * BOOTSTRAP ROUTINE * 72 * * 73 * This program is cut into a PROM that resides on the SSU. * 74 * The SSU loads it into the lowest memory at physical address * 75 * zero when the boot switch is activated. All CPUs have PF80 set * 76 * to point there (read/write), PC set to zero, MSR set to monitor * 77 * state, and IM and R4 set to point to the slot containing the * 78 * SSU. The program examines the system configuration and reads * 79 * a bootstrap program from some device. * 80 * * 81 * The sequence of events done by the SSU microcode * 82 * during a bootstrap is: * 83 * 1) Assert PAUSE, set Run/Halt switch to HALT, * 84 * wait for 250 ms. * 85 * 2) Assert PFW, wait for 250 ms. * 86 * 3) Clear PFW, wait for 250 ms. * 87 * 4) Assert MCLR, wait for 250 ms. This clears out * 88 * the bus interface logic and such like and sets * 89 * up the microprocessors to run when released. * 90 * 5) Release MCLR, wait for 5 seconds. This allows * 91 * sufficient time for all VRA bus devices to run * 92 * their self tests. The longest is the CPU4 * 93 * which runs an extra long RAM test on power up. * 94 * 6) Send a WRU 0 to each slot. If there is no * 95 * memory with a page zero, display "NO MEMORY" * 96 * and exit. * 97 * 7) For each active slot, do a WRU 0 through WRU 0E * 98 * and store the results into the first MCU at * 99 * address #2sw, where s is the slot number of the * 100 * interrogated module, and w is the WRU number. * 101 * For each empty slot, #2sx is set to 0 for x=0 * 102 * to 0E. Word #2sF is set to #FFFFFFFF for all s. * 103 * 8) Command each bus device to run its self test * 104 * and display "SELF TEST". * 105 * 9) Allow two seconds for self test to complete. * 106 * 10) Retrieve the self test response (WRU #F) from * 107 * all occupied slots. If it is a zero, store it * 108 * into word #2sF. If it is not a word of all * 109 * zeros, display "STF SLOT s" on the control * 110 * panel display and exit. * 111 * 11) If there is no CPU in any slot, display * 112 * "NO CPU" and exit. * 113 * 12) Do the following initialization for each CPU: * 114 * A) PC := 0 * 115 * B) PSR := 0 * 116 * C) PF 80 := first page of first memory * 117 * D) R0 := slot number of first memory * 118 * E) PF 81 := excluded (#00060000) * 119 * F) R4 := IM := #000000F0 + slot number of * 120 * this SSU * 121 * G) MSR := #E1F0 * 122 * H) Go * 123 * 13) Copy the bootstrap prom into the first memory * 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 4 F 0 124 * at addresses 0:#1FF and read it back to * 125 * verify the checksum. * 126 * 14) Set the Run switch. * 127 * 15) Release pause to let the CPUs go. * 128 * * 129 * This code is then executed by each CPU. The interlock * 130 * near the beginning causes all CPUs but one to wait. Note * 131 * that this bootstrap, like the operating system code, uses * 132 * virtual address 1800:1BFF to talk to the peripheral devices * 133 * on the bus. This is accomplished by loading page file * 134 * location PNCIX with the appropriate page map value to point * 135 * to the desired I/O device and then using addresses relative * 136 * to CIX. * 137 * The CPU doing the work executes this bootstrap to * 138 * accomplish the following: * 139 * 1) Handles several initialization chores. * 140 * Note: the MCU may be in a slot other than zero. * 141 * 2) Checks for type of boot. * 142 * 3) Loops to find PPU, channel (controller), and * 143 * unit appropriate to the type of boot requested. * 144 * 4) For boot from mass storage, we read in the * 145 * pack label (if needed to find the parameters * 146 * for the disk driver) and the boot block. We * 147 * then use the routines in the boot block to * 148 * ensure that we have a system volume. This * 149 * is done by using SRCHDIR to search for the file * 150 * "System.!!!:!!!!!!!!!!!!.!!!!!!". The error * 151 * expected is "file not found". If the volume * 152 * is not a system volume (indicated by finding * 153 * some other error code), we continue our scan, * 154 * otherwise we release all CPUs to go to * 155 * DISKBOOT. * 156 * 5) For boot from tape, we read the first record * 157 * after the first file mark. We decrypt the code * 158 * part of the block (using the tape password from * 159 * the NVM), verify that it is a proper TAPEBOOT, * 160 * and release all CPUs to go to TAPEBOOT. * 161 * * 162 ********************************************************************************** 163 164 165 ********************************************************************************** 166 * * 167 * Note: The memory of a machine when booted may contain * 168 * parity errors in any and all locations. These parity errors * 169 * must be cleared so that a crashdump operation can take * 170 * place and so that actual memory problems stand out during * 171 * field service analysis. The operating system takes care of * 172 * most of these errors by ensuring that it initially does a * 173 * fill or disk read of any new page. However, it is our * 174 * responsibility to clear page zero. Locations 000:1FF are * 175 * taken care of because the BootProm is copied there. * 176 * Locations 200:2FF are taken care of because the SSU stores * 177 * WRU responses there. We must ensure that all remaining * 178 * variables on the boot page get cleared. Instructions have * 179 * been inserted to clear 300:35F. This serves to eliminate * 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 5 F 0 180 * the parity errors. Subsequent operations will clear the * 181 * remaining tables. * 182 * Prior to the addition of this clear, the code was * 183 * organized to ensure that each USED location was stored into * 184 * by a whole word store before any ZBM (read OR write, direct * 185 * or indirect) or read operation was attempted against the * 186 * location. This proved to be inadequate, since the disk * 187 * write during crashdump reads all locations, whether a used * 188 * variable or not. The code was, however, adequate to ensure * 189 * that the system could be booted and run. This assurance is * 190 * inexpensive and I would expect that all existing and new * 191 * code will continue to observe this initialization rule. * 192 * * 193 ********************************************************************************** 194 195 BLOCK Global Block 196 197 NOLIST CREF 198 INPUT SOURCE.OPSYS:MACHDEFS 199 INPUT .SYS:MACROS 1 * Including MACROS.ASSEM Version A8607. 200 INPUT SOURCE.OPSYS:IODEFS 201 INPUT OPSYS.SCSIDR:SCSIDEFS 202 INPUT SOURCE.OPSYS:DISKDEFS 203 INPUT SOURCE.OPSYS:PAGEDEFS 204 INPUT BOOT.OPSYS:OPLVECTORS 205 INPUT SOURCE.OPSYS:HALTDEFS 206 INPUT BOOT.OPSYS:TAPECB 207 LIST CREF 209 INPUT SOURCE.OPSYS:IBLOCK 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 6 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 7 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 8 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 9 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 10 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 11 (IBLOCK) F 12 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 C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 12 (IBLOCK) F 12 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 212 INPUT PROMBOOT.OPSYS:PBCRYPDEFS decryptor definitions 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 13 (PBCRYPDEFS) F 13 2 3 ********************************************************************************** 4 * * 5 * These definitions are provided so that programs using the * 6 * PROMBOOT encrytor/decryptor may include the same decrypt file * 7 * which uses global variables. These variables for most programs * 8 * reside in the first page of virtual (and physical) memory and * 9 * are defined in IBLOCK. Here we equate encrypt/decrypt global * 10 * variables to the ones defined for this purpose in IBLOCK. * 11 * * 12 ********************************************************************************** 13 0000031F 14 HDRBUF EQU TPHDRBF buffer for the tape header 15 0400032A 16 KEYHALF EQU KEYH describe key by half words 0000032A 17 KEYINDIC EQU KEYIND holds the key indicator 0000032B 18 KEYPWDDAT EQU KEYPWDATE holds XOR of PWD and backup date 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 14 F 0 214 215 ********************************************************************************** 216 * * 217 * The SSU reads PROMBOOT (this program) from an EPROM * 218 * and stores it starting at location zero. Then the SSU sets * 219 * up the CPUs to start execution at location zero. * 220 * * 221 ********************************************************************************** 222 223 ORG MA 0 224 225 BLOCK PROMBOOT routine 226 00000000 227 PBPAGE LABEL 00000080 ABS 228 PNPBPAGE EQU MONPF+(PBPAGE DISPW MA 0)/WPP prom boot page number 229 230 ********************************************************************************** 231 * * 232 * This jump is here so that the version number can be * 233 * in the 'standard' location at one past the entry point. * 234 * It is replaced with a halt later in this bootstrap code. * 235 * The power failure restart code is placed here during the * 236 * initialization phase of the operating system operation. * 237 * * 238 ********************************************************************************** 239 00000000 240 BOOT LABEL 00000 FE0E0004 241 JMP OVERVERSN jump over version number 242 * --- 243 00001 382E3120 244 VERSION TEXT "8.1" version number 00002 00000000 245 VFD 0 reserved for future feature 246 00003 00021002 247 ZEROHALT HALT HALTB1002 power failure while booting 248 * or during subsequent offline 249 * operation. This instruction 250 * is copied to location zero 251 252 ********************************************************************************** 253 * * 254 * Clear out the page file except for the page that we * 255 * are running in. Note that we must not store anything into * 256 * the IBLOCK variable area until after it is cleared * 257 * following the SETT that picks a CPU. * 258 * * 259 ********************************************************************************** 260 00000004 261 OVERVERSN LABEL 00004 60C400FF 3 IMM 262 LD PFPTR PFSIZE-1 number of PF locations 00000005 263 BCLPFLP LABEL 00005 64C40080 3 IMM 264 CPR PFPTR PNPBPAGE checks for current page 00006 FE020008 265 JEQ BCPFME jump to skip page file clear 00007 80D28000 2 REG 266 PFRC R2 clear PF location, discard . . . 267 * . . . unwanted current value in R2 00000008 268 BCPFME LABEL 00008 FAE60005 3 269 JDR PFPTR BCLPFLP continue for all locations 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 15 F 0 270 * \ / 271 272 ********************************************************************************** 273 * * 274 * Here we set up the page file so that each CPU has * 275 * pages mapped as follows: * 276 * PFN virtual addr phys addr use * 277 * --- ----------- --------- --------------------------- * 278 * 80 00000 00000 PROMBOOT (mapped by SSU) * 279 * 84 01000 00400 DISKBOOT or TAPEBOOT (aka WNDO3) * 280 * 82 00800 00800 WNDO1 (disk buffer in DISKBOOT) * 281 * 83 00C00 00C00 WNDO2 (disk buffer in DISKBOOT) * 282 * 85 01400 01000 WNDO4 (substitution list area) * 283 * * 284 ********************************************************************************** 285 286 * \ / 00009 61840360 6 IMM 287 LD SP ADR IBSTACK point SP to IBLOCK stack area 288 * (must not use until filled) 289 0000A 60C40080 3 IMM 290 LD PFPTR PNPBPAGE PROMBOOT page number 0000B 80920000 0 REG 291 PFRD R0 get our own page-file value 0000C 2802000E 0 IMM 292 BSUB R0 1*PFROBIT+1*PFALTBIT+1*PFREFBIT strip off these bits 0000D 60C40084 3 IMM 293 LD PFPTR PNBOOTLOC get page number where DISKBOOT is to be loaded 0000E 00D61001 0 REG 294 LDPF R0+1 set DISKBOOT page map 0000F 60C40082 3 IMM 295 LD PFPTR PNWNDO1 00010 00D61002 0 REG 296 LDPF R0+2 set WNDO1 page map 00011 60C40083 3 IMM 297 LD PFPTR PNWNDO2 00012 00D61003 0 REG 298 LDPF R0+3 set WNDO2 page map 00013 60C40085 3 IMM 299 LD PFPTR PNWNDO4 00014 00D61004 0 REG 300 LDPF R0+4 set WNDO4 page map 301 * \ / 302 303 ********************************************************************************** 304 * Only one CPU may actually run the bulk of the * 305 * bootstrap code. This lock allows the first CPU to arrive * 306 * here to have the honors. All other CPUs go off to a tight * 307 * loop and twiddle their bits until the first CPU flags them * 308 * to go. Note that LOCKWORD also serves to hold all the * 309 * non-primary CPUs in a loop until the primary CPU clears it. * 310 ********************************************************************************** 311 312 * \ / 00015 D1C001E9 313 SETT LOCKWORD see if we're first 00016 FE0200E7 314 JEQ OTHERWAY jump if someone else made it through 315 * \ / 316 317 ********************************************************************************** 318 * Clear memory errors from that portion of the boot page * 319 * not already cleared by the boot process. We also pick up * 320 * the page map value of the last used page to pass on to * 321 * DISKBOOT and points south. * 322 ********************************************************************************** 323 324 * \ / 00017 60840300 2 IMM 325 LD R2 ADR EWRUINFO points to start of var area 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 16 F 0 00018 60440180 1 IMM 326 LD R1 EVARCLEAR DISPC EWRUINFO length of area to clear 00019 DA800800 2 1 327 FILLI R2 R1 000 clear out the area 328 329 * \ / PFPTR still points to PNWNDO4 0001A 80800311 330 PFRD PHPNAV save number of last used page 331 * \ / 332 333 ********************************************************************************** 334 * * 335 * Device Map * 336 * The SSU has placed all of the WRU responses from the * 337 * bus devices into the IBLOCK table. We build a condensed * 338 * table containing the WRU zero reponses. This table will be * 339 * passed to DISKBOOT and the operating system initialization * 340 * routine. * 341 * * 342 ********************************************************************************** 343 344 * \ / 0001B 6047FFF0 1 IMM 345 LD R1 -NUMSLOTS index into IBSLOTS 0001C 60840000 2 IMM 346 LD R2 0 index into IBLOCK 347 * \ / 0000001D 348 BUSLOOP LABEL 0001D 60240200 0 2 349 LD R0 IBLOCK(R2) get WRU response 0001E E4220380 0 1 350 ST R0 IBSLOTS(R1+NUMSLOTS) save in compact vector 0001F 18840010 2 IMM 351 ADD R2 WRUIMAX R2 = next index into IBLOCK 00020 FA60001D 1 352 IRJ R1 BUSLOOP R1 = next index into IBSLOTS, and jump 353 * \ / 354 355 ********************************************************************************** 356 * * 357 * Clear the starting location to prevent trying a * 358 * restart after power failure. We make the assumption that * 359 * all other CPUs have left location zero by now. This is * 360 * reasonable since all CPUs are told to GO while PAUSE is on. * 361 * PAUSE is then released and all CPUs start together. Since * 362 * we are now several hundred instructions later, it is a safe * 363 * bet that the other CPUs have each executed at least one * 364 * instruction. * 365 * * 366 ********************************************************************************** 367 368 * \ / 00021 60000003 0 369 LD R0 ZEROHALT a HALT B1002 instruction 00022 E4000000 0 370 ST R0 BOOT store at beginning of boot 371 * \ / 372 373 ********************************************************************************** 374 * * 375 * Get the SSU slot # that it was nice enough to give to * 376 * us in register 4, and build a page file entry to talk to * 377 * the SSU. * 378 * * 379 ********************************************************************************** 380 381 * \ / use R0 to build PF value 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 17 F 0 00023 60040005 0 IMM 382 LD R0 SSUCOFFSET/FLDABSPG start with page number where SSU takes commands 00024 E50A0840 4 0 CBM 383 ST R4 R0/PFSLOT R0 = page file for SSU 00025 E4000310 0 384 ST R0 SSUPF page file to access SSU for commands 00026 60C40086 3 IMM 385 LD PFPTR PNCIX get page number reserved for I/O 00027 00D20000 0 REG 386 LDPF R0 map SSU into CIX 00028 60001810 0 387 LD R0 CIX(SSUBOOTFP) get switches at boot time 00029 E4000313 0 388 ST R0 FPSWITCHX save the switches 389 * \ / 390 391 ********************************************************************************** 392 * * 393 * Decide whether to boot from disk, tape, or something * 394 * else. * 395 * * 396 ********************************************************************************** 397 398 * \ / 0002A 61C40002 7 IMM 399 LD R7 2 initialize flag: illegal boot request 0002B 7804000F 0 IMM 400 AND R0 0F get boot selection from switches 0002C 60300088 0 0 @ 401 LD R0 @PBOOTABLE(R0) get boot type from table 0002D FA0200B7 0 402 JEQZ R0 BOOTERROR jump if illegal boot type 403 * \ / 0002E E4000330 0 404 ST R0 BOOTYPE save boot type requested 405 * note that the 'tape' type boots may 406 * be either from MT, CT, or VT, and 407 * 'disk' type boots may be either 408 * from a BFD or a SCSI disk controller. 409 * \ / this is not a hardware type code. 410 411 ********************************************************************************** 412 * * 413 * Search slots for PPU. Then look for disk or tape * 414 * controller as specified by operator switch setting. It * 415 * always searches for PPUs, controllers, and units in * 416 * ascending order. * 417 * * 418 ********************************************************************************** 419 420 * \ / 0002F 61C40000 7 IMM 421 LD R7 0 set flag: no PPU (and no boot device) found 00030 EC000316 422 STZ BOOTDEVPF start with slot zero 423 424 * \ / 00000031 425 TRYSLOT LABEL 00031 601000E2 0 @ 426 LD R0 @SLOTPTR get slot number from page map value 00032 60200370 0 0 427 LD R0 IBSLOTS(R0) get WRU response from resident table 00033 600A0040 0 0 CBM 428 LD R0 R0/WRU0TYPE get board type 00034 64040003 0 IMM 429 CPR R0 SLTTPPU is it a PPU? 00035 FE0C00B4 430 JNE NEXTSLOT jump if not 431 * \ / 00036 7DC40001 7 IMM 432 IOR R7 1 set flag: PPU found 00037 EC1000E3 @ 433 STZ @CHANPTR start looking at channel zero 434 435 * \ / 00000038 436 TRYCHAN LABEL 00038 60C40086 3 IMM 437 LD PFPTR PNCIX get page number for I/O 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 18 F 0 00039 00C00316 438 LDPF BOOTDEVPF map in the controller 0003A 60801800 2 439 LD R2 CIX(PPUCABLED) get device WRU info 0003B 604A8080 1 2 CBM 440 LD R1 R2/DWRUTYPE get device type 0003C 6032008A 0 1 @ 441 LD R0 @PTABLE1(R1) get type marker constant 0003D 10040002 0 IMM 442 SUB R0 BIAS subtract table bias 0003E E4000331 0 443 ST R0 BOOTCLOC save control field 0003F 6032008C 0 1 @ 444 LD R0 @PTABLE2(R1) get type of device 00040 64000330 0 445 CPR R0 BOOTYPE correct type of device (disk or tape)? 00041 FE0C00B1 446 JNE NEXTCHAN jump if not 447 * \ / 00042 7DC40003 7 IMM 448 IOR R7 3 set flag: correct device found 00043 5C0AA080 2 CBM 449 CMZ R2/DWRUDD did self-test work? 00044 FE02004D 450 JEQ GOODCHAN jump if yes 451 * \ / 00045 6000004C 0 452 LD R0 CONTSTOP2 else load prototype STOP instruction 00046 609000E2 2 @ 453 LD R2 @SLOTPTR 00047 E48A2840 2 0 CBM 454 ST R2 R0/BITS 20:23 store slot into instruction 00048 609000E3 2 @ 455 LD R2 @CHANPTR 00049 E48A3040 2 0 CBM 456 ST R2 R0/BITS 24:27 store channel into instruction 0004A 5D520000 0 REG 457 XCT R0 STOP B2scu - controller scu failed self-test 0004B FE0E00B1 458 JMP NEXTCHAN ignore device if operator hits RUN 459 * --- 460 0004C 00822000 461 CONTSTOP2 STOP STOPB2XXX controller XXX (SCU) failed self-test 462 0000004D 463 GOODCHAN LABEL 0004D EC000317 464 STZ BOOTUNIT start looking at unit zero 0004E 64040001 0 IMM 465 CPR R0 BTYPEDISK is it a disk? 0004F FE02008D 466 JEQ TRYDISK if yes, jump to disk section 467 * \ / 468 469 ********************************************************************************** 470 * Check to see if this device is a VT. The units can not * 471 * be addressed until they finish their self test, a variable * 472 * and considerable amount of time. * 473 ********************************************************************************** 474 00050 60000331 0 475 LD R0 BOOTCLOC pick up control field 00051 E4000318 0 476 ST R0 BOOTDEVCB/TPCBTRACK and save as track number 00052 6407FFFE 0 IMM 477 CPR R0 -2 check for VT 00053 FE0C005B 478 JNE NOSTOP if not, don't stop 00054 62000080 01 479 LD2 R0 VTMSG1 message prototype 00055 60800082 2 480 LD R2 VTMSG2 get last part of msg 00056 DC4000EA 481 CALLNP DISPLAY put MSG into the display 00057 00BFFFFF 482 STOP NOHALTCODE booting from non-zero unit 00058 60000083 0 483 LD R0 BLANKS clear the display 00059 62400083 12 484 LD2 R1 BLANKS 0005A DC4000EA 485 CALLNP DISPLAY put MSG into the display 0000005B 486 NOSTOP LABEL 487 488 ********************************************************************************** 489 * * 490 * Search for tape unit from which to boot. * 491 * We start by reloading the page file for the TAPE unit. * 492 * This covers the case where we loop back from NEXTUNIT * 493 * after destroying the mapping. (The current simple * 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 19 F 0 494 * minded tape driver does not destroy the mapping, but * 495 * this is for safety in the event of a change) * 496 * * 497 ********************************************************************************** 498 499 * \ / 0000005B 500 TRYTAPE LABEL 0005B 60C40086 3 IMM 501 LD PFPTR PNCIX get page number reserved for I/O 0005C 00C00316 502 LDPF BOOTDEVPF re-map the controller 503 * \ / Note that REWIND also selects track 504 * zero if this is a CT 0005D DC400166 505 CALLNP REWIND rewind the tape 0005E FE0E007C 506 JMP NEXTUNIT bad tape unit, try another unit 507 * \ / 508 509 ********************************************************************************** 510 * * 511 * The tape that we want should have two records (tape * 512 * label and duplicate), a file mark, and then TAPEBOOT. * 513 * In order to allow for minor changes in this format, we * 514 * search for the file mark, allowing up to 4 records before * 515 * the tape mark. * 516 * Note that if we fail to find a boot block, we do NOT * 517 * rewind the tape that we looked at. * 518 * * 519 ********************************************************************************** 520 521 * \ / 0005F 61440004 5 IMM 522 LD R5 5-1 initialize counter 00000060 523 TRYNXTREC LABEL 00060 DC40017D 524 CALLNP TAPE read a record 00061 FEC00000 525 NOP 0 ignore error return 00062 F6900065 2 526 JBT R2/MTSTEOF FOUNDEOF if EOF, expect boot block next 00063 FB660060 5 527 JDR R5 TRYNXTREC check record counter 00064 FE0E007C 528 JMP NEXTUNIT too far down this tape, try next unit 529 * --- 530 00000065 531 FOUNDEOF LABEL 00065 DC40017D 532 CALLNP TAPE try to read TAPEBOOT 00066 FE0E007C 533 JMP NEXTUNIT jump if bad read 534 * \ / 00067 6003FFC0 0 IMM 535 LD R0 FBICSMASK get mask for checking the header 00068 F000031F 0 536 PRMUT R0 HDRBUF do the XORs 00069 FA2E007C 0 537 JNEMW R0 NEXTUNIT jump if no good 538 0006A 6240031F 12 539 LD2 R1 HDRBUF(TPHDRTAG) get header label 0006B 66400085 12 540 CPR2 R1 TAPELABEL is this identified as TapeBoot? 0006C FE0C007C 541 JNE NEXTUNIT if not, try next tape unit 542 * \ / 0006D DC0001A0 543 CALL PBDINIT initialize decryptor 0006E 41400321 544 PARV HDRBUF(TPHDRIND) with header indicator 0006F 43400322 545 PARV2 HDRBUF(TPHDRDATE) and backup date 00070 40441000 IMM 546 PARVL ADR(BOOTLOC) pass address of data to decrypt 00071 DC4001B4 547 CALLNP PBDECRYPT decrypt the record 548 00072 604403FF 1 IMM 549 LD R1 L/CPW-1 get length of the tape boot record 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 20 F 0 00073 60040000 0 IMM 550 LD R0 0 initialize accumulator 00074 58840004 IMM 551 CLBPSR PSRCARRY clear arithmetic carry bit 00075 58C40010 IMM 552 IORPSR PSRMODIF set modify arithmetic 00000076 553 TPCKSLOOP LABEL 00076 18221000 0 1 554 ADD R0 BOOTLOC(R1) combine the next word 00077 FA660076 1 555 JDR R1 TPCKSLOOP include all words in checksum 556 * \ / 00078 18040000 0 IMM 557 ADD R0 0 add in final carry bit 00079 58840010 IMM 558 CLBPSR PSRMODIF clear the modify arithmetic 0007A 64000328 0 559 CPR R0 HDRBUF(TPHDRDCKS) is this the proper checksum? 0007B FE0200E0 560 JEQ DOBOOT jump to continue if good 561 * \ / bad checksum, try next record 0000007C 562 NEXTUNIT LABEL 0007C BCC00317 3 563 INCL R3 BOOTUNIT advance to next unit 0007D 64C40004 3 IMM 564 CPR R3 NMTPUNITS limited to 4 tape units 0007E FE08005B 565 JLT TRYTAPE back to try next unit 566 * \ / 0007F FE0E00B1 567 JMP NEXTCHAN try next channel 568 * --- end of section for tape 569 00081 20120419 570 VTMSG1 VFD "TAPE" AND 03F3F3F3F," RDY" AND 03F3F3F3F 00082 3F200010 571 VTMSG2 VFD ("? " AND 03F3F0000)+1*SSUALARM 00084 20200000 572 BLANKS VFD " " AND 03F3F3F3F," " AND 03F3F0000 573 00085 B8E273B9 574 TAPELABEL PAK12 TAPEBOOT identifier for TAPEBOOT 575 576 ********************************************************************************** 577 * * 578 * This table is indexed by the boot switches. It yields * 579 * a code distinguishing TAPE, DISK, and ILLEGAL boot requests. * 580 * * 581 ********************************************************************************** 582 00000000 ABS 583 BTYPEILL EQU 0 illegal boot type 00000001 ABS 584 BTYPEDISK EQU 1 boot from disk 00000002 ABS 585 BTYPETAPE EQU 2 boot from tape 586 00086 00000001 587 BOOTABLE VFD 2:BTYPEDISK,BTYPEDISK,BTYPEDISK,BTYPEDISK 00086 00000001 588 VFDB 2:BTYPEDISK,BTYPEDISK,BTYPEDISK,BTYPEDISK 00086 00000002 589 VFDB 2:BTYPETAPE,BTYPETAPE,BTYPETAPE,BTYPETAPE 00087 00000001 590 VFDB 2:BTYPEILL,BTYPEILL,BTYPEILL,BTYPEDISK 00088 00880087 591 PBOOTABLE PTR BOOTABLE 592 593 ********************************************************************************** 594 * * 595 * This table is indexed by controller WRUTYPE code and * 596 * provides a magic number that is saved in the control location. * 597 * The primary purpose is to enable the tape or disk drivers to * 598 * readily distinguish between MT/CT/VT or BFD/SCSI type controllers. * 599 * * 600 ********************************************************************************** 601 00000002 ABS 602 BIAS EQU 2 bias to allow negative numbers 603 00088 00000002 604 TABLE1 VFD 2:BIAS hardware type - 0 undefined 00088 00000003 605 VFDB 2:BIAS+1 hardware type - 1 BFD 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 21 F 0 00088 00000002 606 VFDB 2:BIAS hardware type - 2 LP 00088 00000002 607 VFDB 2:BIAS hardware type - 3 undefined 00088 00000002 608 VFDB 2:BIAS hardware type - 4 undefined 00088 00000002 609 VFDB 2:BIAS hardware type - 5 undefined 00088 00000002 610 VFDB 2:BIAS hardware type - 6 undefined 00088 00000002 611 VFDB 2:BIAS hardware type - 7 undefined 00088 00000002 612 VFDB 2:BIAS hardware type - 8 CIA 00088 00000001 613 VFDB 2:BIAS-1 hardware type - 9 MTC 00088 00000002 614 VFDB 2:BIAS+0 hardware type - A CTC 00088 00000000 615 VFDB 2:BIAS-2 hardware type - B VTC 00088 00000001 616 VFDB 2:BIAS-1 hardware type - C SDC 00088 00000002 617 VFDB 2:BIAS hardware type - D undefined 00088 00000002 618 VFDB 2:BIAS hardware type - E undefined 00089 00000002 619 VFDB 2:BIAS hardware type - F undefined 0008A 00880089 620 PTABLE1 PTR TABLE1 621 622 ********************************************************************************** 623 * * 624 * This table is indexed by controller WRUTYPE code and * 625 * provides the type code (corresponding to BOOTABLE entries) * 626 * of the boot operation that controller type can do. * 627 * * 628 ********************************************************************************** 629 0008A 00000000 630 TABLE2 VFD 2:BTYPEILL hardware type - 0 undefined 0008A 00000001 631 VFDB 2:BTYPEDISK hardware type - 1 BFD 0008A 00000000 632 VFDB 2:BTYPEILL hardware type - 2 LP 0008A 00000000 633 VFDB 2:BTYPEILL hardware type - 3 undefined 0008A 00000000 634 VFDB 2:BTYPEILL hardware type - 4 undefined 0008A 00000000 635 VFDB 2:BTYPEILL hardware type - 5 undefined 0008A 00000000 636 VFDB 2:BTYPEILL hardware type - 6 undefined 0008A 00000000 637 VFDB 2:BTYPEILL hardware type - 7 undefined 0008A 00000000 638 VFDB 2:BTYPEILL hardware type - 8 CIA 0008A 00000002 639 VFDB 2:BTYPETAPE hardware type - 9 MTC 0008A 00000002 640 VFDB 2:BTYPETAPE hardware type - A CTC 0008A 00000002 641 VFDB 2:BTYPETAPE hardware type - B VTC 0008A 00000001 642 VFDB 2:BTYPEDISK hardware type - C SDC 0008A 00000000 643 VFDB 2:BTYPEILL hardware type - D undefined 0008A 00000000 644 VFDB 2:BTYPEILL hardware type - E undefined 0008B 00000000 645 VFDB 2:BTYPEILL hardware type - F undefined 0008C 0088008B 646 PTABLE2 PTR TABLE2 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 22 F 0 648 649 ********************************************************************************** 650 * * 651 * Look for disk unit to boot from * 652 * * 653 ********************************************************************************** 654 0000008D 655 TRYDISK LABEL 656 * reload page file for DISK in case loop after SRCHDIR 657 * fails to find file 658 0008D 60C40086 3 IMM 659 LD PFPTR PNCIX get page number reserved for I/O 0008E 00C00316 660 LDPF BOOTDEVPF reload page file 661 0008F 60000331 0 662 LD R0 BOOTCLOC pick up control field 00090 FA040093 0 663 JGTZ R0 READBFD jump if a BFD controller 00091 DC000132 664 CALL SCSIDISK read from the SCSI device 00092 FE0E009E 665 JMP BLOCKIN go merge with BFD code 666 * --- 667 00000093 668 READBFD LABEL 00093 EDC00318 669 STW BOOTSCPTRK initialize the pack sizes to allow... 00094 EDC00319 670 STW BOOTRKPCYL ... the disk driver to read the pack label 00095 DC0000F1 671 CALL DISK read the pack label 00096 41440000 IMM 672 PARV PLDA block number 00097 40440001 IMM 673 PARVL FBITPL fbi type 00098 FE0E00AE 674 JMP NEXTDISK jump if can't get pack label 675 * \ / 00099 60001010 0 676 LD R0 BOOTLOC/PLSECPTRK 0009A E4000318 0 677 ST R0 BOOTSCPTRK set number of sectors per track 0009B 60001011 0 678 LD R0 BOOTLOC/PLTRKPCYL 0009C E4000319 0 679 ST R0 BOOTRKPCYL set number of tracks per cylinder 680 0009D DC0000F1 681 CALL DISK read the bootstrap block 0000009E 682 BLOCKIN LABEL entry from SCSI code 0009E 41440002 IMM 683 PARV BOOTDA block number 0009F 40440003 IMM 684 PARVL FBITBOOT fbi type 000A0 FE0E00AE 685 JMP NEXTDISK jump if can't read boot block 686 * \ / 687 * Set page map values in DISKBOOT to keep it happy 000A1 60C40082 3 IMM 688 LD PFPTR PNWNDO1 000A2 809013E8 @ 689 PFRD @VPFWNDO1 save WNDO1 page file value 000A3 60C40083 3 IMM 690 LD PFPTR PNWNDO2 000A4 809013E9 @ 691 PFRD @VPFWNDO2 save WNDO2 page file value 692 * \ / 693 694 ********************************************************************************** 695 * * 696 * Here we show some steel nerve and we call routines * 697 * that should be present in the DISKBOOT block that we just * 698 * read. The earlier read operation verified the FBITYPE, so * 699 * we are actually pretty safe. It just SEEMS risky, since * 700 * we haven't verified much of anything else about the block * 701 * (version, etc). The vector area in DISKBOOT (which points * 702 * to the various routines) should never be changed, however, * 703 * so we are on safe ground. * 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 23 F 0 704 * Our first call is to OPENDISK which will read the pack * 705 * label (again) and the substitution list and set up the disk * 706 * control block for all subsequent uses of this disk. * 707 * Then we call SRCHDIR looking for a specific account * 708 * and file. The account is the System.!!! account. It must * 709 * be present if we are to be able to boot from the pack. * 710 * Rather than choosing a particular file that we expect to * 711 * find, we chose the technique of searching for a file that * 712 * should NOT exist. We then expect to get an error from * 713 * SRCHDIR. Since it returns a different error code for * 714 * 'file not found' and 'account not found' we can reliably * 715 * determine whether System.!!! exists. * 716 * * 717 ********************************************************************************** 718 719 * \ / 000A5 60040000 0 IMM 720 LD R0 0 means PF value and unit already are set 000A6 60440000 1 IMM 721 LD R1 0 means use WNDO4 for substitution list 000A7 61040316 4 IMM 722 LD R4 ADR BOOTDEVCB R4 -> disk control block 000A8 DC5013EB @ 723 CALLNP @VOPENDISK call routine in DISKBOOT 000A9 FA0C00AE 0 724 JNEZ R0 NEXTDISK jump if didn't work 725 * \ / 726 * See if account SYSTEM.!!! exists on this disk. 727 * \ / 000AA 614400C7 5 IMM 728 LD R5 ADR FILEDESC R5 -> file descriptor 000AB DC5013E2 @ 729 CALLNP @VSRCHDIR search for file (in DISKBOOT) 000AC 64040006 0 IMM 730 CPR R0 6 error code: file not found 000AD FE0200D1 731 JEQ GOTBOOT jump if account exists (but not file) 732 * \ / 733 734 * we fall through on any error that prevents us from finding 735 * the account, including 'not a system disk'. 736 737 * \ / 000000AE 738 NEXTDISK LABEL try next disk 000AE BC000317 0 739 INCL R0 BOOTUNIT increment disk unit number 000AF 64040008 0 IMM 740 CPR R0 BFDUNITS maximum number of units 000B0 FE08008D 741 JLT TRYDISK jump if good 742 * \ / end of section for disk 743 000000B1 744 NEXTCHAN LABEL try next channel 000B1 BC1000E3 0 @ 745 INCL R0 @CHANPTR increment channel number 000B2 64040004 0 IMM 746 CPR R0 PPUCHANS maximum channel number 000B3 FE080038 747 JLT TRYCHAN jump if good 748 * \ / 000000B4 749 NEXTSLOT LABEL try next slot 000B4 BC1000E2 0 @ 750 INCL R0 @SLOTPTR increment slot number 000B5 64040010 0 IMM 751 CPR R0 NUMSLOTS maximum slot number 000B6 FE080031 752 JLT TRYSLOT jump if good 753 * \ / 754 755 ********************************************************************************** 756 * * 757 * Here, we failed to find a device to boot from. * 758 * * 759 * If R7 = 0, then we didn't even find a PPU. * 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 24 F 0 760 * If R7 = 1, then we found a PPU but not a device controller. * 761 * If R7 = 2, then an illegal switch setting was used for boot. * 762 * If R7 = 3, then we found at least one device controller, * 763 * but there were no disks that had both a good * 764 * boot block and an account for SYSTEM.!!! or * 765 * there were no tape drive units found that had * 766 * a decryptable tape boot block. * 767 * * 768 ********************************************************************************** 769 770 * \ / 000000B7 771 BOOTERROR LABEL 000B7 622E00BB 01 7 772 LD2 R0 HALTMSG1(R7) get first 8 chars of msg 000B8 60AE00C3 2 7 773 LD R2 HALTMSG2(R7) 000B9 DC4000EA 774 CALLNP DISPLAY put MSG into the display 000BA 003FFFFF 775 HALT NOHALTCODE halt, leave message in lights 776 * --- 777 000000BB 778 HALTMSG1 LABEL 000BC 10152020 779 VFD "NO P" AND 03F3F3F3F,"PU " AND 03F3F3F3F 000BE 0F0E1412 780 VFD "NO C" AND 03F3F3F3F,"ONTR" AND 03F3F3F3F 000C0 020F0F14 781 VFD "BAD " AND 03F3F3F3F,"BOOT" AND 03F3F3F3F 000C2 19132004 782 VFD "NO S" AND 03F3F3F3F,"YS D" AND 03F3F3F3F 783 000000C3 784 HALTMSG2 LABEL 000C3 20200010 785 VFD (" " AND 03F3F0000)+1*SSUALARM 000C4 0C120010 786 VFD ("LR " AND 03F3F0000)+1*SSUALARM 000C5 20230010 787 VFD (" # " AND 03F3F0000)+1*SSUALARM 000C6 05160010 788 VFD ("EV " AND 03F3F0000)+1*SSUALARM 789 790 ********************************************************************************** 791 * * 792 * The following is the file descriptor for DIRSRCH. The * 793 * account name must be the name of the system account, and * 794 * the file name must NOT exist in the directory. * 795 * * 796 ********************************************************************************** 797 000000C7 798 FILEDESC BSS 0 beginning of file descriptor 000C7 B674BFEF 799 PAK12 SYSTEM 000C9 E79DF200 800 PAK6 !!! 000CB 00000000 801 VFD 0,0 000CC E79EDF2D 802 PAK12 !!!!!!!!!!!! 000CE E79EDF2D 803 PAK6 !!!!!! 000D0 00000000 804 VFD 0,0 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 25 F 0 806 807 ********************************************************************************** 808 * * 809 * The bootstrap has been read in from disk. The disk * 810 * that we are pointing to contains a SYSTEM.!!! account. * 811 * If the disk unit number is not zero, then it is possible * 812 * that this disk is not really the system disk, but a backup * 813 * copy of the system disk. On a system with a single disk * 814 * controller this will only happen if the system disk is not * 815 * available on unit zero. However, in a system with more * 816 * than one disk controller it may be that the actual system * 817 * disk is on a disk controller at a higher position. * 818 * In any event, if the disk unit number is not zero, we * 819 * will STOP with the disk address displayed in the lights. * 820 * If the user really wants to boot from this disk, he can * 821 * press RUN. If not, he can make this disk not ready and * 822 * boot again (after also ensuring that the system disk is * 823 * ready). * 824 * * 825 ********************************************************************************** 826 000000D1 827 GOTBOOT LABEL 000D1 5C000317 828 CMZ BOOTUNIT is unit number zero? 000D2 FE0200E0 829 JEQ DOBOOT jump if yes 830 * \ / 000D3 620000E4 01 831 LD2 R0 FROMMSG1 message prototype 000D4 609000E2 2 @ 832 LD R2 @SLOTPTR get slot number 000D5 64840009 2 IMM 833 CPR R2 9 is it numeric? 000D6 FE0A00D8 834 JLE OKSLOT jump if yes 835 * \ / 000D7 18840027 2 IMM 836 ADD R2 (("A" XOR "0") AND 03F)-10 convert it 837 * remember the char set is 6-bit ASCII 000000D8 838 OKSLOT LABEL 000D8 F48A5460 2 1 CBM 839 XORM R2 R1/BITS 10:15 put into message 000D9 609000E3 2 @ 840 LD R2 @CHANPTR get channel number 000DA E48A6840 2 1 CBM 841 ST R2 R1/BITS 20:23 store it 000DB 60800317 2 842 LD R2 BOOTUNIT get unit number 000DC E48A7840 2 1 CBM 843 ST R2 R1/BITS 28:31 store it 000DD 608000E6 2 844 LD R2 FROMMSG2 get last part of msg 000DE DC4000EA 845 CALLNP DISPLAY put MSG into the display 000DF 00BFFFFF 846 STOP NOHALTCODE booting from non-zero unit 847 * \ / 848 849 ********************************************************************************** 850 * * 851 * Here, we have fulfilled our mission in life. We hand * 852 * the ball off to TAPEBOOT or DISKBOOT which will read in * 853 * the system. Bye, y'all! * 854 * * 855 ********************************************************************************** 856 857 * \ / 000000E0 858 DOBOOT LABEL 000E0 EC0001E9 859 STZ LOCKWORD release the other CPUs 000E1 FE0E1000 860 JMP BOOTLOC go start the bootstrap 861 * --- 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 26 F 0 862 000E2 21080316 863 SLOTPTR PTR BOOTDEVPF/PFSLOT slot number in page file 000E3 C0880316 864 CHANPTR PTR BOOTDEVPF/PPUCHAN channel number in page file 865 000E5 20303030 866 FROMMSG1 VFD "FROM" AND 03F3F3F3F," 000" AND 03F3F3F3F 000E6 203F0010 867 FROMMSG2 VFD (" ? " AND 03F3F0000)+1*SSUALARM 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 27 F 0 869 870 ********************************************************************************** 871 * * 872 * This is the path taken by all CPUs except the first. * 873 * * 874 ********************************************************************************** 875 876 000000E7 877 OTHERWAY LABEL 878 * \ / 879 000000E7 880 WAITHERE LABEL 000E7 5C0001E9 881 CMZ LOCKWORD wait until we are released 000E8 FE0C00E7 882 JNE WAITHERE 883 * \ / 000E9 FE0E1000 884 JMP BOOTLOC go to the boot that we read in 885 * --- 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 28 F 0 887 888 ********************************************************************************** 889 * * 890 * DISPLAY driver * 891 * This routine places R0, R1, and R2 into the SSU * 892 * display. * 893 * Call: * 894 * * 895 * CALLNP DISPLAY * 896 * Eats PFPTR, I/O mapping * 897 * Stack required: 1 * 898 * * 899 ********************************************************************************** 900 901 DISPLAY BLOCK 902 ENTRY DISPLAY 903 904 BEGFRAME 905 ENDFRAME 906 000EA DD5F8001 6 STAK 907 DISPLAY ENTRNP PUSH 000EB 60C40086 3 IMM 908 LD PFPTR PNCIX get page number reserved for I/O 000EC 00C00310 909 LDPF SSUPF map in the SSU 000ED E400180A 0 910 ST R0 CIX(SSUDISP03) display first 4 chars of msg 000EE E440180B 1 911 ST R1 CIX(SSUDISP47) display next 4 chars of msg 000EF E480180C 2 912 ST R2 CIX(SSUDISP89) display it 000F0 5D1F8001 6 STAK 913 LEAVE POP return to caller 914 * --- 915 +DISPLAY 000000EA F 0 902 907= +SSUPF 00000310 F 0 909 916 END DISPLAY 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 29 F 0 918 919 ********************************************************************************** 920 * * 921 * ONE-SHOT READ-ONLY DISK DRIVER * 922 * * 923 * This routine will read a page from the disk, with no * 924 * error recovery. It is intended to be as small as possible. * 925 * Call: * 926 * CIX mapped to disk controller * 927 * BOOTUNIT = unit number * 928 * BOOTSCPTRK = sectors per track * 929 * BOOTRKPCYL = tracks per cylinder * 930 * CALL DISK * 931 * PARV * 932 * PARVL * 933 * * 934 * * 935 * * 936 * Blatant assumptions: * 937 * * 938 * 1. We reside in page zero of some memory. * 939 * 2. We will read the data into page one of the * 940 * same memory and the FBI into BOOTFBIBF on * 941 * page zero. * 942 * 3. The slot number field in a PPU address is in * 943 * the same place as the slot number field in a * 944 * page file value. * 945 * * 946 * Eats R0:R3 * 947 * Stack required: 2 = 1 + max(PPUIWAIT(1)) * 948 * * 949 ********************************************************************************** 950 951 DISK BLOCK 952 ENTRY DISK 953 954 BEGFRAME 00178801 6 BASE 955 BLOCKNUM BSS 1 block number to read 00178802 6 BASE 956 FBITYPEX BSS 1 expected fbi type 957 ENDFRAME 958 000F1 DD1F8003 6 STAK 959 DISK ENTR PUSH 000F2 C1578801 6 BASE 960 STPV SP,BLOCKNUM block number 000F3 C0578802 6 BASE 961 STPVL SP,FBITYPEX expected fbi type 962 000F4 EC001801 963 STZ CIX(PPUABORT) clean up the channel 000F5 D1401803 964 STMW CIX(PPUSCSTAT) disable ints, set DMA to input 965 000F6 60040020 0 IMM 966 LD R0 BFDFNSAFE function code to clear 'not ready' latch 000F7 60400317 1 967 LD R1 BOOTUNIT pick up unit number 000F8 E4221A28 0 1 968 ST R0 CIX(BFDFUNC+BFDSELECTB+R1) select drive and make safe 969 000F9 60040011 0 IMM 970 LD R0 BFDFNCLFLT function code to reset fault (in drive) 000FA E4001A20 0 971 ST R0 CIX(BFDFUNC) clear fault 972 000FB 60040012 0 IMM 973 LD R0 BFDFNZERO function code to recalibrate drive 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 30 F 0 000FC E4001A20 0 974 ST R0 CIX(BFDFUNC) re-zero the drive 975 000FD 60400131 1 976 LD R1 STATMASK get mask of relevant status bits 000000FE 977 ZEROWAIT LABEL wait for drive to re-zero 000FE 60001A20 0 978 LD R0 CIX(BFDSS) get disk status 000FF 6C021000 01 IMM 979 MCPR R0 SEEKING 00100 FE0200FE 980 JEQ ZEROWAIT jump if still seeking 981 * \ / 982 * Calculate seek address. 00101 EC128000 2 REG 983 STZ R2 build seek address here 00102 60178801 0 6 BASE 984 LD R0 SP,BLOCKNUM get block number 00103 58C40010 IMM 985 IORPSR PSRMODIF set funky arithmetic 00104 62120000 010 REG 986 LD2 R0 R0 00105 14000318 0 987 DIV R0 BOOTSCPTRK R0 = (cyl,head), R1 = sector 00106 E44AB080 1 2 CBM 988 ST R1 R2/BFDSASEC 00107 62120000 010 REG 989 LD2 R0 R0 00108 14000319 0 990 DIV R0 BOOTRKPCYL R0 = cyl, R1 = head 00109 E44AA080 1 2 CBM 991 ST R1 R2/BFDSAHEAD 0010A E40A8100 0 2 CBM 992 ST R0 R2/BFDSACYL R2 = seek address 0010B 58840010 IMM 993 CLBPSR PSRMODIF 994 995 * Do the seek. 0010C E4801A10 2 996 ST R2 CIX(BFDSEEK) start seek 997 * \ / 0010D 60400131 1 998 LD R1 STATMASK get mask of relevant status bits 0000010E 999 SEEKWAIT LABEL 0010E 60001A20 0 1000 LD R0 CIX(BFDSS) get disk status 0010F 6C021000 01 IMM 1001 MCPR R0 SEEKING is it still seeking? 00110 FE02010E 1002 JEQ SEEKWAIT jump if yes 1003 * \ / 00111 6C021800 01 IMM 1004 MCPR R0 GOODSTAT is the status good? 00112 FE0C0130 1005 JNE RETURN jump if not 1006 * \ / 1007 * Set up the PPU for data transfer. 1008 * NOTE: DMA direction already says input. 00113 60400311 1 1009 LD R1 PHPNAV page file for some page in this memory 00114 6004031F 0 IMM 1010 LD R0 ADR BOOTFBIBF R0 -> fbi place 1011 * Note that the virtual address = physical address 00115 E40A5560 0 1 CBM 1012 ST R0 R1/PPUAMEMA combine address and slot 00116 E4401807 1 1013 ST R1 CIX(PPUADDR2) store second address into PPU 00117 6004802C 0 IMM 1014 LD R0 FBILNTH*CPW+1*PPUCLAST size of FBI and last bit 00118 E4001806 0 1015 ST R0 CIX(PPUCNT2) store second byte count into PPU 00119 60040400 0 IMM 1016 LD R0 1*FLDPAGE get physical address for disk read 0011A E40A5560 0 1 CBM 1017 ST R0 R1/PPUAMEMA R1 -> page one of this memory 0011B E4401805 1 1018 ST R1 CIX(PPUADDR1) store first address into PPU 0011C 60041000 0 IMM 1019 LD R0 CPP size of data block 0011D E4001804 0 1020 ST R0 CIX(PPUCNT1) store first byte count into PPU 1021 1022 * Do the read operation. 0011E EC001AB0 1023 STZ CIX(BFDREAD+1*BFDINTBIT) tell controller to start read 1024 0011F DC000193 1025 CALL PPUIWAIT wait for read to finish 00120 404401F4 IMM 1026 PARVL 500 max wait = 5 seconds 1027 00121 FA0C0130 0 1028 JNEZ R0 RETURN jump if bad channel status 1029 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 31 F 0 00122 60C00131 3 1030 LD R3 STATMASK get mask of relevant status bits 00123 6C821800 23 IMM 1031 MCPR R2 GOODSTAT check for expected status 00124 FE0C0130 1032 JNE RETURN jump if bad controller status 1033 1034 * See if the FBI checks. 00125 6084031F 2 IMM 1035 LD R2 ADR BOOTFBIBF R2 -> fbi 00126 6003FFC0 0 IMM 1036 LD R0 FBICSMASK get mask for words to be checked 00127 F0168800 0 2 BASE 1037 PRMUT R0 R2,0 generate the checksum 00128 FA2E0130 0 1038 JNEMW R0 RETURN jump if not good 1039 * \ / 00129 60178802 0 6 BASE 1040 LD R0 SP,FBITYPEX get expected fbi type 0012A 64088080 0 2 ZBM 1041 CPR R0 R2,FBITYPE compare to type read in 0012B FE0C0130 1042 JNE RETURN jump if not good 1043 * \ / 0012C 60178801 0 6 BASE 1044 LD R0 SP,BLOCKNUM get expected block number 0012D 64089181 0 2 ZBM 1045 CPR R0 R2,FBIDA 0012E FE0C0130 1046 JNE RETURN jump if not right 1047 * \ / 0012F 19C40001 7 IMM 1048 ADD R7 1 increment return address 00000130 1049 RETURN LABEL 00130 5D1F8003 6 STAK 1050 LEAVE POP return to caller 1051 * --- 1052 0F000000 ABS 1053 MASKA EQU 1*BFDSSRDY+1*BFDSSONCYL+1*BFDSSSKERR+1*BFDSSFAULT 00000F00 ABS 1054 MASKB EQU 1*BFDSSWCERR+1*BFDSSLOSTD+1*BFDSSIFPE+1*BFDSSRSPER 000000FF ABS 1055 MASKC EQU 7*BFDSSHDECD+1*BFDSSCEOV+0F*BFDSSERRCD 1056 00131 0F000FFF 1057 STATMASK VFD MASKA+MASKB+MASKC relevant disk status bits 1058 08000000 ABS 1059 SEEKING EQU 1*BFDSSRDY disk is still seeking status 0C000000 ABS 1060 GOODSTAT EQU 1*BFDSSRDY+1*BFDSSONCYL good disk status 1061 BLOCKNUM 00178801 F 0 955= 960s 984 1044 +BOOTFBIBF 0000031F F 0 1010a 1035a +BOOTRKPCYL 00000319 F 0 990 +BOOTSCPTRK 00000318 F 0 987 +BOOTUNIT 00000317 F 0 967 +DISK 000000F1 F 0 952 959= FBITYPEX 00178802 F 0 956= 961s 1040 GOODSTAT 0C000000 F 0 1004 1031 1060= MASKA 0F000000 F 0 1053= 1057x MASKB 00000F00 F 0 1054= 1057x MASKC 000000FF F 0 1055= 1057x +PHPNAV 00000311 F 0 1009 +PPUIWAIT UUUUUUUU F 0 1025 RETURN 00000130 F 0 1005j 1028j 1032j 1038j 1042j 1046j 1049= SEEKING 08000000 F 0 979 1001 1059= SEEKWAIT 0000010E F 0 999= 1002j STATMASK 00000131 F 0 976 998 1030 1057= ZEROWAIT 000000FE F 0 977= 980j 1062 END DISK 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 32 F 0 1064 1065 ********************************************************************************** 1066 * * 1067 * This routine will read in the boot block from the SCSI * 1068 * disk, with no error recovery. It is intended to be as small * 1069 * as possible. * 1070 * Call: * 1071 * CIX mapped to disk controller * 1072 * BOOTUNIT = unit number * 1073 * CALL SCSIDISK * 1074 * PARV * 1075 * PARVL * 1076 * JMP * 1077 * * 1078 * * 1079 * Blatant assumptions: * 1080 * * 1081 * 1. We reside in page zero of some memory. * 1082 * 2. We will read the data into page one of the * 1083 * same memory and the FBI into BOOTFBIBF on * 1084 * page zero. * 1085 * 3. The slot number field in a PPU address is in * 1086 * the same place as the slot number field in a * 1087 * page file value. * 1088 * * 1089 * Registers Used: R0:R3. * 1090 * Stack Required: 2. * 1091 * * 1092 * 1 + Max ( PPUIWAIT (1) ) * 1093 * * 1094 ********************************************************************************** 1095 1096 SCSIDISK BLOCK SCSIDISK Routine 1097 ENTRY SCSIDISK 1098 1099 BEGFRAME 00178801 6 BASE 1100 BLOCKNUM BSS 1 block number to read 00178802 6 BASE 1101 FBITYPEX BSS 1 expected fbi type 1102 ENDFRAME 1103 00132 DD1F8003 6 STAK 1104 SCSIDISK ENTR PUSH 00133 C1578801 6 BASE 1105 STPV SP,BLOCKNUM block number 00134 C0578802 6 BASE 1106 STPVL SP,FBITYPEX expected fbi type 00135 EC001801 1107 STZ CIX(PPUABORT) clean up the channel 00136 D1401803 1108 STMW CIX(PPUSCSTAT) disable ints, set DMA to input 00137 6002000E 0 IMM 1109 LD R0 SDFNSAFE clear unsafe status 00138 60400317 1 1110 LD R1 BOOTUNIT current unit number 00139 E4221A40 0 1 1111 ST R0 CIX(SDSELECT+SDSTORE+R1) issue the function 1112 * \ / 1113 * Set up the PPU for data transfer. NOTE: DMA direction already 1114 * says input. 1115 * \ / 0013A 60400311 1 1116 LD R1 PHPNAV page file for some page in this memory 0013B 60040800 0 IMM 1117 LD R0 ADR WNDO1 R0 -> temporary FBI place 1118 * Note that the virtual address = physical address 0013C E40A5560 0 1 CBM 1119 ST R0 R1/PPUAMEMA combine address and slot 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 33 F 0 0013D E4401807 1 1120 ST R1 CIX(PPUADDR2) store second address into PPU 0013E 60048200 0 IMM 1121 LD R0 BYTESPLB+1*PPUCLAST size to read and last bit 0013F E4001806 0 1122 ST R0 CIX(PPUCNT2) store second byte count into PPU 00140 60040400 0 IMM 1123 LD R0 1*FLDPAGE get physical address for disk read 00141 E40A5560 0 1 CBM 1124 ST R0 R1/PPUAMEMA R1 -> page one of this memory 00142 E4401805 1 1125 ST R1 CIX(PPUADDR1) store first address into PPU 00143 60041000 0 IMM 1126 LD R0 CPP size of data block 00144 E4001804 0 1127 ST R0 CIX(PPUCNT1) store first byte count into PPU 1128 * \ / 1129 * Set up the read command descriptor block 1130 * \ / 00145 60840164 2 IMM 1131 LD R2 ADR READCDB address command descriptor 00146 60178801 0 6 BASE 1132 LD R0 SP,BLOCKNUM get block number 00147 1C040009 0 IMM 1133 MUL R0 LBLKPERBLK convert to address on the disk 00148 E4089750 0 2 ZBM 1134 ST R0 R2,CDB6LBA set into logical block address of CDB 00149 62000164 01 1135 LD2 R0 READCDB get read CDB 0014A E4001A00 0 1136 ST R0 CIX(SDSELECT) send out first half 0014B 60800317 2 1137 LD R2 BOOTUNIT unit number 0014C E4641AD0 1 2 1138 ST R1 CIX(SDSELECT+SDINTBIT+SDSTORE+SDSENDEOR+R2) start the read 1139 * \ / 0014D DC000193 1140 CALL PPUIWAIT wait for read to finish 0014E 4044012C IMM 1141 PARVL 300 max wait = 3 seconds 1142 * \ / 1143 * R0 <= Masked PPU Status, R2 <= Controller Status 1144 * \ / 0014F FA0C0162 0 1145 JNEZ R0 RETURN jump if bad channel status 00150 F2BE0162 2 1146 JBF R2/SDSSRDY RETURN jump if device not ready 00151 78800163 2 1147 AND R2 SCSIMASK mask off irrelevant status bits 00152 FA8C0162 2 1148 JNEZ R2 RETURN jump if bad controller status 1149 * \ / 1150 * Move the FBI to its proper buffer. 1151 * \ / 00153 6084031F 2 IMM 1152 LD R2 ADR BOOTFBIBF R2 -> fbi 1153 00154 60D28000 3 2 REG 1154 LD R3 R2 copy FBI pointer for move 00155 6044002C 1 IMM 1155 LD R1 FBILNTH*CPW characters to move 00156 60040800 0 IMM 1156 LD R0 ADR WNDO1 where actual FBI was read 00157 DAC80800 3 01 1157 MOVE R3 R0 R1 1158 * \ / 1159 * See if the FBI checks out. 1160 * \ / 00158 6003FFC0 0 IMM 1161 LD R0 FBICSMASK get mask for words to be checked 00159 F0168800 0 2 BASE 1162 PRMUT R0 R2,0 generate the checksum 0015A FA2E0162 0 1163 JNEMW R0 RETURN jump if not good 1164 * \ / 0015B 60178802 0 6 BASE 1165 LD R0 SP,FBITYPEX get expected fbi type 0015C 64088080 0 2 ZBM 1166 CPR R0 R2,FBITYPE compare to type read in 0015D FE0C0162 1167 JNE RETURN jump if not good 1168 * \ / 0015E 60178801 0 6 BASE 1169 LD R0 SP,BLOCKNUM get expected block number 0015F 64089181 0 2 ZBM 1170 CPR R0 R2,FBIDA got the right one? 00160 FE0C0162 1171 JNE RETURN jump if not right 1172 * \ / 00161 19C40001 7 IMM 1173 ADD R7 1 increment return address 00000162 1174 RETURN LABEL 00162 5D1F8003 6 STAK 1175 LEAVE POP return to caller 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 34 F 0 1176 * --- 1177 0000F000 ABS 1178 SCSI1 EQU ONEBITS/SDSSZ80ERR*SDSSZ80ERR 000F0000 ABS 1179 SCSI2 EQU ONEBITS/SDSSBYTE*SDSSBYTE 00163 000FF00C 1180 SCSIMASK VFD SCSI1+SCSI2+1*SDSSNSAFE+1*SDSSBUSY 1181 00000164 1182 READCDB LABEL 00165 00000006 1183 VFDC CMDREAD,0,0,0,LBLKPERBLK,0,0,CDB6LEN read command descriptor 1184 BLOCKNUM 00178801 F 0 1100= 1105s 1132 1169 +BOOTFBIBF 0000031F F 0 1152a +BOOTUNIT 00000317 F 0 1110 1137 FBITYPEX 00178802 F 0 1101= 1106s 1165 +PHPNAV 00000311 F 0 1116 +PPUIWAIT UUUUUUUU F 0 1140 READCDB 00000164 F 0 1131a 1135 1182= RETURN 00000162 F 0 1145j 1146j 1148j 1163j 1167j 1171j 1174= SCSI1 0000F000 F 0 1178= 1180x SCSI2 000F0000 F 0 1179= 1180x +SCSIDISK 00000132 F 0 1097 1104= SCSIMASK 00000163 F 0 1147 1180= 1185 END SCSIDISK SCSIDISK Routine 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 35 F 0 1187 1188 ********************************************************************************** 1189 * * 1190 * REWIND TAPE ROUTINE * 1191 * * 1192 * This routine cleans up the channel to the tape * 1193 * controller, sets DMA to input, selects the tape unit and * 1194 * rewinds the tape to its beginning. If the tape is a CT, * 1195 * it also selects track 0. * 1196 * Call: * 1197 * CALLNP REWIND * 1198 * * 1199 * * 1200 * * 1201 * Eats R0:R2 * 1202 * Stack required: 2 = 1 + max(PPUIWAIT(1)) * 1203 * * 1204 ********************************************************************************** 1205 1206 BLOCK 1207 ENTRY REWIND 1208 1209 BEGFRAME 1210 ENDFRAME 1211 00166 DD5F8001 6 STAK 1212 REWIND ENTRNP PUSH 00167 EC001801 1213 STZ CIX(PPUABORT) clean up the PPU channel 00168 D1401803 1214 STMW CIX(PPUSCSTAT) reset the status, set DMA to input 1215 00169 60800317 2 1216 LD R2 BOOTUNIT get the current unit we are trying 0016A 60040002 0 IMM 1217 LD R0 MTFNREWIND function code for rewind 0016B E4241AB8 0 2 1218 ST R0 CIX(MTCMFUNC+MTINTREQ+MTSELECT+R2) rewind the drive 1219 0016C DC000193 1220 CALL PPUIWAIT wait for interrupt 0016D 40447530 IMM 1221 PARVL 30000 max wait is 300 sec. 0016E FA0C017C 0 1222 JNEZ R0 BADRTN jump if channel error 1223 * \ / 0016F F684017C 2 1224 JBT R2/MTSTANER BADRTN jump on controller error 1225 * \ / 1226 1227 ********************************************************************************** 1228 * * 1229 * If cartridge tape we will always be at BOT, since the * 1230 * controller doesn't interrupt us until it has finished the * 1231 * rewind. The 9-track comes back with an interrupt when it * 1232 * issues the command, so we might have to set up an interrupt * 1233 * on state change to wait for it to finish rewinding. * 1234 * It may be possible to lose the state change interrupt * 1235 * if the BOT shows up at the wrong time. The proper fix * 1236 * is probably to loop looking for load point. * 1237 * * 1238 ********************************************************************************** 1239 1240 * \ / 00170 F6B60177 2 1241 JBT R2/MTDSTBOT ALLDONE jump if at BOT already? 1242 * \ / 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 36 F 0 00171 60040009 0 IMM 1243 LD R0 MTFNDSCION code to enable state change interrupt 00172 E4001A30 0 1244 ST R0 CIX(MTCMFUNC) enable state change interrupt 1245 00173 DC000193 1246 CALL PPUIWAIT wait for 9-track rewind to complete 00174 40447530 IMM 1247 PARVL 30000 max. wait is 300 sec. 00175 FA0C017C 0 1248 JNEZ R0 BADRTN jump on channel error 1249 * \ / 00176 F684017C 2 1250 JBT R2/MTSTANER BADRTN jump on controller error 1251 * \ / 00000177 1252 ALLDONE LABEL 00177 60000318 0 1253 LD R0 BOOTDEVCB/TPCBTRACK get track indicator 00178 FA08017B 0 1254 JLTZ R0 NOSELTRK and jump out if 9 track or VT 00179 60040010 0 IMM 1255 LD R0 MTFNTRSEL+0 select track zero command 0017A E4001A30 0 1256 ST R0 CIX(MTCMFUNC) select track zero of CT 1257 0000017B 1258 NOSELTRK LABEL 0017B 19C40001 7 IMM 1259 ADD R7 1 no error, go on to read tape 0000017C 1260 BADRTN LABEL 0017C 5D1F8001 6 STAK 1261 LEAVE POP 1262 * --- 1263 ALLDONE 00000177 F 0 1241j 1252= BADRTN 0000017C F 0 1222j 1224j 1248j 1250j 1260= +BOOTDEVCB 00000316 F 0 1253 +BOOTUNIT 00000317 F 0 1216 NOSELTRK 0000017B F 0 1254j 1258= +PPUIWAIT UUUUUUUU F 0 1220 1246 +REWIND 00000166 F 0 1207 1212= 1264 END REWIND routine 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 37 F 0 1266 1267 ********************************************************************************** 1268 * * 1269 * ONE-SHOT READ-ONLY TAPE DRIVER * 1270 * * 1271 * This routine reads a page from the 9 track, cartridge * 1272 * tape, or video tape with no error recovery and is intended * 1273 * to be as short as possible. * 1274 * This routine assumes that the DMA direction is * 1275 * already set to input. * 1276 * Call: * 1277 * CALLNP TAPE * 1278 * * 1279 * * 1280 * R0 = masked PPU status * 1281 * R1 = PPU status * 1282 * R2 = masked controller status * 1283 * * 1284 * It has the same blatant assumptions as the One-Shot * 1285 * Disk Driver above. * 1286 * * 1287 * Eats R0:R2 * 1288 * Stack required: 2 = 1 + max(PPUIWAIT(1)) * 1289 * * 1290 ********************************************************************************** 1291 1292 BLOCK 1293 ENTRY TAPE 1294 1295 BEGFRAME 1296 ENDFRAME 1297 0017D DD5F8001 6 STAK 1298 TAPE ENTRNP PUSH 1299 1300 * Set up the PPU for data transfer. 1301 * NOTE: DMA direction already says input. 0017E 60400311 1 1302 LD R1 PHPNAV page file for some page in this memory 0017F 60040400 0 IMM 1303 LD R0 1*FLDPAGE get physical address for tape read 1304 * Note that we unconditionally read into physical 1305 * page one. It may, however, be mapped into a 1306 * different virtual page. See the memory map 1307 * at the beginning of this listing. 00180 E40A5560 0 1 CBM 1308 ST R0 R1/PPUAMEMA R1 -> page one of this memory 00181 E4401807 1 1309 ST R1 CIX(PPUADDR2) store second address into PPU 00182 60049000 0 IMM 1310 LD R0 CPP+1*PPUCLAST 00183 E4001806 0 1311 ST R0 CIX(PPUCNT2) store second byte count into PPU 1312 00184 6004031F 0 IMM 1313 LD R0 ADR HDRBUF R0 -> header place 00185 E40A5560 0 1 CBM 1314 ST R0 R1/PPUAMEMA combine address and slot 00186 E4401805 1 1315 ST R1 CIX(PPUADDR1) store first address into PPU 00187 6004002C 0 IMM 1316 LD R0 TPHDRLNTH*CPW length of TAPEBOOT header 00188 E4001804 0 1317 ST R0 CIX(PPUCNT1) store first byte count into PPU 1318 00189 60000317 0 1319 LD R0 BOOTUNIT get the boot unit number 0018A EC201AC8 0 1320 STZ CIX(MTCMREAD + MTINTREQ + MTSELECT + R0) start the read 1321 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 38 F 0 0018B DC000193 1322 CALL PPUIWAIT wait for end of read interrupt 0018C 40440FA0 IMM 1323 PARVL 4000 max time = 40 seconds 1324 0018D FA0C0191 0 1325 JNEZ R0 ERRORETURN return if abnormal PPU status 1326 * \ / 0018E 78800192 2 1327 AND R2 ERRMASK isolate error code bits 0018F FA8C0191 2 1328 JNEZ R2 ERRORETURN jump on error 1329 * \ / 00190 19C40001 7 IMM 1330 ADD R7 1 00000191 1331 ERRORETURN LABEL 00191 5D1F8001 6 STAK 1332 LEAVE POP return to calling routine 1333 * --- 1334 00192 20800040 1335 ERRMASK VFD 1*MTSTANER+1*MTSTEOF+1*MTDSTEOT mask for controller errors 1336 +BOOTUNIT 00000317 F 0 1319 ERRMASK 00000192 F 0 1327 1335= ERRORETURN 00000191 F 0 1325j 1328j 1331= +HDRBUF 0000031F F 0 1313a +PHPNAV 00000311 F 0 1302 +PPUIWAIT UUUUUUUU F 0 1322 +TAPE 0000017D F 0 1293 1298= +TPHDRLNTH 0000000B F 0 1316 1337 END TAPE routine 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 39 F 0 1339 1340 ********************************************************************************** 1341 * * 1342 * WAIT FOR PPU INTERRUPT * 1343 * * 1344 * This routine waits for an interrupt from the PPU to * 1345 * indicate an I/O operation has been completed. This is done * 1346 * by waiting for the 'controller requests interrupt' bit to * 1347 * become true in the PPU status. This implies that the * 1348 * controller was told to interrupt on completion when the * 1349 * operation was started. This routine leaves the PPU status * 1350 * in R1, the error bits from the PPU status in R0, and the * 1351 * controller status in R2. * 1352 * Call: * 1353 * CALL PPUIWAIT * 1354 * PARVL * 1355 * * 1356 * R0 = masked PPU status * 1357 * R1 = PPU status * 1358 * R2 = controller status * 1359 * Sets R0:R2. * 1360 * Stack required: 1 * 1361 * * 1362 ********************************************************************************** 1363 1364 BLOCK 1365 ENTRY PPUIWAIT 1366 1367 BEGFRAME 1368 ENDFRAME 1369 00006540 ABS 1370 PPUMASK EQU 1*PPUIXTRA+1*PPUIDPPE+1*PPUICONF+1*PPUIMPE+1*PPUIBCNR 1371 00193 DD1F8001 6 STAK 1372 PPUIWAIT ENTR PUSH 00194 C0520000 0 REG 1373 STPVL R0 save max wait time (1 = 10 millisecs) 00000195 1374 INTWAIT LABEL 00195 004403E8 IMM 1375 WAIT 1000 wait here for 10 milliseconds 1376 * \ / to avoid saturating the PPU 00196 60401801 1 1377 LD R1 CIX(PPUINTSTAT) get PPU status 00197 F678019A 1 1378 JBT R1/PPUIINTC ENDWAIT if completed, jump out of loop 00198 FA260195 0 1379 JDR R0 INTWAIT continue if max time not exceeded 1380 * \ / 1381 * If we time out we will return with all error bits set in R1. 00199 D1524000 1 REG 1382 STMW R1 say we timed out 0000019A 1383 ENDWAIT LABEL 0019A 60124000 0 1 REG 1384 LD R0 R1 copy status 0019B 78046540 0 IMM 1385 AND R0 PPUMASK mask off the bad bits 0019C 60801802 2 1386 LD R2 CIX(PPUCHANS1) get controller status at interrupt time 0019D FA02019F 0 1387 JEQZ R0 NOPPUERR jump if PPU happy 0019E EC001801 1388 STZ CIX(PPUABORT) clean up channel 0000019F 1389 NOPPUERR LABEL 0019F 5D1F8001 6 STAK 1390 LEAVE POP 1391 * --- 1392 ENDWAIT 0000019A F 0 1378j 1383= INTWAIT 00000195 F 0 1374= 1379j 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 40 F 0 NOPPUERR 0000019F F 0 1387j 1389= +PPUIWAIT 00000193 F 0 1365 1372= PPUMASK 00006540 F 0 1370= 1385 1393 END PPUIWAIT routine 1394 INPUT PROMBOOT.OPSYS:PBDECRYPT get in the decryptor 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 41 (PBDECRYPT) F 14 PROMBOOT decrypt routines 3 4 PBDECRYPT BLOCK decryptor for PROMBOOT 5 6 ENTRY PBDINIT decryptor initializer 7 ENTRY PBDECRYPT for decrypt (used in PROMBOOT) 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 42 (PBDECRYPT) F 14 PROMBOOT decrypt routines 9 10 ********************************************************************************** 11 * * 12 * This is the decryptor initialization routine. It * 13 * takes the decryption indicator and backup date from a block * 14 * header as passed in calling parameters, adds in the backup * 15 * key from the NVM, and builds its decryption tables for use * 16 * in decrypting a block of backup data. * 17 * Call: * 18 * CALL PBDINIT * 19 * PARV * 20 * PARV2 * 21 * PARVL
* 22 * Eats R0:R3. * 23 * stack required = 1 * 24 * * 25 ********************************************************************************** 26 27 PBDINIT BLOCK 28 29 ENTRY PBDINIT decryptor initializer 30 31 BEGFRAME 32 ENDFRAME 33 001A0 DD1F8001 6 STAK 34 PBDINIT ENTR PUSH 001A1 C140032A 35 STPV KEYINDIC save the indicator 001A2 C340032B 36 STPV2 KEYPWDDAT and the tape date 001A3 C0524000 1 REG 37 STPVL R1 get address of data to decrypt 001A4 38084080 0 1 ZBM 38 LEA R0 R1,0/CH0 make a character pointer 001A5 E400032D 0 39 ST R0 APROGBC and save for decryptor use 001A6 38084050 0 1 ZBM 40 LEA R0 R1,0/BITS 0:4 and make a 5-bit pointer 001A7 E400032E 0 41 ST R0 APROGB5S save that too 42 001A8 60000310 0 43 LD R0 SSUPF get PMV for SSU commands 44 * modify to point to NVM 001A9 18040001 0 IMM 45 ADD R0 SSUNVM/FLDABSPG-SSUCOFFSET/FLDABSPG 001AA 60C40086 3 IMM 46 LD PFPTR PNCIX indicate CIX 001AB 80928000 2 REG 47 PFRD R2 pick up old contents 48 001AC 00D20000 0 REG 49 LDPF R0 make PF point to NVM 001AD 60440007 1 IMM 50 LD R1 2*CPW-1 load count for double word 000001AE 51 ANOTHBYTE LABEL 001AE 60221822 0 1 52 LD R0 CIX(NVMTAPEPW)(R1) get next byte from NVM 001AF F43201B3 0 1 @ 53 XORM R0 @AKEYPWDATE(R1) combine with pre-existing 001B0 FA6601AE 1 54 JDR R1 ANOTHBYTE recycle through all bytes 55 * \ / 001B1 00D28000 2 REG 56 LDPF R2 restore page file value 001B2 5D1F8001 6 STAK 57 LEAVE POP then return to caller 58 * --- 59 001B3 020C032B 60 AKEYPWDATE PTR KEYPWDDAT/CH0 character pointer for key 61 AKEYPWDATE 000001B3 F 14 53s 60= ANOTHBYTE 000001AE F 14 51= 54j +APROGB5S 0000032E F 14 41s 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 43 (PBDECRYPT) F 14 PROMBOOT decrypt routines +APROGBC 0000032D F 14 39s +KEYINDIC 0000032A F 14 35s +KEYPWDDAT 0000032B F 14 36s 60a +PBDINIT 000001A0 F 14 29 34= +SSUPF 00000310 F 14 43 62 END PBDINIT end of encrypt initialization 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 44 (PBDECRYPT) F 14 PROMBOOT decrypt routines 64 65 ********************************************************************************** 66 * * 67 * These routines implement the PROMBOOT decryption * 68 * algorithms. * 69 * Call: * 70 * setup done by PBDINIT * 71 * CALLNP PBDECRYPT * 72 * Eats R0:R2 * 73 * stack required = 4 * 74 * 1 + max (RANDINIT(2), TRANSPOSE(3), SUBS5(1)) * 75 * * 76 ********************************************************************************** 77 78 PBDECRYPT BLOCK 79 80 ENTRY PBDECRYPT PromBoot decryptor 81 82 BEGFRAME 83 ENDFRAME 84 001B4 DD5F8001 6 STAK 85 PBDECRYPT ENTRNP PUSH 001B5 DC4001DA 86 CALLNP RANDINIT start up the random number generator 001B6 DC4001CD 87 CALLNP TRANSPOSE 001B7 DC4001BD 88 CALLNP SUBS5 001B8 DC4001CD 89 CALLNP TRANSPOSE 001B9 DC4001BD 90 CALLNP SUBS5 001BA DC4001CD 91 CALLNP TRANSPOSE 001BB DC4001BD 92 CALLNP SUBS5 001BC 5D1F8001 6 STAK 93 LEAVE POP return 94 * --- 95 +PBDECRYPT 000001B4 F 14 80 85= +RANDINIT UUUUUUUU F 14 86 +SUBS5 UUUUUUUU F 14 88 90 92 +TRANSPOSE UUUUUUUU F 14 87 89 91 96 END PBDECRYPT end of decryptor 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 45 (PBDECRYPT) F 14 PROMBOOT decrypt routines 98 99 ********************************************************************************** 100 * * 101 * Substitution routine for PROMBOOT * 102 * This routine treats the message block (MB) as a * 103 * string of five bit fields and substitutes each field * 104 * with corresponding value from the lookup table. * 105 * Eats R0:R1 * 106 * stack required = 1 * 107 * * 108 ********************************************************************************** 109 110 111 SUBS5 BLOCK start of SUBS5 112 113 ENTRY SUBS5 do substitute 114 115 BEGFRAME 116 ENDFRAME 117 001BD DD5F8001 6 STAK 118 SUBS5 ENTRNP PUSH 001BE 60441998 1 IMM 119 LD R1 ((L*8)/5)-1 get number of 5 bit blocks in MB 000001BF 120 SUBSLOOP LABEL 001BF 6032032E 0 1 @ 121 LD R0 @APROGB5S(R1) pick up a field 001C0 603001CC 0 0 @ 122 LD R0 @ASUBTAB(R0) do the substitution 001C1 E432032E 0 1 @ 123 ST R0 @APROGB5S(R1) and plop back into MB 001C2 FA6601BF 1 124 JDR R1 SUBSLOOP back if not done 125 * \ / 001C3 5D1F8001 6 STAK 126 LEAVE POP return 127 * --- 128 020001C4 129 SUBTABLE BSSC 0 table label 001C5 00000004 130 VFDC 01B,01F,015,008,00A,01C,012,004 001C7 00000016 131 VFDC 007,003,00C,00E,011,018,001,016 001C9 00000009 132 VFDC 019,014,00F,01D,01E,00D,010,009 001CB 00000013 133 VFDC 000,01A,017,006,002,005,00B,013 001CC 020C01C4 134 ASUBTAB PTR SUBTABLE 135 +APROGB5S 0000032E F 14 121 123s ASUBTAB 000001CC F 14 122 134= +L 00001000 F 14 119 +SUBS5 000001BD F 14 113 118= SUBSLOOP 000001BF F 14 120= 124j SUBTABLE 020001C4 F 14 129= 134a 136 END SUBS5 of SUBS5 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 46 (PBDECRYPT) F 14 PROMBOOT decrypt routines 138 139 ********************************************************************************** 140 * * 141 * Transposition routine for PROMBOOT * 142 * The TRANSPOSE routine scans the message block from * 143 * left to right. For each field, it exchanges that field * 144 * with another field determined by the next pseudo-random * 145 * number. * 146 * Function TRANSPOSE * 147 * For each field N of the message block, * 148 * where N = 0 to L-1 do: * 149 * J := RANDOM MOD L * 150 * BTEMP := MB(FIELD N) * 151 * MB(FIELD N) := MB(FIELD J) * 152 * MB(FIELD J) := BTEMP * 153 * end of loop * 154 * end of function * 155 * * 156 * Notes: * 157 * 1). The variable J is actually served by R1 and N by R4. * 158 * 2). The field exchange is done with R0 and R1 holding the * 159 * intermediate fields. * 160 * Eats R0:R2 * 161 * stack required = 3 * 162 * 2 + RANDOM(1) * 163 * * 164 ********************************************************************************** 165 166 TRANSPOSE BLOCK start of TRANSPOSE 167 168 ENTRY TRANSPOSE transpose routine 169 170 BEGFRAME 00178801 6 BASE 171 SAVER4 BSS 1 location to save R4 172 ENDFRAME 173 001CD DD5F8002 6 STAK 174 TRANSPOSE ENTRNP PUSH 001CE E5178801 4 6 BASE 175 ST R4 SP,SAVER4 save R4 176 001CF 61040000 4 IMM 177 LD R4 0 initial field location 000001D0 178 TRANLOOP LABEL 001D0 DC4001E1 179 CALLNP RANDOM get the next random number 001D1 604A82C0 1 2 CBM 180 LD R1 R2/BITS 1:SIZELOG2 get something in our size 001D2 6038032D 0 4 @ 181 LD R0 @APROGBC(R4) get field N of program buffer 001D3 E032032D 0 1 @ 182 EXCH R0 @APROGBC(R1) exchange for field J of program buffer 001D4 E438032D 0 4 @ 183 ST R0 @APROGBC(R4) and put J into Ns place 184 001D5 19040001 4 IMM 185 ADD R4 1 advance the field counter 001D6 65041000 4 IMM 186 CPR R4 L are we done with this pass? 001D7 FE0801D0 187 JLT TRANLOOP jump back for next field if not 188 * \ / 001D8 61178801 4 6 BASE 189 LD R4 SP,SAVER4 restore R4 001D9 5D1F8002 6 STAK 190 LEAVE POP return 191 * --- 192 +APROGBC 0000032D F 14 181 182s 183s 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 47 (PBDECRYPT) F 14 PROMBOOT decrypt routines +L 00001000 F 14 186 +RANDOM UUUUUUUU F 14 179 SAVER4 00178801 F 14 171= 175s 189 +SIZELOG2 0000000C F 14 180 TRANLOOP 000001D0 F 14 178= 187j +TRANSPOSE 000001CD F 14 168 174= 193 END TRANSPOSE of Transpose 194 195 INPUT PROMBOOT.OPSYS:PBENCRANDOM get the random number generator 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 48 (PBENCRANDOM) F 15 Random Number Code for Promboot Decryptor 3 4 PBENCRANDM BLOCK start of common random number routines 5 6 ENTRY RANDINIT to initialize the random number generator 7 ENTRY RANDOM random number generator 8 9 ********************************************************************************** 10 * * 11 * This is the routine that intializes the pseudo-random * 12 * number generator. The PRN accumulator is initialized as a * 13 * combination of the Password, Backup date, and Indicator. * 14 * Call: * 15 * CALLNP RANDINIT * 16 * * 17 * Eats R1:R2, (sets R2 = initial value) * 18 * stack required = 2 * 19 * 1 + RANDOM(1) * 20 * * 21 ********************************************************************************** 22 23 RANDINIT BLOCK 24 25 ENTRY RANDINIT random number initializer 26 27 BEGFRAME 28 ENDFRAME 29 001DA DD5F8001 6 STAK 30 RANDINIT ENTRNP PUSH 001DB 6240032B 12 31 LD2 R1 KEYPWDDAT get password/date info 001DC 74924000 2 1 REG 32 XOR R2 R1 fold the halves together 001DD 7480032A 2 33 XOR R2 KEYINDIC throw in the indicator 001DE DC4001E1 34 CALLNP RANDOM warm it up a little 001DF DC4001E1 35 CALLNP RANDOM just for drill 001E0 5D1F8001 6 STAK 36 LEAVE POP return, RANDOM is initialized 37 * --- 38 +KEYINDIC 0000032A F 15 33 +KEYPWDDAT 0000032B F 15 31 +RANDINIT 000001DA F 15 25 30= +RANDOM UUUUUUUU F 15 34 35 39 END RANDINIT 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 49 (PBENCRANDOM) F 15 Random Number Code for Promboot Decryptor 41 42 ********************************************************************************** 43 * * 44 * RANDOM. This routine is called to generate the next * 45 * number in the pseudo-random sequence by using a standard * 46 * linear congruential PRN generator. The generator is * 47 * 32-bits wide so it has a very long period. (a) and (c) have * 48 * been carefully chosen to pass all of the standard tests for * 49 * good PRN's. (We are using a = 1664525 and c = 713737) * 50 * * 51 * When using a pseudo-random number, the upper part of * 52 * the seed value should be used to produce the necessary * 53 * number of bits of the random number, as the lower several * 54 * bits of the seed are extremely non-random. * 55 * * 56 * Note that the value of (c) is actually (c-1) because * 57 * the carry bit, which is on and will affect modified * 58 * arithmetic, provides the extra 1. * 59 * * 60 * Method: X(i) = a * X(i-1) + c (mod 2**32) * 61 * * 62 * R2 = old PRN seed * 63 * CALLNP RANDOM * 64 * R2 = new PRN seed * 65 * Eats R1:R2 * 66 * stack required = 1 * 67 * * 68 ********************************************************************************** 69 70 RANDOM BLOCK 71 72 ENTRY RANDOM random number generator 73 74 BEGFRAME 75 ENDFRAME 76 001E1 DD5F8001 6 STAK 77 RANDOM ENTRNP PUSH 001E2 60528000 1 2 REG 78 LD R1 R2 get old seed value 001E3 58C40014 IMM 79 IORPSR PSRMODIF+PSRCARRY turn on magic, ensure carry state known 001E4 1C4001E7 1 80 MUL R1 A temp = X * a 001E5 188001E8 2 81 ADD R2 CMINUS1 X = temp + c 001E6 5D1F8001 6 STAK 82 LEAVE POP 83 * --- 84 001E7 0019660D 85 A VFD 1664525 a 001E8 000AE408 86 CMINUS1 VFD 713737-1 c - 1 87 A 000001E7 F 15 80 85= CMINUS1 000001E8 F 15 81 86= +RANDOM 000001E1 F 15 72 77= 88 END RANDOM end of random number generator 89 +KEYINDIC 0000032A F 15 33 +KEYPWDDAT 0000032B F 15 31 +RANDINIT 000001DA F 15 6 23= 25 30= +RANDOM 000001E1 F 15 7 34 35 70= 72 77= 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 50 (PBENCRANDOM) F 15 Random Number Code for Promboot Decryptor 90 END PBENCRANDM of random number routines 196 +APROGB5S 0000032E F 14 41s 121 123s +APROGBC 0000032D F 14 39s 181 182s 183s +KEYINDIC 0000032A F 14 35s F 15 33 +KEYPWDDAT 0000032B F 14 36s 60a F 15 31 +L 00001000 F 14 119 186 +PBDECRYPT 000001B4 F 14 7 78= 80 85= +PBDINIT 000001A0 F 14 6 27= 29 34= PBENCRANDM F 15 4= 90 RANDINIT 000001DA F 14 86 F 15 6 23= 25 30= RANDOM 000001E1 F 14 179 F 15 7 34 35 70= 72 77= +SIZELOG2 0000000C F 14 180 +SSUPF 00000310 F 14 43 SUBS5 000001BD F 14 88 90 92 111= 113 118= 136 TRANSPOSE 000001CD F 14 87 89 91 166= 168 174= 193 197 END PBDECRYPT of decryptor for PROMBOOT 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 51 F 0 1396 1397 ********************************************************************************** 1398 * * 1399 * Pre-initialized variables for multiple CPU interlock * 1400 * * 1401 ********************************************************************************** 1402 001E9 00000000 1403 LOCKWORD VFD STORE lock word for first critical region 1404 1405 ********************************************************************************** 1406 * * 1407 * PROMBOOT CheckSum. The last byte of the bootstrap prom * 1408 * is a checksum byte. The prom MUST sum using one's * 1409 * complement addition of all bytes to hex 55. * 1410 * * 1411 * This checksum is actually calculated using program * 1412 * "Boot.Opsys:BootCkSum". * 1413 * * 1414 ********************************************************************************** 1415 1416 ORG MA (WPP/2-1) 1417 BSSC CPW-1 C20001FF 1418 CHKSUMLOC BSSC 1 the checksum goes here 1419 +APROGB5S 0000032E F 14 41s 121 123s +APROGBC 0000032D F 14 39s 181 182s 183s BCLPFLP 00000005 F 0 263= 269j BCPFME 00000008 F 0 265j 268= BIAS 00000002 F 0 442 602= 604x 605x 606x 607x 608x 609x 610x 611x 612x 613x 614x 615x 616x 617x 618x 619x BLANKS 00000083 F 0 483 484 572= BLOCKIN 0000009E F 0 665j 682= BOOT 00000000 F 0 240= 370s BOOTABLE 00800087 F 0 587= 591a +BOOTCLOC 00000331 F 0 443s 475 662 +BOOTDEVCB 00000316 F 0 476s 722a 1253 +BOOTDEVPF 00000316 F 0 422s 438 502 660 863a 864a BOOTERROR 000000B7 F 0 402j 771= +BOOTFBIBF 0000031F F 0 1010a 1035a 1152a +BOOTRKPCYL 00000319 F 0 670s 679s 990 +BOOTSCPTRK 00000318 F 0 669s 677s 987 +BOOTUNIT 00000317 F 0 464s 563s 739s 828 842 967 1110 1137 1216 1319 +BOOTYPE 00000330 F 0 404s 445 BTYPEDISK 00000001 F 0 465 584= 587x 587x 587x 587x 588x 588x 588x 588x 590x 631x 642x BTYPEILL 00000000 F 0 583= 590x 590x 590x 630x 632x 633x 634x 635x 636x 637x 638x 643x 644x 645x BTYPETAPE 00000002 F 0 585= 589x 589x 589x 589x 639x 640x 641x BUSLOOP 0000001D F 0 348= 352j CHANPTR 000000E3 F 0 433s 455 745s 840 864= CHKSUMLOC C20001FF F 0 1418= CONTSTOP2 0000004C F 0 452 461= DISK 000000F1 F 0 671 681 951= 952 959= 1062 DISPLAY 000000EA F 0 481 485 774 845 901= 902 907= 916 DOBOOT 000000E0 F 0 560j 829j 858= 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 52 F 0 +EVARCLEAR 00000360 F 0 326 +EWRUINFO 00000300 F 0 325a 326 FILEDESC 000000C7 F 0 728a 798= FOUNDEOF 00000065 F 0 526j 531= +FPSWITCHX 00000313 F 0 388s FROMMSG1 000000E4 F 0 831 866= FROMMSG2 000000E6 F 0 844 867= GOODCHAN 0000004D F 0 450j 463= GOTBOOT 000000D1 F 0 731j 827= HALTMSG1 000000BB F 0 772 778= HALTMSG2 000000C3 F 0 773 784= +HDRBUF 0000031F F 0 536 539 544 545 559 1313a +IBLOCK 00000200 F 0 349 +IBSLOTS 00000370 F 0 350s 427 +IBSTACK 00000360 F 0 287a +KEYINDIC 0000032A F 14 35s F 15 33 +KEYPWDDAT 0000032B F 14 36s 60a F 15 31 +L 00001000 F 0 549 F 14 119 186 LOCKWORD 000001E9 F 0 313s 859s 881 1403= NEXTCHAN 000000B1 F 0 446j 458j 567j 744= NEXTDISK 000000AE F 0 674j 685j 724j 738= NEXTSLOT 000000B4 F 0 430j 749= NEXTUNIT 0000007C F 0 506j 528j 533j 537j 541j 562= NOSTOP 0000005B F 0 478j 486= OKSLOT 000000D8 F 0 834j 838= OTHERWAY 000000E7 F 0 314j 877= OVERVERSN 00000004 F 0 241j 261= PBDECRYPT 000001B4 F 0 547 F 14 4= 7 78= 80 85= 197 PBDINIT 000001A0 F 0 543 F 14 6 27= 29 34= PBOOTABLE 00000088 F 0 401 591= PBPAGE 00000000 F 0 227= 228e +PHPNAV 00000311 F 0 330s 1009 1116 1302 PNPBPAGE 00000080 F 0 228= 264 290 PPUIWAIT 00000193 F 0 1025 1140 1220 1246 1322 1365 1372= PTABLE1 0000008A F 0 441 620= PTABLE2 0000008C F 0 444 646= READBFD 00000093 F 0 663j 668= REWIND 00000166 F 0 505 1207 1212= SCSIDISK 00000132 F 0 664 1096= 1097 1104= 1185 +SIZELOG2 0000000C F 14 180 SLOTPTR 000000E2 F 0 426 453 750s 832 863= +SSUPF 00000310 F 0 384s 909 F 14 43 TABLE1 00800089 F 0 604= 620a TABLE2 0080008B F 0 630= 646a TAPE 0000017D F 0 524 532 1293 1298= TAPELABEL 00000085 F 0 540 574= TPCKSLOOP 00000076 F 0 553= 555j +TPHDRDATE 00000003 F 0 545 +TPHDRDCKS 00000009 F 0 559 +TPHDRIND 00000002 F 0 544 +TPHDRLNTH 0000000B F 0 1316 +TPHDRTAG 00000000 F 0 539 TRYCHAN 00000038 F 0 436= 747j TRYDISK 0000008D F 0 466j 655= 741j TRYNXTREC 00000060 F 0 523= 527j TRYSLOT 00000031 F 0 425= 752j 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 53 F 0 TRYTAPE 0000005B F 0 500= 565j VERSION 00000001 F 0 244= VTMSG1 00000080 F 0 479 570= VTMSG2 00000082 F 0 480 571= WAITHERE 000000E7 F 0 880= 882j +WRUIMAX 00000010 F 0 351 ZEROHALT 00000003 F 0 247= 369 1421 END PROMBOOT routine APROGB5S 0000032E F 12 226= F 14 41s 121 123s APROGBC 0000032D F 12 225= F 14 39s 181 182s 183s BOOTCLOC 00000331 F 0 443s 475 662 F 12 240= BOOTDEVCB 00000316 F 0 476s 722a 1253 F 12 151= BOOTDEVPF 00000316 F 0 422s 438 502 660 863a 864a F 12 152= BOOTFBIBF 0000031F F 0 1010a 1035a 1152a F 12 172= 193e BOOTRKPCYL 00000319 F 0 670s 679s 990 F 12 156= BOOTSCPTRK 00000318 F 0 669s 677s 987 F 12 155= BOOTUNIT 00000317 F 0 464s 563s 739s 828 842 967 1110 1137 1216 1319 F 12 153= BOOTYPE 00000330 F 0 404s 445 F 12 239= CALLNAME 00000314 F 12 137= CPUPT 00000360 F 12 289= EVARCLEAR 00000360 F 0 326 F 12 271= EWRUINFO 00000300 F 0 325a 326 F 12 64= FPSWITCHX 00000313 F 0 388s F 12 130= HDRBUF 0000031F F 0 536 539 544 545 559 1313a F 13 14= HEADPMV 00000387 F 12 312= IBLKPATCH 00000332 F 12 242= IBLOCK 00000200 F 0 349 F 12 41= IBSLOTS 00000370 F 0 350s 427 F 12 298= IBSTACK 00000360 F 0 287a F 12 260= INTDEVICES 00000312 F 12 118= IZONEWORD 0000032F F 12 238= KEYH 0400032A F 12 222= F 13 16e KEYHALF 0400032A F 13 16= KEYIND 0000032A F 12 223= F 13 17e KEYINDIC 0000032A F 13 17= F 14 35s F 15 33 KEYPWDATE 0000032B F 12 224= F 13 18e KEYPWDDAT 0000032B F 13 18= F 14 36s 60a F 15 31 L 00001000 F 0 549 F 12 204= F 14 119 186 PFMAP 00000380 F 12 311= 312e PHPNAV 00000311 F 0 330s 1009 1116 1302 F 12 108= RELESEFLAG 0000031E F 12 165= ROUNDS 00000003 F 12 205= SIZELOG2 0000000C F 12 203= 204e F 14 180 SSUPF 00000310 F 0 384s 909 F 12 107= F 14 43 TPHDR 0000032A F 12 194= 202a TPHDRBF 0000031F F 12 193= F 13 14e TPHDRDATE 00000003 F 0 545 F 12 197= TPHDRDCKS 00000009 F 0 559 F 12 199= TPHDRHCKS 0000000A F 12 200= TPHDRIND 00000002 F 0 544 F 12 196= TPHDRLNTH 0000000B F 0 1316 F 12 192= TPHDRTAG 00000000 F 0 539 F 12 195= VARAREA 0000032A F 12 216= WRU0 00000000 F 12 43= WRU1 00000001 F 12 44= 1 Assembler C9101 PROM resident bootstrap 31-Mar-92 15:02 PAGE 54 F 0 WRU10 0000000A F 12 53= WRU11 0000000B F 12 54= WRU12 0000000C F 12 55= WRU13 0000000D F 12 56= WRU14 0000000E F 12 57= WRU15 0000000F F 12 58= WRU2 00000002 F 12 45= WRU3 00000003 F 12 46= WRU4 00000004 F 12 47= WRU5 00000005 F 12 48= WRU6 00000006 F 12 49= WRU7 00000007 F 12 50= WRU8 00000008 F 12 51= WRU9 00000009 F 12 52= WRUIMAX 00000010 F 0 351 F 12 60= 63 WRUINFO 00000200 F 12 63= WRUIPROTO 00000200 F 12 42= 60e 61a 1422 END Global Block