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.Includes running SMP kernels.

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.gzformat and have a /initlink 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 
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 uImagekernel and filesystem.cpio.gzfiles into the directory created above and the makecommand will build a linux-image.axffile that can be loaded into the model and executed.

Example for a RealView/EB model

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

  1. Download the Makefile, boot.Sand model.ldsfiles 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
IAttachmentActionSizeDateWhoComment
elseEXTMakefilemanage0.4 K02 Dec 2009 - 17:57CatalinMarinas 
elseSboot.Smanage2.0 K03 Dec 2009 - 16:43CatalinMarinas 
elseldsmodel.ldsmanage1.2 K03 Dec 2009 - 16:42CatalinMarinas 

This topic: LinuxReference > RunningOnModel
Topic revision: r9 - 25 Mar 2010 - 10:22:16 - PeterPearse
 
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
zenweb1 : 0.05 secs More Info