hello friends !!!
Those of you who want to work on arm might first wish to taste its flavour, then go for the board.
This scenario demands for virtual arm processors to work on & and there comes the QEMU... :)
lets first be familiar with QEMU ( Quick Emualator) is an open source machine emulator and virtualizer. It has two operating modes-
- User mode emulation - for running single programs cross-compiled for various architectures like ARM, Power PC, etc..
- Computer emulation - for emulating full computer system, virtualizing the whole processor. :)
However, There is lot of stuff on wiki, you can refer there for detailed info.. :)
In this article, we will focus on various HOW-TOs for installing qemu and executing the programs for ARM architecture.. :)
for installation there are two options :-)
- get it directly from repository- using apt-get-install or yum etc.. as per your distros..
- for fedora - yum install qemu (it will automatically download and install qemu for all architectures).
2. download the source code and compile it..
You can check various arcitectures in the terminal using command
$ qemu
n den press tab..
After we have qemu installed on our system, now is the turn to start our journey to virtualization:
lets start with the arm processor ... we will write a small HELLO WORLD program and cross-compile it for the arm architecture and finally execute it in user-mode-emulation...

so here is our smallest program : hello_world.c
now comes the step of cross-compiling it for ARM architecture.. well, cross-compiling means to compile a code on our pc (i.e.. host) for different target board (arm in this case).
Well in the previous post it is done with all the necessary steps :) that includes toolchain installation and compilation-
http://beyondszine.wordpress.com/2012/07/08/yet-another-hello-world-this-time-for-arm/
There it is compiled dynamically, (better if memory is limited, and diff programs share same libraries).
$ arm-none-linux-gnueabi-gcc <myfile> -o <desired name>
which means when you execute the final binary, you will have to give the path to the libraries (glibc). and the emulation command becomes -
$ qemu-arm -L <path of the library file to be linked to> ./file-name
____________________________________________________________________________
For the static compilation, just add static keyword
$ arm-none-linux-gnueabi-gcc -static <myfile> -o <desired name>
this will resolve all the function at the compilation time itself producing a stand-alone executable.. :) better choice is memory is no issue. :)
the emulation step is
$ qemu-arm ./file-name
____________________________________________________________________________
so simple :)
i have used static compilation as it seems easy to implement... lol
In our case:
$arm-none-linux-gnueabi-gcc -static hello_world.c -o hello_world
for emulation
- qemu emulation step for hello_world
You see !!! dat was so simple..
well, this is just the beginning... :) we'll see how to compile linux kernel and will build a minimal root filesystem for arm processor. :)


