Skip to content

Instantly share code, notes, and snippets.

@TheLittleNaruto
Created October 3, 2019 10:43
Show Gist options
  • Save TheLittleNaruto/aaec4bcbed24370c1e8062ebf934074b to your computer and use it in GitHub Desktop.
Save TheLittleNaruto/aaec4bcbed24370c1e8062ebf934074b to your computer and use it in GitHub Desktop.
Hello Driver
#include<linux/module.h>
#include<linux/init.h>
#include<linux/kernel.h>
static int hello_init(void){
printk(KERN_ALERT "Hello TheLittleNaruto; it's your first driver which d oes no shit :/\n");
return 0;
}
static void hello_exit(void){
printk(KERN_INFO "Goodbye TheLittleNaruto; No point in keeping this driv er running.\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_AUTHOR("TheLittleNaruto");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TheLittleNaruto's first driver with GPL licence.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment