add assignement 00 to 08
This commit is contained in:
8
01/Makefile
Normal file
8
01/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
obj-m += main.o
|
||||
PWD := $(CURDIR)
|
||||
|
||||
all:
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
20
01/main.c
Normal file
20
01/main.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/printk.h>
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("hello world module");
|
||||
|
||||
static int __init hello_init(void)
|
||||
{
|
||||
pr_info("Hello world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit hello_exit(void)
|
||||
{
|
||||
pr_info("Cleaning up module.\n");
|
||||
}
|
||||
|
||||
module_init(hello_init);
|
||||
module_exit(hello_exit);
|
Reference in New Issue
Block a user