.MCALL .MODULE .MODULE BUP,VERSION=61,COMMENT=,AUDIT=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .SBTTL ****************************** .SBTTL *Backup Utility Program (BUP)* .SBTTL ****************************** .ENABL LC,GBL .Audit .BUPSUB, .BUPBAK, .BUPRS, .BUPDIR, .BUPCMD, .BUPINI .Audit .BUPIMA, .BUPSRM, .BUPDRS, .BUPDDI, .BPMT1, .BPMT2 ;+ ; Last revised: ; 07-Oct-89 R. Hamilton RT-11 V5.5 Development ; 13-Jan-1998 TDS 061 BUPDIR modified for 4-digit years. ;- ;+ ; BUP - Is a Backup/Restore program for RT-11 V5 ; ; HIGHLIGHTS: ; ; 1. Multiple volume backup/restore for random access storage devices ; ; 2. Multiple volume backup/restore for files on random access devices ; ; 3. Backup operation of random access devices into sequential access ; magtape, achieving maximum speed of operation on special streaming ; magtapes. ; ; 4. Restore operation of sequential access magtape into random access ; storage devices. ; ; 5. Directory operation giving a summary of the information stored ; on a set of backup volumes. ; ; 6. Initializion of backup volumes with scan of bad blocks. ; ; 7. Restore of files from within a backup device. The device can ; be sequential or non-sequential(tape), and the file can expand ; across boundaries of volumes. ; ; 8. Verify operation on all of the data transfer commands. ;- .SBTTL The BUP module's MAIN ;+ ; This module is the root of the program. It contains the global ; definitions, the storage locations, and the messages used thru the ; program. In addition it performs the following functions: ; ; o resets the stack pointer ; ; o initializes some locations, purges channels and releases handlers. ; ; o retrieves the command from the user. ; ; o calls appropriate subroutines in overlays to check inputs, switches, ; and devices. Dispatches to appropriate action routine. ; ; o once an operation is complete, it prompts the users for further ; commands ;- .SBTTL PSECT ordering ;+ ; The ordering of the Psects is performed here. ;- .PSECT IMPURE,D .PSECT .LIBP. .PSECT .LIBD. .PSECT MAIN .PSECT PATCH,RW,I .SBTTL OPTN$ macro ;+ ; OPTN$ - the option macro creates a table with the options accepted ; by BUP. ; ; Contents of entrys: ; ; +-----------------+ ; ! RES. ! OPTIO ! ; +-----------------+ ; ! RES. ! GIVEN ! ; +-----------------+ ; ; Where, ; RES. - reserved for future ; ; OPTION - ASCII equivalent for option ; ; GIVEN - = 0 if option was not specified ; = -1 if option was specified ; ; Calling the macro ; ; OPTN$ N --> SET UP OPTION N ; ; The option processor will fill the information on the table at execution ; time. To access the information in the table, i.e. if a switch was given ; you can use the following label: GIV.x where x is the switch character. ; ; Symbol definition GIVEN ==: 2 ; Offset to given OPTSIZ =: 4 ; Size of entry in table ; Macro definition .MACRO OPTN$ OP .BYTE ''OP .BYTE 0 GIV.'OP::.BYTE 0 .BYTE 0 .ENDM .SBTTL Definitions and Equates .MCALL .CSISPC .EXIT .GTIM .GTLIN .GVAL .PRINT .RCTRLO ;+ ; SYSTEM.MLB can be used only when ULBMAC is made compatible. They ; have incompatible definitions of the DS macro. ; ; .LIBRARY "SRC:SYSTEM.MLB" ; .MCALL .DSTDF .FIXDF .SYCDF ; .MCALL .ERMDF ; .FIXDF GLOBAL=YES ; .SYCDF GLOBAL=YES ; .DSTDF GLOBAL=YES ; .ERMDF GLOBAL=YES ;- ; Offsets for RAD50 storage of command line OUSPSZ ==: 12 ; Size of CSI output spec(bytes) INSPSZ ==: 10 ; Size of CSI input spec(bytes) INSPST ==: ; Offset to start of input specs SPCSIZ ==: + ; Size of CSI filespecs ; Particular disk type (.DSTATUS) codes DEV.TT ==: 4 ; .DSTAT code for TT DEV.DL ==: 5 ; .DSTAT code for RL01/2 DEV.DM ==: 23 ; .DSTAT code for RK06/7 ; Other .DSTATUS definitions DEVID$ ==: 000377 ; Device ID mask VARSZ$ ==: 000400 ; Variable sized device ABTIO$ ==: 001000 ; Enter abort code on any exit SPFUN$ ==: 002000 ; Handler does SPFUNs HNDLR$ ==: 004000 ; Enter abort code on job abort SPECL$ ==: 010000 ; Special Directory device WONLY$ ==: 020000 ; Write-only device RONLY$ ==: 040000 ; Read-only device FILST$ ==: 100000 ; Random access device ER.IUN ==: 6 ; LOOKUP error, Invalid Unit .SBTTL Homeblock offsets HMBLK ==: 1 ; Homeblock LBN ; BUP's Reserved Homeblock Field - for BUP disks only DK.TAG ==: 252 ; BUP tag to identify a Backup volume BU.TAG ==: "BU ; Contents of tag DK.TG2 ==: 254 ; 2nd BUP tag word BU.TG2 ==: 'Q ; Contents of 3rd tag byte DK.FIL ==: 255 ; 9-character BUP filename ; (blank, beginning with V5.5 BUP) DK.VOL ==: 266 ; BUP volume number DK.TOT ==: 270 ; BUP total volumes of this set ; (zero, beginning with V5.5 BUP) DK.SIZ ==: 272 ; BUP size of smallest volume in set ; (zero, beginning with V5.5 BUP) DK.TSZ ==: 274 ; BUP total size of volumes stored ; (zero, beginning with V5.5 BUP) ; DEC-wide homeblock fields PCLUST ==: 722 ; Pack cluster size SYSVER ==: 726 ; System version DK.VAL ==: 730 ; Volume ID DK.OWN ==: 744 ; Owner DK.OLN ==: 14 ; Length of owner field DK.VTO ==: 760 ; System ID .SBTTL RT-11 Disk Directory Offsets and Definitions ; Directory Segment Header offsets D.TOTA ==: 0 ; Available segments D.NEXT ==: 2 ; Next segment D.HIGH ==: 4 ; Highest segment in use D.EXTR ==: 6 ; Extra bytes per directory segment D.STRT ==: 10 ; Block where first file starts D.LENG ==: 12 ; Point to first segment entry ; Disk directory entry offsets and symbolics E.STAT ==: 0 ; Status word E.TENT ==: 400 ; Tentative entry E.MPTY ==: 1000 ; Empty entry E.PERM ==: 2000 ; Permanent entry E.EOS ==: 4000 ; End of segment E.PROT ==: 100000 ; Permanent entry E.NAME ==: 2 ; File name 3 char E.FN2 ==: E.NAME+2 ; File name 3 char E.TYPE ==: E.NAME+4 ; File type 3 char RAD50 E.LENG ==: 10 ; File size E.DATE ==: 14 ; Offset creation date DA.YR ==: 000037 ; Year mask DA.DAY ==: 001740 ; Day mask DA.MON ==: 036000 ; Month mask DA.AGE ==: 140000 ; Age mask E.ELEN ==: 16 ; Size of directory entry SF.SIZ ==: 373 ; SPFUN for determining volume size .SBTTL Magtape directory offsets and symbolics MT.VOL ==: "VO ; Volume label identifier MT.HDR ==: "HD ; Hdr label identifier MT.EOF ==: "EO ; Eof label identifier .SBTTL ANSI Tape Label Offsets ;+ ; (See American National Standard X3.27-1987 or ISO 1001-1986) ;- AV1.VI ==: 4. ; VOL1 Volume ID field AV1.II ==: 24. ; VOL1 Implementation ID field AV1.LV ==: 79. ; VOL1 Level Version field AH1.FI ==: 4. ; HDR1 File Identifier AH1.FS ==: 21. ; HDR1 File Set Identifier AH1.SC ==: 27. ; HDR1 File Section Number AH1.SN ==: 31. ; HDR1 Sequence Number AH1.GN ==: 35. ; HDR1 Generation Version Number AH1.DA ==: 41. ; HDR1 Creation Date AH1.EX ==: 47. ; HDR1 Expiration Date AH1.FA ==: 53. ; HDR1 File Accessibility AH1.BC ==: 54. ; HDR1 Block Count AH1.II ==: 60. ; HDR1 Implementation ID field AH2.RF ==: 4. ; HDR2 Record Format AH2.BL ==: 5. ; HDR2 Block Length AH2.RL ==: 10. ; HDR2 Record Length AH2.SZ ==: 16. ; HDR2 File Size field (our def) AH2.CB ==: 24. ; HDR2 Current Block (our def) AH2.OL ==: 50. ; HDR2 Offset Length field ; Magtape SPFUN codes SF.MST ==: 367 ; STREAM SF.MRD ==: 370 ; READ RECORD SF.MWR ==: 371 ; WRITE RECORD SF.MOR ==: 372 ; REWIND_OFFLINE SF.MRE ==: 373 ; REWIND SF.MWE ==: 374 ; WRITE/EXTENDED_GAP SF.MBS ==: 375 ; BACKSPACE SF.MFS ==: 376 ; FORWARDSPACE SF.MTM ==: 377 ; WRITE TAPEMARK ; BUP magtape data blocking definitions TBLOCK ==: 8. ; 8 blocks per tape record TWNCT ==: 2048. ; Word count equivalent TREC ==: 4096. ; Byte count equivalent .SBTTL Magtape Errors and Exceptions ; (FUTURE - use .ERMDF) ; Error codes for $ERRBY = ER.EOF = 0 (EOF error) EM.EOF ==: 1 ; Tapemark encountered EM.EOT ==: 2 ; Indicates EOT zone detected EM.BOT ==: 4 ; Begining of Tape encountered ; Error codes for $ERRBY = ER.HRD = 1 ("HARD" error) EM.OFL ==: 1 ; Off_Line EM.POS ==: 2 ; Position_Lost EM.WLK ==: 4 ; Write_Locked EM.BIG ==: 5 ; Data block larger than read EM.SML ==: 6 ; Data block smaller than read .SBTTL System Communication Area $JSW ==: 44 ; Job status word GTLIN$ ==: 10 ; Non-terminating .GTLIN EDIT$ ==: 20 ; DISABLE_SL bit RSTRT$ ==: 20000 ; Re-enterable TTLC$ ==: 40000 ; lower case bit $USRTO ==: 50 ; Highest location in memory $ERRBY ==: 52 ; Error byte ERRBYT ==: 52 ; Error byte .SBTTL RT-11 Resident Monitor Offsets $BLKEY ==: 256 ; Cached Directory Block $SYSVE ==: 276 ; System version offset $CNFG1 ==: 300 ; 1st configuration word FJOB$ ==: 000200 ; Foreground loaded bit KT11$ ==: 010000 ; Memory Management Support .SBTTL Miscellaneous SYS.ID ==: 5 ; Current system version ; Channel Status masks/offsets CSW.DI ==: 76 ; Device index mask CST.DU ==: 10 ; Offset to device unit number ; returned from .CSTAT CST.DN ==: 12 ; Offset to device name in RAD50 ; returned from .CSTAT ; Block definitions RESBLK ==: 10 ; Reserved blocks directory ONEBLK ==: 256. ; 256 words per block TWOBLK ==: 512. ; 512 words (two blocks) ; ASCII definitions BEEP ==: 7 ; Bell (or beep) LF ==: 12 ; Line feed CR ==: 15 ; Carriage return BLANK ==: 40 ; Blank character ZERO ==: 60 ; Number zero ASTERK ==: 132500 ; RAD50 code for '*' CHAN0 == 0 ; Channel zero symbolic CHAN1 == 1 ; Channel one symbolic CONSOL == 0 ; Get input from console BIT0 == 1 ; Octal bit zero BIT1 == 2 BIT2 == 4 BIT3 == 10 BIT4 == 20 BIT5 == 40 BIT6 == 100 BIT7 == 200 ; Octal bit seven BIT8 == 400 BIT9 == 1000 BIT10 == 2000 BIT11 == 4000 BIT12 == 10000 BIT13 == 20000 BIT14 == 40000 BIT15 == 100000 ; Octal bit fifteen ; Option word definitions A$GRP == BIT15 ; Group A commands ; == BIT13 L$OPT == BIT12 ; Directory listing command Z$OPT == BIT11 ; /INITIALIZE option ; == BIT10 M$OPT == BIT9 ; /NOREWIND option S$OPT == BIT8 ; /SAVESET option B$GRP == BIT7 ; Group B commands XIF$OP == BIT6 ; Sub-file restore command XI$OPT == BIT5 ; Device restore command X$OPT == BIT4 ; File restore command NO$OPT == BIT3 ; File backup (NO switch) I$OPT == BIT2 ; Device backup command XF$OPT == BIT1 ; Restore/File command T$OPT == BIT0 ; Tape operation command WRDISK ==: 123 ; Unique code for Restore permission ; OPTAC2 bit definitions XM$ENV ==: BIT15 ; XM environment XM$REG ==: BIT14 ; XM Region has been created XM$RGF ==: BIT13 ; XM Region Failed ; IGTDIR/IGTENT error codes E.IVDF ==: -5. ; invalid directory E.NOMA ==: -20. ; not-a-match .SBTTL IMPURE - Impure data .SBTTL Patchable values .PSECT IMPURE,D ..MBAD::.WORD 25. ; Maximum # of bad blocks possible ..ARPE::.WORD 3 ; No. of allowable records past EOT ; when reading old BUP tapes ..BUPT:: TMPFIL::.RAD50 /WF BUPTMPTMP/ ; Temporary file's spec ..BUPF:: DEFNAM::.RAD50 /BACKUPBUP/ ; Default saveset name .SBTTL Switch Table ; OPTION block NUMOPT::.WORD 0 ; NUMber of OPTions entered OPTTBL:: ; OPTN$ A ; reserved OPTN$ B ; NON-BUP TAPE OK ; OPTN$ C ; not necessarily reserved ; OPTN$ D ; reserved OPTN$ E ; SYSTEM OPTN$ F ; FILE restore option OPTN$ G ; NO BADBLOCK SCAN option ; OPTN$ H ; not necessarily reserved OPTN$ I ; DEVICE switch ; OPTN$ J ; reserved ; OPTN$ K ; reserved OPTN$ L ; DIRECTORY switch OPTN$ M ; NOREWIND-tape option ; OPTN$ N ; reserved OPTN$ O ; ONLY tape directory option OPTN$ P ; EXCLUDE ; OPTN$ Q ; not necessarily reserved OPTN$ R ; RT-11 logical disk SUBSET file OPTN$ S ; SAVESET name option ; OPTN$ T ; not necessarily reserved ; OPTN$ U ; reserved OPTN$ V ; VERIFY copy option OPTN$ W ; NOLOG option OPTN$ X ; RESTORE switch OPTN$ Y ; NOQUERY switch OPTN$ Z ; INITIALIZE switch .WORD 0 ; End of table .SBTTL Device codes and names DKDEV:: .RAD50 /DK/ ; RAD50 equivalent for default TTDEV: .RAD50 /TT/ ; RAD50 equivalent for console DEV1:: .BYTE 0 ; device code for output DEV2:: .BYTE 0 ; device code for input OUTDEV::.WORD 0 ; RAD50 output device INPDEV::.WORD 0 ; RAD50 input device ; $NOUTFL Bit7 on--> no output file specification NOUTFL::.WORD 0 ; Flag to indicate no output spec OPTACT::.WORD 0 ; OPTion ACTion word OPTAC2::.WORD 0 ; 2nd Option Word NOTBAK::.WORD 0 ; NOT BACKUP volume ; flag for command line without filename ; NONAME Bit15 on--> no filename on input ; Bit7 on--> no filename on output NONAME::.WORD 0 ; NO fileNAME flag ; Flag to indicate that a magtape operation is requested ; SEQDEV BIT7 on--> a magtape operation ; SEQPOS BIT7 ON --> magtape on output ; BIT15 ON -> magtape on input SEQDEV::.WORD 0 SEQPOS::.WORD 0 ; Storage locations SAVEPC::.WORD 0 ; Save PC SAVESP::.WORD 0 ; Save SP .SBTTL Output filespec in RAD50 OUTFIL::.WORD 0 ; Device RAD50 .WORD 0 ; Filename .WORD 0 ; Filename .WORD 0 ; Type .SBTTL Input filespec in RAD50 INFIL:: .WORD 0 ; Device .WORD 0 ; Filename .WORD 0 ; Filename .WORD 0 ; Type .SBTTL Input and Output filespecs in ASCII OUTASC::.BLKB 3. ; Device name and unit number OUTNAM::.BLKB 9. ; Filename and extension INASC:: .BLKB 3. ; Input device name and unit INNAM:: .BLKB 9. ; Input name and ext .BYTE 200 ; (For .PRINT of filename) .EVEN .SBTTL Global BACKUP and RESTORE data SIZBLK::.WORD 0 ; Size in blocks of device BLKAVA::.WORD 0 ; Blocks available (=size-resblk) TOTLLN::.WORD 0 ; Total saveset length NUMVOL::.WORD 0 ; Number of volumes needed/created VOLNUM::.WORD 0 ; Current volume number VOLCOP::.WORD 0 ; Volumes copied so far COPBLK::.WORD 0 ; Current blocks copied (dynbuf) CWCNT:: .WORD 0 ; Word count of above (dynbuf) BLOCK:: .WORD 0 ; Current blocks being read/written OUTBLK::.WORD 0 ; Logical output block number SMALLE::.WORD 0 ; Size of smaller volume of set BLKSIZ::.WORD 0 ; Size of file to create (/x) FILSIZ::.WORD 0 ; Size of file to backup (image) OUTSIZ::.WORD 0 ; Size of first output volume ENTSIZ::.WORD 0 ; Size requested with .ENTER CONBLK::.WORD 0 ; Size of container portion NFTRAN::.WORD 0 ; No. of files transferred FNDBTS::.WORD 0 ; Files-found bitmap (IGT*) RETCOD::.WORD 0 ; Code to be returned on exit. BLKVER::.WORD 0 ; Blocks yet to verify on volume BUFBYT::.WORD 0 ; Size of each buffer in bytes. BUFBLK::.WORD 0 ; Size of each buffer in blocks. SAVINB::.WORD 0 ; Starting block for volume INBLK:: .WORD 0 ; Logical input block number BLKCOP::.WORD 0 ; Blocks to be copied RESUME::.WORD 0 ; Local next input blk no. REMFIL::.WORD 0 ; No. blocks remaining in file ASCLST::.BLKB <6.*11.> ; ASCII input filespec list WILDFG::.BYTE 0 ; Wildcard-specified flag NISPEC::.BYTE 0 ; Number of non-/S input specs VERFYG::.BYTE 0 ; Verifying flag NEEDOP::.BYTE 0 ; Indicates NEED LIST FILE OPEN TMPOPN::.BYTE 0 ; Indicates TMP file is open CLOBSY::.BYTE 0 ; Indicates user has RESTORED over SY .EVEN .SBTTL Data related to magtape operations SPFBUF::.WORD 0 ; Memory area to start tape operations RBLOCK::.WORD 0 ; Number of blocks (n*4k=rblocks) NUMSPF::.WORD 0 ; Number of SPFUNS to issue STRBUF::.WORD 0 ; Set or clear streaming bit LKBLK:: .WORD 0,0,0,0 ; Error information stored here LBLOCK::.WORD 0 ; Number of blocks for adjusted r/w BADTOT::.WORD 0 ; Number of bad blocks encountered TEMP:: .WORD 0 ; Current block number VCHECK::.WORD 0 ; verify check flag VBAD:: .WORD 0 ; bad block counter on verify .SBTTL EMT block and extra queue elements EMTARE::.BLKW 10. NADDQU == 6 ; No. of additional Queue Elements ADDQUE::.BLKW NADDQU*10. ; Additional queue elements .SBTTL DBLK for NFS lookups DEVSPC::.WORD 0 ; Save RAD50 of device here .WORD 0,0,0 ; Zero for non file lookup TAPDEV::.WORD 0 ; RAD50 tape device name PONLY:: .WORD 0 ; /LIST/ONLY:n value SSSPEC::.WORD 0 ; SAVESET switch with file number .SBTTL Channel variables CHANEL::.WORD 0 ; For subroutines mixed channels TAPCHA::.WORD 0 ; Tape channel DSKCHA::.WORD 1 ; Disk channel INCHAN::.WORD 0 ; Input channel OUTCHA::.WORD 1 ; Output channel TMPCHA::.WORD 2 ; Temporary file channel ; .SPFUN area FUNBUF::.WORD 0. ; Store size here ; .DSTATUS area DSTOUT::.WORD 0 ; 2nd DSTAT word of output device DEVBLK::.BLKW 4. ; Status info block LOGLIN::.BLKB 16. ; log-line filename area LBLBUF::.BLKW 256. ; Buffer area for labels, etc. .SBTTL .CSISPC and .GTLIN area CMDBUF == LBLBUF ; .BLKW 41. ; Command line to CSI FSASC == CMDBUF+82. ; .BLKW 41. ; ASCII command line area ; FSPEC == FSASC+82. ; .BLKW 39. ; CSI file spec area FSPEC:: .BLKW 39. ; CSI file spec area .BLKW 2 ; Make compatible (41. word) array for INIT CMDLIN::.BLKW 41. ; Command line w/o wildcards .SBTTL Default filetypes (extensions) DEFAUL: .WORD -1 ; Default for input (see BUPCMD) .WORD -1 ; output one .WORD -1 ; output two .WORD -1 ; output three ASTERP::.ASCII /*/<200> ; Asterisk prompt for .GTLIN .EVEN .SBTTL Memory allocation and addresses used by FETCH HDRADD::.WORD 0 ; Code top and handler address NHDRAD::.WORD 0 ; Next handler address TOPADD::.WORD 0 ; User highest address BUFADD::.WORD 0 ; Address for r/w buffer BUFAD2::.WORD 0 ; Next buffer address VERBUF::.WORD 0 ; Verify buffer address LIMIT:: .LIMIT ; High extent .SBTTL Messages .NLIST BEX ; Message processor definitions ERRBUP:: .NLCSI PART=PREFIX,TYPE=I ; Prefix string LEVBUP:: .ASCII /X-/<200> ; Level string .EVEN ERRARE:: .BYTE 0 ; Error code .BYTE 0 ; ASCII character level .WORD ERRBUP ; -> To prefix string .WORD LEVBUP ; -> to level byte .WORD MSGTAB ; -> to start of message table .WORD 0 ; -> to filename .WORD START2 ; -> to abort return .SBTTL Error Message table .GLOBL FET,LO1,LO2,RE1,WR1,RE2,WR2,BAK,SPA,VOL,TOO,FEP .GLOBL BBS,BBD,NBB,DUP,ABO,IDO,IND,LO3,MEM,SET,IOS,WSV .GLOBL MIS,DSS,DEQ,DEV,OPT,CMD,ICM,BSZ,NOD,DNA,DWL,DFL .GLOBL RGF,NSY,NOF,VCF,NRT,IOD,IUW MSGLST MSGTAB ERRMSG CMD ;level F ERRMSG DEV ;level F ERRMSG IDO ;level F ERRMSG OPT ;level F ERRMSG IOD ;level F ERRMSG ICM ;level F ERRMSG DEQ ;level F ERRMSG IUW ;level F ERRMSG DUP ;level F ERRMSG DSS ;level F ERRMSG MEM ;level F ERRMSG IND ;level F ERRMSG DFL ;level F ERRMSG FET ;level F ERRMSG LO1 ;level F-E ERRMSG LO2 ;level F ERRMSG LO3 ;level F ERRMSG RE1 ;level F ERRMSG RE2 ;level F ERRMSG WR1 ;level F ERRMSG WR2 ;level F ERRMSG BAK ;level W-F ERRMSG SPA ;level F ERRMSG SET ;level W ERRMSG VOL ;level E ERRMSG BBS ;level I ERRMSG BBD ;level I ERRMSG NBB ;level I ERRMSG TOO ;level F ERRMSG ABO ;level F ERRMSG IOS ;level F ERRMSG WSV ;level F ERRMSG FEP ;level F ERRMSG MIS ;level F ERRMSG BSZ ;level F ERRMSG NOD ;level F ERRMSG DNA ;level F ERRMSG DWL ;level F ERRMSG RGF ;level F ERRMSG NSY ;level W ERRMSG NOF ;level W ERRMSG VCF ;level W ERRMSG NRT ;level W .EVEN MSGEND .SBTTL Messages from main code and parser VERSIO: .NLCSI CSIERR: .ASCIZ /?CSI-F-Invalid command/ SKIP1:: .ASCII <15><12> CRLF1:: .ASCII <15><12><200> CRLF == CRLF1 MSGFOR:: .ASCIZ /Foreground loaded/ ABOMSG:: .NLCSI PART=NAME,TYPE=I .ASCII / - Are you sure? /<200> .SBTTL Messages from image copy operation MESCOP:: .ASCII /Mount output volume/ .ASCII / in / DEVICE:: .BLKB 3. .ASCII /; Continue? /<200> .SBTTL Prompts and Informational Messages MXCOP:: .ASCII /Mount input volume /<200> MESEND:: .ASCII / in / XDEV:: .BLKB 3. .ASCII /; Continue? /<200> BOCOP:: .NLCSI PART=PREFIX,TYPE=I .ASCII /I-Backup /<200> BVOCOP:: .NLCSI PART=PREFIX,TYPE=I .ASCII \I-Backup/Verify \<200> SXCOP:: .NLCSI PART=PREFIX,TYPE=I .ASCII /I-Restore /<200> VXCOP:: .NLCSI PART=PREFIX,TYPE=I .ASCII /I-Verify /<200> SVXCOP:: .NLCSI PART=PREFIX,TYPE=I .ASCII \I-Restore/Verify \<200> STARTD:: .ASCII /operation started from volume /<200> COMPMS:: .ASCIZ /operation is complete/ VERMES:: .NLCSI PART=PREFIX,TYPE=I .ASCII /W-Verification error at block /<200> JNKTXT:: .NLCSI PART=PREFIX,TYPE=I .ASCII /E-Input error at block /<200> .SBTTL Initialize Prompt INIDEV:: .BLKB 3 .ASCII \:/\ .NLCSI PART=NAME,TYPE=I .ASCII \ Initialize; \ RUSURE:: .ASCII \Are you sure? \<200> ; Other BYTE data VONLY:: .BYTE 0 ; Flag indicating /V:ONLY TPOPEN::.BYTE 0 ; Flag indicating TAPE CHAN OPEN INPUT2::.BYTE 0 ; Flag indicating 2nd input spec SYSOUT::.BYTE 0 ; Flag indicating SY: is output BBRDEV::.BYTE 0 ; Flag indicating BBR device .EVEN .LIST BEX ; Make code REENTER-able, and disable SL editing (most of the time) .ASECT ; Make section absolute . = $JSW ; Set location to JSW .WORD RSTRT$!EDIT$ ; Set REENTER-able and NO-SL bits .SBTTL BUP - MAIN code ;+ ; The central code is the switch board for the main code. It calls the ; the necessary routines which perform the functions described above ; ('about the BUP module'). It obtains the processed command line and ; passes it to CSI. CSI errors are detected by looking at the ; carry bit after the call. ; When no input is entered, the utility name and version number is ; printed. ; ; .RUN BUP ; * ; ; FSPEC -> CSI filespec area (RAD50) ; ; FSASC -> Entered command line (ASCII) ;- .PSECT MAIN .ENABL LSB ; Beginning of BUP code BR START2 ; Re-enter branch ; Check RT-11 version for validity START1:: .GVAL #EMTARE,#$SYSVE ; Get System Version Word CMPB #SYS.ID,R0 ; Correct version? BEQ 10$ ; Yes, branch MOV #WSV,R1 ; <-F-Wrong version of RT11> JMP FATAL ; Look at the memory picture. Get the current time. 10$: MOV SP,SAVESP ; Save the stack pointer CALL GETHDR ; Allocate memory .GTIM #EMTARE,#EMTARE+2 ; Do to tweek time. Discard. ; BUP re-start. Save SP, re-enable terminal, do INIT, get command START2:: MOV SAVESP,SP ; Reset the stack pointer, .RCTRLO ; Make sure console can print CALL INIT ; Initialize stuff, CALL GETCMD ; Get user command line, .CSISPC #FSPEC,#DEFAUL,#CMDBUF,#FSASC ; Get filespecs and switches BCC 20$ ; If no error branch .PRINT #CSIERR ; Print CSI error msg BR START2 ; Try again. 20$: TSTB @#FSASC ; Did user type anything? BNE 30$ .PRINT #VERSIO ; No... print version no. BR START2 ; Restart. ; Do major BUP things... Check validity of options, named devices, ; and files. Then dispatch to the appropriate action routine. 30$: CALL SAVEOP ; Save the entered options CALL FILCHK ; check files CALL DEVCHK ; check devices CALL OPTCHK ; check options CALL DISPCH ; Get addr of what to do TST R0 ; Valid action routine address? BEQ START2 ; No.. start all over again CALL PREMSG ; do preliminary messages CALL @R0 ; Perform designated function BR START2 ; Start all over again. .DSABL LSB .SBTTL CREBHB - Create BOOT and HOME blocks for MAKDIR in BUPCMD ; Create boot and home blocks in temp file. ; Called from BUPCMD overlay, but boot and homeblock code is in BUPINI. .ENABL LSB CREBHB::CALL CREBO1 ; Create boot block, BCS 10$ CALL CREHB1 ; Create home block 10$: BIC R0,R0 ;*C* CLR R0 BCC 20$ INC R0 ; R0=1 if CREHB1 or CREBO1 failed 20$: CALLR CMDOVR ; Reload CMD overlay .DSABL LSB .SBTTL Patch space ;+ ; ; The following space can be used to patch BUP. ; ;- .PSECT PATCH,RW,I PATBUP::.BLKW 32. .END START1