Operating System Requirements for Embedded Systems Rabi Mahapatra.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Introduction CSCI 444/544 Operating Systems Fall 2008.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 Operating System Requirements for Embedded Systems Rabi Mahapatra.
CPU Scheduling. Schedulers Process migrates among several queues –Device queue, job queue, ready queue Scheduler selects a process to run from these queues.
Embedded and Real Time Systems Lecture #4 David Andrews
OS Spring’03 Introduction Operating Systems Spring 2003.
DPM Dynamic power management. DPM Tree DPM Timeout Adaptive Device dependent Predictive L-shape Exponential average Predictive wakeup Adaptive Disk shutdown.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
General What is an OS? What do you get when you buy an OS? What does the OS do? What are the parts of an OS? What is the kernel? What is a device.
Operating Systems Part III: Process Management (CPU Scheduling)
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
Review for Quiz-2 Applied Operating System Concepts Chap.s 1,2,6,7 - ECE3055b, Spring 2005.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  What Operating Systems Do  Computer-System Organization  Computer-System Architecture  Operating-System Structure.
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Real-Time Operating Systems RTOS For Embedded systems.
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Operating Systems Concepts
UNIT–II: Process Management
REAL-TIME OPERATING SYSTEMS
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
Chapter 3: Process Concept
CS 286 Computer Organization and Architecture
Chapter 1: Introduction
Real-time Software Design
RTS: Kernel Design and Cyclic Executives
Operating Systems CPU Scheduling.
CSCI 315 Operating Systems Design
Chapter 15, Exploring the Digital Domain
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
CPU SCHEDULING.
Lecture 4- Threads, SMP, and Microkernels
RTS: Kernel Design and Cyclic Executives
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Chapter 3: Process Concept
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Operating System Requirements for Embedded Systems Rabi Mahapatra

Complexity trends in OS OS functionality drives the complexity Router Small controllers sensors Home appliances Mobile phones PDAs Game Machines

Requirements of EOS Memory Resident: size is important consideration –Data structure optimized –Kernel optimized and usually in assembly language Support of signaling & interrupts Real-time scheduling – tight-coupled scheduler and interrupts Power Management capabilities –Power aware schedule –Control of non-processor resources

Embedded OS Design approach Networking support Traditional OS: Monolithic or Distribute Embedded: Layered is the key (Constantine D. P, UIUC 2000) Memory Management Real-Time Scheduler Interrupt & signalling Basic Loader Power Management Custom device support

Power Management by OS Static Approach: Rely on pre-set parameters –Example: switch off the power to devices that are not in use for a while (pre-calculated number of cycles). Used in laptops now. Dynamic Approach: Based on dynamic condition of workloads and per specification of power optimization guidelines –Example: Restrict multitasking progressively, reduce context switching, even avoid cache/memory access, etc..

Popular E-OS WinCE (proprietary, optimized assembly..) VxWorks Micro Linux MuCOS Java Virtual Machine (Picojava) OS –Most likely first open EOS!

Interrupts Each device has 1-bit “arm’ register to be set by software if interrupt from the device to be accepted. CCR is used to program the interrupts A good design should provide for extensibility in the number of devices that can issue interrupts and also number of ISRs. Either poled or vectored interrupts depending on nature of processors and I/O devices. –Polling: Dedicated controllers, data acquisition with periodicity and the I/O devices are slow –Interrupts: Real-time environments, when events are unpredictable and asynchronous

Direct Memory Access DMA is used when low latency and/or high bandwidth is required. (disk IO, video output or low latency data acquisition) Software DMA: starts with normal interrupts, the ISR sets the device resisters and initiate I/O, processor returns to normal operation, on completion of I/O device inform the processor. Hardware DMA: the above can be implemented in hardware Burst DMA: when buffers are put in I/O devices (disk) –Low latency asynchronous I/O can not use burst DMA.

Real-Time Scheduling Interrupts are heavily used in scheduling when real-time events are to be completed by some deadline. Events or threads or tasks or processes need to use priority, deadline, blocking, restoring and nesting NP-hard problem with out an optimal solution. Greedy heuristics are proposed as working solutions with some assumptions. Dynamic RT Scheduling: Use greedy heuristics together with priority-based interrupts.

OS directed power reduction Dynamic power management: determine the power state of a device based on the current workload, move through the power transitions based on shot down policy Usually, in stead of power off/on, there are dynamic voltage setting and variable clock speeds => multiple power states Previous works: –Shot down device if idle long enough –Hardware centric => observe past requests at device to predict future idleness, no OS info, no study on characteristics of requsters –Use stochastic model and assume randomly one request without distinguishing the source of the requester

OS directed power reduction Disk request sources: compiler, text editor, ftp program Network card: internet browser or telnet session? Important that we have accurate model of requesters in concurrent environment.( Task Based Power Management) A software-centric approach Two methods to reduce power: adjust CPU clock speed, sleeping states

Process states ready waiting running new terminated IO or event wait IO or event completion Scheduler dispatch interrupt exit admitted

TBPM’s supplement on device drivers Four problems: –Requesters are generated by multiple tasks. TBPM uses the knowledge from OS kernel to separate tasks –Tasks are created, executed and terminated. (DD has know knowledge on multiple tasks and their termination) –Tasks have different characteristics in device utilization. –Task can generate requests while running. TBPM considers CPU time of tasks while deciding the power states Data structures: –device-requester utilization matrix U (d, r) : utilization of device d by requester r; –processor utilization vector P ( r ) : percentage of processor time used by requester.

Updating U, P U matrix example: HDD NIC Gcc emacs netscape Matrix element refers to the reciprocal of the average Time between requests (TBR) TBRn = . TBR + (1-  ). TBRn-1 U(d,r) – 1/ TBRn 0 <  <1 If  = 0, TBRn is constant using the first TBR and for  = 1, TBRn is last TBR.

Updating U, P P(r ) is the percentage of CPU time executing task r or = CPU time (r )/  CPU time by all requester Updated based on sliding window scheme but not a discounted scheme as used for U. –Incase of IO bound bursty requests, TBR will show on high utilization but can not capture the running time requirements –Sliding window is used to compute CPU time distributed among processes. But the window time should be such that it samples all processes (long) and also reflect the workload variation (short).

Shutdown condition Break-even-time: minimum length of idle time –Depends on device characteristics –Independent of workloads