Heading:
How to Use Midas with Pilot
Page Numbers: Yes X: 527 Y: 10.5"
XEROX
PARC
8 February 1982


To:Microcode File

From:Jim Frandeen, Edward Fiala

Subject:How to Use Midas with Pilot

Filed On:
[Indigo]<D0Docs>DebugPilotWithMidas.Bravo, .Press

This is a short description of how to debug Pilot with Midas; it works for the Cedar variant of Pilot and handles any combination of microswitch/Star keyboards and CSL/LF monitors. It assumes you already know how to use Midas. Documentation for Midas can be found on [Indigo]<D0Docs>D0Midas.Press. You will need a Midas disk to start with.
If you don’t already have a Midas disk, you will need to build one:
1. Spin up a clean disk on your Alto. Boot the NetExec and invoke NewOS. Use the long installation dialog and erase the disk.

2. Retrieve two files from [Idun]<WD0>:
MidasDisk.do
Do.run
Type:
Do MidasDisk
This procedure will prompt you for the name of a file server where it can find Alto files.
3.When you finish the above procedure, you will have a disk current as of the last SDD integration. Then update to Ed Fiala’s latest release by loading several FTP dump files:
[Indigo]<D0>D0MidasRun.Dm,
[Indigo]<D0Source>CedarUCode.Dm, and
[Indigo]<D0SOurce>InitialSources.Dm;
then you retrieve [Indigo]<D0>Midas.Programs.
4.Finally, call Ed Fiala or send message to Fiala.Pa for any special instructions.
There are several important limitations to the ways in which Midas can be used to debug Pilot. The first is that you must BEGIN with Midas. If instead you attempt to attach to a machine which is in an interesting state, then Midas will boot the machine while activating its Kernel microcode, and all RM registers and the TPC’s for the tasks will be reset (possibly storage will survive booting, however).
The second limitation is that the various microcode systems that you run must all reserve space for the Midas Kernel and have an appropriate linkage between the fault handler and the Midas Kernel. Initial has an IMReserve for the Midas Kernel; if you assemble the Pilot microcode with WithMidas=1 in GlobalDefs.Mc, then Pilot also has an IMReserve for the Midas Kernel. Pilot microcode at the present time is built with WithMidas=1, but the Cedar variant frequently is not built with WithMidas=1. However, the normally released Alto emulator overwrites the Midas Kernel, so you will need to obtain a special debugging version of the Alto emulator before attempting the "Start From Alto" procedure discussed below.
The third limitation is that you cannot activate Pilot directly from Midas by loading and running .Mb files. Instead, you must put the Pilot germ and microcode somewhere on the Dolphin, and then load the microcode by running either the Initial microcode or the Alto RunPilot subsystem. There are two ways to start Pilot from Midas:.
1. Use Midas to boot Pilot directly. For this method, you must have Pilot microcode and the Pilot Germ installed on your SA4000; generally speaking, the microcode installed on the SA4000 must be the SAME as that on your Midas debugging disk. In addition, you must have a Physical Boot Volume set.
2. Use Midas to boot Alto mode. From the Alto Executive, type RunPilot. For this method, you must have Pilot.Eb and the Pilot Germ installed on the Alto volume. In addition, you must have a Physical Boot Volume set. ???What switch makes RunPilot take these from the Alto volume???
Using Midas to Boot Pilot Directly
Boot the Midas disk and type Midas/i Pilot. The Pilot.Midas command file will first load Initial.Mb, insert a breakpoint at RamLoaded, and start Initial at SAPilotStart. If all goes properly, Initial will read the Pilot microcode and all of its overlays from your SA4000 into storage, and the breakpoint at RamLoaded will be hit after LoadRAM has loaded Pilot1 into the microstore; then Pilot1 symbols are loaded by RunProg and the RamLoaded breakpoint is reinserted in octal (at IMX 316); this is necessary because all previous symbols and breakpoint information (which pertained to Initial) have been flushed by Run-Prog; since the space occupied by the LoadRAM module in Initial has been IMReserved in Pilot, the RamLoaded symbol is no longer available.
The Pilot.Midas command file pauses at this point with a message saying that Pilot1 is loaded, and you may abort the command file or continue it. If you continue the command file, it will pause again at BootEmulators in Initialize.Mc after comleting all device initialization but before loading the Pilot2 overlay. If you continue from there, it will pause a final time after loading the Pilot2 overlay; if you continue from there, your physical boot volume will be started.
Assuming that you abort the first time the Pilot.Midas command file pauses, then you have the following options:
a) Kill the IMX 316 breakpoint and proceed, letting Pilot start normally. After it is running, you can get control with Midas control-C and establish a suitable debugging context as discussed below.
b) Insert any breakpoints in Pilot1 that you wish and continue. This allows debugging initialization and other Pilot1 microcode.
c) If you want to debug the terminal microcode, then the driver for the LF keyboard system is included in Pilot1, so you can insert breakpoints directly; for a CSL keyboard system (with either a CSL or LF monitor), you must proceed from the RamLoaded breakpoint--the next time you get to that breakpoint, the microcode for that terminal, obtained from the first or second overlay in PilotD0.Eb or CedarD0.Eb, will have been loaded into the microstore. See below for establishing a debugging context.
To debug Pilot2 microcode, you should continue the command file until it indicates that Pilot2 has been loaded; then abort it.
Using Midas to Boot Alto Mode
1. Obtain a special debugging version of the Alto emulator that contains an IMReserve for the Midas Kernel--normal Alto microcode overwrites the Kernel and cannot be used. [Indigo]<D0>NewAMesa.Mb with CSL keyboards or [Indigo]<D0>LFAMesa.Mb with LF keyboards are suitable; put one of these on your Midas disk.
2. Boot the Midas disk and type "NewAMesa;L"; this loads the Alto microcode. Start the Alto emulator with "EGO;G" "KGO;G" or "KGOP2;G" for ether boot, partition 1 boot, or partition 2 boot, respectively. The Alto Executive will appear shortly on the screen.
3. Type RunPilot to the Alto Executive--this will use the installed pilot germ and microcode. RunPilot also has options that allow the germ and microcode to be taken from files in the Alto file system; these options are described somewhere else.
4. When Pilot begins execution, you may abort it with the mouse button or control-C. See below for how to establish the appropriate context for debugging after you have gotten control.
Displaying Appropriate Symbols From Midas
When appropriate microcode is loaded, you can setup a debugging context by doing Run-Prog on PILOT1SYMBOLS, PILOT2SYMBOLS, CSLSYMBOLS, or CSLFSYMBOLS. Run-Prog clears all previous symbols and breakpoints and loads symbols from one of the four Pilot overlays--it is impossible to have symbols from more than one overlay concurrently active. PILOT1SYMBOLS and PILOT2SYMBOLS also setup the middle column of the Midas display with registers generally of interest when debugging Pilot emulator code; CSLSYMBOLS and CSLFSYMBOLS setup the middle column with registers generally interesting when debugging one of the display drivers.
At any time you can change the contents of the Midas display by doing Read-Cmds on a variety of files in the menu with suggestive names. Among these are the following:
BBREGSDisplays BitBlt registers in middle column.
RDCREGSDisplays RDC registers in middle column.
GCDEBUGDisplays CedarGC registers.
MEMERRORSDisplays memory error registers in right column.
TX*Various TextBlt registers.
Loading the Eprom Microcode
To load the microcode that is normally loaded from the EPROMs, use the EPROM command file:
1. Select Run-Prog on the Midas menu.
2. When the Run-Prog menu appears, select EPROM.
3. When SA4000Boot is loaded and the next menu appears, select continue. This will cause the D0 to be booted from the Initial Microcode file.
Loading Initial
To load the Initial microcode, use the Initial command file:
1. Select Run-Prog on the Midas menu.
2. When the Run-Prog menu appears, select INITIAL.
When the command file is finished, the display will show some symbols of interest for the MemInit.Mc module. The various starting addresses are on pages 1 and 2 of Initial.Mc; they include the following:
SAAltoStartboots and starts AMesa from the SA4000.
SAPilotStartboots and starts Pilot from the SA4000.
EtherAltoStartboots and starts AMesa from the 3 mb Ethernet.
EtherPilotStartboots and starts Pilot from the 3 mb Ethernet.
Some interesting breakpoints in Initial are the following:
RamLoaded(IMX 316) where LoadRAM finishes.
IMapbeginning of the map and storage test.
imRepeatStorageTestafter map test.; here you can change the contents of the SoftQThreshold register to 100b if you want to make the storage test put pages with correctable errors into service.
MemInitDoneend of storage test.
MicrocodeLoadedafter loading microcode into the VM block at 1400b.