Realtime System Fundamentals

Slides:



Advertisements
Similar presentations
B. RAMAMURTHY 4/13/2015 cse321-fall2014 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
Advertisements

Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Real-time concepts Lin Zhong ELEC424, Fall Real time Correctness – Logical correctness – Timing Hard vs. Soft – Hard: lateness is intolerable Pass/Fail.
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
CMPE-443 Real-Time Systems Design1 Real-Time Operating Systems Real-Time Kernels Theoretical Foundations of RTOS Intertask Communication & Synchronization.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
Real Time Operating System
SOC Consortium Course Material SoC Design Laboratory Lab 8 Real-time OS - 2 Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department.
Real-Time Kernel (Part 1)
LAB 11: Task Synchronization Chung-Ta King National Tsing Hua University CS 4101 Introduction to Embedded Systems.
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 7: Process Synchronization Background The Critical-Section Problem Synchronization.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
1 Interprocess Communication (IPC) - Outline Problem: Race condition Solution: Mutual exclusion –Disabling interrupts; –Lock variables; –Strict alternation.
1 Lecture 8: Concurrency: Mutual Exclusion and Synchronization(cont.) Advanced Operating System Fall 2009.
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
ROSHINA HARAM ROLL NO# 31 BS(TS) 3 rd
3/1/2016Page 1 Realtime System Fundamentals : Scheduling B. Ramamurthy.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 6: Process Synchronization.
Big Picture Lab 4 Operating Systems C Andras Moritz
Chapter 6 Synchronization Dr. Yingwu Zhu. The Problem with Concurrent Execution Concurrent processes (& threads) often access shared data and resources.
Real-Time Operating Systems RTOS For Embedded systems.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Deadlock and Starvation
Interprocess Communication Race Conditions
REAL-TIME OPERATING SYSTEMS
EMERALDS Landon Cox March 22, 2017.
Operating Systems Review ENCE 360.
Operating systems Deadlocks.
Chapter 6: Process Synchronization
Process Synchronization: Semaphores
Scheduling and Resource Access Protocols: Basic Aspects
Auburn University COMP 3500 Introduction to Operating Systems Synchronization: Part 4 Classical Synchronization Problems.
Interprocess Communication (3)
Concurrency.
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
Java Byte IPC: Part 6-Summary
Inter-Process Communication and Synchronization
Concurrency: Mutual Exclusion and Synchronization
Chapter 5: Process Synchronization (Con’t)
Shell & Kernel Concepts in Operating System
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy 11/22/2018.
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
Intro. To Operating Systems
CSCI1600: Embedded and Real Time Software
Semaphore Originally called P() and V() wait (S) { while S <= 0
Operating systems Deadlocks.
Process Description and Control
Transmitter Interrupts
Lecture 2 Part 2 Process Synchronization
Realtime System Fundamentals
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
Computer Science & Engineering Electrical Engineering
Processes and operating systems
Realtime System Fundamentals
Process Synchronization
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CSE 153 Design of Operating Systems Winter 19
Chapter 7: Synchronization Examples
CSE 153 Design of Operating Systems Winter 2019
Chapter 6: Synchronization Tools
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
Process/Thread Synchronization (Part 2)
Chapter 3: Process Management
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Realtime System Fundamentals B. Ramamurthy 1/11/2019

Review of Project Plans Hardware modifications (proof of concept done) Software to generate xinu.boot Cross compiler (host system to MIPS) gcc is now available at /projects/bina/NEXOS/CSE321 We will have it installed on Linux machines at 206 Franzack And on a Linux laptop You can use this to compile the software you write for shell and drivers and anything else you add to exinu. Uploading xinu.boot to test your shell and drivers: You can do it from any system with a serial port , hyperterminal and tftp installed. Such a setup will be available in the Franzack lab and is currently available during recitation/lecture on Tuesdays at 340 Bell. 1/11/2019

Realtime scheduling We discussed realtime system scheduling: Earliest deadline scheduling (EDS) Starting deadline Completion deadline Dynamic priority scheduling Rate monotonic scheduling (RMS) Periodic tasks are prioritized by the frequency of repetition (high priority to tasks with shorter periods) Preemptive scheduling Fixed priority scheduling See table 3.3 Schedulability according to RMS Σ(Ci/Ti) <= n(21/n-1) Cyclic executives (pre-scheduled) Concepts of hyper-period and frame Hyper-period is a the repeated loop Pages 92-93 Exercises: 3.13 – 3.17 1/11/2019

Intertask communication and synchronization Buffering data: For inter-task communication For sending data To handle incompatibilities between tasks typically a buffer is introduced Classical buffer (fig. 2.11) Double buffer (fig. 2.12) Ring buffer (fig. 2.13) Mail boxes 1/11/2019

Mailboxes Mailboxes are intertask communication device available in many commercial operating systems. A mailbox is a memory location that one or more tasks can use to pass data or for synchronization. post and pend are used for mailbox write and read 1/11/2019

Mailbox implementation List of tasks and needed resources (mailboxes, printers etc.) is kept along with a second table of list of resources and their state (tables 3.6, and 3.7) taskID Resource Status 100 printer Has it 102 Mailbox 1 104 Mailbox 2 pending resource status owner printer busy 100 Mailbox 1 102 Mailbox 2 empty none 1/11/2019

Mailbox implementation (contd) Task 104 requests mailbox 2 “pend” or “read”; It blocks waiting for read. Operating system checks task table, if “key” is full or available for mailbox 2, then it unblocks Task 104 and lets it read from mailbox 2; Task 104 reads from mailbox 2 and set it “key” back to empty. Accept is another function for mailbox; it is a non-blocking call; it reads data if available or it fails 1/11/2019

Task states Ready, running and blocked Critical regions Semaphores for protection of critical regions Identify the critical region and enclose it with p() and v() operators of the semaphore Lets look at an example of implementation of mailboxes using semaphores 1/11/2019

Mailboxes using semaphores Semaphore mutex, proc_sem; Bool full, empty; void post(int mailbox, int message) { wait(mutex); if (empty_slots){ insert(mailbox, message); update; signal(mutex); signal(proc_sem); } else {// no empty slots; wait for empty slots wait(proc_sem); wait(mutex); insert(mailbox,message); update(); signal(proc_sem); } 1/11/2019

Mailboxes using semaphores void pend(int *mailbox, int *message) { wait(mutex); if (full_slots) { extract(mailbox, message); update(); signal(mutex); } else { .. signal(mutex); wait(proc_sem); extract(mailbox,message); } 1/11/2019

Priority Inversion When we allow concurrent task to execute and with semaphore and mailboxes and other synchronization primitives, it is possible that a low priority taks may come to block a high priority task. This situation is known as priority inversion. See fig.3.16 1/11/2019