How to debug *BSD kernel (1) kernel printf() simple but powerful enough for a simple bug. just add printf() in the kernel source code (like in an application). printed messages can be seen on the console or via syslog(3). core file examination useful for bugs of illegal memory access, etc. procedure: 1. build kernel with debugging symbols (add "-g" on compilation). 2. dig a dump directly (/var/crash). 3. let the kernel core-dump, then the kernel will produce a core file on boottime. 4. examine the core using gdb (for FreeBSD)% gdb -k kernel.gdb /var/crash/vmcore.0 note that not all bugs make the kernel core-dump (e.g. infinite loops)