Created
May 17, 2012 14:17
-
-
Save 17twenty/2719206 to your computer and use it in GitHub Desktop.
Simplest Kernel Module I could do
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> /* Needed by all modules */ | |
#include <linux/kernel.h> /* Needed for KERN_INFO */ | |
#include <linux/init.h> /* Needed for the macros */ | |
static int __init hello_start(void) | |
{ | |
printk(KERN_INFO "Hello world\n"); | |
return 0; | |
} | |
static void __exit hello_end(void) | |
{ | |
printk(KERN_INFO "Goodbye World\n"); | |
} | |
module_init(hello_start); | |
module_exit(hello_end); | |
MODULE_LICENSE("GPL"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment