17
1 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM Linux & GNU Philippe Robin June 2004 2 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Outline Open source model Architecture and platforms support Linux 2.4 kernel Linux 2.6 kernel GNU GCC tool chain Debugging Cooperation Linux resources

Arm Linux & Gcc

Embed Size (px)

Citation preview

Page 1: Arm Linux & Gcc

1THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux & GNUPhilippe Robin

June 2004

2THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Outline

Open source model

Architecture and platforms support

Linux 2.4 kernel

Linux 2.6 kernel

GNU GCC tool chain

Debugging

Cooperation

Linux resources

Page 2: Arm Linux & Gcc

3THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Architecture Evolution

ARMv4T – Thumb ISA® ISA

ARMv5TEJ – Jazelle® Java Acceleration

ARMv6 – SIMD Media ISA

ARMv6T2– Thumb-2 ISA

ARMv6Z– TrustZone™, IEM*

ARMv7

1995

2000

2002

ARMv5TE – DSP Instructions

1998

2003

2003

2004

4THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux and Architecture Support

V4V4 V5TEV5TE V5TEJV5TEJ V6V6 V7V7AR

M A

RC

HIT

EC

TU

RE

SA

RM

AR

CH

ITE

CT

UR

ES

Jazelle (option)Jazelle (option)

TrustZoneTrustZone

Intelligent Energy Controller (IEC)Intelligent Energy Controller (IEC)

Linux 2.4 kernelLinux 2.4 kernel

Linux 2.6 kernelLinux 2.6 kernel

Linux 2.7 kernelLinux 2.7 kernel

Lin

ux

Ker

nel

Lin

ux

Ker

nel

Preemtion, 0(1) scheduler, New Posix Thread Library (NPTL), Power Management etc…

Page 3: Arm Linux & Gcc

5THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Open Source Model

Open Source Repositorywww.kernel.org

Commercial Linux Providers

ARM Source TreeArchitecture & Platform

SupportARM Linux

Open Source Treehttp://www.arm.linux.org.uk

Other organisations-Embedded Linux Consortium-Embedix-CELF

Other Contributors:-Platforms (Zaurus, iPaq…)-Debian-Etc…

Gatekeepers

6THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM and Open Source Projects

ARM Contribute Architectural support to theLinux kernel and related GNU projects– For ARM cores and specific technology

• ARMv6, ARMv7...

– Promote standardization initiatives• New ARM ABI

Early contribution to promote adoption from the community– Cooperation with partners and gatekeepers

Promote active participation and contributions to the open source

Page 4: Arm Linux & Gcc

7THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Architectural Support

ARM uses Linux kernel internally to validate new ARM cores and technology– Used with simulation models, FPGA and Cores

Contribute architectural support to GNU GCC– Currently GCC is needed to compile kernel and

applications

– New ARM ABI will allow more choices and inter-operability between tool chains

8THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Development Platforms

Core Modules

Logic Modules

Compact Platform

Interface Modules

Logic Tile

Versatile Platform Baseboard

Integrator Family Versatile Family

Analyzer Tile

Page 5: Arm Linux & Gcc

9THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Cores and Platform Support

Currently Linux has support for:– ARM720T, ARM92x, ARM102x and

ARM11 cores

ARM development platforms

– ARM Integrator family

– Versatile board

BSP availability– ARM (early access)

– Open source (www.kernel.org)

• availability usually coincide with hardware availability

10THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux 2.4 kernel

Stable version

– Feature freeze

• Only bug fixes are now being integrated

Current 2.4.21 includes support for:

– ARM cores up to ARMv6

• Legacy mode, not optimised

– Integrator AP and CP

– Versatile PB

• Patch available from ARM

Page 6: Arm Linux & Gcc

11THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux 2.6 kernel

2.6.6 is the current development versionVersion 2.6.6 includes support for:

– ARM cores up to architecture v6 including:• ASIDS, • Atomic instructions, • physically tagged cache, • CPS instructions

– Integrator AP, CP and Versatile Platforms• Including the following Primecell peripherals:

Serial, Timers, Interrupt controller, KMI, Ethernet, VGA/LCD

Peripherals being added in 04Q2

– AACI, VIC, VFP9– MMC, RTC, I2C

USB (Transdimension), DoC (M-Systems)

12THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Hardware Floating Point

Need compiler support

– Now available in GCC 3.4

Linux kernel support currently being addedto 2.6 kernel

