Kernel configuration is invalid. include/linux/autoconf.h or include/config/auto.conf are missing

//刚下载的linux源代码,一个简单的hello驱动都没有编译通过
//下面是驱动源代码

#include <linux/init.h>
#include <linux/module.h> 

static int hello_init(void)
{
	printk(KERN_ALERT "Hello, Tekkaman Ninja !\n");
	return 0;
}

static void hello_exit(void)
{
	printk(KERN_ALERT "Goodbye, Tekkaman Ninja !\n Love Linux !Love ARM ! Love KeKe !\n");
}

module_init(hello_init);
module_exit(hello_exit);



MODULE_LICENSE("Dual BSD/GPL");

下面是简单的makefile文件

obj-m := hello.o
KERNELDIR = /home/xduser/study/driver/src/linux-2.6.22
PWD := $(shell pwd)
default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
但是却有错误

    make[1]: Entering directory `/home/xduser/study/driver/src/linux-2.6.22'  
      
      ERROR: Kernel configuration is invalid.  
             include/linux/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/xduser/study/driver/src/linux-2.6.22'/Module.symvers  
               is missing; modules will have no dependencies and modversions.  
原因是内核没有编译,先处理内核

执行make oldconfig&&make prepare&&make scripts

然后在执行make编译hello驱动即可


  • 5
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值