Trailing-Edge
-
PDP-10 Archives
-
bb-bt99e-bb
-
plrini.c08
There is 1 other file named plrini.c08 in the archive. Click here to see a list.
INS 30/1 ;08C1
GLOB <G$REEL>
REP 12/4 ;08C2
MOVX S1,TV.OVR!TV.INC ;Get bits to clear
ANDCAM S1,TCB.IL(B) ;Zap everything
WIT
MOVX S1,TV.OVR ;Get bits to clear
ANDCAM S1,TCB.IL(B) ;Zap everything
SETZM TCB.IR(B) ;CLEAR REQUEST-ID
SETZM TCB.II(B) ;CLEAR INCREMENT
REP 46/4 ;08C3
SKIPE TCB.IV(B) ;A REELID SPECIFIED?
JRST INIL.2 ;YES--NO MORE TO CHECK
WIT
MOVX S1,TV.NEW ;GET /NEW-VOLUME BIT
TDNN S1,TCB.IL(B) ;REINITIALIZING AN OLD TAPE?
SKIPE TCB.IV(B) ;NO--WAS A REELID SPECIFIED?
JRST INIL.2 ;SKIP LABEL AND REELID CHECK
REP 55/4 ;08C4
INIL.2: MOVEI S2,1 ;Assume a default increment
LOAD S1,TCB.IL(B),TV.INC ;Get the increment
SKIPN S1 ;Is there one?
STORE S2,TCB.IL(B),TV.INC ;Save the new value
LOAD S1,TCB.IL(B),TV.CNT ;Get the volume count
MOVX S2,TV.HLD ;Get the /TAPE-DISPOSITION:HOLD bit
CAILE S1,1 ;More then 1 tape ???
ANDCAM S2,TCB.IL(B) ;Yes, zap hold bit
WIT
INIL.2: MOVEI S2,1 ;ASSUME A DEFAULT INCREMENT
SKIPN S1,TCB.II(B) ;GET THE INCREMENT IF THERE IS ONE
MOVEM S2,TCB.II(B) ;SET DEFAULT
MOVE S2,TCB.IL(B) ;GET FLAGS, ETC.
LOAD S1,S2,TV.CNT ;GET VOLUME COUNT
TXNE S2,TV.NEW ;RE-INITIALIZING OLD TAPES?
HLRZ S1,TCB.VP(B) ;GET NUMBER OF REELS TO PROCESS
STORE S1,S2,TV.CNT ;RESET COUNT
TXNE S2,TV.NEW ;/NEW-VOLUME PROCESSING?
TXO S2,TV.HLD ;YES--ALWAYS TURN ON HOLD
CAILE S1,1 ;UNLESS MORE THAN ONE TAPE
TXZ S2,TV.HLD ;THEN ZAP HOLD BIT
MOVEM S2,TCB.IL(B) ;UPDATE FLAGS, ETC.
INS 66/4 ;08C5
TXNE S2,TV.NEW ;/NEW-VOLUME PROCESSING?
SKIPA ;YES--USE PROTECTION (MIGHT BE -1)
REP 6/5 ;08C6
INITAB:
XWD .TAPDV,ININOP ;Skip the drive name block
WIT
INITAB: XWD .TAPDV,ININOP ;Skip the drive name block
INS 21/5 ;08C7
XWD .SIERA,V$ERA ;ERASE THE TAPE
XWD .SINEW,V$NEW ;NEW VOLUME (RE-INITIALIZE OLD TAPE)
XWD .SILST,V$LST ;LIST OF REELIDS
XWD .ORREQ,V$REQ ;REQUEST-ID (/NEW ONLY)
REP 6/6 ;08C8
V$CNT: SKIPA S2,[POINTR TCB.IL(B),TV.CNT] ;Where to store the # vols to do
V$INCR: MOVE S2,[POINTR TCB.IL(B),TV.INC] ;Where to store the Increment
; PJRST V$DATA ;Get and store the data
V$DATA: MOVE S1,0(S1) ;Get the volume id
WIT
V$INCR: MOVE S2,(S1) ;GET INCREMENT
MOVEM S2,TCB.II(B) ;SAVE IT
$RETT ;RETURN
V$CNT: MOVE S2,[POINTR TCB.IL(B),TV.CNT] ;Where to store the # vols to do
MOVE S1,0(S1) ;GET VOLUME COUNT
INS 37/6 ;08C9
V$ERA: SKIPA S2,[POINTR TCB.IL(B),TV.ERA] ;ERASE BIT
V$NEW: MOVE S2,[POINTR TCB.IL(B),TV.NEW] ;NEW BIT
JRST V$ONE ;GO STORE A 1
INS 56/6 ;08C10
V$LST: LOAD S1,ARG.HD(T2),AR.LEN ;GET BLOCK LENGTH
SUBI S1,ARG.DA ;MINUS NUMBER OF OVERHEAD WORDS
$CALL M%GMEM ;GET THIS MUCH CORE
HRL S2,S1 ;MAKE IT LEN,,ADDR
MOVEM S2,TCB.VP(B) ;SAVE FOR LATER
MOVNS S1 ;GET -WORD COUNT
HRL S2,S1 ;MAKE AN AOBJN POINTER TO LIST
MOVEM S2,TCB.VC(B) ;SAVE AS POINTER TO CURRENT REELID
MOVSI S1,ARG.DA(T2) ;POINT TO THE FIRST DATA WORD
HRR S1,TCB.VP(B) ;MAKE A BLT POINTER
HLRZ S2,TCB.VP(B) ;GET NUMBER OF WORDS TO BLT
ADD S2,TCB.VP(B) ;COMPUTE END OF BLOCK
TLZ S2,-1 ;NO JUNK
BLT S1,-1(S2) ;COPY LIST OF REELIDS
$RETT ;AND RETURN
V$REQ: MOVE S1,(S1) ;GET REQUEST-ID
MOVEM S1,TCB.IR(B) ;SAVE FOR ACK TO QUASAR
$RETT ;RETURN
REP 13/8 ;08C11
V$MDFN: MOVEM S1,MDFMSG+.OHDRS+ARG.DA+.RECDN ;Save the drive name
DMOVE S1,[EXP MDFLEN,MDFMSG] ;Aim at the message
PJRST G$SMDA## ;Send answer to MDA
WIT
MOVE S2,TCB.IR(B) ;GET THE REQUEST-ID (IF ANY)
V$MDFN: MOVEM S1,DEVNAM+ARG.DA ;STORE DRIVE NAME
MOVE S1,MDFMSG+.MSFLG ;GET MESSAGE FLAG WORD
TLZE S2,400000 ;ERROR SOMEWHERE?
TXOA S1,AK.NAK ;LITE THE NAK BIT
TXZ S1,AK.NAK ;ELSE CLEAR IT
MOVEM S1,MDFMSG+.MSFLG ;UPDATE FLAGS
MOVEM S2,REQID+ARG.DA ;STORE REQUEST-ID
DMOVE S1,[EXP MDFLEN,MDFMSG] ;AIM AT THE MESSAGE
PJRST G$SMDA## ;SEND ANSWER TO MDA
REP 21/8 ;08C12
$SET (.OARGC,,1) ;One argument
$EOB
$BUILD ARG.DA+.RECSZ ;Build the one block
$SET (ARG.HD,AR.LEN,ARG.DA+.RECSZ) ;Size of the block
$SET (ARG.HD,AR.TYP,.RECDV) ;Block type
$EOB
MDFLEN==.-MDFMSG ;Length of message
WIT
$SET (.OARGC,,2) ;NUMBER OF ARGUMENTS
$EOB
DEVNAM: XWD 2,.RECDV ;LEN,,BLOCK TYPE
EXP 0 ;DEVICE NAME
REQID: XWD 2,.ORREQ ;LEN,,BLOCK TYPE
EXP 0 ;REQUEST-ID
MDFLEN==.-MDFMSG ;LENGTH OF MESSAGE
INS 24/9 ;08C13
MOVX S1,TV.NEW ;GET /NEW-VOLUME BIT
TDNN S1,TCB.IL(B) ;SPECIAL INITIALIZATION?
JRST VLAB.1 ;NO
PUSHJ P,V$NEWV ;GET FIRST /NEW-VOLUME IF NECESSARY
REP 40/9 ;08C14
VLAB.3: MOVX S1,TS.INI ;Get the initialization bit
WIT
VLAB.3: MOVX S2,TV.NEW ;GET /NEW-VOLUME BIT
TDNN S2,TCB.IL(B) ;SPECIAL TYPE OF INITIALIZATION?
JRST VLAB.4 ;NO
SKIPL TCB.IR(B) ;DID AN ERROR OCCUR?
PUSHJ P,V$FIRS ;NO--GET FIRST REEL BACK ON THE DRIVE
HLRZ S1,TCB.VP(B) ;GET WORD COUNT
HRRZ S2,TCB.VP(B) ;GET ADDR
$CALL M%RMEM ;RELEASE CORE
SETZM TCB.VP(B) ;CLEAR POINTER
VLAB.4: MOVX S1,TS.INI ;Get the initialization bit
REP 16/10 ;08C15
LABE.3: MOVX S1,TV.OVR ;Get ignore expiration bit
TDNE S1,TCB.IL(B) ;Ignoring expiration?
JRST LABE.6 ;Yes, just write the labels
;Here to check expiration
PUSHJ P,L$RVOL## ;Read the VOL1 record, find LT
JUMPF [DMOVE S1,[EXP CCETYP,NTPTXT]
JRST LABE.2 ] ;Try again
PUSHJ P,L$HDEX## ;Make sure first file has expired
WIT
LABE.3: MOVE S1,TCB.IL(B) ;GET INITALIZATION FLAGS
TXNN S1,TV.NEW ;USER WANTS TO RE-INIT AN OLD TAPE?
TXNN S1,TV.OVR ;OPR WANTS TO OVERRIDE EXPIRATION DATE?
SKIPA
JRST LABE.6 ;GO WRITE LABELS
PUSHJ P,L$RVOL## ;READ VOL RECORDS
JUMPF [DMOVE S1,[EXP CCETYP,NTPTXT]
JRST LABE.2 ] ;Try again
MOVX S1,TV.NEW ;GET /NEW-VOLUME BIT
TDNN S1,TCB.IL(B) ;USER WANTS TO RE-INIT AN OLD TAPE?
JRST LABE.4 ;NO
JMPUNL LT,LAB3A ;NO REELID STUFF IF UNLABELED
MOVE T1,[CPTRI ^D5,0(BUF)] ;VOLID STORE IN CP 5-10
MOVE T2,[POINT 8,TCB.VL(B)] ;COPY TO HERE
HRRZI T3,6 ;SIX CHARACTERS
HRL T3,L$CVTT##(LT) ;GET CONVERSION ROUTINE ADDR
PUSHJ P,L$STST## ;COPY TEXT
CAIE LT,LT.SL ;ANSI?
CAIN LT,LT.SUL ;ANSI WITH USER LABELS?
SKIPA S1,TCB.OI(B) ;GET OWNER PPN
LAB3A: MOVEI S1,0 ;CLEAR OUT OWNER PPN
MOVEM S1,TCB.VO(B) ;DEFAULT THE ONE ON THE TAPE
PUSHJ P,L$RUVL## ;READ UVL1 RECORD FOR PROT AND PPN
PUSHJ P,NEWCHK ;PERFORM NEW-VOLUME CHECKS
JUMPF LABE.2 ;GIVE UP ON FAILURE AND TRY ANOTHER
LABE.4: MOVX S1,TV.OVR ;GET /OVERRIDE BIT
TDNE S1,TCB.IL(B) ;OPR WANTS TO OVERRIDE EXPIRATION DATE?
JRST LABE.5 ;YES
PUSHJ P,L$HDEX## ;ELSE CHECK THE DATE
INS 29/10 ;08C16
MOVX S1,TV.ERA ;GET ERASE BIT
TDNN S1,TCB.IL(B) ;WANT TO ZAP THE TAPE?
JRST LABE.6 ;NO
MOVEI S1,'DSE' ;GET CODE
PUSHJ P,T$POS## ;DO DATA SECURITY ERASE
SKIPT ;DID IT WORK?
PUSHJ P,ERACHK ;MAYBE WE HAVE TO TELL THE OPERATOR
MOVEI S1,'REW' ;NOW REWIND THE TAPE
PUSHJ P,T$POS## ; BACK TO THE LOAD POINT
INS 45/10 ;08C17
NEWCHK: JMPUNL LT,.RETT ;NOTHING TO CHECK IF UNLABELED
MOVEI S1,TCB.VL(B) ;POINT TO REELID STORAGE
PUSHJ P,O$CN86## ;CONVERT TO SIXBIT
CAME S2,TCB.IV(B) ;THE SAME?
JRST NEWCE1 ;NO--TRY ANOTHER TAPE
CAIE LT,LT.SL ;ANSI?
CAIN LT,LT.SUL ;ANSI WITH USER LABELS?
SKIPA S1,TCB.VO(B) ;YES--GET VOLUME OWNER (FROM TAPE)
$RETT ;NOTHING ELSE TO CHECK
MOVE S2,TCB.OI(B) ;GET PROSPECTIVE NEW OWNER
PUSHJ P,I$OWN## ;SEE IF THEY'RE THE SAME
JUMPF NEWCE2 ;NO--GET ANOTHER TAPE
$RETT ;LOOKS LIKE A GOOD TAPE
NEWCE1: MOVEM S2,G$REEL## ;SAVE IN A SAFE PLACE
DMOVE S1,[EXP VIDTYP,VIDTXT] ;POINT TO TYPE AND TEXT BLOCKS
$RETF ;TRY ANOTHER TAPE
NEWCE2: DMOVE S1,[EXP PPNTYP,PPNTXT] ;POINT TO TYPE AND TEXT BLOCKS
$RETF ;TRY ANOTHER TAPE
VIDTYP: ASCIZ |Volume-id mismatch during tape reinitialization|
VIDTXT: ITEXT (<Tape ^W/G$REEL/ mounted when expecting ^W/TCB.IV(B)/
Please try another tape>)
PPNTYP: ASCIZ |PPN mismatch during tape reinitialization|
PPNTXT: ITEXT (<Tape owned by ^U/TCB.VO(B)/ when expecting ^U/TCB.OI(B)/
Please try another tape>)
; Check erase failures
ERACHK: MOVE S1,TCB.IL(B) ;GET INITIALIZATION FLAGS
TXZN S1,TV.NOE ;DOES OPR ALREADY KNOW THIS?
POPJ P, ;YES--JUST RETURN
MOVEM S1,TCB.IL(B) ;UPDATE FLAGS
MOVX S1,TV.NEW ;GET /NEW-VOLUME
TDNN S1,TCB.IL(B) ;WHO REQUESTED THIS?
SKIPA S1,[ERATX2] ;THE OPERATOR ON SET TAPE INIT COMMAND
MOVEI S1,ERATX3 ;THE USER ON MOUNT COMMAND
$WTO (<^T/ERATX1/>,<^T/(S1)/>,TCB.OB(B),$WTFLG(WT.SJI))
POPJ P, ;RETURN
ERATX1: ASCIZ |Hardware does not support data security erase|
ERATX2: ASCIZ |Function requested by the operator|
ERATX3: ASCIZ |Function requested by user|
INS 9/11 ;08C18
NEWTYP: ASCIZ /Wrong tape for reinitialization/
INS 1/16 ;08C19
SUBTTL V$NEWV - Routine to get the next "new" volume
; This routine is used only for /NEW-VOLUME processing. In this
; case, QUASAR generates the SET TAPE INITIALIZE message and
; provides a list of reelids. This list comes from the user's
; MOUNT /REELID:(reel1,reel2,...)/NEW-VOLUME command. This mechanism
; is used to tell MDA to re-initialize existing tapes already
; owned by the user.
V$NEWV: SETZM TCB.IV(B) ;ASSUME NO MORE
SKIPL S1,TCB.VC(B) ;GET AOBJN POINTER TO CURRENT REELID
$RETF ;ALL DONE!
MOVE S2,(S1) ;GET A REELID
MOVEM S2,TCB.IV(B) ;SET IT UP FOR LBLINI
AOBJN S1,.+1 ;ADVANCE POINTER
MOVEM S1,TCB.VC(B) ;UPDATE FOR NEXT TIME
$RETT ;RETURN
SUBTTL V$FIRST - Routine to get the first volume mounted again
; This routine is required for /NEW-VOLUME processing. Before telling
; QUASAR we're done, we have to get the first reel mounted again so the
; world doesn't fall apart.
; Call: MOVE B, TCB address
; PUSHJ P,V$NEXT
;
; TRUE return: First volume back on the drive
; FALSE return: The operator is very unsocialble
;
V$FIRS: LOAD S1,TCB.IL(B),TV.CNT ;GET COUNT OF REELS INITIALIZED
SOJLE S1,.POPJ ;RETURN IF MORE THAN ONE
SKIPN S1,TCB.VP(B) ;HAVE A LIST OF REELIDS?
$STOP (NFR,<No first reel for reinitialization>)
MOVE S1,(S1) ;GET FIRST REELID
MOVEM S1,TCB.IV(B) ;SAVE IT AWAY
MOVEI S1,FIRTX1 ;POINT TO TYPE TEXT
MOVEI S2,FIRTX2 ;POINT TO MAIN TEXT
PUSHJ P,V$TAPE ;GET THE TAPE MOUNTED
JUMPT .POPJ ;RETURN IF ALL IS WELL
POPJ P, ;RETURN
FIRTX1: ASCIZ |Please load first tape again|
FIRTX2: ITEXT (<The reelid is ^W/TCB.IV(B)/; it will be identified with request-id ^D/TCB.IR(B)/>)
REP 11/16 ;08C20
V$NEXT: PUSHJ P,V$NVID ;Generate the next volume id
JUMPF .POPJ ;Can't, so quit
MOVEI S1,[ASCIZ/Please load next tape to be initialized/]
MOVEI S2,[ITEXT(<It will be initialized as an unlabeled tape>)]
JMPUNL LT,NEXT.1 ;Go if unlabeled
MOVEI S2,[ITEXT(<Its volume identifier will be ^W/TCB.IV(B)/>)]
NEXT.1: PJRST V$TAPE ;Get that tape up
WIT
V$NEXT: MOVX S2,TV.NEW ;GET /NEW-VOLUME BIT
TDNE S2,TCB.IL(B) ;SPECIAL TYPE OF INITIALIZATION?
JRST NEXT.1 ;YES
PUSHJ P,V$NVID ;GENERATE A NEW REELID
JUMPF .POPJ ;CAN'T
MOVEI S1,NXTTXT ;GET TYPE TEXT
HLRZ S2,LBLITX(LT) ;GET ADDR OF NORMAL-INIT ITEXT BLOCK
PJRST V$TAPE ;GET THE NEXT TAPE
NEXT.1: PUSHJ P,V$NEWV ;GET NEXT REELID REQUESTED BY USER
JUMPF .POPJ ;NO MORE TO DO
MOVEI S1,NXTTXT ;GET TYPE TEXT
HRRZ S2,LBLITX(LT) ;GET ADDR OF RE-INIT ITEXT BLOCK
PJRST V$TAPE ;GET THE NEXT TAPE
NXTTXT: ASCIZ |Please load the next tape|
; Normal-initialization ANSI tape message
NXTNI1:
; Normal-initialization Non-ANSI tape message
NXTNI2: ITEXT (<It will be initialized as ^T/@LBLTAB(LT)/ tape. The
volume-id will be ^W/TCB.IV(B)/.>)
; Normal-initialization unlabeled tape message
NXTNI3: ITEXT (<It will be initialized as ^T/@LBLTAB(LT)/ tape.>)
; New-volume ANSI tape message
NXTNV1: ITEXT (<It will be reinitialized as ^T/@LBLTAB(LT)/ tape. The
volume-id will be ^W/TCB.IV(B)/.>)
; New-volume non-ANSI tape message
NXTNV2: ITEXT (<It will be reinitialized as ^T/@LBLTAB(LT)/ tape. Make
sure volume ^W/TCB.IV(B)/ is mounted. It is impossible for the
tape labeler to verrify owner information using these type
of labels.>)
; New-volume unlabeled tape message
NXTNV3: ITEXT (<It will be reinitialized as ^T/@LBLTAB(LT)/ tape. Make
sure volume ^W/TCB.IV(B)/ is mounted. It is impossible for the
tape labeler to verrify volume-id or owner information using
these type of labels.>)
LBLTAB: [ASCIZ |an unlabeled|]
[ASCIZ |an ANSI|]
[ASCIZ |an ANSI|]
[ASCIZ |an IBM|]
[ASCIZ |an IBM|]
[ASCIZ |an unlabeled|]
[ASCIZ |an unlabeled|]
[ASCIZ |an unlabeled|]
[ASCIZ |an ASCII-COBOL|]
[ASCIZ |a sixbit-COBOL|]
[ASCIZ |an unlabeled|]
LBLITX: NXTNI3,,NXTNV3
NXTNI1,,NXTNV1
NXTNI1,,NXTNV1
NXTNI2,,NXTNV2
NXTNI2,,NXTNV2
NXTNI3,,NXTNV3
NXTNI3,,NXTNV3
NXTNI3,,NXTNV3
NXTNI2,,NXTNV2
NXTNI2,,NXTNV2
NXTNI3,,NXTNV3
REP 18/17 ;08C21
PJRST O$NTAP## ;Get a new tape up
WIT
PUSHJ P,O$NTAP## ;GET A NEW TAPE
JUMPT .POPJ ;RETURN IF ALL IS WELL
MOVSI S1,400000 ;MUST FLAG THE ERROR
IORM S1,TCB.IR(B) ;SO QUASAR WON'T SELF DESTRUCT
POPJ P, ;AND RETURN
REP 43/18 ;08C22
NVID.3: LOAD S1,TCB.IL(B),TV.INC ;Get the amount to move
WIT
NVID.3: MOVE S1,TCB.II(B) ;GET THE AMOUNT TO MOVE
REP 25/19 ;08C23
MOVEI S1,G$TXTB## ;POINT TO TEXT BUFFER
$WTO (<Volume initialized>,<^T/(S1)/>,TCB.OB(B),$WTFLG(WT.SJI))
WIT
MOVX S1,TV.NEW ;GET /NEW-VOLUME BIT
TDNE S1,TCB.IL(B) ;RE-INITIALIZING AN OLD TAPE?
SKIPA S1,[[ASCIZ |reinitialized|]]
MOVEI S1,[ASCIZ |initialized|]
MOVEI S2,G$TXTB## ;POINT TO TEXT BUFFER
$WTO (<Volume ^T/(S1)/>,<^T/(S2)/>,TCB.OB(B),$WTFLG(WT.SJI))
SUM 98225