How to cause kernel panic with a single command?
compile the following code into a module and insmod it, sure you should get a panic:
static int crash_module_init(void)
{
printf("crash module starting\n");
int *p = 0;
printk("%d\n", *p);
return 0;
}
static void crash_module_exit(void)
{
printf("crash module exiting\n");
}
module_init(crash_module_init);
module_exit(crash_module_exit);