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