SlideShare a Scribd company logo
1 of 26
Download to read offline
1Embedded Linux Quick Start Guide
In the beginning
The Embedded Linux Quick Start Guide
In the Beginning...
Chris Simmonds
Embedded Linux Conference Europe 2010
Copyright © 2010, 2net Limited
2Embedded Linux Quick Start Guide
In the beginning
Overview
●
Genesis of a Linux project
●
The four elements
●
Tool chain; boot loader; kernel; user space
●
Element 1: Tool chain
●
Element 2: Boot loader
3Embedded Linux Quick Start Guide
In the beginning
“I've just had this great idea...”
●
“…our next product will run Linux”
●
This workshop will take a look at
●
Board bring-up
●
Development environment
●
Deployment
4Embedded Linux Quick Start Guide
In the beginning
The four elements
Toolchain (air)
Boot loader (earth)
Kernel (fire)
User space (water)
5Embedded Linux Quick Start Guide
In the beginning
First element: the toolchain
●
You can't do anything until you can produce
code for your platform
●
A tool chain consists of at least
●
binutils: GNU assembler, linker, etc.
●
gcc: GNU C compiler
●
C library (libc): the interface to the operating system
●
gdb: debugger
6Embedded Linux Quick Start Guide
In the beginning
Types of toolchain
●
Native: run compiler on target board
●
If your target board is not fast enough or doesn't
have enough memory or storage, use an emulator
e.g. qemu
●
Cross: compile on one machine, run on another
●
Most common option
7Embedded Linux Quick Start Guide
In the beginning
The C library
●
Gcc is built along side the C library
●
Hence, the C library is part of the tool chain
●
Main options are
●
GNU glibc
– big but fully functional
●
GNU eglibc
– glibc but more configurable; embedded-friendly
●
uClibc
– small, lacking up-to-date threads library and other
POSIX functions
8Embedded Linux Quick Start Guide
In the beginning
Criteria for selecting a toolchain
●
Good support for your processor
●
e.g. for ARM A-8 core, armv4 compilers work OK but
armv7t works better
●
Appropriate C library
●
Up-to-date
●
Good support (community or commercial)
●
Other goodies, e.g.
●
Cross-compiled libraries and programs
●
Development tools for tracing, profiling, etc.
9Embedded Linux Quick Start Guide
In the beginning
Toolchain examples
URL Architectures
ARM, MIPS, PPC, SHCodesourcery G++ Lite www.codesourcery.com
URL Architectures
ARM, PPC, AVR32, SH
Debian ARM, PPC
Ubuntu ARM
PPC (ARM, MIPS)
Angstrom www.angstrom-distribution.org
www.debian.org
www.ubuntu.com
Denx ELDK www.denx.de
Free, minimal
Free, binary
10Embedded Linux Quick Start Guide
In the beginning
Toolchain examples
URL Architectures
ARM, PPC, MIPS
ARM, PPC, AVR32, SH
LTIB ARM, PPC
Buildroot www.buildroot.org
OpenEmbedded www.openembedded.org
www.bitshrine.org
URL Architectures
MontaVista Linux www.mvista.com
Timesys LinuxLink linuxlink.timesys.com
Windriver Linux www.windriver.com
LynuxWorks BlueCat Linux www.lynuxworks.com
Sysgo ElinOS www.sysgo.com
Free, integrated build environment
Commercial
11Embedded Linux Quick Start Guide
In the beginning
“I got a toolchain with my board”
●
This is often a trap!
●
Most board vendors don't have in-depth
embedded Linux expertise
●
Toolchain often out of date
●
Wrong libc
●
Poor selection of other development libraries
●
No update policy
●
Consider using a generic toolchain instead
12Embedded Linux Quick Start Guide
In the beginning
Installing a toolchain
●
Usually everything is in a single directory tree
●
typically in /usr/local or /opt
●
In which you will find...
●
cross-compiler and debugger binaries
– cross tools have a prefix, such as
arm-angstrom-linux-gnueabi-gcc
●
header files and libraries for the target
●
To use it, do something like:
PATH=/usr/local/some_tool_chain/bin:$PATH
arm-angstrom-linux-gnueabi-gcc my_prog.c -o my_prog
13Embedded Linux Quick Start Guide
In the beginning
Adding libraries
●
A minimal tool chain only has libc
●
Example: we have structured data and want to
use sqlite3. What to do?
●
Worst case: cross compile it yourself
●
libsqlite3 is not difficult; others are much worse
●
You need
●
Header files toolchain usr/include directory→
●
Library .a and .la files toolchain usr/lib directory→
●
Library .so files target usr/lib directory→
14Embedded Linux Quick Start Guide
In the beginning
Tip
●
Choose a toolchain that comes with all (or
most) of the libraries you will need for the
project
15Embedded Linux Quick Start Guide
In the beginning
Support for debugging
●
For remote debugging of the target make sure
your toolchain includes cross-development gdb
and cross-compiled gdbserver
●
Ideally it should include debug symbols in all
the libraries
●
Ideally it should include source code for the
libraries
16Embedded Linux Quick Start Guide
In the beginning
Other goodies
●
Graphical IDE
●
Eclipse with C/C++ Development Toolkit (CDT)
●
Profilers
●
Oprofile
●
Memory patrol
●
Tracers
●
Linux Trace Toolkit
17Embedded Linux Quick Start Guide
In the beginning
Second element: bootloader
●
Initialise the hardware
●
Set up SDRAM controller
●
Map memory
●
Set processor mode and features
●
Load a kernel
●
Optional (but very useful)
●
Load images via Ethernet, serial, SD card
●
Erase and program flash memory
●
Display splash screen
18Embedded Linux Quick Start Guide
In the beginning
Pre-boot loader
●
Usually stored in flash memory
●
Old days: NOR flash mapped to processor restart
vector so whole boot loader stored as single image
●
These days: first stage boot loader is stored in first
page of NAND flash which is loaded by on-chip
microcode
●
Sequence:
●
Pre-boot loader main boot loader kernel→ →
19Embedded Linux Quick Start Guide
In the beginning
Loading the kernel
●
Primary task of boot loader is to
●
Generate a description of the hardware
– e.g. size and location of RAM, flash, ...
●
Load a kernel image into memory
●
(Optional) load a ramdisk image into memory
●
Set the kernel command line (see later)
●
Jump to kernel start vector, passing pointers to
– information about hardware
– kernel command line
20Embedded Linux Quick Start Guide
In the beginning
Bootloader-kernel ABI: ATAGS
ARM (and some others) the kernel is passed values in two registers
R1 = machine number
R2 = Pointer to ATAGS list
The ATAGS are a linked list of tagged values. For example
ATAG_CORE ; mandatory (pagesize, rootdev)
ATAG_MEM ; size, start physical addr
ATAG_CMDLINE ; Kernel cmdline
ATAG_NONE ; end of list
21Embedded Linux Quick Start Guide
In the beginning
Bootloader-kernel ABI: flattened
Device Tree
PPC (and others) use Flattened Device Tree (FDT)
/ device-tree
name = “device-tree”
model = “MyBoardName”
...
PowerPC,970@0
name = "PowerPC,970"
device_type = "cpu"
...memory@0
name = "memory"
device_type = "memory"
...
cpus
name = "cpus"
....
22Embedded Linux Quick Start Guide
In the beginning
Examples of boot loaders
●
(Das) U-Boot
●
PPC, ARM, MIPS, SH4
●
http://www.denx.de/wiki/U-Boot/WebHome
●
Redboot
●
PPC, ARM, MIPS, SH4
●
http://sources.redhat.com/redboot/
●
For PC hardware use
●
BIOS together with GRUB or LILO
23Embedded Linux Quick Start Guide
In the beginning
U-Boot command line
Load a kernel image into memory from...
NAND flash
nand read 80100000 1000000 200000
SD card
mmc rescan 1
fatload mmc 1:1 80100000 uimage
TFTP server
setenv ipaddr 192.168.1.2
setenv serverip 192.168.1.1
tftp 80100000 uImage
Boot a kernel image in memory
bootm 80100000
24Embedded Linux Quick Start Guide
In the beginning
U-Boot environment
U-Boot U-Boot
environment
Kernel image,
flash file systems, etc.
Typical flash memory layout
U-Boot commands for environment
setenv ipaddr 192.168.1.101
printenv ipaddr
savvenv
25Embedded Linux Quick Start Guide
In the beginning
Automating boot: bootcmd
Set command to run when U-Boot starts
setenv bootcmd tftp 80100000 uImage;bootm 80100000
Set delay before bootcmd is execcuted
setelv bootdelay 3
26Embedded Linux Quick Start Guide
In the beginning
Summary
●
Tool chain
●
Cross or native
●
Choice of C library: glibc, eglibc or uClibc
●
Plus development libraries as needed
●
Boot loader
●
Initialises the hardware and loads a kernel
●
Passes hardware description to kernel

