ARM Linux Notes
ARM Linux Notes
July 2006
Abstract
This document describes stages to set-up and run Linux on ARM
based platforms, from installing a boot loader, kernel and file
system image. This is not intended as an exhaustive guide on
developing or building Linux system. There is already considerable
information available in the open source community for this. Open
source discussion forums also provide a good source of
information. Please refer to the ARM Linux Wiki site (www.linux-
arm.org) or www.arm.com/linux for additional information.
• ARM RealView Versatile/(PB, AB)926EJ-S: run the BootMonitor.axf program supplied with the
board from the debugger to program images. There is a Flash menu with some options to
program ELF or binary images. To run from flash you should program the ELF image into flash
as:
FLASH> write image c:/tmp/u-boot.axf NAME u-boot
An additional flash programming utility is provided with RealView Versatile boards called
‘Network Flash Utility’ (NFU). This program enables programming of images into flash through an
Ethernet connection. Please, refer to documentation on the RealView Versatile Family CD for more
information.
A similar process can be used to program other images (kernel and cramfs) into Flash. These should
be programmed as binary files as they are not ELF images.
For more information, please refer to the Firmware documentation supplied with the board.
2. Boot Loader
U-Boot is used as boot loader for RealView Integrator and Versatile platforms. The source code and
documentation are available at the following location: http://sourceforge.net/projects/u-boot/
U-Boot is expected to run from 0x01000000 in memory on ARM boards. The supplied images can
be loaded and run from a debugger at this address.
• RealView Integrator: raw binaries (or ELF files) can be placed at the beginning of flash and
executed as default image.
• RealView Versatile: you should use the ELF file to execute directly from flash or load and run
the raw binary from memory.
To compile U-Boot, download source distribution from the above site. RealView Integrator and
Versatile support has been added in U-Boot CVS/GIT repository. Additional patches may have
been submitted at the time of writing this document, if any, these should have been posted on the
public mailing list. Once you have unpacked/retrieved the sources, you need to configure and build
the boot loader. You can consult the full list of targets from the top Makefile. To configure and
compile the boot loader, you should execute the following commands:
• RealView Integrator/CP:
make integratorcp_config
make
You can also use the ‘help’ command with U-Boot to see the exact syntax of each command.
The command line
The Linux kernel CMDLINE can be set from the U-Boot prompt using the ‘set’ command. The
‘printenv’ command can be used to list the current environment variables. When executing the
Linux kernel from a boot loader, the kernel will use the command line which is pointed at by <r1>,
instead of any default built-in command line.
The images provided allow you to save the environment into Flash memory. This can be done using
the saveenv command.
The U-Boot images available for download at http://www.arm.com/linux contain the command line
used with the supplied U-Boot, kernel and filesystem images saved into flash, in that order, starting
at the bottom of flash.
3.Linux kernel
Sources for the kernel can be obtained and downloaded from www.kernel.org. Any additional patch
should be applied to the base kernel source tree as follows:
$ cd linux-2.6.17/
$ patch –p 1 < patch-2.6.17-<revision>
Configuration files are provided for each platform and pre-built images. The relevant configuration
file should be copied into the kernel tree as .config, the kernel can then be configured running
‘make xconfig’ or equivalent command. The following sequence of commands can be used to build
the kernel:
$ make xconfig
$ make Image produces a raw binary Image in arch/arm/boot/
4.Filesystem
Pre-built filesystem images provided on this page can be use with ARM RealView Integrator and
Versatile platforms. The platform type is detected at run-time with a script to create a symbolic link
to the appropriate serial device (/dev/tty…).
These images contain a subset of system utilities, commands and applications. To configure a
compressed filesystem image, the ARM_Embedded_Linux_2.2.0.tar.gz file needs to be unpacked.
The build instructions written in the top-level README file list the various steps needed to
generate a compressed filesystem image. A copy of the source of packages used to produce
applications used in this file system (e.g. cramfs) are available in source format from ARM upon
request.
The filesystem can either be mounted via NFS or placed into Flash, depending on the platform
settings and the command line passed to the kernel at boot time. In any case, the location of the
filesystem should be specified in the kernel command line by the “root =…” option, either
root=/dev/mtdblocki or root=/dev/nfs, where i is to be replaced by the appropriate partition number.
On RealView Versatile platform, the mtdpart option needs to be defined to indicate where images
are located in flash. This is documented in the kernel driver/mtd/ sources and an example is in the
configuration file associated with the RealView Versatile binary image.
5.Compilation Tools
5.1.Cross-compilation
An ARM cross-compilation tool chain need to be installed on the host system to produce Linux
kernels or applications. By default, this document assumes a Linux based host development
platform.
Note that the pre-compiled tool chain which is available for download assumes that you have a
version of Glibc library ≥ 2.3 installed on your system.
Perform the following steps as root to unpack and install the pre-built tool chain on your system:
$ mkdir /usr/local/arm/gnu/release4.1-6
$ cd /usr/local/arm/gnu/release4.1-6
$ tar xvfz sourceryg++-4.1-6-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.gz
$ ln –s /usr/local/arm/gnu/release-4.1-6 /usr/local/arm/gnu/release
Sources used to build the GCC tools can be downloaded from www.codesourcery.com or from the
main GCC CVS repository. Discussion groups are also available on this site to discuss technical
issues related to ARM GNU tools.
Multiple targets can be built for the compiler:
- arm-elf produces a flat or standalone binaries which are not tied to any operating system.
arm-elf selects ELF support which shares much of its code with arm-linux.
6.Additional notes
Notes and Linux packages provided on this page are intended as starting point for evaluation and
validation with ARM development platforms. Please contact Linux distributors for complete Linux
distributions.
Some additional discussion forums are also available on public websites, Linux kernel mailing lists
and GNU mailing lists. Other communities such as www.debian.org, www.openembedded.org,
www.handhelds.org and http://www.celinuxforum.org/ also provide good resources which can be
used with ARM platforms.