0% found this document useful (0 votes)
23 views

embeddedlinuxfromscratchtoyocto-150302065300-conversion-gate01

The document provides an overview of Embedded Linux, detailing its history, significance, and the process of building an Embedded Linux system from scratch or using tools like Buildroot and Yocto. It emphasizes the importance of customizing the Linux kernel and user-land libraries for specific applications in various industries. Additionally, it outlines the components necessary for an Embedded Linux system and the booting sequence involved.

Uploaded by

anandk1386
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

embeddedlinuxfromscratchtoyocto-150302065300-conversion-gate01

The document provides an overview of Embedded Linux, detailing its history, significance, and the process of building an Embedded Linux system from scratch or using tools like Buildroot and Yocto. It emphasizes the importance of customizing the Linux kernel and user-land libraries for specific applications in various industries. Additionally, it outlines the components necessary for an Embedded Linux system and the booting sequence involved.

Uploaded by

anandk1386
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Embedded Linux

From Scratch To Yocto

Information Technology Institute

Sherif Mousa

Embedded Linux @ Information Technology Institute 1


Linux

Unix (Ken Thompson & Dennis Ritchie) AT&T
company 1969

FSF & GNU (Gnu is Not Unix) & GPL (Richard
Stallman) 1984

Hurd Kernel

Linux (LinusTorvalds) 1991

GNU/Linux 1992 (complete, open source, UNIX-
like operating system)
– https://www.gnu.org/gnu/linux-and-gnu.html

Embedded Linux @ Information Technology Institute 2
Embedded Linux

Embedded Linux is the use of Linux in
embedded computer systems.

Adapting the Linux kernel and customizing the
user-land libraries and utilities to embedded
applications such as those in use in consumer
electronics, military, medical, industrial,
network, and auto industries.

Creating an Embedded Linux based system is
like a puzzle. Putting the right pieces together
will create the final image.
Embedded Linux @ Information Technology Institute 3
Some Whys ...

Why OS for Embedded ?
– Make use of micro-processor capabilities (Multi-Tasking …).
– Easy to program.
– System scalability.

Why Embedded not Normal OS ?
– Systems with small and limited resources.
– Special-Purpose systems.
– Real-Time systems.

Why Linux ?
– Inexpensive, robust, easy to program, open source.
– Ported to a variety of CPU architectures.
– Large device drivers coverage.
Embedded Linux @ Information Technology Institute 4
Why build from scratch ?

“When you bake it at the factory that’s what it
does forever. “
Tim Bird, Sony Entertainment

You can use ready-made distributions as well,
but you will face some restrictions if you need
to modify something.

Embedded Linux @ Information Technology Institute 5


Some Facts ...

Is it easy?
– NO, IT’S NOT EASY.
– To finish a complete OS, it’s not just Linux kernel to
compile, you need to build and integrate the other OS
components (BootLoader, Libraries, Commands, …….)
– And you will do all of this without getting a PhD degree
in OS building :)

Do I need more knowledge ?
– If you are a Linux super user, and you think
that you need to learn more things to enter
the Embedded Linux field, THAT’S WRONG.
Embedded Linux @ Information Technology Institute 6
Embedded Linux Development

Embedded Linux @ Information Technology Institute 7


Some definitions

Cross Compiler
– A cross compiler is a compiler capable of creating
executable code for a platform other than the one on
which the compiler is running.

Toolchain
– Set of programming tools that are used to create a
product (typically another computer program), used in
chain.
– A simple software development ToolChain consists of a
compiler and linker to transform the source code into an
executable program, libraries to provide interfaces to
the operating system, and a debugger.
Embedded Linux @ Information Technology Institute 8
Some definitions (cont'd)

Cross-Toolchain
– The usual development tools available on a
GNU/Linux workstation is a native ToolChain.
– For embedded systems, it is usually impossible or
not interesting to use a ToolChain installed on it

The target is restricted in terms of storage and memory

The target is very slow compared to your workstation
– Therefore, Cross-ToolChain is used. Runs on your
workstation but generates binaries for your target.

Embedded Linux @ Information Technology Institute 9


Cross-Toolchain

Source Code X86

Native ToolChain Cross ToolChain

X86 Binary Target Binary

X86 Target CPU

Embedded Linux @ Information Technology Institute 10


Embedded Linux System Components

Cross-compilation ToolChain
– Compiler, debugger, libraries, headers, extra tools.

Boot Loader (grub, lilo, uboot)
– Started by the hardware.
– Responsible for basic initialization, loading and executing the kernel.

Linux Kernel (Normal or Real-Time)
– Contains the process and memory management, network stack, device drivers, and
many other core OS responsibilities, and provides services to userspace applications.

C Library (glibc, uclibc, ….)
– The interface between the kernel and the userspace applications.

User Land
– Configuration files
– Common system commands
– User application(s)

Embedded Linux @ Information Technology Institute 11


Linux System Running

app A app B
User
C Library Land

Call Event
a service Handler

Linux Kernel

Manage Event
Hardware notification

Hardware

Embedded Linux @ Information Technology Institute 12


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 and execute.

Linux Kernel
– Uncompresses itself
– Initializes the kernel core and statically compiled drivers (required 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 and any installed user interface (graphical or terminal based).

Embedded Linux @ Information Technology Institute 13


Building Process

Embedded Linux @ Information Technology Institute 14


How to build?

From scratch
– The original way, you need to build every single
component from scratch, from its source code.
Applying your configurations, compiler options,
building each component of the system, then
integrate all these parts together.

Auto-Build tools
– Automated tools in the form of “build scripts”,
written by the experts in this field to make it easy
for everyone to build a full embedded Linux system
with the minimal knowledge of building process.
Embedded Linux @ Information Technology Institute 15
Building from scratch

Components you need to build
– Cross-Toolchain (ready or build)
– BootLoader
– Linux Kernel configuration and compiling
– Root filesystem hierarchy
– System command (BusyBox)
– Startup scripts and variables

Two approaches
– Bottom-Up approach (start with minimal system)
– Top-Down approach (start with ready base system)
Embedded Linux @ Information Technology Institute 16
Auto-Build Tools

Buildroot
– It’s a set of Makefiles and patches that simplifies
and automates the process of building a complete
Linux system for an embedded system, by
using cross-compilation.
– Useful mainly while working with small or
embedded systems, using various CPU
architectures – including x86, ARM, MIPS, and
PowerPC.

Embedded Linux @ Information Technology Institute 17


Auto-Build Tools

Yocto
– It is a Linux Foundation workgroup
– It's a complete embedded Linux development
environment with tools, metadata, and
documentation - everything you need
– The Yocto Project has the objective of attempting
to improve the lives of developers of
customized Linux systems supporting
the ARM, MIPS, PowerPC and x86/x86 64
architectures.

Embedded Linux @ Information Technology Institute 18


Embedded Linux @ Information Technology Institute 19
[email protected]
[email protected]
http://about.me/shatrix
Embedded Linux @ Information Technology Institute 20

You might also like