Google
 

Trailing-Edge - PDP-10 Archives - BB-FI81B-DD_1989 - 1,4/klone.mic
There are no other files named klone.mic in the archive.
'<SILENCE>
.MIC SET NO MSGLVL 17
!
!
!	    KLONE -- Field Service KLAD pack cloning procedure
!
!	Procedure started at '<time> on '<Day>, '<Date>
!
!
;
; COPYRIGHT (c) 1989 DIGITAL EQUIPMENT CORPORATION.  ALL RIGHTS RESERVED.
;
;
.error ?
.ON CANCEL:GOTO CCTRAP
.MIC SET NO LC
!This procedure will, given a blank disk and a mounted KLAD pack, initialize
!the new pack and copy the entire contents of the KLAD pack onto it.
!
!KLONE is designed to make the KLAD-cloning process simpler and easier.
!
!Before proceeding, KLONE will first check some important system parameters
!and verify the system state.  If there are any problems, KLONE will 
!tell you what problem it encountered and then exit.  If everything is all
!right, KLONE will ask you some questions about the target disk. After you
!have entered your answers, it will verify them and give you the opportunity 
!to change them if they are incorrect.  Default answers are enclosed within
!square brackets ([]).  
!
!
!'<TIME> Performing preliminary checks.
;
;First, see if we can do Super USETI/O.  If Not, punt.
;
.if ($PPN = "[1,2]") .goto begin
.noerror
!
!?You are not logged in as [1,2]
.error
!
!KLONE cannot continue.  You must be logged into [1,2] to clone a KLAD
!pack.
!
.goto done
begin::
;
; here to find the Monitor version number.  If it isn't 7.04 or better, die.
;
.let x=$gettab(%11,%71,oct)	;Mask off whole version
.if($x >= "070400000000") .goto monok
.noerror
!
!?Monitor version is prior to 7.04
!
!KLONE cannot continue.  You must be running TOPS-10 Version 7.04 or later
!to use this procedure.
.error
.goto done
monok::
.let m=$gettab(%206,0,asc)+$gettab(%206,1,asc)+$gettab(%206,2,asc)
.let m=$m+$gettab(%206,3,asc)+$gettab(%206,4,asc)+$gettab(%206,5,asc)
.let m=$m+$gettab(%206,6,asc)+$gettab(%206,7,asc)+$gettab(%206,8,asc)
.let m=$m+$gettab(%206,9,asc)+$gettab(%206,10,asc)+$gettab(%206,11,asc)
.let m=$m+$gettab(%206,12,asc)+$gettab(%206,13,asc)
.let m=$m.["/D ",""]		;truncate string to get rid of boot switch
.let m=$m.[1,"]"]+"]"		;and get rid of trailing nulls etc.
;
;Here to see if enough of Galaxy is running for OPR to be useful...
;
;See if QUASAR, ORION, and PULSAR have PIDs...
.if (GETTAB(%126,%2,DEC) = 0).goto NOQSR
.if (GETTAB(%126,%10,DEC) = 0).goto NOORN
.if (GETTAB(%126,%3,DEC) = 0).goto NOPLR
.goto GALOK
NOQSR::
.noerror
!?QUASAR is not running
.error
.goto NOGAL
NOORN::
.noerror
!?ORION is not running
.error
.goto NOGAL
NOPLR::
.noerror
!?PULSAR is not running
.error
NOGAL::
!
!This procedure requires that GALAXY be up and running.  One of the required
!GALAXY processes has not been found.  Please start GALAXY and re-execute
!KLONE.
!
.goto done
GALOK::
!'<TIME> GALAXY-10 is up and running.
;
;Check for presence of KLAD pack.  If not mounted, ask user to mount it and
;then press RETURN.
;
CHKLAD::
.error
.assign klad foo
.if(noerror).goto kladOK
!
!%No KLAD pack is mounted on this system.
!
!Please mount the original KLAD pack on any free drive.  Press RETURN when
.MIC INPUT X, "the disk has spun up and gone on-line: "
.backto chklad
KLADOK::
!'<TIME> An orginal KLAD pack is mounted on this system.
.DEASSIGN
;
;Find where we were invoked from, and see if DDT is present on SYS...
.let w=$micfil
.error %
.dir SYS:DDT.EXE,sys:FILDDT.EXE
.if(noerror).goto DDTOK
!
.noerror
!?Could not locate SYS:DDT.EXE or SYS:FILDDT.EXE
!
!KLONE could not locate DDT or FILDDT -- support programs it uses to obtain
!system-related information.  Please place these program on SYS: and rerun the
!procedure.
.error
.goto DONE
DDTOK::
!'<TIME> Initial checks complete.
!
;
;Here's where we actually start doing something.
;
;Ask the user for unit ID.
.let h="No default"				;Default for question
!KLONE needs to know the name of the physical disk unit where the destination
!KLAD pack will be mounted.  Please specify a 1 to 4 character unit name.
!
GETD::
.if ($D # "").if ($D # "<") .if ($D # "?") .let h=$D
.MIC INPUT D, "* What physical unit holds the destination disk ['h]? "
.LET D=$D.[1,":"].[1,4]		;truncate either after colon or 4 chars
.if ($D.[1] = "<") .backto GETD
.if ($D.[1] = "?") .GOTO HELPD
.IF ($D = "") .if ($H # "No default").let D=$H
.if ($D # "") .goto CHKD
!%You must specify a device name.  There is no default for this question.
!Type a question-mark (?) for help.
.backto GETD
.GOTO CHKD
HELPD::
.let D=""
!
!This question is asking for the physical disk drive where the new KLAD
!pack will be created.  Specify a four-character unit name, such as
!RPA1, to answer this question.
!
!
!Please specify a 1- to 4-character structure or unit name, without a colon.
!
.BACKTO GETD
CHKD::
;
;Here to check the unit name given.
;
;Create DDT files to check unit name and structure status...
;
!
!'<time> Verifying that unit 'D is a disk drive
.R PIP
*klone1.ddt=tty:
*0/dv.dsk+dv.dir^jzstat:^["/'d/
*devchr 1,^[xand 1,0^[x0/.[^j
*^z
*klone2.ddt=tty:
*pat../^["/'d/
*pat..+.dcsnm/strnam:0/76,,pat..
*dskchr^[xpat..+.dcunt/^[6t;^j
*^z
*^z
.error Z
.mic response z(60)
.r ddt
^[yklone1.ddt
^Z
.if(error)		;dont care -- we only wanted to capture the text
.noerror
.let z=$z.["   ","   "]		;get just the juicy part
.if(z#0).goto chkstr
!
!?Device 'd is not a disk
!
!The unit specification 'd is invalid.  Please re-enter it.
.let d=""
.backto getD
chkstr::
!'<time> Checking unit 'D to see if a system-mounted structure is present...
.error S
.mic response Z(60)
.r ddt
^[yklone2.ddt
^Z
.if(error)
.noerror
.delete klone1.ddt,klone2.ddt
.noerror
.let Z=$Z.["   ","   "]
.if ($Z="").goto nostr
.if ($Z=$D).goto nounit
.IF($Z="KLAD").GOTO KLADNA
!
!%Device 'D has structure 'Z mounted on it.  If you wish to use this
!device, the structure will be dissolved and all previous data on the
!structure will be destroyed.
!
.mic input y,"* Do you wish to use this device anyway [N]? "
.let y=$y.[1,1]		;truncate to 1 letter
.if ($Y="").let y="N"
.if ($Y="N").backto getD
.goto nostr
nounit::
!
!?The device name specified, 'D, is actually the name of a structure,
!rather than a physical unit.  Please re-answer the question.
!
.let D=""
.backto GETD
KLADNA::
!
!?Device 'D has the original KLAD pack mounted on it.  This is the SOURCE
!for the copy operation, rather than the destination.  Please specify a different
!unit name for the destination pack.
!
.let d=""
.backto GETD
nostr::
!
!You have specified the following:
!
!	Destination unit name:	'D
.if ($Z="").goto nost1
!	Structure to dissolve:	'Z
.goto nost2
nost1::
!	[No structure is mounted on this unit]
nost2::
!
.mic input y,"* Is this correct [Y or N, no default]? "
.let y=$y.[1,1]
.if($Y#"Y").IF($Y#"N").backto nost2
.if($Y#"Y").backto getd
;
;Commence.  Dismount existing structure if necessary.
;
.if($Z="").goto nodism
.R OPR
*DISABLE VOLUME-RECOGNITION 'D
*DISMOUNT STRUCTURE 'Z/NOCHECK
*EXIT
.MIC SLEEP 5
!
![Structure 'Z dismounted from unit 'D]
!
nodism::
.r OPR
*DISABLE VOLUME-RECOGNITION 'D
*EXIT
!
!If no pack is mounted on unit 'D, please go mount one now
.mic input x, "and press RETURN when it is spun up and ready: "
!
!'<TIME> Commencing definition of destination pack on unit 'D...
;
;first, blow away the HOM blocks so that the monitor will think its not
;an existing structure...
;
.ctest copy klone3.ddt=tty:
200/0^j0^j0^j0^j0^j0^j0^j0^j0
2400/0^j0^j0^j0^j0^j0^j0^j0^j0
^Z
!'<time> Dissolving structure...
.R FILDDT
'D:/U/P
^[Yklone3.ddt
^Z
.delete klone3.ddt
.if(error)
;
;Now define the structure using the Monitor...
;
!'<TIME> Defining structure...
.R 'M
*NO			;No scratch file
*'D			;Read unit
*
*'D			;Write unit
*
*DEFINE STRUCTURE ZXCV
*'D			;Logical unit 0
*
*NO			;No bad regions please
*10			;Blocks per cluster
*NO			;Not private
*NONE			;No owner
*ALL			;All disk sets
*4096			;K for CRASH.EXE
*500			;Overdraw per user
*30			;Consecutive blocks tried for on output
*12			;Bits per cluster count
*YES			;Only structure in SSL
*YES			;Only structure in SDL
*ZXCV00			;Unit-ID
*8			;SAT Blocks per Unit
*8			;SAT Blocks in Core
*4807			;K for Swapping
*
*0			;Swapping class
*YES			;Only structure in ASL
*
!'<time> Refreshing structure...
*REFRESH		;Now refresh it
*ZXCV			;Name to refresh
*
*EXIT/NOERROR		;We're done!
!'<time> Mounting structure on system...
.R OPR
*RECOGNIZE 'D
*EXIT
.mic sleep 5
.error
.assign zxcv foo
.if(noerror).goto ZXCVOK
.mic sleep 5
.assign zxcv foo			;try a second time
.if(noerror).goto ZXCVOK
!?Couldn''t mount destination structure
!
!Please correct the problem and rerun the procedure.
.goto done
ZXCVOK::
.error ?
.MOUNT ZXCV/SINGLE
!
![Destination KLAD pack mounted using alias ZXCV on unit 'D]
!
!'<time> Now running FSCOPY to copy the pack.  This step will take 
!	 30 minutes or so (on an unloaded system) to complete.
.error ?
.mic response Y(100)
.R FSCOPY
*BOOT
*FESYS
*SORT FILES
*EXCLUDE [10,1]
*COPY ZXCV:=KLAD:
*^Z
.IF(NOerror).goto FSOK
!
!FSCOPY reported an error: 'y
!%An error was encountered during the copying process.  The pack may be
!incompletely copied.   KLONE is continuing...
!
FSOK::
!'<time> FSCOPY process completed
.error %
.DIR ZXCV:FE.SYS[1,4]
.IF(NOERROR).GOTO MK611
.noerror
!
!%The FE.SYS file did not get created correctly on this pack.  It needs
!to be created by using the RSXINS procedure before the pack can be used.
!
!RSXINS will ask you a series of questions about the installation.  A
!default response for each question will be displayed.  KLONE will
!provide a set of defaults to RSXINS that is appropriate to this
!installation, so you should press RETURN to use each of these defaults.
!
askfs::
.mic input Y,"* Do you wish to run RSXINS now [Y]? "
.let y=$y.[1,1]
.IF($Y="").LET Y="Y"
.if($y#"Y").if($Y#"N").backto askFS
.if($Y="N").goto MK611
!
!'<time> Invoking KLAD:RSXINS.MIC[1,4,RSX20F]...
!
.error
.do KLAD:RSXINS[1,4,RSX20F] 'D,5000,N,Y
.if(noerror).goto RSXOK
.noerror
!
!%Unable to invoke RSXINS procedure.  You must run RSXINS under timesharing
!as documented in Chapter 8 of the Software Installation Guide prior to using
!this pack standalone.
!
!Continuing...
.goto MK611
RSXOK::
!
!'<TIME> Control returned to KLONE procedure
!'<TIME> Now moving DBOOT files to destination pack...
.error
.R F11
*PUT 'D:[5,5]=KLAD:DBOOT.CMD[6,10]
*PUT 'D:[5,5]=KLAD:DBOOT.OBJ[6,10]/IMAGE
*PUT 'D:[5,5]=KLAD:DBOOT.MAP[6,10]
*PUT 'D:[5,5]=KLAD:DBOOT.SYS[6,10]/CONTIG/IMAGE
*PUT 'D:[5,5]=KLAD:TKB.TSK[6,10]/CONTIG/IMAGE
*PUT 'D:[5,5]=KLAD:KLDCP.BIN/IMAGE
*EXIT
.if(noerror).goto PUTDOK
.noerror
!?Unable to put DBOOT, TKB, and/or KLDCP files onto front-end area of
!destination pack on 'D.  Either there is insufficient space on the
!FE.SYS area, or the files DBOOT.*, TKB.TSK, or KLDCP.BIN do not exist
!on the [6,10] area of the source pack.  Make sure that these files
!exist on the source pack and then re-run this procedure.  
!
!Until the problem is corrected, the destination pack can only be used to 
!boot the timesharing KLAD monitor and to run user-mode diagnostics.
!KLDCP will not be accessible, hence no standalone diagnostics can be run.
!
!KLONE will finish up without creating a [6,11] area on the destination
!pack.
!
.goto redef
PUTDOK::
!'<TIME> Move of DBOOT files completed
MK611::
!'<TIME> Creating new [6,11] area on destination pack...
.error ?
.r credir-(ZXCV:[6,11]/exit)
.if(error)
;
;now run SETSRC and set up areas and paths...
;
.R SETSRC
*C /LIB:[6,10]KLAD
*CP [6,11]
=^Z
.ASSIGN ZXCV DEV
!'<TIME> Running KLAD10 program to create and populate [6,11] area.
!	 This will take about 20 minutes.
.error ?
.mic response y(80)
.RUN KLAD:KLAD10
*P1011[6,10]@
.IF(NOERROR).GOTO MK6OK
.noerror
!KLAD10 encountered an error: 'y
!
!?Error encountered by KLAD10 program -- KLDCP front-end area may not
!be correctly built.
!
.goto redef
mk6ok::
!'<TIME> Population of [6,11] complete
redef::
.r setsrc
*cp [1,2]
*c ssl
=^Z
.if(error)
!'<time> Dismounting new KLAD pack from system...
.DISMOUNT ZXCV
.R OPR
*DISMOUNT STRUCTURE ZXCV/NOCHECK
*EXIT
.MIC SLEEP 5
!'<TIME> Redefining pack name from ZXCV to KLAD...
.ctest copy klone4.ddt=tty:
*201/^[6t;^["/KLAD00/
*204/^["/KLAD/
*206/^["/KLAD00/
*207/^["/KLAD0/
*2401/^[6t;^["/KLAD00/
*2404/^["/KLAD/
*2406/^["/KLAD00/
*2407/^["/KLAD0/
=^Z
.R FILDDT
*'D:/U/P
^[YKLONE4.DDT
=^Z
.if(error).abort
.delete klone.ddt
spin::
!
.MIC INPUT Y, "* Do you wish to spin down the destination pack [Y]? "
.let y=$y.[1]
.if($y="Y").goto spdown
.if($y="").goto spdown
.if($Y="N").goto spdone
.backto spin
spdown::
.R DDT
*0/.duunl,,1^j^["/'D/
*disk.^[x
=^Z
spdone::
!
!New KLAD pack may now be removed from unit 'D.
!
DONE::
.IF(ERROR)
!
!	KLONE procedure finished at '<time> on '<Day>, '<Date>
!
!
'<return>
CCTRAP::'<SILENCE>
!
!KLONE process aborted by user typing Control-C.
!
.backto done
ABORT::'<SILENCE>
%FIN::
%ERR::
%TERR::
%CERR::
!
!KLAD copy aborted due to error encountered by KLONE procedure.
!
!
.backto done