Introduction to Embedded
Linux
1
Prepared by kms
Agenda
• Main concepts on Embedded
systems
• Difference between SW_ES & Digital Design
• HISTORICAL BACKGROUND
• Introduction to Embedded Linux
• Why embedded Linux?
• The core of embedded Linux
• The android
• Yocto project
• Embedded Linux materials
2
Main concepts on Embedded
systems
3
What’s Embedded Systems ?
What’s Embedded Systems ?
What’s Embedded Systems ?
ES VS General Purpose Systems
Baremetal application & OS
APP APP
OS
HW Drivers
Prepared by: AMIT Learning
Embedded System Classification
There are two main families of embedded system platforms:
• Microcontroller Family
• High performance (System on Chip) SOC platforms Family
Prepared by: AMIT Learning
Microcontroller Family
Prepared by: AMIT Learning
High performance SOC platforms Family
It contains a micro processors:
Prepared by: AMIT Learning
BeagleBoard
resperi pi 2
• A 900MHz quad-core ARM Cortex-A7 CPU
• 1GB RAM
• Like the (Pi 1) Model B+, it also has:
• 4 USB ports
• 40 GPIO pins
• Full HDMI port
• Ethernet port
• Combined 3.5mm audio jack and composite video
• Camera interface (CSI)
• Display interface (DSI)
• Micro SD card slot
• VideoCore IV 3D graphics core
(Digital Design (FPGA) VS microcontroller) implementation
Prepared by: AMIT Learning
RTL Design
Prepared by: AMIT Learning
field-programmable gate array (FPGA)
https://www.altera.com/products/fpga/arria-series/arria-v/overview.html
Prepared by: AMIT Learning
FPGA Design Flow
17
field-programmable gate array (FPGA)
Prepared by: AMIT Learning
(Digital Design (FPGA) VS microcontroller) implementation
Prepared by: AMIT Learning
HISTORICAL BACKGROUND
UNIX
It started in Bell Labs with a terminated project for the Multics
Multi-user operating system
Dennis Ritchie and Ken Thomson started to work on Unix
1969: First Implementation of Unix
1972: Creation of “C” programming language to facilitate the porting
1973: Complete rewrite of UNIX into “C” (which led to high
portability)
UC Berkeley
GNU
GNU Not Unix
Richard Stallman is Believing in free software,
he formed the Free Software Foundation
and started the GNU project in 1983
Linux
Developed by Linus
Embedded Linux
Embedded Linux usually means Linux kernel
running on a particular CPU and inside
an embedded device.
A few examples of embedded systems
running Linux
• Personal routers
A few examples of embedded systems
running Linux
• Laser cutting machine
• Phones and Tablets
• Automotive
Why embedded Linux?
29
1. Re-using components
• The key advantage of Linux and open-source in
embedded
systems is the ability to re-use components
• The open-source system already provides many
components for standard features, from hardware support
to
network protocols, going through multimedia, graphic,
cryptographic libraries, etc.
1. Re-using components
• As soon as a hardware device, or a protocol, or a feature is
wide-spread enough, high chance of having open-source
components that support it.
• Allows to quickly design and develop complicated products,
based on existing components.
• No-one should re-develop yet another operating system kernel,
TCP/IP stack, USB stack or another graphical toolkit library.
• Allows to focus on the added value of your product.
2.Low cost
• Free software can be duplicated on as many devices as you
want, free of charge.
• I If your embedded system uses only free software, you can
reduce the cost of software licenses to zero. Even the
• development tools are free, unless you choose a commercial
embedded Linux edition.
• Allows to have a higher budget for the hardware or to
increase the company's skills and knowledge
3.Full control
• With open-source, you have the source code
for all
components in your system
• Allows unlimited modifications, changes,
debugging,
• optimization, for an unlimited period of time
• Allows to have full control over the software
part of your
• system
4.Quality
• Many open-source components are widely used, on millions of
systems
• Usually higher quality than what an in-house development can
produce, or even proprietary vendors
• Of course, not all open-source components are of good
quality, but most of the widely-used ones are.
• Allows to design your system with high-quality
components at the foundations
5.Community support
• Open-source software components are
developed by
communities of developers and users
• This community can provide a high-quality
support: you can
directly contact the main developers of the
component you
are using.
Minimum requirements
Embedded Linux work
Software components
Software components
Flash outline
First element: the toolchain
Types of toolchain
QEMU
Fast processor emulator using a portable dynamic
translator. http://bellard.org/qemu/
QEMU Examples
General Purpose Toolbox: busybox
Criteria for selecting a toolchain
Second element: bootloader
Initialize the hardware
Set up SDRAM controller
Set processor mode and features
Load a kernel
Optional (but very useful)
Load images via Ethernet, serial, SD card
Pre-boot loader
Bootloader-kernel ABI &
Device Tree
Examples of boot loaders
U-Boot command line
U-Boot environment
Automating boot: bootcmd
Summary
Third element: kernel
Linux kernel in the system
57
Inside the Linux kernel
58
Kernel version numbers
3.x stable branch
60
Levels of board support
Kernel modules
Kernel configuration
Building the kernel
Kernel command line
Fourth element: user space
The root file system
Other options for a root file system
Busybox
Busybox init
Summary
What is Android?
Linux kernel – with patches
Java application framework
set of Java apps (calendar, clock, etc
Plus many more free and non-free app
Google Market
Android internals
Proposition
Challenges when porting Android
Downloads from Google
Quick start: the Android SDK
OpenEmbedded / Yocto Project
78
The Yocto Project
79
embedded-linux-materials
80
embedded-linux-conference
• http://events.linuxfoundation.org/events/e
mbedded-linux-conference
81
The Embedded Linux Quick
Start Guide
• by Chris Simmons at Embedded Linux
Conference Europe, Cambridge,
82
Part 1: Toolchain and Boot loader
• First Element: Toolchain
• Minimal elements of toolchain
• Types of toolchain
• Types of C libraries for toolchain
• Criteria for selecting toolchain
• Toolchain examples
• Installing a toolchain
• Adding libraries to toolchain
• Support for debugging
• Other goodies along with toolchain
• Second Element: Boot loader
• What is boot loader
• Pre-boot loader
• Loading the kernel
• Boot loader-kernel ABI – ATAGS and
FDT
• Examples of boot loaders https://youtu.be/6_pugJ0H50U
• U-Boot command line
• U-Boot environment
Slides
• Automating boot – bootcmd
83
Part 2: Kernel and User space
• Third Element: Kernel
• Kernel vs User space
• Kernel version numbers
• Bug fix releases
• Board support packages
• Levels of board support
• Board support
• Kernel modules
• Kernel configuration
• Building the kernel
• Kernel command line
• Fourth Element: User space
• What is user space
• The root file system (rootfs)
• Other options for a rootfs
• Busybox and examples Slides
• init: Busybox init and System V init
• System V inittab
• Initialization scripts https://www.youtube.com/watch?t=1000&v=sPraL_k1ZNA
• Device nodes: /dev
• The rootfs during development
• The rootfs in production 84
• Flash file systems
Part 3: Advanced topics
https://www.youtube.com/watch?v=UjXGg2UkQRE
Slides
85
What else can you do with
Android? – Part 1
Slides
Video
86
What else can you do with
Android? – Part 2
Slides
Video
87
What else can you do with
Android? – Part 3
Slides
Video
88
embedded linux for arab
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelar...
89