Introduction to Debugging the FreeBSD Kernel

John Baldwin <jhb@FreeBSD.org>

Just like every other piece of software, the FreeBSD kernel has bugs. Debugging a kernel is a bit different from debugging a userland program as there is nothing underneath the kernel to provide debugging facilities such as ptrace() or procfs. This paper will give a brief overview of some of the tools available for investigating bugs in the FreeBSD kernel. It will cover the in-kernel debugger DDB, the kernel tracing facility KTR, and using kgdb to perform post-mortem analysis on kernel crash dumps.

  • article.pdf (152 kb)
  • slides.pdf (112 kb)