linux2.6下驱动模块编译问题

linux(red hat)linux2.6下驱动模块编译问题2.6linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题编译失败linux2.6下驱动模块编译问题提示说头文件之类linux2.6下驱动模块编译问题东西找linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题请大家帮忙看看啊linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题没有办法才提问linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题点分全部用了linux2.6下驱动模块编译问题请大家帮帮忙linux2.6下驱动模块编译问题只有linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题led.c文件和linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题Makefilelinux2.6下驱动模块编译问题led.c文件里面只linux2.6下驱动模块编译问题基本linux2.6下驱动模块编译问题init和exitlinux2.6下驱动模块编译问题源文件linux2.6下驱动模块编译问题下:
(源文件放linux2.6下驱动模块编译问题/1_led(包含led.c,Makefiel两linux2.6下驱动模块编译问题文件)linux2.6下驱动模块编译问题linux2.6下驱动模块编译问题错误信息因linux2.6下驱动模块编译问题字数限制linux2.6下驱动模块编译问题我删除了linux2.6下驱动模块编译问题些类似linux2.6下驱动模块编译问题错误信息)

==========led.c===========
#include
#include

MODULE_LICENSE("GPL");

static int __init led_init(void)
{
printk("hello driver!\n");
return 0;
}

static void __exit led_exit(void)
{
printk("Byebye driver!\n");
}

module_init(led_init)
module_exit(led_exit)

========Makefile============
KERNEL_PATH=/linux-2.6.29 #编译所需内核源码根目录
SOURCE_PATH=$(shell pwd)

obj-m = led.o

all:
make -C $(KERNEL_PATH) M=$(SOURCE_PATH) modules

clean:
rm *.mod.c *.o *.ko .*.cmd modules.order Module.symvers .tmp_versions -rf

===========错误信息================
[root@localhost 1_led]# make
make -C /kernel M=/1_led modules
make[1]: Entering directory `/kernel'

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 /kernel/Module.symvers
is missing; modules will have no dependencies and modversions.

CC [M] /1_led/led.o
cc1: error: include/linux/autoconf.h: No such file or directory
In file included from include/linux/prefetch.h:14,
from include/linux/list.h:6,
from include/linux/module.h:9,
from /1_led/led.c:1:
/kernel/arch/arm/include/asm/processor.h:109:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/linux/list.h:7,
from include/linux/module.h:9,
from /1_led/led.c:1:
include/asm-generic/cmpxchg-local.h: In function '__cmpxchg_local_generic':
include/asm-generic/cmpxchg-local.h:23: error: implicit declaration of function 'local_irq_save'
In file included from include/linux/bitops.h:17,
from include/linux/kernel.h:15,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/stat.h:60,
from include/linux/module.h:10,
from /1_led/led.c:1:
/kernel/arch/arm/include/asm/memory.h: In function 'virt_to_phys':
/kernel/arch/arm/include/asm/memory.h:160: error: 'CONFIG_DRAM_BASE' undeclared (first use in this function)

include/linux/tracepoint.h: In function 'tracepoint_synchronize_unregister':
include/linux/tracepoint.h:153: error: implicit declaration of function '__synchronize_sched'
make[2]: *** [/1_led/led.o] 错误 1
make[1]: *** [_module_/1_led] 错误 2
make[1]: Leaving directory `/kernel'
make: *** [all] 错误

解决办法:配置一次并编译一次。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值