1
votes

I am new to cross-compilation. I have to cross-compile a Linux kernel because I intend to use a wifi module with my TS-7500 SBC (ARM processor) and it does not support it. I have the drivers for my wifi module and through internet surfing I have come to know a general procedure of cross-compilation. However I am somewhat confused on the extra module portion. Here is the information from official website of TS-7500 regarding these extra modules:

Appendix - Compiling TS-Kernel with Custom Options In order to compile a separate kernel module and come out with a .ko file for inclusion in the already existing kernel, these are the steps to take following step 08 and ending at step 09 above. Note: Steps after step 02 are unverified/untested. They represent an accurate procedure which one would go through.

01.) Open menuconfig and modularize the kernel feature using "M". For example, to modularize cifs.ko, one would use the arrow and Enter keys to navigate to Filesystems -> Network File Systems -> CIFS Support.
Press "M" to modularize CIFS support into the kernel then keep hitting "exit" until you're prompted to save changes, choose "yes".

make menuconfig

02.) Compile the kernel with the modules and copy the modules to the Linux PC

 make && make modules && make modules_install  

03.) Retrieve the module which was copied to the Linux PC with a command like cp so that it can be installed into the kernel on the MiniSD card.

mkdir /mnt/miniSD4
mount /dev/sdb4 /mnt/miniSD4
cp /lib/modules/2.6.24.4/kernel/fs/cifs/cifs.ko /mnt/miniSD4

04.) Install the module into the kernel by copy and pasting from partition 4 of the card to partition 2 on the SBC.

cp -r /dev/nbd4/cifs.ko /dev/nbd2/lib/modules/2.6.24.4/kernel/fs/cifs/cifs.ko

05.) Finally, in order to use the new module, you must enable it. This can be included in a startup script such as linuxrc.

depmod
modprobe cifs.ko

I am confused about serial 2. Can anyone explain this to me and where am I supposed to provide address of the drivers I want to install?

Thanks in advance.

1

1 Answers

0
votes

I assume that by saying that your SBC does not support it, you mean that the module/driver, that you have cross-compiled, is an 'out of source tree' kernel module.

The above procedure is only for 'in-tree kernel modules'.

This leaves you with following two options.

  1. As a result of cross-compiling the driver, you will have an *.ko file. Transfer this file to the running system using an SD card or through network. After this load the module using

    insmod /path/to/module/filename.ko
    

    This method has but one limitation. i.e If this driver/module depends on other drivers, you will have to load them first.

  2. Include you driver in the kernel source tree and use modprobe drivername to load it along with the dependencies. modprobe is more advance than insmod in the sense that it first checks for dependencies and loads them automatically before loading the module itself.

To include the driver in you kernel's source tree see this answer.