building embedded linux systems introduction
DESCRIPTION
An introduction to know how to start in the field of Embedded Linux systems building & development.TRANSCRIPT
![Page 1: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/1.jpg)
Embedded Linux
Information Technology Institute (ITI)
Sherif Mousa
Embedded Linux @ Information Technology Institute 1
2– Introduction To Embedded Linux
![Page 2: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/2.jpg)
2
Definition
Embedded Linux @ Information Technology Institute
![Page 3: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/3.jpg)
Definition
• Embedded Linux is the use of Linux in embedded computer systems.
• Adapting the Linux kernel and customizing the user-space libraries and utilities to embedded applications such as those in use in consumer electronics, military, medical, industrial, 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
![Page 4: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/4.jpg)
4
Some Whys ???
Embedded Linux @ Information Technology Institute
![Page 5: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/5.jpg)
Why Embedded ?
? 5 Embedded Linux @ Information Technology Institute
![Page 6: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/6.jpg)
Why OS for Embedded ?
• Make use of micro-processor capabilities (Multi-Tasking …).
• Easy to program.
• System scalability.
6 Embedded Linux @ Information Technology Institute
![Page 7: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/7.jpg)
Why Embedded not Normal OS ?
• Systems with small and limited resources.
• Special-Purpose systems.
• Real-Time systems.
7 Embedded Linux @ Information Technology Institute
![Page 8: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/8.jpg)
Why Linux ?
• Inexpensive, Robust, Easy to program.
• Source code is available.
• Ported to a variety of CPU architectures.
• Large device drivers coverage.
• Hosting huge number of languages & libraries.
• Software is highly modularized, making it easy to build something new.
8 Embedded Linux @ Information Technology Institute
![Page 9: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/9.jpg)
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.
9 Embedded Linux @ Information Technology Institute
![Page 10: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/10.jpg)
10
Some Facts
Embedded Linux @ Information Technology Institute
![Page 11: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/11.jpg)
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
11 Embedded Linux @ Information Technology Institute
![Page 12: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/12.jpg)
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.
• Linux - Somethings = EmbeddedLinux
12 Embedded Linux @ Information Technology Institute
![Page 13: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/13.jpg)
Android is embedded Linux?
• “Of course not” Karim Yaghmour
• Google custom-built Android as a mobile operating system that comes with its own ecosystem, separate from the classic Linux ecosystem. Its user interface is optimized for touch screen devices. It comes with a set of APIs. But most classic embedded devices don’t need Google maps, for example.
13 Embedded Linux @ Information Technology Institute
![Page 14: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/14.jpg)
14
Embedded Linux Development
Embedded Linux @ Information Technology Institute
![Page 15: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/15.jpg)
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.
15 Embedded Linux @ Information Technology Institute
![Page 16: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/16.jpg)
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.
16 Embedded Linux @ Information Technology Institute
![Page 17: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/17.jpg)
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. They run on your workstation but generate code for your target.
17 Embedded Linux @ Information Technology Institute
![Page 18: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/18.jpg)
Cross-ToolChain
18 Embedded Linux @ Information Technology Institute
X86 Binary Target Binary
X86
X86 Target CPU
Source Code
Native ToolChain Cross ToolChain
![Page 19: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/19.jpg)
Cross-ToolChain Components
• Binutils is a set of tools to generate and manipulate binaries for a given CPU architecture – as, ld, ar, …….
• Kernel headers – Available system calls and their numbers, Constant
definitions, Data structures.
• C/C++ libraries – Interface between the applications and the kernel – glibc (or) uClibc
• GCC compiler • GDB debugger
19 Embedded Linux @ Information Technology Institute
![Page 20: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/20.jpg)
20
Embedded Linux Components
Embedded Linux @ Information Technology Institute
![Page 21: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/21.jpg)
Embedded Linux Components
• Boot Loader (grub, Lilo, Uboot)
• Kernel (Normal or Real-Time)
• FileSystem (FHS)
• Configuration files
• C Library
• Common system commands
• User application(s)
21 Embedded Linux @ Information Technology Institute
![Page 22: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/22.jpg)
Embedded Linux Components
• 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.
• System libraries (C library) – The interface between the kernel and the userspace
applications.
• Filesystem – Contains Linux commands, libraries and other needed
scripts.
22 Embedded Linux @ Information Technology Institute
![Page 23: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/23.jpg)
System Integration & Installation
• Integrate all the components, bootloader, kernel, system libraries and applications and our applications into a full working system.
• Install the OS into the device (?!!??!?!!!?!?!)
23 Embedded Linux @ Information Technology Institute
![Page 24: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/24.jpg)
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.
• 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 and user interface (if found).
24 Embedded Linux @ Information Technology Institute
![Page 25: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/25.jpg)
Linux System Running
25 Embedded Linux @ Information Technology Institute
Hardware
Linux Kernel
User Space C Library
app A app B
Call a service
Manage Hardware
Event Handler
Event notification
![Page 26: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/26.jpg)
Then What ???
• Once you have the system installed with no problems on your development device, you are free to write applications as you need with the any programming language (supported by your embedded OS).
26 Embedded Linux @ Information Technology Institute
![Page 27: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/27.jpg)
27 Embedded Linux @ Information Technology Institute
![Page 28: Building Embedded Linux Systems Introduction](https://reader034.vdocuments.us/reader034/viewer/2022051111/554be7acb4c9055a368b4b0c/html5/thumbnails/28.jpg)
http://about.me/shatrix
28 Embedded Linux @ Information Technology Institute