*****************
*M*      GHOST1D  GHOST1 DRIVER
*****************
         DEF      GHOST1            GHOST1D'S ENTRY POINT
*P*
*P*      NAME:    GHOST1D
*P*      PURPOSE: INITIATE THE GHOST1 PROCESSOR.
*P*      DESCRIPTION:  GHOST1D EXITS IMMEDIATELY IF THE SYSTEM
*P*               IS UP & RUNNING. OTHERWISE, GHOST1D DETERMINES
*P*               HOW IT WAS ENTERED, I.E., BY RECOVERY, BOOT
*P*               UNDER THE FILES, COLD TAPE BOOT, OR FROM
*P*               RAD/DISC BOOT. GHOST1D THEN ENTERS SYSMAK TO
*P*               INITIALIZE THE PROCESSORS. COC INITIALIZATION,
*P*               BATCH SCHEDULER INITIALIZATION, & REAL-TIME USER
*P*               INITIALIZATION ARE THEN PERFORMED UNLESS
*P*               RECOVERY HAS ABORTED, THEN NO INITIALIZATION
*P*               IS DONE. GHOST1D THEN DISPLAYS, IF REQUESTED,
*P*               THE PARTITIONING INFO IDENTIFYING WHAT
*P*               DEVICES &/OR CONTROLLERS ARE PARTITIONED.
*P*               GHOST1D ENTERS A SYSTEM START-UP ERROR LOG
*P*               MESSAGE & THEN STARTS THE SYMBIONT GHOST.
*P*               OTHER GHOSTS STARTED INCLUDE:
*P*                           ANLZ (ONLY AFTER RECOVERY)
*P*                           RVGHOST (IF DUMP FILE EXISTS)
*P*                           ERR:FIL
*P*                           FIX
*P*                           MOOSE (IF SLAVE OVER-RIDE IS SET
*P*                                 FOR MULTI-PROCESSING SYSTEM)
*P*               GHOST1D THEN CHANGES GHOST1'S ENTRY FOR GHOST
*P*               START-UP TO FILL. GHOST1D THEN EXITS TO FILL.
*P*
GHOST1D  DSECT    1
         PAGE
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
*
MPBITS   SET      1                 MULTIPROCESSING FLAGS
         SYSTEM   UTS
M:PRINT  CNAME
         PROC
LF       LI,14    AF(1,2)
         CAL1,2   PRINT
         PEND
         PAGE
         DEF      PAS0RTN           RETURN ENTRY TO GHOST1
*,*                                 FROM GENMDG MODULE
         PAGE
*
         REF      BOOTFLG           INPUT OUTPUT WORD
*,*                           FLAG CONTAINING THE TYPE OF
*,*                           ENTRY INTO GHOST1.
*,*                           BYTE-0 CONTAINS THE FLAGS:
*,*                                 80 = I (TTY I/O)
*,*                                 40 = P (LP OUTPUT)
*,*                                 20 = C (CARD PATCHES)
*,*                                 10 = T (TAPE PATCHES)
*,*                                 08 = F (TAPE FILES)
*,*                                 04 = D (XDELTA RETAINED)
*,*                                 02 = S (:SYS FILES)
         REF      M:DO              DCB
*,*                           OPEN DIAGNOSTIC OUTPUT
         REF      M:LL              DCB
*,*                           OPEN LISTING OUTPUT
         REF      M:LO              DCB
*,*                           OPEN LISTING OUTPUT
         REF      M:TM              DCB
*,*                           FILE DCB
         REF      M:PATCH           DCB
*,*                           PATCH FILE DCB
         REF      LLNDD             INPUT WORD
*,*                           LISTING DEV.ADDR.DURING BOOT
         REF      DCT3              INPUT BYTE
*,*                           CHECK IF DEVICE IS PARTITIONED
*,*                           BIT 2
         REF      DCT8              INPUT WORD
*,*                           CHECK HANDLER ADDRESSES FOR
*,*                           SPECIAL HANDLERS
         REF      DCT9              INPUT WORD BITS 3-4
*,*                           CHECK IF CONTROLLER IS PARTITIONED
*,*                           BIT 3 = 1, ALTERNATE
*,*                           BIT 4 = 1, PRIMARY
         REF      J:ASSIGN          SET PPMD BIT FOR DUMPS
         REF      DCT16             INPUT DOUBLE WORD
*,*                           DISPLAY 'YYNDD' FOR PARTITIONED
*,*                           DEVICES
         REF      DCTSIZ            INPUT
