Debugging Kernel without a JTag


I am going to write a new driver for my beagleboard xm which has ubuntu 12.04 running on it. But before writing the driver I wanted to check for my options to debug it. I was considering gdb as an options but one of my friends told me that I cannot use that. He said that after attaching the driver to the kernel and rebooting the device, if you have any problems with your driver then you will get kernel panick error and will not be able to load kernel. Is it true? If yes is my only option using a JTag debugger or are there any other options to debug my driver?

Best regards,

I think most people get along with a classic printk, but I believe there are other options, kgdb being one. Google really is your friend here.

Yeah I was considering kgdb as an option but after my friend told me I cannot use that since kernel will give kernel panic error, I started searching for something else. (He said something like in order to use kgdb I need to be able to successfully launch the kernel since kgdb is alsa attached to kernel. But if it is true then what is the meaning of debugging :D) i do not have an opinion about it. If you have ever used kgdb could you please tell me how it works and if what my friend says is true or not?

I have never found the need to use kgdb, so I can't comment, sorry! I have always managed with printk statements.

I've also not used kgdb and have hacked together a kernel module from
scratch and added features to others without issue. Download LDDv3 [1],
use liberal printks, and start your module out of tree so you can load /
unload it on a running system to test. This way at least the kernel
will boot and you can run other debugging aids when loading the module.



As everyone pointed, printk is your best friend.

Open source JTAG debugger is this:
You can look at arm registers, but i am not sure if it supports source
level kernel debug.
Maybe at most assembly and arm registers.

The best option out there is Lauterbach Hw + trace32 software - but
the price is _TOO_ high to make if feasible for a hacker.
You need to have made your first million $, and then its a safe bet.