| #include <linux/module.h> |
| #include <linux/kernel.h> |
| #include <linux/init.h> |
| |
| static int __init mymodule_init(void) { |
| printk(KERN_INFO "My module initialized\n"); |
| |
| #if defined(CONFIG_MYMODULE_DEBUG) |
| printk(KERN_INFO "Debugging On\n"); |
| #else |
| printk(KERN_INFO "Debugging Off\n"); |
| #endif |
| |
| return 0; |
| } |
| |
| static void __exit mymodule_exit(void) { |
| printk(KERN_INFO "My module exiting\n"); |
| } |
| |
| module_init(mymodule_init); |
| module_exit(mymodule_exit); |
| |
| MODULE_LICENSE("GPL"); |
| MODULE_AUTHOR("Edward Hyun-koo Jee <edjee@google.com>"); |
| MODULE_DESCRIPTION("Simple kernel module example"); |