This commit is contained in:
firmianay
2018-04-29 22:21:55 +08:00
parent 033944eb84
commit f6656821eb
135 changed files with 438 additions and 466 deletions

View File

@ -0,0 +1,8 @@
BUILDPATH := ~/kernelbuild/linux-4.16.3/
obj-m += hello.o
all:
make -C $(BUILDPATH) M=$(PWD) modules
clean:
make -C $(BUILDPATH) M=$(PWD) clean

View File

@ -0,0 +1,4 @@
#!/bin/bash
cd ./initramfs/
find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz

View File

@ -0,0 +1,20 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
static int hello_init(void)
{
printk(KERN_ALERT "Hello module!\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye module!\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("A simple module.");