summaryrefslogtreecommitdiff
path: root/tests/projects/linux/driver/hello/src
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-08 23:15:44 +0800
committerruki <[email protected]>2021-12-08 23:15:44 +0800
commitb76de4c1fb632724c412a1638af8694fb35e021d (patch)
tree48066720fc7379e5aa0ca7f002dff6fbc36d66c5 /tests/projects/linux/driver/hello/src
parentb3ae4feec5afe623183d92f8f3f9f0347f6abaea (diff)
add linux driver rule stub
Diffstat (limited to 'tests/projects/linux/driver/hello/src')
-rw-r--r--tests/projects/linux/driver/hello/src/hello.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/projects/linux/driver/hello/src/hello.c b/tests/projects/linux/driver/hello/src/hello.c
new file mode 100644
index 000000000..2614fb2cc
--- /dev/null
+++ b/tests/projects/linux/driver/hello/src/hello.c
@@ -0,0 +1,21 @@
+#include <linux/init.h>
+#include <linux/module.h>
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Ruki");
+MODULE_DESCRIPTION("A simple Hello World Module");
+MODULE_ALIAS("a simplest module");
+
+int hello_init(void)
+{
+ printk(KERN_INFO "Hello World\n");
+ return 0;
+}
+
+void hello_exit(void)
+{
+ printk(KERN_INFO "Goodbye World\n");
+}
+
+module_init(hello_init);
+module_exit(hello_exit);