© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems Operating systems. 1.

Slides:



Advertisements
Similar presentations
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Advertisements

Introduction to Embedded Systems Resource Management - III Lecture 19.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Computer Systems/Operating Systems - Class 8
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Big Picture Lab 4 Operating Systems Csaba Andras Moritz.
Process Description and Control
Chapter 2: Processes Topics –Processes –Threads –Process Scheduling –Inter Process Communication (IPC) Reference: Operating Systems Design and Implementation.
Review: Process Management Objective: –Enable fair multi-user, multiprocess computing on limited physical resources –Security and efficiency Process: running.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
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)
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Chapter 11 Operating Systems
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zInterprocess communication. zOperating system performance.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
High Performance Embedded Computing © 2007 Elsevier Lecture 14: Real Time Concepts Embedded Computing Systems Mikko Lipasti Based on slides and textbook.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
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.
Real-Time Operating Systems for Embedded Computing 李姿宜 R ,06,10.
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 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,
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems  Operating systems.
Processes Introduction to Operating Systems: Module 3.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 7 -1 CHAPTER 7 PROCESS SYNCHRONIZATION CGS Operating System Concepts UCF, Spring 2004.
Distributed System Services Fall 2008 Siva Josyula
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Lab 4 : Real-Time OS Team #7 P 李彥勳 P 謝嵩淮 R 侯凱文.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
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.
Big Picture Lab 4 Operating Systems C Andras Moritz
System Components Operating System Services System Calls.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
REAL-TIME OPERATING SYSTEMS
Topics Covered What is Real Time Operating System (RTOS)
Operating Systems (CS 340 D)
Wayne Wolf Dept. of EE Princeton University
Virtual Memory Networks and Communication Department.
Real-time Software Design
Operating Systems (CS 340 D)
Ch4 Process and Operating System
Process Description and Control
Processes and operating systems
EE 472 – Embedded Systems Dr. Shwetak Patel.
Process Description and Control
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Processes and operating systems
Chapter 10 Multiprocessor and Real-Time Scheduling
- When you approach operating system concepts there might be several confusing terms that may look similar but in fact refer to different concepts:  multiprogramming, multiprocessing, multitasking,
Presentation transcript:

© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems Operating systems. 1

© 2000 Morgan Kaufman Overheads for Computers as Components Operating systems The operating system controls resources: who gets the CPU; when I/O takes place; how much memory is allocated. The most important resource is the CPU itself. CPU access controlled by the scheduler. 2

© 2000 Morgan Kaufman Overheads for Computers as Components Process state A process can be in one of three states: executing on the CPU; ready to run; waiting for data. executing readywaiting gets data and CPU needs data gets data needs data preempted gets CPU 3

© 2000 Morgan Kaufman Overheads for Computers as Components Operating system structure OS needs to keep track of: process priorities; scheduling state; process activation record. Processes may be created: statically before system starts; dynamically during execution. 4

© 2000 Morgan Kaufman Overheads for Computers as Components Embedded vs. general-purpose scheduling Workstations try to avoid starving processes of CPU access. Fairness = access to CPU. Embedded systems must meet deadlines. Low-priority processes may not run for a long time. 5

© 2000 Morgan Kaufman Overheads for Computers as Components Priority-driven scheduling Each process has a priority. CPU goes to highest-priority process that is ready. Priorities determine scheduling policy: fixed priority; time-varying priorities. 6

© 2000 Morgan Kaufman Overheads for Computers as Components Priority-driven scheduling example Rules: each process has a fixed priority (1 highest); highest-priority ready process gets CPU; process continues until done. Processes P1: priority 1, execution time 10 P2: priority 2, execution time 30 P3: priority 3, execution time 20 7

© 2000 Morgan Kaufman Overheads for Computers as Components Priority-driven scheduling example time P2 ready t=0P1 ready t=15 P3 ready t= P2 P1P3 8

© 2000 Morgan Kaufman Overheads for Computers as Components The scheduling problem Can we meet all deadlines? Must be able to meet deadlines in all cases. How much CPU horsepower do we need to meet our deadlines? 9

© 2000 Morgan Kaufman Overheads for Computers as Components Process initiation disciplines Periodic process: executes on (almost) every period. Aperiodic process: executes on demand. Analyzing aperiodic process sets is harder- --must consider worst-case combinations of process activations. 10

© 2000 Morgan Kaufman Overheads for Computers as Components Timing requirements on processes Period: interval between process activations. Initiation interval: reciprocal of period. Initiation time: time at which process becomes ready. Deadline: time at which process must finish. 11

© 2000 Morgan Kaufman Overheads for Computers as Components Timing violations What happens if a process doesn’t finish by its deadline? Hard deadline: system fails if missed. Soft deadline: user may notice, but system doesn’t necessarily fail. 12

© 2000 Morgan Kaufman Overheads for Computers as Components Example: Space Shuttle software error Space Shuttle’s first launch was delayed by a software timing error: Primary control system PASS and backup system BFS. BFS failed to synchronize with PASS. Change to one routine added delay that threw off start time calculation. 1 in 67 chance of timing problem. 13

© 2000 Morgan Kaufman Overheads for Computers as Components Interprocess communication Interprocess communication (IPC): OS provides mechanisms so that processes can pass data. Two types of semantics: blocking: sending process waits for response; non-blocking: sending process continues. 14

© 2000 Morgan Kaufman Overheads for Computers as Components IPC styles Shared memory: processes have some memory in common; must cooperate to avoid destroying/missing messages. Message passing: processes send messages along a communication channel---no common address space. 15

© 2000 Morgan Kaufman Overheads for Computers as Components Shared memory Shared memory on a bus: CPU 1CPU 2 memory 16

© 2000 Morgan Kaufman Overheads for Computers as Components Race condition in shared memory Problem when two CPUs try to write the same location: CPU 1 reads flag and sees 0. CPU 2 reads flag and sees 0. CPU 1 sets flag to one and writes location. CPU 2 sets flag to one and overwrites location. 17

© 2000 Morgan Kaufman Overheads for Computers as Components Atomic test-and-set Problem can be solved with an atomic test-and-set: single bus operation reads memory location, tests it, writes it. ARM test-and-set provided by SWP: ADR r0,SEMAPHORE LDR r1,#1 GETFLAG SWP r1,r1,[r0] BNZ GETFLAG 18

© 2000 Morgan Kaufman Overheads for Computers as Components Critical regions Critical region: section of code that cannot be interrupted by another process. Examples: writing shared memory; accessing I/O device. 19

© 2000 Morgan Kaufman Overheads for Computers as Components Semaphores Semaphore: OS primitive for controlling access to critical regions. Protocol: Get access to semaphore with P(). Perform critical region operations. Release semaphore with V(). 20

© 2000 Morgan Kaufman Overheads for Computers as Components Message passing Message passing on a network: CPU 1CPU 2 message 21

© 2000 Morgan Kaufman Overheads for Computers as Components Process data dependencies One process may not be able to start until another finishes. Data dependencies defined in a task graph. All processes in one task run at the same rate. P1P2 P3 P4 22

© 2000 Morgan Kaufman Overheads for Computers as Components Other operating system functions Date/time. File system. Networking. Security. 23