This commit is contained in:
2025-05-29 14:52:54 +01:00
parent 9942e5c6ae
commit 176993ba81
2 changed files with 32 additions and 0 deletions

11
driver/Makefile Normal file
View File

@ -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

21
driver/hello.c Normal file
View File

@ -0,0 +1,21 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
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");