![]() ![]() We are going to compile for ARM architecture by using a cross-toolchain, so we need to tell it somehow to the Linux build system. This will create a new subdirectory called linux-3.2 containing the full source of the Linux kernel. One way to do it is by running in the same directory: tar xjf linux-3.2.tar.bz2 The official site for mainline Linux kernel is at The kernel version that I will use is the 3.2, be aware that if you want to use a different version you may have different results, even though most of the functionality used here is simple enough that it should not change between versions.ĭownload linux-3.2.tar.bz2 from the FTP site, or simply run from the command line: wget Emulate kernel boot and ramdisk execution.The last command opens a QEMU window, that shows a black background and many boot messages, and towards the end the “Hello World!” string is displayed. The kernel compilation (the “ make all” command) could take some minutes or hours depending on your host machine power. Qemu-system-arm -M vexpress-a9 -kernel linux-3.2/arch/arm/boot/zImage -initrd initramfs -serial stdio -append "console=tty1" Then in the same directory execute the following commands in order: wget Īrm-linux-gnueabi-gcc -static init.c -o initĮcho init|cpio -o -format=newc > initramfs The short storyĬreate a clean directory, then create a file called “ init.c“, which contains the following simple C code: #include ![]() You must install the correct package depending on your distribution sometimes distributions split the QEMU programs into different packages, for example Ubuntu packs it into the “ qemu-extras” package. In my case I use Emdebian toochain, which has the “ arm-linux-gnueabi-” prefix.įinally the emulator that I use is QEMU, in particular the program to emulate ARM hardware is “ qemu-system-arm“.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |