Introduction to embedded Linux
Florent Gluck - Florent.Gluck@hesge.ch
September 19, 2024
*
Merci à la société Bootlin (https://bootlin.com) d’où provient une grande partie de ces slides.
1/37
Embedded Linux
Embedded Linux?
2/37
Rationale
Why Linux as an embedded system?
3/37
Aspencore 2023 Embedded Survey (1/4)
Source: Aspencore 2023 Embedded Survey
4/37
Aspencore 2023 Embedded Survey (2/4)
Source: Aspencore 2023 Embedded Survey
5/37
Aspencore 2023 Embedded Survey (3/4)
Source: Aspencore 2023 Embedded Survey
6/37
Aspencore 2023 Embedded Survey (4/4)
Source: Aspencore 2023 Embedded Survey
7/37
Supercomputers Linux market shares
Source: https://www.top500.org/
8/37
Servers operating system shares 2023
Source: https://www.fortunebusinessinsights.com
9/37
Automotive global operating system shares
10/37
Motivation
• Low cost.
• Open-source ecosystem provides many components for standard
features: hardware support, network protocols, multimedia, graphic,
cryptographic libraries, etc.
• As soon as hardware device, protocol, or feature is widespread
enough → high chances of open-source components supporting it.
• Allows to quickly design and develop products, based on existing
components.
• No need to re-develop another kernel, TCP/IP stack, USB stack or
graphical toolkit library.
• Instead: allows focusing on the added value of the product.
11/37
Low cost
• Free software can be duplicated on as many devices as needed,
free of charge.
• If only free software is used → cost of software licenses is zero.
• Development tools are also free, unless one chooses a
commercial embedded Linux edition.
• Net result = higher budget for hardware and/or increase the
company’s skills and knowledge.
12/37
Open-source software
• Open-source: source code for all components in the system!
• Allow unlimited modifications, changes, tuning, debugging,
optimization, for an unlimited period of time.
• Without lock-in or dependency from a third-party vendor.
• To remain true, non open-source components must be avoided
when designing and developing the system.
• Allow full control over the software part of the system.
13/37
Quality of open-source software
• Many open-source components are widely used, on millions of
systems.
• Usually higher quality than what an in-house development can
produce, or even proprietary vendors.
• Of course, not all open-source components are of good quality,
but most of the widely-used ones are.
• Allows to design a system with high-quality core components.
• Open-source being freely available → easy to get a piece of
software and evaluate it.
14/37
Community support
• Open-source software components are developed by communities of
developers and users.
• Usually easier to find solution on the web than with proprietary
components.
• Community can provide high-quality support: can directly contact
the main developers.
• Often better than traditional support, but one needs to understand
how the community works to properly use the community support.
• Speed up in problems’ resolution when developing the system.
15/37
Involvement in the community
• Possibility to take part in the development of components: bug
reporting, testing, bug fixes, development, etc.
• Motivation:
• For engineers: way to get recognition outside the company,
communication with others in the field, new opportunities, etc.
• For managers: motivation factor for engineers, allows companies
to be recognized in the open-source community → get support
more easily.
• Potential job opportunities!
16/37
Embedded Linux use cases
Embedded Linux used in many fields and industries. . .
17/37
Internet of Things
18/37
Automotive
19/37
Space
20/37
Domotics
21/37
Cashier registers (1/2)
22/37
Cashier registers (2/2)
23/37
Point of sale terminal
24/37
Routers (Open-WRT)
25/37
Electronics appliances
26/37
Home appliances
27/37
Industrial automation
28/37
Agriculture machine
29/37
Embedded hardware for Linux
systems
Processor and architecture (1/2)
Linux kernel supports a wide range of 32 and 64 bits architectures:
• x86 and x86-64 (PC but also embedded: multimedia, industrial)
• ARM, with hundreds of different SoC (multimedia, industrial)
• PowerPC (real-time, industrial applications)
• MIPS (networking applications)
• SuperH (TV boxes, multimedia applications)
• Blackfin (DSP architecture)
• Microblaze (soft-core for Xilinx FPGA)
• Coldfire, SCore, Tile, Xtensa, Cris, FRV, AVR32, M32R
30/37
Processor and architecture (2/2)
• Both MMU and non-MMU architectures are supported (w/o
memory protection for non-MMU arch).
• Possible to compile Linux without MMU support on
architectures featuring an MMU (eg. x86).
• Linux is not designed for small microcontrollers.
• Besides the toolchain, the bootloader and the kernel, all other
components are generally architecture-independent.
31/37
RAM + storage requirements
• RAM
• Very basic system: 8MB!
• More realistically: ≥ 32 MB of RAM (use-case dependent)
• Storage
• Very basic system: 4MB storage!
• Support for RAW flash storage (NAND & NOR)
• Support for block flash storage (SD/MMC, eMMC, etc.)
• Not necessarily worth it to be too restrictive: more
RAM/storage allows to re-use existing components.
32/37
How to choose the hardware?
• Make sure the hardware is supported by the Linux kernel and the
bootloader (typically U-Boot).
• Support in the projects’ (kernel, bootloader) official versions is a lot
better: better quality, and availability of new versions.
• Some vendors do not contribute their changes back to the mainline
Linux kernel. A good metric is the “delta” between their kernel and
the official one.
• Huge difference in dev time and cost between a properly supported
hardware in the official Linux kernel and a poorly supported one.
33/37
Embedded Linux system
architecture
Global architecture
34/37
Software components
• Cross-compilation toolchain
• Compiler that runs on the development machine but generates
code for the target.
• Bootloader
• Initiated by the hardware, performs basic initialization, loads
and executes the kernel.
• Linux kernel
• Handles hardware, memory and process management. Provides
services to user space applications.
• C library
• Interface between kernel and user space applications.
• Libraries and applications
• User applications and libraries running on top of the C library.
35/37
Board Support Package (BSP)
Collection of software used to boot and run the hardware
platform
• The BSP provides:
• low level bootloader (1st stage bootloader)
• bootloader (2nd stage bootloader)
• operating system and drivers for the specific hardware
• minimal set of software needed for user interactions and
communication
• For evaluation boards, manufacturers often provide a
Linux-based BSP
36/37
37/37