Back to home page

LXR

 
 

    


0001 /*
0002  * This module emits "Hello, world" on printk when loaded.
0003  *
0004  * It is designed to be used for basic evaluation of the module loading
0005  * subsystem (for example when validating module signing/verification). It
0006  * lacks any extra dependencies, and will not normally be loaded by the
0007  * system unless explicitly requested by name.
0008  */
0009 
0010 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
0011 
0012 #include <linux/init.h>
0013 #include <linux/module.h>
0014 #include <linux/printk.h>
0015 
0016 static int __init test_module_init(void)
0017 {
0018     pr_warn("Hello, world\n");
0019 
0020     return 0;
0021 }
0022 
0023 module_init(test_module_init);
0024 
0025 static void __exit test_module_exit(void)
0026 {
0027     pr_warn("Goodbye\n");
0028 }
0029 
0030 module_exit(test_module_exit);
0031 
0032 MODULE_AUTHOR("Kees Cook <keescook@chromium.org>");
0033 MODULE_LICENSE("GPL");