Kernel debugger explained
A kernel debugger is a debugger present in some operating system kernels to ease debugging and kernel development by the kernel developers. A kernel debugger might be a stub implementing low-level operations, with a full-blown debugger such as GNU Debugger (gdb), running on another machine, sending commands to the stub over a serial line or a network connection, or it might provide a command line that can be used directly on the machine being debugged.
Operating systems and operating system kernels that contain a kernel debugger:
- The Windows NT family includes a kernel debugger named KD,[1] which can act as a local debugger with limited capabilities (reading and writing kernel memory, and setting breakpoints)[2] and can attach to a remote machine over a serial line, IEEE 1394 connection, USB 2.0 or USB 3.0 connection.[3] The WinDbg GUI debugger can also be used to debug kernels on local and remote machines.
- BeOS and Haiku include a kernel debugger usable with either an on-screen console or over a serial line. It features various commands to inspect memory, threads, and other kernel structures. [4]
- DragonFly BSD
- Linux kernel; No kernel debugger was included in the mainline Linux tree prior to version 2.6.26-rc1 because Linus Torvalds didn't want a kernel debugger in the kernel.[5] [6]
- NetBSD (DDB for local, KGDB for remote)
- macOS - ddb for local, kdp for remote[11]
- OpenBSD includes ddb which has a syntax is similar to GNU Debugger.[12]
Notes and References
- Web site: Debugging Environments. 2020-02-16. Debugging Tools for Windows (WinDbg, KD, CDB, NTSD).
- Web site: Local Kernel-Mode Debugging. 2020-02-16.
- Web site: Live Kernel-Mode Debugging Using KD. 2020-01-16.
- Web site: Welcome to Kernel Debugging Land.
- Web site: LWN.net . 2008-05-29.
- Web site: Linux 2.6.26-rc1 . 3 May 2008 . Linus . Torvalds . LWN . 9 March 2015 .
- Web site: Nellitheertha . Hariprasad . Inside the Linux kernel debugger . . 2008-05-29 . dead . https://web.archive.org/web/20080621041048/http://www.ibm.com/developerworks/linux/library/l-kdbug/index.html . 21 June 2008 .
- Web site: LWN Weekly Kernel News . 7 Sep 2008.
- Web site: MDB Github Website . 1 Jan 2016 . dead . https://web.archive.org/web/20160322085319/http://jeffmerkey.github.io/linux/ . 22 March 2016 .
- Web site: LWN Weekly Kernel News . 28 June 2010.
- Web site: the built-in low-level kernel debugger, ddb, is part of XNU's Mach component, and so is kdp, a remote kernel debugging protocol implementation. Singh. Amit. XNU: The Kernel. What is Mac OS X?. 2012-05-25. December 2003. https://web.archive.org/web/20200602233536/http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html. 2020-06-02. dead.
- Web site: ddb(4) . . 2019-12-06 . OpenBSD manual page server . 2019-12-13 . The ddb debugger provides a means for debugging the kernel, and analysing the kernel after a system crash ("panic"), with a gdb(1)-like syntax..