         << LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION >>     00000001
                                                               <<09412>>00090010
<< PVPROC started after SYSUP set.  Allows AVRing of SDISCs  >><<09412>>00090020
<< which were on line when system came up.                   >><<09412>>00090030
                                                               <<09412>>00090040
        OLD'CONSOLE'LDEV,                                      <<01259>>00901000
INTEGER ECHOSTATE;                                             << 9331>>01386000
DEFINE   CPUNUM   = ASSEMBLE(PCN)#,      << Get CPU number >>  <<*9383>>01545000
         PMBCFIRMWARE = ABSOLUTE(%1220).(14:1)#;               <<*9383>>01546000
        No'Records           = 1015, << No records in file.  >><<s9115>>01850000
        Nothing'to'do        = 1016  << No block for startup >><<s9115>>01855000
                                     << or this startup type.>><<s9115>>01857500
        ;                                                      <<s9115>>01860000
                                                               <<s9115>>01862500
    INTEGER ARRAY Filenums ( 0:1 );                            <<s9115>>01940500
    << Used for storing file numbers in Fopen'Kludge.        >><<s9115>>01941000
                                                               <<s9115>>01941500
                                                               << 2215>>01960100
EQUATE   MAESTRO'OFFSET = %153;                                << 2215>>01960200
                                                               << 2215>>01960400
PROCEDURE MESSENGER;                                           << 1559>>03295000
PROCEDURE ALTDSEGSIZE (DST, SIZE);                             << 9790>>03415100
VALUE DST, SIZE;                                               << 9790>>03415200
INTEGER DST, SIZE;                                             << 9790>>03415300
OPTION EXTERNAL;                                               << 9790>>03415400
                                                               << 9790>>03415500
           Com'Dict'Size  =  442;                              <<S2073>>07735000
$EDIT VOID=07950000                                            <<s9115>>07950000
                    11, 9, "NSCONTROL",                        << 1114>>07971000
                    12,10, "NETCONTROL",                       << 1114>>07972000
                    14,12, "AUTOALLOCATE",                     <<S2073>>07973000
$EDIT VOID=10090000                                            <<s9115>>10015000
$Page "System Startup Processor - Fopen'kludge"                <<s9115>>10016000
$Control Segment=Called'once                                   <<s9115>>10017000
                                                               <<s9115>>10018000
PROCEDURE Fopen'kludge ( Fnums );                              <<s9115>>10019000
INTEGER ARRAY Fnums;                                           <<s9115>>10020000
BEGIN                                                          <<s9115>>10021000
                                                               <<s9115>>10022000
<< This procedure and its companion Fclose'kludge            >><<s9115>>10023000
<< exist because of a problem in the file system.            >><<s9115>>10024000
<< Normal user and CI processes have $Stdin and              >><<s9115>>10025000
<< $Stdlist as file numbers 1 and 2.                         >><<s9115>>10026000
<< But system processes do not have real $Stdin's            >><<s9115>>10027000
<< and $Stdlists. This mostly is hidden away                 >><<s9115>>10028000
<< from the user because the Read and Print                  >><<s9115>>10029000
<< intrinsics have a horrible kludge inside them             >><<s9115>>10030000
<< to make them appear as if system processes                >><<s9115>>10031000
<< really do have these files. Now when a system             >><<s9115>>10032000
<< process opens its first file it gets file                 >><<s9115>>10033000
<< number 1 which is generally reserved for $Stdin.          >><<s9115>>10034000
<< As long as the system process stays in                    >><<s9115>>10035000
<< priviledge mode, the file system will not                 >><<s9115>>10036000
<< interfere. As soon as the user switches                   >><<s9115>>10037000
<< to user mode, the file system will not let the            >><<s9115>>10038000
<< user access the file even though he obtained              >><<s9115>>10039000
<< the file number through legitimate means.                 >><<s9115>>10040000
<< Unfortunately, the file system doesn't check              >><<s9115>>10041000
<< to see how the file number was obtained in the            >><<s9115>>10042000
<< first place. The chief offender is the procedure          >><<s9115>>10043000
<< Loc'Acb.                                                  >><<s9115>>10044000
                                                               <<s9115>>10045000
<< In order to get around this mess for now,                 >><<s9115>>10046000
<< this procedure sucks up two file numbers,                 >><<s9115>>10047000
<< to ensure that system startup state will                  >><<s9115>>10048000
<< work with file numbers greater than 2.                    >><<s9115>>10049000
<< When system startup is all done, the procedure            >><<s9115>>10050000
<< Fclose'kludge is called to give the file                  >><<s9115>>10051000
<< numbers back.                                             >><<s9115>>10052000
                                                               <<s9115>>10053000
  INTEGER Index, Num;                                          <<s9115>>10054000
                                                               <<s9115>>10055000
  FOR Index := 0 UNTIL 1 DO                                    <<s9115>>10056000
  BEGIN                                                        <<s9115>>10057000
                                                               <<s9115>>10058000
    << Get two file numbers (hopefully 1 and 2               >><<s9115>>10059000
    << by Fopening $null.                                    >><<s9115>>10060000
                                                               <<s9115>>10061000
    Fnums ( Index ) := 0;                                      <<s9115>>10062000
    Num := Fopen ( , %60 ); << No-name, $Null >>               <<s9115>>10063000
    IF = THEN                                                  <<s9115>>10064000
      Fnums ( Index ) := Num;                                  <<s9115>>10065000
                                                               <<s9115>>10066000
  END;                                                         <<s9115>>10067000
END;                                                           <<s9115>>10068000
                                                               <<s9115>>10069000
$Control Segment=Called'once                                   <<s9115>>10070000
PROCEDURE Fclose'kludge ( Fnums );                             <<s9115>>10071000
INTEGER ARRAY Fnums;                                           <<s9115>>10072000
BEGIN                                                          <<s9115>>10073000
                                                               <<s9115>>10074000
  << Fclose the $Null files opened earlier.                  >><<s9115>>10075000
                                                               <<s9115>>10076000
  INTEGER Index;                                               <<s9115>>10077000
                                                               <<s9115>>10078000
  FOR Index := 0 UNTIL 1 DO                                    <<s9115>>10079000
    IF Fnums ( Index ) <> 0 THEN                               <<s9115>>10080000
      Fclose ( Fnums ( Index ) , 0, 0);                        <<s9115>>10081000
                                                               <<s9115>>10082000
END;                                                           <<s9115>>10083000
                                                               <<s9115>>10085000
$Page "System Startup Processor - Process'Startup"             <<s9115>>10085500
                                                               <<s9115>>10086000
<< ========================================================= >><<s9115>>10086500
<< ======          Procedure Process'Startup          ====== >><<s9115>>10087000
<< ========================================================= >><<s9115>>10087500
                                                               <<s9115>>10088000
PROCEDURE Process'Startup;                                     <<s9115>>10088500
                                                               <<s9115>>10089000
Comment                                                                 10089500
                                                                        10090000
This is the main procedure (i.e. that one which is called from          10090500
PROGEN's main program) of those set of procedures which process         10091000
the System Startup Configurator file.  This file, SYSSTART.PUB.SYS      10091500
contains commands which are executed before a session is                10092000
logged onto the console. Note that due to the programmatic              10092500
    Fopen'kludge ( Filenums );                                 <<s9115>>10260500
                                                               <<s9115>>10261000
      Find'keywords( Start'File'No, Start'Up'Option,           <<s9115>>10286000
                     Startup'Record, Type'Record );            <<s9115>>10287000
$EDIT VOID=10295000                                            <<s9115>>10290000
                                                               <<s9115>>10291000
      IF Startup'Record = -1D AND Type'Record = -1D            <<s9115>>10292000
      THEN                                                     <<s9115>>10293000
                                                               <<s9115>>10294000
        << On this particular startup there is no startup    >><<s9115>>10295000
        << block and no block for this startup type. But     >><<s9115>>10296000
        << the file exists and is valid. So we have already  >><<s9115>>10297000
        << printed the message indicating we have started    >><<s9115>>10298000
        << processing. This message explains that nothing    >><<s9115>>10299000
        << will happen this time.                            >><<s9115>>10300000
                                                               <<s9115>>10301000
        Genmsg ( Sysset, Nothing'to'do)                        <<s9115>>10302000
                                                               <<s9115>>10303000
      ELSE                                                     <<s9115>>10304000
      BEGIN                                                    <<s9115>>10305000
$EDIT VOID=10310000                                            <<s9115>>10310000
        IF Startup'Record <> -1d  THEN                         <<s9115>>10311000
        BEGIN                                                  <<s9115>>10312000
          Print'Block'Type ( T'Startup );                      <<s9115>>10313000
          Process'Block ( Start'File'No, Startup'Record );     <<s9115>>10315000
        END;                                                   <<s9115>>10320000
        IF Type'Record <> -1d   THEN                           <<s9115>>10330000
        BEGIN                                                  <<s9115>>10335000
          Print'Block'Type ( Start'Up'Option );                <<s9115>>10340000
          Process'Block ( Start'File'No, Type'Record );        <<s9115>>10345000
        END;                                                   <<s9115>>10350000
                                                               <<s9115>>10352500
      END;                                                     <<s9115>>10353000
                                                               <<s9115>>10411000
    Fclose'kludge ( Filenums );                                <<s9115>>10412000
   ABORTIO (CONSOLELDEV); <<abort all IOs to console >>        << 9953>>10991000
   STOPSPOOLERS (LDT'OUTPUT'SPOOLED);                          << 1512>>11285000
   MOVE STOPBUF(9) := ("DELETE", %15);                         << 1512>>11290000
