Day 09 Processes.

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

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.
Chapter 3 Process Description and Control
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Process Description and Control Chapter 3. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
CSCE 351: Operating System Kernels
OS Spring’03 Introduction Operating Systems Spring 2003.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Operating System 3 PROCESS DESCRIPTION AND CONTROL.
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
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 3 Process Description and Control
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
4P13 Week 2 & 3 Talking Points 1. Kernel Processes 2.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
1 Process Description and Control Chapter 3. 2 Requirements of an Operating System Interleave the execution of multiple processes to maximize processor.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Process Description and Control
Interrupts and exceptions
Processes and threads.
Exceptional Control Flow
Mechanism: Limited Direct Execution
Modeling Page Replacement Algorithms
Day 08 Processes.
Overview of today’s lecture
Intro to Processes CSSE 332 Operating Systems
Structure of Processes
2P13 Week 2.
Module 2.2 COP4600 – Operating Systems Richard Newman
Computer System Overview
Computer-System Architecture
Module 2: Computer-System Structures
Processor Fundamentals
Process & its States Lecture 5.
Modeling Page Replacement Algorithms
Process Description and Control
Process Description and Control
Process Description and Control
COMPUTER PERIPHERALS AND INTERFACES
Architectural Support for OS
Processes Hank Levy 1.
Process Description and Control
Operating System 3 PROCESS DESCRIPTION AND CONTROL
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Process Description and Control
Module 2: Computer-System Structures
Process Description and Control
Process Description and Control
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Architectural Support for OS
Processes Hank Levy 1.
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Presentation transcript:

Day 09 Processes

Can you think of the states in a 5-state model?

i.e. 5-state model

Suspended Processes Processor is faster than I/O so all processes in main memory could be waiting for I/O Swap these processes to disk to free up main memory Blocked process becomes a suspended process when swapped to disk

One Suspend State

7-state model - two suspend states

Reasons for Process Suspension

Modes of execution User mode – restricted access to memory and restricted access to certain instructions. Kernel mode or system mode – when the OS is in control. Access to privileged instructions.

Mode switch How to set and reset the mode? Hardware level support required. Mode bit (part of the Process Status Word) When an interrupt is detected, control is transferred to the OS (i.e. privileged mode is required) Change the mode bit When the interrupt service routine is done, control is transferred back to a user program (i.e. non-privileged mode) Change the mode bit again.

Process switching When can a process switch occur? Examples: Anytime the OS takes over from the user process. Examples: Interrupt – external to the currently running process – clock INT, I/O interrupt, memory fault (page or segment) Trap – error exception internal to the program may have a recovery procedure or simply notify and quit Supervisor call – explicit request from the program (system call).

Process Switching – Supervisor call

Process switching – Timer interrupt

Context/mode switch Context/mode switch - When the processor switches between a user process and an OS process or vice versa. Involves the following steps: Set the PC value to the address of the ISR. Change to kernel model so that the ISR may access privileged instructions. Save the context of the process i.e. the general purpose registers, stack information, and PC value.

Context switch or Process switch? When a context switch occurs, the PCB of the process that was running is still marked Running and is not placed in the Blocked or Ready queue. However, depending on what caused the context switch, a process switch could follow.

Process switch When the processor switches between two user processes. Save the context of the current process Update the PCB to the new state. Move the PCB to new queue Select another process for execution Update the PCB of the next process Move the PCB of the next process to Running Update memory-mgmt data structures Restore the context of the processor to that of the new process. Lots of work! Design goal: Minimize the number of process switches.