Monday, March 14, 2011

debugging linux kernel, create an oops

How to create an Oops for debugging purposes

Hi,
     I found this bit in Beginning Linux programming...To generate an oops create a module.... and in the init function.....

int init_module(void)
{
     /* deferencing a null pointer */
     *(int*)0 = 1 ;
     return 0;
}
If your kernel has symbols, this will product a stack backtrace from where you code this.

No comments:

Post a Comment