building embedded linux
DESCRIPTION
TRANSCRIPT
Learn To Be Embedded Linux Training
Embedded Linux TrainingFacebook group: Learn To BeOfficial website: www.L2b-egypt.org
Prepared By: SHATRIX E-Mail: [email protected]
2
Learn To Be Embedded Linux Training
Overview•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.
3
Learn To Be Embedded Linux Training
Basic embedded Linux arch.•Boot Loader (grub, Lilo, Uboot)•Kernel (Normal or Real-Time)•FileSystem•C Library•User application(s)
4
Learn To Be Embedded Linux Training
Host & Target
Croos-PlatformToolchain
GCC
Host
BootLoaderKernel
FilesystemLibraries
Applications
Target
5
Learn To Be Embedded Linux Training
To 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 applications
6
Learn To Be Embedded Linux Training
What's 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
libraries
7
Learn To Be Embedded Linux Training
Root filesystem•The root filesystem, is mounted as /•On embedded systems, this root
filesystem contains all the libraries, applications and data of the system
•Therefore, building the root filesystem is one of the main tasks of integrating embedded Linux components into a device
•The kernel is usually kept separate
BootLoader
Kernel
RootFilesystem
System Contents
8
Learn To Be Embedded Linux Training
Cross-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 your target.
9
Learn To Be Embedded Linux Training
Cross-compiling Toolchain
X86 Binary Target Binary
X86
X86 Target CPU
Source Code
Native Toolchain Cross Toolchain
10
Learn To Be Embedded Linux Training
Cross 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 debugger
11
Learn To Be Embedded Linux Training
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▫ 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 services
12
Learn To Be Embedded Linux Training
Linux Kernel
Hardware
Linux Kernel
UserSpaceC Library
app A app B
Calla service
ManageHardware
EventHandler
Eventnotification
13
Learn To Be Embedded Linux Training
Linux 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 directories
Learn To Be Embedded Linux Training
Thank You
Facebook group: Learn To BeOfficial website: www.L2b-egy.org
Prepared By: SHATRIX E-Mail: [email protected]