XEROXPARC14 June 1983To:Microcode DevelopersFrom:Edward FialaSubject:How to Debug Dolphin Microcode With MidasFiled On:[Indigo]DebugWithMidas.Bravo, .PressThis is a short description of how to debug Pilot, Cedar, or AMesa microcode with Midas. Ithandles any combination of microswitch/Star keyboards and CSL/LF monitors.Documentation for Midas can be found on [Indigo]D0Midas.Press. You shouldread both the Midas document and the part of "Dolphin Booting and Maintenance PanelCodes" ([Indigo]MPCodes.press) which describes booting.Midas is a debugging program that runs under the Alto OS on a different machine from theone you are debugging. You can run it on an Alto or on the Alto partition of a Dolphin. Ineither case, you need a special cable to connect the printer interface of the Alto or Dolphinrunning Midas to the printer interface of the Dolphin being debugged.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 thelong installation dialog and erase the disk. If you going to run Midas on a Dolphin, youdon't have to do this--just make sure there are 2000 free pages on your Alto partition.2. Obtain the following files from the place where you get Alto subsystems (e.g.,[Maxc]):Micro.run(microcode assembler)MicroD.run(microcode loader)Ftp.runBravo.cmand execute this command fileRunMesa.runEmpress.runFind.runWaterlily.run3. Load D0MidasRun.dm and retrieve the other files below from [Indigo] with Ftp:D0Lang.McD0MidasRun.dmMidas.programsMemErrors.midasMakeLoaderFile.bcd(microcode boot file builder)%D`vp(^q%](rX Ws`r Ts`r Qs`r) NFsF`r%X HY9# F ? DG B F A.? =T ;= :'F 8]E 4C1yXR/Y-W*rR(%5,#j ,!, @ u 9Q2 g , U>XHow to Use Midas with Pilot2Because of file name conflicts, you can only have one of the following dumps ofmicrocode sources loaded at-a-time (except that Initial can coexist with Pilot microcodeif Pilot microcode is loaded last):CedarUCode.dmfor Cedar microcodePilotUCode.dmfor Pilot microcodeAMesaSources.dmfor AMesa microcodeInitialSources.dmfor Initial microcode4.Call Ed Fiala or send message to Fiala.Pa if you have problems with theseprocedures.There are several important limitations to the ways in which Midas can be used to debug aDolphin. The first is that you must BEGIN with Midas. If instead you attempt to attach to amachine which is in an interesting state, then Midas will boot the machine while activating itsKernel microcode, and all RM registers and the TPC's for the tasks will be reset (possiblystorage will survive booting, however).The second limitation is that the various microcode systems that you run must all reservespace for the Midas Kernel and have an appropriate linkage between the fault handler andthe Midas Kernel. Initial has an IMReserve for the Midas Kernel; if you assemble the Pilotmicrocode with WithMidas=1 in GlobalDefs.Mc, then Pilot also has an IMReserve for theMidas Kernel. SDD Pilot microcode at the present time is built with WithMidas=1, but theCedar and Tor variants are not, and the normally released Alto emulator overwrites the MidasKernel, so you will need to obtain or create special debugging versions of these to debugfrom Midas.The third limitation is that you cannot activate Pilot directly from Midas by loading andrunning .Mb files. Instead, you must install the Pilot germ and microcode on the DolphinSA4000, and then load the microcode by running the Initial microcode from Midas. Themicrocode 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. Using Midas to Boot PilotBoot the Midas disk and type "Midas/i Pilot". The Pilot.Midas command file will first loadInitial.Mb, insert a breakpoint at RamLoaded, and start Initial at SAPilotStart. If all goesproperly, Initial will read the Pilot microcode and all of its overlays from your SA4000 intostorage, and the breakpoint at RamLoaded will be hit after LoadRAM has loaded Pilot1 intothe microstore; then Pilot1 symbols are loaded by RunProg and the RamLoaded breakpointis reinserted in octal (at IMX 316); this is necessary because all previous symbols andbreakpoint information (which pertained to Initial) have been flushed by Run-Prog; since thespace occupied by the LoadRAM module in Initial has been IMReserved in Pilot, theRamLoaded symbol is no longer available.The Pilot.Midas command file pauses at this point with a message saying that Pilot1 isloaded, and you may abort the command file or continue it. If you continue the commandfile, it will pause again at BootEmulators in Initialize.Mc after comleting all device initializationbut before loading the Pilot2 overlay. If you continue from there, it will pause a final timeafter loading the Pilot2 overlay; if you continue from there, your physical boot volume will bestarted. fqGbrXO`SX^#\,Z,Y),W^,S'IR" NW LG K R IP4& G' DY BI&2 @~A > G <"7 ;'5 9T%4 7 4? 2L< 0 J .B ,7 (q %5r> #j? !L (1  K @B u\ '* ( nL  L ]  T D_ y r 2>].How to Use Midas with Pilot3Assuming that you abort the first time the Pilot.Midas command file pauses, then you havethe 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 (or by selecting and left-buttoning "Abort") andestablish a suitable debugging context as discussed below.b) Insert any breakpoints in Pilot1 that you wish and continue. This allows debugginginitialization and other Pilot1 microcode.c) If you want to debug the terminal microcode, then the driver for the LF keyboard system isincluded in Pilot1, so you can insert breakpoints directly; for a CSL keyboard system (witheither a CSL or LF monitor), you must proceed from the RamLoaded breakpoint--the nexttime you get to that breakpoint, the microcode for that terminal, obtained from the first orsecond overlay in PilotD0.Eb or CedarD0.Eb, will have been loaded into the microstore. Seebelow for establishing a debugging context.To debug Pilot2 microcode, you should continue the command file until it indicates thatPilot2 has been loaded; then abort it. Displaying Pilot Microcode Symbols From MidasWhen Pilot has been loaded and started as described above, you can setup a debuggingcontext by doing Run-Prog on PILOT1SYMBOLS, PILOT2SYMBOLS, CSLSYMBOLS, orCSLFSYMBOLS. Run-Prog clears all previous symbols and breakpoints and loads symbolsfrom one of the four Pilot overlays--it is impossible to have symbols from more than oneoverlay concurrently active. PILOT1SYMBOLS and PILOT2SYMBOLS also setup the middlecolumn of the Midas display with registers generally of interest when debugging Pilotemulator code; CSLSYMBOLS and CSLFSYMBOLS setup the middle column with registersgenerally 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 avariety 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.Using Midas to Debug AMesa microcode1. Obtain a special debugging version of the Alto emulator that contains an IMReserve forthe Midas Kernel--normal Alto microcode overwrites the Kernel and cannot be used.[Indigo]NewAMesa.Mb with CSL keyboards or [Indigo]LFAMesa.Mb with LFkeyboards 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 theAlto emulator with "EGO;G" "KGO;G" or "KGOP2;G" for ether boot, partition 1 boot, or fqG br!8 `S \A [U YL: U? T* P4) N%6 MM K>H Is< G+ D7H Bl' >&q- :rH 8F 7** 5U= 37 1E /)' .*@ *4 (7x%|+x#G(x!x0x dq$ r N ( 2 ]W-X < 3% VI  >]How to Use Midas with Pilot4partition 2 boot, respectively. The Alto Executive will appear shortly on the screen.Eprom MicrocodeSources and other files for the Rev-L EPROM microcode are on[Indigo]Proms>Rev-L>*. After you rebuild the .mb file for the EPROM microcodefrom the sources, you can debug it from Midas as follows:1. Select Run-Prog on the Midas menu.2. When the Run-Prog menu appears, select EPROM.When SA4000Boot is loaded and the next menu appears, you can select "CONTINUE" tocontinue the boot sequence with the Initial microcode, obtained from the Initial microcodearea of the SA4000.Loading InitialTo 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 theMemInit.Mc module. The various starting addresses are on pages 1 and 2 of Initial.Mc; theyinclude 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 ofthe SoftQThreshold register to 100b if you want to make the storagetest put pages with correctable errors into service.MemInitDoneend of storage test.MicrocodeLoadedafter loading microcode into the VM block at 1400b. fqG brV ]q Zfrm< X7! V9 S_% O0 L{8 J; H Dq A.r< =% :K2 6H 5(3 3Cx/ 'x- 'x+i .x)4. %:x"P!x &x#( #R4x x3X =RiLOGO HELVETICA  HELVETICA  HELVETICA5 Ej/DebugWithMidas.BravoFialaJune 14, 1983 10:57 AM