![]() Compile the kernel, while electing to build a uImage for u-boot. The kernel zImage files are not compatible with u-boot, so let’s use uImage instead, which is a kernel image with the header modified to support u-boot. In subsequent articles, we will be doing lots of testing on u-boot - and for that, we need a modified kernel. ![]() ![]() (EABI is Embedded Application Binary Interface.) Without this option, the kernel won’t be able to load your test program. In the configuration window, navigate to “Kernel Features”, and enable “Use the ARM EABI to compile the kernel”. Here, specify the architecture as ARM, and invoke the ARM tool-chain to build the kernel. # make menuconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi. The mainstream Linux kernel already contains supporting files and code for ARM you need not patch it, as you used to do some years ago.ĭownload latest version of Linux from (v2.6.37 as of this writing), and extract the tarball, enter the extracted directory, and configure the kernel for ARM: # tar -jxvf linux-2.6.37.tar.bz2 The next step is to build the Linux kernel for ARM. So, you are now done with the ARM tool-chain and qemu-arm. While executing the program, you must link it to the ARM library. Run the test program: #qemu-arm -L /your-path/arm-2010.09/arm-none-linux-gnueabi/libc. Test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped Once the file is compiled successfully, check the properties of the output file, showing that the output executable is built for ARM: # file test Use the ARM compiler to compile this program: # arm-none-linux-gnueabi-gcc test.c -o test Before proceeding, you should add the ARM tool-chain to your PATH: # PATH=/(Your-path)/arm-2010.09/bin:$PATHĬreate a small test program, test.c, with the basic “Hello world”: #include Now use the arm-none-linux-gnueabi-gcc tool to compile a test C program. rwxr-xr-x 2 root root 222948 Nov 7 22:23 arm-none-linux-gnueabi-gcc Cross-compiling and running the test program for ARM rwxr-xr-x 1 root root 18612 Nov 7 22:23 arm-none-linux-gnueabi-elfedit rwxr-xr-x 1 root root 224196 Nov 7 22:23 arm-none-linux-gnueabi-cpp rwxr-xr-x 1 root root 572028 Nov 7 22:23 arm-none-linux-gnueabi-c++filt rwxr-xr-x 2 root root 1046336 Nov 7 22:23 arm-none-linux-gnueabi-as rwxr-xr-x 2 root root 593236 Nov 7 22:23 arm-none-linux-gnueabi-ar rwxr-xr-x 1 root root 569820 Nov 7 22:23 arm-none-linux-gnueabi-addr2line You can download it from here.Įxtract the archive’s contents, and view a list of the available binaries: $ tar -jxvf 2 Just as you need the x86 tool-chain to develop programs for Intel, you need the ARM tool-chain for ARM program development. The first is used to execute ARM binary files, and the second to boot the ARM OS. You will find two output binaries, qemu-arm and qemu-system-arm, in the source code directory. Extract the tarball, change to the extracted directory, configure and build it as follows: $ tar -zxvf qemu-0.14.0.tar.gz Download the QEMU source, if you don’t have it already. In the last article, we compiled QEMU for x86. In the second case, you can try to boot the Linux kernel for ARM, and test it. This feature is very helpful and time-saving. The results quiet resemble those from the previous reports that compared the performance in the user mode.In the first case, you can run and test ARM programs without installing ARM OS or its kernel. The results from the topN script and the manual boot-up time measurement are combined in the table below. All emulations are performed with a RAM size of 1024 MB.ġ1 0.84% object_class_dynamic_cast_assertĢ1 0.49% address_space_translate_internal The below snippets download the required files from the Debian archives then starts the emulation for each target. iso image of Debian which is around 350 MB for each target, it’s sufficient to use the initial ramdisk and kernel files from the netboot version of the Debian distribution. Having said that, instead of downloading the. Doing so assures that enough instructions are executed by QEMU for accurately comparing the results while at the same time avoids the unnecessary lengthy process of actually installing the OS. The latest Debian version 15.0 is used.įor each of the five targets (aarch64, arm, mips, mipsel, and x86_64), the Debian image is booted up until the setup menu appears, then the emulation is manually stopped. configure -target-list =aarch64-softmmu,arm-softmmu,mips-softmmu,mipsel-softmmu,x86_64-softmmuĭebian provides support for a variety of architectures, that’s why it’s the OS of choice for testing the system mode emulation.
0 Comments
Leave a Reply. |