SEMICON Solutions
Embedded Linux Fundamental
18/07/2016
Agenda
Embedded Linux architecture
Development environment
Cross-compiling toolchains
Bootloader
Embedded Linux architecture
Global architecture
Software components
Cross-compilation toolchain
Compiler that runs on the development machine, but generates
code for the target
Bootloader
Started by the hardware, responsible for basic initialization,
loading and executing the kernel
Linux kernel
Contains the process and memory management, network stack,
device drivers and provides services to user space applications
C library
The interface between the kernel and the user space applications
Libraries and applications
Third-party or in-house
Embedded Linux work
Board Support Package (BSP) development
A BSP contains a bootloader and kernel with the
suitable device drivers for the targeted hardware
System integration
Integrate all the components, bootloader, kernel, third-
party libraries and applications and in-house
applications into a working system
Development of applications
Normal Linux applications, but using specifically
chosen libraries
OS for Linux development
Recommend to use Linux as the desktop OS to
embedded Linux developers.
As Linux also runs on the embedded device, all the
knowledge will apply similarly to the embedded
device.
Linux is a multi-user operating system.
Host vs. target
The host, the development workstation, which is typically a powerful
PC
The target, which is the embedded system under development
They are connected by various means:
Serial line for debugging purposes
Ethernet connection
JTAG interface for low-level debugging
Cross-compiling toolchains
Definition
Different toolchain build procedures
Components
Bootloader
Bootloaders
The bootloader is a piece of code responsible for
Basic hardware initialization
Loading of an application binary
Possibly decompression of the application binary
Execute of the application
Provide a shell with various commands:
Loading of data from storage or network, memory inspection,
hardware diagnostic, etc.
Booting process
Booting on embedded CPUs: case 1
The CPU starts executing code at a fixed
address when powered.
There is no other booting mechanism
provided by the CPU
The first stage bootloader must be
programmed at this address in NOR
NOR is mandatory, because it allows
random access, which NAND doesn’t allow
Not very common anymore (unpractical,
and requires NOR flash)
Booting on embedded CPUs: case 2
The CPU has an integrated boot code in ROM
This boot code is able to load at first stage
bootloader from a storage device into an internal
SRAM
The first stage bootloader must initialize DRAM
and other hardware devices and load a second
stage bootloader into RAM
Loading through U-boot example
Boot device S5PV210
• General NAND Flash memory
• OneNAND memory
• SD/ MMC memory
• eMMC memory
• eSSD memory
• UART and USB devices
Boot sequence
① iROM can do initial boot up : initialize
system clock, device specific controller and
booting device.
② iROM boot codes can load boot-loader to
SRAM. The boot-loader is called BL1. Then
iROM verify integrity of BL1 in case of secure
boot mode.
③ BL1 will be executed: BL1 will load
remained boot loader which is called BL2 on
the SRAM then BL1 verify integrity of BL2 in
case of secure boot mode.
④ BL2 will be executed : BL2 initialize
DRAM controller then load OS data to
SDRAM.
⑤ Finally, jump to start address of OS. That
will make good environment to use system.
Q&A