1 / 14

Real Time Operating Systems Lecture 10

Real Time Operating Systems Lecture 10. David Andrews dandrews@eecs.ukans.edu. 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

vangie
Download Presentation

Real Time Operating Systems Lecture 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Real Time Operating SystemsLecture 10 David Andrews dandrews@eecs.ukans.edu

  2. 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

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

  4. 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

  5. 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...

  6. 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.

  7. 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 – …

  8. Task B Task A Restore context Save context OS OS Restore context Save Context Task B WACO 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

  9. … 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

  10. Time Action WCET 10 17 22 38 47 Start T1 Send M5 Stop T1 Start T3 Send M3 12 20 Dispatcher Task Management • Time Triggered • A priori build Task-Descriptor Table (TADL)

  11. 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

  12. Time Management • Time Management provides: • Clock synchronization • Time stamping • Watchdog Timers • User Accessible • Operating System

  13. 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

  14. 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?)

More Related