Skip to content

Instantly share code, notes, and snippets.

@mavieth
Created February 11, 2016 00:06
Show Gist options
  • Select an option

  • Save mavieth/0a25ebd7fecfe8ab8e20 to your computer and use it in GitHub Desktop.

Select an option

Save mavieth/0a25ebd7fecfe8ab8e20 to your computer and use it in GitHub Desktop.
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
/* This function is called when the module is loaded. */
int simple init(void){
printk(KERN INFO "Loading Module\n"); return 0;
}
/* This function is called when the module is removed. */
void simple exit(void) {
printk(KERN INFO "Removing Module\n");
}
/* Macros for registering module entry and exit points. */
module init(simple init);
module exit(simple exit);
MODULE LICENSE("GPL");
MODULE DESCRIPTION("Simple Module"); MODULE AUTHOR("SGG");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment