Skip to content

Instantly share code, notes, and snippets.

@Taehun
Last active October 11, 2015 11:27
Show Gist options
  • Save Taehun/3851414 to your computer and use it in GitHub Desktop.
Save Taehun/3851414 to your computer and use it in GitHub Desktop.
Linux Kernel Module Example: Hello kernel
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_init(void)
{
printk(KERN_INFO "Hello kernel.\n");
return 0;
}
static void __exit hello_exit(void)
{
printk(KERN_INFO "Good bye kernel..\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