Chinaunix首页 | 论坛 | 博客
  • 博客访问: 278467
  • 博文数量: 78
  • 博客积分: 1834
  • 博客等级: 上尉
  • 技术积分: 1140
  • 用 户 组: 普通用户
  • 注册时间: 2012-06-22 17:46
文章分类

全部博文(78)

文章存档

2013年(4)

2012年(74)

分类: LINUX

2012-07-19 19:18:10

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

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