*,*                           SIZE OF DCT TABLES
         REF      SNDDX             INPUT BYTE
*,*                           BYTE-0 = # ENTRIES IN SYMBIONT TABLES
*,*                           USED TO SET UP PAGE STEALING DURING
*,*                           BOOT
         REF      RBLIMS            INPUT DOUBLE WORD
*,*                           REMOTE BATCH STATION SYMBIONT
*,*                           INDEX LIMITS
         REF      SSTAT             SYMBIONTS STATUS
         REF      INITIAL:MOS       * SETUP THRESHOLDS FOR MOS MEMORY
         REF      MOSTAB            * SYSGENED <>0 FOR MOS SYSTEM
         REF      DUMPFILE          OUTPUT TABLE
*,*                           SET INFO FOR RVGHOST
         REF      SL:STLM           OUTPUT WORD
*,*                           MAX.# PAGES TO BE STOLEN
         REF      SL:RSVP           OUTPUT WORD
*,*                           # RESERVED PAGES FOR STEALER
         REF      SL:CORE           INPUT OUTPUT WORD
*,*                           MAX.SWAPPER SIZE
         REF      S:ACORE           INPUT OUTPUT WORD
*,*                           # PAGES AVAILABLE TO SYSTEM
         REF      S:PCORE           OUTPUT WORD
*,*                           # PAGES AVAILABLE TO USER
         REF      S:STLC            OUTPUT WORD
*,*                           # CURRENTLY STEALABLE PAGES
         REF      CORED             INPUT WORD
*,*                                 ADDRESS OF PHYSICAL MEMORY+1
         REF      SMUIS             INPUT
*,*                           MAX.# USERS IN SYSTEM
         REF      SEEK4000          OUTPUT WORD
*,*                           DUMPFILES SEEK ADDRESS LOCATED IN
*,*                           SEEK4000 -1
         REF      RCVRCNT           INPUT WORD
*,*                           RECOVERY COUNT USED IN SYSTEM
*,*                           START-UP ERROR LOG ENTRY
         REF      RCVCODE           INPUT WORD
*,*                           CONTAINS RECOVERY SCREECH
*,*                           CODE & SUB-CODE
         REF      SMAKFLG           INPUT BITS 0-3
*,*                           FLAG = 8, START RVGHOST INSTEAD OF
*,*                           ANLZ AS DUMPFILE CONTAINS THE DUMP
         REF      XFC               CONSTANT X'000000FC'
         REF      ERRLOG            ROUTINE
*,*                           ADD SYSTEM STARTUP ENTRY TO ERROR LOG
         REF      RECOVER2          ROUTINE
*,*                           GHOST1 HAS BEEN ENTERED AS A
*,*                           RESULT OF A RECOVERY OR
*,*                           OPERATOR RECOVERY
         REF      PASS0             ROUTINE
*,*                           ENTER PASS0 IF TAPE BOOT OR
*,*                           AFTER RECOVER2 COMPLETES ITS
*,*                           BOOT UNDER THE FILES FUNCTIONS
         REF      SYSMAK            ROUTINE
*,*                           ENTERED TO INITIALIZE THE SYSTEM
*,*                           PROCESSORS
         REF      T:GJOBSTRT        ROUTINE
*,*                           START UP DESIGNATED GHOST
         REF      T:BTSCHED         ROUTINE
*,*                           INITIATE BATCH SCHEDULER
         REF      RT:REBOOT         ROUTINE
*,*                           INITIALIZE REAL-TIME USER(S)
         REF      DSCCVT            ROUTINE
*,*                           CONVERT SECTOR ADDRESS TO A
*,*                           DISC SEEK ADDRESS
         SREF     RASIZE            INPUT
*,*                           # READ AHEAD ENTRIES
         SREF     CO:INTFL          ENABLE COCINIT EXECUTION
         SREF     COCGFLG           SET TYPE OF STARTUP FOR COC INITIALIZATION
         SREF     SB:RCVR           OUTPUT WORD
*,*                           SET MASTER RECOVER FLAG =0
         SREF     SB:RCVA           OUTPUT WORD
*,*                           SET SLAVE RECOVER FLAG =0
         SREF     SB:INIT           INPUT OUTPUT BYTE
*,*                           SET BIT-7 =0 (START FLAG), &
*,*                           SET BIT-6 =1 (STOP FLAG)
*,*                           OF SLAVES FLAG
         SREF     SL:BSTRT          INPUT WORD
*,*                           SLAVE OVERRIDE FLAG CHECK
*,*                                 = 0  START MOOSE GHOST
*,*                                 > 0  FIX UP SB:INIT FLAG
*,*                                      & DON'T START MOOSE GHOST
         SREF     SL:PWP            INPUT WORD
*,*                           #PHYSICAL WORK PAGES REQUIRED FOR
*,*                           TP. PASS2-GENERATED ON BASIS OF PWP OPTION
         SREF     HASPIO            ROUTINE
*,*                           CHECK PRESENCE OF HASPIO HANDLER
*,*                           IN SYSTEM
         SREF     2780IO            ROUTINE
*,*                           CHECK PRESENCE OF 2780IO HANDLER
*,*                           IN SYSTEM
         REF      S:ADR             CPU HARDWARE ADDRESS TABLE
         REF      SUABTFLE          SINGLE USER ABORT FDA OF DUMPFILE.
         REF      GRANRAD
         PAGE
         PCC      0
BOOTYPE  EQU      %
         DATA,2   'NO'
         DATA,2   X'2210'
         DATA,2   X'FFFF'
         DATA,2   X'6C00'
         DATA,2   X'0000'
         DATA,2   X'0001'
#BOOTS   EQU      HA(%)-HA(BOOTYPE)-1
*
*
         PAGE
*F*
*F*      NAME:    GHOST1
*F*      PURPOSE: INITIATE THE GHOST1 PROCESSOR.
*F*      DESCRIPTION:  GHOST1 EXITS IMMEDIATELY IF THE SYSTEM
*F*               IS UP & RUNNING. OTHERWISE, GHOST1 DETERMINES
*F*               HOW IT WAS ENTERED, I.E., BY RECOVERY, BOOT
*F*               UNDER THE FILES, COLD TAPE BOOT, OR FROM
*F*               RAD/DISC BOOT. IF BOOT IS A TAPE BOOT OR
*F*               BOOT UNDER FILES, GHOST1 THEN EXITS TO PASS0.
*F*               OTHERWISE,GHOST1 ENTERS SYSMAK TO
*F*               INITIALIZE THE PROCESSORS. COC INITIALIZATION,
*F*               BATCH SCHEDULER INITIALIZATION, & REAL-TIME USER
*F*               INITIALIZATION ARE THEN PERFORMED UNLESS
*F*               RECOVERY HAS ABORTED, THEN NO INITIALIZATION
*F*               IS DONE. GHOST1 THEN DISPLAYS, IF REQUESTED,
*F*               THE PARTITIONING INFO IDENTIFYING WHAT
*F*               DEVICES &/OR CONTROLLERS ARE PARTITIONED.
*F*               GHOST1 ENTERS A SYSTEM START-UP ERROR LOG
*F*               MESSAGE & THEN STARTS THE SYMBIONT GHOST.
*F*               OTHER GHOSTS STARTED INCLUDE:
*F*                           ANLZ (ONLY AFTER RECOVERY)
*F*                           RVGHOST (IF DUMP FILE EXISTS)
*F*                           ERR:FIL
*F*                           FIX
*F*                           MOOSE (IF SLAVE OVER-RIDE IS SET
*F*                                 FOR MULTI-PROCESSING SYSTEM)
*F*               GHOST1 THEN CHANGES GHOST1'S ENTRY FOR GHOST
*F*               START-UP TO FILL. GHOST1 THEN EXITS TO FILL.
*DO*
*D*      NAME:    GHOST1
*        ENTRY:   DABN
*        PURPOSE: INITIATE THE GHOST1 PROCESSOR.
*        DESCRIPTION:  GHOST1 EXITS IMMEDIATELY IF THE SYSTEM
*                 IS UP & RUNNING. OTHERWISE, GHOST1 DETERMINES
*                 HOW IT WAS ENTERED, I.E., BY RECOVERY, BOOT
*                 UNDER THE FILES, COLD TAPE BOOT, OR FROM
*                 RAD/DISC BOOT. GHOST1 THEN ENTERS THE
*                 APPROPRIATE MODULE IN GHOST1'S LOAD MODULE
*                 TO PERFORM THE NECESSARY FUNCTIONS
*                 DEPENDING UPON HOW GHOST1 WAS ENTERED.
*
*        DABN -   ENTERED WHEN I/O ERROR FROM M:TM.
*
*                 THE TYPE OF BOOT INDEX USED THROUGHOUT GHOST1
*                 IS AS FOLLOWS:
*        INDEX    TYPE OF BOOT
*        ------   --------------------------
*        0        INDETERMINATE
*        1        COLD TAPE BOOT
*        2        BOOT UNDER FILES
*        3        RAD BOOT
*        4        RECOVERY
*        5        OPERATOR RECOVERY
*
*        INTERFACE:  EXIT,HASPIO,2780IO,RECOVER2,RECVRTN,
*                 PASS0,OPNAB.
*        REGISTERS:  ALL USED
*        ENVIRONMENT:  MAPPED, MASTER
*FIN*
*
         PAGE
GHOST1   EQU      %
         CAL1,6   MASTER
         BCS,8    EXIT              DIDNT WORK
         MTW,0    BOOTFLG           DONT RUN IF WE ARE UP
         BE       EXIT
         LI,1     X'40000'          SET PPMD FLAG TO GET DUMPS
         STS,1    J:ASSIGN          IF WE ABORT
         LI,1     M:DO              M:DO DCB
         LI,2     X'3FFF'
         AND,2    LLNDD             'LL' DEVICE ADDRESS
         AI,2     X'4000'           DIAG BIT
         CAL1,1   DEVOPN            OPEN M:DO DCB
         LI,1     M:LO              M:LO DCB
         CAL1,1   DEVOPN            OPEN M:LO DCB
         LI,1     M:LL              OPEN LL
         LC       BOOTFLG           TO 'NO' IF NO LP OUTPUT
         BCS,4    %+2               SET ON ANY RAD BOOT(RECOV, ETC.)
         LI,2     'NO'
         INT,3    X'2A'             IF NOT TAPE BOOT
         BDR,3    %+2               USE SYMBIONT LP
         LI,2     'LP'
         CAL1,1   DEVOPN
*
*
*
*  SET UP PAGE STEALING CELLS SO THAT WRITE-AHEAD CAN
*  BE DONE DURING BOOT
*
         LB,1     SNDDX
         SLS,1    -1
         AI,1     RASIZE            ADD # READ-AHEAD ENTRIES
         STW,1    SL:STLM
         STW,1    S:STLC
         LI,R10   3+NSCPU           DEFAULT PGS +1 FOR EACH SLAVE CPU DEFINED
         LI,11    2
         LI,0     HASPIO
         BNEZ     SETSTL-1
         LI,0     2780IO
         BEZ      SETSTL1
         LI,11    1
         LW,1     RBLIMS+1
SETSTL   CW,1     RBLIMS
         BL       SETSTL1
         LW,0     DCT8,1
         CI,0     HASPIO
         BE       %+3
         CI,0     2780IO
         BNE      %+2
         AW,10    11
         AI,1     -1
         B        SETSTL
*
SETSTL1  EQU      %
         SLS,10   -1
         LI,1     SL:PWP            CK FOR PRESENCE OF TP PHYSICAL WK PGS
         BEZ      SETSTL2           B, IF NONE
         LI,1     -6                WILL SUBTRACT 6 PGS FROM SL:PWP
         AW,10    SL:PWP            ASSUME SL:PWP LESS THAN OR = 6
         AW,1     SL:PWP            BUT, CHECK ON THIS
         BLEZ     SETSTL2           B, IF SO; ALL PAGES TO SL:RSVP
         AWM,1    SL:STLM           ELSE, ADD SL:PWP -6 PGS TO STLM
         AWM,1    S:STLC            UPDATE INITIAL STLM COUNT ALSO
         SW,10    1                 GET EXCESS OVER 6 PGS BACK FROM RSVP
SETSTL2  EQU      %
         STW,10   SL:RSVP
         LW,1     S:ACORE
         SW,1     10
         CW,1     SL:CORE
         BGE      %+2
         STW,1    SL:CORE
         STW,1    S:ACORE
         LCW,10   10
         AWM,10   S:PCORE
*
         LC       X'2A'             GET BOOT TYPE
         BCS,15   PAS0CHK           NOT RECOVERY
RECOV    EQU      %
         BAL,11   RECOVER2
         MTB,-1   ERFLG             ERROR, DONT RESTART USERS
         B        RECVRTN
PAS0CHK  EQU      %
         LI,11    PASS0             EXIT TO PASS0 FROM RECOVER2
         BCS,8    RECOVER2          IF BOOT UNDER FILES
         BCR,4    PASS0             TAPE BOOT
         BAL,11   RECOVER2          RESTORE ZAPPED DATA IF RAD BOOT
         B        RECVRTN
         PAGE
CLSPATCH GEN,8,24 X'15',M:PATCH
         DATA     X'80000000',2     CLOSE AND SAVE PATCH FILE
RSTTM    GEN,8,24 X'14',M:TM
         DATA     X'7001'
         DATA     1
         DATA,1   3,,,,4,,,,5,,,,6,,,,11,1,,
OPNDUMP  GEN,8,24 X'14',M:TM
         DATA     X'C5441001'
         DATA     DABN,DABN
         DATA     3,2,2             RANDOM,OUT,SAVE
         PZE      *R2               OP LABLE
         PZE      *3
         DATA,1   1,1,3,3
         TEXTC    'DUMPFILE'
         PAGE
DABN     RES
         CI,R2    'DP'              DISK PACK
         BE       DABN1             YES-CANT GET FILE
         LI,R2    'DP'              NO-TRY DISK PACK
         AI,R8    -1                POINT BACK TO CAL
         B        *R8               TRY TO GET DUMPFILE ON PACK
DABN1    EQU      %
         LI,R2    -1
         STW,R2   DUMPFILE          SET DUMPFILE TO CANT GET FILE
         B        OPNAB
         PAGE
*F*
*F*      NAME:    PAS0RTN
*F*      PURPOSE: GHOST1'S GENMDG MODULE RETURN POINT.
*F*      DESCRIPTION:  CLOSE PATCH FILE & THEN ENTER SYSMAK TO
*F*               INITIALIZE THE PROCESSORS. COC INITIALIZATION,
*F*               BATCH SCHEDULER INITIALIZATION, & REAL-TIME USER
*F*               INITIALIZATION ARE THEN PERFORMED UNLESS
*F*               RECOVERY HAS ABORTED, THEN NO INITIALIZATION
*F*               IS DONE. PAS0RTN THEN DISPLAYS, IF REQUESTED,
*F*               THE PARTITIONING INFO IDENTIFYING WHAT
*F*               DEVICES &/OR CONTROLLERS ARE PARTITIONED.
*F*               PAS0RTN ENTERS A SYSTEM START-UP ERROR LOG
*F*               MESSAGE & THEN STARTS THE SYMBIONT GHOST.
*F*               OTHER GHOSTS STARTED INCLUDE:
*F*                           ANLZ (ONLY AFTER RECOVERY)
*F*                           RVGHOST (IF DUMP FILE EXISTS)
*F*                           ERR:FIL
*F*                           FIX
*F*                           MOOSE (IF SLAVE OVER-RIDE IS SET
*F*                                 FOR MULTI-PROCESSING SYSTEM)
*F*               PAS0RTN THEN CHANGES GHOST1'S ENTRY FOR GHOST
*F*               START-UP TO FILL. PAS0RTN THEN EXITS TO FILL.
*F*
*D*
*D*      NAME:    PAS0RTN
*D*      ENTRY:   RECVRTN
*D*      ENTRY:   OPNAB
*D*      PURPOSE: GHOST1'S GENMDG MODULE RETURN POINT.
*D*      DESCRIPTION:  CLOSE PATCH FILE & THEN ENTER SYSMAK TO
*D*               INITIALIZE THE PROCESSORS. COC INITIALIZATION,
*D*               BATCH SCHEDULER INITIALIZATION, & REAL-TIME USER
*D*               INITIALIZATION ARE THEN PERFORMED UNLESS
*D*               RECOVERY HAS ABORTED, THEN NO INITIALIZATION
*D*               IS DONE. PAS0RTN THEN DISPLAYS, IF REQUESTED,
*D*               THE PARTITIONING INFO IDENTIFYING WHAT
*D*               DEVICES &/OR CONTROLLERS ARE PARTITIONED.
*D*               PAS0RTN ENTERS A SYSTEM START-UP ERROR LOG
*D*               MESSAGE & THEN STARTS THE SYMBIONT GHOST.
*D*               OTHER GHOSTS STARTED INCLUDE:
*D*                           ANLZ (ONLY AFTER RECOVERY)
*D*                           RVGHOST (IF DUMP FILE EXISTS)
*D*                           ERR:FIL
*D*                           FIX
*D*                           MOOSE (IF SLAVE OVER-RIDE IS SET
*D*                                 FOR MULTI-PROCESSING SYSTEM)
*D*               PAS0RTN THEN CHANGES GHOST1'S ENTRY FOR GHOST
*D*               START-UP TO FILL. PAS0RTN THEN EXITS TO FILL.
*D*
*D*      RECVRTN - ENTERED DIRECTLY FROM GHOST1 IF PASS0 IS
*D*               NOT ENTERED.
*D*      OPNAB -  ENTERED ONLY IF I/O ERROR/ABNORMAL OCCURS
*D*               WHEN OPENING THE DUMPFILE.
*D*
*D*      INTERFACE:  SYSMAK,COCINITNR,T:BTSCHED,RT:REBOOT,
*D*               DSCCVT,MSMSET,ERRLOG,T:GJOBSTRT.
*D*      REGISTERS:  ALL USED
*D*      ENVIRONMENT:  MAPPED, MASTER
*D*
CLSDUMP  GEN,8,24 X'15',M:TM
         DATA     X'80000000',2