$EDIT                                                                   11460000
$EDIT                                                                   11535000
$EDIT VOID=13370000                                            << 1559>>12320000
$TITLE "CREATE'MESSENGER"                                      << 1559>>12321000
PROCEDURE CREATE'MESSENGER;                                    << 1559>>12322000
BEGIN                                                          << 1559>>12323000
                                                               << 1559>>12324000
<<*********************************************************>>  << 1559>>12325000
<<                                                         >>  << 1559>>12326000
<< This procedure PROCREATEs the MESSENGER system process  >>  << 1559>>12327000
<< to manage the message system buffer.     The procedure  >>  << 1559>>12328000
<< MESSENGER is created as an outer block of a process.    >>  << 1559>>12329000
<< MESSENGER   is never called.                            >>  << 1559>>12330000
<<                                                         >>  << 1559>>12331000
<< Comments for the handling of PROCREATE are scattered    >>  << 1559>>12332000
<< throughout this procedure.                              >>  << 1559>>12333000
<<                                                         >>  << 1559>>12334000
<<*********************************************************>>  << 1559>>12335000
                                                               << 1559>>12336000
                                                               << 1559>>12337000
INTEGER                                                        << 1559>>12338000
   PIN := 0,              << Holds the MESSENGER   PIN.    >>  << 1559>>12339000
                          << Passing in a zero here to     >>  << 1559>>12340000
                          << PROCREATE indicates that      >>  << 1559>>12341000
                          << PROCREATE must get the PCB    >>  << 1559>>12342000
                          << entry for this PIN.           >>  << 1559>>12343000
   PLABEL,                << of MESSENGER.                 >>  << 1559>>12344000
   DELTAP,                << of MESSENGER.                 >>  << 1559>>12345000
   STACKDST,              << of MESSENGER.                 >>  << 1559>>12346000
   GLOBSIZE  := 14,       << GLOBSIZE is the amount of DB  >>  << 1559>>12347000
                          << relative storage in the stack.>>  << 1559>>12348000
                          << It is used to calculate where >>  << 1559>>12349000
                          << in the stack the first stack  >>  << 1559>>12350000
                          << marker should be placed.      >>  << 1559>>12351000
   DLSIZE :=  0,          << No DL                         >>  << 1559>>12352000
   LOCSIZE := %3000,      << Local storage size            >>  << 1559>>12353000
                                                               << 1559>>12354000
                                                               << 1559>>12355000
                                                               << 1559>>12356000
                                                               << 1559>>12357000
   PRI := [5/4,3/0,8/120],<< Linear Q (4) and pri=120      >>  << 1559>>12358000
                          <<     is its execute priority.  >>  << 1559>>12359000
   STRING := 0,           << INFO string, not used.        >>  << 1559>>12360000
   STRLEN := 0,           << INFO string length.           >>  << 1559>>12361000
   PARAM := 0,            << at MESSENGER   Q-4, not used. >>  << 1559>>12362000
   FLAGS := 0,            << This is the default value     >>  << 1559>>12363000
                          << expected by PROCREATE.  Other >>  << 1559>>12364000
                          << bits are used for things like >>  << 1559>>12365000
                          << an initial DEBUG call and the >>  << 1559>>12366000
                          << program capabilities.  See    >>  << 1559>>12367000
                          << the DEFINEs below for more    >>  << 1559>>12368000
                          << details.                      >>  << 1559>>12369000
   MAXSTACK := %10000,    << MAXDATA value.                >>  << 1559>>12370000
   STDIN := 0,            << No $STDIN.                    >>  << 1559>>12371000
   STDLIST := 0;          << No $STDLIST.                  >>  << 1559>>12372000
                                                               << 1559>>12373000
                                                               << 1559>>12374000
