linux3.13.0内核编译驱动的问题

周靖峰 2015-08-03 10:34:07
我想要在linux3.13.0上编译一个驱动

我先写好源文件,再写好makefile,但是编译的时候出现
  ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.


WARNING: Symbol version dump /home/zjf/zjf/kernel/linux-source-3.13.0/Module.symvers
is missing; modules will have no dependencies and modversions.


然后我去内核目录执行了make menuconfig和make prepare
但是在执行make prepare的时候却报错了,错误提示如下:
zjf@zjf-ubuntu:~/zjf/kernel/linux-source-3.13.0$ make prepare
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
SYSTBL arch/x86/syscalls/../include/generated/asm/syscalls_32.h
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
CHK include/config/kernel.release
UPD include/config/kernel.release
WRAP arch/x86/include/generated/asm/clkdev.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/x86/kernel/asm-offsets.s
In file included from include/linux/suspend.h:8:0,
from arch/x86/kernel/asm-offsets.c:12:
include/linux/mm.h:647:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
^
make[1]: *** [arch/x86/kernel/asm-offsets.s] 错误 1
make: *** [prepare0] 错误 2


请问这是什么错误?应该如何解决这个错误?
...全文
588 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
dirtyrain1990 2015-08-28
  • 打赏
  • 举报
回复
首先应该检查一下是否是你驱动模块的问题,即不添加这个驱动模块是否能够正常编译,所谓的“make oldconfig”等仅仅类似于“按照上一次正常的操作,进行这次操作”,在之前已经报错缺少自动配置文件,所以你在执行此命令也照样会报错。 1.如果是本来编译就缺少autoconf.h\auto.conf的话,建议你去网上这个内核版本里下载一个,因为这个是内核里自带的 2.文件不缺少仍编译失败,使用root权限进行操作,可能是权限问题 3.驱动模块加载后失败,应该是驱动文件配置问题,即与驱动文件关联的Kconfig或者Kconfig.driver等没有进行宏定义

1,324

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