SlideShare una empresa de Scribd logo
1 de 28
Embedded Linux
Workshop India
Wilson Wingston Sharon
wingston.sharon@gmail.com
What are embedded systems?
• Embedded systems are self contained intelligent electronic
  control systems.

• They contain a microcontroller / microprocessor and
  peripherals interfaced to perform a particular series of tasks.

• Embedded systems today run almost every electronic device
  imaginable from TV’s to washing machine.

• Embedded systems also can be used for self-contained
  intelligent automated systems.
Simple Embedded Example
• An AVR microcontroller. Atmega328.

• Contains all hardware necessary to perform computational tasks
  onboard provided power is given to it.

• Communicates with the outside world via gpio pins.

• Can be used to read data from a sensor connected to it and analyze
  that. (e.g.: IR

• Can be interfaces to motors and set to control the movement of the
  motors depending on the sensor input.

• Then, the microcontroller can be put on-board a bot and be asked to
  perform line following!
Programming simple MC’s
• Microcontrollers are defined by their architecture and bus bit
  width.
• The atmega is an 8 bit AVR series microcontroller.

• To program the atmega we need
  • A Compiler to compile C code for the atmega328
  • A Flash/EPROM burning device

• The cross compiler convers our code from C to the hex op
  code that can be placed in the atmega’s internal memory.

• The atmega executes each instruction sequentially!
The problem!
• When we program in native C for a microcontroller, we need to be
  intimately aware of the underlying hardware.

• To control the atmega’s behavior we need to engage in register level
  programming.

• This makes the code non-portable as the program is now written to
  run on only one controller!

• Even different atmega that has different pinouts and register names
  will require a complete rewrite of most of the code before the
  program can work on it.

• As more advanced microcontrollers / microprocessors emerged into
  the market, register level programming needed an alternative to
  avoid over specializing developers.
Hardware available
• Hardware manufactures keep increasing complexity and
  system performance.

• The higher processing power comes with the price of too
  much registers with individual internal controlling
  methodology

• Hardware manufacturers needed to abstract their hardware to
  be able to support easier development.
• Software developers needed a generalized framework where
  they cab build their applications without worrying about their
  hardware.
Hardware v/s software
• Objective : Getting your code to sense / control external devices.

• The more complex your hardware is, the more requirements it will have
  in respect to code to write control mechanism.

• If a stand-alone application is required to be developed
   • Multiple (internal / external) devices have to be managed in the background
   • I/O of different devices must be managed and processed as per demand.
   • Interrupts / clocks / power must be managed to keep the microcontroller
     running.

• This calls for increased debugging / non portability and results in
  increased development time / bugs in the system.

• If hardware is as complicated and powerful as a computer (SBC) then we
  need code comparable to that of an Operating System (DOS) to be able
  to run it!!
Line between HW / SW
• Very few processors can be programmed by flash burning with
  ICSP. (e.g: ARM5)

• Modern communication standards are replacing “legacy” RS-
  232 with USB, I2C ,Ethernet etc.

• The software control of these protocols in the Atmega register
  level way is too complex.

• Harware manufacturers release “Drivers” or libraries for
  controlling their hardware to software developers which
  allows for more efficient usage of the underlying hardware.
Embedded Linux


Hardware         Kernel              Userland

   • Processor      • Kernel            • This is
   • RAM              developers          where user
   • GPIO             work on             level
                      hardware            application
   • Clocks
                      control of          programs
   • UART             the devices.        are written.
   • I2C
Embedded Linux
• In 1990s, an underground software movement consisting of the
  worlds leading developers and programmers wrote a completely
  free Operating System!

• As more people used it with the FOSS philosophy, improvements,
  fixes and support for multiple processors creeped in!

• This resulted in Linux (the very same kernel ) to run on many
  processors and provide a similar level of functionality.

• A Global collaborative effort for improvements and upgrades make
  linux so popular with hardware developers
• Most of the time, linux gets fixes and support for new hardware as
  soon as they are available!
Application Developers
• Embedded developers prefer a non black box OS distribution.

• Although Software application are completely abstracted away
  from the hardware, it is still requirement that slight changes /
  improvements in the OS code could make the application a lot
  more efficiently on the developers embedded target.

• The HAL (Hardware Abstraction Layer) lets you focus on image
  recognition and not memory management!

• The Open Source Linux Kernel Project provids a HAL that is
  ported to wide range of processors and has driver support for
  almost every hardware device in the market.
Linux -> Embedded Linux
• Linux for x86 and amd64 (desktop architectures) require
  almost 100 - 500mb.

• Embedded Devices have more strict requirements in terms of
  memory and processing power.

• Embedded Linux kernels can go as low of 11Mb when placed
  in RAM.

• A non distribtion based linux – with only kernel and a minimal
  filesystem for a “dos” – like usage is usually run.
• Any custom linux libraries for hardware / software can be
  installed to help with application development.
Starting the Hardware
• When the hardware is switched on, the OS is present in some
  onboard memory peripheral.

• First there is code called a bootloader that initializes all the
  required hardware on the board.
• Bootloaders are small programs (4 – 16K) written for and
  compiled for specific hardware to be executed immediately
  after start.

• The bootloader starts the board and loads the kernel from
  where-ever it is into RAM.

• Once the Kernel starts executing from RAM, it takes over and
  starts a linux session!
Types of Bootloaders
• Intel Motherboard : PHOENIX BIOS :
  • This bootloader is present on most intel based laptops.
  • It starts the laptop hardware and loads “NTLDR” the windows
    bootmanager.
  • This code is hardwired into the mother board.



• Embedded Hardware
  • Bootloader is usually places in a NAND Flash memory.
  • Bootloaders are very small.
  • They load, uncompress the linux kernel and relenquish control..
Kernel
• Designed as a Finnish UG (B.tech eq) student’s hobby project.

• First was made as a UNIC port for a motorola 64Kb machine that
  made Linux designed for Portability.

• The groundwork and FOSS nature allowed the kernel to be ported to
  (and thus support) almost every hardware platform on/off the
  market.

• The base for extending the kernel through “Device Drivers” have
  hardware manufactures / driver developers to release support for
  any hardware available.

• Kernel is just a runtime HAL! It just has instructions for running the
  hardware – something has to give it instructions -> RootFS..
Linux system Design
Filesystem (UserLand)
• Filesystem : Collection of directories

• These directories follow a tree heirarchy and contain
  •   Executable files or programs that the kernel loads into memory
  •   Libraries for application to link to at run-time
  •   User Application that can be simply installed onto it
  •   Setting files that control the Linux OS’s behaviour.

• Hardware devices are also linked as special file nodes in the
  filesystem to connect them to the Kernel’s HAL.

• USB drives / HDDs / SD cards are mounted onto the filesystem
  and can be browsed as usual.
Cross Compilers and
Toolchains
• Different Hardware – Same Source code?

• Cross Compilers are called the translators to machine language for
  different architectures.

• Hardware manufactures and developers develop a toolchain for
  their architectures.
• The toolchain contain all the utilities required to compile, debug
  code and link for the processor.
• There is a GNU toolchain for AVR and ARM architectures.
• The same source code when used with different cross compilers
  allow for targeting different platforms.

• The changes in code required for a particular hardware is managed
  with localised “patches”.
Applications
• Headless units : Devices without the need for a graphical display
    • Routers
    • Set Top Box
• GUI based Applications
    • Touch Smartphones
    • GPS car navigation multimedia systems.

• Application developers have:
    •   System level functionality if required
    •   Shared libraries for efficient management of resources
    •   Linux kernel provided complete HAL
    •   Same code workable of various devices

•   Android is a Linux Kernel and FS example!
•   Android will run on any phone that linux can work in.
•   Phone developers have a unified Free OS to work with.
•   Cheaper and more wide variety of applications!
Drivers
• Run time modules attached to the linux kernel to manage hardware
  peripherals

• USB Wifi
• Camera
• GPS

• Unified driver API that makes it easy to write Driver Code that
  integrated to the main Kernel.

• Hardware that is accepted to the main repository (upstream) means
  that everybody has access to the driver for that hardware!

• Linux drivers need not be released as source – which means
  hardware manufactures can release their driver in binary format.
  (becomes proprietary)
Libraries
• C library
  • Provides an interface to the kenel functions via calls from
    userland.

• Stripped down minimal C libraries are there for use in
  embedded devices.
  • GlibC (Full Featured)
  • uCibC (Minimal Variant)

• POSIX support
  • Allows for communication job sceduling, multiprocessing and IPC
    in a unified framework.
• ALSA
  • Advanced Linux Sound Architecture for Hardware DSP support
Custom Applications
• Compiled with appropriate cross-compiler as UNIX / POSIX
  Compliant applications

• BusyBox
  •   Provides an embedded shell functionality in embedded devices
  •   cd ls mkdir echo cat and all standard linux commands all work
  •   I/O can be managed over a serial line
  •   Can be thought of as a terminal equivalent
  •   Commands allow for direct control of the kernel
  •   Helps navigate the filesystem

• Qt GUI applications can also be built if LCD is present.
Run Time Linux
• Serial Console

• Apps that can be autostarted

• Daemons or “services” that provide background application
  functionality

• Kernel Threads for Real-Time interrupt management

• RTOS supprt in RT-Linux Project.
Memory Considerations
• Linux works primarily on processors with a hardware MMU.
  (memory management unit)

• MMU enforces copy and access violation protection in RAM
  between kernel, hardware and user application to make sure
  system can be kept stable at all times.

• Virtual Memory allows for run-time linking and delinking of un
  responsive kernel modules / application to keep the system
  functioning even in the event of a crash.
Try for yourself
• devmem2
  • Memory inspector



• ps
  • Running processors



• cat files in /proc
  • Gives you current system information
Open source Licenses
• Basic funda
   • Us at your own Risk
   • No guarantee
   • We’ll help if we CAN. We don’t need to.

• GPLv2
   • GNU Public Licence
   • Source must accompany binary
   • Linkng to non GPL software not possible.

• LGPL
   • Link to non GPL software possible
   • To provide for non open source driver development
   • LGPL source must be provided

• Modified Free-BSD
   • No source delivery required
   • For proprietary kernels
   • Broken and non FOSS supported Forks

Más contenido relacionado

La actualidad más candente

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Yocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distributionemertxemarketing
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loaderiamumr
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot) Omkar Rane
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting ProcessGaurav Sharma
 
