diff --git a/driver/Makefile b/driver/Makefile new file mode 100644 index 0000000..e531ee8 --- /dev/null +++ b/driver/Makefile @@ -0,0 +1,11 @@ +obj-m += hello.o + +KDIR := /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) + +all: + $(MAKE) -C $(KDIR) M=$(PWD) modules + +clean: + $(MAKE) -C $(KDIR) M=$(PWD) clean + diff --git a/driver/hello.c b/driver/hello.c new file mode 100644 index 0000000..3e4c43d --- /dev/null +++ b/driver/hello.c @@ -0,0 +1,21 @@ +#include +#include +#include + +static int __init hello_init(void) { + pr_info("hello: Modul wurde geladen.\n"); + return 0; +} + +static void __exit hello_exit(void) { + pr_info("hello: Modul wurde entladen.\n"); +} + +module_init(hello_init); +module_exit(hello_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Du"); +MODULE_DESCRIPTION("Minimales Kernelmodul-Beispiel"); +MODULE_VERSION("0.1"); +