加载模块的时候出现版本不匹配的问题

在 Redhat 9x 系统下编译 helloworld.c 模块,insmod 时提示内核版本不匹配。编译的模块适用于 2.4.20 版本,而当前内核是 2.4.20 - 8。可通过确保 'uname -r' 结果与 /usr/src/linux/include/linux/version.h 中 UTS_RELEASE 定义一致来解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在redhat9x下边先了个 helloworld.c的module,编译通过之后insmod的时候提示说:
helloworld.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8.
后来受下面这段话的启发,而有所获:呵呵
make sure the result of 'uname -r'
is the same with the definition of UTS_RELEASE in
/usr/src/linux/include/linux/version.h.
If not, please modify the definition of UTS_RELEASE
in /usr/src/linux/include/linux/version.h


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值