mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
readme: more info on kernel panics, oops an backtraces.
myinsmod: use either finit or init
This commit is contained in:
@@ -1,28 +1,17 @@
|
||||
/*
|
||||
It will happen eventually, so you might as well learn do deal with it.
|
||||
|
||||
TODO: how to scroll up to see full trace? Shift + Page Up does not work as it normally does:
|
||||
https://superuser.com/questions/848412/scrolling-up-the-failed-screen-with-kernel-panic
|
||||
|
||||
The alternative is to get the serial data out streamed to console or to a file:
|
||||
|
||||
- https://superuser.com/questions/269228/write-qemu-booting-virtual-machine-output-to-a-file
|
||||
- http://www.reactos.org/wiki/QEMU#Redirect_to_a_file
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
static int myinit(void)
|
||||
{
|
||||
pr_info("panic init\n");
|
||||
pr_info("panic myinit\n");
|
||||
panic("hello panic");
|
||||
pr_info("panic after\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myexit(void)
|
||||
{
|
||||
pr_info("panic cleanup\n");
|
||||
pr_info("panic myexit\n");
|
||||
}
|
||||
|
||||
module_init(myinit)
|
||||
|
||||
Reference in New Issue
Block a user