Stop managing your network one node at a time!
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.
- 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).
- Configure VMware serial port(s).
- Build a kgdb enabled kernel.
I used the RedHat 2.4.18-3 kernel, and built it on the host.
- The kgdb patch
(linux-2.4.18-kgdb-1.5.patch, as of when I wrote this document) didn't apply
cleanly, but it was pretty easy to sort out. After you apply the patch, search
for any '.rej' files and merge them by hand. If you can't figure out how to
do this, then you probably shouldn't be debugging kernel anyways.
- kgdb recommends that you compile everything you need into the kernel, instead
of using modules. Here are some modules the VMware uses with my RedHat 7.3:
pcnet32, mii, ide-cd, cdrom, usb-uhci, usbcore.
If you want to use NFS, add nfs, lockd, sunrpc.
- There was one
remaining compilation problem, here is a fix from the kgdb mailing list:
- See the kgdb kernel
build page for more details.
- 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.
- 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.
- Debug the kernel.
User Mode Linux
- Install User Mode Linux per the documents at
their web site.
- Attach a debugger to a kernel as described in their
- Debug the kernel.
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!
- Get rsh working.
- add 'rsh' to /etc/securetty
- set 'disabled = no' in /etc/xinetd.d/rsh
- run 'service xinetd restart'
Please send any comments, suggestions or corrections to the net-policy-users mailing
Last modified: Mon Nov 22 09:20:00 EST 2002