Some stub modules that will show procfs and char device usage.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Thu, 24 Sep 2009 10:10:45 +0000 (07:10 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Thu, 24 Sep 2009 10:10:45 +0000 (07:10 -0300)
Makefile [new file with mode: 0644]
hello_char.c [new file with mode: 0644]
hello_procfs.c [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..1c06ef1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+obj-m += hello_procfs.o
+obj-m += hello_char.o
diff --git a/hello_char.c b/hello_char.c
new file mode 100644 (file)
index 0000000..cfc008c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  Copyright (C) 2009  Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#include <linux/module.h>
+
+MODULE_AUTHOR("Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>");
+MODULE_LICENSE("GPL");
+
+static int hello_char_init(void)
+{
+       return 0;
+}
+
+static void hello_char_exit(void)
+{
+}
+
+module_init(hello_char_init);
+module_exit(hello_char_exit);
diff --git a/hello_procfs.c b/hello_procfs.c
new file mode 100644 (file)
index 0000000..1390972
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Copyright (C) 2009  Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+
+MODULE_AUTHOR("Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>");
+MODULE_LICENSE("GPL");
+
+static int hello_procfs_init(void)
+{
+       return 0;
+}
+
+static void hello_procfs_exit(void)
+{
+}
+
+module_init(hello_procfs_init);
+module_exit(hello_procfs_exit);