|
发表于 2008-3-12 20:12:20
|
显示全部楼层
Post by hollyren;1819139
#include <linux/module.h> //所有模块都需要的头文件
#include <linux/init.h> // init&exit相关宏
MODULE_LICENSE("GPL");
static int __init hello_init (void)
{
printk("Hello china init\n");
return 0;
}
static void __exit hello_exit (void)
{
printk("Hello china exit\n");
}
module_init(hello_init);
module_exit(hello_exit);
程序是这样的,但是当我insmod hello.ko 的时候,没有输入结果,是什么原因的?
dmesg 最后那几行就是你想要的 |
|