You are on page 1of 19

FreeElectrons

Introduction toembedded Linux


MichaelOpdenacker ThomasPetazzoni FreeElectrons

Copyright2009,FreeElectrons. CreativeCommonsBYSA3.0license Latestupdate:May26,2010, Documentsources,updatesandtranslations: http://freeelectrons.com/docs/embeddedlinuxintro Corrections,suggestions,contributionsandtranslationsarewelcome!

FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Embeddedsystem?
An embedded system is a specialpurpose computer system designed to perform one or a few dedicated functions, often with realtime computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. In contrast, a general purpose computer, such as a personal computer, can do many different tasks depending on programming. Embeddedsystemscontrolmanyofthecommondevices inusetoday.
Wikipedia,http://en.wikipedia.org/wiki/Embedded_system

2
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Manydifferentsystems
Averygenericdefinition Coversverydifferenttypesofsystems Fuzzyborderwithstandardsystems. Consumerelectronics(CE)products Homerouters,DVDplayers,TVsets,digitalcameras,GPS, camcorders,mobilephones,microwaveovens... Industrialproducts Machinecontrol,alarms,surveillancesystems,automotive, rail,aircraft,satellite...

3
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Manydifferentproducts

4
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

EmbeddedLinux
TheFreeSoftwareandOpenSourceworldoffersabroad rangeoftoolstodevelopembeddedsystems. Advantages
Reuseofexistingcomponentsforthebasesystem. Allowstofocusontheaddedvalueoftheproduct. Highquality,provencomponents(Linuxkernel,Clibraries...) Completecontrolonthechoiceofcomponents. Modificationspossiblewithoutexternalconstraints. Communitysupport:tutorials,mailinglists... Lowcost,inparticularnoperunitroyalties. Potentiallylesslegalissues. Easieraccesstosoftwareandtools.
5
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Deviceexamples
GPS:TomTomandGarmin Homenetworkrouters:Linksys,Netgear PDA:Zaurus,NokiaN8x0 TVs,camcorders,DVDplayers:Sony,Philips Mobilephones:Motorola,Android,OpenMoko Industrialmachinery Andmanyotherproductsyoudon'tevenimagine...

6
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Quiz

ItworkswithLinux,butwhatisitfor?
7
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Answer

Tomilkcows!
8
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Globalarchitecture
Application Application

Tools

Library

Library

Library

StandardClibrary Linuxkernel Bootloader Hardware


9
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Embeddedhardware
Hardwareforembeddedsystemsisoftendifferentfrom hardwareforclassicalsystems.
OftenadifferentCPUarchitecture: oftenARM,MIPSorPowerPC.x86isalsoused. Storageonflashstorage,NORorNANDtype,oftenwith limitedcapacity(fromafewMBtohundredsofMB) LimitedRAMcapacity(fromafewMBtoseveraltensofMB) Manyinterconnectbusnotoftenfoundonthedesktop:I2C, SPI,SSP,CAN,etc.

Developmentboardsstarting fromafewhundredsofEUR/USD
Oftenusedasabasisforthefinalboarddesign.

10
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Examples
Picotux100 ARM755MHz,Netsilicon NS7520 2MBofflash 8MBofRAM Ethernet 5GPIOs Serial OpenMoko ARM920T400MHz, Samsung2442B 2MBofNORflash 128MBofRAM 256MBofNANDflash 640x480touchscreen, Bluetooth,GSM,serial, GPS,sound,2buttons, Wifi,USB,etc.

11
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Minimumrequirements
ACPUsupportedbygccandtheLinuxkernel
32bitCPU MMUlessCPUsarealsosupported,throughtheuClinuxproject.

AfewMBofRAM,from4MB. 8MBareneededtodoreallydosomething. AfewMBofstorage,from2MB. 4MBtoreallydosomething. Linuxisn'tdesignedforsmallmicrocontrollersthatjusthavea fewtensorhundredsofKBofflashandRAM.


Basemetal,noOS Reducedsystems,suchasFreeRTOS
12
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Softwarecomponents
Crosscompilationtoolchain
Compilerthatrunsonthedevelopmentmachine,butgenerates codeforthetarget

Bootloader
Startedbythehardware,responsibleforbasicinitialization,loading andexecutingthekernel

LinuxKernel
Containstheprocessandmemorymanagement,networkstack, devicedriversandprovidesservicestouserspaceapplications

Clibrary
Theinterfacebetweenthekernelandtheuserspaceapplications

Librariesandapplications
Thirdpartyorinhouse
13
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

EmbeddedLinuxwork
Severaldistincttasksareneededwhendeploying embeddedLinuxinaproduct BoardSupportPackagedevelopment
ABSPcontainsabootloaderandkernelwiththesuitabledevice driversforthetargetedhardware PurposeofourKernelDevelopmenttraining

Systemintegration
Integrateallthecomponents,bootloader,kernel,thirdpartylibraries andapplicationsandinhouseapplicationsintoaworkingsystem Purposeofthistraining

Developmentofapplications
NormalLinuxapplications,butusingspecificallychosenlibraries
14
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Rootfilesystem
InaLinuxsystem,several filesystemsaremountedandcreatea globalhierarchyoffilesand directories Aparticularfilesystem,theroot filesystem,ismountedas/ Onembeddedsystems,thisroot filesystemcontainsallthelibraries, applicationsanddataofthesystem Therefore,buildingtheroot filesystemisoneofthemaintasksof integratingembeddedLinux componentsintoadevice Thekernelisusuallykeptseparate
15
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Flashcontents

Bootloader Kernel

Root filesystem

Developmentenvironment
TwowaystoswitchtoembeddedLinux
UsesolutionsprovidedandsupportedbyvendorslikeMontaVista, WindRiverorTimeSys.Thesesolutionscomewiththeirown developmenttoolsandenvironment Usecommunitysolutions

InFreeElectronstrainings,wedonotpromoteaparticular vendor,andthereforeusecommunitysolutions
However,knowingtheconcepts,switchingtovendorsolutionswill beeasy

DoingembeddedLinuxdevelopmentrequiresLinuxonthe desktop
ThecommunitysolutionsusuallyonlyexistonLinux UnderstandingLinuxonthedesktopallowsyoutobetter understandLinuxonthedevice
16
FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Relateddocuments

Allourtechnicalpresentations onhttp://freeelectrons.com/docs Linuxkernel Devicedrivers Architecturespecifics EmbeddedLinuxsystemdevelopment


FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Howtohelp
Youcanhelpustoimproveandmaintainthisdocument... Bysendingcorrections,suggestions,contributionsand translations Byaskingyourorganizationtoorderdevelopment,consulting andtrainingservicesperformedbytheauthorsofthese documents(seehttp://freeelectrons.com/). Bysharingthisdocumentwithyourfriends,colleagues andwiththelocalFreeSoftwarecommunity. Byaddinglinksonyourwebsitetoouronlinematerials, toincreasetheirvisibilityinsearchengineresults.

FreeElectrons.Kernel,driversandembeddedLinuxdevelopment,consulting,trainingandsupport.http//freeelectrons.com

Linuxkernel Linuxdevicedrivers Boardsupportcode Mainstreamingkernelcode Kerneldebugging EmbeddedLinuxTraining Allmaterialsreleasedwithafreelicense! UnixandGNU/Linuxbasics Linuxkernelanddriversdevelopment RealtimeLinux,uClinux Developmentandprofilingtools Lightweighttoolsforembeddedsystems Rootfilesystemcreation Audioandmultimedia Systemoptimization

FreeElectrons
Ourservices
CustomDevelopment Systemintegration EmbeddedLinuxdemosandprototypes Systemoptimization Applicationandinterfacedevelopment Consultingandtechnicalsupport Helpindecisionmaking Systemarchitecture Systemdesignandperformancereview Developmenttoolandapplicationsupport Investigatingissuesandfixingtoolbugs

You might also like