Operating Systems Internals and Design Principles 6E William

  • Slides: 41
Download presentation
Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 13 Embedded Systems Patricia

Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL © 2008, Prentice Hall

Embedded System • Hardware and software designed to perform a dedicated function • Tightly

Embedded System • Hardware and software designed to perform a dedicated function • Tightly coupled to their environmnet

Examples

Examples

Examples

Examples

Embedded System Organization

Embedded System Organization

Characteristics of Embedded Operating System • Real-time operation • Reactive operation – Respond to

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 •

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

Adapting an Existing OS • Add real-time capability • Streamlining operation • Add necessary functionality

e. Cos • Embedded Configurable Operating Systems • Open source • Royalty-free • Real-time

e. Cos • Embedded Configurable Operating Systems • Open source • Royalty-free • Real-time OS • Most widely used embedded OS

e. Cos Configuration Tool

e. Cos Configuration Tool

e. Cos Configuration Tool

e. Cos Configuration Tool

Loading an e. Cos Configuration

Loading an e. Cos Configuration

e. Cos Layered Structure

e. Cos Layered Structure

Hardware Abstraction Layer • Presents consistent API to upper layers • Different for each

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

HAL

HAL

HAL Modules • Architecture – Processor family type • Variant – Support features of

HAL Modules • Architecture – Processor family type • Variant – Support features of specific processor • Platform – Support of tightly coupled peripherals

e. Cos Kernel • • Low interrupt latency Low task switching latency Small memory

e. Cos Kernel • • Low interrupt latency Low task switching latency Small memory footprint Deterministic behavior

Not in e. Cos Kernel • Memory allocation • Device driver

Not in e. Cos Kernel • Memory allocation • Device driver

e. Cos I/O System • Framework for supporting device drivers

e. Cos I/O System • Framework for supporting device drivers

e. Cos Scheduler • Bitmap scheduler – Efficient for small number of threads active

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

Bitmap Scheduler

Bitmap Scheduler

e. Cos Scheduler • Multilevel queue scheduler – Appropriate when number of threads is

e. Cos Scheduler • Multilevel queue scheduler – Appropriate when number of threads is dynamic – Multiple threads at each priority – Time slicing

Multilevel Queue Scheduler

Multilevel Queue Scheduler

e. Cos Thread Synchronization • Mutexes • Semaphores • Condition variables

e. Cos Thread Synchronization • Mutexes • Semaphores • Condition variables

e. Cos Thread Synchronization • Event flags • Mailboxes • Spinlocks – Useful in

e. Cos Thread Synchronization • Event flags • Mailboxes • Spinlocks – Useful in SMP (symmetric multiprocessing)

Mutexes

Mutexes

Mutexes and Condition Variables

Mutexes and Condition Variables

Mutexes and Condition Variables

Mutexes and Condition Variables

Tiny. OS • • 400 bytes of code Not a real-time OS No kernel

Tiny. OS • • 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

Tiny OS • • Component-based OS No processes No memory allocation Interrupt and exception handling dependent on peripheral • Nonblocking

Wireless Sensor Network Topology

Wireless Sensor Network Topology

Tiny. OS Goals • Allow high concurrency • Operate with limited resources • Adapt

Tiny. OS Goals • Allow high concurrency • Operate with limited resources • Adapt to hardware evolution

Tiny. OS Goals • Support a wide range of applications • Support a diverse

Tiny. OS Goals • Support a wide range of applications • Support a diverse set of platforms • Be robust

Tiny. OS Components • • • Single-hop networking Ad-hoc routing Power management Times Nonvolatile

Tiny. OS Components • • • Single-hop networking Ad-hoc routing Power management Times Nonvolatile storage control

Timer. M Component

Timer. M Component

Timer. M Configuration

Timer. M Configuration

Tiny. OS Scheduler • Operates across all components • Only one task executes at

Tiny. OS Scheduler • Operates across all components • Only one task executes at one time • Simple FIFO queue

Example Tiny. OS Appliction

Example Tiny. OS Appliction

Example Tiny. OS Appliction

Example Tiny. OS Appliction

Tiny. OS Resource Interface • Dedicated • Virtualized • Shared

Tiny. OS Resource Interface • Dedicated • Virtualized • Shared

Shared Resource Configuration

Shared Resource Configuration