I n t r o d u c t i o n t o E mb e d d e d L i - - PowerPoint PPT Presentation

i n t r o d u c t i o n t o e mb e d d e d l i n u x
SMART_READER_LITE
LIVE PREVIEW

I n t r o d u c t i o n t o E mb e d d e d L i - - PowerPoint PPT Presentation

J o i n t I C T P - I A E A S c h o o l o n Z y n q - 7 0 0 0 S o C a n d i t s A p p l i c a t i o n s f o r N u c l e a r a n d R e l a t e d I n s t r u me n t a t


slide-1
SLIDE 1

Smr3143 – ICTP & IAEA (Aug. & Sept. 2017)

J

  • i

n t I C T P

  • I

A E A S c h

  • l
  • n

Z y n q

  • 7

S

  • C

a n d i t s A p p l i c a t i

  • n

s f

  • r

N u c l e a r a n d R e l a t e d I n s t r u me n t a t i

  • n

I n t r

  • d

u c t i

  • n

t

  • E

mb e d d e d L i n u x

Fernando Rincón

fernando.rincon@uclm.es

slide-2
SLIDE 2

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 2

Contents

  • Embedded OS
  • Embedded Linux
  • Linux Architecture
slide-3
SLIDE 3

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 3

Embedded OS

  • Embedded systems usually perform very simple tasks

– Monitor status of sensors – React to events following simple rules

  • Move motors
  • Activate relays
  • Send data
  • Complex applications may have more requirements

– Concurrent execution – Real-time management – Resource multiplexion – Advanced communication mechanisms

  • Purpose of the OS → Release the user from those complex tasks
slide-4
SLIDE 4

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 4

Desktop vs Embedded

  • Main diferences

– Small footprint, and tailored to the specifc need – Custom peripheral drivers. – Less protection mechanisms

  • Even no Memory management Unit (MMU)

– Real-time – Lack of very simplistic user-interface – Sometimes no network connection

  • Although the trend is to have everything connected
slide-5
SLIDE 5

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 5

Embedded OS Development

  • Cross-development

– Host machine: develoment enviroment and tools

  • Cross-compiler

– Diferent versions for bare-metal and OS development

  • Mostly because of the linked libraries
  • Ex: arm-none- vs arm-xilinx-linux
  • Target root flesystem & basic libraries for compilation purposes

– Target machine:

  • Bootloader
  • Kernel
  • Root flesystem
  • Cross-platform design cycle

– Compile → test → debug – Use of emulators

  • Bootstrap process:

– Flash – Network – ...

slide-6
SLIDE 6

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 6

Why Linux?

  • Low cost of ownership
  • Open-source, full control and customizability
  • Rich feature set
  • Quality of Linux components
  • Re-use of Linux components
  • Big active developer community & resources
  • Pool of talented embedded Linux developers
  • Scalability, from embedded to the cluster
  • Standard tools and run-time environment
slide-7
SLIDE 7

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 7

What does Linux Ofer?

  • Multiple processor achitectures supported

– ARM, MIPS, PowerPC, x84, amd64, Microblaze, …

  • Reduced foot print (a few MB) and fast booting times (~4 s)
  • Networking:

– full support for TCP/IP, Wif, Bluetooth, USB, …

  • Graphics:

– X, Frame Bufer & DRM/KMS. – Graphical development libraries QT, Gnome, …

  • Multimedia:

– Video4Linux & Gstreamer, FFMPeg, OpenCV, …

slide-8
SLIDE 8

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 8

What Does Linux Ofer?

  • Interoperability and OS infrastructure

– Networking, fle systems, device support – Scheduling, processes/threads, interrupt handling, interprocess

communication, symmetric multiprocessing (SMP)

  • Developer familiarity

– Standard tools – Standard run-time environment – Application code can be prototyped on the desktop

  • Scalability

– Deeply embedded → single board computers → desktop → server → cluster

  • Freedom and openness

– Accessibility to modify source code

slide-9
SLIDE 9

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 9

Linux Components

Hardware QEMU Libraries – Graphics, Video, Networking, etc. Application Utilities User Applications

Root File system (rootfs)

U-boot First Stage Boot Loader

Boot Loader

Linux Kernel Device Drivers

Kernel Image Board Support Package (BSP): Collection of SoC/board specific Linux components that include Linux kernel & device drivers, boot loader and tools

Linux Build & Development Tool GNU Cross-Compiler tool chain & Debugger

Tools

Linux Build tools: PetaLinux, Yocto, OpenEmbedded, buildroot Other tool chains: Linaro, GCC mainline

slide-10
SLIDE 10

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 10

Anatomy of a Linux System

  • User applications

– Task specifc – Libraries – C run time, networking, – graphics, for example

  • Kernel

– More on this soon

  • Hardware

– CPU, memory – Timer, interrupt controller, I/O

slide-11
SLIDE 11

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 11

Linux Kernel Architecture Overview

  • System call interface (SCI)

– Function calls from user space to

kernel

  • Process management

– Processes or threads – Share the CPU between the active

threads

  • Memory management

– Manages the virtual and physical

memory

  • Virtual fle system

– Switching layer between the SCI

and the fle systems supported by Linux

slide-12
SLIDE 12

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 12

Linux Kernel Architecture Overview

  • Network stack

– Above TCP, socket layer – Invoked through the SCI

  • Device drivers

– Supports most of the common

devices

  • Architecture-dependent code

(BSP)

– Processor and platform-specifc

code

slide-13
SLIDE 13

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 13

System Call Interface

  • Contract between user space and kernel space

– Request services – Memory, I/O – Process management

  • The standard C library is a wrapper around the system call interface

– For example, malloc()

is a C library call

  • Maintains a pool of memory
  • Calls kernel memory allocator only when that pool is exhausted
slide-14
SLIDE 14

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 14

Virtual Memory

slide-15
SLIDE 15

Introduction to Petalinux Smr3143 – ICTP & IAEA (Aug. & Sept. 2017) 15

Linux distributions