More Related Content

What's hot

BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101 BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101 Linaro
 
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationBKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationLinaro
 
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARMSFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARMLinaro
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical trainingThierry Gayet
 
Las16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLas16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLinaro
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206Linaro
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesLeszek Godlewski
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitlinuxlab_conf
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLeszek Godlewski
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Kernel TLV
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideLinaro
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...linuxlab_conf
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VOpersys inc.
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Projectlinuxlab_conf
 
Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02Linaro
 

What's hot (20)

BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101 BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101
 
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationBKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
 
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARMSFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical training
 
Las16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLas16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need it
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launches
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology aside
 
OpenWRT and Perl
OpenWRT and PerlOpenWRT and Perl
OpenWRT and Perl
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
Autotools
AutotoolsAutotools
Autotools
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Project
 
Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02
 

Viewers also liked

痛風者救星
痛風者救星痛風者救星
痛風者救星lys167
 
Lezione 7 (12 marzo 2012)
Lezione 7 (12 marzo 2012)Lezione 7 (12 marzo 2012)
Lezione 7 (12 marzo 2012)STELITANO
 
Water joey h. sean f.
Water  joey h. sean f.Water  joey h. sean f.
Water joey h. sean f.Mary Noble
 
Punainen Norsu Kierrätys Jälleenmyyjähinnasto
Punainen Norsu Kierrätys JälleenmyyjähinnastoPunainen Norsu Kierrätys Jälleenmyyjähinnasto
Punainen Norsu Kierrätys JälleenmyyjähinnastoPunainenNorsu
 
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?UpSale
 
TP Newsletter July - September 2012
TP Newsletter July - September 2012TP Newsletter July - September 2012
TP Newsletter July - September 2012awmtea
 
коркина са.Ppt
коркина са.Pptкоркина са.Ppt
коркина са.PptRbhbkk Rjhrby
 
Integrating technology into the teaching of ela
Integrating technology into the teaching of elaIntegrating technology into the teaching of ela
Integrating technology into the teaching of elahzick
 
Метафизика продаж. Как практика брендинга влияет на увеличение
Метафизика продаж. Как практика брендинга влияет на увеличениеМетафизика продаж. Как практика брендинга влияет на увеличение
Метафизика продаж. Как практика брендинга влияет на увеличениеКирилл Казаков
 
Новый год с тату и пату в Ого-Городе
Новый год с тату и пату в Ого-ГородеНовый год с тату и пату в Ого-Городе
Новый год с тату и пату в Ого-ГородеAnton Koval
 
Trying To Find Drawing-Sculptures at MoMA
Trying To Find Drawing-Sculptures at MoMATrying To Find Drawing-Sculptures at MoMA
Trying To Find Drawing-Sculptures at MoMASteve Kemple
 
Beatriz Armendariz –Professor at the University College London and Harvard Un...
Beatriz Armendariz –Professor at the University College London and Harvard Un...Beatriz Armendariz –Professor at the University College London and Harvard Un...
Beatriz Armendariz –Professor at the University College London and Harvard Un...bmathew1
 
50+ Stigma The Story Goes on...
50+ Stigma The Story Goes on...50+ Stigma The Story Goes on...
50+ Stigma The Story Goes on...Waverley Care
 

Viewers also liked (20)

Marketing management
Marketing managementMarketing management
Marketing management
 
痛風者救星
痛風者救星痛風者救星
痛風者救星
 
Brasfield & Gorrie Job Openings
Brasfield & Gorrie Job OpeningsBrasfield & Gorrie Job Openings
Brasfield & Gorrie Job Openings
 
Lezione 7 (12 marzo 2012)
Lezione 7 (12 marzo 2012)Lezione 7 (12 marzo 2012)
Lezione 7 (12 marzo 2012)
 
Water joey h. sean f.
Water  joey h. sean f.Water  joey h. sean f.
Water joey h. sean f.
 
Using Content Marketing to Drive Sales
Using Content Marketing to Drive SalesUsing Content Marketing to Drive Sales
Using Content Marketing to Drive Sales
 
Custorio power point
Custorio power pointCustorio power point
Custorio power point
 
Punainen Norsu Kierrätys Jälleenmyyjähinnasto
Punainen Norsu Kierrätys JälleenmyyjähinnastoPunainen Norsu Kierrätys Jälleenmyyjähinnasto
Punainen Norsu Kierrätys Jälleenmyyjähinnasto
 
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?
Какая реклама эффективна? Как стать лидером рынка? Куда развиваться дальше?
 
TP Newsletter July - September 2012
TP Newsletter July - September 2012TP Newsletter July - September 2012
TP Newsletter July - September 2012
 
коркина са.Ppt
коркина са.Pptкоркина са.Ppt
коркина са.Ppt
 
Integrating technology into the teaching of ela
Integrating technology into the teaching of elaIntegrating technology into the teaching of ela
Integrating technology into the teaching of ela
 
Метафизика продаж. Как практика брендинга влияет на увеличение
Метафизика продаж. Как практика брендинга влияет на увеличениеМетафизика продаж. Как практика брендинга влияет на увеличение
Метафизика продаж. Как практика брендинга влияет на увеличение
 
Kids Ocean
Kids OceanKids Ocean
Kids Ocean
 
Essay 3
Essay 3Essay 3
Essay 3
 
MARZO 18 AL 23 DE 2013
MARZO 18 AL 23 DE 2013MARZO 18 AL 23 DE 2013
MARZO 18 AL 23 DE 2013
 
Новый год с тату и пату в Ого-Городе
Новый год с тату и пату в Ого-ГородеНовый год с тату и пату в Ого-Городе
Новый год с тату и пату в Ого-Городе
 
Trying To Find Drawing-Sculptures at MoMA
Trying To Find Drawing-Sculptures at MoMATrying To Find Drawing-Sculptures at MoMA
Trying To Find Drawing-Sculptures at MoMA
 
Beatriz Armendariz –Professor at the University College London and Harvard Un...
Beatriz Armendariz –Professor at the University College London and Harvard Un...Beatriz Armendariz –Professor at the University College London and Harvard Un...
Beatriz Armendariz –Professor at the University College London and Harvard Un...
 
50+ Stigma The Story Goes on...
50+ Stigma The Story Goes on...50+ Stigma The Story Goes on...
50+ Stigma The Story Goes on...
 

Similar to 01 linux-quick-start

Embedded platform choices
Embedded platform choicesEmbedded platform choices
Embedded platform choicesTavish Naruka
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
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 ARMSherif Mousa
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded LinuxTushar B Kute
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesEddy Reyes
 
Porting Android ABS 2011
Porting Android ABS 2011Porting Android ABS 2011
Porting Android ABS 2011Opersys inc.
 
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 IVOpersys inc.
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...melbats
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VIOpersys inc.
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsBill Malchisky Jr.
 

Similar to 01 linux-quick-start (20)

Embedded platform choices
Embedded platform choicesEmbedded platform choices
Embedded platform choices
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
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
 
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
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded Linux
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Building
BuildingBuilding
Building
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Porting Android ABS 2011
Porting Android ABS 2011Porting Android ABS 2011
Porting Android ABS 2011
 
Hands on OpenCL
Hands on OpenCLHands on OpenCL
Hands on OpenCL
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
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 and course Details of Embedded Linux Platform Developer Training
Introduction and course Details of Embedded Linux Platform Developer TrainingIntroduction and course Details of Embedded Linux Platform Developer Training
Introduction and course Details of Embedded Linux Platform Developer Training
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Armbian linux
Armbian linuxArmbian linux
Armbian linux
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
 

