Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine

1,365 bytes added, 13:40, 22 December 2010
Example 1: Hello world (built with cross toolchain)
=== Examples ===
==== Example 1: Hello world (built with cross toolchain) ====
* Create source code text fileFirst of all you need to initialize a suitable environment in a bash console inside your virtual machine. You can do this sourcing once the environment-setup script. <pre>$ source /usr/local/poky/eabi-glibc/arm/environment-setup</pre> Create a single .c file (TODOhello-world.c), using your preferred editor (vi, nano, gedit, ...) <br><br>hello-world.c:<pre>#include <stdio.h> int main (int argc, char **argv){ printf("Hello world !\n"); return 0;}</pre> * Build arm binary executableCross toolchain tools are available into the built-in virtual machine Poky SDK.You only need open bash terminal prompt and write commands:<pre>$ arm-none-linux-gnuabi-gcc -o hello-world hello-world.c$ file hello-worldhello-world: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped</pre> * Transfer arm executable file from virtual machine to IGEPv2 boardCopy the binary result to your NFS-mounted root filesystem on your local virtual machine path<pre>$ sudo cp hello-world /srv/nfs/poky/poky-image-sato/igep0020a/home/root[sudo] password for jdoe: letmein</pre> * Execute arm executable file inside IGEPv2 boardAnd run the program in your target device (serial console or ssh network terminal) <pre># cd /home/root# ./hello-worldHello World !</pre>
==== Example 2: Hello world (built with autotool+cross toolchain) ====
0
edits