我准备做一个远程实时监控的系统。使用了芯片为zc301P的中星微摄像头。linux内核版本为2.4.18,使用交叉工具链2.95.3,ARM是周立功生产的Magic ARMs3c2410a,内核和交叉工具链都是配套的软件包里面的。
由于2.4.18不支持该摄像头。所以我通过打补丁usb-2.4.31LE06.patch来支持他。
打完补丁后,配置内核:
make menuconfig
选中<M>video for linux加载多媒体接口;
选中<M>usb spca5xx sunplus vimico sonix cameras
然后就编译内核,make dep;make zImage;make modules.
在上述过程中非常顺利,没有出现错误。
编译内核结束后,产生了摄像头的三个驱动程序:spca5xx.o、spca_core.o、spcadecoder.o。
将内核移植到ARM板上以后,我依次加载驱动模块:
#insmod videodev.o
#insmod spca5xx.o
#insmod spca_core.o
#insmod spcadecoder.o
当然:其他相关的USB驱动之前已经加载好了。
由于我使用servfox作为摄像头的数据采集端:
所以执行:servfox -d /dev/vide0 -s 320x240 -w 7070
然后就出现了内核崩溃的问题!!
错误信息如下:
servfox version: 1.1.2 date: 07:10:2005 (C) mxhaard@magic.fr
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
*pgd = 00000000, *pmd = 00000000
Internal error: Oops: ffffffff
CPU: 0
pc : [<c002b4fc>] lr : [<c002b4f8>] Tainted: P
sp : c0155ef4 ip : 60000013 fp : c0155f10
r10: c018c800 r9 : c0155f64 r8 : 60000093
r7 : 00000000 r6 : c0156080 r5 : c24da008 r4 : c24da008
r3 : 00000000 r2 : 00000000 r1 : c24da00c r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: 317F Table: 32500000 DAC: 0000001D
Process swapper (pid: 0, stackpage=c0155000)
Stack: (0xc0155ee4 to 0xc0156000)
5ee0: c002b4f8 c002b4fc 60000013 ffffffff 00000001 c01560d8 fffffff7
5f00: c018c800 c0155f34 c0155f14 c002b2b0 c002b4b0 00000000 0000001a 04000000
5f20: c018499c c018465c c0155f60 c0155f38 c001b178 c002b244 ea000000 c0155fac
5f40: 00000001 c0021aa4 60000013 ffffffff 30014ca0 c0155fb8 c0155f64 c001a500
5f60: c001b05c 00000000 00000032 00000000 c001bca8 c001bca8 c0154000 c0184e7c
5f80: c0184e64 c0156c48 41129200 30014ca0 c0155fb8 c0155fbc c0155fac c001bcbc
5fa0: c0021aa4 60000013 ffffffff c0155fd0 c0155fbc c001b608 c001bcb8 00004000
5fc0: c01af284 c0155fe0 c0155fd4 c001a030 c001b5c0 c0155ffc c0155fe4 c000885c
5fe0: c001a010 c0185290 c01b6768 c01b6768 00000000 c0156000 c0008080 c000872c
Backtrace:
Function entered at [<c002b4a0>] from [<c002b2b0>]
r7 = C018C800 r6 = FFFFFFF7 r5 = C01560D8 r4 = 00000001
Function entered at [<c002b234>] from [<c001b178>]
r8 = C018465C r7 = C018499C r6 = 04000000 r5 = 0000001A
r4 = 00000000
Function entered at [<c001b04c>] from [<c001a500>]
Function entered at [<c001bca8>] from [<c001b608>]
Function entered at [<c001b5b0>] from [<c001a030>]
r5 = C01AF284 r4 = 00004000
Function entered at [<c001a000>] from [<c000885c>]
Function entered at [<c000871c>] from [<c0008080>]
Code: 1a000009 e2841004 eb041836 e3500000 (05800000)
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
我在网上查了其他网友的说法。
有的说是编译内核和servfox的交叉工具链版本要相同!
但是我编译内核和servfox的交叉工具链版本都是2.95.3
有的说是问题出在:
Unable to handle kernel NULL pointer dereference at virtual address 00000000
是驱动中的指针赋了null值的问题??
请各位帮忙啊!!
这个问题已经困扰很久了!我反复实验下来,觉得是摄像头驱动的问题。 |