如题。
//hello.c #include <linux/init.h> #include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); #define pr_info(fmt, arg...) \ printk("\033[032m[Mark] %s :\n %s[line %03d] : " fmt " \033[0m\n\n", \ __FILE__, __FUNCTION__, __LINE__, ##arg) static int hello_init(void) { pr_info("hello"); return 0; } static void hello_exit(void) { pr_info("good bye"); } module_init(hello_init); module_exit(hello_exit);