try some module stuff

This commit is contained in:
twoneis 2025-03-13 16:37:33 +01:00
parent afe8820375
commit 376edcff27
3 changed files with 28 additions and 0 deletions

View file

@ -1 +1,7 @@
obj-m += module.o
modules:
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean

21
code/module.c Normal file
View file

@ -0,0 +1,21 @@
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/uaccess.h>
static int
mod_init(void)
{
printk(KERN_INFO "module init");
return 0;
}
static void
mod_exit(void)
{
printk(KERN_INFO "module exit");
}
module_init(mod_init);
module_exit()

View file

@ -24,6 +24,7 @@
gnumake
clang-tools
gcc
linuxHeaders
texlab
texliveFull
];