You are here: LinuxReference Web>RunningOnModel (03 Dec 2009)

Running Linux on a software model

Software models do not usually have all the features of a hardware platform like Ethernet, persistent Flash memory, boot monitor. This page describes a way to build an ELF image from kernel, filesystem and simple boot code to initialise the registers and UART0. The example files are to be used with the ARM Ltd. models that emulate a RealView/EB platform.

Kernel configuration and filesystem requirements

The kernel needs the following configuration options set:

CONFIG_BLK_DEV_INITRD=y

The kernel command line options and initramfs address/size is set by the boot code and passed to the kernel via the ATAG list. The boot code expects a kernel image with 64 bytes U-Boot header ( uImage).

The filesystem needs to be in a .cpio.gz format and have a /init link pointing to /sbin/init (or the preferred init application). A compressed cpio archive can be created as below (as root or under a fakeroot environment):

cd <filesystem-root>
find . | cpio --quiet -H newc -o | gzip -9 -n > ../filesystem.cpio.gz

Building the ELF model image

Copy the following files (attached) to a local directory:

  • Makefile - builds the ELF model image
  • boot.S - simple code to initialise registers and UART0 before branching into the ARM Linux kernel
  • model.lds - linker script used to generate the ELF model image
Copy the uImage kernel and filesystem.cpio.gz files into the directory created above and the make command will build a linux-image.axf file that can be loaded into the model and executed.

Example for a RealView/EB model

The following steps generate a linux-system.axf file that can be loaded into the model as a normal application:

  1. Download the Makefile, boot.S and model.lds files attached to this page
  2. Download the pre-built kernel image and rename it uImage
  3. Download the filesystem in cpio format and rename it filesystem.cpio.gz
  4. Type make
The sources and configuration files for the above images are available from the ARM Ltd. Linux repository or the main ARM Ltd. Linux page.

-- CatalinMarinas - 03 Dec 2009

Topic attachments
I Attachment Action Size Date Who Comment
elseEXT Makefile manage 0.4 K 02 Dec 2009 - 17:57 CatalinMarinas  
elseS boot.S manage 2.0 K 03 Dec 2009 - 16:43 CatalinMarinas  
elselds model.lds manage 1.2 K 03 Dec 2009 - 16:42 CatalinMarinas  
Topic revision: r8 - 03 Dec 2009 - 16:43:15 - CatalinMarinas
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This page took 3.91 joules of energy to render (zen4 : 1.24 secs : 3 sessions : 0.79 amps) More Info