#include <oskit/gdb.h>void gdb_pc_com_init(int com_port, struct termios *com_params);
This is a simple ``wrapper'' function which ties together all of the OSKit's remote debugging facilities to automatically create a complete remote debugging environment for a specific, typical configuration: namely, remote serial-line debugging on a PC through a COM port. This function can be used as-is if this configuration happens to suit your purposes, or it can be used as an example for setting up the debugging facilities for other configurations.Specifically, this function does the following:
- Sets all entries in the base_trap_handlers array to point to gdb_trap. This establishes the GDB debugging trap handler as the basic handler used to handle all processor traps.
- Sets the gdb_signal variable to point to gdb_serial_signal. This ``connects'' the generic GDB debugging code to the serial-line debugging stub.
- Sets gdb_serial_recv to point to com_cons_getchar, and gdb_serial_send to point to com_cons_putchar. (Actually a wrapper that gives the port to those functions, as they now take a serial port as the first parameter). This connects the serial-line debugging stub to the simple polling PC COM-port console code.
- Initializes the specified COM port using the specified parameters (baud rate, etc.).
- Sets the hardware IRQ vector in the base IDT corresponding to the selected COM port to point to an interrupt handler that invokes the remote debugger with a ``fake'' SIGINT trap, and enables the serial port interrupt. This allows the remote user to interrupt the running kernel by pressing CTRL-C on the remote debugger's console, at least if the kernel is running with interrupts enabled.
- com_port
- The COM port number through which to communicate: must be 1, 2, 3, or 4.
- com_params
- A pointer to a termios structure defining the required serial port communication parameters. If this parameter is NULL, the serial port is set up for 9600,8,N,1 by default.
- gdb_trap
- 10.17.5
- gdb_signal
- 10.17.9
- gdb_serial_signal
- 10.18.2
- gdb_serial_recv
- 10.18.7
- gdb_serial_send
- 10.18.8
- com_cons_init
- 10.13.8
- com_cons_getchar
- 10.13.9
- com_cons_putchar
- 10.13.10
- com_cons_enable_receive_interrupt
- 10.13.12
- base_idt
- 10.7.4
- base_raw_termios
- 10.13.4