Table of Contents
Embedded linux components
- Toolchain
- Boot loader
- kernel
- user space
Embedded linux tools
U-Boot - GPL boot loader
uClibc is a small C standard library intended for embedded linux systems that was created to support uClinux, a version of linux that does not require an MMU. Currently, the kernel codebases for uClinux and linux are the same, having just different configurations (since the 2.6 Linux release). It is now supported by MontaVista, TimeSys and Windriver. A native uClibc toolchain can be built using the uClibc buildroot-based system (see http://free-electrons.com/docs/uclinux/).
Busybox is a userland software running on top of the linux kernel, that provides the usual set of Unix tools (sh, ls….). Its size is less than 500KB when compiled statically with uClibc.
A cross-compiling toolchain for a specific architecture, like PowerPC or ARM, contains the following components:
- GCC compiler
- C libraries - glibc (1.7MB on ARM), uClibc (400kB on ARM), eglibc, dietlibc, newlibc, etc. It should be chosen at the toolchain generation time, as the GCC compiler has been compiled against a specific C library
- an assembler
- a linker/loader
- associated binary utilities, binutils, which includes e.g. objdump and readelf
- kernel header files (required for compilation of the C library as well as many applications)
- a debugger, like gdb (equivalent to dbx in UNIX) (an useful tutorial is http://dirac.org/linux/gdb/)
- trace tools like strace/ltrace
libgcc is a low-level runtime library used by gcc-compiled code, e.g. to support complex arithmetic operations
Cross-compiling toolchains
- Code Sourcery G++, which includes their modified GNU C and C++ compilers and the Eclipse IDE framework
- Free Electrons
- CrossWorks for ARM (using the GNU gcc compiler)
- SnapGear (using the GNU gcc compiler)
- Emdebian is Debian for embedded devices, providing different architectures:
- arm, using old ABI, by default generates armv5t code, retired in favour of armel.
- armel, new ARM EABI Little-endian, doesn't require an fpu, by default generates code for armv4t code.
- armhf, makes use of fpu, needs at least ARMv7 CPU with Thumb-2. In practice armel will be used for older CPUs (armv4t, armv5, armv6), and armhf for newer CPUs (armv7+VFP).
- (see also http://elinux.org/Toolchains)
Other third party development tools (with their own compilers):
- ARM RealView Development Suite, RVDS4 (RVCT tools, including armcc, the ARM compiler), succesor of the ARM Developer Suite (ADS)
- Green Hills MULTI Integrated Development Environment
- IAR Embedded Workbench for ARM
- Keil Development Studio 5 (DS-5), using a modified GNU gcc compiler
- Keil uVision (mdk-arm), supporting full simulation on the host computer
We can build our own toolchain instead of using a third-party one, using tools like these:
- Buildroot is a set of Makefiles and patches that make it easy to generate a cross-compilation toolchain and root filesystem for your target Linux system using the uClibc C library. Some instructions here. See http://autobuild.buildroot.org/.
- PTXDist is a tool to create a Linux root filesystem (kernel, scripts, programs and libraries) for small/embedded computer systems. PTXDist provides a defined and repeatable way of building toolchains and root filesystems, consisting of open-source packages and user applications/libraries. In contrast to tools like OpenWrt or Buildroot, its principal library is glibc and not one of its lightweight counterparts like uclibc or dietlibc.
- Open Embedded is a software framework to create Linux distributions aimed at embedded devices.
- Buildcross, used by emdebian
The above tools also build the needed root filesystem, which can also be built manually with Scratchbox (used by Nokia for its internet tablets).
Workstation emulators
Qemu (supports x86, x86_64, ppc, arm, sparc, mips, m68k). User mode emulation on linux hosts (can run applications compiled for another CPU, e.g. we can run busybox compiled for ARM on a i386 linux host).
ARM-specific emulators:
Flash utilities
- Flash Magic (Windows)
- lpc21isp
Debugging
- OpenOCD
- gdb/ddd
Embedded linux distributions
- Yocto is not a distribution per se, but provides templates and tools to create custom distributions. It uses Open Embedded.
- Angstrom, using also the Open Embedded framework.
ELC2010
ELC2011
Interesting links
podcast on embedded linux:
http://www.timesys.com/resources/podcast
good embedded linux documents
http://free-electrons.com/docs