-- Copyright (C) 1983, 1985  by Xerox Corporation. All rights reserved. 
-- BootMeAgain.mesa, HGM,  6-Apr-85 11:40:29

DIRECTORY
  Boot USING [EthernetRequest],
  NSConstants USING [bootServerSocket],
  Process USING [Pause, SecondsToTicks],
  ProcessorFace USING [SetMP],
  SpecialBooting USING [BootFromEthernet],
  System USING [broadcastHostNumber, NetworkAddress, nullNetworkNumber],
  Unformat USING [HostNumber],
  
  EERom USING [SmashData],
  Watchdog USING [Activate];

BootMeAgain: PROGRAM
  IMPORTS Process, ProcessorFace, SpecialBooting, Unformat, EERom, Watchdog =
  BEGIN
  
  bootFileNumber: LONG STRING = "25200002001";

  DoIt: PUBLIC PROCEDURE =
    BEGIN
    where: Boot.EthernetRequest;
    address: System.NetworkAddress;
    address ← [
      net: System.nullNetworkNumber,
      host: System.broadcastHostNumber,
      socket: NSConstants.bootServerSocket];
    where ← [
      bfn: [LOOPHOLE[Unformat.HostNumber[bootFileNumber]]],
      address: address ];
    FOR i: CARDINAL DECREASING IN [0..30) DO
      ProcessorFace.SetMP[i];
      Process.Pause[Process.SecondsToTicks[1]];
      ENDLOOP;
    Watchdog.Activate[5*60];
    SpecialBooting.BootFromEthernet[where];
    END;
  
  
  EERom.SmashData[];
  DoIt[];
  
  END.....