Cellar Door

17 сентября 2005

Debugging Kernel Problems by Greg Lehey

Благодарю списку рассылки FreeBSD cvs-src было обнаружено превосходное руководство по отладке ядра, точнее - книга, находящаяся еще в процессе написания. Прошу любить и жаловать -
Debugging Kernel Problems
by Greg Lehey. В высшей степени великолепный материал. Чтобы не быть голословным, приведу здесь вступительную часть:

Operating systems fail. All operating systems contain bugs, and they will sometimes cause the system to behave incorrectly. BSD kernels are no exception. Compared to most other operating systems, both free and commercial, BSD kernels offer a large number of debugging tools. This tutorial examines the options available both to the experienced end user and also to the developer.
This tutorial bases on the FreeBSD kernel, but the differences in other BSDs are small. We’ll look at the following topics:
• How and why kernels fail.
• Understanding log files: dmesg and the files in /var/log, notably /var/log/messages.
• Userland tools for debugging a running system.
• Building a kernel with debugging support: the options.
• Using a serial console.
• Preparing for dumps: dumpon, savecore.
• The assembler-level view of a C program.
• Preliminary dump analysis.
• Reading code.
• Introduction to the kernel source tree.
• Analysing panic dumps with gdb.
• On-line kernel debuggers: ddb, remote serial gdb.
• Debugging a running system with ddb.
• Debugging a running system with gdb.
• Debug options in the kernel: INVARIANTS and friends.
• Debug options in the kernel: WITNESS.
• Code-based assistance: KTR.