added cvsignore file
[my-code/kernel.git] / hello / hello.c
index cf6bd93..3b236b8 100644 (file)
@@ -1,17 +1,22 @@
-/* my first kernel driver :-) */
+/*
+ * hello world kernel module
+ *
+ */
 
 #include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/config.h>
+#include <linux/init.h>
 
-int init_module(void) {
-       printk(KERN_ALERT "hi hackbard, here is your kernel speaking! :)\n");
-       printk(KERN_ALERT "some info : %s has process id %i\n",current->comm,
-                                                               current->pid);
-       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_module(void) {
-       printk(KERN_ALERT "bye hackbard ...\n");
+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);