5

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

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

Comments

5

For this you have to do the following steps.

  1. 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

  2. Install cross tool chain in your host PC.

  3. Export the cross tool chain path in your host PC using export command.

  4. Change the make file of the kernel module to set the compiler as CROSS_COMPILE.

  5. Do make.

  6. Move the .ko file to target and insert it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.