PAS0RTN  EQU      %
         CAL1,1   CLSPATCH          CLOSE AND SAVE THE PATCH FILE AFTER DATE
RECVRTN  EQU      %
         BAL,11   SYSMAK            INITIALIZE PROCESSORS
*
*        THE FOLLOWING INSTRUCTION BECOMES A BRANCH IF
*        RECOVER2 OR HGPRECONSTRUCT ABORT
*        USER REINITIALIZATION CODE SHOULD THEREFORE BE
*        PLACED BETWEEN ERFLG AND ERSKIP
*
ERFLG    BCS,0    ERSKIP
         BAL,11   T:BTSCHED
         BAL,R11  RT:REBOOT         REAL-TIME USER INITIALIZATION
ERSKIP   EQU      %
         LI,R10   0                 =0 DEVICE, >0 CONTROLLER
         LI,R11   -1                1ST TIME FLAG (I.E., DEVICE)
         LI,R1    1                 DCT INDEX (FOR DEVICE)
NXTDEV   EQU      %
         LB,R3    DCT3,R1           GET FLAGS
         CI,R3    DOWND
         BANZ     DEVDOWN     YES-- DEV.PARTITIONED
2NXTDEV  EQU      %           NO---
         AI,R1    1                 2 NEXT DCT
         CI,R1    DCTSIZ
         BLE      NXTDEV      NO--- DONE
         LW,R10   CONT        YES-- SET MESSAGE
         STW,R10  MSGPRT+1            FOR CONTROLLER
         LI,R1    1                 DCT INDEX (FOR CONTROLLER)
NXTCONT  EQU      %
         LW,R3    DCT9,R1
         LB,R3    R3                GET FLAGS
         CI,R3    DOWNC
         BANZ     CONTDOWN    YES-- CONT.PARTITIONED
2NXTCONT EQU      %           NO---
         AI,R1    1                 2 NEXT DCT
         CI,R1    DCTSIZ
         BLE      NXTCONT     NO--- DONE
         CI,R11   0           YES--
         BGEZ     ENDPRT      YES-- ANY PARTITIONED ITEMS
*                             NO---
         B        CONTINU
*----------------
DEVDOWN  EQU      %
CONTDOWN EQU      %
         AI,R11   1                 SET FLAG TO NOT 1ST TIME
         BGZ      DISPLAY     NO--- WAS THIS THE 1ST TIME
*                             YES--
TOP:PAGE EQU      %
         CAL1,1   PAGE              TOP OF PAGE
         M:PRINT  (MESS,ITMPRT)     'ITEMS PARTITIONED'
BLNKLN   M:PRINT  (MESS,BLANK)      'BLANK LINE'
DISPLAY  EQU      %
         LD,R2    DCT16,R1          GET 'YYNDD'
         SLD,R2   8
         AI,R3    ' '
         STW,R3   MSGPRT+3          PUT 'NDD' INTO MESSAGE
         LI,R3    1
         STH,R2   MSGPRT+2,R3       PUT 'YY' INTO MESSAGE
         M:PRINT  (MESS,MSGPRT)     'DEV/CONT YYNDD PART'
         CI,R10   0
         BEZ      2NXTDEV     YES-- DEV.TYPE
         B        2NXTCONT    NO--- CONT.
*----------------
ENDPRT   EQU      %
         EXU      BLNKLN            'BLANK LINE'
         M:PRINT  (MESS,ENDITMS)    'END OF PART ITEMS'
         EXU      TOP:PAGE          TOP OF PAGE
CONTINU  EQU      %
         LW,R3    CORED
         AI,R3    -1
         SLS,R3   -9                HIGHEST PAGE NUMBER IN MEMORY
         STH,3    DUMPFILE+1
         AI,3     SMUIS+1           PLUS ROOM FOR USER JITS
         CAL1,1   RSTTM             CLEAN OUT THE M:TM DCB
         LI,R2    'DC'              TRY TO GET DUMPFILE ON RAD
         LW,1     GRANRAD           IS THERE LOTS OF RAD
         CI,1     2500              (AT LEAST ONE DEVICE)
         BGE      %+2               YES
         LI,2     'DP'              NO DONT USE IT
         CAL1,1   OPNDUMP           OPEN THE FILE
         LW,1     M:TM+1            CFUADDRESS
         LW,R8    1,R1              FDA OF DUMPFILE
         LW,3     5,1               SIZE
         CAL1,1   CLSDUMP
         STW,R8   SUABTFLE          FDA OF SUA RANDUM FILE
         STW,R3   SUABTFLE+1        NUMBER OF SECTORS IN FILE
         BAL,R11  DSCCVT            GO-CONVERT TO SEEK
         STW,R8   SEEK4000-1        SEEK OF X'4000'
OPNAB    EQU      %
*
*        INSERT SYSTEM START-UP ERROR LOG MESSAGE
*
*
         LI,1     #BOOTS            MAX LOOP
         LH,2     X'2A'             GET INDICATOR
         CH,2     BOOTYPE,1         FIND MATCHUP
         BE       GOTYPE            GOTCHA
         BDR,1    %-2
GOTYPE   LI,10    X'1804'           CODE/COUNT FOR MSG
         LI,3     7                 MASK TO GET
         LS,3     RCVRCNT           COUNT
         STH,3    10                TO PUT AWAY COUNT
         STB,1    10                PUT AWAY TYPE
         SCS,10   16                AND POSITION PROPERLY
         LW,13    RCVCODE           GET SCREECH CODE/SUBCODE
         SCS,13   16                POSITION PROPERPY
         STB,13   13
         LW,R8    S:ADR             GET HARDWARE ADDRESS
*                                   0 FOR SIGMA 7
         LI,R9    X'FFFF'
         STS,R8   R13               POSITION IN RIGHT HALFWORD
         LI,6     10                LOC OF ERR MSG
         BAL,5    ERRLOG            AND INSERT IT INTO LOG
         LB,1     SNDDX             L/COUNT OF SYMBIONTS
         LI,4     3                 L/CODE FOR 'SYMB. NOT AVAIL'
SYMCHEK  LB,2     SNDDX,1           L/SYMBIONT'S DCT INDEX
         BEZ      NEXTSYMB          BZ/DUMMY (DELETE/SPILL-FILL)
         CLM,2    RBLIMS            C/RBT STREAM LIMITS
         BCR,9    NEXTSYMB          B/IF RBT STREAM
         LB,3     DCT3,2            L/DCT3 ENTRY
         CI,3     X'20'             C/'PARTITIONED' BIT
         BAZ      NEXTSYMB          B/IF NOT PARTITIONED
         STB,4    SSTAT,1           S/'NOT AVAIL' CODE
NEXTSYMB BDR,1    SYMCHEK           B/BACK FOR NEXT SYMBIONT
         SPACE
*
*        IF THE SYSTEM IS MOS MEMORY GENNED,
*          AND
*                 WE'RE RECOVERING, USE THE OLD DATA FROM RCVBUF
*                 AND INITIALIZE REPORT SBCE ON UNOVERFLOWED BANKS
*          ELSE
*                 INITIALIZE DATA FROM SCRATCH, AS CE MAY HAVE
*                 CHANGED CONFIGURATION FOR RAD OR TAPE BOOT
*
         SPACE
         LI,1     MOSTAB            * CHECK FOR MOS MEMORY GEN
         BEZ      MOSTHRU           *******
         SPACE
         LI,4     1                 * ASSUME RECOVERY IN PROGRESS
         MTW,0    X'2A'             * ** NOW CHECK IT
         BEZ      MOSGO             * ** IF RECOVERY, BAL WITH R4=1
         SPACE
         LI,4     0                 * ** IF NOT, BAL WITH R4=0 (INITIALIZE)
MOSGO    BAL,11   INITIAL:MOS       ***** GO SET UP RCE ON BANKS
MOSTHRU  EQU      %
         LI,1     0                 SET RUNNING FILA
         STW,1    BOOTFLG
*
         LD,0     TXCRBBAT
         BAL,10   T:GJOBSTRT        START SYMBIONT GHOST