– Validated on Versatile platform using VFP9

Availability

– 2004Q2

Page 7: Arm Linux & Gcc

13THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux – SMP Support

Linux kernel already has SMP support for multiple architectures

Implications on development tool chain– Multi-threading (TLS)

– Debugging toolsARMv6 architecture + extensions– Physically indexed, physically tagged coherent data cache– Write allocation in Write-Back regions– 64-bit non-bus locking LDRDEX/STRDEX– Thread context registers– Weakly ordered memory model, with memory barriers and

sequential consistency for certain memory regionsInitial validation on modified ARM926EJ-S cores with Linux on ARM Integrator CP

– Need hardware support for cache coherency, synchronization

14THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux – MPCore Platform

Configurable ARMv6 architectural core– Implement between 1 and 4 processors– Provides up to 2600 DMIPS performance– Integral interrupt distribution and control unit

Flexible software support– Symmetric multiprocessing (SMP)

• OS dynamically shares task across multiple CPU• Coherent and consistent view of memory

– Asymmetric multiprocessing (AMP)• Programmer statically assigns tasks to CPU• Isolate tasks from each other

SoC system compatibility– AMBA AXI bus inter-connect– RealView® development tools– PrimeCell™ L220 L2 cache controller

Page 8: Arm Linux & Gcc

15THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Intelligent Energy Management (IEM)

Controlling run-time voltage reduces energy consumed from battery when maximum performance is not required.Reducing energy consumed, – Extends battery life or– Enables additional functionality for same battery– Reduces battery size for same functionality

Greater user benefits and/or lower mfg. costReducing frequency reduces average power consumption and associated heating– Can also help to reduce packaging costs

16THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux - IEM

Current prototype developed on Linux kernel– Used as technology demonstrator

– Complementary to other existing technologies such as Montavista Dynamic Power Management (DPM)

– Works along hardware components (IEC)

Participate to CELF Power Management Group– Define common kernel interface to power management

Availability – Mid-2004

IEM documentation– http://www.arm.com/products/CPUs/cpu-arch-IEM.html

Page 9: Arm Linux & Gcc

17THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Future Architectural Support

ARM1176JZ-S support

– Planned for 04Q3

Thumb2 support planned for 05Q4

ARMv7 (Tiger) scheduled for 2006

18THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM GNU Tools

Page 10: Arm Linux & Gcc

19THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM GNU Tools

Follow evolution of the ARM Architecture– Recently added ARMv6 support

Adoption of the new ARM ABI– Initial ARM ABI support for GCC end 2004– Inter-operability between tool chains

Publicly available– Bi-annual source and binary releases

• Snapshots and binary packages• Open source mailing lists

– Cooperation with www.codesourcery.com

20THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM GNU Tools

Currently support up to ARMv6 Architecture

– ARMv6 instructions (supported by compiler)

– Hardware VFP

– BE8 (new ARM ABI)

– ARM1176JZ-S CPU support

– ARMv6 interrupt instructions

Page 11: Arm Linux & Gcc

21THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM GNU Tools – Planned Work

Next release planned for 2004Q4– New ARM ABI support

• Enables interlink with ARM Compiler

2005 Q4– Thumb2 support

– CPU support for ARM1156T2(F)-S

2006 Q2– Tiger CPU support

22THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM GNU GCC

Adoption of the new ABI for the ARM Architecture– Better portability of binary code

– Allows greater interoperability between proprietary tool chains (RVCT, etc.)http://www.arm.com/products/DevTools/ABI.html

Open access of pre-built GNU binaries– Facilitate access to ARM development environment

– Enable early adoption of new architectural features

http://www.codesourcery.com

Page 12: Arm Linux & Gcc

23THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux and GNU roadmap

03/Q4 04/Q1 04/Q2 04/Q3 04/Q4 05/Q1 05/Q2 05/Q3 05/Q4 06/Q1 06/Q2 06/Q3 06/Q4

ARMv6 and VFP binutils support ABI v1.0

GCC roadmap

ARMv6 GCC support- VFP GCC support

Thumb 2 support ARMv7 supportABI v1.2

Linux 2.6.x roadmap

2.5.70 SMP (CP/CM916)2.6 kernel (ARMv6, Integrator CP, AP)

2.5.70 kernel- ARMv6 (ASIDS, CPS,

LDREX/STREX, Cache)Thumb2 ARMv7

ARM1136 SMP

