mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
Move files up on tree
This commit is contained in:
23
kernel_module/hello.c
Normal file
23
kernel_module/hello.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Hello world module.
|
||||
|
||||
dmesg -c
|
||||
insmod hello.ko
|
||||
dmesg -c | grep 'hello init'
|
||||
rmmod hello.ko
|
||||
dmesg -c | grep 'hello cleanup'
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
int init_module(void)
|
||||
{
|
||||
printk(KERN_INFO "hello init\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cleanup_module(void)
|
||||
{
|
||||
printk(KERN_INFO "hello cleanup\n");
|
||||
}
|
||||
Reference in New Issue
Block a user