Академический Документы
Профессиональный Документы
Культура Документы
A quick guide for utilizing the latest version of the Android OS on Cortex-A15 Fast Models
Author: Updated: Contacts: Alexander Spyridakis, Virtual Open Systems on 2012-04-18 Tel +33 09 63 54 99 49, Email contact@virtualopensystems.com
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 1/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Summary
1 Introduction 2 KVM for ARM 2.1 Requirements 2.2 Cortex-A15 2.3 big.LITTLE 3 Versatile Express 3.1 Platform Overview 3.2 Peripheral Components 4 ICS Android & ARM Fast Models 4.1 Fast Models 5 Android host and booting a guest 5.1 Compiling the kernel 5.2 Userland and simulation execution 5.3 Booting on big.LITTLE 5.4 Running a guest OS 5.5 Limitations 6 Future work & References 6.1 References 7 About Virtual Open Systems Golden Guides 8 About Virtual Open Systems 8.1 Virtual Open Systems Android-Virtualization Services 3 4 4 4 5 6 7 7 8 9 10 10 10 11 12 13 13 14 15 15 15
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 2/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
1 Introduction
The advent of tablets and smartphones has revolutionized the mobile market. Currently, many of the ARM-based (Advanced RISC Machine) tablet and smartphone products are running the Android software. With the newly released version of Android, the Ice Cream Sandwich, Google unifies tablets and mobile devices, by incorporating the 1 Honeycomb features and various enhancements into the new OS . In addition, during 2012 it is expected a new generation of tablet and mobile products based on ARM Cortex-A15 MPCore. This processor is a multicore ARM architecture providing an out-of-order superscalar pipeline ARM v7 instruction set running at up to 2.5 GHz. The cortex-A15 is the first ARM processor supporting the hardware virtualization extensions and the Large Physical Address Extensions (LPAE). With these features, ARM cortex A15 is suitable either for consumer market or for lightweight server tasks, like running a web server, and in a micro-server configuration for cloud computing. In this context, Virtualization is an ubiquitous technology in enterprise data-centers and cloud computing infrastructures. Virtualization introduces one level of indirection between logical and physical context. Such indirection has proven to be remarkably powerful and efficient. In modern platforms for consumer and server markets, this indirection is used in numerous ways. For instance in an hypervisor, a software layer that decouples an operation system and its applications from the real hardware, or in a virtual machine (VM) that is a software layer emulating a hardware platform. In order to start software development for modern platforms based on cortex-A15 that use virtualization technologies ahead of real platforms, it is possible to provide a virtual representation of the hardware platform. Using technologies such as the ARM Fast Models, software developers can capture different application scenarios quite in advance compared to the availability of real hardware. Thus Fast Models can help software engineers to debug, to optimize and to analyze applications and middleware environments, such as Android. In this document we will describe how to completely boot the Android Ice-Cream-Sandwich (ICS) on Fast Models. For the purpose of this guide, the Cortex-A15 Versatile Express hardware platform has been chosen.
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 3/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
2.1 Requirements
The following requirements will either be described or provided, for successfully completing this guide: Installation and setup of the simulation platform. ARM Fast Models simulator is needed to generate a Cortex-A15 Versatile Express model. An Android-ready Linux kernel. We provide a pre-compiled kernel which will boot Android on our simulation platform. The Android ICS OS userland files. Pre-compiled AOSP binaries (v4.0.3) to boot the host OS. QEMU and a guest OS. Utilize QEMU in conjunction with KVM to boot a guest OS under Android.
2.2 Cortex-A15
The new Cortex A15 MPCore processor, is the first in the ARM A series to introduce hardware virtualization, 6 together with increased performance (up to 40% faster than A9) and the standard ARM low power requirements . Full Hardware Virtualization Large Physical Address Extensions (LPAE) VFPv4 Floating point NEON Advanced SIMD 1-4X SMP within a single processor cluster, up to 2 clusters per chip
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 4/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
2.3 big.LITTLE
big.LITTLE 7 is the synergy of the powerful Cortex-A15 processor and the energy efficient Cortex-A7, for the purpose of achieving power critical use cases and offering drastic performance gains when needed. Cortex-A7 is feature and architecturally identical with Cortex-A15 but with the best power to performance ratio ever seen in an ARM processor. The low power requirements of Cortex-A7 are mostly related to its reduced pipeline compared to Cortex-A15. To lower even further the power profile of the system, each core has its own Level 2 cache memory. While sharing an L2 cache would be a more area optimized design, integration of an L2 cache on each processor, yields better power results. The first use model of the big.LITTLE system is task migration to Cortex-A15 when performance is critical, while execution of simpler tasks must be done on Cortex-A7 for low power operation. Another option is utilizing both clusters for an AMP (asymmetrical multiprocessing) setup.
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 5/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
3 Versatile Express
The Versatile Express family of development platforms provides the right environment for prototyping the next generation of system-on-chip designs. Thanks to its flexible, modular architecture, and high-speed interfaces, hardware and software applications can be developed and debugged quickly and efficiently.
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
SP804 Timer SP805 Watchdog timer PL390 Generic Interrupt Controller SMSC91C111 Ethernet Controller PL041_AACI audio interface (partially implemented)
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 8/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Tip
Build a static version of the model Optionally, the user can choose to build a static version of the model by selecting the Integrated simulator (ISIM system) check-box option in the "Targets" tab, under Settings. This will create an isim_system executable that can be used directly, instead of loading the cadi_system library under model shell.
Fast Models offers a range of processors and platforms to simulate. On this guide we will mainly focus on the Versatile Express platform, with Cortex-A15 and the Cortex-A15 + Cortex-A7 system, also known as big.LITTLE. For performance reasons, on big.LITTLE models it is important to disable the cache_state_modelled parameter on System Canvas, before compiling the simulator. To do that, right click on the top-level coretile component and select properties. From there uncheck the property cache_state_modelled. Do the same for the CCI400 sub-component located inside the coretile. The following models can be used for this guide: RTSM_VE_Cortex-A15x1 RTSM_VE_Cortex-A15x2 RTSM_VE_Cortex-A15x4 RTSM_VE_Cortex-A15x1-A7x1 RTSM_VE_Cortex-A15x4-A7x4
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 9/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
$ wget http://www.virtualopensystems.com/media/android/uImage
$ wget http://www.virtualopensystems.com/media/android/linux-system-semi.axf
$ wget http://www.virtualopensystems.com/media/android/android-kvm-a15-v7.patch
$ wget http://www.virtualopensystems.com/media/android/.config
Put them both in the kernel source code directory and run:
For a more detailed process of compiling the kernel, consult our previous KVM-on-ARM guide on chapter 3.
$ wget http://www.virtualopensystems.com/media/android/ics_ve_4.0.3.tar.gz
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 10/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Finally, mount the image file and extract the userland files in it:
$ $ $ $
mkdir mnt sudo mount -o loop disk.img mnt sudo tar -C mnt -xf ics_ve_4.0.3.tar.gz sudo umount mnt
We are now able to start the simulator and boot our system with the following command:
$ ./isim_system \ -a cluster.cpu0=linux-system-semi.axf \ -C motherboard.vis.rate_limit-enable=0 \ -C motherboard.mmc.p_mmc_file="disk.img" \ -C cluster.cpu0.semihosting-cmd_line="--kernel uImage -- console=ttyAMA0 mem=512M mem=512@0x880000000 root=/dev/mmcblk0 rw androidboot.console=ttyAMA3 init=/init"
Upon booting click the upper right corner in the CLCD display to open the Android main menu.
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 11/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
It should be noted though that due to the nature of the Virtualizer, it is currently in conflict with KVM. Both of them utilize specific Hypervisor calls and registers of the virtualization extensions, disallowing simultaneous usage of the two for the time being. Download the bootwrapper + Virtualizer:
And finally run the big.LITTLE model with the same kernel for A15:
As soon as the model starts, you will notice the virtual LEDs in the upper part of the CLCD view, blinking at around 120 million instructions. This blinking activity represents the task migration between the two clusters. Similar behaviour can be seen in the instruction counters of the clusters. Virtual Open Systems has extended the functionality of the virtualizer, to allow selection between AMP or SMP (switching) mode during the instantiation of the big.LITTLE model, avoiding the need of recompiling. In AMP mode the cluster switcher is suppressed at boot time and the payload sees a single cluster with double the amount of cores. To enable AMP functionality, add the following parameter when starting the model:
-C coretile.dualclustersystemconfigurationblock.CFG_ACTIVECLUSTER=3
Tip
Boot the guest with initrd It is advised to boot the guest with initrd (ramdisk) and not MMC. Due to performance issues, initrd booting is several times faster than MMC.
To create the initrd for the guest, you need to execute as root:
$ $ $ $ $ $
mkdir mnt1 mnt2 sudo mount -o loop filesystem_bin_alip-ael-armv7-thumb-min-debug.cramfs mnt1 sudo cp -a ./mnt1/* ./mnt2/ cd ./mnt2 sudo ln -s sbin/init init find ./ | cpio -o -H newc | gzip > ./initrd.cpio.gz
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 12/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Alternatively, the Android userland files already include properly pre-compiled binaries of QEMU, a guest kernel and the initrd of a BusyBox filesystem. To run the guest OS simply execute the following commands from the open terminal of the Android host:
$ cd /root $ ./start_qemu.sh
5.5 Limitations
The main limitation of the system is the absence of a GPU. Any output to the frame buffer must be rendered from the CPU, wasting valuable simulation cycles in an already performance degraded system. This behavior can be exaggerated by the bootanimation service. When booting, the default animated Android logo can seize up to 90% of the CPU. Replacing it with a static image (as in our case), will drop CPU utilization near 0%, making the boot process much faster. The current known limitations include: Due to software rendering, performance is sub-par. Sound doesn't work, because the PL041_AACI audio interface is partially implemented. There is no USB support in Fast Models, thus some applications refuse to work without it. Currently, QEMU can be operated only in a terminal. This limitation prohibits guests with a GUI.
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 13/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
6.1 References
1 2 3 Introducing Android 4.0: http://www.android.com/about/ice-cream-sandwich/ Paravirtualized drivers for KVM: http://www.linux-kvm.org/page/Virtio Kernel-based Virtualization with KVM: http://www.linux-magazine.com/w3/issue/86/Kernel_Based_Virtualization_With_KVM.pdf Cortex-A15 Processor: http://www.arm.com/products/processors/cortex-a/cortex-a15.php Virtual Open Systems KVM repository: https://github.com/virtualopensystems/linux-kvm-arm Cortex-A15 Technical Reference Manual: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0438c/DDI0438C_cortex_a15_r2p0_trm.pdf big.LITTLE White Paper: http://www.arm.com/files/downloads/big_LITTLE_Final_Final.pdf Versatile Express platform: http://www.arm.com/products/tools/development-boards/versatile-express/index.php ARM Fast Models: http://infocenter.arm.com/help/topic/com.arm.doc.dui0423l/DUI0423L_fast_model_rm.pdf
4 5 6
7 8 9
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 14/15 -
Embedded Systems Virtualization Services by Virtual Open Systems - Android ICS on Fast Models
Sarl Virtual Open Systems - Registered at 529 212 987 RCS Grenoble - www.virtualopensystems.com - Page 15/15 -