readme: more info on kernel panics, oops an backtraces.

myinsmod: use either finit or init
This commit is contained in:
Ciro Santilli
2018-04-14 19:11:13 +01:00
parent 7b0bd10c0b
commit a08a87dc0f
8 changed files with 398 additions and 51 deletions

23
kernel_module/warn_on.c Normal file
View File

@@ -0,0 +1,23 @@
/*
Prints a backtrace.
*/
#include <linux/module.h>
#include <linux/kernel.h>
static int myinit(void)
{
pr_info("warn_on init\n");
WARN_ON("warn_on do it");
pr_info("warn_on after\n");
return 0;
}
static void myexit(void)
{
pr_info("warn_on cleanup\n");
}
module_init(myinit)
module_exit(myexit)
MODULE_LICENSE("GPL");