1. Embedded Linux Training
Facebook group: Learn To Be
Official website: www.L2b-egypt.org
Prepared By: SHATRIX
E-Mail: eng.shatrix@gmail.com
Learn To Be Embedded Linux Training
2. 2
Overview
• Embedded Linux is the use of Linux in embedded
computer systems such as mobile phones, personal
digital assistants, media players, set-top boxes,
networking equipment, machine control, industrial
automation, navigation equipment and medical
instruments.
• Creating an Embedded Linux based system is like a
puzzle. Putting the right pieces together will create the
final image.
Learn To Be Embedded Linux Training
3. 3
Basic embedded Linux arch.
• Boot Loader (grub, Lilo, Uboot)
• Kernel (Normal or Real-Time)
• FileSystem
• C Library
• User application(s)
Learn To Be Embedded Linux Training
4. 4
Host & Target
Host Target
Croos-Platform BootLoader
Toolchain Kernel
Filesystem
GCC Libraries
Applications
Learn To Be Embedded Linux Training
5. 5
To Do List
• Cross-compilation toolchain
▫ Compiler that runs on the development machine, but generates
binary files for the target machine
• 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 userspace applications
• C library
▫ The interface between the kernel and the userspace applications
• Filesystem
▫ Contains Linux commands, libraries and other needed scripts
• Other libraries and applications
Learn To Be Embedded Linux Training
6. 6
What's next?
• System integration
▫ Integrate all the components, bootloader, kernel, third-
party libraries and applications and our applications into
a working system
• Development of applications
▫ Normal Linux applications, but using specifically chosen
libraries
Learn To Be Embedded Linux Training
7. 7
Root filesystem
• The root filesystem, is mounted as /
System Contents
• On embedded systems, this root
filesystem contains all the libraries,
applications and data of the system BootLoader
• Therefore, building the root
Kernel
filesystem is one of the main tasks
of integrating embedded Linux
Root
components into a device
Filesystem
• The kernel is usually kept separate
Learn To Be Embedded Linux Training
8. 8
Cross-compiling Toolchain
• The usual development tools available on a GNU/Linux
workstation is a native toolchain
• This toolchain runs on your workstation and generates
code for your workstation, usually x86
• For embedded system development, it is usually
impossible or not interesting to use a native toolchain
▫ The target is too restricted in terms of storage and/or
memory
▫ The target is very slow compared to your workstation
▫ You may not want to install all development tools on your
target.
• Therefore, cross-compiling toolchains are generally used.
They run on your workstation but generate code for your
Learn target.
To Be Embedded Linux Training
9. 9
Cross-compiling Toolchain
Source Code X86
Native Toolchain Cross Toolchain
X86 Binary Target Binary
X86 Target CPU
Learn To Be Embedded Linux Training
10. 10
Cross Toolchain components
• Binutils is a set of tools to generate and manipulate
binaries for a given CPU architecture
▫ as, ld, ar, ranlib, strip
▫ http://www.gnu.org/software/binutils/
• Kernel headers
▫ Available system calls and their numbers, Constant
definitions, Data structures.
• C/C++ libraries
▫ Interface between the applications and the kernel
▫ glibc, uClibc
• GCC compiler
• GDB debugger
Learn To Be Embedded Linux Training
11. 11
Booting sequence
• Bootloader
▫ Executed by the hardware at a fixed location in ROM / Flash
▫ Initializes support for the device where the kernel image is found
(local storage, network, removable media)
▫ Loads the kernel image in RAM
▫ Executes the kernel image (with a specified command line)
• Kernel
▫ Uncompresses itself
▫ Initializes the kernel core and statically compiled drivers (needed to
access the root filesystem)
▫ Mounts the root filesystem (specified by the root kernel parameter)
▫ Executes the first userspace program (specified by the init kernel
parameter)
• First userspace program Configures userspace and starts up
system services
Learn To Be Embedded Linux Training
12. 12
Linux Kernel
app A app B
User
C Library Space
Call Event
a service Handler
Linux Kernel
Manage Event
Hardware notification
Hardware
Learn To Be Embedded Linux Training
13. 13
Linux Kernel
• The official version of the Linux kernel, as released by
Linus Torvalds is available at http://www.kernel.org
• Incremental patches between versions
▫ It assumes you already have a base version and you
apply the correct patches in the right order
▫ Quick to download and apply
• The patch command applies changes to files in the
current directory:
▫ Making changes to existing files
▫ Creating or deleting files and directories
Learn To Be Embedded Linux Training
14. Thank You
Facebook group: Learn To Be
Official website: www.L2b-egy.org
Prepared By: SHATRIX
E-Mail: eng.shatrix@gmail.com
Learn To Be Embedded Linux Training