Stop managing your network one node at a time!
[Home] [Download] [Project Page] [Bugs] [SVN] [email Lists] [Tutorials] [Screenshots]

Methods

There are several methods for doing kernel debugging. This simplest is to use printk throughout your code. however, this doesn't help much if you are locking up your kernel, and constantly having to wait for your system to reboot and check the disks after a hard lockup. (Use of a journaling filesystem is highly recommended if you are doing kernel debugging!)

The second method is to debug on a virtual machine. There are several available, including the commercial VMWare and the open-source projects User Mode Linux and bochs.

VMware

  1. Install VMware. The configuration I used when writing this document was VMware 3.2 for Linux. I'm running a custom 2.4.19 kernel on the host (the physical hardware), and RedHat 7.3 on the guest (the VMware virtual machine).
  2. Configure VMware serial port(s).
  3. Build a kgdb enabled kernel. I used the RedHat 2.4.18-3 kernel, and built it on the host.
  4. Install the kgdb kernel (and any necessary modules) on the virtual machine, per the kgdb docs. When you reboot, the kernel will pause an wait for gdb to attach.
  5. Attach gdb to the virtual machine, again, as described in the kgdb connecting to a debug kernel document. You should hit a break point right away. Set any breakpoints youd like, and enter 'c' to continue booting the virtual machine.
  6. Debug the kernel.

User Mode Linux

  1. Install User Mode Linux per the documents at their web site.
  2. Attach a debugger to a kernel as described in their debugging page.
  3. Debug the kernel.

Modules

Both kgdb and user mode linux contain information about debugging modules. It seems that it's pretty tricky. Consult their web pages for more information, and I'll add more information here once I try it myself!

VMware

  1. Get rsh working.

Comments?

Please send any comments, suggestions or corrections to the net-policy-users mailing list. Thanks!
Last modified: Mon Nov 22 09:20:00 EST 2002
Powered by: SourceForge Logo