这个是什么原因啊?
刚学Linux下的驱动开发,把《Linux设备驱动程序》中的那个hello模块拿来照搬,结果不行!
hello源程序如下:
#define MODULE
#include <linux/version.h>
#include <linux/module.h>
int init_module(void){
printk("<1>Hello,world\n");
return 0;
}
void cleanup_module(void){
printk("<1>Goodbye cruel world\n");
}
然后编译执行:
[root@localhost root]#gcc -c hello.c
/gxqing/hello.c:12:2: warning: no newline at end of file
[root@localhost root]# insmod hello.o
hello.o: kernel-module version mismatch
hello.o was compiled for kernel version 2.4.9-9
while this kernel is version 2.4.18-14.
注:我的内核是rh8的2.4.18-14
不明白它指什么版本不匹配?
请指教,3X
:confused: