try some module stuff
This commit is contained in:
parent
afe8820375
commit
376edcff27
3 changed files with 28 additions and 0 deletions
|
@ -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
21
code/module.c
Normal 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()
|
|
@ -24,6 +24,7 @@
|
|||
gnumake
|
||||
clang-tools
|
||||
gcc
|
||||
linuxHeaders
|
||||
texlab
|
||||
texliveFull
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue