Realtime System Fundamentals

Slides:



Advertisements
Similar presentations
Real Time Scheduling.
Advertisements

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
B. RAMAMURTHY 4/13/2015 cse321-fall2014 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
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.
Intertask Communication and Synchronization In this context, the terms “task” and “process” are used interchangeably.
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
Real-Time Kernel (Part 1)
LAB 11: Task Synchronization Chung-Ta King National Tsing Hua University CS 4101 Introduction to Embedded Systems.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
1 Interprocess Communication (IPC) - Outline Problem: Race condition Solution: Mutual exclusion –Disabling interrupts; –Lock variables; –Strict alternation.
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
Introduction to Embedded Systems Rabie A. Ramadan 5.
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
6.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Module 6: Process Synchronization.
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 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Deadlock and Starvation
REAL-TIME OPERATING SYSTEMS
EMERALDS Landon Cox March 22, 2017.
Operating systems Deadlocks.
Chapter 6: Process Synchronization
Process Synchronization
Chapter 5: Process Synchronization
Scheduling and Resource Access Protocols: Basic Aspects
Auburn University COMP 3500 Introduction to Operating Systems Synchronization: Part 4 Classical Synchronization Problems.
Deadlock and Starvation
Interprocess Communication (3)
Unit OS9: Real-Time and Embedded Systems
Chapter 5: Process Synchronization
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
Chapter 5: Process Synchronization
Inter-Process Communication and Synchronization
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
Topic 6 (Textbook - Chapter 5) Process Synchronization
Semaphore Originally called P() and V() wait (S) { while S <= 0
CSCI1600: Embedded and Real Time Software
Operating systems Deadlocks.
Realtime System Fundamentals
Lecture 2 Part 2 Process Synchronization
Chapter 7: Synchronization Examples
Realtime System Fundamentals
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
Computer Science & Engineering Electrical Engineering
Midterm Review CSE321 B.Ramamurthy 2/23/2019 B.Ramamurthy.
CSCI1600: Embedded and Real Time Software
Midterm Review CSE321 B.Ramamurthy 4/4/2019 B.Ramamurthy.
Final Review CSE321 B.Ramamurthy 4/17/2019 B.Ramamurthy.
CSE 153 Design of Operating Systems Winter 19
Chapter 7: Synchronization Examples
Midterm Review CSE321 B.Ramamurthy 4/23/2019 B.Ramamurthy.
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)
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University
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 2/28/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. 2/28/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 2/28/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 2/28/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 2/28/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 2/28/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 2/28/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 2/28/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); } 2/28/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); } 2/28/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 task may come to block a high priority task. This situation is known as priority inversion. See fig.3.16 2/28/2019

Priority inversion (Priority: t1>t2>t3) Critical section task1 time 0 1 2 3 4 5 6 7 8 9 10 blocked task2 task3 2/28/2019

Priority Ceiling Protocol CS Used by Priority Ceiling S1 t1,t2 P(t1) S2 t1,t2,t3 S3 t3 P(t3) Acquire S1 Release S1 task1 Attempt to Acquire S1 Acquire S1 Acquire S2 No way task2 Acquire S2 Release S2 Critical section task3 0 1 2 3 4 5 6 7 8 9 10 time 2/28/2019

Exercise 3.18 We will work out exercise 3.18 to illustrate priority inheritance and priority ceiling protocol. 2/28/2019

Midterm Exam Chapter 3, project 1 and 2, handouts Open book and notes Earliest deadline scheduling Rate monotonic scheduling Design cyclic executive schedule given a table of task characteristics Priority inversion and solutions in priority inheritance and priority ceiling protocols. Projects: buffer overflow, kernel coding 2/28/2019