Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1 @@
Program('hello.c')
+5
View File
@@ -0,0 +1,5 @@
int
main()
{
printf("Hello, world!\n");
}
@@ -0,0 +1,19 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_init(void)
{
printk(KERN_INFO "Hello world!\n");
return 0;
}
static void __exit hello_cleanup(void)
{
printk(KERN_INFO "Cleaning up hellomod.\n");
}
module_init(hello_init);
module_exit(hello_cleanup);
MODULE_LICENSE("GPL");
@@ -0,0 +1,8 @@
obj-m := hellomod.o
KDIR := /usr/src/kernel
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
@@ -0,0 +1,5 @@
test: test.o
gcc -o test test.o -lm
test.o: test.c
gcc -c test.c