Added basic kernel module and makefile
This commit is contained in:
parent
870bfe72e2
commit
f6f4c7cae5
|
@ -0,0 +1,7 @@
|
|||
obj-m += king.o
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
|
@ -0,0 +1,22 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Michael Sweet");
|
||||
MODULE_DESCRIPTION("Universal CUPS printing driver");
|
||||
MODULE_VERSION("1.0");
|
||||
|
||||
static int __init lkm_example_init(void)
|
||||
{
|
||||
printk(KERN_INFO "Hello m8s\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit lkm_example_exit(void)
|
||||
{
|
||||
printk(KERN_INFO "Bye m8s\n");
|
||||
}
|
||||
|
||||
module_init(lkm_example_init);
|
||||
module_exit(lkm_example_exit);
|
Loading…
Reference in New Issue