原文kmcti的专栏
这几天我一直在搞摄像头的驱动,期间看了很前辈的文章,对我很有帮助,在此表示感谢,我的这篇文章是在前辈文章的启示下,完成的。不能算是原创。特此声明。如果有侵权行为,请与本人联系。
我的环境:
os:Windows XP
虚拟机:vmware 5
虚拟机os:Red Hat 9.0
1、下载 spca5xx-20060402.tar.gz,可以去官方网站:http://mxhaard.free.fr/download.html,但是官方网站我试了很多此次都没有打开,我会传到csdn上,供大家下载。 也可以到:http://ftp.osuosl.org/pub/FreeBSD/distfiles/spca5xx-20060402.tar.gz去下载.
2、解压编译;
在进行这项工作之前一定要保证你gcc make 工具的好用。
[root@localhost ~]# tar zxvf spca5xx-20060402.tar.gz
[root@localhost ~]# cd spca5xx-20060402
[root@localhost spca5xx-20060402]# make
[root@localhost spca5xx-20060402]# make install
[root@localhost spca5xx-20060402]# depmod -a
[root@localhost spca5xx-20060402]# modprobe spca5xx
[root@localhost spca5xx-20060402]# lsmod |grep spca5xx
spca5xx 659920 0
videodev 7040 1 spca5xx
//我们再查看一下设备/dev/video0是否存在?
[root@localhost spca5xx-20060402]# ls -lh /dev/video0
crw------- 1 beinan root 81, 0 06-08 09:33 /dev/video0
3、可能出现的问题:但你make的时候会出现以下信息:
[root@localhost spca5xx-20060402]# make
Compiling drivers/usb/spca5xx.c
In file included from /lib/modules/2.4.20-8/build/include/linux/vmalloc.h:8,
from drivers/usb/spca5xx.c:46:
/lib/modules/2.4.20-8/build/include/linux/highmem.h: In function `bh_kmap':
/lib/modules/2.4.20-8/build/include/linux/highmem.h:20: warning: pointer of
type `void *' used in arithmetic
drivers/usb/spca5xx.c: In function `spca5xx_mmap':
drivers/usb/spca5xx.c:5131: warning: passing arg 1 of
`remap_page_range_R2baf18f2' makes pointer from integer without a cast
drivers/usb/spca5xx.c:5131: incompatible type for argument 4 of
`remap_page_range_R2baf18f2'
drivers/usb/spca5xx.c:5131: too few arguments to function
`remap_page_range_R2baf18f2'
drivers/usb/spca5xx.c: At top level:
..........
make: *** [drivers/usb/spca5xx.o] Error 1
解决办法:
打开源码spca5xx.c中的spca5xx_mmap,可以发现在这个函数的调用上RH9和RH9以上的版本调用的都不是同一条函数,在remap_page_range()函数的第一个参数对于RH9就没有做定义,为定义情况下在RH9调用remap_page_range()就缺少了第一个参数的描述,一个小bug在这里,只要在出错的remap_page_range参数添加第一个参数,设为0,编译就通过了,还有几个warming可以忽略。
再执行make,make install 就可以了。
注意:gspcav1-20070508.tar.gz是在2.6内核以上的版本上才可以的。
zhangchunyu1988 于 2011-05-19 12:18:50发表:
谢谢!正需要!
myqlinux 于 2010-01-05 10:06:45发表:
看了再说
vbets 于 2010-01-04 21:54:10发表:
找了很久了
末日逐沙 于 2009-04-17 20:58:39发表:
挂代理上外国网站
yuqilin1228 于 2009-04-17 20:07:40发表:
啊 我看不到啊 呵呵 可惜了
yuqilin1228 于 2009-04-17 20:07:13发表:
谢谢楼主分享 外国网真的打不开啊
superyongzhe 于 2009-04-11 11:40:25发表:
真是太感谢了,不知那个国外的网站怎么回事,总是无法下载。
我再传一遍吧,方便大家!