Reputation: 73
I am trying to insert a .ko
kernel module into the linux running in arm processor. I built a .ko
file in my desk PC which is a x86 one. How do I cross compile it to arm specs. I am new to this field.
Thanks in advance
Upvotes: 5
Views: 10252
Reputation: 2191
For this you have to do the following steps.
Check you have cross compiler tool chain or not. If you don't have cross compiler tool chain you can download from one of the free ARM cross compiler from net. You can generate your own cross tool chain using Buildroot tool. below you can get the link of Buildroot user manual. http://buildroot.uclibc.org/downloads/manual/manual.html#_using_buildroot
Install cross tool chain in your host PC.
Export the cross tool chain path in your host PC using export command.
Change the make file of the kernel module to set the compiler as CROSS_COMPILE.
Do make.
Move the .ko
file to target and insert it.
Upvotes: 5
Reputation: 9494
For that you need to download the ARM compilers first. I suggest you download the compiler from http://www.linaro.org/downloads/ then set the CROSS_COMPILE environment variable to arm-linux-gcc.
set the bin directory path in PATH variable.You can do it by export PATH=$PATH:/path/to/arm/binaries/
Finally compile the code then run in ARM.
use file <filename>
whether it is ARM executable or not.
Upvotes: 7