2.6 kernel:- Versatile PB926 + VFP- ARMv6

IEM, TrustZone

GCC / ARM ABI

24THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux - Debugging

Architectural support added for new cores– Currently ARMv6 support

GDB Multi-thread debug– Ensure working debug functionality in GDB

for multi-threaded applications

ARM RealView Linux Debug– Debug Linux kernels using ARM RealView

Debugger– HSD for kernel and loadable modules– Plan for RSD with running kernels

Page 13: Arm Linux & Gcc

25THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Cooperation

Commercial Linux distributions– Montavista (http://www.mvista.com/)

– Metrowerks (http://www.metrowerks.com)

– LynuxWorks (http://www.lynuxworks.com/)

– Lineo (http://www.lineo.co.jp)

– …

Consumer Electronic Linux Forum (CELF)– ARM is Associate Member– Participate to Working Groups to improve

ARM/Linux support for Embedded platforms

26THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux – Building Blocks

Compilation tool chain

Boot Loader

Kernel distribution and patches

Filesystem and applications

Debug and Validation tools

Additional links

Page 14: Arm Linux & Gcc

27THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

ARM Linux – Tool Chain

arm-linux build of the GNU compiler– Cross-compilation from Unix (Linux or Solaris) or

Windows host

– Snapshots available at http://www.codesourcery.com/

Choice of C library – Glibc – standard GNU C library

– uCLibc• http://www.uclibc.org

– Newlib – smaller library• http://sources.redhat.com/newlib/

– Decide on which library to use when building the cross compilation tool chain

28THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux - Boot Loader

Needed to initialise platform, – Load and run the Linux kernel

• Can download kernel using tftp/bootp

• Access from flash if kernel resides in Flash

– Setup various initialisation parameters:• command line: root=/dev/nfs ….

• Platform ID (stored in r1)

Available boot loaders for ARM platforms:– U-Boot (http://sourceforge.net/projects/u-boot)

– RedBoot (http://www.ecoscentric.com/ecos/redboot.shtml)

Page 15: Arm Linux & Gcc

29THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Building Linux Kernels

Download reference kernel– http://www.kernel.org

Download and apply associated ARM patch– http://www.arm.linux.org.uk/developer/– This is applied on unpacked base kernel– Add additional patches as appropriate

Configure the kernel (make xconfig)– Choose architecture, development platform, devices and

functionality needed

Build the kernel– Ensure the right link is set in main Makefile to point at the

cross compiler location

30THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Running Linux kernels

Built image is in arch/arm/boot directory

Loading and running the image on the target:– Use BootLoader

• Either via network (tftp/bootp) or from flash

– Use Debugger• Load image as raw binary

(i.e. @0x8000 for uncompressed Image)

• Set platform ID in r1 and initialise r0, r2

• Disable semihosting and vector catch

• Set pc=0x8000 and run the kernel

Page 16: Arm Linux & Gcc

31THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux Filesystem

Contains system utilities and applications– Busybox for base utilities (http://www.busybox.net/)

– Need C library – either Glibc or Newlib– Additional utilities such as:

• Sysvinit, shells, ftpd, telnet…

– Graphical windowing system and applications:• X11 environment: http://www.xfree86.org/

• Microwindows: http://www.microwindows.org/

• Qt/Qtopia: http://www.trolltech.com

Access from Flash or via NFS– From Flash can use cramfs, romfs…

32THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Linux – Debugging

Kernel debug– With JTAG connection use commercial debugger for early

kernel bring up– Use Kgdb to debug kernel– Commercial debuggers offer additional features to debug

and profile the Linux kernel:• Choice of halted/running system debug• Profiling

Application debug– Use GDB over serial or networking link

• Either natively or in cross-debug environment• Choice over graphical front-end used

– Use commercial debuggers for debugging over JTAG

Page 17: Arm Linux & Gcc

33THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

Additional open source links

Gnu Debugger - http://www.gnu.org/software/gdb/gdb.html

Linux Test Project - http://ltp.sourceforge.net/

– Test coverage of the kernel

Linux Trace Toolkit - http://www.opersys.com/LTT/

– Acquire and display kernel trace information

Guide to porting Linux on new ARM hardware– http://vega.soi.city.ac.uk/~es728/pdf/aleph.pdf

Guide to building Linux system from scratch– http://www.opersys.com/quickref.html

Other useful resources– http://www.debian.org– http://www.handhelds.org/