Saturday, November 11, 2006

Cross-compiling the QuickCam web cam module

Here are the steps needed to build the QuickCam web cam module for the TS-7260. Cross-compilation occurred on a stock 32-bit Fedora Core 4 system. These steps are also useful for those wanting to compile a kernel for the TS-7260.

1) Download the ARM crosstools hosted at technologics. Links are available here:

Documentation I used to build the kernel, excellent I might add, was found here:

Section 6 of the above manual describes how to build the kernel.

I downloaded

2) Unpack the thing, and copy it, as root, to /

3) Grab the Linux kernel sources, also from technologics. I grabbed ts11, because running uname on the board indicated the kernel version is 2.4.26-ts11. Here is the link:

I placed this in my home directory, under ~/TS7260/ksrc, and then unpacked

4) cd linux24

5) Edit the Makefile in linux24, comment out the line starting with CROSS_COMPILE, and add a new line below it to point at the crosstools installed in steps 1 and 2:

CROSS_COMPILE = $(shell cd /usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/ && pwd)/arm-linux-

6) Type make ts7260_config

Answer no (n) to all questions.

7) Type make oldconfig

Answer no (n) to all questions.

8) Type make menuconfig

A UI will display, this can be used to set configuration parameters needed to build the videodev.o kernel module.

In this UI, traverse down to the Multimedia devices section, open it up by hitting return, and then configure Video For Linux as shown in the figures (make sure a M is displayed). See the figures for details.

Exit, and save menuconfig

9) Type make dep

10) Type make vmlinux

11) Type make modules

12) If all goes well, you can then do a "find . -name videodev.o -print" and locate the videodev.o module. FTP it over to the 7260, and then run insmod:

$ insmod videodev.o

If successful, the videodev module, needed by QuickCam, will be installed.

Next step is to get the sources for the quickcam module, and compile them:

13) Go to

14) Download the sources, and follow the instructions for building.

15) Copy the file quickcam.o to the 7260, and install the module:

$ insmod quickcam.o

ts7200:/home/quickcam/qc-usb-0.6.5# insmod quickcam.o
usb.c: registered new driver quickcam

16) Run lsmod, and you should see something like the following:

ts7200:/home/quickcam/qc-usb-0.6.5# lsmod
Module Size Used by Tainted: P
quickcam 62544 0 (unused)
videodev 6616 0 [quickcam]
usb-storage 55912 1
sd_mod 11100 2
scsi_mod 53816 2 [usb-storage sd_mod]
usb-ohci-ep93xx 888 0 (unused)
usb-ohci 15584 0 [usb-ohci-ep93xx]
pcipool 2072 1 [usb-ohci-ep93xx usb-ohci]
usbcore 55944 1 [quickcam usb-storage usb-ohci]
af_packet 9448 0
tsuart7260 1628 0 (unused)
tsuart0 8880 0 [tsuart7260]
vfat 10140 0 (unused)
fat 29608 0 [vfat]

Note, if you don't insmod videodev.o before doing the insmod quickcam.o, the QuickCam module will fail and complain that it can't resolve videodev.o


Blogger Xin said...

hello, problem i have :

root@ts7000:linux24# make ts7200_config
make: Warning: File `Rules.make' has modification time 1.1e+09 s in the future
*** Default configuration for ts7200 installed
*** Next, you may run 'make oldconfig'
make: warning: Clock skew detected. Your build may be incomplete.


root@ts7000:linux24# make menuconfig
make: Warning: File `Rules.make' has modification time 1.1e+09 s in the future
rm -f include/asm
( cd include ; ln -sf asm-arm asm)
make -C scripts/lxdialog all
make[1]: Entering directory `/root/TS7200/ksrc/linux24/scripts/lxdialog'
make[1]: Warning: File `Makefile' has modification time 1.1e+09 s in the future
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status

>> Unable to find the Ncurses libraries.
>> You must have Ncurses installed in order
>> to use 'make menuconfig'

make[1]: *** [ncurses] Error 1
make[1]: Leaving directory `/root/TS7200/ksrc/linux24/scripts/lxdialog'
make: *** [menuconfig] Error 2

what is wrong ?
thanks for your help

1:11 PM  
Blogger Xin said...

step9: make dep

ts7200:~/TS7200/ksrc/linux24# make dep
rm -f include/asm
( cd include ; ln -sf asm-arm asm)
make[1]: Entering directory `/root/TS7200/ksrc/linux24/arch/arm/tools'
/root/TS7200/ksrc/linux24/scripts/mkdep -D__KERNEL__ -I/root/TS7200/ksrc/linux24/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mtune=arm9tdmi -msoft-float -Uarm -- getconstants.c |\
sed s,getconstants.o,constants.h, > .depend
make all
make[2]: Entering directory `/root/TS7200/ksrc/linux24/arch/arm/tools'
/root/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-gcc -D__KERNEL__ -I/root/TS7200/ksrc/linux24/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mtune=arm9tdmi -msoft-float -Uarm -S -o constants.h.tmp.1 getconstants.c
/root/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-gcc: /root/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-gcc: cannot execute binary file
make[2]: *** [constants.h] Error 126
make[2]: Leaving directory `/root/TS7200/ksrc/linux24/arch/arm/tools'
make[1]: *** [dep] Error 2
make[1]: Leaving directory `/root/TS7200/ksrc/linux24/arch/arm/tools'
make: *** [archdep] Error 2

3:01 PM  

Post a Comment

<< Home