X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fkernel.git;a=blobdiff_plain;f=hello%2Fhello.c;fp=hello%2Fhello.c;h=3b236b8e85aaf25eb208cfefe7370bc9ba7be687;hp=0000000000000000000000000000000000000000;hb=0df0d597825c70057f929a4d08ecb459b3c672cd;hpb=8a336451c7768f15c42feaf03c4d82acd88bc6cc 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);