Real Time Operating Systems Lecture 10 David Andrews

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Computer Systems/Operating Systems - Class 8
Chapter 5 Processes and Threads Copyright © 2008.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Embedded and Real Time Systems Lecture #4 David Andrews
3.5 Interprocess Communication
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
1 Chapter 4 Threads Threads: Resource ownership and execution.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
CprE 458/558: Real-Time Systems
Performance Evaluation of Real-Time Operating Systems
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Real Time Operating System
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Chapter 4 Threads, SMP, and Microkernels Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Windows NT and Real-Time? Reading: “Inside Microsoft Windows 2000”, (Solomon, Russinovich, Microsoft Programming Series) “Real-Time Systems and Microsoft.
1 Threads, SMP, and Microkernels Chapter 4. 2 Focus and Subtopics Focus: More advanced concepts related to process management : Resource ownership vs.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Scheduling policies for real- time embedded systems.
Real-Time Operating Systems for Embedded Computing 李姿宜 R ,06,10.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Operating Systems. Definition An operating system is a collection of programs that manage the resources of the system, and provides a interface between.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Threads G.Anuradha (Reference : William Stallings)
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 9: Input Output Concepts Steven Reiss, Fall 2015.
Module 2.0: Threads.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Outlines  Introduction  Kernel Structure  Porting.
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).
REAL-TIME OPERATING SYSTEMS
Processes and threads.
Topics Covered What is Real Time Operating System (RTOS)
CSCI1600: Embedded and Real Time Software
Threads, SMP, and Microkernels
Mid Term review CSC345.
Lecture 4- Threads, SMP, and Microkernels
Threads and Concurrency
Threads Chapter 4.
EE 472 – Embedded Systems Dr. Shwetak Patel.
Operating Systems Lecture 1.
Lecture 3: Main Memory.
Outline Operating System Organization Operating System Examples
CS703 – Advanced Operating Systems
CSE 153 Design of Operating Systems Winter 2019
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Real Time Operating Systems Lecture 10 David Andrews

What We Will Cover Today Operating Systems Services –Base Components Real Time Considerations –Task Management Time Triggered Event Triggered –Interprocess Communications Blocking Non-Blocking –Time Management Services Maintenance

Operating Systems Functionality Considerations –Footprint An Issue –Small Numbers of Programs –Virtual Memory Will Not be Required For Our Study Task Manager Scheduling Semaphores Timer Services Watchdog Countdown System Time IPC Synch Asynch File Mgt Virtual Mem Cache

Task Taxonomy Simple Task (S-task) No synchronization within task Executes from beginning to end, subject only to pre-emption by interrupts – Might be triggered by some other task initially – Might communicate results to some other task – But, no internal synchronization with other tasks Complex Task (C-task) Has some synchronization with other tasks – May have to wait for another task to process a request – May have to wait for I/O to complete – May have to wait for resource to become available (memory, network) Timing depends on the rest of the system – So, C-tasks are “bad” because they increase complexity – And, C-tasks make it more difficult to analyze system timing properties

C-Task Execution time S-Task execution time plus: Waiting for other processes… Not so bad if other tasks are S-Tasks and it is just a remote procedure call General case can be impractical to handle General solution: Break C-tasks into S-tasks separated by interactions Then, make sure that S-tasks are scheduled far enough apart for interaction to complete Great when it works...

Task Management Key component is scheduler: –Static: Schedule Built up Prior To Running Scheduler Develops Time Triggered Schedule Periodic/Predictable –Dynamic: Schedule Built During Run Time Can Be Based on Worst Case Execution Time (WCET) Scheduler Invoked by events –Timer, Interrupts, suspend, resume, etc.

Worst Case Execution Time (simple version)... Assume a simple task (S-task) that just executes its own code without coordinating with other threads or I/O How hard could it be to determine timing? Timing is once through the code + jitter due to: Non-fixed loop iteration count Non-fixed number of recursive calls Garbage collection Conditional statement execution asymmetry (if/else path timings) Effects of hardware non-determinism – Cache – Data-dependent instruction execution time – …

WACO … Plus S-Task Context Swapping Overhead from task switching: OS + Hardware … multiply by number of pre-emptions Gives WCAO (Worst-Case Administrative Overhead) due to pre-emptions Task A Save context OS Restore context Task B Save Context OS Restore context Task B

… Plus Effects From Nested Interrupts What if you have multiple prioritized interrupts Worst case execution time for interrupt at Priority X is = Execution time for interrupt at Priority 1 (perhaps multiple times) + Execution time for interrupt at Priority 2 (perhaps multiple times) + Execution time for interrupt at Priority 3 (perhaps multiple times) … + Execution time for interrupt at Priority X (perhaps multiple times) You can bound this as long as the period of each interrupt is bounded Same algorithm as for computing worst case CAN message latency(!) Scheduling on a CPU is a dual problem to scheduling on a network

Task Management Time Triggered –A priori build Task-Descriptor Table (TADL) TimeActionWCET Start T1 Send M5 Stop T1 Start T3 Send M Dispatcher

Interprocess Communications IPC can support Messages, or Common Data Regions… Messages –We have already discussed synch/asynch Asynchronous can be implemented in S-Tasks Synchronous (suspend) can be implemented in C-Tasks Common Data Regions –Implemented via shared memory Introduces critical regions Semaphore Operations needed –Test and Set

Time Management Time Management provides: –Clock synchronization –Time stamping –Watchdog Timers User Accessible Operating System

Real Time Operating Systems Unix “feel” QNX LinxOS “Smaller” RTOSs OS9, Microware VxWorks (be sure to get the memory protection extension) pSOS RTX, VenturCom A few research/freeware RTOS systems: KURT (KU real Time) RT-Mach, CMU …others Windows: WinCE; embedded NT, Windows + RT add-on products

Questions To Ask Your RTOS Vendor Real Time Operating System Purports to ensure timeliness of task execution Uses task priorities and a scheduling algorithm Hard questions: What is the tasking model (preemptive or non-preemptive)? Scheduler? What is the longest task switch latency? – Function of interrupt masking time How big is the footprint for a real system? (Not a stripped-down toy system) Does it have inter-task memory protection? How much of POSIX does it really support? How long does the system take to reboot? What is the runtime license fee? How robust is it (and what is the exception handling model?)