Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall...

Post on 19-Dec-2015

221 views 2 download

Transcript of Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall...

Chapter 13Embedded Systems

Patricia RoyManatee Community College, Venice,

FL©2008, Prentice Hall

Operating Systems:Internals and Design Principles, 6/E

William Stallings

Embedded System

• Hardware and software designed to perform a dedicated function

• Tightly coupled to their environmnet

Examples

Examples

Embedded System Organization

Characteristics of Embedded Operating System

• Real-time operation• Reactive operation

– Respond to external events

• Configurability– Large variation in systems so need flexible

configuration

Characteristics of Embedded Operating System

• I/O device flexibility• Streamlined protection mechanisms• Direct use of interrupts

Adapting an Existing OS

• Add real-time capability• Streamlining operation• Add necessary functionality

eCos

• Embedded Configurable Operating Systems

• Open source• Royalty-free• Real-time OS• Most widely used embedded OS

eCos Configuration Tool

eCos Configuration Tool

Loading an eCos Configuration

eCos Layered Structure

Hardware Abstraction Layer

• Presents consistent API to upper layers• Different for each hardware platform

HAL

HAL Modules

• Architecture– Processor family type

• Variant– Support features of specific processor

• Platform– Support of tightly coupled peripherals

eCos Kernel

• Low interrupt latency• Low task switching latency• Small memory footprint• Deterministic behavior

Not in eCos Kernel

• Memory allocation• Device driver

eCos I/O System

• Framework for supporting device drivers

eCos Scheduler

• Bitmap scheduler– Efficient for small number of threads active– Each thread has different priority

Bitmap Scheduler

eCos Scheduler

• Multilevel queue scheduler– Appropriate when number of threads is

dynamic– Multiple threads at each priority– Time slicing

Multilevel Queue Scheduler

eCos Thread Synchronization

• Mutexes• Semaphores• Condition variables

eCos Thread Synchronization

• Event flags• Mailboxes• Spinlocks

– Useful in SMP (symmetric multiprocessing)

Mutexes

Mutexes and Condition Variables

Mutexes and Condition Variables

TinyOS

• 400 bytes of code• Not a real-time OS• No kernel• No memory protection

Tiny OS

• Component-based OS• No processes• No memory allocation• Interrupt and exception handling

dependent on peripheral• Nonblocking

Wireless Sensor Network Topology

TinyOS Goals

• Allow high concurrency• Operate with limited resources• Adapt to hardware evolution

TinyOS Goals

• Support a wide range of applications• Support a diverse set of platforms• Be robust

TinyOS Components

• Single-hop networking• Ad-hoc routing• Power management• Times• Nonvolatile storage control

TimerM Component

TimerM Configuration

TinyOS Scheduler

• Operates across all components• Only one task executes at one time• Simple FIFO queue

Example TinyOS Appliction

Example TinyOS Appliction

TinyOS Resource Interface

• Dedicated• Virtualized• Shared

Shared Resource Configuration