Embedded Linux Training Facebook group: Learn To Be Official website: www.L2b-egypt.org Prepared By: SHATRIX E-Mail: email@example.comLearn To Be Embedded Linux Training
2Overview • 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
3Basic 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
4Host & Target Host Target Croos-Platform BootLoader Toolchain Kernel Filesystem GCC Libraries ApplicationsLearn To Be Embedded Linux Training
5To 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 applicationsLearn To Be Embedded Linux Training
6Whats 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 librariesLearn To Be Embedded Linux Training
7Root 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 separateLearn To Be Embedded Linux Training
8Cross-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 yourLearn target. To Be Embedded Linux Training
9Cross-compiling Toolchain Source Code X86 Native Toolchain Cross Toolchain X86 Binary Target Binary X86 Target CPULearn To Be Embedded Linux Training
10Cross 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 debuggerLearn To Be Embedded Linux Training
11Booting 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 servicesLearn To Be Embedded Linux Training
12Linux Kernel app A app B User C Library Space Call Event a service Handler Linux Kernel Manage Event Hardware notification HardwareLearn To Be Embedded Linux Training
13Linux 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 directoriesLearn To Be Embedded Linux Training
Thank You Facebook group: Learn To Be Official website: www.L2b-egy.org Prepared By: SHATRIX E-Mail: firstname.lastname@example.orgLearn To Be Embedded Linux Training
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.