Introduction to Embedded Linux
Introduction to Embedded LinuxIntroduction to Embedded Linux
Introduction to Embedded LinuxHossain Reja
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded LinuxTushar B Kute
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture amrutachintawar239
 
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeRISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeAtish Patra
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 

La actualidad más candente (20)

Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 
Yocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distribution
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loader
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
linux device driver
linux device driverlinux device driver
linux device driver
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
Introduction to Embedded Linux
Introduction to Embedded LinuxIntroduction to Embedded Linux
Introduction to Embedded Linux
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded Linux
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture
 
Gnu debugger
Gnu debuggerGnu debugger
Gnu debugger
 
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeRISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 

Destacado

Embedded linux system development (slides)
Embedded linux system development (slides)Embedded linux system development (slides)
Embedded linux system development (slides)Jaime Barragan
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionSherif Mousa
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoSherif Mousa
 
Building Embedded Linux
Building Embedded LinuxBuilding Embedded Linux
Building Embedded LinuxSherif Mousa
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerSherif Mousa
 

Destacado (6)

Embedded linux system development (slides)
Embedded linux system development (slides)Embedded linux system development (slides)
Embedded linux system development (slides)
 
Embedded Linux
Embedded LinuxEmbedded Linux
Embedded Linux
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to Yocto
 
Building Embedded Linux
Building Embedded LinuxBuilding Embedded Linux
Building Embedded Linux
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution Maker
 

Similar a Embedded linux

Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systemsVandana Salve
 
Mces MOD 1.pptx
Mces MOD 1.pptxMces MOD 1.pptx
Mces MOD 1.pptxRadhaC10
 
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
 
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI Alliance
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
Linux – an introduction
Linux – an introductionLinux – an introduction
Linux – an introductionWingston
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsNational Cheng Kung University
 
Operating Systems 1 (4/12) - Architectures (Windows)
Operating Systems 1 (4/12) - Architectures (Windows)Operating Systems 1 (4/12) - Architectures (Windows)
Operating Systems 1 (4/12) - Architectures (Windows)Peter Tröger
 
Introduction to Operating system CBSE
Introduction to Operating system CBSE Introduction to Operating system CBSE
Introduction to Operating system CBSE PrashantChahal3
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandAhmed El-Arabawy
 
Raspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionRaspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionMohamed Abdallah
 
Chapter 1 - Introduction to Operating System.pptx
Chapter 1 - Introduction to Operating System.pptxChapter 1 - Introduction to Operating System.pptx
Chapter 1 - Introduction to Operating System.pptxgowthamiv26
 
Central Processing Unit
Central Processing Unit Central Processing Unit
Central Processing Unit Alaka Acharya
 
Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Ahmed El-Arabawy
 

Similar a Embedded linux (20)

Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Mces MOD 1.pptx
Mces MOD 1.pptxMces MOD 1.pptx
Mces MOD 1.pptx
 
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
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Linux
LinuxLinux
Linux
 
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
 
Intro to linux
Intro to linux Intro to linux
Intro to linux
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Linux – an introduction
Linux – an introductionLinux – an introduction
Linux – an introduction
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
Operating Systems 1 (4/12) - Architectures (Windows)
Operating Systems 1 (4/12) - Architectures (Windows)Operating Systems 1 (4/12) - Architectures (Windows)
Operating Systems 1 (4/12) - Architectures (Windows)
 
Overview.ppt
Overview.pptOverview.ppt
Overview.ppt
 
Platform-Technology.pdf
Platform-Technology.pdfPlatform-Technology.pdf
Platform-Technology.pdf
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Introduction to Operating system CBSE
Introduction to Operating system CBSE Introduction to Operating system CBSE
Introduction to Operating system CBSE
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS Land
 
Raspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionRaspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 Introduction
 
Chapter 1 - Introduction to Operating System.pptx
Chapter 1 - Introduction to Operating System.pptxChapter 1 - Introduction to Operating System.pptx
Chapter 1 - Introduction to Operating System.pptx
 
Central Processing Unit
Central Processing Unit Central Processing Unit
Central Processing Unit
 
Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land
 

Más de Wingston

OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012Wingston
 
05 content providers - Android
05   content providers - Android05   content providers - Android
05 content providers - AndroidWingston
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - AndroidWingston
 
03 layouts & ui design - Android
03   layouts & ui design - Android03   layouts & ui design - Android
03 layouts & ui design - AndroidWingston
 
02 hello world - Android
02   hello world - Android02   hello world - Android
02 hello world - AndroidWingston
 
01 introduction & setup - Android
01   introduction & setup - Android01   introduction & setup - Android
01 introduction & setup - AndroidWingston
 
OpenCV with android
OpenCV with androidOpenCV with android
OpenCV with androidWingston
 
C game programming - SDL
C game programming - SDLC game programming - SDL
C game programming - SDLWingston
 
C programming - Pointers
C programming - PointersC programming - Pointers
C programming - PointersWingston
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02Wingston
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral InterfacingWingston
 
03 analogue anrduino fundamentals
03   analogue anrduino fundamentals03   analogue anrduino fundamentals
03 analogue anrduino fundamentalsWingston
 
02 General Purpose Input - Output on the Arduino
02   General Purpose Input -  Output on the Arduino02   General Purpose Input -  Output on the Arduino
02 General Purpose Input - Output on the ArduinoWingston
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
4.content mgmt
4.content mgmt4.content mgmt
4.content mgmtWingston
 
8 Web Practices for Drupal
8  Web Practices for Drupal8  Web Practices for Drupal
8 Web Practices for DrupalWingston
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in DrupalWingston
 
6 Special Howtos for Drupal
6 Special Howtos for Drupal6 Special Howtos for Drupal
6 Special Howtos for DrupalWingston
 
5 User Mgmt in Drupal
5 User Mgmt in Drupal5 User Mgmt in Drupal
5 User Mgmt in DrupalWingston
 

Más de Wingston (20)

OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012
 
05 content providers - Android
05   content providers - Android05   content providers - Android
05 content providers - Android
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
03 layouts & ui design - Android
03   layouts & ui design - Android03   layouts & ui design - Android
03 layouts & ui design - Android
 
02 hello world - Android
02   hello world - Android02   hello world - Android
02 hello world - Android
 
01 introduction & setup - Android
01   introduction & setup - Android01   introduction & setup - Android
01 introduction & setup - Android
 
OpenCV with android
OpenCV with androidOpenCV with android
OpenCV with android
 
C game programming - SDL
C game programming - SDLC game programming - SDL
C game programming - SDL
 
C programming - Pointers
C programming - PointersC programming - Pointers
C programming - Pointers
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral Interfacing
 
03 analogue anrduino fundamentals
03   analogue anrduino fundamentals03   analogue anrduino fundamentals
03 analogue anrduino fundamentals
 
02 General Purpose Input - Output on the Arduino
02   General Purpose Input -  Output on the Arduino02   General Purpose Input -  Output on the Arduino
02 General Purpose Input - Output on the Arduino
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
4.content mgmt
4.content mgmt4.content mgmt
4.content mgmt
 
8 Web Practices for Drupal
8  Web Practices for Drupal8  Web Practices for Drupal
8 Web Practices for Drupal
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in Drupal
 
6 Special Howtos for Drupal
6 Special Howtos for Drupal6 Special Howtos for Drupal
6 Special Howtos for Drupal
 
5 User Mgmt in Drupal
5 User Mgmt in Drupal5 User Mgmt in Drupal
5 User Mgmt in Drupal
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
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
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
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
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
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
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
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
 

Embedded linux

  • 1. Embedded Linux Workshop India Wilson Wingston Sharon wingston.sharon@gmail.com
  • 2. What are embedded systems? • Embedded systems are self contained intelligent electronic control systems. • They contain a microcontroller / microprocessor and peripherals interfaced to perform a particular series of tasks. • Embedded systems today run almost every electronic device imaginable from TV’s to washing machine. • Embedded systems also can be used for self-contained intelligent automated systems.
  • 3. Simple Embedded Example • An AVR microcontroller. Atmega328. • Contains all hardware necessary to perform computational tasks onboard provided power is given to it. • Communicates with the outside world via gpio pins. • Can be used to read data from a sensor connected to it and analyze that. (e.g.: IR • Can be interfaces to motors and set to control the movement of the motors depending on the sensor input. • Then, the microcontroller can be put on-board a bot and be asked to perform line following!
  • 4. Programming simple MC’s • Microcontrollers are defined by their architecture and bus bit width. • The atmega is an 8 bit AVR series microcontroller. • To program the atmega we need • A Compiler to compile C code for the atmega328 • A Flash/EPROM burning device • The cross compiler convers our code from C to the hex op code that can be placed in the atmega’s internal memory. • The atmega executes each instruction sequentially!
  • 5. The problem! • When we program in native C for a microcontroller, we need to be intimately aware of the underlying hardware. • To control the atmega’s behavior we need to engage in register level programming. • This makes the code non-portable as the program is now written to run on only one controller! • Even different atmega that has different pinouts and register names will require a complete rewrite of most of the code before the program can work on it. • As more advanced microcontrollers / microprocessors emerged into the market, register level programming needed an alternative to avoid over specializing developers.
  • 6. Hardware available • Hardware manufactures keep increasing complexity and system performance. • The higher processing power comes with the price of too much registers with individual internal controlling methodology • Hardware manufacturers needed to abstract their hardware to be able to support easier development. • Software developers needed a generalized framework where they cab build their applications without worrying about their hardware.
  • 7. Hardware v/s software • Objective : Getting your code to sense / control external devices. • The more complex your hardware is, the more requirements it will have in respect to code to write control mechanism. • If a stand-alone application is required to be developed • Multiple (internal / external) devices have to be managed in the background • I/O of different devices must be managed and processed as per demand. • Interrupts / clocks / power must be managed to keep the microcontroller running. • This calls for increased debugging / non portability and results in increased development time / bugs in the system. • If hardware is as complicated and powerful as a computer (SBC) then we need code comparable to that of an Operating System (DOS) to be able to run it!!
  • 8. Line between HW / SW • Very few processors can be programmed by flash burning with ICSP. (e.g: ARM5) • Modern communication standards are replacing “legacy” RS- 232 with USB, I2C ,Ethernet etc. • The software control of these protocols in the Atmega register level way is too complex. • Harware manufacturers release “Drivers” or libraries for controlling their hardware to software developers which allows for more efficient usage of the underlying hardware.
  • 9.
  • 10. Embedded Linux Hardware Kernel Userland • Processor • Kernel • This is • RAM developers where user • GPIO work on level hardware application • Clocks control of programs • UART the devices. are written. • I2C
  • 11. Embedded Linux • In 1990s, an underground software movement consisting of the worlds leading developers and programmers wrote a completely free Operating System! • As more people used it with the FOSS philosophy, improvements, fixes and support for multiple processors creeped in! • This resulted in Linux (the very same kernel ) to run on many processors and provide a similar level of functionality. • A Global collaborative effort for improvements and upgrades make linux so popular with hardware developers • Most of the time, linux gets fixes and support for new hardware as soon as they are available!
  • 12. Application Developers • Embedded developers prefer a non black box OS distribution. • Although Software application are completely abstracted away from the hardware, it is still requirement that slight changes / improvements in the OS code could make the application a lot more efficiently on the developers embedded target. • The HAL (Hardware Abstraction Layer) lets you focus on image recognition and not memory management! • The Open Source Linux Kernel Project provids a HAL that is ported to wide range of processors and has driver support for almost every hardware device in the market.
  • 13. Linux -> Embedded Linux • Linux for x86 and amd64 (desktop architectures) require almost 100 - 500mb. • Embedded Devices have more strict requirements in terms of memory and processing power. • Embedded Linux kernels can go as low of 11Mb when placed in RAM. • A non distribtion based linux – with only kernel and a minimal filesystem for a “dos” – like usage is usually run. • Any custom linux libraries for hardware / software can be installed to help with application development.
  • 14. Starting the Hardware • When the hardware is switched on, the OS is present in some onboard memory peripheral. • First there is code called a bootloader that initializes all the required hardware on the board. • Bootloaders are small programs (4 – 16K) written for and compiled for specific hardware to be executed immediately after start. • The bootloader starts the board and loads the kernel from where-ever it is into RAM. • Once the Kernel starts executing from RAM, it takes over and starts a linux session!
  • 15. Types of Bootloaders • Intel Motherboard : PHOENIX BIOS : • This bootloader is present on most intel based laptops. • It starts the laptop hardware and loads “NTLDR” the windows bootmanager. • This code is hardwired into the mother board. • Embedded Hardware • Bootloader is usually places in a NAND Flash memory. • Bootloaders are very small. • They load, uncompress the linux kernel and relenquish control..
  • 16. Kernel • Designed as a Finnish UG (B.tech eq) student’s hobby project. • First was made as a UNIC port for a motorola 64Kb machine that made Linux designed for Portability. • The groundwork and FOSS nature allowed the kernel to be ported to (and thus support) almost every hardware platform on/off the market. • The base for extending the kernel through “Device Drivers” have hardware manufactures / driver developers to release support for any hardware available. • Kernel is just a runtime HAL! It just has instructions for running the hardware – something has to give it instructions -> RootFS..
  • 18. Filesystem (UserLand) • Filesystem : Collection of directories • These directories follow a tree heirarchy and contain • Executable files or programs that the kernel loads into memory • Libraries for application to link to at run-time • User Application that can be simply installed onto it • Setting files that control the Linux OS’s behaviour. • Hardware devices are also linked as special file nodes in the filesystem to connect them to the Kernel’s HAL. • USB drives / HDDs / SD cards are mounted onto the filesystem and can be browsed as usual.
  • 19.
  • 20. Cross Compilers and Toolchains • Different Hardware – Same Source code? • Cross Compilers are called the translators to machine language for different architectures. • Hardware manufactures and developers develop a toolchain for their architectures. • The toolchain contain all the utilities required to compile, debug code and link for the processor. • There is a GNU toolchain for AVR and ARM architectures. • The same source code when used with different cross compilers allow for targeting different platforms. • The changes in code required for a particular hardware is managed with localised “patches”.
  • 21. Applications • Headless units : Devices without the need for a graphical display • Routers • Set Top Box • GUI based Applications • Touch Smartphones • GPS car navigation multimedia systems. • Application developers have: • System level functionality if required • Shared libraries for efficient management of resources • Linux kernel provided complete HAL • Same code workable of various devices • Android is a Linux Kernel and FS example! • Android will run on any phone that linux can work in. • Phone developers have a unified Free OS to work with. • Cheaper and more wide variety of applications!
  • 22. Drivers • Run time modules attached to the linux kernel to manage hardware peripherals • USB Wifi • Camera • GPS • Unified driver API that makes it easy to write Driver Code that integrated to the main Kernel. • Hardware that is accepted to the main repository (upstream) means that everybody has access to the driver for that hardware! • Linux drivers need not be released as source – which means hardware manufactures can release their driver in binary format. (becomes proprietary)
  • 23. Libraries • C library • Provides an interface to the kenel functions via calls from userland. • Stripped down minimal C libraries are there for use in embedded devices. • GlibC (Full Featured) • uCibC (Minimal Variant) • POSIX support • Allows for communication job sceduling, multiprocessing and IPC in a unified framework. • ALSA • Advanced Linux Sound Architecture for Hardware DSP support
  • 24. Custom Applications • Compiled with appropriate cross-compiler as UNIX / POSIX Compliant applications • BusyBox • Provides an embedded shell functionality in embedded devices • cd ls mkdir echo cat and all standard linux commands all work • I/O can be managed over a serial line • Can be thought of as a terminal equivalent • Commands allow for direct control of the kernel • Helps navigate the filesystem • Qt GUI applications can also be built if LCD is present.
  • 25. Run Time Linux • Serial Console • Apps that can be autostarted • Daemons or “services” that provide background application functionality • Kernel Threads for Real-Time interrupt management • RTOS supprt in RT-Linux Project.
  • 26. Memory Considerations • Linux works primarily on processors with a hardware MMU. (memory management unit) • MMU enforces copy and access violation protection in RAM between kernel, hardware and user application to make sure system can be kept stable at all times. • Virtual Memory allows for run-time linking and delinking of un responsive kernel modules / application to keep the system functioning even in the event of a crash.
  • 27. Try for yourself • devmem2 • Memory inspector • ps • Running processors • cat files in /proc • Gives you current system information
  • 28. Open source Licenses • Basic funda • Us at your own Risk • No guarantee • We’ll help if we CAN. We don’t need to. • GPLv2 • GNU Public Licence • Source must accompany binary • Linkng to non GPL software not possible. • LGPL • Link to non GPL software possible • To provide for non open source driver development • LGPL source must be provided • Modified Free-BSD • No source delivery required • For proprietary kernels • Broken and non FOSS supported Forks