bit ARM Development: Hello World and Linux on ARMv8 Fast Mod

At the end of last year,ARM announced ARMv8, the first ARM 64-bit ARM archtecture, and last week at ARM Techcon 2012, ARM announced the firstARMv8 cores: Cortex A53 and A57. But since there’s no silicon at the moment, what if you wanted to develop code running on ARMv8 before the hardware is available? The answer is:Fast Models, a Virtual Platform (VP) to accelerate software development. This is especially important for ARMv8 since hardware is not expected to be available for another year. In this post, I’ll first show how to run “Hello World!” in ARMv8 fast models, then we’ll run ARM Linux 64-Bit (Aarch64) in the virtual platform.

ARMv8 Foundation Model

In order allow the developer’s community to program for ARMv8 (Cortex A53/A57 cores), ARM has madeARMv8 Foundation Model, a virtual platform, available free of charge.

This v8 Foundation model provides a basic ARMv8 platform environment suitable for running bare metal semi-hosted applications, and Linux OS booting. The platform provides:

The V8 processor model implements:

The models require an x86 64-bit Linux machine running Red Hat Enterprise Linux version 5.x for 64-bit architectures, Red Hat Enterprise Linux version 6.x for 64-bit architectures, Ubuntu 10.04 (64-bit) or later. However,any x86 64-bit Linux distributions with glibc v2.3.2 (or greater) and libstdc++ 6.0.0 (or greater), should be able to run the models. I used a machine running Ubuntu Desktop 12.04 LTS 64-bit with the instructions below.

Hello Word! for ARMv8

To get started, visit the page linked above, and click on “Download Now” at the bottom of the page. You’ll need to login or register (It’s free), and then on the top right of the screen click on “Download Now” again to start downloading theV8 Foundation Model. You’ll a get a 8 MB file called FM000-KT-00035-r0p8-44rel23.tgz.

Let’s work in a terminal window, uncompress the file and run the “Hello World!” application.

tar xzvf FM000-KT-00035-r0p8-44rel23.tgzcd ~/Foundation_v8pkg./Foundation_v8 –image examples/hello.axf terminal_0: Listening for serial connection on port 5000 terminal_1: Listening for serial connection on port 5001 terminal_2: Listening for serial connection on port 5002 terminal_3: Listening for serial connection on port 5003 Simulation is started Hello, 64-bit world!

That’s it! Details are in in the document: DUI0677A_foundation_fast_model_ug.pdf, including instructions to access a web interface to monitor the machine, access to UART and more.hello.axfis a file based on “ARM Executable Format” that contains executable binary code generated with armlink linker part of theKeil ARM Compilation Tools. You can check the Makefile in the examples directory to see how armcc and armlink are used for the ARMv8 architecture.

Run ARMv8 Linux in the Virtual Platform

Now let’s do something a bit more interesting by running Linux (OpenEmbedded) in the v8 foundation model. The instructions I followed are available at

Prepare a working directory:

mkdir ~/linaro-armv8cd ~/linaro-armv8

Download boot image:

wget

Download and extract disk image:

wget gunzip vexpress64-openembedded_sdk-armv8_20121019-22.img.gz

Run OpenEmbedded in the virtual platform:

~/Foundation_v8pkg/Foundation_v8 –image ~/linaro-armv8/img-foundation.axf –block-device ~/linaro-armv8/vexpress64-openembedded_sdk-armv8_20121019-22.img –network=nat

After a few seconds, a terminal window (Telnet attached to UART) with the kernel output should pop-up:

Be patient, and after several minutes (12 minutes on a PC based on Intel Core 2 processor @ 1.8 GHz), you should see the command prompt.Let’s see if we really run on ARMv8:

uname -aLinux genericarmv8 3.6.0-1-linaro-vexpress64 #1~ci+121019044339 SMP Fri Oct 19 05:03:44 UTC 2012 aarch64 GNU/Linuxcat /proc/cpuinfoProcessor : AArch64 Processor rev 0 (aarch64)processor : 0BogoMIPS : 200.00Features : fp asimdCPU implementer : 0x41CPU architecture: AArch64CPU variant : 0x0CPU part : 0xd00CPU revision : 0Hardware : V2P-AARCH64

All good!

Building for ARMv8

Running Linux in ARMv8 is nice, but what you really want to do is write and build programs for the platform. Natively build programs inside the foundation models is probably not a good idea for most programs, since it would be quite slow, so you’ll have to cross-compile for Aarch64. I’ll build the “Hello World!” application as explained inhttps://wiki.linaro.org/HowTo/HelloAarch64.

First download and install aarch64-toolchain:

劝君更尽一杯酒,西出阳关无故人。

bit ARM Development: Hello World and Linux on ARMv8 Fast Mod

相关文章:

你感兴趣的文章:

标签云: