Last active
December 11, 2020 07:23
-
-
Save abhishekjiitr/7b440741c25fa46f99f54623d267c949 to your computer and use it in GitHub Desktop.
Medium Blog Linux Kernel Module Programming Supporting Code
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
// hello.c | |
#include <linux/module.h> | |
#include <linux/kernel.h> | |
// license for the module. required | |
MODULE_LICENSE("GPL"); | |
// executed when module is inserted | |
int init_module(void) | |
{ | |
printk(KERN_INFO "Hello, World!\n"); | |
return 0; | |
} | |
// executed when module is removed | |
void cleanup_module(void) | |
{ | |
printk(KERN_INFO "Bye World!\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment