1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 1 (PROP) F 2 3 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, 1992 BTI Computer Systems ****** 30 * 31 * This document and the program it describes are the exclusive property 32 * of and proprietary to BTI Computer Systems. No use, reproduction or 33 * disclosure of this document or its contents, either in full or in part, 34 * by any means whatsoever regardless of purpose may be made without the 35 * prior written consent of BTI Computer Systems. 36 * 37 * BTI Computer Systems 38 * Sunnyvale, California 94086 4 5 6 7 * TTTTT AAA PPPP EEEEE BBBB OOO OOO TTTTT 8 * T A A P P E B B O O O O T 9 * T A A P P E B B O O O O T 10 * T AAAAA PPPP EEEE BBBB O O O O T 11 * T A A P E B B O O O O T 12 * T A A P E B B O O O O T 13 * T A A P EEEEE BBBB OOO OOO T 14 15 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 2 F 0 17 18 ********************************************************************************** 19 * * 20 * Revisions Date * 21 * --------- ---- * 22 * 2.1 8306 27 June 83 * 23 * Minor cleanups. * 24 * 2.2 8412 19 Dec 84 * 25 * Zero out time zone word in IBLOCK. * 26 * 2.3 8501 31 Jan 85 * 27 * Remove TAPELOAD from TALON. * 28 * 2.4 8502 22 Feb 85 * 29 * Changes to one buffer read routine to allow * 30 * reads into non-page aligned buffers. * 31 * 2.5 8503 20 Mar 85 * 32 * Bug fix in TALON. * 33 * 2.6 8608 11 Aug 86 * 34 * Major changes and bug fixes in TALON. * 35 * CHECKHDR and CHECKDATA moved into TAPELOAD file. * 36 * Tape write code moved to TALON (previously in * 37 * DiskToTape) and code cleaned up. Tape error log * 38 * added. Multiple CPU code added to main control. * 39 * Bug fix in error message display code. * 40 * 2.7 8612 22 Dec 86 * 41 * Front Panel Display fixed to not alarm. After * 42 * rewind of tape now reads individual records * 43 * looking for a file mark. RC * 44 * A8703 31 Mar 87 * 45 * Bug fix in TALON. RC * 46 * A8901 31 Jan 89 * 47 * Reassembled to get new TALON with changes for * 48 * Video Tape (Exabyte). RC * 49 * A8903 02 Mar 89 * 50 * Added TapeNRLoad entry to TapeLoad so that * 51 * the rewind during boot can be avoided. RC * 52 * A8907 20 Jul 89 * 53 * Reassembled to get new TALON. RC * 54 * A8907a 23 Jul 89 * 55 * Reassembled to get new TALON. RC * 56 * * 57 ********************************************************************************** 58 59 BLOCK global block 60 61 NOLIST CREF 62 INPUT .SYS:MACROS 1 * Including MACROS.ASSEM Version A8607. 63 INPUT SOURCE.OPSYS:MACHDEFS 64 INPUT SOURCE.OPSYS:IODEFS 65 INPUT SOURCE.OPSYS:DISKDEFS 66 INPUT SOURCE.OPSYS:HALTDEFS 67 INPUT SOURCE.OPSYS:PAGEDEFS 68 INPUT SOURCE.OPSYS:IBLOCK 69 INPUT BOOT.OPSYS:ERRLOGBLK 70 INPUT BOOT.OPSYS:DISKCB 71 INPUT BOOT.OPSYS:TAPECB 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 3 (OPLVECTORS.ASSEM) F 13 72 INPUT BOOT.OPSYS:OPLVECTORS.ASSEM 73 LIST CREF 74 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 4 F 0 77 78 ********************************************************************************** 79 * * 80 * BOOTSTRAP ROUTINE * 81 * * 82 * This program resides on the first record after the * 83 * first file mark on all system volumes that are backed up by * 84 * +BACKUP or DiskToTape. The PROMBOOT routine starts all CPUs * 85 * at BOOTLOC in this code. We, in turn, find and load TOPL. * 86 * * 87 ********************************************************************************** 88 89 ********************************************************************************** 90 * * 91 * This map describes the contents of the page file for * 92 * each CPU as it is set up by the PROMBOOT program. The * 93 * first CPU through the lock runs the code that loads TOPL * 94 * from the tape. * 95 * * 96 * VPN MA VIRTUAL PAGE PHYSICAL LOCATION * 97 * --- -- ------- ---- -------- -------- * 98 * 0 00000 PROM BOOT PAGE 0 * 99 * 4 01000 BOOTSTRAP PAGE 1 * 100 * 2 00800 WINDOW 1 PAGE 2 * 101 * 3 00C00 WINDOW 2 PAGE 3 * 102 * 6 01800 CIX - - - * 103 * * 104 ********************************************************************************** 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 5 F 0 106 107 TAPEBOOT BLOCK beginning of TAPEBOOT routine 108 ENTRY BOOT official starting location 109 110 ********************************************************************************** 111 * * 112 * This is the entry point for all CPU's. * 113 * PROMBOOT starts us here with a valid stack pointer in R6 * 114 * * 115 ********************************************************************************** 116 117 ORG BOOTLOC 118 00001000 119 BOOT LABEL 01000 FE0E1003 120 JMP OVERVERSN jump over the version name 121 * --- 122 01001 41383930 123 VERSION TEXTZ "A8907a" 124 125 ********************************************************************************** 126 * * 127 * CPU LOCKOUT * 128 * This section ensures that only one CPU runs the * 129 * following code. All other CPUs go into an idle loop, * 130 * waiting for the first CPU to finish. * 131 * * 132 ********************************************************************************** 133 00001003 134 OVERVERSN LABEL 01003 D1C0103C 135 SETT LOCKWORD check the lock 01004 FE021036 136 JEQ OTHERWAY jump if already set 137 * \ / 138 139 ********************************************************************************** 140 * * 141 * The first CPU is nominated to load up TOPL. PROMBOOT * 142 * has already created a page map value in IBLOCK called SSUPF * 143 * so we can talk to the SSU. There is also a page map value * 144 * in IBLOCK called BOOTDEVPF so we can talk to the device * 145 * from which we were booted. * 146 * * 147 ********************************************************************************** 148 01005 DC401305 149 CALLNP DISPLAY flash the lights 01006 54415045 150 ASCII 2,TAPEBOOT "TAPEBOOT " 01008 20200000 151 VFD " " AND 03F3F0000 152 01009 60C40082 3 IMM 153 LD PFPTR PNWNDO1 number for this page 0100A 809013E8 @ 154 PFRD @VPFWNDO1 put contents into vector 0100B 60C40083 3 IMM 155 LD PFPTR PNWNDO2 number for this page 0100C 809013E9 @ 156 PFRD @VPFWNDO2 put contents into vector 157 0100D DC40102C 158 CALLNP LOADPF load up the page file for TOPL 159 * \ / 0100E EC00032F 160 STZ IZONEWORD so time displays will appear as GMT 0100F 6100103D 4 161 LD R4 TAPECB point to booted control block 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 6 F 0 01010 DC001055 162 CALL TAPENRLOAD now to load TOPL 01011 4340103E 163 PARV2 TOPLNAME pass the name to get 01012 41441C00 IMM 164 PARV TOPLSTRT start loading at variables page 01013 4004031F IMM 165 PARL ADR BOOTFBIBF use location in IBLOCK 01014 FA022000 0 166 JEQZ R0 TOPL go to TOPL if no errors 167 * \ / error code in R0 168 169 ********************************************************************************** 170 * * 171 * The specified file cannot be read in. Here we halt, * 172 * and put the failure code on the SSU front panel. R0 * 173 * contains the tape error code returned from the tape driver. * 174 * * 175 ********************************************************************************** 176 177 * \ / error code in R0 01015 60C40086 3 IMM 178 LD PFPTR PNCIX point to I/O page 01016 00C00310 179 LDPF SSUPF map in SSU 01017 6040102A 1 180 LD R1 MSG1 load first message part 01018 E440180A 1 181 ST R1 CIX(SSUDISP03) and put in lights 182 01019 604A3610 1 0 CBM 183 LD R1 R0/BIT 27 get first digit 0101A 7C440030 1 IMM 184 IOR R1 "0" make into ascii 0101B 604A7000 1 1 CBM 185 LD R1 R1/BITS 24:23 put in high char position 0101C 600A3840 0 0 CBM 186 LD R0 R0/BITS 28:31 get second digit 0101D 64040009 0 IMM 187 CPR R0 09 is it numeric (0-9)? 0101E FE041020 188 JGT ALF jump if alpha 0101F 18040039 0 IMM 189 ADD R0 "9" bias to ascii digit 00001020 190 ALF LABEL 01020 10040009 0 IMM 191 SUB R0 9 correct digits, make 0A:0F into 6 bit ascii 01021 7C4A2000 1 0 CBM 192 IOR R1 R0/BITS 16:15 place next to first digit 01022 7C44200D 1 IMM 193 IOR R1 " M" AND 03F3F assume MT (use " M") 01023 5C170802 4 BASE 194 CMZ MTU,TPCBTRACK check device track number 01024 FE081026 195 JLT ERROK jump if MT device 01025 7444000E 1 IMM 196 XOR R1 ("C" AND 03F) XOR ("M" AND 03F) convert M to C 00001026 197 ERROK LABEL (variable stuff constructed in R1) 01026 E440180B 1 198 ST R1 CIX(SSUDISP47) put out this fragment 01027 6000102B 0 199 LD R0 MSG2 second message part 01028 E400180C 0 200 ST R0 CIX(SSUDISP89) display 01029 003FFFFF 201 HALT NOHALTCODE die here and now 202 * --- 203 0102A 05121220 204 MSG1 VFD "ERR " AND 03F3F3F3F 0102B 14200010 205 MSG2 VFD ("T " AND 03F3F0000)+1*SSUALARM 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 7 F 0 207 208 BLOCK 209 210 ENTRY LOADPF 211 212 ********************************************************************************** 213 * * 214 * LOADPF. This routine loads the page file so as to map * 215 * each virtual page to the corresponding physical page in the * 216 * proper MCU (that used by PROMBOOT, the first MCU found) * 217 * e.g. PF location 08C gets physical page 0C mapped into it. * 218 * This way any given address is the same whether virtual or * 219 * physical. We start with virtual address 2000 in monitor * 220 * memory and go far enough for TOPL. * 221 * Call: * 222 * CALLNP LOADPF * 223 * Eats R0:R1, R3 * 224 * * 225 ********************************************************************************** 226 0102C DD524000 1 REG 227 LOADPF ENTRNP R1 0102D 60C40087 3 IMM 228 LD PFPTR TOPLSTRT/WPP+MONPF starting page number (first is variables) 0102E 60000311 0 229 LD R0 PHPNAV get page file for this memory 0000102F 230 PFSTARTER LABEL 0102F E4CA28C0 3 0 CBM 231 ST PFPTR R0/PFPAGENUM make page file for that page 01030 EC0A3010 0 CBM 232 STZ R0/PFPAGENUM/MONBIT remove monitor bit 01031 00D20000 0 REG 233 LDPF R0 map memory one-to-one 01032 18C40001 3 IMM 234 ADD PFPTR 1 advance to next page 01033 64C4008C 3 IMM 235 CPR PFPTR (TOPLSTRT+(5*WPP))/WPP+MONPF mapped enough? 01034 FE0A102F 236 JLE PFSTARTER if not, map next page 01035 5D124000 1 REG 237 LEAVE R1 238 * --- 239 +LOADPF 0000102C F 0 210 227= PFSTARTER 0000102F F 0 230= 236j +TOPLSTRT UUUUUUUU F 0 228 235 240 END 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 8 F 0 242 243 ********************************************************************************** 244 * * 245 * If there are other CPUs, they will come here, load * 246 * their page files for the TOPL program, and stop. TOPL will * 247 * bring them around by storing a new address into VEXTRACPUS. * 248 * * 249 ********************************************************************************** 250 00001036 251 OTHERWAY LABEL 01036 DC40102C 252 CALLNP LOADPF load the page file 00001037 253 MULTILOOP LABEL 01037 00420008 IMM 254 WAIT WAITCOUNT wait here a bit 01038 5C8013FC 255 LDPC VEXTRACPUS loop to where the vectors want us 256 * --- 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 9 F 0 258 259 260 ********************************************************************************** 261 * PAGE FILE CONSTANTS * 262 ********************************************************************************** 263 00001039 264 PFWNDO1 BSS 1 page file for window 1 0000103A 265 PFWNDO2 BSS 1 page file for window 2 266 267 268 ********************************************************************************** 269 * * 270 * Pointer to the next available word in Window 4. This * 271 * space is used to build substitution lists. * 272 * * 273 ********************************************************************************** 274 0103B 00001400 275 MEMSPACE VFD STORE+ADR WNDO4 276 277 ********************************************************************************** 278 * Lock and CPU control flags * 279 ********************************************************************************** 280 0103C 00000000 281 LOCKWORD VFD STORE lock word for CPU interlock 282 283 ********************************************************************************** 284 * Names and Addresses * 285 ********************************************************************************** 286 0103D 00000316 287 TAPECB PTR BOOTDEVPF pointer to booted tape control block 288 0103E BB057D80 289 TOPLNAME PAK12 TOPL name of TOPL blocks on tape 00001C00 ABS 290 TOPLSTRT EQU 01C00 start of TOPL (first page is variables) 00002000 291 TOPL EQU ma (TOPLSTRT+WPP) entry point to TOPL 292 293 INPUT BOOT.OPSYS:TAPELOAD 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 10 (TAPELOAD) F 14 Tape Boot File Loader 3 4 ********************************************************************************** 5 * * 6 * TAPELOAD ROUTINE * 7 * This routine loads a code file image from the current * 8 * tape. It reads one or more blocks from the tape while the * 9 * header name matches the name requested. We start by * 10 * selecting track zero (iff CT) and rewinding the tape unit. * 11 * We then look for the file mark that should be right there * 12 * on a boot tape (currently, there should be two records * 13 * before the tape mark. We allow up to four in case we must * 14 * modify the tape format). After that, we just breeze down * 15 * the tape looking for a file that matches the name we were * 16 * given. Once we find matching names in the header, we enter * 17 * the main loading loop which decrypts the most recently read * 18 * block, verifys its data checksum, and reads the next data * 19 * block from the tape. The first block read with a different * 20 * name terminates the loading process. Note also that the * 21 * load addresses are sequential... there is no provision for * 22 * a skipped page. * 23 * We provide the alternate entry TAPENRLOAD for use by * 24 * the TAPEBOOT routine who knows that the tape is positioned * 25 * right before the record that we want. * 26 * Call: * 27 * MTU => tape control block * 28 * CALL TAPELOAD * 29 * PARV2 * 30 * PARV TPDATLOC - address for data block * 31 * PARL TPHDRLOC - address for TPHDR * 32 * JNEZ R0 * 33 * Eats R0:R3 * 34 * stack required = 10 * 35 * 4 + max( CHECKDATA (3), CHECKHDR (2), PBDECRYPT (4), * 36 * PBDINIT (1), READTAPE (6), REWIND (3) ) * 37 * * 38 ********************************************************************************** 39 40 TAPELOAD BLOCK 41 ENTRY TAPELOAD 42 ENTRY TAPENRLOAD 43 44 BEGFRAME 00178801 6 BASE 45 TLNAME BSS 2 place for name we want 00178803 6 BASE 46 TLCOUNTER BSS 1 holds counter for pre-fm records 47 ENDFRAME 48 01040 DD1F8004 6 STAK 49 TAPELOAD ENTR PUSH 01041 C3578801 6 BASE 50 STPV2 SP,TLNAME save name to look for 01042 C1401081 51 STPV TPDATLOC save address for data 01043 C0401082 52 STPVL TPHDRLOC and save address for header 53 01044 5C170802 4 BASE 54 CMZ MTU,TPCBTRACK check type of tape 01045 FE081047 55 JLT NOTACART jump if not cartridge 01046 EC170802 4 BASE 56 STZ MTU,TPCBTRACK call for track 0 00001047 57 NOTACART LABEL 01047 DC40120B 58 CALLNP SETTAPE select track 0 and rewind the tape 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 11 (TAPELOAD) F 14 Tape Boot File Loader 01048 FA0C1080 0 59 JNEZ R0 TLEXIT exit if error occurred 60 * \ / 01049 60040004 0 IMM 61 LD R0 5-1 counter for max records before FM 0104A E4178803 0 6 BASE 62 ST R0 SP,TLCOUNTER and set the counter 0000104B 63 TLSFM LABEL 0104B DC0010D5 64 CALL READTAPE read a record from tape 0104C 41440000 IMM 65 PARV 0 no known record number 0104D 41401081 66 PARV TPDATLOC convenient buffer for read 0104E 40401082 67 PARVL TPHDRLOC and a header address too 0104F 64040008 0 IMM 68 CPR R0 TERREOF looking for file mark 01050 FE021059 69 JEQ TL10 jump if found, boot info follows 01051 D0578803 6 BASE 70 DEC SP,TLCOUNTER check the counter for too far without FM 01052 FE06104B 71 JGE TLSFM discard record if not too far 01053 6004000D 0 IMM 72 LD R0 TERRNBT not a bootable tape, probably 73 * switched during backup 01054 FE0E1080 74 JMP TLEXIT return giving error 75 * --- 76 77 ********************************************************************************** 78 * * 79 * We should now be positioned immediately before a boot * 80 * format block. Read it and verify in turn... its name, its * 81 * header CS, and that it decrypts and checksums. * 82 * * 83 ********************************************************************************** 84 01055 DD1F8004 6 STAK 85 TAPENRLOAD ENTR PUSH 01056 C3578801 6 BASE 86 STPV2 SP,TLNAME save name to look for 01057 C1401081 87 STPV TPDATLOC save address for data 01058 C0401082 88 STPVL TPHDRLOC and save address for header 00001059 89 TL10 LABEL 01059 DC0010D5 90 CALL READTAPE read a block from the tape 0105A 41440000 IMM 91 PARV 0 no record number known 0105B 41401081 92 PARV TPDATLOC pass data page address 0105C 40401082 93 PARVL TPHDRLOC and header address 94 0105D FA021062 0 95 JEQZ R0 NOTAPERR jump if read okay 96 * The read return said we got an error, see if it is an EOF. 0105E 64040008 0 IMM 97 CPR R0 TERREOF did we hit the EOF flag? 0105F FE0C1080 98 JNE TLEXIT jump if not, return error from READTAPE 01060 60040009 0 IMM 99 LD R0 TERRFNF otherwise, say we couldn't find the file 01061 FE0E1080 100 JMP TLEXIT 101 * --- 102 00001062 103 NOTAPERR LABEL 01062 60C01082 3 104 LD R3 TPHDRLOC point to the header buffer 01063 6216C800 013 BASE 105 LD2 R0 R3,TPHDRTAG get name of block we read 01064 6A178801 016 BASE 106 UCPR2 R0 SP,TLNAME is it the one we want? 01065 FE0C1059 107 JNE TL10 if not try another block 108 * \ / R3 => TPHDR 00001066 109 LOADLOOP LABEL 01066 DC001083 110 CALL CHECKHDR checksum the header block 01067 40401082 111 PARVL TPHDRLOC pass its location 01068 FA0C1080 0 112 JNEZ R0 TLEXIT exit if checksum error 113 * \ / 01069 DC0012BC 114 CALL PBDINIT set up to decrypt the block 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 12 (TAPELOAD) F 14 Tape Boot File Loader 0106A 4156C802 3 BASE 115 PARV R3,TPHDRIND pass indicator 0106B 4356C803 3 BASE 116 PARV2 R3,TPHDRDATE pass backup date 0106C 40401081 117 PARVL TPDATLOC pass the page address 118 0106D DC4012D0 119 CALLNP PBDECRYPT now do the actual decryption 120 0106E DC00108B 121 CALL CHECKDATA now checksum the data block 0106F 41401081 122 PARV TPDATLOC pass address of data 01070 40401082 123 PARVL TPHDRLOC and header location 01071 FA0C1080 0 124 JNEZ R0 TLEXIT exit if checksum error 125 * \ / 126 127 ********************************************************************************** 128 * * 129 * We have now successfully loaded and decrypted a block * 130 * from the file on tape. Read the next block and see if it * 131 * is part of this file or not (FM or different name). * 132 * * 133 ********************************************************************************** 134 135 * \ / 01072 60040400 0 IMM 136 LD R0 WPP get a page increment 01073 98001081 0 137 ADDM R0 TPDATLOC advance to next data page 138 01074 DC0010D5 139 CALL READTAPE read a block from the tape 01075 41440000 IMM 140 PARV 0 no record number known 01076 41401081 141 PARV TPDATLOC pass data page address 01077 40401082 142 PARVL TPHDRLOC and header address 143 01078 64040008 0 IMM 144 CPR R0 TERREOF is it EOF? 01079 FE02107F 145 JEQ TLOK if so then ok 0107A FA0C1080 0 146 JNEZ R0 TLEXIT jump if couldn't read it 0107B 60C01082 3 147 LD R3 TPHDRLOC point to the header buffer 0107C 6216C800 013 BASE 148 LD2 R0 R3,TPHDRTAG get name of block we read 0107D 6A178801 016 BASE 149 UCPR2 R0 SP,TLNAME is it the one we want? 0107E FE021066 150 JEQ LOADLOOP if so try for next record 151 * \ / 0000107F 152 TLOK LABEL 0107F EC120000 0 REG 153 STZ R0 return the all-clear code 00001080 154 TLEXIT LABEL 01080 5D1F8004 6 STAK 155 LEAVE POP return to caller 156 * --- 157 00001081 158 TPDATLOC BSS 1 virtual address of data page 00001082 159 TPHDRLOC BSS 1 virtual address of header 160 +CHECKDATA UUUUUUUU F 14 121 +CHECKHDR UUUUUUUU F 14 110 LOADLOOP 00001066 F 14 109= 150j +MTU UUUUUUUU F 14 54 56s NOTACART 00001047 F 14 55j 57= NOTAPERR 00001062 F 14 95j 103= +PBDECRYPT UUUUUUUU F 14 119 +PBDINIT UUUUUUUU F 14 114 +READTAPE UUUUUUUU F 14 64 90 139 +SETTAPE UUUUUUUU F 14 58 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 13 (TAPELOAD) F 14 Tape Boot File Loader +TAPELOAD 00001040 F 14 41 49= +TAPENRLOAD 00001055 F 14 42 85= TL10 00001059 F 14 69j 89= 107j TLCOUNTER 00178803 F 14 46= 62s 70s TLEXIT 00001080 F 14 59j 74j 98j 100j 112j 124j 146j 154= TLNAME 00178801 F 14 45= 50s 86s 106 149 TLOK 0000107F F 14 145j 152= TLSFM 0000104B F 14 63= 71j TPDATLOC 00001081 F 14 51s 66 87s 92 117 122 137s 141 158= TPHDRLOC 00001082 F 14 52s 67 88s 93 104 111 123 142 147 159= 161 END TAPELOAD 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 14 (TAPELOAD) F 14 Tape Boot File Loader 163 164 ********************************************************************************** 165 * * 166 * CHECKHDR routine for header checksum verification * 167 * Call: * 168 * CALL CHECKHDR * 169 * PARVL
* 170 * JNEZ R0
* 171 * Sets R0 * 172 * stack required = 2 * 173 * * 174 ********************************************************************************** 175 176 BLOCK 177 178 ENTRY CHECKHDR 179 180 BEGFRAME 00178801 6 BASE 181 CHKHADR BSS 1 place for header address 182 ENDFRAME 183 01083 DD1F8002 6 STAK 184 CHECKHDR ENTR PUSH 01084 C0578801 6 BASE 185 STPVL SP,CHKHADR 01085 6003FFC0 0 IMM 186 LD R0 FBICSMASK get checksum mask 01086 F0178C01 0 6 FPVR 187 PRMUT R0 @(SP,CHKHADR) and compute the checksum 01087 7407FFFF 0 IMM 188 XOR R0 0FFFFFFFF convert to 0 if good 01088 FA02108A 0 189 JEQZ R0 CHKHEXIT jump if match, R0=no error code (0) 01089 6004000A 0 IMM 190 LD R0 TERRHCS say we got a header check err 0000108A 191 CHKHEXIT LABEL 0108A 5D1F8002 6 STAK 192 LEAVE POP return with result in R0 193 * --- 194 +CHECKHDR 00001083 F 14 178 184= CHKHADR 00178801 F 14 181= 185s 187 CHKHEXIT 0000108A F 14 189j 191= 195 END 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 15 (TAPELOAD) F 14 Tape Boot File Loader 197 198 ********************************************************************************** 199 * * 200 * CHECKDATA routine is used to check data block checksum * 201 * * 202 * CALL CHECKDATA * 203 * PARV * 204 * PARVL * 206 * Sets R0, Eats R1 * 207 * stack required = 3 * 208 * * 209 ********************************************************************************** 210 211 BLOCK 212 213 ENTRY CHECKDATA 214 215 BEGFRAME 00178801 6 BASE 216 CHKHADR BSS 1 place for header address 00178802 6 BASE 217 CHKDADR BSS 1 place for data address 218 ENDFRAME 219 0108B DD1F8003 6 STAK 220 CHECKDATA ENTR PUSH 0108C C1578802 6 BASE 221 STPV SP,CHKDADR save pointer to data 0108D C0578801 6 BASE 222 STPVL SP,CHKHADR and save header pointer 0108E E0978802 2 6 BASE 223 EXCH R2 SP,CHKDADR save R2, get buffer pointer 0108F 604403FF 1 IMM 224 LD R1 WPP-1 get buffer size (1 page) 01090 EC120000 0 REG 225 STZ R0 intialize accumulator 01091 58840004 IMM 226 CLBPSR PSRCARRY clear any leftover carry 01092 58C40010 IMM 227 IORPSR PSRMODIF set modified arithmetic 00001093 228 CHK10 LABEL 01093 181A8C00 0 21 @R 229 ADD R0 @R2(R1) add in one more data location 01094 FA661093 1 230 JDR R1 CHK10 loop through whole data page 231 * \ / 01095 18040000 0 IMM 232 ADD R0 0 add in final carry 01096 58840010 IMM 233 CLBPSR PSRMODIF clear modified arithmetic 01097 60978802 2 6 BASE 234 LD R2 SP,CHKDADR restore R2 01098 60578801 1 6 BASE 235 LD R1 SP,CHKHADR get pointer to header 01099 74164809 0 1 BASE 236 XOR R0 R1,TPHDRDCKS compare our value to checksum 0109A FA02109C 0 237 JEQZ R0 CHKDEXIT jump if match, R0=no error code (0) 0109B 6004000B 0 IMM 238 LD R0 TERRDCS say we got data checksum error 0000109C 239 CHKDEXIT LABEL 0109C 5D1F8003 6 STAK 240 LEAVE POP return to caller 241 * --- 242 +CHECKDATA 0000108B F 14 213 220= CHK10 00001093 F 14 228= 230j CHKDADR 00178802 F 14 217= 221s 223s 234 CHKDEXIT 0000109C F 14 237j 239= CHKHADR 00178801 F 14 216= 222s 235 243 END of CHECKDATA 294 INPUT BOOT.OPSYS:TALON 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 16 (TALON) F 15 Off-Line Tape Driver 3 4 ********************************************************************************** 5 * * 6 * Revisions Date * 7 * --------- ---- * 8 * 1.0 8608 11 Aug 86 * 9 * Revisions list added. * 10 * Minor fixes in OPENTAPE. CHKHDR and CHKDATA * 11 * moved to TAPELOAD. * 12 * 1.1 8608a 27 Aug 86 * 13 * Major changes and bug fixes. * 14 * Tape write code and error logging added. Misc * 15 * mods to organization, resets, and PPUIWAIT. RC * 16 * 1.2 8701 07 Jan 87 * 17 * Tape reader nows returns error without retry * 18 * if buffer too small. RC * 19 * A8703 31 Mar 87 * 20 * Fix in previous fix. RC * 21 * A8811 28 Nov 88 * 22 * Fix to WRITEFM to use proper retry counter. * 23 * Change to OPENTAPE to remove MTCMRESET. * 24 * Mods to allow operation on VT. RC * 25 * A8907 20 Jul 89 * 26 * Changed to tell controller the read length * 27 * set up when only one page is being read. * 28 * This is to prevent hangs when reading from * 29 * the VT. Filled in VT error code table. RC * 30 * A8907a 23 Jul 89 * 31 * Fixes to new VT code and related stuff broken * 32 * in A8811. RC * 33 * **** may still need adjustment to timeouts **** * 34 * * 35 ********************************************************************************** 36 00130000 4 REG 37 MTU EQU R4 tape unit controller element pointer 38 39 TALON BLOCK offline tape driver 40 41 ENTRY OPENTAPE tape open routine 42 ENTRY PPUIWAIT routine to wait for interrupt 43 ENTRY READTAPE tape read routine 44 ENTRY REWIND tape rewind routine 45 ENTRY SEFF tape search EOF forward routine 46 ENTRY SEFB tape search EOF backward routine 47 ENTRY SETTAPE tape density/track select 48 ENTRY TAPEFUNC tape function routine 49 ENTRY WRITETAPE tape write routine 50 ENTRY WRITEFM tape write file mark routine 51 52 ********************************************************************************** 53 * * 54 * OFFLINE TAPE-DRIVER ROUTINES * 55 * * 56 * These offline routines perform the tape operations * 57 * for TAPEBOOT and DISKTOTAPE: * 58 * * 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 17 (TALON) F 15 Off-Line Tape Driver 59 * OPENTAPE - intialize tape control block * 60 * READTAPE - read a given number of bytes from the * 61 * tape and store at a specified address. * 62 * REWIND - rewind tape to BOT. * 63 * SEFF - seek an end-of-file forward. * 64 * SEFB - seek an end-of-file backward. * 65 * SETTAPE - select a track, and do rewind (if CTC). * 66 * TAPEFUNC - perform a tape operation with an input * 67 * of the tape op code. * 68 * WRITETAPE - write a given number of bytes to the * 69 * tape from a specified address. * 70 * WRITEFM - write a file mark onto the tape. * 71 * * 72 * error codes * 73 * 1 Bad unit number * 74 * 2 Bad channel number * 75 * 3 Bad slot number * 76 * 4 Device not a tape drive * 77 * 5 Tape drive not on-line (unused) * 78 * 6 Tape drive not ready * 79 * 7 Irrecoverable tape error * 80 * 8 File mark on read * 81 * 9 File name not found on tape * 82 * 0A Header checksum error (from TAPELOAD) * 83 * 0B Data checksum error (from TAPELOAD) * 84 * 0C drive is write protected * 85 * 0D this tape is not a bootable tape * 86 * * 87 * Misc Caveats. * 88 * This code is designed to work in the off-line * 89 * environment. It is gathered together from various places, * 90 * so the coding style and even the assumptions about how the * 91 * hardware works are not consistent. * 92 * Several changes have been made to restore consistency. * 93 * Most notably, some code (primarily write) was originally * 94 * written as if the PPU interrupt for rollover or DMA * 95 * completion had to be set in order to get the rollover or * 96 * completion status bits to come up. Other code just waited on * 97 * the status bits without ever enabling the relevant interrupt. * 98 * Since this latter seemed to work, the other was removed. * 99 * * 100 ********************************************************************************** 101 102 ********************************************************************************** 103 * * 104 * Global equates and variables * 105 * * 106 ********************************************************************************** 107 108 * mask for error bits in PPU status 00006540 ABS 109 PPUMASK EQU 1*PPUIXTRA+1*PPUIDPPE+1*PPUICONF+1*PPUIMPE+1*PPUIBCNR 00000014 ABS 110 TAPEERRMAX EQU 20 maximum number of retries 00040000 ABS 111 CATCHWAIT EQU 2 POWER 18 about 2.5 seconds of wait. 112 * used after PPU abort to allow 113 * controller to become idle. 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 18 (TALON) F 15 open tape routine 116 117 ********************************************************************************** 118 * * 119 * OPENTAPE. This routine will initialize a tape control * 120 * element. It will parse the tape name and, if not already * 121 * established, it will set up the tape unit controller element. * 122 * Call: * 123 * LD R4 => tape control element * 124 * LD R0 pak6 tape name (TAPscu), or zero * 125 * if tape unit is already set up. * 126 * CALLNP OPENTAPE * 127 * JNEZ R0 * 128 * * 129 * Sets R0, Eats R1:R3 * 130 * stack required = 1 * 131 * * 132 ********************************************************************************** 133 134 OPENTAPE BLOCK 135 ENTRY OPENTAPE 136 137 BEGFRAME 138 ENDFRAME 139 0109D B8E21A69 140 TAP000 PAK6 TAP000 base for tape name unpacker 141 0109E DD5F8001 6 STAK 142 OPENTAPE ENTRNP PUSH 0109F FA0210B1 0 143 JEQZ R0 HAVETAPE jump if tape unit already found 010A0 EC170800 4 BASE 144 STZ MTU,TPCBPFILE clean out page file 010A1 1000109D 0 145 SUB R0 TAP000 R0 = (slot * 40 + chan) * 40 + unit 010A2 58C40010 IMM 146 IORPSR PSRMODIF set funky arithmetic 010A3 62120000 010 REG 147 LD2 R0 R0 010A4 14040028 0 IMM 148 DIV R0 40 R0 = slot * 40 + chan, R1 = unit 010A5 68440004 1 IMM 149 UCPR R1 NMTPUNITS check for allowable unit 010A6 FE0610CB 150 JGE BADUNIT jump if unit out of range 010A7 E4570801 1 4 BASE 151 ST R1 MTU,TPCBUNIT save unit number 010A8 62120000 010 REG 152 LD2 R0 R0 010A9 14040028 0 IMM 153 DIV R0 40 R0 = slot, R1 = channel 010AA 68440004 1 IMM 154 UCPR R1 PPUCHANS check for allowable channel 010AB FE0610CD 155 JGE BADCHAN jump if channel out of range 010AC E4493020 1 4 ZBM 156 ST R1 MTU,TPCBPFILE/PPUCHAN save channel number 010AD 68040010 0 IMM 157 UCPR R0 NUMSLOTS now compare against maximum slot number 010AE FE0610CF 158 JGE BADSLOT jump if slot out of range 010AF E4090840 0 4 ZBM 159 ST R0 MTU,TPCBPFILE/PFSLOT save slot number 010B0 58840010 IMM 160 CLBPSR PSRMODIF restore normal arithmetic 161 162 * See if we really have a tape. 163 * \ / 000010B1 164 HAVETAPE LABEL 010B1 60090840 0 4 ZBM 165 LD R0 MTU,TPCBPFILE/PFSLOT R0 = PPU slot number 010B2 60200370 0 0 166 LD R0 IBSLOTS(R0) R0 = WRU response from slot 010B3 600A0040 0 0 CBM 167 LD R0 R0/WRU0TYPE R0 = type field of WRU0 response 010B4 64040003 0 IMM 168 CPR R0 SLTTPPU is it a PPU? 010B5 FE0C10CF 169 JNE BADSLOT jump if not 010B6 60C40086 3 IMM 170 LD PFPTR PNCIX 010B7 00D70800 4 BASE 171 LDPF MTU,TPCBPFILE map in the controller 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 19 (TALON) F 15 open tape routine 010B8 60001800 0 172 LD R0 CIX(PPUCABLED) get the device WRU response 010B9 600A0080 0 0 CBM 173 LD R0 R0/DWRUTYPE R0 = device type field 174 010BA D1570802 4 BASE 175 STMW MTU,TPCBTRACK assume 9-track 010BB 64040009 0 IMM 176 CPR R0 DVCTMTC is it a tape controller? 010BC FE0210C4 177 JEQ UNITSTATUS jump if so 010BD 6404000B 0 IMM 178 CPR R0 DVCTVTC is it a video tape controller? 010BE FE0C10C1 179 JNE NOTVT jump if not 010BF D0570802 4 BASE 180 DEC MTU,TPCBTRACK indicate VT (-2) 010C0 FE0E10C4 181 JMP UNITSTATUS go do cleanups 182 * --- 183 000010C1 184 NOTVT LABEL 010C1 6404000A 0 IMM 185 CPR R0 DVCTCTC is it a cartridge tape controller? 010C2 FE0C10D1 186 JNE BADTAPE jump if not 010C3 EC170802 4 BASE 187 STZ MTU,TPCBTRACK set track 0 of cartridge tape 000010C4 188 UNITSTATUS LABEL 010C4 EC001801 189 STZ CIX(PPUABORT) clean up the channel 010C5 60570801 1 4 BASE 190 LD R1 MTU,TPCBUNIT get desired unit number 010C6 EC221A38 1 191 STZ CIX(MTCMFUNC+MTSELECT+R1) select the correct unit 192 000010C7 193 UNITSTAT01 LABEL 010C7 60001A10 0 194 LD R0 CIX(MTLDSTAT) get controller status 010C8 F23410D3 0 195 JBF R0/MTDSTRDY NOTREADY jump if not ready 196 * \ / 010C9 60040000 0 IMM 197 LD R0 0 good return code 000010CA 198 GOBACK LABEL 010CA 5D1F8001 6 STAK 199 LEAVE POP return to user 200 * --- 201 000010CB 202 BADUNIT LABEL (Bad unit number) 010CB 60040001 0 IMM 203 LD R0 TERRBUN 010CC FE0E10CA 204 JMP GOBACK 205 * --- 206 000010CD 207 BADCHAN LABEL (Bad channel number) 010CD 60040002 0 IMM 208 LD R0 TERRBCN 010CE FE0E10CA 209 JMP GOBACK 210 * --- 211 000010CF 212 BADSLOT LABEL (Bad slot number) 010CF 60040003 0 IMM 213 LD R0 TERRBSN 010D0 FE0E10CA 214 JMP GOBACK 215 * --- 216 000010D1 217 BADTAPE LABEL (Device not a tape drive) 010D1 60040004 0 IMM 218 LD R0 TERRDNT 010D2 FE0E10CA 219 JMP GOBACK 220 * --- 221 000010D3 222 NOTREADY LABEL (Drive not ready) 010D3 60040006 0 IMM 223 LD R0 TERRDNR 010D4 FE0E10CA 224 JMP GOBACK and return 225 * --- 226 BADCHAN 000010CD F 15 155j 207= 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 20 (TALON) F 15 open tape routine BADSLOT 000010CF F 15 158j 169j 212= BADTAPE 000010D1 F 15 186j 217= BADUNIT 000010CB F 15 150j 202= GOBACK 000010CA F 15 198= 204j 209j 214j 219j 224j HAVETAPE 000010B1 F 15 143j 164= +MTU 00130000 F 15 144s 151s 156s 159s 165 171 175s 180s 187s 190 NOTREADY 000010D3 F 15 195j 222= NOTVT 000010C1 F 15 179j 184= +OPENTAPE 0000109E F 15 135 142= TAP000 0000109D F 15 140= 145 UNITSTAT01 000010C7 F 15 193= UNITSTATUS 000010C4 F 15 177j 181j 188= 227 END OPENTAPE routine 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 21 (TALON) F 15 offline tape driver 230 231 ********************************************************************************** 232 * * 233 * READTAPE * 234 * This routine reads a record from the 9 track, cartridge * 235 * tape, or video tape. Note that this routine will read two * 236 * types of records. The first is the type that TAPEBOOTMAKE * 237 * writes out to the tape. The format of these records is * 238 * analagous to a disk block and FBI except that the header is * 239 * first. The second type is what +BACKUP writes onto the tape, * 240 * and is basicly a linear record. The second type of record * 241 * is distinguished by passing a zero address as the second * 242 * parameter. They may extend past page boundaries and are * 243 * read into ascending contiguous pages (as mapped in the monitor * 244 * page file). * 245 * * 246 * Call: * 247 * MTU => tape control block * 248 * CALL READTAPE * 249 * PARV * 250 * PARV * 251 * PARVL * 252 * JNEZ R0 ERROR * 253 * (R1 = # bytes read, R0 = error code) * 254 * Sets R0:R1, Eats R2. * 255 * stack required = 6 * 256 * 4 + MAX ( DOTWOBUF (2), DOONEBUF (2), INTFUNC (2), * 257 * LOGERROR (2), SETUPNMAP (1), UNMAP (1) ) * 258 * * 259 ********************************************************************************** 260 261 READTAPE BLOCK 262 ENTRY READTAPE 263 264 BEGFRAME 00178801 6 BASE 265 DATPAGE BSS 1 data address 00178802 6 BASE 266 HDRPAGE BSS 1 header address 00178803 6 BASE 267 R3SAVE BSS 1 temp for R3 268 ENDFRAME 269 010D5 DD1F8004 6 STAK 270 READTAPE ENTR PUSH 010D6 C14012BB 271 STPV RECORDNUM save record number 010D7 C1578801 6 BASE 272 STPV SP,DATPAGE save data address 010D8 C0578802 6 BASE 273 STPVL SP,HDRPAGE and also header address 010D9 E4D78803 3 6 BASE 274 ST R3 SP,R3SAVE save R3 from harm 275 010DA DC40126B 276 CALLNP SETUPNMAP do initial stuff 000010DB 277 RETRYLOOP LABEL 010DB D1401803 278 STMW CIX(PPUSCSTAT) set status and DMA to input 010DC 60578801 1 6 BASE 279 LD R1 SP,DATPAGE get address of data page 010DD 60978802 2 6 BASE 280 LD R2 SP,HDRPAGE get address of header page 010DE FA8210E1 2 281 JEQZ R2 ONEBUF jump if we read sequential buffer 010DF DC4010F8 282 CALLNP DOTWOBUF read buffer and header 010E0 FE0E10E2 283 JMP CHKSTAT go see if all is ok 284 * --- 285 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 22 (TALON) F 15 offline tape driver 000010E1 286 ONEBUF LABEL 010E1 DC40110F 287 CALLNP DOONEBUF read a single sequential record 288 289 * When we get here we have: R0 = PPU status masked, 290 * R1 = PPU status 291 * R2 = controller status. 000010E2 292 CHKSTAT LABEL 010E2 FA0C10EA 0 293 JNEZ R0 BADREAD jump if PPU is complaining 010E3 F68410EA 2 294 JBT R2/MTSTANER BADREAD jump if controller un-happy 295 * R0 = 0 indicates we had a good read 010E4 F29010E6 2 296 JBF R2/MTSTEOF READEXIT but only if there was no EOF 010E5 60040008 0 IMM 297 LD R0 TERREOF else say we hit a file mark 000010E6 298 READEXIT LABEL 010E6 60401803 1 299 LD R1 CIX(PPUCHANS2) get number of bytes actually read 010E7 DC401279 300 CALLNP UNMAP unmap the controller 010E8 60D78803 3 6 BASE 301 LD R3 SP,R3SAVE restore this register 010E9 5D1F8004 6 STAK 302 LEAVE POP return to calling routine 303 * --- 304 305 * If we get any error on the read we will come here. 306 000010EA 307 BADREAD LABEL 010EA DC00128B 308 CALL LOGERROR make an entry in the error log 010EB 40440012 IMM 309 PARVL ERTOPREAD indicating read operation 010EC 60040006 0 IMM 310 LD R0 TERRDNR assume drive not ready 010ED F2B410E6 2 311 JBF R2/MTDSTRDY READEXIT jump if good guess 010EE 60040007 0 IMM 312 LD R0 TERRITE get the catch-all error in case 010EF F66210E6 1 313 JBT R1/PPUIXTRA READEXIT jump if buffer too small, no hope 010F0 D04012BA 314 DEC RETRYCOUNT check to see if another attempt okay 010F1 FE0810E6 315 JLT READEXIT jump if retrys exhausted 010F2 F29410DB 2 316 JBF R2/MTSTTMFWB RETRYLOOP retry if tape did not move 317 010F3 60040006 0 IMM 318 LD R0 MTFNBKSP otherwise back it up 010F4 DC401259 319 CALLNP INTFUNC so we can make another try 010F5 DC00128B 320 CALL LOGERROR log backspace in error buffer 010F6 40440010 IMM 321 PARVL ERTOPBKSP indicate backspace 010F7 FE0E10DB 322 JMP RETRYLOOP go try it again 323 * --- 324 BADREAD 000010EA F 15 293j 294j 307= CHKSTAT 000010E2 F 15 283j 292= DATPAGE 00178801 F 15 265= 272s 279 +DOONEBUF UUUUUUUU F 15 287 +DOTWOBUF UUUUUUUU F 15 282 HDRPAGE 00178802 F 15 266= 273s 280 +INTFUNC UUUUUUUU F 15 319 +LOGERROR UUUUUUUU F 15 308 320 ONEBUF 000010E1 F 15 281j 286= R3SAVE 00178803 F 15 267= 274s 301 READEXIT 000010E6 F 15 296j 298= 311j 313j 315j +READTAPE 000010D5 F 15 262 270= +RECORDNUM UUUUUUUU F 15 271s +RETRYCOUNT UUUUUUUU F 15 314s RETRYLOOP 000010DB F 15 277= 316j 322j +SETUPNMAP UUUUUUUU F 15 276 +UNMAP UUUUUUUU F 15 300 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 23 (TALON) F 15 offline tape driver 325 END READTAPE routine 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 24 (TALON) F 15 offline tape driver 327 328 ********************************************************************************** 329 * * 330 * DOTWOBUF * 331 * This routine will read a header, and a page of data from * 332 * the tape. The page of data must be read into a page aligned * 333 * buffer, and the header must be read into a buffer contained * 334 * all on one page. * 335 * Calling sequence: * 336 * R1 = address of page * 337 * R2 = address of header * 338 * CALLNP DOTWOBUF * 339 * R0 = masked PPU status * 340 * R1 = PPU status * 341 * R2 = controller status * 342 * Sets R0:R2, Eats R3. * 343 * stack required = 2 * 344 * 1 + PPUIWAIT(1) * 345 * * 346 ********************************************************************************** 347 348 DOTWOBUF BLOCK 349 ENTRY DOTWOBUF 350 351 BEGFRAME 352 ENDFRAME 353 010F8 DD5F8001 6 STAK 354 DOTWOBUF ENTRNP PUSH 010F9 60CA9E70 3 2 CBM 355 LD PFPTR R2/FLDPAGE extract virtual page number 010FA 7CC40080 3 IMM 356 IOR PFPTR MONPF we're in monitor memory 010FB 80920000 0 REG 357 PFRD R0 get page file contents 010FC E40A94C0 0 2 CBM 358 ST R0 R2/FLDABSPG make relative physical page 010FD E48A1560 2 0 CBM 359 ST R2 R0/PAGEANDISP combine with slot number 010FE E4001805 0 360 ST R0 CIX(PPUADDR1) store address for header 361 010FF 60CA5E70 3 1 CBM 362 LD PFPTR R1/FLDPAGE extract virtual page number 01100 7CC40080 3 IMM 363 IOR PFPTR MONPF we're in monitor memory 01101 80920000 0 REG 364 PFRD R0 get page file contents 01102 E40A54C0 0 1 CBM 365 ST R0 R1/FLDABSPG make relative physical page 01103 E44A1560 1 0 CBM 366 ST R1 R0/PAGEANDISP combine with slot number 01104 E4001807 0 367 ST R0 CIX(PPUADDR2) store address for data block 368 01105 60049000 0 IMM 369 LD R0 PPUCLAST*1+CPP get length of data block 01106 E4001806 0 370 ST R0 CIX(PPUCNT2) store data byte count 01107 6004002C 0 IMM 371 LD R0 TPHDRLNTH*CPW get header length 01108 E4001804 0 372 ST R0 CIX(PPUCNT1) store header length 373 01109 60570801 1 4 BASE 374 LD R1 MTU,TPCBUNIT get tape unit number 0110A 6004102C 0 IMM 375 LD R0 CPP+TPHDRLNTH*CPW get length set up 0110B E4221AC8 0 1 376 ST R0 CIX(MTCMREAD+MTINTREQ+MTSELECT+R1) 0110C DC00127D 377 CALL PPUIWAIT wait for end of read interrupt 0110D 40442328 IMM 378 PARVL 9000 wait ninety seconds (ten ms units) 0110E 5D1F8001 6 STAK 379 LEAVE POP 380 * --- 381 +DOTWOBUF 000010F8 F 15 349 354= 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 25 (TALON) F 15 offline tape driver +MTU 00130000 F 15 374 +PPUIWAIT UUUUUUUU F 15 377 382 END DOTWOBUF 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 26 (TALON) F 15 offline tape driver 384 385 ********************************************************************************** 386 * * 387 * DOONEBUF * 388 * This routine will read a single contiguous record from * 389 * the tape. The destination buffer need not start on a page * 390 * boundary but must start on a word boundary. No checking * 391 * is done for buffer overflow so the caller is responsible * 392 * for providing a large enough buffer for the any record * 393 * that will appear on the tape. * 394 * Call: * 395 * R1 = address of the buffer * 396 * CALLNP DOONEBUF * 397 * R0 = masked PPU status * 398 * R1 = PPU status * 399 * R2 = controller status * 400 * Sets R0:R2, Eats R3. * 401 * stack required = 2 * 402 * * 403 ********************************************************************************** 404 405 DOONEBUF BLOCK 406 ENTRY DOONEBUF 407 408 BEGFRAME 00178801 6 BASE 409 PAGADR BSS 1 temp. to hold address 410 ENDFRAME 411 0110F DD5F8002 6 STAK 412 DOONEBUF ENTRNP PUSH 01110 E4578801 1 6 BASE 413 ST R1 SP,PAGADR remember the start of the buffer 414 01111 60CA5E70 3 1 CBM 415 LD PFPTR R1/FLDPAGE extract the virtual page number 01112 7CC40080 3 IMM 416 IOR PFPTR MONPF we're in monitor memory 01113 80920000 0 REG 417 PFRD R0 get the page file contents 01114 E40A54C0 0 1 CBM 418 ST R0 R1/FLDABSPG make relative physical page 01115 E44A1560 1 0 CBM 419 ST R1 R0/PAGEANDISP combine with slot number 01116 E4001805 0 420 ST R0 CIX(PPUADDR1) store address for first part of record 421 01117 60440000 1 IMM 422 LD R1 0 want zero offset into page 01118 18C40001 3 IMM 423 ADD PFPTR 1 move to next virtual page number 01119 80920000 0 REG 424 PFRD R0 get the page file contents 0111A E40A54C0 0 1 CBM 425 ST R0 R1/FLDABSPG make relative physical page 0111B E44A1560 1 0 CBM 426 ST R1 R0/PAGEANDISP combine with slot number 0111C E4001807 0 427 ST R0 CIX(PPUADDR2) and store the address 428 0111D 60041000 0 IMM 429 LD R0 CPP number of chars. to read 0111E E4001806 0 430 ST R0 CIX(PPUCNT2) ... in the second page 431 0111F 6049ACA1 1 6 ZBM 432 LD R1 SP,PAGADR/DISPFIELD get displacement into page 01120 30440400 1 IMM 433 RSB R1 WPP how many words are left on page 01121 1C440004 1 IMM 434 MUL R1 CPW convert to a character count 01122 E4401804 1 435 ST R1 CIX(PPUCNT1) store the count for this page 436 01123 60570801 1 4 BASE 437 LD R1 MTU,TPCBUNIT get the unit number 01124 EC221AC8 1 438 STZ CIX(MTCMREAD+MTINTREQ+MTSELECT+R1) do it 439 * \ / 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 27 (TALON) F 15 offline tape driver 00001125 440 BCRCOUNT LABEL 01125 60055F90 0 IMM 441 LD R0 90000 90 second dead-man timer (1 ms units) 00001126 442 INTWAIT LABEL 01126 00440064 IMM 443 WAIT 100 wait here for 1 millisecond 444 * \ / to avoid saturating the PPU 01127 60401801 1 445 LD R1 CIX(PPUINTSTAT) get the status 01128 F678112C 1 446 JBT R1/PPUIINTC ENDWAIT jump if all done 01129 F6761133 1 447 JBT R1/PPUIROLL ROLLOVER jump if byte count rollover 0112A FA261126 0 448 JDR R0 INTWAIT wait for another ms 449 * \ / 0112B D1524000 1 REG 450 STMW R1 timed out, real bad 0000112C 451 ENDWAIT LABEL 0112C 60124000 0 1 REG 452 LD R0 R1 copy status 0112D 78046540 0 IMM 453 AND R0 PPUMASK mask off error bits 0112E 60801802 2 454 LD R2 CIX(PPUCHANS1) get controller status 0112F FA021132 0 455 JEQZ R0 PPUSOKAY jump if PPU status clean 01130 EC001801 456 STZ CIX(PPUABORT) clean up channel 01131 00420008 IMM 457 WAIT CATCHWAIT wait for controller to catch up 00001132 458 PPUSOKAY LABEL 01132 5D1F8002 6 STAK 459 LEAVE POP 460 * --- 461 00001133 462 ROLLOVER LABEL 01133 60440000 1 IMM 463 LD R1 0 want zero offset into page 01134 18C40001 3 IMM 464 ADD PFPTR 1 move to next virtual page number 01135 80920000 0 REG 465 PFRD R0 get the page file contents 01136 E40A54C0 0 1 CBM 466 ST R0 R1/FLDABSPG make relative physical page 01137 E44A1560 1 0 CBM 467 ST R1 R0/PAGEANDISP combine with slot number 01138 E4001807 0 468 ST R0 CIX(PPUADDR2) and store the address 469 01139 60041000 0 IMM 470 LD R0 CPP number of chars. to read 0113A E4001806 0 471 ST R0 CIX(PPUCNT2) store for this page 472 0113B FE0E1125 473 JMP BCRCOUNT go wait again 474 * --- 475 BCRCOUNT 00001125 F 15 440= 473j +CATCHWAIT 00040000 F 15 457 +DOONEBUF 0000110F F 15 406 412= ENDWAIT 0000112C F 15 446j 451= INTWAIT 00001126 F 15 442= 448j +MTU 00130000 F 15 437 PAGADR 00178801 F 15 409= 413s 432 +PPUMASK 00006540 F 15 453 PPUSOKAY 00001132 F 15 455j 458= ROLLOVER 00001133 F 15 447j 462= 476 END DOONEBUF 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 28 (TALON) F 15 offline tape driver 478 479 ********************************************************************************** 480 * * 481 * WRITETAPE writes a record onto tape (MT, CT, or VT). * 482 * It will attempt a reasonable number of retries on non- * 483 * fatal errors. * 484 * The record must exist in contiguous pages in virtual * 485 * memory and cannot exceed 12 pages for 9 track tape or VT, and * 486 * 4 and 1/2 pages minus 2 words for cartridge tape. * 487 * For NRZI 9 track tape format, records shorter than * 488 * 24 characters should not be written. * 489 * Call: * 490 * LD MTU ADR * 491 * CALL WRITETAPE * 492 * PARV * 493 * PARV * 494 * PARL ADR (must be a word address) * 495 * JMP * 496 * JMP * 497 * * 498 * * 499 * Returns error code in R0 * 500 * Eats R0:R3 * 501 * Leaves CIX unmapped * 502 * stack required = 8 * 503 * 4 + max ( DOWRITE (4), INTFUNC (2), LOGERROR (2), * 504 * SETUPNMAP (1), UNMAP (1), WRITEGAP (3) ) * 505 * * 506 ********************************************************************************** 507 508 WRITETAPE BLOCK 509 510 ENTRY WRITETAPE 511 512 BEGFRAME 00178801 6 BASE 513 LENGTH BSS 1 length of record to write 00178802 6 BASE 514 RECADDR BSS 1 address of the record 00178803 6 BASE 515 GAPFLAG BSS 1 indicates if should gap before retry 516 ENDFRAME 517 518 0113C DD1F8004 6 STAK 519 WRITETAPE ENTR PUSH 0113D C14012BB 520 STPV RECORDNUM save record number 0113E C1578801 6 BASE 521 STPV SP,LENGTH length of record to write (bytes) 0113F C0178802 6 BASE 522 STPL SP,RECADDR where the record is 01140 DC40126B 523 CALLNP SETUPNMAP do initial stuff 524 00001141 525 RETRYLOOP LABEL 01141 D1401802 526 STMW CIX(PPUSSSTAT) set status and DMA to output 527 01142 60938000 2 6 REG 528 LD R2 SP temp stack pointer for call 01143 DC001189 529 CALL DOWRITE do the write 01144 41568801 2 BASE 530 PARV R2,LENGTH the length 01145 40568802 2 BASE 531 PARVL R2,RECADDR the address 01146 FE0E114C 532 JMP WRITEERR error writing to tape 01147 FE0E1149 533 JMP TAPEEND end of tape reached 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 29 (TALON) F 15 offline tape driver 534 * \ / 00001148 535 NORMALBYE LABEL 01148 19C40001 7 IMM 536 ADD R7 1 advance for normal return 00001149 537 TAPEEND LABEL 01149 19C40001 7 IMM 538 ADD R7 1 tape end return is one less 0000114A 539 RETURN0 LABEL 0114A DC401279 540 CALLNP UNMAP unmap the controller 0114B 5D1F8004 6 STAK 541 LEAVE POP 542 * --- 543 0000114C 544 WRITEERR LABEL 0114C DC00128B 545 CALL LOGERROR log the error 0114D 40440013 IMM 546 PARVL ERTOPWRITE indicating a write operation 547 0114E EC178803 6 BASE 548 STZ SP,GAPFLAG say we don't want to gap 0114F F6841164 2 549 JBT R2/MTSTANER CONTROLERR check for controller error 00001150 550 CHEKPPU LABEL 01150 F6641153 1 551 JBT R1/PPUIDPPE RETRY retry if parity error 01151 F66A1153 1 552 JBT R1/PPUICONF RETRY retry if PPU is confused 01152 F2721162 1 553 JBF R1/PPUIBCNR REALBAD any other error not retryable 554 * \ / retry if byte count rollover not ready 00001153 555 RETRY LABEL 01153 D04012BA 556 DEC RETRYCOUNT indicate another retry attempt 01154 FE081162 557 JLT REALBAD cannot exceed our limit 01155 F294115B 2 558 JBF R2/MTSTTMFWB CHECKGAP if no forward motion see about gap 01156 F6921162 2 559 JBT R2/MTSTTMBKB REALBAD both bits on indicate lost controller 560 * \ / 561 01157 60040006 0 IMM 562 LD R0 MTFNBKSP backspace request 01158 DC401259 563 CALLNP INTFUNC before we write again 01159 DC00128B 564 CALL LOGERROR log backspace in error buffer 0115A 40440010 IMM 565 PARVL ERTOPBKSP indicate backspace 566 * \ / 0000115B 567 CHECKGAP LABEL 0115B 5C178803 6 BASE 568 CMZ SP,GAPFLAG should we do a gap? 0115C FE021141 569 JEQ RETRYLOOP if not then just try again 570 * \ / otherwise, write the gap first 0115D 60178801 0 6 BASE 571 LD R0 SP,LENGTH size of record 0115E DC0011DF 572 CALL WRITEGAP write the gap 0115F 40520000 0 REG 573 PARVL R0 how big the record is 01160 FE0E1162 574 JMP REALBAD couldn't even write a gap 01161 FE0E1141 575 JMP RETRYLOOP now try write again 576 * --- 577 00001162 578 REALBAD LABEL 01162 60040007 0 IMM 579 LD R0 TERRITE bad error 00001163 580 RETURNERR LABEL place to breakpoint any error 01163 FE0E114A 581 JMP RETURN0 582 * --- 583 584 00001164 585 CONTROLERR LABEL 01164 6004000C 0 IMM 586 LD R0 TERRWPRT assume write protected 01165 F6B81163 2 587 JBT R2/MTDSTWPRT RETURNERR jump if a good guess 01166 F6A01153 2 588 JBT R2/MTSTDPPE RETRY retry data path parity errors 01167 600A9650 0 2 CBM 589 LD R0 R2/MTSTERSTAT get the error status bits 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 30 (TALON) F 15 offline tape driver 01168 FA021177 0 590 JEQZ R0 NOCONTERR if error code of zero then no error 01169 60D70802 3 4 BASE 591 LD R3 MTU,TPCBTRACK check tape type (-1 sez 9 trk) 0116A FAC6117A 3 592 JGEZ R3 CARTRIDGE jump out if CT 0116B FAEC1170 3 593 JEQMW R3 NINETRACK jump out if MT 594 * \ / through here for VT 595 0116C 50040016 0 IMM 596 MIN R0 VTERRMAX+1 if higher than max use fatal error code 0116D 60301188 0 0 @ 597 LD R0 @VTERRPTR(R0) find out what to do about the error 0116E FA021153 0 598 JEQZ R0 RETRY 0 => try again 0116F FE0E1162 599 JMP REALBAD return bad error 600 * --- 601 00001170 602 NINETRACK LABEL 01170 004400C8 IMM 603 WAIT 200 wait a bit before backspacing 01171 5004001B 0 IMM 604 MIN R0 MTERRMAX+1 if higher than max use fatal error code 01172 60301182 0 0 @ 605 LD R0 @MTERRPTR(R0) find out what to do about the error 01173 FA021153 0 606 JEQZ R0 RETRY 0 => try again 01174 EDD78803 6 BASE 607 STW SP,GAPFLAG indicate we want a gap 01175 F63E1153 0 608 JBT R0/GAPRTRY RETRY write a gap and retry 01176 FE0E1162 609 JMP REALBAD return bad error 610 * --- 611 00001177 612 NOCONTERR LABEL 01177 78446540 1 IMM 613 AND R1 PPUMASK isolate the PPU error bits 01178 FA421148 1 614 JEQZ R1 NORMALBYE if no PPU error then just leave 01179 FE0E1150 615 JMP CHEKPPU 616 * --- 617 0000117A 618 CARTRIDGE LABEL 0117A 5004001A 0 IMM 619 MIN R0 CTERRMAX+1 if higher than max use fatal error code 0117B 60301185 0 0 @ 620 LD R0 @CTERRPTR(R0) find out what to do about the error 0117C FA021153 0 621 JEQZ R0 RETRY 0 => try again 0117D EDD78803 6 BASE 622 STW SP,GAPFLAG indicate we want a gap 0117E F63E1153 0 623 JBT R0/GAPRTRY RETRY write a gap and retry 0117F FE0E1162 624 JMP REALBAD return bad error 625 * --- 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 31 (TALON) F 15 offline tape driver 627 628 ********************************************************************************** 629 * * 630 * These tables are used to determine what to do about * 631 * controller errors. They are indexed by the error code * 632 * returned from the controller. There are separate tables * 633 * for 9 track tape, cartridge tape, and video tape since * 634 * their controllers return different error codes. * 635 * Any error considered fatal indicates a hardware * 636 * problem of some sort, either tape, drive, or driver, * 637 * and is serious enough to abort the process doing the * 638 * write. * 639 * The codes in the following table are: * 640 * 0 = retry * 641 * 1 = write a gap and retry * 642 * 2 = fatal error * 643 * * 644 ********************************************************************************** 645 00003E10 BYTE 646 GAPRTRY EQU BIT 31 bit indicating gap and retry 647 648 * Codes for MT (Rev 5 u-code) 0117F 00000000 649 MTERRTAB VFDB 2:0 00 - no error 0117F 00000000 650 VFDB 2:0 01 - multi-track (hard) error reading PE data 0117F 00000000 651 VFDB 2:0 02 - vertical parity error reading PE data 0117F 00000000 652 VFDB 2:0 03 - vertical parity error reading NRZI data 0117F 00000000 653 VFDB 2:0 04 - crc error reading NRZI data 0117F 00000000 654 VFDB 2:0 05 - lrc error reading NRZI data 0117F 00000000 655 VFDB 2:0 06 - no rdr while attempting to read data 0117F 00000000 656 VFDB 2:0 07 - rate error while reading data 0117F 00000000 657 VFDB 2:0 08 - rate error while writing data 0117F 00000001 658 VFDB 2:1 09 - multi-track error writing PE data 0117F 00000001 659 VFDB 2:1 0A - vertical parity error writing PE data 0117F 00000001 660 VFDB 2:1 0B - vertical parity error writing NRZI data 0117F 00000001 661 VFDB 2:1 0C - crc error writing NRZI data 0117F 00000001 662 VFDB 2:1 0D - lrc error writing NRZI data 0117F 00000000 663 VFDB 2:0 0E - bad checksum in string from PPU 01180 00000002 664 VFDB 2:2 0F - drive not ready for requested operation 01180 00000002 665 VFDB 2:2 10 - unrecognized command 01180 00000002 666 VFDB 2:2 11 - illegal command with tape at EOT/BOT 01180 00000000 667 VFDB 2:0 12 - data after write count exhausted 01180 00000002 668 VFDB 2:2 13 - bad filemark read or written 01180 00000000 669 VFDB 2:0 14 - bad phase encoded ID zone 01180 00000002 670 VFDB 2:2 15 - timeout: 80 inches of blank tape read 01180 00000000 671 VFDB 2:0 16 - spurious NAK from PPU 01180 00000000 672 VFDB 2:0 17 - bad first byte (not 96 or 62) 01180 00000000 673 VFDB 2:0 18 - data path parity error 01180 00000000 674 VFDB 2:0 19 - timeout on PPU data path 0000001A ABS 675 MTERRMAX EQU (DISPB MTERRTAB)/2 max error codes 01180 00000002 676 VFDB 2:2 fatal error if exceeds max 01182 00881180 677 MTERRPTR PTR MTERRTAB 678 01182 00000000 679 CTERRTAB VFDB 2:0 00 - no error 01182 00000002 680 VFDB 2:2 01 - illegal drive 01182 00000002 681 VFDB 2:2 02 - illegal store 01182 00000002 682 VFDB 2:2 03 - illegal track 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 32 (TALON) F 15 offline tape driver 01182 00000002 683 VFDB 2:2 04 - illegal tape motion 01182 00000000 684 VFDB 2:0 05 - no go byte 01182 00000002 685 VFDB 2:2 06 - timeout during FF or rewind 01182 00000002 686 VFDB 2:2 07 - offline during FF or rewind or write gap 01182 00000002 687 VFDB 2:2 08 - load point hole late 01182 00000001 688 VFDB 2:1 09 - sync zone late 01182 00000001 689 VFDB 2:1 0A - IRG found when not expecting it 01182 00000001 690 VFDB 2:1 0B - dropout during write 01182 00000001 691 VFDB 2:1 0C - ID zone late 01182 00000001 692 VFDB 2:1 0D - leading ID zone bad 01182 00000001 693 VFDB 2:1 0E - word count CRC bad 01183 00000001 694 VFDB 2:1 0F - data CRC bad (MFM mode only) 01183 00000001 695 VFDB 2:1 10 - reverse word count check bad (GCR mode only) 01183 00000001 696 VFDB 2:1 11 - trailing ID zone bad 01183 00000001 697 VFDB 2:1 12 - trailing sync zone bad 01183 00000001 698 VFDB 2:1 13 - GCR byte count not match blockette number 01183 00000001 699 VFDB 2:1 14 - GCR record not recoverable / write error 01183 00000001 700 VFDB 2:1 15 - GCR read not all right but recoverable 01183 00000001 701 VFDB 2:1 16 - GCR record not recoverable 01183 00000002 702 VFDB 2:2 17 - EOT caused some other error to be detected 01183 00000002 703 VFDB 2:2 18 - BOT caused some other error to be detected 00000019 ABS 704 CTERRMAX EQU (DISPB CTERRTAB)/2 max error codes 01183 00000002 705 VFDB 2:2 fatal error if exceeds max 01185 00881183 706 CTERRPTR PTR CTERRTAB 707 01185 00000000 708 VTERRTAB VFDB 2:0 00 - no error 01185 00000002 709 VFDB 2:2 01 - (unused, hardware error) 01185 00000002 710 VFDB 2:2 02 - unit not ready 01185 00000002 711 VFDB 2:2 03 - bad tape or EOT/BOT 01185 00000002 712 VFDB 2:2 04 - tape unit self test failure 01185 00000002 713 VFDB 2:2 05 - illegal request 01185 00000002 714 VFDB 2:2 06 - reset or cartridge change 01185 00000002 715 VFDB 2:2 07 - write protected cartridge 01185 00000002 716 VFDB 2:2 08 - blank tape during read 01185 00000002 717 VFDB 2:2 09 - illegal operation 01185 00000002 718 VFDB 2:2 0A - (unused, copy aborted) 01185 00000002 719 VFDB 2:2 0B - command aborted 01185 00000002 720 VFDB 2:2 0C - (unused) 01185 00000002 721 VFDB 2:2 0D - EOT encountered during write 01185 00000002 722 VFDB 2:2 0E - (unused) 01186 00000002 723 VFDB 2:2 0F - (reserved) 01186 00000002 724 VFDB 2:2 10 - (unused) 01186 00000002 725 VFDB 2:2 11 - tape not present 01186 00000002 726 VFDB 2:2 12 - power failure 01186 00000002 727 VFDB 2:2 13 - bad command from PPU 01186 00000002 728 VFDB 2:2 14 - bad data from tape unit 00000015 ABS 729 VTERRMAX EQU (DISPB VTERRTAB)/2 max error codes 01186 00000002 730 VFDB 2:2 fatal error if exceeds max 01188 00881186 731 VTERRPTR PTR VTERRTAB 732 CARTRIDGE 0000117A F 15 592j 618= CHECKGAP 0000115B F 15 558j 567= CHEKPPU 00001150 F 15 550= 615j CONTROLERR 00001164 F 15 549j 585= CTERRMAX 00000019 F 15 619 704= CTERRPTR 00001185 F 15 620 706= 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 33 (TALON) F 15 offline tape driver CTERRTAB 00801183 F 15 679= 704e 706a +DOWRITE UUUUUUUU F 15 529 GAPFLAG 00178803 F 15 515= 548s 568 607s 622s GAPRTRY 00003E10 F 15 608j 623j 646= +INTFUNC UUUUUUUU F 15 563 LENGTH 00178801 F 15 513= 521s 530 571 +LOGERROR UUUUUUUU F 15 545 564 MTERRMAX 0000001A F 15 604 675= MTERRPTR 00001182 F 15 605 677= MTERRTAB 00801180 F 15 649= 675e 677a +MTU 00130000 F 15 591 NINETRACK 00001170 F 15 593j 602= NOCONTERR 00001177 F 15 590j 612= NORMALBYE 00001148 F 15 535= 614j +PPUMASK 00006540 F 15 613 REALBAD 00001162 F 15 553j 557j 559j 574j 578= 599j 609j 624j RECADDR 00178802 F 15 514= 522s 531 +RECORDNUM UUUUUUUU F 15 520s RETRY 00001153 F 15 551j 552j 555= 588j 598j 606j 608j 621j 623j +RETRYCOUNT UUUUUUUU F 15 556s RETRYLOOP 00001141 F 15 525= 569j 575j RETURN0 0000114A F 15 539= 581j RETURNERR 00001163 F 15 580= 587j +SETUPNMAP UUUUUUUU F 15 523 TAPEEND 00001149 F 15 533j 537= +UNMAP UUUUUUUU F 15 540 VTERRMAX 00000015 F 15 596 729= VTERRPTR 00001188 F 15 597 731= VTERRTAB 00801186 F 15 708= 729e 731a WRITEERR 0000114C F 15 532j 544= +WRITEGAP UUUUUUUU F 15 572 +WRITETAPE 0000113C F 15 510 519= 733 END WRITETAPE 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 34 (TALON) F 15 offline tape driver 735 736 ********************************************************************************** 737 * * 738 * DOWRITE writes a record onto tape. The record must * 739 * exist on contiguous virtual pages in memory and start on * 740 * a word boundary. The write will start at the address * 741 * given and continue to write to tape until the byte count * 742 * is exhausted. * 743 * Call: * 744 * PPU mapped into CIX, all status bits set * 745 * LD MTU ADR * 746 * CALL DOWRITE * 747 * PARV * 748 * PARVL ADR must be a word address * 749 * JMP error * 750 * JMP end of tape * 751 * * 752 * Returns R0 = masked PPU status (error bits only) * 753 * R1 = unmasked PPU status * 754 * R2 = controller status * 755 * Eats R0:R3 * 756 * stack required = 4 * 757 * * 758 ********************************************************************************** 759 760 DOWRITE BLOCK 761 762 ENTRY DOWRITE 763 764 BEGFRAME 00178801 6 BASE 765 LENGTH BSS 1 length of record to write 00178802 6 BASE 766 ADDRREC BSS 1 address of record 00178803 6 BASE 767 COUNT BSS 1 count of bytes remaining to write 768 ENDFRAME 769 01189 DD1F8004 6 STAK 770 DOWRITE ENTR PUSH 0118A C1578801 6 BASE 771 STPV SP,LENGTH length of record to write 0118B C0578802 6 BASE 772 STPVL SP,ADDRREC address of the record 773 774 ********************************************************************************** 775 * * 776 * Special code to allow testing on a PPU that does double * 777 * word reads and erroneously reports memory parity errors for * 778 * an unused second word. * 779 * The special code extends to the line of *s. * 780 * It uses only COUNT as a temporary variable and needs no special * 781 * variables or labels other than this short block of code. * 782 * * 783 ********************************************************************************** 784 0118C 60578802 1 6 BASE 785 LD R1 SP,ADDRREC pick up the virtual starting address 0118D 184981E1 1 6 ZBM 786 ADD R1 SP,LENGTH/BITS 0:29 add on the word length 787 * creating the first word past end 788 * (all writes in DTT are whole word) 0118E F27E119C 1 789 JBF R1/BIT 31 NOPROB skip all this if even address 0118F 60CA5E70 3 1 CBM 790 LD PFPTR R1/FLDPAGE extract the page number 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 35 (TALON) F 15 offline tape driver 01190 7CC40080 3 IMM 791 IOR PFPTR MONPF make monitor page number 01191 80920000 0 REG 792 PFRD R0 get the page file contents 01192 E40A54C0 0 1 CBM 793 ST R0 R1/FLDABSPG make relative physical page 01193 E44A1560 1 0 CBM 794 ST R1 R0/PAGEANDISP put in with the page offset 01194 604A0080 1 0 CBM 795 LD R1 R0/BITS 0:7 isolate the slot number 01195 2803FE00 0 IMM 796 BSUB R0 0FF000000 remove the slot number 01196 7C024000 0 IMM 797 IOR R0 020000000 and insert a read command 01197 E4178803 0 6 BASE 798 ST R0 SP,COUNT save the command word temporarily 01198 0C120000 0 REG 799 LDFB R0 and do the read 01199 FE14119C 800 JOC NOPROB jump if the word came back okay 0119A 60099183 0 6 ZBM 801 LD R0 SP,COUNT/BITS 8:31 pick up the command word, dropping read command 0119B 0C520000 0 REG 802 STTB R0 use command word as data too 0000119C 803 NOPROB LABEL 804 *************************************************************************** 805 0119C 60578802 1 6 BASE 806 LD R1 SP,ADDRREC get the address 0119D 60CA5E70 3 1 CBM 807 LD PFPTR R1/FLDPAGE extract virtual page number 0119E 7CC40080 3 IMM 808 IOR PFPTR MONPF keep in monitor memory 0119F 80920000 0 REG 809 PFRD R0 get the page file contents 011A0 E40A54C0 0 1 CBM 810 ST R0 R1/FLDABSPG make relative physical page 011A1 E44A1560 1 0 CBM 811 ST R1 R0/PAGEANDISP put in with the page offset 011A2 E4001805 0 812 ST R0 CIX(PPUADDR1) store starting address of record 813 011A3 6049ACA2 1 6 ZBM 814 LD R1 SP,ADDRREC/DISPFIELD records displacement on page 011A4 30440400 1 IMM 815 RSB R1 WPP see how many words are left on page 011A5 1C440004 1 IMM 816 MUL R1 CPW convert to char count 011A6 50578801 1 6 BASE 817 MIN R1 SP,LENGTH in case it doesn't go to page boundary 011A7 60978801 2 6 BASE 818 LD R2 SP,LENGTH get the total write's length 011A8 10924000 2 1 REG 819 SUB R2 R1 subtract bytes in first block 011A9 FA8C11AC 2 820 JNEZ R2 MORETHAN1 not 0, then more than one page 821 * \ / 011AA 7C448000 1 IMM 822 IOR R1 1*PPUCLAST say first byte count is last 011AB FE0E11B9 823 JMP JUSTONE just one page to write 824 * --- 825 000011AC 826 MORETHAN1 LABEL 011AC E4978803 2 6 BASE 827 ST R2 SP,COUNT current count 011AD 60840000 2 IMM 828 LD R2 0 we want zero offset into the page 011AE 18C40001 3 IMM 829 ADD PFPTR 1 move to next virtual page 011AF 80920000 0 REG 830 PFRD R0 get the page file contents 011B0 E40A94C0 0 2 CBM 831 ST R0 R2/FLDABSPG make relative physical page 011B1 E48A1560 2 0 CBM 832 ST R2 R0/PAGEANDISP put in with the page offset 011B2 E4001807 0 833 ST R0 CIX(PPUADDR2) store as address of next block 834 011B3 60841000 2 IMM 835 LD R2 CPP second byte count 011B4 50978803 2 6 BASE 836 MIN R2 SP,COUNT can't exceed remaining count 011B5 B0978803 2 6 BASE 837 RSBM R2 SP,COUNT and account for these 011B6 FE0C11B8 838 JNE NOTLAST if zero then set last byte count flag 839 * \ / 011B7 7C848000 2 IMM 840 IOR R2 1*PPUCLAST say last byte count 000011B8 841 NOTLAST LABEL 011B8 E4801806 2 842 ST R2 CIX(PPUCNT2) set second block's byte count 843 * \ / 000011B9 844 JUSTONE LABEL 011B9 60178801 0 6 BASE 845 LD R0 SP,LENGTH get the total length of this write 011BA 60970801 2 4 BASE 846 LD R2 R4,TPCBUNIT get the tape unit number 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 36 (TALON) F 15 offline tape driver 011BB E4401804 1 847 ST R1 CIX(PPUCNT1) set first block's byte count 011BC E4241AD8 0 2 848 ST R0 CIX(MTCMWRITE+MTINTREQ+MTSELECT+R2) start things going 849 * \ / 000011BD 850 WRITELOOP LABEL 011BD 6004C350 0 IMM 851 LD R0 50000 50 second dead man timer (1 ms units) 000011BE 852 ROLLWAIT LABEL 011BE 00440064 IMM 853 WAIT 100 wait 1 msecs 854 * \ / 011BF 60401801 1 855 LD R1 CIX(PPUINTSTAT) get the status 011C0 F67811C4 1 856 JBT R1/PPUIINTC ENDWAIT jump if controller interrupt (done) 011C1 F67611D0 1 857 JBT R1/PPUIROLL ROLLOVER or if rollover interrupt request 000011C2 858 ROLLCOUNT LABEL 011C2 FA2611BE 0 859 JDR R0 ROLLWAIT go wait for the roll over 860 * \ / 011C3 D1524000 1 REG 861 STMW R1 indicate massive error on fall through 000011C4 862 ENDWAIT LABEL 011C4 60124000 0 1 REG 863 LD R0 R1 copy status 011C5 78046540 0 IMM 864 AND R0 PPUMASK just keep error bits 011C6 60801802 2 865 LD R2 CIX(PPUCHANS1) get controller status 011C7 FA0C11CD 0 866 JNEZ R0 DOPRESET if non-zero, error happened 011C8 F68411CF 2 867 JBT R2/MTSTANER ERRSPOT jump if controller error 011C9 F6B211CC 2 868 JBT R2/MTDSTEOT ENDTAPE check for EOT warning 011CA 19C40002 7 IMM 869 ADD R7 2 advance beyond error return 011CB 5D1F8004 6 STAK 870 RETURN0 LEAVE POP 871 * --- 872 011CC FBE011CB 7 873 ENDTAPE IRJ R7 RETURN0 advance to end of tape return 874 * --- 875 000011CD 876 DOPRESET LABEL 011CD EC001801 877 STZ CIX(PPUABORT) clean up channel 011CE 00420008 IMM 878 WAIT CATCHWAIT wait for controller to catch up 000011CF 879 ERRSPOT LABEL 011CF 5D1F8004 6 STAK 880 LEAVE POP separate leave so we can breakpoint 881 * --- 882 000011D0 883 ROLLOVER LABEL 011D0 5C178803 6 BASE 884 CMZ SP,COUNT see if we are done with byte counts 011D1 FE0211C2 885 JEQ ROLLCOUNT if so just wait for controller completion 886 * \ / 011D2 60440000 1 IMM 887 LD R1 0 we want zero offset into the page 011D3 18C40001 3 IMM 888 ADD PFPTR 1 move to next virtual page 011D4 80920000 0 REG 889 PFRD R0 get the page file contents 011D5 E40A54C0 0 1 CBM 890 ST R0 R1/FLDABSPG make relative physical page 011D6 E44A1560 1 0 CBM 891 ST R1 R0/PAGEANDISP put in with the page offset 011D7 E4001807 0 892 ST R0 CIX(PPUADDR2) store as address of next block 893 011D8 60578803 1 6 BASE 894 LD R1 SP,COUNT get remaining length 011D9 50441000 1 IMM 895 MIN R1 CPP one block max 011DA B0578803 1 6 BASE 896 RSBM R1 SP,COUNT keep track of how much we have written 011DB FE0C11DD 897 JNE STILLMORE if not zero, then don't set last count bit 898 * \ / 011DC 7C448000 1 IMM 899 IOR R1 1*PPUCLAST say last byte count 000011DD 900 STILLMORE LABEL 011DD E4401806 1 901 ST R1 CIX(PPUCNT2) store for this page 011DE FE0E11BD 902 JMP WRITELOOP 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 37 (TALON) F 15 offline tape driver 903 * --- 904 ADDRREC 00178802 F 15 766= 772s 785 806 814 +CATCHWAIT 00040000 F 15 878 COUNT 00178803 F 15 767= 798s 801 827s 836 837s 884 894 896s DOPRESET 000011CD F 15 866j 876= +DOWRITE 00001189 F 15 762 770= ENDTAPE 000011CC F 15 868j 873= ENDWAIT 000011C4 F 15 856j 862= ERRSPOT 000011CF F 15 867j 879= JUSTONE 000011B9 F 15 823j 844= LENGTH 00178801 F 15 765= 771s 786 817 818 845 MORETHAN1 000011AC F 15 820j 826= NOPROB 0000119C F 15 789j 800j 803= NOTLAST 000011B8 F 15 838j 841= +PPUMASK 00006540 F 15 864 RETURN0 000011CB F 15 870= 873j ROLLCOUNT 000011C2 F 15 858= 885j ROLLOVER 000011D0 F 15 857j 883= ROLLWAIT 000011BE F 15 852= 859j STILLMORE 000011DD F 15 897j 900= WRITELOOP 000011BD F 15 850= 902j 905 END DOWRITE 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 38 (TALON) F 15 offline tape driver 907 908 ********************************************************************************** 909 * * 910 * WRITEGAP writes a gap onto the tape. The length of the * 911 * gap is calculated from the size of the record being written. * 912 * The gap will be approximately 1/3 the length of the * 913 * original record. This is all irrelevant for 9-track tape * 914 * since the 9-track controller will only write 3 inch gaps. * 915 * A reasonable number of retries will be attempted. * 916 * This routine is for internal use only, as it does not * 917 * map in the tape controller. * 918 * Call: * 919 * PPU mapped into CIX * 920 * LD R4 ADR * 921 * CALL WRITEGAP * 922 * PARVL record size (in chars) * 923 * JMP error * 924 * Returns PPU status in R1, Channel status in R2 * 925 * Eats R0:R2 * 926 * stack required = 4 * 927 * 3 + MAX ( LOGERROR (2), PPUIWAIT (1) ) * 928 * * 929 ********************************************************************************** 930 931 WRITEGAP BLOCK 932 933 ENTRY WRITEGAP 934 935 BEGFRAME 00178801 6 BASE 936 TRYCOUNT BSS 1 counter for error retries 00178802 6 BASE 937 GAPSIZE BSS 1 size of gap 938 ENDFRAME 939 011DF DD1F8003 6 STAK 940 WRITEGAP ENTR PUSH 011E0 C0528000 2 REG 941 STPVL R2 save the record size 011E1 14840960 2 IMM 942 DIV R2 2400 since there are 800 chars to inch 011E2 18840001 2 IMM 943 ADD R2 1 add an extra inch to round up 011E3 E4978802 2 6 BASE 944 ST R2 SP,GAPSIZE save for retry 011E4 60040014 0 IMM 945 LD R0 TAPEERRMAX counter for error retries 011E5 E4178801 0 6 BASE 946 ST R0 SP,TRYCOUNT set up our counter 947 * \ / 948 000011E6 949 GAPLOOP LABEL 011E6 60170801 0 4 BASE 950 LD R0 MTU,TPCBUNIT unit number of drive 011E7 60978802 2 6 BASE 951 LD R2 SP,GAPSIZE get the gap size 011E8 E4A01AE8 2 0 952 ST R2 CIX(MTCMERASE+MTINTREQ+MTSELECT+R0) start things going 953 011E9 DC00127D 954 CALL PPUIWAIT call to wait for operation complete 011EA 40440064 IMM 955 PARVL 100 wait for up to 1 second 011EB FA0C11F3 0 956 JNEZ R0 GAPERROR jump if PPU error 011EC F28411F2 2 957 JBF R2/MTSTANER GAPLEAVE no error, let's leave 011ED F2B411F3 2 958 JBF R2/MTDSTRDY GAPERROR big error, it's offline 011EE F6B811F3 2 959 JBT R2/MTDSTWPRT GAPERROR error, it's writeprotected 960 * \ / 011EF D0578801 6 BASE 961 DEC SP,TRYCOUNT we have tried again and failed 011F0 FE0611E6 962 JGE GAPLOOP if above or equal to zero we can try again 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 39 (TALON) F 15 offline tape driver 011F1 FE0E11F3 963 JMP GAPERROR out of tries 964 * --- 965 000011F2 966 GAPLEAVE LABEL 011F2 19C40001 7 IMM 967 ADD R7 1 good return 000011F3 968 GAPERROR LABEL bad return 011F3 DC00128B 969 CALL LOGERROR log the gap operation in error buffer 011F4 40440016 IMM 970 PARVL ERTOPGAP indicate it's a gap operation 011F5 5D1F8003 6 STAK 971 LEAVE POP 972 * --- 973 GAPERROR 000011F3 F 15 956j 958j 959j 963j 968= GAPLEAVE 000011F2 F 15 957j 966= GAPLOOP 000011E6 F 15 949= 962j GAPSIZE 00178802 F 15 937= 944s 951 +LOGERROR UUUUUUUU F 15 969 +MTU 00130000 F 15 950 +PPUIWAIT UUUUUUUU F 15 954 +TAPEERRMAX 00000014 F 15 945 TRYCOUNT 00178801 F 15 936= 946s 961s +WRITEGAP 000011DF F 15 933 940= 974 END WRITEGAP 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 40 (TALON) F 15 offline tape driver 976 977 ********************************************************************************** 978 * * 979 * WRITEFM * 980 * * 981 * Routine to write a file mark to tape with error recovery. * 982 * We will try a reasonable number of times to write a file mark. * 983 * * 984 * Call: * 985 * LD R4 ADR tape control block * 986 * CALLNP WRITEFM * 987 * JMP could not do it * 988 * * 989 * Leaves CIX unmapped. * 990 * Eats R0:R3 * 991 * stack required = 4 * 992 * 1 + max ( INTFUNC (2), LOGERROR (2), SETUPNMAP (1), * 993 * UNMAP (1), WRITEGAP (3) ) * 994 * * 995 ********************************************************************************** 996 997 WRITEFM BLOCK 998 999 ENTRY WRITEFM 1000 1001 BEGFRAME 1002 ENDFRAME 1003 011F6 DD5F8001 6 STAK 1004 WRITEFM ENTRNP PUSH 011F7 DC40126B 1005 CALLNP SETUPNMAP do initial stuff 1006 000011F8 1007 RETRYLOOP LABEL 011F8 60040018 0 IMM 1008 LD R0 MTFNWFM code for write file mark 011F9 DC401259 1009 CALLNP INTFUNC write the file mark 011FA FA0C11FF 0 1010 JNEZ R0 FILEMERR PPU error 011FB F68411FF 2 1011 JBT R2/MTSTANER FILEMERR controller error 011FC 19C40001 7 IMM 1012 ADD R7 1 good return 000011FD 1013 FATALERR LABEL 011FD DC401279 1014 CALLNP UNMAP unmap the controller 011FE 5D1F8001 6 STAK 1015 LEAVE POP 1016 * --- 1017 000011FF 1018 FILEMERR LABEL 011FF DC00128B 1019 CALL LOGERROR log the error 01200 40440014 IMM 1020 PARVL ERTOPWFM indicate during WFM 01201 D04012BA 1021 DEC RETRYCOUNT one more retry 01202 FE0811FD 1022 JLT FATALERR out of chances 01203 60040006 0 IMM 1023 LD R0 MTFNBKSP back space 01204 DC401259 1024 CALLNP INTFUNC ignore any error 01205 DC00128B 1025 CALL LOGERROR log backspace in error buffer 01206 40440010 IMM 1026 PARVL ERTOPBKSP indicate backspace 01207 DC0011DF 1027 CALL WRITEGAP now write a gap 01208 40440000 IMM 1028 PARVL 0 record size (not much to a file mark) 01209 FE0E11FD 1029 JMP FATALERR if we could not write the gap 0120A FE0E11F8 1030 JMP RETRYLOOP try again 1031 * --- 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 41 (TALON) F 15 offline tape driver 1032 FATALERR 000011FD F 15 1013= 1022j 1029j FILEMERR 000011FF F 15 1010j 1011j 1018= +INTFUNC UUUUUUUU F 15 1009 1024 +LOGERROR UUUUUUUU F 15 1019 1025 +RETRYCOUNT UUUUUUUU F 15 1021s RETRYLOOP 000011F8 F 15 1007= 1030j +SETUPNMAP UUUUUUUU F 15 1005 +UNMAP UUUUUUUU F 15 1014 +WRITEFM 000011F6 F 15 999 1004= +WRITEGAP 000011DF F 15 1027 1033 END WRITEFM 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 42 (TALON) F 15 offline tape driver 1035 1036 ********************************************************************************** 1037 * * 1038 * SETTAPE * 1039 * This routine will select a track (if CT), and do a rewind. * 1040 * * 1041 * LD MTU => tape control block * 1042 * CALLNP SETTAPE * 1043 * ST R0 error code (0 if ok) * 1044 * Sets R0, Eats R1:R3. * 1045 * stack required = 6 * 1046 * 1 + MAX( REWIND (3), TAPEFUNC (3) ) * 1047 * * 1048 ********************************************************************************** 1049 1050 SETTAPE BLOCK 1051 ENTRY SETTAPE 1052 1053 BEGFRAME 1054 ENDFRAME 1055 0120B DD5F8001 6 STAK 1056 SETTAPE ENTRNP PUSH 0120C 60970802 2 4 BASE 1057 LD R2 MTU,TPCBTRACK load track number for CTC 0120D FA881210 2 1058 JLTZ R2 TRAKOK jump if nine-track - all ok 1059 * \ / 0120E 60169010 0 2 REG 1060 LD R0 MTFNTRSEL+R2 track select op code 0120F DC401260 1061 CALLNP TAPEFUNC 1062 00001210 1063 TRAKOK LABEL 01210 DC401212 1064 CALLNP REWIND rewind the drive 01211 5D1F8001 6 STAK 1065 LEAVE PUSH 1066 * --- 1067 +MTU 00130000 F 15 1057 +REWIND UUUUUUUU F 15 1064 +SETTAPE 0000120B F 15 1051 1056= +TAPEFUNC UUUUUUUU F 15 1061 TRAKOK 00001210 F 15 1058j 1063= 1068 END SETTAPE routine 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 43 (TALON) F 15 offline tape driver 1070 1071 ********************************************************************************** 1072 * * 1073 * REWIND * 1074 * This routine will do a rewind on the tape drive. * 1075 * Call: * 1076 * MTU => tape control block * 1077 * CALLNP REWIND * 1078 * R0 = error code * 1079 * Sets R0, Eats R1:R3. * 1080 * stack required = 3 * 1081 * 1 + MAX ( LONGFUNC (2), LOGERROR (2), PPUIWAIT (1), * 1082 * SETUPNMAP (1), UNMAP (1) ) * 1083 * * 1084 ********************************************************************************** 1085 1086 REWIND BLOCK 1087 ENTRY REWIND 1088 1089 BEGFRAME 1090 ENDFRAME 1091 01212 DD5F8001 6 STAK 1092 REWIND ENTRNP PUSH 01213 DC40126B 1093 CALLNP SETUPNMAP do initial stuff 00001214 1094 REWRETRY LABEL 01214 60040002 0 IMM 1095 LD R0 MTFNREWIND rewind op-code 01215 DC401256 1096 CALLNP LONGFUNC do the rewind 01216 FA0C1222 0 1097 JNEZ R0 REWERR jump if PPU is un-happy 01217 F6841222 2 1098 JBT R2/MTSTANER REWERR jump if problems 1099 * \ / 1100 1101 ********************************************************************************** 1102 * When we get here the CTC will always be at BOT, since he will * 1103 * interrupt us when he is done with the rewind. The 9-track * 1104 * may not be at BOT in which case we will have to set up an * 1105 * interrupt on state change to wait for the rewind to complete. * 1106 ********************************************************************************** 1107 1108 * \ / 01218 F6B6121F 2 1109 JBT R2/MTDSTBOT REWOK jump if at BOT 1110 01219 60040009 0 IMM 1111 LD R0 MTFNDSCION state change interrupt enable code 0121A E4001A30 0 1112 ST R0 CIX(MTCMFUNC) enable the state change 1113 0121B DC00127D 1114 CALL PPUIWAIT wait for 9-track rewind to complete 0121C 40447530 IMM 1115 PARVL 30000 wait max of five minutes 1116 0121D FA0C1222 0 1117 JNEZ R0 REWERR jump if PPU is un-happy 0121E F6841222 2 1118 JBT R2/MTSTANER REWERR jump if problems 0000121F 1119 REWOK LABEL 0121F EC120000 0 REG 1120 STZ R0 get the all-clear code 00001220 1121 REWEXIT LABEL 01220 DC401279 1122 CALLNP UNMAP unmap the controller 01221 5D1F8001 6 STAK 1123 LEAVE POP 1124 * --- 1125 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 44 (TALON) F 15 offline tape driver 00001222 1126 REWERR LABEL 01222 DC00128B 1127 CALL LOGERROR log the error 01223 40440011 IMM 1128 PARVL ERTOPREW indicate during REW 01224 F6B6121F 2 1129 JBT R2/MTDSTBOT REWOK all ok if at front of tape 01225 60040006 0 IMM 1130 LD R0 TERRDNR drive not ready? 01226 F2B41220 2 1131 JBF R2/MTDSTRDY REWEXIT exit if that was the error 01227 D04012BA 1132 DEC RETRYCOUNT see if we should try again 01228 FE061214 1133 JGE REWRETRY go give it another chance 01229 60040007 0 IMM 1134 LD R0 TERRITE say it's irrecoverable 0122A FE0E1220 1135 JMP REWEXIT and return the bad news 1136 * --- 1137 +LOGERROR UUUUUUUU F 15 1127 +LONGFUNC UUUUUUUU F 15 1096 +PPUIWAIT UUUUUUUU F 15 1114 +RETRYCOUNT UUUUUUUU F 15 1132s REWERR 00001222 F 15 1097j 1098j 1117j 1118j 1126= REWEXIT 00001220 F 15 1121= 1131j 1135j +REWIND 00001212 F 15 1087 1092= REWOK 0000121F F 15 1109j 1119= 1129j REWRETRY 00001214 F 15 1094= 1133j +SETUPNMAP UUUUUUUU F 15 1093 +UNMAP UUUUUUUU F 15 1122 1138 END REWIND 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 45 (TALON) F 15 offline tape driver 1140 1141 ********************************************************************************** 1142 * * 1143 * SEFF * 1144 * This routine will search forward past the next * 1145 * file mark on the tape. * 1146 * Call: * 1147 * LD MTU => tape control block * 1148 * CALLNP SEFF * 1149 * ST R0 error code (0 if ok) * 1150 * Sets R0, Eats R1:R2. * 1151 * stack required = 3 * 1152 * 1 + MAX ( INTFUNC (2), LONGFUNC (2), LOGERROR (2), * 1153 * SETUPNMAP (1), UNMAP (1) ) * 1154 * * 1155 ********************************************************************************** 1156 1157 SEFF BLOCK 1158 ENTRY SEFF 1159 1160 BEGFRAME 1161 ENDFRAME 1162 0122B DD5F8001 6 STAK 1163 SEFF ENTRNP PUSH 0122C DC40126B 1164 CALLNP SETUPNMAP do initial stuff 0000122D 1165 RETRYLOOP LABEL 0122D 60040005 0 IMM 1166 LD R0 MTFNSEFF seek EOF forward opcode 0122E DC401256 1167 CALLNP LONGFUNC do operation 0122F FA0C1234 0 1168 JNEZ R0 SEFFERR jump on PPU error 01230 F6841234 2 1169 JBT R2/MTSTANER SEFFERR jump on controller error 01231 EC120000 0 REG 1170 STZ R0 say all is ok 00001232 1171 SEFFEXIT LABEL 01232 DC401279 1172 CALLNP UNMAP unmap the controller 01233 5D1F8001 6 STAK 1173 LEAVE POP 1174 * --- 1175 00001234 1176 SEFFERR LABEL 01234 DC00128B 1177 CALL LOGERROR log the error 01235 40440015 IMM 1178 PARVL ERTOPSEFF indicate during SEFF 01236 60040006 0 IMM 1179 LD R0 TERRDNR assume drive not ready 01237 F2B41232 2 1180 JBF R2/MTDSTRDY SEFFEXIT jump if good guess 01238 F294123D 2 1181 JBF R2/MTSTTMFWB RETRY if tape didn't move, retry 01239 60040006 0 IMM 1182 LD R0 MTFNBKSP tape moved forward 0123A DC401259 1183 CALLNP INTFUNC backspace before retrying 1184 0123B 60040007 0 IMM 1185 LD R0 TERRITE assume bad error 0123C F6841232 2 1186 JBT R2/MTSTANER SEFFEXIT give up if bksp doesn't work 1187 * \ / 0000123D 1188 RETRY LABEL 0123D D04012BA 1189 DEC RETRYCOUNT decrement the retry count 0123E FE06122D 1190 JGE RETRYLOOP try again a few times 1191 * \ / 0123F 60040007 0 IMM 1192 LD R0 TERRITE else use the default 01240 FE0E1232 1193 JMP SEFFEXIT 1194 * --- 1195 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 46 (TALON) F 15 offline tape driver +INTFUNC UUUUUUUU F 15 1183 +LOGERROR UUUUUUUU F 15 1177 +LONGFUNC UUUUUUUU F 15 1167 RETRY 0000123D F 15 1181j 1188= +RETRYCOUNT UUUUUUUU F 15 1189s RETRYLOOP 0000122D F 15 1165= 1190j +SEFF 0000122B F 15 1158 1163= SEFFERR 00001234 F 15 1168j 1169j 1176= SEFFEXIT 00001232 F 15 1171= 1180j 1186j 1193j +SETUPNMAP UUUUUUUU F 15 1164 +UNMAP UUUUUUUU F 15 1172 1196 END SEFF 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 47 (TALON) F 15 offline tape driver 1198 1199 ********************************************************************************** 1200 * * 1201 * SEFB - Seek End-of-File Backward * 1202 * Call: * 1203 * LD MTU => tape control block * 1204 * CALLNP SEFB * 1205 * ST R0 error code (0 if ok) * 1206 * Sets R0, Eats R1:R2 * 1207 * stack required = 3 * 1208 * 1 + MAX ( INTFUNC (2), LONGFUNC (2), LOGERROR (2), * 1209 * SETUPNMAP (1), UNMAP (1) ) * 1210 * * 1211 ********************************************************************************** 1212 1213 SEFB BLOCK 1214 ENTRY SEFB 1215 1216 BEGFRAME 1217 ENDFRAME 1218 01241 DD5F8001 6 STAK 1219 SEFB ENTRNP PUSH 01242 DC40126B 1220 CALLNP SETUPNMAP do initial stuff 00001243 1221 RETRYLOOP LABEL 01243 60040004 0 IMM 1222 LD R0 MTFNSEFB seek EOF backward opcode 01244 DC401256 1223 CALLNP LONGFUNC do operation, check for errors 01245 FA0C124A 0 1224 JNEZ R0 SEFBERR jump if channel error 01246 F2841248 2 1225 JBF R2/MTSTANER SEFBOK any error? return if ok 01247 F2B6124A 2 1226 JBF R2/MTDSTBOT SEFBERR tape at load point? ok if so 1227 * \ / 00001248 1228 SEFBOK LABEL R0 = 0 indicates OK 01248 DC401279 1229 CALLNP UNMAP unmap the controller 01249 5D1F8001 6 STAK 1230 LEAVE POP 1231 * --- 1232 0000124A 1233 SEFBERR LABEL 0124A DC00128B 1234 CALL LOGERROR log the error 0124B 40440017 IMM 1235 PARVL ERTOPSEFB indicate during SEFB 0124C F2921252 2 1236 JBF R2/MTSTTMBKB SEFBBAD retry if tape didn't move 0124D 60040007 0 IMM 1237 LD R0 MTFNFWSP tape moved backward 0124E DC401259 1238 CALLNP INTFUNC forward space before retrying 0124F F6841252 2 1239 JBT R2/MTSTANER SEFBBAD give up if got error here 01250 D04012BA 1240 DEC RETRYCOUNT decrement the retry count 01251 FE061243 1241 JGE RETRYLOOP try again if not hard error 00001252 1242 SEFBBAD LABEL 01252 60040006 0 IMM 1243 LD R0 TERRDNR maybe the drive isn't ready 01253 F2B41255 2 1244 JBF R2/MTDSTRDY SEFBEXIT exit if not 01254 60040007 0 IMM 1245 LD R0 TERRITE else use the catch-all 1246 * \ / 00001255 1247 SEFBEXIT LABEL 01255 FE0E1248 1248 JMP SEFBOK jump to completion 1249 * --- 1250 +INTFUNC UUUUUUUU F 15 1238 +LOGERROR UUUUUUUU F 15 1234 +LONGFUNC UUUUUUUU F 15 1223 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 48 (TALON) F 15 offline tape driver +RETRYCOUNT UUUUUUUU F 15 1240s RETRYLOOP 00001243 F 15 1221= 1241j +SEFB 00001241 F 15 1214 1219= SEFBBAD 00001252 F 15 1236j 1239j 1242= SEFBERR 0000124A F 15 1224j 1226j 1233= SEFBEXIT 00001255 F 15 1244j 1247= SEFBOK 00001248 F 15 1225j 1228= 1248j +SETUPNMAP UUUUUUUU F 15 1220 +UNMAP UUUUUUUU F 15 1229 1251 END SEFB 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 49 (TALON) F 15 offline tape driver 1253 1254 ********************************************************************************** 1255 * * 1256 * INTFUNC, LONGFUNC * 1257 * * 1258 * These routines perform a tape function on the drive, then wait * 1259 * for the interrupt completion. They are intended for internal use. * 1260 * The two entry points give different allowances for the timeout * 1261 * value. INTFUNC allows 80 seconds while LONGFUNC allows 10 minutes. * 1262 * * 1263 * LD MTU => tape control block * 1264 * LD R0 * 1265 * CALLNP INTFUNC (or LONGFUNC) * 1266 * R0 = masked PPU status * 1267 * R1 = PPU status * 1268 * R2 = controller status * 1269 * Sets R0:R2. * 1270 * stack required = 2 * 1271 * 1 + PPUIWAIT(1) * 1272 * * 1273 ********************************************************************************** 1274 1275 INTFUNC BLOCK 1276 ENTRY INTFUNC 1277 ENTRY LONGFUNC 1278 1279 BEGFRAME 1280 ENDFRAME 1281 01256 DD5F8001 6 STAK 1282 LONGFUNC ENTRNP PUSH entry for ten minute allowance 01257 6084EA60 2 IMM 1283 LD R2 60000 10 minute timeout (10 ms units) 01258 FE0E125B 1284 JMP FUNCCOMMON and share the remainder 1285 * --- 1286 01259 DD5F8001 6 STAK 1287 INTFUNC ENTRNP PUSH entry for 10 second allowance 0125A 60841F40 2 IMM 1288 LD R2 8000 80 second timeout (10 ms units) 0000125B 1289 FUNCCOMMON LABEL 0125B 60570801 1 4 BASE 1290 LD R1 MTU,TPCBUNIT get tape unit number 0125C E4221AB8 0 1 1291 ST R0 CIX(MTCMFUNC+MTINTREQ+MTSELECT+R1) 1292 0125D DC00127D 1293 CALL PPUIWAIT wait for PPU interrupt 0125E 40528000 2 REG 1294 PARVL R2 indicate maximum wait likely 0125F 5D1F8001 6 STAK 1295 LEAVE POP 1296 * --- 1297 FUNCCOMMON 0000125B F 15 1284j 1289= +INTFUNC 00001259 F 15 1276 1287= +LONGFUNC 00001256 F 15 1277 1282= +MTU 00130000 F 15 1290 +PPUIWAIT UUUUUUUU F 15 1293 1298 END INTFUNC 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 50 (TALON) F 15 offline tape driver 1300 1301 ********************************************************************************** 1302 * * 1303 * TAPEFUNC * 1304 * * 1305 * This routine performs a tape function on the drive, and waits * 1306 * for the interrupt completion. * 1307 * * 1308 * LD MTU => tape control block * 1309 * LD R0 * 1310 * CALLNP TAPEFUNC * 1311 * R0 = masked PPU status * 1312 * R1 = PPU status * 1313 * R2 = controller status * 1314 * Sets R0:R2. * 1315 * stack required = 3 * 1316 * 2 + MAX ( PPUIWAIT(1), SETUPNMAP (1), UNMAP (1) ) * 1317 * * 1318 ********************************************************************************** 1319 1320 TAPEFUNC BLOCK 1321 ENTRY TAPEFUNC 1322 1323 BEGFRAME 00178801 6 BASE 1324 R3SAVE BSS 1 1325 ENDFRAME 1326 01260 DD5F8002 6 STAK 1327 TAPEFUNC ENTRNP PUSH 01261 E4D78801 3 6 BASE 1328 ST R3 SP,R3SAVE save R3 from harm 01262 60920000 2 0 REG 1329 LD R2 R0 load desired function 01263 DC40126B 1330 CALLNP SETUPNMAP do initial stuff 1331 01264 60570801 1 4 BASE 1332 LD R1 MTU,TPCBUNIT get tape unit number 01265 E4A21AB8 2 1 1333 ST R2 CIX(MTCMFUNC+MTINTREQ+MTSELECT+R1) 1334 01266 DC00127D 1335 CALL PPUIWAIT wait for PPU interrupt 01267 4044EA60 IMM 1336 PARVL 60000 wait max of ten minutes 1337 01268 DC401279 1338 CALLNP UNMAP unmap the controller 01269 60D78801 3 6 BASE 1339 LD R3 SP,R3SAVE restore R3 0126A 5D1F8002 6 STAK 1340 LEAVE POP 1341 * --- 1342 +MTU 00130000 F 15 1332 +PPUIWAIT UUUUUUUU F 15 1335 R3SAVE 00178801 F 15 1324= 1328s 1339 +SETUPNMAP UUUUUUUU F 15 1330 +TAPEFUNC 00001260 F 15 1321 1327= +UNMAP UUUUUUUU F 15 1338 1343 END TAPEFUNC 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 51 (TALON) F 15 offline tape driver 1345 1346 ********************************************************************************** 1347 * * 1348 * SETUPNMAP * 1349 * Routine to do various setup operations. We load up the * 1350 * page file to point to the appropriate tape controller, and * 1351 * select any necessary conditions there in. Before loading * 1352 * the page file to point to the tape controller, we fetch the * 1353 * current clock from the SSU. We accept the slight risk of * 1354 * acquiring the wrong time at rollover. It is used in error * 1355 * ÿlogging. * 1356 * Call: * 1357 * LD R4 => control block * 1358 * CALLNP SETUPNMAP * 1359 * * 1360 * Eats R0:R1, R3. * 1361 * Stack required: 1 * 1362 * * 1363 ********************************************************************************** 1364 1365 SETUPNMAP BLOCK 1366 1367 ENTRY SETUPNMAP 1368 1369 BEGFRAME 1370 ENDFRAME 1371 0126B DD5F8001 6 STAK 1372 SETUPNMAP ENTRNP PUSH 0126C 60C40086 3 IMM 1373 LD PFPTR PNCIX get channel index page number 0126D 00C00310 1374 LDPF SSUPF load the page file for the SSU 0126E 60401802 1 1375 LD R1 CIX(SSUCLOCKL) fetch low half clock 0126F 60001801 0 1376 LD R0 CIX(SSUCLOCKU) fetch high half clock 01270 E60012B8 01 1377 ST2 R0 CLOCKTIME save the current time for later 01271 00D70800 4 BASE 1378 LDPF MTU,TPCBPFILE map in the controller 01272 60040000 0 IMM 1379 LD R0 0 value for retry count (none) for vt 01273 60570802 1 4 BASE 1380 LD R1 MTU,TPCBTRACK pick up track 01274 6447FFFE 1 IMM 1381 CPR R1 -2 is it a video tape? 01275 FE021277 1382 JEQ SETRETRY if so, use 1 for retry count 01276 60040014 0 IMM 1383 LD R0 TAPEERRMAX get retry count 00001277 1384 SETRETRY LABEL 01277 E40012BA 0 1385 ST R0 RETRYCOUNT for error recovery 01278 5D1F8001 6 STAK 1386 LEAVE POP 1387 * --- 1388 +CLOCKTIME UUUUUUUU F 15 1377s +MTU 00130000 F 15 1378 1380 +RETRYCOUNT UUUUUUUU F 15 1385s SETRETRY 00001277 F 15 1382j 1384= +SETUPNMAP 0000126B F 15 1367 1372= +TAPEERRMAX 00000014 F 15 1383 1389 END 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 52 (TALON) F 15 offline tape driver 1391 1392 ********************************************************************************** 1393 * * 1394 * UNMAP * 1395 * Clean up. * 1396 * Call: * 1397 * CALLNP UNMAP * 1398 * Eats R3 * 1399 * stack required = 1 * 1400 * * 1401 ********************************************************************************** 1402 1403 UNMAP BLOCK 1404 ENTRY UNMAP 1405 1406 BEGFRAME 1407 ENDFRAME 1408 01279 DD5F8001 6 STAK 1409 UNMAP ENTRNP PUSH 0127A 60C40086 3 IMM 1410 LD PFPTR PNCIX load controller window page number 0127B 80D2C000 3 REG 1411 PFRC PFPTR and clear PF location 0127C 5D1F8001 6 STAK 1412 LEAVE POP 1413 * --- 1414 +UNMAP 00001279 F 15 1404 1409= 1415 END UNMAP 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 53 (TALON) F 15 offline tape driver 1417 1418 ********************************************************************************** 1419 * * 1420 * PPUIWAIT, wait for PPU interrupt * 1421 * * 1422 * This routine waits for an interrupt from the PPU to * 1423 * indicate an I/O operation has been completed. This is done * 1424 * by waiting for the 'controller requests interrupt' bit to * 1425 * become true in the PPU status. This implies that the * 1426 * controller was told to interrupt on completion when the * 1427 * operation was started. This routine leaves the PPU status * 1428 * in R1, the error bits from the PPU status in R0, and the * 1429 * controller status in R2. * 1430 * Call: * 1431 * CALL PPUIWAIT * 1432 * PARVL * 1433 * R0 = masked PPU status * 1434 * R1 = PPU status * 1435 * R2 = controller status * 1436 * Sets R0:R2. * 1437 * stack required = 1 * 1438 * * 1439 ********************************************************************************** 1440 1441 PPUIWAIT BLOCK 1442 ENTRY PPUIWAIT 1443 1444 BEGFRAME 1445 ENDFRAME 1446 0127D DD1F8001 6 STAK 1447 PPUIWAIT ENTR PUSH 0127E C0520000 0 REG 1448 STPVL R0 save max wait time (1 = 10 millisecs) 0000127F 1449 INTWAIT LABEL 0127F 004403E8 IMM 1450 WAIT 1000 wait here for 10 milliseconds 1451 * \ / to avoid saturating the PPU 01280 60401801 1 1452 LD R1 CIX(PPUINTSTAT) get PPU status 01281 F6781284 1 1453 JBT R1/PPUIINTC ENDWAIT if completed, jump out of loop 01282 FA26127F 0 1454 JDR R0 INTWAIT continue if max time not exceeded 1455 * \ / 01283 D1524000 1 REG 1456 STMW R1 say we timed out 00001284 1457 ENDWAIT LABEL 01284 60124000 0 1 REG 1458 LD R0 R1 copy status 01285 78046540 0 IMM 1459 AND R0 PPUMASK mask off the bad bits 01286 60801802 2 1460 LD R2 CIX(PPUCHANS1) get controller status at interrupt time 01287 FA02128A 0 1461 JEQZ R0 NOPPUERR jump if PPU happy 01288 EC001801 1462 STZ CIX(PPUABORT) clean up channel 01289 00420008 IMM 1463 WAIT CATCHWAIT wait for controller to catch up 0000128A 1464 NOPPUERR LABEL 0128A 5D1F8001 6 STAK 1465 LEAVE POP 1466 * --- 1467 1468 +CATCHWAIT 00040000 F 15 1463 ENDWAIT 00001284 F 15 1453j 1457= INTWAIT 0000127F F 15 1449= 1454j NOPPUERR 0000128A F 15 1461j 1464= 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 54 (TALON) F 15 offline tape driver +PPUIWAIT 0000127D F 15 1442 1447= +PPUMASK 00006540 F 15 1459 1469 END PPUIWAIT 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 55 (TALON) F 15 offline tape driver 1471 1472 ********************************************************************************** 1473 * * 1474 * LOGERROR - Log a tape I/O error. * 1475 * See ERRLOGBLK for the format of the entries. * 1476 * Call: * 1477 * RECORDNUM = record number or optional data * 1478 * R1 = PPU status * 1479 * R2 = controller status * 1480 * R4 = address of tape control block * 1481 * CALL LOGERROR eats R0:R1 before passing parameters * 1482 * PARVL * 1483 * * 1484 * Eats R0 * 1485 * Stack required = 2 * 1486 * * 1487 ********************************************************************************** 1488 1489 LOGERROR BLOCK error log routine 1490 1491 ENTRY LOGERROR 1492 1493 BEGFRAME 00178801 6 BASE 1494 PPUSTATUS BSS 1 to hold the PPU status 1495 ENDFRAME 1496 0128B DD9F8002 6 STAK 1497 LOGERROR ENTRS PUSH 0128C E4578801 1 6 BASE 1498 ST R1 SP,PPUSTATUS save the PPU status 0128D 604013EA 1 1499 LD R1 VERRLOGPTR R1 -> error log buffer 0128E FA4212B5 1 1500 JEQZ R1 LOGSKIP jump if no log buffer exists 0128F 60164800 0 1 BASE 1501 LD R0 R1,0 get first word 01290 FA2C12B4 0 1502 JEQMW R0 LOGFULL jump if log is full 1503 01291 60090840 0 4 ZBM 1504 LD R0 R4,DCBPFILE/PFSLOT get slot number of PPU 01292 E4084843 0 1 ZBM 1505 ST R0 R1,ERRSLOT save it 01293 60093020 0 4 ZBM 1506 LD R0 R4,DCBPFILE/PPUCHAN get channel number of controller 01294 E4085043 0 1 ZBM 1507 ST R0 R1,ERRCHAN save it 01295 60170801 0 4 BASE 1508 LD R0 R4,DCBUNIT get tape unit number 01296 E4085843 0 1 ZBM 1509 ST R0 R1,ERRUNIT save it 1510 01297 DCD3C000 7 REG 1511 EXPCS R7 go get parms 01298 C0564004 1 CACH 1512 STPVL R1,ERROPER save operation type 01299 600012BB 0 1513 LD R0 RECORDNUM retrieve record number 0129A E4085181 0 1 ZBM 1514 ST R0 R1,ERRBLOCK and save it 0129B 60178801 0 6 BASE 1515 LD R0 SP,PPUSTATUS retrieve PPU status 0129C E4086103 0 1 ZBM 1516 ST R0 R1,ERRPPUSTAT save PPU status 0129D E4964804 2 1 BASE 1517 ST R2 R1,ERRCTLSTAT save tape status 1518 0129E 38964004 2 1 CACH 1519 LEA R2 R1,ERRCOMPARE R2 -> beginning of part to compare 0129F E4961005 2 0 REG 1520 ST R2 R0+ERRLNTH R0 -> previous log entry 012A0 60440010 1 IMM 1521 LD R1 ERREND DISPC ERRCOMPARE R1 = size to compare 012A1 FE540000 1522 CMS same error as previous entry? 1523 * condition bits held for later test 012A2 600013EA 0 1524 LD R0 VERRLOGPTR re-fetch error log buffer pointer 012A3 60960804 2 0 BASE 1525 LD R2 R0,ERRCTLSTAT retrieve callers controller status 012A4 FE0C12A8 1526 JNE SETTIME jump if not 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 56 (TALON) F 15 offline tape driver 012A5 10040005 0 IMM 1527 SUB R0 ERRLNTH make pointer to previous entry 012A6 D0160000 0 CACH 1528 INC R0,ERRCOUNT increment number of times for this error 012A7 FE0E12B2 1529 JMP LOGDONE and we're all done 1530 * --- 1531 000012A8 1532 SETTIME LABEL 012A8 620012B8 01 1533 LD2 R0 CLOCKTIME get the time last read from SSU 012A9 160403E8 01 IMM 1534 DIV2 R0 1000 convert value to seconds 012AA 58C40010 IMM 1535 IORPSR PSRMODIF 012AB 14055180 0 IMM 1536 DIV R0 86400 R1 = seconds past midnight 012AC 58840010 IMM 1537 CLBPSR PSRMODIF 012AD 600013EA 0 1538 LD R0 VERRLOGPTR restore pointer to log file entry 012AE E4481180 1 0 ZBM 1539 ST R1 R0,ERRTIME save time of error 012AF EDD60000 0 CACH 1540 STW R0,ERRCOUNT say error has occurred once 012B0 18040005 0 IMM 1541 ADD R0 ERRLNTH point to next entry 012B1 E40013EA 0 1542 ST R0 VERRLOGPTR update pointer to error log buffer 1543 * \ / 1544 000012B2 1545 LOGDONE LABEL 012B2 60578801 1 6 BASE 1546 LD R1 SP,PPUSTATUS restore PPU status 012B3 5D1F8002 6 STAK 1547 LEAVE POP return 1548 * --- 1549 000012B4 1550 LOGFULL LABEL 012B4 D0164801 1 BASE 1551 INC R1,1 increment number of lost errors 1552 * \ / 1553 000012B5 1554 LOGSKIP LABEL throw away the parameters 012B5 DCD3C000 7 REG 1555 EXPCS R7 go get parms 012B6 C0520000 0 REG 1556 STPVL R0 get operation in error 012B7 FE0E12B2 1557 JMP LOGDONE 1558 * --- 1559 +CLOCKTIME UUUUUUUU F 15 1533 LOGDONE 000012B2 F 15 1529j 1545= 1557j +LOGERROR 0000128B F 15 1491 1497= LOGFULL 000012B4 F 15 1502j 1550= LOGSKIP 000012B5 F 15 1500j 1554= PPUSTATUS 00178801 F 15 1494= 1498s 1515 1546 +RECORDNUM UUUUUUUU F 15 1513 SETTIME 000012A8 F 15 1526j 1532= 1560 END LOGERROR of error log routine 1561 000012B8 1562 CLOCKTIME BSS 2 holds the current time 000012BA 1563 RETRYCOUNT BSS 1 retry counter 000012BB 1564 RECORDNUM BSS 1 current record number (for error log) 1565 CATCHWAIT 00040000 F 15 111= 457 878 1463 CLOCKTIME 000012B8 F 15 1377s 1533 1562= DOONEBUF 0000110F F 15 287 405= 406 412= 476 DOTWOBUF 000010F8 F 15 282 348= 349 354= 382 DOWRITE 00001189 F 15 529 760= 762 770= 905 INTFUNC 00001259 F 15 319 563 1009 1024 1183 1238 1275= 1276 1287= 1298 LOGERROR 0000128B F 15 308 320 545 564 969 1019 1025 1127 1177 1234 1489= 1491 1497= 1560 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 57 (TALON) F 15 offline tape driver LONGFUNC 00001256 F 15 1096 1167 1223 1277 1282= +MTU 00130000 F 15 144s 151s 156s 159s 165 171 175s 180s 187s 190 374 437 591 950 1057 1290 1332 1378 1380 +OPENTAPE 0000109E F 15 41 134= 135 142= +PPUIWAIT 0000127D F 15 42 377 954 1114 1293 1335 1441= 1442 1447= PPUMASK 00006540 F 15 109= 453 613 864 1459 +READTAPE 000010D5 F 15 43 261= 262 270= RECORDNUM 000012BB F 15 271s 520s 1513 1564= RETRYCOUNT 000012BA F 15 314s 556s 1021s 1132s 1189s 1240s 1385s 1563= +REWIND 00001212 F 15 44 1064 1086= 1087 1092= +SEFB 00001241 F 15 46 1213= 1214 1219= +SEFF 0000122B F 15 45 1157= 1158 1163= +SETTAPE 0000120B F 15 47 1050= 1051 1056= SETUPNMAP 0000126B F 15 276 523 1005 1093 1164 1220 1330 1365= 1367 1372= TAPEERRMAX 00000014 F 15 110= 945 1383 +TAPEFUNC 00001260 F 15 48 1061 1320= 1321 1327= UNMAP 00001279 F 15 300 540 1014 1122 1172 1229 1338 1403= 1404 1409= 1415 +WRITEFM 000011F6 F 15 50 997= 999 1004= WRITEGAP 000011DF F 15 572 931= 933 940= 974 1027 +WRITETAPE 0000113C F 15 49 508= 510 519= 1566 END TALON of tape driver 295 INPUT PROMBOOT.OPSYS:PBCRYPDEFS 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 58 (PBCRYPDEFS) F 16 offline tape driver 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 296 INPUT PROMBOOT.OPSYS:PBDECRYPT get in the decryptor 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 59 (PBDECRYPT) F 17 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 C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 60 (PBDECRYPT) F 17 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 012BC DD1F8001 6 STAK 34 PBDINIT ENTR PUSH 012BD C140032A 35 STPV KEYINDIC save the indicator 012BE C340032B 36 STPV2 KEYPWDDAT and the tape date 012BF C0524000 1 REG 37 STPVL R1 get address of data to decrypt 012C0 38084080 0 1 ZBM 38 LEA R0 R1,0/CH0 make a character pointer 012C1 E400032D 0 39 ST R0 APROGBC and save for decryptor use 012C2 38084050 0 1 ZBM 40 LEA R0 R1,0/BITS 0:4 and make a 5-bit pointer 012C3 E400032E 0 41 ST R0 APROGB5S save that too 42 012C4 60000310 0 43 LD R0 SSUPF get PMV for SSU commands 44 * modify to point to NVM 012C5 18040001 0 IMM 45 ADD R0 SSUNVM/FLDABSPG-SSUCOFFSET/FLDABSPG 012C6 60C40086 3 IMM 46 LD PFPTR PNCIX indicate CIX 012C7 80928000 2 REG 47 PFRD R2 pick up old contents 48 012C8 00D20000 0 REG 49 LDPF R0 make PF point to NVM 012C9 60440007 1 IMM 50 LD R1 2*CPW-1 load count for double word 000012CA 51 ANOTHBYTE LABEL 012CA 60221822 0 1 52 LD R0 CIX(NVMTAPEPW)(R1) get next byte from NVM 012CB F43212CF 0 1 @ 53 XORM R0 @AKEYPWDATE(R1) combine with pre-existing 012CC FA6612CA 1 54 JDR R1 ANOTHBYTE recycle through all bytes 55 * \ / 012CD 00D28000 2 REG 56 LDPF R2 restore page file value 012CE 5D1F8001 6 STAK 57 LEAVE POP then return to caller 58 * --- 59 012CF 020C032B 60 AKEYPWDATE PTR KEYPWDDAT/CH0 character pointer for key 61 AKEYPWDATE 000012CF F 17 53s 60= ANOTHBYTE 000012CA F 17 51= 54j +KEYINDIC 0000032A F 17 35s 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 61 (PBDECRYPT) F 17 PROMBOOT decrypt routines +KEYPWDDAT 0000032B F 17 36s 60a +PBDINIT 000012BC F 17 29 34= 62 END PBDINIT end of encrypt initialization 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 62 (PBDECRYPT) F 17 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 012D0 DD5F8001 6 STAK 85 PBDECRYPT ENTRNP PUSH 012D1 DC4012F6 86 CALLNP RANDINIT start up the random number generator 012D2 DC4012E9 87 CALLNP TRANSPOSE 012D3 DC4012D9 88 CALLNP SUBS5 012D4 DC4012E9 89 CALLNP TRANSPOSE 012D5 DC4012D9 90 CALLNP SUBS5 012D6 DC4012E9 91 CALLNP TRANSPOSE 012D7 DC4012D9 92 CALLNP SUBS5 012D8 5D1F8001 6 STAK 93 LEAVE POP return 94 * --- 95 +PBDECRYPT 000012D0 F 17 80 85= +RANDINIT UUUUUUUU F 17 86 +SUBS5 UUUUUUUU F 17 88 90 92 +TRANSPOSE UUUUUUUU F 17 87 89 91 96 END PBDECRYPT end of decryptor 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 63 (PBDECRYPT) F 17 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 012D9 DD5F8001 6 STAK 118 SUBS5 ENTRNP PUSH 012DA 60441998 1 IMM 119 LD R1 ((L*8)/5)-1 get number of 5 bit blocks in MB 000012DB 120 SUBSLOOP LABEL 012DB 6032032E 0 1 @ 121 LD R0 @APROGB5S(R1) pick up a field 012DC 603012E8 0 0 @ 122 LD R0 @ASUBTAB(R0) do the substitution 012DD E432032E 0 1 @ 123 ST R0 @APROGB5S(R1) and plop back into MB 012DE FA6612DB 1 124 JDR R1 SUBSLOOP back if not done 125 * \ / 012DF 5D1F8001 6 STAK 126 LEAVE POP return 127 * --- 128 020012E0 129 SUBTABLE BSSC 0 table label 012E1 00000004 130 VFDC 01B,01F,015,008,00A,01C,012,004 012E3 00000016 131 VFDC 007,003,00C,00E,011,018,001,016 012E5 00000009 132 VFDC 019,014,00F,01D,01E,00D,010,009 012E7 00000013 133 VFDC 000,01A,017,006,002,005,00B,013 012E8 020C12E0 134 ASUBTAB PTR SUBTABLE 135 ASUBTAB 000012E8 F 17 122 134= +SUBS5 000012D9 F 17 113 118= SUBSLOOP 000012DB F 17 120= 124j SUBTABLE 020012E0 F 17 129= 134a 136 END SUBS5 of SUBS5 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 64 (PBDECRYPT) F 17 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 012E9 DD5F8002 6 STAK 174 TRANSPOSE ENTRNP PUSH 012EA E5178801 4 6 BASE 175 ST R4 SP,SAVER4 save R4 176 012EB 61040000 4 IMM 177 LD R4 0 initial field location 000012EC 178 TRANLOOP LABEL 012EC DC4012FD 179 CALLNP RANDOM get the next random number 012ED 604A82C0 1 2 CBM 180 LD R1 R2/BITS 1:SIZELOG2 get something in our size 012EE 6038032D 0 4 @ 181 LD R0 @APROGBC(R4) get field N of program buffer 012EF E032032D 0 1 @ 182 EXCH R0 @APROGBC(R1) exchange for field J of program buffer 012F0 E438032D 0 4 @ 183 ST R0 @APROGBC(R4) and put J into Ns place 184 012F1 19040001 4 IMM 185 ADD R4 1 advance the field counter 012F2 65041000 4 IMM 186 CPR R4 L are we done with this pass? 012F3 FE0812EC 187 JLT TRANLOOP jump back for next field if not 188 * \ / 012F4 61178801 4 6 BASE 189 LD R4 SP,SAVER4 restore R4 012F5 5D1F8002 6 STAK 190 LEAVE POP return 191 * --- 192 +RANDOM UUUUUUUU F 17 179 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 65 (PBDECRYPT) F 17 PROMBOOT decrypt routines SAVER4 00178801 F 17 171= 175s 189 TRANLOOP 000012EC F 17 178= 187j +TRANSPOSE 000012E9 F 17 168 174= 193 END TRANSPOSE of Transpose 194 195 INPUT PROMBOOT.OPSYS:PBENCRANDOM get the random number generator 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 66 (PBENCRANDOM) F 18 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 012F6 DD5F8001 6 STAK 30 RANDINIT ENTRNP PUSH 012F7 6240032B 12 31 LD2 R1 KEYPWDDAT get password/date info 012F8 74924000 2 1 REG 32 XOR R2 R1 fold the halves together 012F9 7480032A 2 33 XOR R2 KEYINDIC throw in the indicator 012FA DC4012FD 34 CALLNP RANDOM warm it up a little 012FB DC4012FD 35 CALLNP RANDOM just for drill 012FC 5D1F8001 6 STAK 36 LEAVE POP return, RANDOM is initialized 37 * --- 38 +KEYINDIC 0000032A F 18 33 +KEYPWDDAT 0000032B F 18 31 +RANDINIT 000012F6 F 18 25 30= +RANDOM UUUUUUUU F 18 34 35 39 END RANDINIT 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 67 (PBENCRANDOM) F 18 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 012FD DD5F8001 6 STAK 77 RANDOM ENTRNP PUSH 012FE 60528000 1 2 REG 78 LD R1 R2 get old seed value 012FF 58C40014 IMM 79 IORPSR PSRMODIF+PSRCARRY turn on magic, ensure carry state known 01300 1C401303 1 80 MUL R1 A temp = X * a 01301 18801304 2 81 ADD R2 CMINUS1 X = temp + c 01302 5D1F8001 6 STAK 82 LEAVE POP 83 * --- 84 01303 0019660D 85 A VFD 1664525 a 01304 000AE408 86 CMINUS1 VFD 713737-1 c - 1 87 A 00001303 F 18 80 85= CMINUS1 00001304 F 18 81 86= +RANDOM 000012FD F 18 72 77= 88 END RANDOM end of random number generator 89 +KEYINDIC 0000032A F 18 33 +KEYPWDDAT 0000032B F 18 31 +RANDINIT 000012F6 F 18 6 23= 25 30= +RANDOM 000012FD F 18 7 34 35 70= 72 77= 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 68 (PBENCRANDOM) F 18 Random Number Code for Promboot Decryptor 90 END PBENCRANDM of random number routines 196 +KEYINDIC 0000032A F 17 35s F 18 33 +KEYPWDDAT 0000032B F 17 36s 60a F 18 31 +PBDECRYPT 000012D0 F 17 7 78= 80 85= +PBDINIT 000012BC F 17 6 27= 29 34= PBENCRANDM F 18 4= 90 RANDINIT 000012F6 F 17 86 F 18 6 23= 25 30= RANDOM 000012FD F 17 179 F 18 7 34 35 70= 72 77= SUBS5 000012D9 F 17 88 90 92 111= 113 118= 136 TRANSPOSE 000012E9 F 17 87 89 91 166= 168 174= 193 197 END PBDECRYPT of decryptor for PROMBOOT 297 INPUT BOOT.OPSYS:DISPLAY 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 69 (DISPLAY) F 19 display routine 3 4 ********************************************************************************** 5 * * 6 * Revisions Date * 7 * --------- ---- * 8 * 1.0 6 Nov 81 * 9 * Initial release. * 10 * * 11 * * 12 * Routine to display the 10 characters specified on * 13 * the front panel. SSUPF was put into IBLOCK by PROMBOOT. * 14 * * 15 * CALLNP DISPLAY * 16 * ASCII 3,text * 17 * * 18 * Gets R0, R1, and R3 and zaps window CIX. * 19 * Stack required: 1 * 20 * * 21 ********************************************************************************** 22 23 BLOCK display routine 24 25 ENTRY DISPLAY 26 27 BEGFRAME 28 ENDFRAME 29 01305 DD5F8001 6 STAK 30 DISPLAY ENTRNP PUSH 01306 60C40086 3 IMM 31 LD PFPTR PNCIX 01307 00C00310 32 LDPF SSUPF point window 3 to the SSU 01308 6047FFFD 1 IMM 33 LD R1 -3 move 3 words 00001309 34 DISPLOOP LABEL 01309 601DC803 0 71 BASE 35 LD R0 R7,3(R1) get a display word 0130A 78001310 0 36 AND R0 ASCII6MASK remove extra bits 0130B E422180D 0 1 37 ST R0 CIX(SSUDISP03+3+R1) place chars in SSU 0130C FA601309 1 38 IRJ R1 DISPLOOP 0130D 80D2C000 3 REG 39 PFRC PFPTR undo window 0130E 19C40003 7 IMM 40 ADD R7 3 move over the params 0130F 5D1F8001 6 STAK 41 LEAVE POP 42 * --- 43 01310 3F3F3F3F 44 ASCII6MASK VFD 03F3F3F3F 45 ASCII6MASK 00001310 F 19 36 44= +DISPLAY 00001305 F 19 25 30= DISPLOOP 00001309 F 19 34= 38j 46 END display routine 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 70 F 0 Vectors 300 301 ********************************************************************************** 302 * * 303 * This is a 16-word vector for the tape driver routines * 304 * supplied by TAPEBOOT for use by TOPL and other tape-loaded * 305 * off-line software. This vector (TAPEVECT) resides in the * 306 * sixteen words immediately preceding the standard Boot/OPL * 307 * vectors. * 308 * * 309 ********************************************************************************** 310 311 ORG BOOT(WPP-32-16) 312 013D0 0000103D 313 VFD ADR(TAPECB) 00 => boot tape control block 013D1 0000109E 314 VFD ADR(OPENTAPE) 01 - tape open routine 013D2 00001040 315 VFD ADR(TAPELOAD) 02 - tape file load routine 013D3 000010D5 316 VFD ADR(READTAPE) 03 - tape read routine 013D4 00001212 317 VFD ADR(REWIND) 04 - tape rewind routine 013D5 0000122B 318 VFD ADR(SEFF) 05 - tape search EOF, forward 013D6 00001241 319 VFD ADR(SEFB) 06 - tape search EOF, backward 013D7 00001260 320 VFD ADR(TAPEFUNC) 07 - tape function routine 013D8 0000120B 321 VFD ADR(SETTAPE) 08 - tape density/track select 013D9 0000127D 322 VFD ADR(PPUIWAIT) 09 - wait for interrupt routine 013DA 00001083 323 VFD ADR(CHECKHDR) 0A - tape header checksum routine 013DB 0000108B 324 VFD ADR(CHECKDATA) 0B - tape data checksum routine 013DC 0000113C 325 VFD ADR(WRITETAPE) 0C - tape write routine 013DD 000011F6 326 VFD ADR(WRITEFM) 0D - write file mark routine 013DE 000013FF 327 VFD ADR(GRUNDGE) 0E 013DF 000013FF 328 VFD ADR(GRUNDGE) 0F 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 71 F 0 Vectors 330 ********************************************************************************** 331 * * 332 * The last 32 words of the TAPEBOOT page contain pointers * 333 * to the routines herein so that the standalone software * 334 * can get at them. * 335 * * 336 ********************************************************************************** 337 338 ORG BOOTLOC(WPP-32) 013E0 000013FF 339 VFD ADR GRUNDGE disk read routine 013E1 000013FF 340 VFD ADR GRUNDGE disk write routine 013E2 000013FF 341 VFD ADR GRUNDGE directory searcher 013E3 00001305 342 VFD ADR DISPLAY front panel displayer 013E4 00000000 343 VFD 0 => boot disk control block 013E5 00000310 344 VFD ADR SSUPF page file for SSU 013E6 00000311 345 VFD ADR PHPNAV PF for some page in this memory 013E7 00000370 346 VFD ADR IBSLOTS array of WRU responses for slots 013E8 00001039 347 VFD ADR PFWNDO1 page file for WNDO1 013E9 0000103A 348 VFD ADR PFWNDO2 page file for WNDO2 013EA 00000000 349 ERRLOGPTR VFD 0 next entry in error log buffer 013EB 000013FF 350 VFD ADR GRUNDGE disk control block initialize routine 013EC 000013FF 351 VFD ADR GRUNDGE terminate disk usage 013ED 0000103B 352 VFD ADR MEMSPACE free space in window 4 013EE 000013FF 353 VFD ADR GRUNDGE 14 013EF 000013FF 354 VFD ADR GRUNDGE 15 355 * The vectors above are normally set by DISKBOOT. 356 * We (TAPEBOOT) set what we can. The remaining 357 * necessary vectors, including some of the ones 358 * below, are set by TOPL after we get it in. 013F0 000013FF 359 VFD ADR GRUNDGE 16 - program exit 013F1 000013FF 360 VFD ADR GRUNDGE 17 - read one character 013F2 000013FF 361 VFD ADR GRUNDGE 18 - write one character 013F3 000013FF 362 VFD ADR GRUNDGE 19 - read one line 013F4 000013FF 363 VFD ADR GRUNDGE 20 - write one line 013F5 000013FF 364 VFD ADR GRUNDGE 21 - fetch an item 013F6 000013FF 365 VFD ADR GRUNDGE 22 - fetch (pack) a filename 013F7 000013FF 366 VFD ADR GRUNDGE 23 - scan over non-item characters 013F8 000013FF 367 VFD ADR GRUNDGE 24 - fetch item, default hex 013F9 000013FF 368 VFD ADR GRUNDGE 25 - output formatter 013FA 000013FF 369 VFD ADR GRUNDGE 26 - beginning of error log buffer 013FB 000013FF 370 VFD ADR GRUNDGE 27 - get date routine 013FC 00001037 371 VFD ADR MULTILOOP 28 - where extra CPUs should loop 013FD 000013FF 372 VFD ADR GRUNDGE 29 013FE 000013FF 373 VFD ADR GRUNDGE 30 013FF 00024100 374 GRUNDGE HALT HALTB4100 31 375 376 ALF 00001020 F 0 188j 190= +BOOT 00001000 F 0 108 119= 311a CHECKDATA 0000108B F 0 324a F 14 121 213 220= CHECKHDR 00001083 F 0 323a F 14 110 178 184= DISPLAY 00001305 F 0 149 342a F 19 25 30= ERRLOGPTR 000013EA F 0 349= ERROK 00001026 F 0 195j 197= GRUNDGE 000013FF F 0 327a 328a 339a 340a 341a 350a 351a 353a 354a 359a 360a 361a 362a 363a 364a 365a 366a 367a 368a 369a 370a 372a 373a 1 Assembler C9208 TAPEBOOT - Tape Resident BootStrap Program 28-Jun-93 9:12 PAGE 72 F 0 Vectors 374= HDRBUF 0000031F F 16 14= KEYHALF 0400032A F 16 16= KEYINDIC 0000032A F 16 17= F 17 35s F 18 33 KEYPWDDAT 0000032B F 16 18= F 17 36s 60a F 18 31 LOADPF 0000102C F 0 158 210 227= 252 LOCKWORD 0000103C F 0 135s 281= MEMSPACE 0000103B F 0 275= 352a MSG1 0000102A F 0 180 204= MSG2 0000102B F 0 199 205= MTU 00130000 F 0 194 F 14 54 56s F 15 37= 144s 151s 156s 159s 165 171 175s 180s 187s 190 374 437 591 950 1057 1290 1332 1378 1380 MULTILOOP 00001037 F 0 253= 371a OPENTAPE 0000109E F 0 314a F 15 41 134= 135 142= OTHERWAY 00001036 F 0 136j 251= OVERVERSN 00001003 F 0 120j 134= PBDECRYPT 000012D0 F 14 119 F 17 4= 7 78= 80 85= 197 PBDINIT 000012BC F 14 114 F 17 6 27= 29 34= PFWNDO1 00001039 F 0 264= 347a PFWNDO2 0000103A F 0 265= 348a PPUIWAIT 0000127D F 0 322a F 15 42 377 954 1114 1293 1335 1441= 1442 1447= READTAPE 000010D5 F 0 316a F 14 64 90 139 F 15 43 261= 262 270= REWIND 00001212 F 0 317a F 15 44 1064 1086= 1087 1092= SEFB 00001241 F 0 319a F 15 46 1213= 1214 1219= SEFF 0000122B F 0 318a F 15 45 1157= 1158 1163= SETTAPE 0000120B F 0 321a F 14 58 F 15 47 1050= 1051 1056= TALON F 15 39= 1566 TAPECB 0000103D F 0 161 287= 313a TAPEFUNC 00001260 F 0 320a F 15 48 1061 1320= 1321 1327= TAPELOAD 00001040 F 0 315a TAPELOAD F 14 40= TAPELOAD 00001040 F 14 41 49= 161 TAPENRLOAD 00001055 F 0 162 F 14 42 85= TOPL 00002000 F 0 166j 291= TOPLNAME 0000103E F 0 163 289= TOPLSTRT 00001C00 F 0 164 228 235 290= 291e VERSION 00001001 F 0 123= WRITEFM 000011F6 F 0 326a F 15 50 997= 999 1004= WRITETAPE 0000113C F 0 325a F 15 49 508= 510 519= 377 END TAPEBOOT of bootstrap BOOT 00001000 F 0 108 119= 311a TAPEBOOT F 0 107= 377 378 END of enclosing block