OpenWrt Forum Archive

Topic: Kernel debugging

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have some questions on how people debug kernel issues with openwrt (if at all).

1) Has anyone actually got kgdb working?  I saw a post relating to this from 2005 indicating that nobody has done it, but wondered if this had changed, or do people just use printk?

2) Does anyone use ksymoops?  This is a pain to configure for cross-compilation (i.e. i386->mips) and I don't seem to be able to get it quite right.

3) How do people maintain kernel patches which are submitted to subversion?  The procedure of checking patches into source control makes it nice and easy for the user, but how do developers deal with maintaining all these 'forks', or is it just 'the hard way'?

4) I'd like to make kernel source changes, and them re-build firmware, but my changes don't seem to get into the (re-built) firmware.  Can someone tell me how I'd normally achieve this without complete rebuild, expecially when my source files are in the platform-specific subdirectories and get copied over the 'vanilla' kernel version?  In any case, the top-level make seems to suffer from rebuilding the lzma-loader every time it's run.

thanks for any help!

I found kernel's configure is not changed by make menucongfig;
I don't know how to change it....

rising_o wrote:

I found kernel's configure is not changed by make menucongfig;
I don't know how to change it....

OpenWRT has a special way of automating configuration of a kernel which bypasses the menu system.  In order for a patch to be applied to the base kernel, the menu entries don't even need to be there.  If you do 'make menuconfig' for the adm5120-2.6 target after the patches have been applied by the build system you will notice that there is no option for adm5120 in the menus.  Probably the same for other targets.

With old versions of OpenWRT it used to be possible to extract a kernel that could be rebuilt with menuconfig, see: http://members.aol.com/bifferos/sweex/midge_buildroot/ for details.  This doesn't seem possible any more.

I think the only thing you can do is change the options in the config-2.6.22 in the target directories.

Use

make kernel_menuconfig

to set new kernel configuration.

Also, I typically use a BDI2000 from Abatron to debug in the Linux Kernel. It has a built in GDB server and uses JTAG to access the device. That way you can single step through your kernel code (should it ever be necessary).

jonasg wrote:

Use

make kernel_menuconfig

to set new kernel configuration.

Also, I typically use a BDI2000 from Abatron to debug in the Linux Kernel. It has a built in GDB server and uses JTAG to access the device. That way you can single step through your kernel code (should it ever be necessary).

Thanks for the kernel_menuconfig tip, however at 2600 euros the BDI2000 is a little more than I have to spend!

Were you able to debug your kernel?
I can change my redboot to open a port for debugging. Should kernel also be configured to remote debugging? Which flags?

If someone can give me some pointers it will be nice.

Thanks,

yoonix wrote:

Were you able to debug your kernel?

No.

yoonix wrote:

I can change my redboot to open a port for debugging. Should kernel also be configured to remote debugging? Which flags?

If someone can give me some pointers it will be nice.

Thanks,

When you figure it out, please let me know.  If I have the basic steps I can probably write something up and publish it.

Argh.. I am still stuck with this as well.. Ditching it for now since my kernel boots up.. but it sucks.

The discussion might have continued from here.