SlideShare a Scribd company logo
1 of 20
Download to read offline
Embedded Linux @ Information Technology Institute 1
Embedded Linux
From Scratch To Yocto
Information Technology Institute
Sherif Mousa
Embedded Linux @ Information Technology Institute 2
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 3
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 4
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 5
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 6
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 7
Embedded Linux Development
Embedded Linux @ Information Technology Institute 8
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 9
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 10
Cross-Toolchain
X86 BinaryX86 Binary Target BinaryTarget Binary
X86
X86 Target CPU
Source CodeSource Code
Native ToolChainNative ToolChain Cross ToolChainCross ToolChain
Embedded Linux @ Information Technology Institute 11
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 12
Linux System Running
HardwareHardware
Linux KernelLinux Kernel
User
Land
C LibraryC Library
app Aapp A app Bapp B
Call
a service
Manage
Hardware
Event
Handler
Event
notification
Embedded Linux @ Information Technology Institute 13
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 14
Building Process
Embedded Linux @ Information Technology Institute 15
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 16
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 17
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 18
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 19
Embedded Linux @ Information Technology Institute 20
sherif.mousa@valeo.com
sherif.e.mousa@gmail.com
http://about.me/shatrix

More Related Content

What's hot

What's hot (20)

Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux
Linux Linux
Linux
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat Linux
 

Viewers also liked

Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
Patrick Bellasi
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
linux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrixlinux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrix
Sherif Mousa
 
Building Embedded Linux
Building Embedded LinuxBuilding Embedded Linux
Building Embedded Linux
Sherif Mousa
 
U-Boot community analysis
U-Boot community analysisU-Boot community analysis
U-Boot community analysis
xulioc
 
001 linux revision
001 linux revision001 linux revision
001 linux revision
Sherif Mousa
 

Viewers also liked (20)

Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
Building Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchBuilding Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 Arch
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Embedded Linux
Embedded LinuxEmbedded Linux
Embedded Linux
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
linux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrixlinux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrix
 
Building Embedded Linux
Building Embedded LinuxBuilding Embedded Linux
Building Embedded Linux
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Embedded linux system development (slides)
Embedded linux system development (slides)Embedded linux system development (slides)
Embedded linux system development (slides)
 
Embedded Linux Basics
Embedded Linux BasicsEmbedded Linux Basics
Embedded Linux Basics
 
U-Boot community analysis
U-Boot community analysisU-Boot community analysis
U-Boot community analysis
 
Smile
SmileSmile
Smile
 
005 skyeye
005 skyeye005 skyeye
005 skyeye
 
001 linux revision
001 linux revision001 linux revision
001 linux revision
 
003 scripting
003 scripting003 scripting
003 scripting
 
Operating systems Basics
Operating systems BasicsOperating systems Basics
Operating systems Basics
 
كيف تفشل
كيف تفشلكيف تفشل
كيف تفشل
 

Similar to Embedded Linux from Scratch to Yocto

Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
definecareer
 
Advance linux presentation_0702011
Advance linux presentation_0702011Advance linux presentation_0702011
Advance linux presentation_0702011
Aravindan Arun
 

Similar to Embedded Linux from Scratch to Yocto (20)

Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Intro to linux
Intro to linux Intro to linux
Intro to linux
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
history_of_linux lec 7.pptx
history_of_linux lec 7.pptxhistory_of_linux lec 7.pptx
history_of_linux lec 7.pptx
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
 
Linux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platformLinux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platform
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Hillel kobrovski Linux security overview for ciso
Hillel kobrovski   Linux security overview for cisoHillel kobrovski   Linux security overview for ciso
Hillel kobrovski Linux security overview for ciso
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Dedicated embedded linux af Esben Haabendal, Prevas A/S
Dedicated embedded linux af Esben Haabendal, Prevas A/SDedicated embedded linux af Esben Haabendal, Prevas A/S
Dedicated embedded linux af Esben Haabendal, Prevas A/S
 
Embedded Linux On A R M
Embedded  Linux On  A R MEmbedded  Linux On  A R M
Embedded Linux On A R M
 
Raspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionRaspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 Introduction
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
 
introduction.pdf
introduction.pdfintroduction.pdf
introduction.pdf
 
Cooperative Linux
Cooperative LinuxCooperative Linux
Cooperative Linux
 
Advance linux presentation_0702011
Advance linux presentation_0702011Advance linux presentation_0702011
Advance linux presentation_0702011
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Recently uploaded (20)

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257
 

Embedded Linux from Scratch to Yocto

  • 1. Embedded Linux @ Information Technology Institute 1 Embedded Linux From Scratch To Yocto Information Technology Institute Sherif Mousa
  • 2. Embedded Linux @ Information Technology Institute 2 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 –
  • 3. Embedded Linux @ Information Technology Institute 3 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.
  • 4. Embedded Linux @ Information Technology Institute 4 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.
  • 5. Embedded Linux @ Information Technology Institute 5 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.
  • 6. Embedded Linux @ Information Technology Institute 6 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.
  • 7. Embedded Linux @ Information Technology Institute 7 Embedded Linux Development
  • 8. Embedded Linux @ Information Technology Institute 8 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.
  • 9. Embedded Linux @ Information Technology Institute 9 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.
  • 10. Embedded Linux @ Information Technology Institute 10 Cross-Toolchain X86 BinaryX86 Binary Target BinaryTarget Binary X86 X86 Target CPU Source CodeSource Code Native ToolChainNative ToolChain Cross ToolChainCross ToolChain
  • 11. Embedded Linux @ Information Technology Institute 11 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)
  • 12. Embedded Linux @ Information Technology Institute 12 Linux System Running HardwareHardware Linux KernelLinux Kernel User Land C LibraryC Library app Aapp A app Bapp B Call a service Manage Hardware Event Handler Event notification
  • 13. Embedded Linux @ Information Technology Institute 13 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).
  • 14. Embedded Linux @ Information Technology Institute 14 Building Process
  • 15. Embedded Linux @ Information Technology Institute 15 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.
  • 16. Embedded Linux @ Information Technology Institute 16 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)
  • 17. Embedded Linux @ Information Technology Institute 17 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.
  • 18. Embedded Linux @ Information Technology Institute 18 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.
  • 19. Embedded Linux @ Information Technology Institute 19
  • 20. Embedded Linux @ Information Technology Institute 20 sherif.mousa@valeo.com sherif.e.mousa@gmail.com http://about.me/shatrix