Skip to content

Instantly share code, notes, and snippets.

@17twenty
Created May 17, 2012 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 17twenty/2719206 to your computer and use it in GitHub Desktop.
Save 17twenty/2719206 to your computer and use it in GitHub Desktop.
Simplest Kernel Module I could do
#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