1. 程式人生 > >最簡單的核心模組例子

最簡單的核心模組例子

#include <linux/kernel.h> 
#include <linux/module.h> 
#include <linux/init.h> 
static int __init hello_init(void) 
{ 
printk(KERN_INFO "Hello world\n"); 
return 0; 
} 
static void __exit hello_exit(void) 
{ 
printk(KERN_INFO "Goodbye world\n"); 
} 
module_init(hello_init); 
module_exit(hello_exit);