Welcome to NYCU CSIT Mirror site

Kernel config options for kdb

Kernel config options for kdb

Kdb is quite a bit more complex than the simple gdbstub sitting on top of the kernel's debug core. Kdb must implement a shell, and also adds some helper functions in other parts of the kernel, responsible for printing out interesting data such as what you would see if you ran "lsmod", or "ps". In order to build kdb into the kernel you follow the same steps as you would for kgdb.

The main config option for kdb is CONFIG_KGDB_KDB which is called "KGDB_KDB: include kdb frontend for kgdb" in the config menu. In theory you would have already also selected an I/O driver such as the CONFIG_KGDB_SERIAL_CONSOLE interface if you plan on using kdb on a serial port, when you were configuring kgdb.

If you want to use a PS/2-style keyboard with kdb, you would select CONFIG_KDB_KEYBOARD which is called "KGDB_KDB: keyboard as input device" in the config menu. The CONFIG_KDB_KEYBOARD option is not used for anything in the gdb interface to kgdb. The CONFIG_KDB_KEYBOARD option only works with kdb.

Here is an example set of .config symbols to enable/disable kdb:

  • # CONFIG_DEBUG_RODATA is not set

  • CONFIG_FRAME_POINTER=y

  • CONFIG_KGDB=y

  • CONFIG_KGDB_SERIAL_CONSOLE=y

  • CONFIG_KGDB_KDB=y

  • CONFIG_KDB_KEYBOARD=y