projects
/
my-code
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added cvsignore file
[my-code/kernel.git]
/
hello
/
hello.c
diff --git
a/hello/hello.c
b/hello/hello.c
index
74ace2a
..
3b236b8
100644
(file)
--- a/
hello/hello.c
+++ b/
hello/hello.c
@@
-1,14
+1,22
@@
-/* my first kernel driver :-) */
+/*
+ * hello world kernel module
+ *
+ */
#include <linux/module.h>
#include <linux/module.h>
-#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/init.h>
-int init_module(void) {
- printk(KERN_ALERT "hi hackbard, here is your kernel speaking! :)\n");
- return 0;
+//MODULE_LICENSE("GPL");
+
+static int __init name_of_initialization_routine(void) {
+ printk(KERN_INFO "hello world, this is your kernel speaking\n");
+ return 0;
}
}
-
void cleanup_modul
e(void) {
-
printk(KERN_ALERT "bye hackbard ...
\n");
+
static void __exit name_of_cleanup_routin
e(void) {
+
printk(KERN_INFO "good bye world!
\n");
}
}
+module_init(name_of_initialization_routine);
+module_exit(name_of_cleanup_routine);