-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Every embedded Linux system consists in four major components:
- Toolchain, which doesn’t run on the target platform, but allows to generate code for the target from a development machine.
- Bootloader, which is responsible for the initial boot process of the system, and for loading the kernel into memory
- Linux Kernel, with all the device drivers
- Root filesystem, which contains all the applications and libraries
Development PC must be running Linux OS, therefore in Windows OS we need use virtual machine.
The toolchain is usually a cross-compilation toolchain, which runs on a development machine and generates code for the embedded platform. It has the following components:
- binutils, the binary manipulation utility including an assembler and a linker
- gcc, the C/C++ (and more) compiler, which is the standard in the open-source world
- C library, which offers the POSIX interface to userspace applications. Several C libraries are available: glibc, eglibc and uClibc, with different size/features.
- gdb, the debugger, which allows remote debugging
- Debian, Ubuntu and other Linux distributions embedded cross-toolchain (the easiest solution for usage)
- Linaro provides monthly GCC source archive snapshots of the current Linaro GCC release branch, as well as quarterly releases of pre-built Linaro GNU cross-toolchain binary archives.
- Crosstool-NG is a tool that automates the process of generating the toolchain. Allows more flexibility than pre-compiled toolchains.
- Buildroot, PTXdist, Yocto, ...
Main role of the bootloader is to initialize some basic hardware peripherals, load the Linux kernel image and run it. For embedded systems today exist two open-source projects:
- U-Boot is the de-facto standard in open-source bootloaders. Available on ARM, PowerPC, MIPS, m68k, Microblaze, x86, NIOS, SuperH, Sparc. Huge hardware support available, large number of features (networking, USB, SD, etc.)
- BareBox is a newer open-source bootloader, with a cleaner design than U-Boot, but less hardware support at the moment
The Linux kernel is a core piece of the embedded system.
- Manage all the hardware resources: CPU, memory, I/O.
- Provide a set of portable, architecture and hardware independent APIs to allow user space applications and libraries to use the hardware resources.
- Handle concurrent accesses and usage of hardware resources from different applications. Example: a single network interface is used by multiple user space applications through various network connections. The kernel is responsible to multiplex the hardware resource.
In a Linux system, applications, libraries, configurations and data are stored into files in a filesystem called as rootfs. The rootfs directory structure is defined by Filesystem Hierarchy Standard (FHS) and is common for most Unix-like operating systems. The content of rootfs is specific for every Linux distribution. Many of big Linux distributions like: Debian, Ubuntu, Fedora and Arch Linux already have a port for ARM platform. For most embedded systems are this distributions still too heavy and complex, but they are usable for rapid development and prototyping. Today exist more projects for autonomous generating a custom and lightweight Linux distributions and this are targeted to final production.
- Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation.
- PTXdist is a GPL licensed build system for userlands, started by Pengutronix. It uses the Kconfig configuration system from the Linux kernel.
- Yocto Project is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture
Embedded Linux wiki, Martin Olejar