主题 : Hello World驱动问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 62533
精华: 0
发帖: 7
金钱: 40 两
威望: 8 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2012-02-01
最后登录: 2012-03-02
楼主  发表于: 2012-02-17 22:53

 Hello World驱动问题

我电脑上的虚拟机用的是ubutu内核是2.6.35,我买了Tiny6410的开发板,内核是2.6.38,我本来想写一个hello world的驱动程序,Makefile编译后,下到开发板上运行的。可是编译总是出错。请大家帮我看看是怎么回事?错误显示如下:
linux@ubuntu:~/friendly-arm/hello-drv$ make
make -C /home/linux/friendly-arm/linux-kernel/linux-2.6.38/ M=`pwd` modules
make[1]: Entering directory `/home/linux/friendly-arm/linux-kernel/linux-2.6.38'

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

  CC [M]  /home/linux/friendly-arm/hello-drv/hello.o
cc1: error: unrecognized command line option "-mlittle-endian"
/home/linux/friendly-arm/hello-drv/hello.c:1: error: unknown ABI (apcs-gnu) for -mabi= switch
make[2]: *** [/home/linux/friendly-arm/hello-drv/hello.o] Error 1
make[1]: *** [_module_/home/linux/friendly-arm/hello-drv] Error 2
make[1]: Leaving directory `/home/linux/friendly-arm/linux-kernel/linux-2.6.38'
make: *** [default] Error 2

我的Makefile如下:
obj-m := hello.o
PWD := 'pwd'
KDIR := /home/linux/friendly-arm/linux-kernel/linux-2.6.38/
default:
            make -C $(KDIR) M=$(PWD) modules
clean:
            make -C $(KDIR) M=$(PWD) clean

麻烦好心人帮我看看,万分感谢。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-02-20 21:43
出错信息已经说的很清楚了。你需要先给你的内核源代码加载tiny6410的内核配置文件。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."