EQUATE                                                         << 1559>>12375000
   FATHERWAIT = 1,        << father wait flag>>                << 1559>>12376000
   INITSTACK = %4000;     << Initial stack size.           >>  << 1559>>12377000
                                                               << 1559>>12378000
                                                               << 1559>>12379000
DEFINE                                                         << 1559>>12380000
   STARTPRIV              << This flags the process's      >>  << 1559>>12381000
      = PLABEL.(0:1) #;   << status register to have its   >>  << 1559>>12382000
                          << privileged bit on.            >>  << 1559>>12383000
                                                               << 1559>>12384000
LOGICAL                                                        << 1559>>12385000
   XREG = X;              << For the subroutines.          >>  << 1559>>12386000
                                                               << 1559>>12387000
                                                               << 1559>>12388000
INTEGER ARRAY                                                  << 1559>>12389000
   WORKSPACE(0:13);       << This work area is used to     >>  << 1559>>12390000
                          << initialize the process's      >>  << 1559>>12391000
                          << stack variables.              >>  << 1559>>12392000
                                                               << 1559>>12393000
INTEGER                                                        << 1559>>12394000
   OFFSET;                << Used to index into the stack. >>  << 1559>>12395000
                                                               << 1559>>12396000
                                                               << 1559>>12397000
                                                               << 1559>>12398000
                                                               << 1559>>12399000
DEFINE                                                         << 1559>>12400000
   FLAGBA = FLAGS.( 7:1) #,   << These DEFINEs are for the >>  << 1559>>12401000
   FLAGIA = FLAGS.( 8:1) #,   << "program" file attributes >>  << 1559>>12402000
   FLAGPM = FLAGS.( 9:1) #,   << to be accessed by the     >>  << 1559>>12403000
   FLAGMR = FLAGS.(12:1) #,   << process.  For more info,  >>  << 1559>>12404000
   FLAGDS = FLAGS.(14:1) #,   << see Chapter 10 of the     >>  << 1559>>12405000
   FLAGPH = FLAGS.(15:1) #;   << System Tables Manual.     >>  << 1559>>12406000
                                                               << 1559>>12407000
                                                               << 1559>>12408000
<< The following subroutines are used to access and modify >>  << 1559>>12409000
<< the process's stack.                                    >>  << 1559>>12410000
   SUBROUTINE MOVEFROMDSEG( TARGET, DSTN, OFFSET, COUNT );     << 1559>>12411000
      VALUE TARGET, DSTN, OFFSET, COUNT;                       << 1559>>12412000
      LOGICAL TARGET, DSTN, OFFSET, COUNT;                     << 1559>>12413000
   BEGIN                                                       << 1559>>12414000
                                                               << 1559>>12415000
      XREG := TOS;                                             << 1559>>12416000
      ASSEMBLE( MFDS 0 );                                      << 1559>>12417000
      TOS := XREG;                                             << 1559>>12418000
                                                               << 1559>>12419000
   END;                                                        << 1559>>12420000
                                                               << 1559>>12420100
   SUBROUTINE MOVETODSEG( DSTN, OFFSET, SOURCE, COUNT );       << 1559>>12420110
      VALUE DSTN, OFFSET, SOURCE, COUNT;                       << 1559>>12420120
      LOGICAL DSTN, OFFSET, SOURCE, COUNT;                     << 1559>>12420130
   BEGIN                                                       << 1559>>12420140
                                                               << 1559>>12420150
      XREG := TOS;                                             << 1559>>12420160
      ASSEMBLE( MTDS 0 );                                      << 1559>>12420170
      TOS := XREG;                                             << 1559>>12420180
                                                               << 1559>>12420190
   END;                                                        << 1559>>12420200
                                                               << 1559>>12421000
