编译linux内核模块出错

本文发布时间: 2019-Mar-22
错误描述:root@light-laptop:/home/light/work/drivers/hello# makemake -C /opt/zeng-linux/linux-2.6.32.2 M=/home/light/work/drivers/hello modulesmake[1]:正在进入目录 `/opt/zeng-linux/linux-2.6.32.2' CC [M] /home/light/work/drivers/hello/hello.oIn 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 directoryinclude/linux/mmzone.h:258:5: warning: "MAX_NR_ZONES" is not definedinclude/linux/mmzone.h:260:7: warning: "MAX_NR_ZONES" is not definedinclude/linux/mmzone.h:262:7: warning: "MAX_NR_ZONES" is not definedIn 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] 错误 1make[1]: *** [_module_/home/light/work/drivers/hello] 错误 2make[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.koinsmod: error inserting 'hello.ko': -1 Invalid module format


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:11pm
栏目列表