Linux内核的错误描述,编译linux内核模块出错

错误描述:

root@light-laptop:/home/light/work/drivers/hello# make

make -C /opt/zeng-linux/linux-2.6.32.2 M=/home/light/work/drivers/hello modules

make[1]:

正在进入目录 `/opt/zeng-linux/linux-2.6.32.2'

CC [M]  /home/light/work/drivers/hello/hello.o

In file included from include/linux/gfp.h:4,

from include/linux/kmod.h:22,

from include/linux/module.h:13,

from /home/light/work/drivers/hello/hello.c:13:

include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory

include/linux/mmzone.h:258:5: warning: "MAX_NR_ZONES" is not defined

include/linux/mmzone.h:260:7: warning: "MAX_NR_ZONES" is not defined

include/linux/mmzone.h:262:7: warning: "MAX_NR_ZONES" is not defined

In file included from include/linux/gfp.h:4,

from include/linux/kmod.h:22,

from include/linux/module.h:13,

from /home/light/work/drivers/hello/hello.c:13:

include/linux/mmzone.h:300: error: 'MAX_NR_ZONES' undeclared here (not in a function)

make[2]: *** [/home/light/work/drivers/hello/hello.o] 错误 1

make[1]: *** [_module_/home/light/work/drivers/hello] 错误 2

make[1]:正在离开目录 `/opt/zeng-linux/linux-2.6.32.2'

make: *** [modules] 错误 2

错误原因:/opt/zeng-linux/linux-2.6.32.2' 这个目录是linux源码的目录,但是没有经过编译,

错误解决:编译这个内核/opt/zeng-linux/linux-2.6.32.2' 这个目录下会生成 vmlinxu文件。

错误描述:Invalid module format

把编译成为了mini2440模块的源码路径/opt/FriendlyARM/mini2440/linux-2.6.32.2:编译为hello.ko

然后进行插入pc的linux 报错如下:

root@light-laptop:/home/light/work/drivers/hello# insmod hello.ko

insmod: error inserting 'hello.ko': -1 Invalid module format

阅读(2610) | 评论(0) | 转发(1) |

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值