[Coco] System-State Remote Debugging for NitrOS-9
Boisy G. Pitre
boisy at boisypitre.com
Mon Apr 4 11:16:24 EDT 2005
One of the things that I have always wanted for NitrOS-9 is a method to
debug system state modules such as the kernel, file managers and
drivers. The problem with doing an on-system debugger is that for the
features that I want, it would take quite a bit of code and space.
Instead, I've taken a "client-server" approach, and as a result, I've
devised a scheme which I think will work well.
All that's needed is:
- a CoCo running NitrOS-9 with a special KrnP3 module installed
- an RS-232 Pak
- a "host system" (Linux, Mac or Windows)
The host system connects to the CoCo via serial cable. On the host
there is a full debugger that communicates with the CoCo via the serial
port. There is a simple communications protocol that the host uses to
get/set the contents of registers and memory. With these simple
operations, the host can set breakpoints, disassemble code in memory on
the fly, etc.
On the CoCo side is a KrnP3 module that goes in the bootfile. To put
the CoCo in 'debug' mode, all that is needed is to invoke a utility
which makes an 'swi' instruction call. (I'm also looking into putting
something in the keyboard driver that would allow the CoCo to go into
debug mode via some convoluted combination of keys.) Once in debug
mode, the CoCo effectively "freezes" and the host can take control and
set breakpoints, change registers, memory, etc.
Once things are set up propertly, the host can then reinvoke execution
on the CoCo. A breakpoint encountered causes the KrnP3 to go active
again, and debugging to resume.
My plan is to have this going in some form or fashion at the upcoming
CoCo Fest.
--
Boisy G. Pitre
E-Mail: boisy at boisypitre.com
Mobile: (337) 781-3997
Web: www.boisypitre.com
More information about the Coco
mailing list