]> hackdaworld.org Git - my-code/kernel.git/commitdiff
readded hello world module and Makefile
authorhackbard <hackbard>
Fri, 23 Sep 2005 07:20:46 +0000 (07:20 +0000)
committerhackbard <hackbard>
Fri, 23 Sep 2005 07:20:46 +0000 (07:20 +0000)
hello/Makefile [new file with mode: 0644]
hello/hello.c [new file with mode: 0644]

diff --git a/hello/Makefile b/hello/Makefile
new file mode 100644 (file)
index 0000000..17ba718
--- /dev/null
@@ -0,0 +1 @@
+obj-m += hello.o
diff --git a/hello/hello.c b/hello/hello.c
new file mode 100644 (file)
index 0000000..3b236b8
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * hello world kernel module
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/init.h>
+
+//MODULE_LICENSE("GPL");
+
+static int __init name_of_initialization_routine(void) {
+    printk(KERN_INFO "hello world, this is your kernel speaking\n");
+    return 0; 
+}
+
+static void __exit name_of_cleanup_routine(void) {
+  printk(KERN_INFO "good bye world!\n");
+}
+
+module_init(name_of_initialization_routine);
+module_exit(name_of_cleanup_routine);