Вы находитесь на странице: 1из 7

Running Linux on ARM

Development Platforms
January 2007
Abstract
This document describes stages to set-up and run Linux on ARM
based platforms from installing a boot loader !ernel and file
system image" This document is not intended as an exhausti#e
guide on de#eloping or building Linux system" There is already
considerable information a#ailable in the open source community
for this" $pen source discussion forums also pro#ide a #aluable
source of information" %lease refer to the ARM Linux &i!i site
'((("linux-arm"org) or ((("arm"com*linux for additional
information"
+opyright , 2007 ARM Ltd"
- - -
./012
1. INSTALLING PRE-BUILT IMAGES ........................................................................................................................ 3
2. BOOT LOADER ........................................................................................................................................................... 3
3. LINUX KERNEL ........................................................................................................................................................... 4
4. FILESYSTEM ................................................................................................................................................................ 5
5. COMPILATION TOOLS ............................................................................................................................................. 5
3"-" +R$44-+$M%.LAT.$/ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 3
3"2" A5. +$M%AT.5.L.T6 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 7
6. CLINUX ..................................................................................................................................................................... 6
7. ADDITIONAL NOTES ................................................................................................................................................ 6
+opyright , 2007 ARM Ltd"
- 2 -
1. Installing pre-built images
.mages can be installed into flash using a debugger connected to the board #ia a JTA8 run control
de#ice such ARM Real9ie( .+1 units"
ARM RealView Integrator boards: use ARM ;lash <tility 'pro#ided (ith the board) to program
images 'e"g" A;<"axf) running the utility from the debugger:
AFU> program 1 u-boot c:/tmp/u-boot.bin
Lowest available flash at location 0!"""0000 bloc# $%0
&rogramming $loc# $%0
...
ARM RealView Versatile/(PB, AB)926EJ-: run the 5ootMonitor"axf program supplied (ith the
board from the debugger to program images" There is a ;lash menu (ith some options to
program 1L; or binary images" To run from flash you should program the 1L; image into flash
as:
FLA'(> write image c:/tmp/u-boot.af )A*+ u-boot
An additional flash programming utility is pro#ided (ith Real9ie( 9ersatile boards called
=/et(or! ;lash <tility> '/;<)" This program enables programming of images into flash using an
1thernet connection" To do(nload and program a <-5oot image into flash from a ser#er (ith .%
address ?-@2"-7A"0"-B for example you can use the follo(ing seCuence:
manage ,hcpc start
manage map n: 1-!.1./.0.1
flash write image n:/u-boot.af
%lease refer to the documentation of your Real9ie( 9ersatile ;amily +0 for more information and
the exact syntax"
A similar process can be used to program other images '!ernel and cramfs) into ;lash" These should
be programmed as binary files as they are not 1L; images"
;or more information please refer to the ;irm(are documentation supplied (ith the board"
2. Boot Loader
<-5oot is used as boot loader for Real9ie( .ntegrator and 9ersatile platforms" The source code and
documentation are a#ailable at the follo(ing location: http:**sourceforge"net*proDects*u-boot*
<-5oot is expected to run from 0x0-000000 in memory on ARM boards" The supplied images can
be loaded and run from a debugger at this address"
RealView Integrator! ra( binaries 'or 1L; files) can be placed at the beginning of flash and
executed as default image"
RealView Versatile! you should use the 1L; file to execute directly from flash or load and run
the ra( binary from memory"
To compile <-5oot do(nload source distribution from the abo#e site" Real9ie( .ntegrator and
9ersatile support has been added in <-5oot +94*8.T repository" Additional patches may ha#e
been submitted at the time of (riting this document if any these should ha#e been posted on the
public mailing list 'source code is a#ailable from http:**((("arm"com*linux*linuxEdo(nload"html)"
$nce you ha#e unpac!ed*retrie#ed the sources you need to configure and build the boot loader"
6ou can consult the full list of targets from the top Ma"e#ile" To configure and compile the boot
loader you should execute the follo(ing commands:
+opyright , 2007 ARM Ltd"
- F -
RealView Integrator/$P:
ma!e integratorcpEconfig
ma!e
RealView Versatile:
ma!e #ersatileabEconfig
ma!e
Resulting executables 'binary and 1L;) are located in the top le#el directory" 4ome macros are used
to encode default command line passed to a Linux !ernel default boot seCuence of the boot loader
'i"e" d%&'*boot' flash etc")" 4ome of these definitions can be changed interacti#ely from the <-5oot
command line using the set command"
%arameters used for ARM Real9ie( 9ersatile board can be found in the respecti#e configuration
file in the in&l(de/&on#igs directory (ith macro definitions such as +$/;.8E+$MMA/04
+$/;.8E5$$TAR84 and +$/;.8E5$$T+$MMA/0"
The Linux !ernel is usually loaded at the address specified by +;8EL$A0EA00R '0x7c0) and
then executed from 0xA000 for an uncompressed Linux !ernel image" These parameters are
specified by the u-boot )"i)age utility (hen con#erting a ra( Linux !ernel binary image to be
loaded by u-boot" The )"i)age utility is built (hen compiling u-boot"
*ote t%at w%en downloading a "ernel i)age +ia Et%ernet, ,o( s%o(ld &on#ig(re ,o(r ser+er to
re&ognise t%e MA$ address o# ,o(r 'lat#or) and t%e lo&ation o# t%e i)age to download-
B!"#$ %&' "'($)* "# %+(*,
&hen adding the u-boot header to the Linux !ernel binary image ensure that the load and execute
addresses are both set to 0xA000" The boot command should be:
.ntegrator+% G cp 0x?!ernelEaddressEinEflashB 0x7fc0 0x?.mageEsiHeEinE(ordsB
.ntegrator+% G bootm
6ou can also use the =%el'> command (ith <-5oot to see the exact syntax of each command"
T,) -''(#. +"#)
The Linux !ernel $M./I*E can be set from the <-5oot prompt using the =set> command" The
='rinten+> command can be used to list the current en#ironment #ariables" &hen executing the
Linux !ernel from a boot loader the !ernel (ill use the command line (hich is pointed at by ?r01
instead of any default built-in command line"
The images pro#ided allo( you to sa#e the en#ironment into ;lash memory" This can be done using
the sa+een+ command"
The <-5oot images a#ailable for do(nload at http:**((("arm"com*linux contain the command line
used (ith the supplied <-5oot !ernel and filesystem images sa#ed into flash in that order starting
at the bottom of flash"
+opyright , 2007 ARM Ltd"
- I -
.Linux !ernel
4ources of the !ernel can be obtained and do(nloaded from ((("!ernel"org" Any additional patch
should be applied to the base !ernel source tree as follo(s:
J cd linux-2"7"-@*
J patch Kp - ? patch-2"7"-@-2re+ision1
+onfiguration files are pro#ided for each platform and pre-built images" The rele#ant configuration
file should be copied into the !ernel tree as -&on#ig, the !ernel can then be configured running
=)a"e 3&on#ig> or eCui#alent commands 'L)a"e )en(&on#igL etc")" The follo(ing seCuence of
commands can be used to build the !ernel:
J ma!e xconfig
J ma!e .mage produces a ra( binary .mage in arch*arm*boot*
A +)lin(3 file is also generated (hich contains debugging information associated to the !ernel
image (hich can be loaded by a debugger 'assuming the !ernel is compiled (ith L-gL flag)"
The boot loader also determines the platform identification" This information is stored in register
?r01" The platform number is needed by the !ernel before starting its execution" &hen starting the
!ernel directly from a debugger this register #alue needs to be set from (ithin the debugger"
".#iles$stem
%re-built filesystem images pro#ided on this page can be use (ith ARM Real9ie( .ntegrator and
9ersatile platforms" The platform type is detected at run-time (ith a script to create a symbolic lin!
to the appropriate serial de#ice '/de+/tt,M)"
These images contain a subset of system utilities commands and applications" To configure a
compressed filesystem image the ARME1mbeddedELinuxE2"F"0"tar"gH file needs to be unpac!ed"
The build instructions pro#ided in the top-le#el R1A0M1 file list the #arious steps needed to
generate a compressed filesystem image" A copy of the source of pac!ages used to produce
applications used in this file system 'e"g" cramfs) is a#ailable in source format from ARM upon
reCuest 'contacting ARM support)"
The filesystem can either be mounted #ia /;4 or placed into ;lash depending on the platform
settings and the command line passed to the !ernel at boot time" .n any case the location of the
filesystem should be specified in the !ernel command line by the Nroot 45O option either
root4/de+/)tdblo&"
i
or root4/de+/n#s (here i is to be replaced by the appropriate partition number"
$n Real9ie( 9ersatile platform the )td'art option needs to be defined to indicate (here images
are located in flash" This is documented in the !ernel dri+er/)td/ sources and an example is in the
configuration file associated (ith the Real9ie( 9ersatile binary image"
%.&ompilation 'ools
%.1.&ross-(ompilation
An ARM cross-compilation tool chain need to be installed on the host system to produce Linux
!ernels or applications" 5y default this document assumes a Linux based host de#elopment
platform"
+opyright , 2007 ARM Ltd"
- 3 -
/ote that the pre-compiled tool chain (hich is a#ailable for do(nload assumes that you ha#e a
#ersion of 8libc library P 2"F installed on your system"
%erform the follo(ing steps as root to unpac! and install the pre-built tool chain on your system:
J m!dir *usr*local*arm*gnu*releaseI"-"-
J cd *usr*local*arm*gnu*releaseI"-"-
J tar x#fH sourcerygQQ-I"-"--arm-none-linux-gnueabi-i7A7-pc-linux-gnu"tar"gH
J ln Ks *usr*local*arm*gnu*release-I"-"- *usr*local*arm*gnu*release
4ources used to build the 8++ tools can be do(nloaded from ((("codesourcery"com or from the
main 8++ +94 repository" 0iscussion groups are also a#ailable on this site to discuss technical
issues related to ARM 8/< tools"
Multiple targets can be built for the compiler:
- ar)-el# produces a flat or standalone binaries (hich are not tied to any operating system"
arm-elf selects 1L; support (hich shares much of its code (ith arm-linux"
- ar)-none-lin(3-gn(eabi is the target you need for Linux and generates 1L; support for
Linux*ARM"
The pre-built tool chain is produced using the arm-linux option and is produced against 2"F"7
#ersion of 8libc"
%.2. ABI (ompatibilit$
The #ersion of 8++ used (ith this release 'i"e" 8++ I"-) defaults to the ne( A5. for the ARM
Architecture" Linux !ernel #ersion 2"7"-@ can be configured to support both the ne( A5. for the
ARM Architecture and old A5." %ac!ages pro#ided (ith filesystem #ersion 2"2"0 (ere built for the
ne( A5. you should ensure that Linux !ernel is configured to support this #ersion of the A5.
'Rernel ;eatures:: +$/;.8EA1A5.)"
$lder #ersion of the A5. for the ARM Architecture can be used (ith Rernel ;eatures::
+$/;.8E$A5.E+$M%AT ho(e#er this should be used in conDunction (ith a file system (ith
binaries built for the old A5. 'i"e" A1L 2"-"0)"
This is particularly important (hen using data structures such as those passed through io&tl() calls
(here types and alignment must be exactly the same from the !ernel #ie( as from the user #ie("
An application note is a#ailable from ARM 4upport pages pro#iding more information on ho( to
use ARM Real9ie( +ompilation Tools (ith 8/< Tools" This document can be found at:
http:**((("arm"com*pdfs*A/-305E5uildingELinuxEApplicationsE(ithER9+T"Hip
). *&linux
This page pro#ides pre-built images of u+linux !ernels" The main repository and source of
information on u+linux is accessible at http:**((("uclinux"org and
http:**opensrc"sec"samsung"com* for the initial ARM port created by Syo! 4" +hoi" As of 2003
MM<less support for ARM has started to be merged into mainline !ernel and most of the
MM<less !ernel patches should be integrated into mainline !ernel"
The u+linux images a#ailable from this (eb page are generated using an 1A5. compliant tool
chain and the !ernel is compiled (ith the +$/;.8EA1A5. option enabled" So(e#er there is not
yet a full 1A5. compliance for u+linux 'i"e" shared libraries etc")" The file system image pro#ided
on this page is a collection of utilities and executables generated by the community (hich are not
+opyright , 2007 ARM Ltd"
- 7 -
compiled (ith the 1A5. option" The !ernel can handle both types of binaries assuming it has been
configured to do so"
u+linux uses a flat binary format for application binaries" This is a relati#ely simple format
intended to contain the minimum needed to load and execute binaries" A special lin!er script is
reCuired to prepare an 1L; file as (ell as a utility called el#2#lat" These are pro#ided (ith 8/<
tools a#ailable from the u+linux community"
+. Additional notes
/otes and Linux pac!ages pro#ided on this page are intended as starting point for e#aluation and
#alidation (ith ARM de#elopment platforms" %lease contact Linux distributors for complete Linux
distributions"
4ome additional discussion forums are also a#ailable on public (ebsites Linux !ernel mailing lists
and 8/< mailing lists" $ther communities such as ((("debian"org ((("openembedded"or g
((("handhelds"org and http:**((("celinuxforum"org* also pro#ide good resources (hich can be
used (ith ARM platforms"
+opyright , 2007 ARM Ltd"
- 7 -

Вам также может понравиться