Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Open Source Software and Platforms
Open Source Software and Platforms
Wiki Build an ILP32 user-space
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • +A-class platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • -Open source software
    • -Linux/Android
      • ------- Power management -------
      • cpufreq (DVFS)
      • cpuidle (hotplug)
      • +Energy Aware Scheduling (EAS)
      • System Suspend to RAM
      • ------- Configuration -------
      • +Device Tree
      • Modify Linux kernel config flags in the Arm Platforms deliverables
      • ----- Virtualization -----
      • Spawn a Linux virtual machine on Arm using QEMU (KVM)
      • ------- User-space -------
      • Android
      • Debian
      • Fedora Server
      • OpenEmbedded
      • Build a Buildroot user-space
      • Build an ILP32 user-space
      • BusyBox
    • +Trusted Firmware-A
    • Trusted Firmware-M
    • +EDK II UEFI
    • OP-TEE
    • +U-Boot
    • Robotics
    • Mbed OS
    • +SCP

Build an ILP32 user-space

Introduction

This article describes how to build and run a minimal ILP32 software stack on Arm's Foundation model and provides an example of the upstream support now available. The instructions were tested on an Ubuntu 16.04 LTS host.

Linux on AArch64 uses LP64 as its standard data model, where long and pointer are 64-bit and int is 32-bit. AArch64-ILP32 uses a data model where int, long, and pointer are all 32-bit. For more details see this whitepaper.

An AArch64-ILP32 model can can be used to address compatibility issues, where legacy 32-bit userspace applications make assumptions about pointer size. It may also provide performance improvements related to reduced memory size and corresponding cache efficiency, for some specific use cases.

Download and install the model

The Armv8 Foundation Model is a fast software model of an Armv8-A compliant implementation. It allows customers to run a full open-source software stack.

  • The model is available as a free download
  • For more details, refer to the user guide

Download the latest Arm platform software binaries

Arm and Linaro host an integrated software stack that is routinely tested on the Armv8 Foundation Model. This software does not support ILP32, but we can use the standard deliverables for our firmware components.

Follow the instructions here to fetch the workspace initialisation script and select the following configuration:

+-----------+-------------------------------------+
| Workspace | /path/to/your/workspace             |
| Platform  | [64-bit] ARMv8 Foundation Model FVP |
| Build     | Use prebuilt configuration          |
| Prebuilt  | latest-armlt + BusyBox              |
+-----------+-------------------------------------+

This will create a new workspace folder containing a set of binaries and a run_model.sh script. Use run_model.sh to check the software boots.

export MODEL=/path/to/Linux64_GCC-x.x/Foundation_Platform
source ./run_model.sh

This will launch the model and spawn a console window. You should see the software boot and mount the busybox filesystem.

Create a ILP32 software stack

This involves building a new kernel and ramdisk to replace those supplied in the standard deliverables.

Download and extract the ilp32 archive attached to this article

This will create an `ilp32test/' subdirectory including the following components:

  • sync-ilp32.sh (fetches ilp32 & lp64 compilers, ilp32 staging kernel & BusyBox sources)
  • init.sh, default.script, files.txt (used in the creation of the BusyBox filesystem)
  • test.c (simple test code reporting pointer size)
  • build-ilp32.sh (builds kernel, ilp32/ilp64 test code & busybox filesystem)
  • mkimage (U-Boot tool used to create ramdisk)

Run the sync script

source ./sync-ilp32.sh

This will fetch lp64 and ilp32 compilers, an ilp32 staging kernel and BusyBox sources.

Run the build script

source ./build-ilp32.sh

This will build the kernel and ramdisk and copy the resultant binaries to ./output

Copy in the pre-built components

Copy the required components from the Arm Platforms software release into ./output

export BINARIES=/path/to/fvp-latest-busybox-uboot
cp $BINARIES/{bl1.bin,fip.bin,foundation-v8-gicv3.dtb,run_model.sh} ./

Run the ILP32 stack on the Foundation Model

export MODEL=/path/to/Linux64_GCC-4.9/Foundation_Platform
source ./run_model.sh

This will launch the model and spawn a console window. You should see the software boot and mount the busybox filesystem. From the busybox prompt you can execute the test applications, these print sizeof a pointer

Console showing the software boot and mount the busybox filesystem

ADDENDUM: Using an Open Embedded filesystem

You can also use the deliverables above with an Open Embedded ILP32 (rather than busybox) filesystem.

Using a prebuilt OE filesystem

Fetch prebuilt image for testing

wget http://snapshots.linaro.org/openembedded/images/minimal-initramfs-armv8-ilp32-gcc-7.1/hikey-/latest/linaro-image-minimal-initramfs-hikey-ilp32-*.rootfs.cpio.gz.u-boot
cp linaro-image-minimal-initramfs-*.rootfs.cpio.gz.u-boot ramdisk.img

Use this new ramdisk.img to replace the existing ramdisk in the ./output directory

Building OE from source

You can also build OE from source

git clone https://git.linaro.org/openembedded/jenkins-setup.git oe-build
cd oe-build
MACHINE=hikey-ilp32 bash -x init-and-build.sh -a armv8 -g 7.1 linaro-image-minimal-initramfs
cp ./build/tmp-glibc/deploy/images/hikey-ilp32/linaro-image-minimal-initramfs-hikey-ilp32-*.rootfs.cpio.gz.u-boot ramdisk.img

Use this new ramdisk.img to replace the existing ramdisk in the ./output directory

ilp32test.zip

  • Linaro
  • Open Source Projects
  • Linux Developers
  • Armv8 Foundation Platform
  • Fixed Virtual Platforms (FVPs)
  • Share
  • History
  • More
  • Cancel
Related
Recommended