Skip to content

Instantly share code, notes, and snippets.

@itrobotics
Created April 13, 2015 06:25
Show Gist options
  • Save itrobotics/0fc2b2af314e112e55cc to your computer and use it in GitHub Desktop.
Save itrobotics/0fc2b2af314e112e55cc to your computer and use it in GitHub Desktop.
hello world of the linux module
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk("Hello world!\n");
return 0;
}
static void hello_exit(void)
{
printk("Goodbye, hello world\n");
}
module_init(hello_init);
module_exit(hello_exit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment