当前位置: 技术问答>linux和unix
关于驱动程序的编译.初学,请教几个问题!
来源: 互联网 发布时间:2015-07-11
本文导语: 我要编译一个触摸屏的驱动程序,这个程序是购买芯片自带的.我要在linux下面编译它,然后下载到开发板上,实现触摸屏的驱动.下面是我的编译:(其中的一些错误) root@ykh glj]# gcc -O2 -DMODULE -D__KERNEL__ -c s3c2410-ts.c -I/home...
我要编译一个触摸屏的驱动程序,这个程序是购买芯片自带的.我要在linux下面编译它,然后下载到开发板上,实现触摸屏的驱动.下面是我的编译:(其中的一些错误)
root@ykh glj]# gcc -O2 -DMODULE -D__KERNEL__ -c s3c2410-ts.c -I/home/glj/kernel/include
In file included from /home/glj/kernel/include/linux/devfs_fs_kernel.h:4,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/asm/semaphore.h: In function `triple_down':
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
请问这个编译输出有哪些错误? 编译模块要注意什么?
root@ykh glj]# gcc -O2 -DMODULE -D__KERNEL__ -c s3c2410-ts.c -I/home/glj/kernel/include
In file included from /home/glj/kernel/include/linux/devfs_fs_kernel.h:4,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/asm/semaphore.h: In function `triple_down':
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `lr' in `asm'
/home/glj/kernel/include/asm/semaphore.h:88: unknown register name `ip' in `asm'
请问这个编译输出有哪些错误? 编译模块要注意什么?
|
你不能用x86的gcc,要用交叉编译器(arm-linux-gcc)编译
|
如果是芯片自带的话,应该有Makefile文件吧,
直接执行make就可以了
直接执行make就可以了
|
你引用的头文件不够,或者应用了错误的semophere.h文件