summaryrefslogtreecommitdiffstats
path: root/misc-modules/hello.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <martinez.javier@gmail.com>2010-11-27 07:49:17 +0100
committerJavier Martinez Canillas <martinez.javier@gmail.com>2010-11-27 07:49:17 +0100
commitab121f379a3cff458c90e6f480ba4bb68c8733dd (patch)
treea9851af109ee83646d108bc247d03b131461b764 /misc-modules/hello.c
downloadldd3-ab121f379a3cff458c90e6f480ba4bb68c8733dd.tar.gz
Linux Device Drivers 3 examples
Diffstat (limited to 'misc-modules/hello.c')
-rw-r--r--misc-modules/hello.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/misc-modules/hello.c b/misc-modules/hello.c
new file mode 100644
index 0000000..85cd6d0
--- /dev/null
+++ b/misc-modules/hello.c
@@ -0,0 +1,20 @@
+/*
+ * $Id: hello.c,v 1.5 2004/10/26 03:32:21 corbet Exp $
+ */
+#include <linux/init.h>
+#include <linux/module.h>
+MODULE_LICENSE("Dual BSD/GPL");
+
+static int hello_init(void)
+{
+ printk(KERN_ALERT "Hello, world\n");
+ return 0;
+}
+
+static void hello_exit(void)
+{
+ printk(KERN_ALERT "Goodbye, cruel world\n");
+}
+
+module_init(hello_init);
+module_exit(hello_exit);