<<*********************************************************>>  << 1559>>12422000
<<                                                         >>  << 1559>>12423000
<<  Start of main code for CREATE'MESSENGER.               >>  << 1559>>12424000
<<                                                         >>  << 1559>>12425000
<<*********************************************************>>  << 1559>>12426000
                                                               << 1559>>12427000
                                                               << 1559>>12428000
<< First, get a stack to be used for the process.          >>  << 1559>>12429000
   STACKDST := GETSTACK( INITSTACK, MAXSTACK );                << 1559>>12430000
   IF STACKDST = 0 THEN                                        << 1559>>12431000
   BEGIN                                                       << 1559>>12432000
      SUDDENDEATH (406);                                       << 1559>>12433000
      << RETURN;   >>                                          << 1559>>12434000
   END;                                                        << 1559>>12435000
                                                               << 1559>>12436000
<< Second, once a stack is obtained, calculate the values  >>  << 1559>>12437000
<< needed for PLABEL and DELTAP.  "@PLABEL" yields both    >>  << 1559>>12438000
<< STT and CST information--both are used for the con-     >>  << 1559>>12439000
<< version to a DELTAP, only the CST information is used   >>  << 1559>>12440000
<< for the PLABEL.                                         >>  << 1559>>12441000
   PLABEL := @MESSENGER.(8:8);  << CST information.      >>    << 1559>>12442000
   STARTPRIV := 1;                                             << 1559>>12443000
   DELTAP := CONVEXTLABELTODELTAP( @MESSENGER);                << 1559>>12444000
                                                               << 1559>>12445000
<< Third, PROCREATE the process.                           >>  << 1559>>12446000
   FLAGIA := 1;                                                << 1559>>12447000
   FLAGBA := 1;                                                << 1559>>12448000
   FLAGPH := 1;      << These capabilities are required.   >>  << 1559>>12449000
   FLAGDS := 1;                                                << 1559>>12450000
   FLAGPM := 1;                                                << 1559>>12451000
   PROCREATE( PIN, PLABEL, DELTAP, STACKDST, GLOBSIZE,         << 1559>>12452000
              DLSIZE, LOCSIZE, PRI, STRING, STRLEN, PARAM,     << 1559>>12453000
              FLAGS, MAXSTACK, STDIN, STDLIST );               << 1559>>12454000
   IF <> THEN                                                  << 1559>>12455000
   BEGIN                                                       << 1559>>12456000
      SUDDENDEATH (406);                                       << 1559>>12457000
      << RELDATASEG( STACKDST );   >>                          << 1559>>12458000
      << RETURN;          >>                                   << 1559>>12459000
   END;                                                        << 1559>>12460000
                                                               << 1559>>12460100
<< now put the word "**MESSENGER**" in the stack for easy >>   << 1559>>12460200
<< identification                                         >>   << 1559>>12460300
<< PXG'RELDB'OFFSET is the index of the word in the PCBX   >>  << 1559>>12461000
<< that points to the location of initial DB.              >>  << 1559>>12462000
   MOVEFROMDSEG( @OFFSET, STACKDST, PXG'RELDB'OFFSET, 1 );     << 1559>>12463000
                                                               << 1559>>12464000
   MOVE WORKSPACE := "**MESSENGER** ";                         << 1559>>12465000
                                                               << 1559>>12466000
   MOVETODSEG( STACKDST, OFFSET, @WORKSPACE, 7 );              << 1559>>12467000
                                                               << 1559>>12468000
                                                               << 1559>>12469000
<< finally, put its PIN in SYSGLOB %142 and AWAKE it >>        << 1559>>12470000
   ABSOLUTE (%1142) := PIN;                                    << 1559>>12471000
   AWAKE (PIN*PCBSIZE, FATHERWAIT, 0);                         << 1559>>12472000
                                                               << 1559>>12473000
