Skip to content

Instantly share code, notes, and snippets.

@cvam0000
Last active December 17, 2019 01:58
Show Gist options
  • Save cvam0000/b47dc5ff5b78ea3141e8758138bd83b8 to your computer and use it in GitHub Desktop.
Save cvam0000/b47dc5ff5b78ea3141e8758138bd83b8 to your computer and use it in GitHub Desktop.
/* An Example of Loadable Kernel Module */
#include<linux/kernel.h>
#include<linux/init.h>
#include<linux/module.h>
MODULE_DESCRIPTION("cvam example kernel module ");
MODULE_AUTHOR("cvam");
MODULE_LICENSE("GPL");
static int cvam_module_init(void)
{
printk(KERN_ALERT " This function initialised the module ");
return 0;
}
static void cvam_module_exit(void)
{
printk(KERN_ALERT " Time to leave the planet kernel " );
}
module_init(cvam_module_init);
module_exit(cvam_module_exit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment