From: hackbard Date: Fri, 23 Sep 2005 07:20:46 +0000 (+0000) Subject: readded hello world module and Makefile X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=0df0d597825c70057f929a4d08ecb459b3c672cd;p=my-code%2Fkernel.git readded hello world module and Makefile --- diff --git a/hello/Makefile b/hello/Makefile new file mode 100644 index 0000000..17ba718 --- /dev/null +++ b/hello/Makefile @@ -0,0 +1 @@ +obj-m += hello.o diff --git a/hello/hello.c b/hello/hello.c new file mode 100644 index 0000000..3b236b8 --- /dev/null +++ b/hello/hello.c @@ -0,0 +1,22 @@ +/* + * hello world kernel module + * + */ + +#include +#include +#include + +//MODULE_LICENSE("GPL"); + +static int __init name_of_initialization_routine(void) { + printk(KERN_INFO "hello world, this is your kernel speaking\n"); + return 0; +} + +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);