Embedded Linux in a Nutshell

Marcel Ziswiler Noser Engineering AG

1

1

Contents Contents ●

Development Environment



Boot Loader



Embedded Linux Kernel



Root File System



Real-World Experience

Development Environment

Boot Loader

Embedded Linux Kernel

Root File System

Real-World Experience

2

2

Development Environment

Difference between development vs. final deployment? How to setup DHCP, TFTP and NFS server? What about a serial terminal console? How to cross compile? Security?

3

Development vs. Product Deployment Contents ●

Development Environment

Boot Loader

Embedded Linux Kernel ●

Root File System

Real-World Experience

Product Deployment ● Most embedded systems need to be self-contained ● Operate from internal flash storage to avoid moving parts (HDs) ● Update requires lengthy download - flash - re-boot procedure ● Dynamic data kept on volatile RAM file system Development ● Direct network connection to development workstation ● Linux kernel (and boot loader update) downloaded via TFTP ● Root file system mounted via NFS ● Allows for quick development cycle

4

Network Setup Contents ●

Convenient use of protocols for automatic network configuration



Avoid messing with company network infrastructure

Development Environment

Boot Loader ●

Embedded Linux Kernel ●

Root File System

Real-World Experience

Separate physical network connection ● Embedded target - development workstation Plug-and-play USB network adapter ● No need to open PC to plug in secondary network card ● Drivers readily available in mainstream Linux distributions

5

Network Setup (cont.) Contents ●

host target {         filename                "uImage";         fixed­address           192.168.1.2;         hardware ethernet       ;         next­server             192.168.1.1;         option host­name        "colibri";         option root­path        "/home/colibri/rootfs"; }

Development Environment

Boot Loader

Embedded Linux Kernel

Root File System

DHCP server provides complete development configuration



Real-World Experience ●

TFTP server transfers images to target ● Embedded Linux kernel ● Boot loader update NFS server serves development root file system to target ● Directory on development host exported as target root ● Cross compiled binaries immediately available for execution 6

Target Console via Serial Terminal Contents

Target console as a simple means for early debugging ● Boot loader and Linux kernel output their progress



Development Environment

Boot Loader

Embedded Linux Kernel

Root File System

Real-World Experience

UARTs available on most embedded controllers/processors



Simple and cheap hardware ● Level shifters optionally on special debug adapter ● No need to populate Connectors/headers on production boards



Serial ports still readily available on Pcs/notebooks ● Use USB to serial adapter on legacy free PCs/notebooks



Simple terminal application minicom ● -c on and -w parameters to enabe color and line wrap modes



7

Cross Compiler Toolchain Contents

Cross compiler allows building executables for target architecture



Development Environment

Cumbersome to build your own toolchain ● What version of gcc, Glibc or rather uClibc? ● Patches required for my platform?



Boot Loader

Embedded Linux Kernel ●

Root File System

Real-World Experience

Third party or pre-built toolchains simplify your life ● Careful they are mostly laid out to be installed at a specific location

Target architecture selectable by environment variables



● ●

ARCH= CROSS_COMPILE=

or directly on the command-line via ●

make ARCH= CROSS_COMPILE= /bin/busybox

Real-World Experience

27

Configure & Build BusyBox Contents

Download source from busybox.net



Development Environment

Extract and optionally patch source



Boot Loader



tar xjvf busybox­1.12.0.tar.bz2; cd busybox­1.12.0



patch ­p1