END;  << CREATE'MESSENGER >>                                   << 1559>>12474000
$EDIT                                                          << 1930>>14120000
        ,IREPSTR(0:17)                                         << 1930>>14121000
    ;LOGICAL ARRAY                                             <<01258>>14226000
             DB'(*) = DB + 0                                   <<01258>>14228000
    IF RITENTRY(RIT'DBREL) = 1 THEN                            <<01258>>14566000
    << ADDRESS IS DB RELATIVE SO MUST ADD THE DISTANCE >>      <<01258>>14566100
    << BETWEEN DB AND TOS TO BUFAD TO GENERATE A DB    >>      <<01258>>14566200
    << RELATIVE TARGET                                 >>      <<01258>>14566300
    TOS _ LOGICAL(BUFAD) + DB'(1)                              <<01258>>14567000
    ELSE                                                       <<01258>>14568000
<< please note that the next statement will and should only >> <<o2277>>19859100
<< move the bits that are set during a vmount operation.    >> <<o2277>>19859200
<< Bit 12 is set during initial and/or spanning a group to  >> <<o2277>>19859300
<< a PV.                                                    >> <<o2277>>19859400
  ABSOLUTE(VMOUNTINFO).(13:3) := JMATVMOUNT;                   <<o2277>>19860000
   ALTDSEGSIZE (SJDTDSTN, JDTHEADERSIZE);                      << 9790>>20581000
   JDTJTDSDPTR    := JDTBEGINTABS;                             << 9790>>20595000
   JDTJTFDPTR    := JDTBEGINTABS;                              << 9790>>20600000
   JDTJTFEQPTR   := JDTBEGINTABS;                              << 9790>>20605000
   JDTJTLEQPTR    := JDTBEGINTABS;                             << 9790>>20610000
   JDTJJCWPTR    := JDTBEGINTABS;                              << 9790>>20615000
   JDTFREESPCPTR := JDTBEGINTABS;                              << 9790>>20620000
SDFINIT(0); << INITIALIZE SOFTDUMP BOOTSTRAP >>                <<D1131>>20827000
$EDIT VOID=21105000                                            <<p9114>>20930000
CREATE'MESSENGER;                                              << 1559>>21114000
<< Is it a Mighty Mouse? Range 6 to 15 >>                      << 1836>>21237500
M'MOUSE := THISCPU >= CPU'MM;                                  << 1836>>21237600
IF PMBCFIRMWARE                                                <<*9383>>21260000
   THEN INIT'PMBCREGS;                                         <<*9383>>21265000
$EDIT VOID=21320000                                            <<09412>>21320000
$EDIT VOID=21340000                                            <<09412>>21340000
$EDIT VOID=21345000                                            <<D1131>>21345000
          AWAKE(ABSYS'PVPROC,1,2);                             <<09412>>21365010
          INITRECLOG;                                          <<09412>>21365020
                                                               <<p9114>>21365050
<< The following fix was requested by the Mighty Mouse       >><<p9114>>21365100
<< Microcode Team. We execute the OSSIG instruction to       >><<p9114>>21365150
<< signal the Mighty Mouse micro machine that MPE            >><<p9114>>21365200
<< is fully up and all is right with the world.              >><<p9114>>21365250
<< How this instruction is used depends on the version       >><<p9114>>21365300
<< of microcode and who last modified OSSIG.                 >><<p9114>>21365350
<< The last time I talked to the microcoders, this           >><<p9114>>21365400
<< instruction did only one thing. Over the last year        >><<p9114>>21365450
<< this instruction has been responsible for other stuff     >><<p9114>>21365500
<< too. At the time of writing, OSSIG 3 is MPE's signal      >><<p9114>>21365550
<< to microcode that MPE is up far enough to do a            >><<p9114>>21365600
<< power failure recovery. If a power failure occurs         >><<p9114>>21365650
<< the firmware will never return to MPE but go straight     >><<p9114>>21365700
<< to the console with the H for Help dialogue.              >><<p9114>>21365750
<< If the OSSIG has been done, microcode will present        >><<p9114>>21365800
<< a powerfail trap through ININ and MPE gets a chance to    >><<p9114>>21365850
<< leave things in a nicely recoverable fashion.             >><<p9114>>21365900
<< The absolute source of what OSSIG does is the             >><<p9114>>21365950
<< microcode listing. OSSIG operation is not documented      >><<p9114>>21366000
<< elsewhere.                                                >><<p9114>>21366050
                                                               <<p9114>>21366100
IF M'Mouse THEN                                                <<p9114>>21366150
BEGIN                                                          <<p9114>>21366200
                                                               <<p9114>>21366250
   TOS := 3; << Parameter to OS-SIGNAL                       >><<p9114>>21366300
                                                               <<p9114>>21366350
   ASSEMBLE ( CON %20104;                                      <<p9114>>21366400
              CON %   23 );                                    <<p9114>>21366450
   << This is the OS-SIGNAL instruction.                     >><<p9114>>21366500
   << Power failure recovery is now enabled.                 >><<p9114>>21366550
END;                                                           <<p9114>>21366600
$EDIT VOID=21435000                                            << 1559>>21430000
   OLD'CONSOLE'LDEV := CONSOLELDEV;                            <<01259>>21531000
        << Get the LPDT entry for the console and turn the  >> << 9117>>21695000
        << LOGGING on bit off and the device owned state to >> << 9117>>21695100
        << free (both values set in CHECK'TERM'ATTRIBUTES)  >> << 9117>>21695200
        LPDT'INDEX := INTEGER( CONSOLELDEV ) *                 << 9117>>21695300
                      INTEGER( LPDT'ENTRY'SIZE );              << 9117>>21695400
        LPDT'LOGGING'ON := 0;                                  << 9117>>21695500
        LPDT'DEV'OWN'STATE := LPDT'NOT'OWNED;                  << 9117>>21695600
        << The console must be DCLOSE'd to free the device  >> << 9117>>21696000
   IF OLD'CONSOLE'LDEV <> CONSOLELDEV THEN                     <<01259>>21750100
   BEGIN                                                       <<01259>>21750200
      << The old console must be DCLOSE'd to free the device >><<01259>>21750300
      DISABLE;                                                 <<01259>>21750400
      LPDT'INDEX := INTEGER ( OLD'CONSOLE'LDEV ) *             <<01259>>21750500
                    INTEGER ( LPDT'ENTRY'SIZE );               <<01259>>21750600
      IF LPDT'DEV'OWN'STATE = LPDT'NOT'OWNED THEN              <<01259>>21750700
      BEGIN                                                    <<01259>>21750800
         LPDT'DEV'OWN'STATE := LPDT'RESERVED;                  <<01259>>21750900
         ENABLE;                                               <<01259>>21751000
         ATTACHIO (OLD'CONSOLE'LDEV,0,0,0,4,0,0,0,1);          <<01259>>21751100
         DISABLE;                                              <<01259>>21751200
         LPDT'DEV'OWN'STATE := LPDT'NOT'OWNED;                 <<01259>>21751300
      END;                                                     <<01259>>21751400
      ENABLE;                                                  <<01259>>21751500
   END;                                                        <<01259>>21751600
                                                               << 2215>>21765100
    << flip the progen flag in maestro'word, so that genmsg >> << 2215>>21765150
    << will not suppress the message                        >> << 2215>>21765250
    SYSGLOBEXT(MAESTRO'OFFSET).(14:1) := 1;                    << 2215>>21765600
                                                               << 2215>>21765700
         << TURN ON ECHO INCASE WE HAVE A PROGRAMMATICALLY   >><< 9331>>21810100
         << CREATED SESSION THAT HAS TURNED IT OFF.          >><< 9331>>21810200
           TOS := ATTACHIO(CONSOLELDEV,0,0,0,%10,0,0,0,1);     << 9331>>21811000
           ECHOSTATE := TOS;                                   << 9331>>21812000
           ASSEMBLE(DEL);                                      << 9331>>21813000
         << enable a 60 seconds timed read   >>                << 1559>>21818000
         ATTACHIO(CONSOLELDEV,0,0,0,5,0,60,0,1);               << 1559>>21819000
         IF ECHOSTATE = 1 << ECHO WAS OFF >>                   << 9331>>21821000
            THEN ATTACHIO(CONSOLELDEV,0,0,0,%11,0,0,0,1);      << 9331>>21822000
         << attachio returns 2 words: Count AND status >>               21825000
          IF TOS <> 1 THEN  << the read failed: timeout... >>  << 1559>>21831000
             GO TO CNTLA'DONE;                                 << 1559>>21832000
          IF NOT OK THEN                                       << 1559>>22215000
CNTLA'DONE:                                                    << 1559>>22216000
             PRINT(MSGX,5,0);                                  << 1559>>22217000
    << flip the progen flag back, so that genmsg will  >>      << 2215>>22230200
    << suppress further console messages               >>      << 2215>>22230210
                                                               << 2215>>22230300
    SYSGLOBEXT(MAESTRO'OFFSET).(14:1) := 0;                    << 2215>>22230400
                                                               << 2215>>22230500
