Linux 内核不匹配的问题
我照着书上些的例子:代码:
#define MODULE
#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");
}
保存为2.1.c
然后一次运行
# gcc -c 2.1.c
# insmod 2.1.c
2.1.c: 2.1.c is not an ELF file
# insmod 2.1.o
2.1.o: kernel-module version mismatch
2.1.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.22-1.2115.nptl.
#
请问我该怎么解决??要改编内核吗??我刚学Linux,不知道该怎么做? insmod -f 2.1o
或者到 version.h 中去修改版本号 这样的话,每次都有warning,
有什么本质的修改方法吗?? 也就事编译器和内核版本号不匹配 改一下version.h就可以了
页:
[1]