01-21-2011 05:13 AM
I have a linux 2.6 from wikidot which run perfectly (root~> ok) but I try to add an executable file in my kernel to bright some leds.
But I don't how can i make it.
I tried with executable ./hello I tried with gcc or cc but same result : ./hello not found, cannot execute or applet not found.
I think I have to configure the kernel and cross compile the C program but I don't no how can I do it.
Please help me as soon as possible.
I have a meeting monday about that...
01-21-2011 12:35 PM - edited 01-21-2011 12:36 PM
In fact you need to cross compile your program C with a gcc adapted to your processor.
Example gcc -o powerpc hello.c -static
static to include the include files in your compilation.
01-24-2011 08:11 AM
Yes you are on the right track. Just like you set up the tools to build the kernel (CROSS_COMPILE=....), you need to use the name of the cross compiler rather than gcc as gcc is the native compiler on your machine.
Such as microblazeel-unknown-linux-gnu-gcc for the little endian tools.
On your host, after compiling it, you should see the file that it builds is an ARM executable (using the "file" utility).
Use -static to compile such that you don't use dynamic linking and the binary will standalone by itself without any library dependencies.
These are all normal Linux things that you should be able to read in every embedded Linux book, you should get one as we don't plan to tutorialize all these things for newbies. Newbies are expected to do their homework, then ask when something doesn't work as expected.