diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ff1b979 --- /dev/null +++ b/Makefile @@ -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 diff --git a/king.c b/king.c new file mode 100644 index 0000000..e78e3be --- /dev/null +++ b/king.c @@ -0,0 +1,22 @@ +#include +#include +#include + +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);