next up previous contents
Next: Running applications under the Up: Remote debugging Previous: Remote debugging

Preparing to debug

If you are using Linux and have a version of GDB that supports ELF, then you can use your native Linux GDB for remote development of DOS programs running under MOSS: there's no need to build a special GDB cross-debugger. This should also be the case for versions of GDB compiled for other ELF systems such as SVR4. For other OS's that do not use ELF as their primary object file format, you may have to build your own cross-GDB debugger. See the GDB documentation for instructions on how to do this.

You'll also need to turn on the ENABLE_RGDB option in `moss/kernel/raw/config.h and build a version MOSS that supports remote debugging. In addition, if your null modem cable is connected to a serial port other than COM1 on your DOS machine (MOSS is currently hard-coded to use COM1--gak, I know!), you'll need to edit moss/kernel/raw/remote-gdb.c and change the #define'd constants `ser_io_base' and `ser_irq' appropriately. (COM2 is 0x2f8 and 4, respectively.) Also, MOSS is currently hard-coded to use 9600,8,n,1 as its serial parameters; you can similarly change that by hacking the source.

Note that the remote GDB support relies on MOSS's ability to dispatch hardware interrupts as POSIX signals: specifically, a serial line interrupt causes a SIGINT to be sent to the program. Since dispatching hardware interrupts as POSIX signals isn't supported under DPMI, neither is remote debugging. (Actually, it might ``sort-of'' work: you might be able to debug, but just won't be able to interrupt the program from the remote GDB. We haven't tested this though.)



Bryan Ford