Chinaunix首页 | 论坛 | 博客
  • 博客访问: 13798
  • 博文数量: 5
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: -10
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-25 13:15
文章分类
文章存档

2015年(5)

我的朋友

分类: LINUX

2015-05-15 22:19:41

原文地址:编译linux内核模块出错 作者:gavinZLX

错误描述:
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

阅读(1314) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~