--HowToCPDebug.doc
--RDH	15-Jul-86 12:34:03	Create.

    This tells how to set up the software for CPDebugging on Daybreaks.  It assumes you already are slightly familiar with the bermuda windows.

    The hardware you need is a DLion (debugger), a Daybreak (debuggee) and a SongBord/Umbilical combination connecting them.  
    
    On your debugger workstation do a bringover of [Pebbles:osbu north:Xerox]<WMicroTools>DF>CPDebug.df.  This will offer to bring to your workstation CP and IOP Bermuda, this document, several command files, IOP symbol files, and the latest microcode from the working directory.  You may not want all of these.
    One such instance is that CPDebug.df will offer to bring three files with B0 in their name, RAMSysB0.loc, CPDebugB0.bermuda, and LoadSymbolsB0.bermuda  These are only useful if you are debugging a B0 or a B1.  You must have RAMDebug.loc MemDebug.loc DiskBoot.loc and 1 of RAMSysB2.loc and RAMSysB0.loc.  
    IOP and CP bermuda should have time stamps of 4-Feb-86 and 17-Mar-86 or later if you will do multibank debugging.  If the bringover tries to bring something older don't accept it.  
    You probably have new microcode you want to test so you need not accept what the smodel offers in the way of microcode.  It is essential however that you have microcode files both .fb and .st on the debugger disk when you run the CPDebug command file and that the name of the files be the same as that loaded by CPDebug.bermuda. 
    If you have a B2 without the Cmos display handler, or you can find a non-cmos board then you can use CPDebugNoCmos.bermuda.  The Cmos handler is constructed so as to make debugging very difficult.  If you have a B2 without a Cmos display controller you can use CPDebugNoCmos.bermuda.   

    On your debuggee install the latest DiskInitialDove.db and MesaDove.db from [Bambam:osbu north:Xerox]<WMicro>Dove> using Othello or the Installer.  The symbol files on the debugger and the .db files on the debuggee must correspond else CPDebug.bermuda will fail to work correctly.  CPDebug.df brings in the latest from the [Bambam:osbu north:Xerox]<WMicro>Dove> so the set of files should be consistent.  Symptoms of symbol files not matching debuggee .db files are failure of the command file CPDebug.bermuda to hit a break, the physical volume booting before the CPDebug.bermuda is done, or timeout when the CP is booted by CPDebug.bermuda.

    Run IOPBermuda, then run CPBermudaDaybreak.  Tiny the CPMesa window.  Grow the IOPBermuda window and the CPBermudaDaybreak window so they are 7 inches or more in height.  If the window is too short the command file may die with a message about an illegal location.

    In the IOPBermuda window run the command file LoadSymbols.bermuda.  This will take 10 to 15 minutes.  Then in CPBermuda run the command file CPDebug.bermuda.  This command file will walk the IOP through its boot sequence, patching over confilicts between CP debugging and the IOP's normal function.  About a minute after it begins running the boot icons should appear on the debuggee's screen.  Select Disk booting, the first function key.  After the IOP is fully booted it boots the CP and loads microcode into the debuggee's control store over the umbilical.  It then starts the CP so that it takes a break on the first Xfer which would start the germ executing.
    
    If you are debugging second bank microcode you may want to reload the debuggee's control store manually at this point, and restart the CP with your own breaks set.  Alternatively you could modify your own copy of CPDebug.bermuda so that it loads the microcode files you want in the first place.

    If you wish to continue the boot sequence on up to the physical volume, you can continue the CP and then continue the IOP.  The physical volume should then boot.

    Here is a word of warning.  To do anything in the CP Bermuda window the IOP must already be executing in its debugger kernel, i.e. either stopped, or at a break point.  So if you want to PollCP, for instance, you must first hit Stop! in the IOPBermuda window, unless of course the IOP is at a break already. 

    Debugging with B0/B1's as the debuggee is almost the same as for B2's.  You need not worry about what type of DCM board you have since their is no CMOS DCM for B0/B1's.  If you are using a B0 or a B1 then you should run the B0 version of the command files, CPDebugB0.bermuda and LoadSymbolsB0.bermuda.  These require RAMSysB0.loc instead of RAMSysB2.loc and the process followed by CPDebugB0.bermuda is slightly different from CPDebug.bermuda.    

    Below is the feedback gotten from the IOPBermuda message subwindow while running LoadSymbols and CPDebug.
    
 9-Jul-86 18:23:42  Running commands from LoadSymbols.bermuda.
Loading symbols from DiskBoot... Total Symbols: 926 Done.
Loading symbols from RAMSysB2... Total Symbols: 2534 Done.
Loading symbols from RAMDebug... Total Symbols: 3987 Done.
Loading symbols from MemDebug... Total Symbols: 4072 Done.
It took 408667 ms to run LoadSymbols.bermuda.

11-Jul-86  9:16:27  Running commands from CPDebug.bermuda.
Booting 80186 ... IOP was booted.

11-Jul-86  9:16   State changed: IOP was booted.
WriteIO[port: 0080, data: 8000];
WriteIO[port: E018, data: 05];
WriteIO[port: E01F, data: FF];
Loading IOP from RAMSysB2... Done.
Setting 80186 Break at 9406 = 9406  ... ok.
Continuing 80186 ... 
11-Jul-86  9:17   State changed: IOP Break at 9406 (DISPLAYINIT+C).
Setting 80186 Break at IOPE@Restart = 8642  ... ok.
Continuing 80186 ... 
11-Jul-86  9:18   State changed: IOP Break at 8642 (IOPE@RESTART).
Clearing 80186 Break at IOPE@Restart = 8642  ... ok.
Setting 80186 Break at StartRam = F54  ... ok.
Continuing 80186 ... 
11-Jul-86  9:18   State changed: IOP Break at F54 (STARTRAM).
Setting 80186 Break at DaybrkCP = 5D92  ... ok.
Continuing 80186 ... 
11-Jul-86  9:18   State changed: IOP Break at 5D92 (DAYBRKCP).
Setting 80186 Break at SystemLoop = 88CF  ... ok.
Continuing 80186 ... 
11-Jul-86  9:18   State changed: IOP Break at 88CF (SYSTEMLOOP).
Clearing 80186 Break at SystemLoop = 88CF  ... ok.
Booting CP ... This machine has 1 banks of control store.Loading Kernel for bank 0... ok.
Booted.
Loading CP from DayBreakMesa.fb.
It took 8281 ms to load 3935 instructions. (22808 bits/sec)
Loading CP symbols from DayBreakMesa.st.
It took 8818 ms to load 1742 tags, 68 R, 29 RH, and 239 U Reg symbols.
Setting CP Break at ControlTrap = .CR 8A5 ok.
Setting CP Break at StackErr = .CR F0B ok.
Setting CP Break at XXXX = .CR 457 ok.
Setting CP Break at XFER = .CR A02 ok.
Setting 80186 Break at A50D = A50D  ... ok.
Continuing 80186 ... 
11-Jul-86  9:19   State changed: IOP Break at A50D (ENDERROR+7).
Clearing 80186 Break at A50D = A50D  ... ok.
Setting PC to Germ, (.CR F00).
CP Break at .CR A02, (XFER), c1.
Clearing CP Break at XFER = .CR A02 ok.
It took 179298 ms to run CPDebug.bermuda.