Recently uploaded

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Recently uploaded (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

01 linux-quick-start

  • 1. 1Embedded Linux Quick Start Guide In the beginning The Embedded Linux Quick Start Guide In the Beginning... Chris Simmonds Embedded Linux Conference Europe 2010 Copyright © 2010, 2net Limited
  • 2. 2Embedded Linux Quick Start Guide In the beginning Overview ● Genesis of a Linux project ● The four elements ● Tool chain; boot loader; kernel; user space ● Element 1: Tool chain ● Element 2: Boot loader
  • 3. 3Embedded Linux Quick Start Guide In the beginning “I've just had this great idea...” ● “…our next product will run Linux” ● This workshop will take a look at ● Board bring-up ● Development environment ● Deployment
  • 4. 4Embedded Linux Quick Start Guide In the beginning The four elements Toolchain (air) Boot loader (earth) Kernel (fire) User space (water)
  • 5. 5Embedded Linux Quick Start Guide In the beginning First element: the toolchain ● You can't do anything until you can produce code for your platform ● A tool chain consists of at least ● binutils: GNU assembler, linker, etc. ● gcc: GNU C compiler ● C library (libc): the interface to the operating system ● gdb: debugger
  • 6. 6Embedded Linux Quick Start Guide In the beginning Types of toolchain ● Native: run compiler on target board ● If your target board is not fast enough or doesn't have enough memory or storage, use an emulator e.g. qemu ● Cross: compile on one machine, run on another ● Most common option
  • 7. 7Embedded Linux Quick Start Guide In the beginning The C library ● Gcc is built along side the C library ● Hence, the C library is part of the tool chain ● Main options are ● GNU glibc – big but fully functional ● GNU eglibc – glibc but more configurable; embedded-friendly ● uClibc – small, lacking up-to-date threads library and other POSIX functions
  • 8. 8Embedded Linux Quick Start Guide In the beginning Criteria for selecting a toolchain ● Good support for your processor ● e.g. for ARM A-8 core, armv4 compilers work OK but armv7t works better ● Appropriate C library ● Up-to-date ● Good support (community or commercial) ● Other goodies, e.g. ● Cross-compiled libraries and programs ● Development tools for tracing, profiling, etc.
  • 9. 9Embedded Linux Quick Start Guide In the beginning Toolchain examples URL Architectures ARM, MIPS, PPC, SHCodesourcery G++ Lite www.codesourcery.com URL Architectures ARM, PPC, AVR32, SH Debian ARM, PPC Ubuntu ARM PPC (ARM, MIPS) Angstrom www.angstrom-distribution.org www.debian.org www.ubuntu.com Denx ELDK www.denx.de Free, minimal Free, binary
  • 10. 10Embedded Linux Quick Start Guide In the beginning Toolchain examples URL Architectures ARM, PPC, MIPS ARM, PPC, AVR32, SH LTIB ARM, PPC Buildroot www.buildroot.org OpenEmbedded www.openembedded.org www.bitshrine.org URL Architectures MontaVista Linux www.mvista.com Timesys LinuxLink linuxlink.timesys.com Windriver Linux www.windriver.com LynuxWorks BlueCat Linux www.lynuxworks.com Sysgo ElinOS www.sysgo.com Free, integrated build environment Commercial
  • 11. 11Embedded Linux Quick Start Guide In the beginning “I got a toolchain with my board” ● This is often a trap! ● Most board vendors don't have in-depth embedded Linux expertise ● Toolchain often out of date ● Wrong libc ● Poor selection of other development libraries ● No update policy ● Consider using a generic toolchain instead
  • 12. 12Embedded Linux Quick Start Guide In the beginning Installing a toolchain ● Usually everything is in a single directory tree ● typically in /usr/local or /opt ● In which you will find... ● cross-compiler and debugger binaries – cross tools have a prefix, such as arm-angstrom-linux-gnueabi-gcc ● header files and libraries for the target ● To use it, do something like: PATH=/usr/local/some_tool_chain/bin:$PATH arm-angstrom-linux-gnueabi-gcc my_prog.c -o my_prog
  • 13. 13Embedded Linux Quick Start Guide In the beginning Adding libraries ● A minimal tool chain only has libc ● Example: we have structured data and want to use sqlite3. What to do? ● Worst case: cross compile it yourself ● libsqlite3 is not difficult; others are much worse ● You need ● Header files toolchain usr/include directory→ ● Library .a and .la files toolchain usr/lib directory→ ● Library .so files target usr/lib directory→
  • 14. 14Embedded Linux Quick Start Guide In the beginning Tip ● Choose a toolchain that comes with all (or most) of the libraries you will need for the project
  • 15. 15Embedded Linux Quick Start Guide In the beginning Support for debugging ● For remote debugging of the target make sure your toolchain includes cross-development gdb and cross-compiled gdbserver ● Ideally it should include debug symbols in all the libraries ● Ideally it should include source code for the libraries
  • 16. 16Embedded Linux Quick Start Guide In the beginning Other goodies ● Graphical IDE ● Eclipse with C/C++ Development Toolkit (CDT) ● Profilers ● Oprofile ● Memory patrol ● Tracers ● Linux Trace Toolkit
  • 17. 17Embedded Linux Quick Start Guide In the beginning Second element: bootloader ● Initialise the hardware ● Set up SDRAM controller ● Map memory ● Set processor mode and features ● Load a kernel ● Optional (but very useful) ● Load images via Ethernet, serial, SD card ● Erase and program flash memory ● Display splash screen
  • 18. 18Embedded Linux Quick Start Guide In the beginning Pre-boot loader ● Usually stored in flash memory ● Old days: NOR flash mapped to processor restart vector so whole boot loader stored as single image ● These days: first stage boot loader is stored in first page of NAND flash which is loaded by on-chip microcode ● Sequence: ● Pre-boot loader main boot loader kernel→ →
  • 19. 19Embedded Linux Quick Start Guide In the beginning Loading the kernel ● Primary task of boot loader is to ● Generate a description of the hardware – e.g. size and location of RAM, flash, ... ● Load a kernel image into memory ● (Optional) load a ramdisk image into memory ● Set the kernel command line (see later) ● Jump to kernel start vector, passing pointers to – information about hardware – kernel command line
  • 20. 20Embedded Linux Quick Start Guide In the beginning Bootloader-kernel ABI: ATAGS ARM (and some others) the kernel is passed values in two registers R1 = machine number R2 = Pointer to ATAGS list The ATAGS are a linked list of tagged values. For example ATAG_CORE ; mandatory (pagesize, rootdev) ATAG_MEM ; size, start physical addr ATAG_CMDLINE ; Kernel cmdline ATAG_NONE ; end of list
  • 21. 21Embedded Linux Quick Start Guide In the beginning Bootloader-kernel ABI: flattened Device Tree PPC (and others) use Flattened Device Tree (FDT) / device-tree name = “device-tree” model = “MyBoardName” ... PowerPC,970@0 name = "PowerPC,970" device_type = "cpu" ...memory@0 name = "memory" device_type = "memory" ... cpus name = "cpus" ....
  • 22. 22Embedded Linux Quick Start Guide In the beginning Examples of boot loaders ● (Das) U-Boot ● PPC, ARM, MIPS, SH4 ● http://www.denx.de/wiki/U-Boot/WebHome ● Redboot ● PPC, ARM, MIPS, SH4 ● http://sources.redhat.com/redboot/ ● For PC hardware use ● BIOS together with GRUB or LILO
  • 23. 23Embedded Linux Quick Start Guide In the beginning U-Boot command line Load a kernel image into memory from... NAND flash nand read 80100000 1000000 200000 SD card mmc rescan 1 fatload mmc 1:1 80100000 uimage TFTP server setenv ipaddr 192.168.1.2 setenv serverip 192.168.1.1 tftp 80100000 uImage Boot a kernel image in memory bootm 80100000
  • 24. 24Embedded Linux Quick Start Guide In the beginning U-Boot environment U-Boot U-Boot environment Kernel image, flash file systems, etc. Typical flash memory layout U-Boot commands for environment setenv ipaddr 192.168.1.101 printenv ipaddr savvenv
  • 25. 25Embedded Linux Quick Start Guide In the beginning Automating boot: bootcmd Set command to run when U-Boot starts setenv bootcmd tftp 80100000 uImage;bootm 80100000 Set delay before bootcmd is execcuted setelv bootdelay 3
  • 26. 26Embedded Linux Quick Start Guide In the beginning Summary ● Tool chain ● Cross or native ● Choice of C library: glibc, eglibc or uClibc ● Plus development libraries as needed ● Boot loader ● Initialises the hardware and loads a kernel ● Passes hardware description to kernel