*  NOTE:  ANLZ MUST BE FIRST GHOST STARTED AFTER RBBAT
         MTB,0    X'2A'
         BNEZ     LOGRCVG
         LC       SMAKFLG           DUMPFILE CONTAIN THE DUMP
         BCS,8    KRD1              YES-DONT START ANLZ; START RVGHOST
         LD,0     ANLZT
         BAL,10   T:GJOBSTRT        START ANLZ
*
LOGRCVG  EQU      %
         MTW,0    DUMPFILE
         BLEZ     %+3               SINGLE USER ABORT 'DUMPFILE' FREE
KRD1     EQU      %
         LD,0     TXCRVGST
         BAL,10   T:GJOBSTRT        START THE RECOVER GHOST
         LCI      2
         LM,0     SQUAWK
         STM,0    X'27'
*  START ERR:FIL
*
         LD,R0    TXCE:FIL
         BAL,R10  T:GJOBSTRT
         LD,R0    FNAME
         BAL,R10  T:GJOBSTRT        START IT
*
         LI,1     NSCPU             MP SYSTEM
         BEZ      LOGFIL2           NO
         LI,0     0
         STW,0    SB:RCVR           ZERO OUT MASTER RCVR FLAG
         STW,0    SB:RCVA           ZERO OUT SLAVE RCVR FLAG
         MTW,0    SL:BSTRT          SLAVE OVERRIDE SET
         BEZ      GOGJOB            NO,  START MOOSE
MOSTOP   LB,10    SB:INIT,1         GET FLAGS
         AND,10   XFC               MASK OUT START/STOP
         AI,10    STOPBIT           SET STOP FLAG
         STB,10   SB:INIT,1         RESTORE FLAG
         BDR,1    MOSTOP            DONE ALL
         B        LOGFIL2           YES,SKIP MOOSE
GOGJOB   EQU      %
         LD,0     TXMOOSE           NO OVERRIDE,START
         BAL,10   T:GJOBSTRT        MOOSE
LOGFIL2  EQU      %
         LD,0     FILLT             START UP FIILL
         BAL,10   T:GJOBSTRT
         LI,R11   X'8000'           L/.8000; RECOVERY-STARTUP COC FLAG
         LC       X'2A'             CHECK TYPE OF STARTUP
         BCR,15   %+2               B/RECOVERY
         LI,R11   X'4000'           L/.4000; NON-RECOVERY-STARTUP
*                                   .. COC FLAG
         STS,R11  COCGFLG           S/COC TYPE-OF-STARTUP FLAG
         LI,R11   0                 L/0
         STW,R11  CO:INTFL          0/COC INTERRUPT FLAG; CLOCK3 WILL
*                                   .. THEN CALL COCINIT; IF NO COC,
*                                   .. 0 TO R0
EXIT     EQU      %
         CAL1,8   GOOSCALL          TRANSFER CONTROL TO GOOSE
         CAL1,9   1                 EXIT TO FILL
         PAGE
         BOUND    8
ANLZT    TEXTC    'ANLZ'
FILLT    TEXTC    'FILL'
TXCRBBAT TEXTC    'RBBAT'
TXCRVGST TEXTC    'RVGHOST'
FNAME    TEXTC    'FIX'
         TEXT     ' '               MUST HAVE TRAILING BLANKS
TXCE:FIL TEXTC    'ERR:FIL'
TXMOOSE  TEXTC    'MOOSE'
GOOSCALL GEN,8,24 3,0
         TEXTC    'GOOSE'
MASTER   DATA,1   8,0,0,0
PRINT    DATA     X'1000000',X'80000000',X'8000000E'
PAGE     GEN,8,24 4,M:LL
SQUAWK   SCREECH  -1,0
         PAGE
********
DOWND    EQU      X'20'             DEV.DOWN
DOWNCP   EQU      X'08'             PRIM.CONT.DOWN
DOWNCA   EQU      X'10'             ALT.CONT.DOWN
DOWNC    EQU      DOWNCP+DOWNCA     CONT.DOWN
********
CONT     TEXT     'CONT'
********
BLANK    EQU      %
         TEXTC    ' '
********
ITMPRT   EQU      %
         TEXTC    ' ***** ITEMS PARTITIONED ******'
********
MSGPRT   EQU      %
         TEXTC    '   DEV   YYNDD     PARTITIONED'
********
ENDITMS  EQU      %
         TEXTC    ' ** END OF PARTITIONED ITEMS **'
********
         PAGE
*
*
DEVOPN   GEN,1,7,7,17  1,X'14',0,1  OPEN *1
         DATA     X'40000'          DEVICE
         PZE      *2
         END      GHOST1

