From b437b7b6ba61ac9e881180f167162cb34d2095ae Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Thu, 24 Sep 2009 07:10:45 -0300 Subject: [PATCH] Some stub modules that will show procfs and char device usage. --- Makefile | 2 ++ hello_char.c | 35 +++++++++++++++++++++++++++++++++++ hello_procfs.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 Makefile create mode 100644 hello_char.c create mode 100644 hello_procfs.c diff --git a/Makefile b/Makefile new file mode 100644 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 index 0000000..cfc008c --- /dev/null +++ b/hello_char.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2009 Thadeu Lima de Souza Cascardo + * + * 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 + +MODULE_AUTHOR("Thadeu Lima de Souza Cascardo "); +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 index 0000000..1390972 --- /dev/null +++ b/hello_procfs.c @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2009 Thadeu Lima de Souza Cascardo + * + * 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 +#include + +MODULE_AUTHOR("Thadeu Lima de Souza Cascardo "); +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); -- 2.20.1