Process Description and Control. Chapter 3

Similar documents
Process Description and Control. Major Requirements of an Operating System

Major Requirements of an Operating System Process Description and Control

Process Description and Control. Chapter 3

Process Description and Control

Major Requirements of an OS

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

IT 540 Operating Systems ECE519 Advanced Operating Systems

Operating Systems. Lecture 3- Process Description and Control. Masood Niazi Torshiz

Dr. D. M. Akbar Hussain DE5 Department of Electronic Systems

Operating System Control Structures

Process Description and Control

Process Description and Control. Chapter 3

Announcement. Exercise #2 will be out today. Due date is next Monday

Chapter 3 Process Description and Control

Process Description and Control

Today s class. Finish review of C Process description and control. Informationsteknologi. Tuesday, September 18, 2007

Introduction to Processes in Computer Systems SEEM

OPERATING SYSTEM. The Process. Introduction Process creation & termination Process state diagram Process scheduling & its criteria

Wednesday, September 14, Chapter 3: Processes

Process. Discussion session 3 1/30/2016

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

Processes, PCB, Context Switch

Chap 4, 5: Process. Dongkun Shin, SKKU

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch-3 Process Description and Control

Process Description and Control

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Process! Process Creation / Termination! Process Transitions in" the Two-State Process Model! A Two-State Process Model!

CSCE Introduction to Computer Systems Spring 2019

OS Main Goals. 10/24/2013 Operating Systems, Beykent University 1

PROCESS DESCRIPTION AND CONTROL

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

Following are a few basic questions that cover the essentials of OS:

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

Operating Systems Process description and control

CSC 539: Operating Systems Structure and Design. Spring 2006

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

CSCE 313: Intro to Computer Systems

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Operating System. Chapter 3. Process. Lynn Choi School of Electrical Engineering

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

UNIT 3. PROCESS MANAGEMENT

Why use an Operating System? Operating System Definition

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Computer Systems II. First Two Major Computer System Evolution Steps

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - III Processes. Louisiana State University. Processes. September 1 st, 2009

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

3.1 Introduction. Computers perform operations concurrently

1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5

The fundamental task of any modern operating system is process management.

Processes. Sanzheng Qiao. December, Department of Computing and Software

Course Syllabus. Operating Systems, Spring 2016, Meni Adler, Danny Hendler & Amnon Meisels

Course: Operating Systems Instructor: M Umair. M Umair

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

! The Process Control Block (PCB) " is included in the context,

SMD149 - Operating Systems

OPERATING SYSTEM : RBMCQ0402. Third RavishBegusarai.

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

Operating Systems. Lecture 05

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

Chapter 3 Process Description and Control

Processes. CS3026 Operating Systems Lecture 05

CSE325 Principles of Operating Systems. Processes. David P. Duggan February 1, 2011

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

CSC 4320 Test 1 Spring 2017

System Call. Preview. System Call. System Call. System Call 9/7/2018

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Process a program in execution; process execution must progress in sequential fashion. Operating Systems

Introduction to Process in Computing Systems SEEM

Chapter 3: Processes. Operating System Concepts Essentials 2 nd Edition

Processes and Threads

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

operating system Spring 2017 Prof.Dr. Hasan Balik Student Name : Walid.W. Ramadan mansour Student ID :

Inf2C - Computer Systems Lecture 16 Exceptions and Processor Management

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

UNIX Processes. by Armin R. Mikler. 1: Introduction

Chapter 3: Processes

Threads, SMP, and Microkernels. Chapter 4

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Process Management Rab Nawaz Jadoon

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

Chapter 3: Process Concept

Chapter 3: Process Concept

* What are the different states for a task in an OS?

Lecture Topics. Announcements. Today: Threads (Stallings, chapter , 4.6) Next: Concurrency (Stallings, chapter , 5.

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

Chapter 3: Process Concept

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Operating System Support

UNIX Memory Management Interview Questions and Answers

CHAPTER 3 - PROCESS CONCEPT

Chapter 3: Processes. Operating System Concepts 8th Edition,

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

2. The system of... generally ran one job at a time. These were called single stream batch processing.

Transcription:

Process Description and Control Chapter 3

Major Requirements of an Operating System Interleave the execution of many processes to maximize processor utilization while providing reasonable response time Allocate resources to processes Support interprocess communication and user creation of processes

Process Also called a task Execution of an individual program Can be traced list the sequence of instructions that execute

Dispatcher Program that assigns the processor from one process to another Prevents a single process from monopolizing processor time

Two-State Process Model Dispatch Enter Not Running Running Exit Pause (a) State transition diagram Enter Queue Dispatch Processor Exit Pause (a) Queuing diagram

How Processes are Created Submission of a batch job User logs on Created to provide a service such as printing Spawned by an existing process

How Processes Terminate Batch job issues Halt instruction User logs off Process executes a service request to terminate Error and fault conditions

Reasons for Process Termination Normal completion Time limit exceeded Memory unavailable Bounds violation Protection error example write to read-only file Arithmetic error Timeout process waited longer than a specified maximum for an event

Reasons for Process Termination (contd) I/O failure Invalid instruction happens when try to execute data Privileged instruction executed in user mode Data misuse Operating system intervention such as when deadlock occurs Parent terminates so child processes terminate Parent request

Process States Running Not-running ready to execute Blocked waiting for I/O Dispatcher cannot just select the process that has been in the queue the longest because it may be blocked

A Five-State Process Model Running Ready Blocked New Exit

Five-State Process Model Dispatch Release Admit New Ready Running Exit Time-out Event Occurs Event Wait Blocked

Single Blocked Queue Admit Ready Queue Dispatch Processor Release Time-out Event Wait Event Occurs Blocked Queue

Multiple Blocked Queues Admit Ready Queue Dispatch Processor Release Time-out Event 1 Occurs Event 1 Wait Event 1 Queue Event 2 Occurs Event 2 Wait Event 2 Queue

Suspended Processes CPU is faster than I/O so all processes could be waiting for I/O Swap these processes to disk to free up more memory Blocked state becomes suspend state when swapped to disk Two new states: Blocked-suspended Ready-suspended

Process State Transition Diagram with Two Suspend States Admit Ready Admi t Suspend Ready, suspend Activat e Suspend Ready Dispatch Time out Running Exit Event Occurs Event Occurs Event Wait Blocked, suspend Activate Suspend Blocked

Operating System Control Structures An OS schedules and dispatches processes for execution by the CPU Allocates resources to processes Responds to requests by user programs. Therefore o Tables (a.k.a. control blocks) are constructed for each entity managed by the OS

Memory Tables Allocation of main memory to processes Allocation of secondary memory to processes Protection attributes for access to shared memory regions Information needed to manage virtual memory

I/O Tables Whether an I/O device is available or assigned Status of I/O operation Location in main memory being used as the source or destination of the I/O transfer

File Tables Existence of files Location of files in secondary memory Current Status Attributes This information is maintained by a filemanagement subsystem (that runs on top of the OS kernel)

Process Table Process image consists of program, data, stack, and attributes Attributes process control block

Process Control Block Process Identification Unique numeric identifier may be an index into the primary process table User identifier who is responsible for the process

Processor State Information Contents of processor registers User-visible registers Control and status registers Stack pointers Program status word (PSW) contains status information Example: the EFLAGS register -- Pentium machines version of PSW

Process Control Information Additional information needed by the operating system to control and coordinate the various active processes scheduling and state information data structuring (e.g., parent-child relationships; membership in wait/ready queues) interprocess communication process privileges memory management resource ownership and utilization

Typical Functions of an Operating-System Kernel Process Management Process creation and termination Process scheduling and dispatching Process switching Process synchronization and support for inter-process communication Management of process control blocks

Typical Functions of an Operating-System Kernel Memory Management Allocation of address space to processes Swapping in/out of memory blocks Page and segment management

Typical Functions of an Operating-System Kernel I/O Management Buffer management Allocation of I/O channels and devices to processes Support Functions Interrupt handling Accounting Monitoring

Process Creation Assign a unique process identifier Allocate space for the process Initialize process control block Set up appropriate linkages Ex: add new process to linked list used as a scheduling queue Other maintain an accounting file

When to Switch a Process Interrupts Clock I/O o process has executed for the maximum allowable time slice Memory fault memory address is in virtual memory so it must be brought into main memory

When to Switch a Process Trap error occurred may cause process to be moved to Exit state Supervisor call such as file open

Change of Process State Save context of processor including program counter and other registers Update the process control block with the new state and any accounting information Move process control block to appropriate queue - ready, blocked

Change of Process State Select another process, P, for execution Update the process control block of P Update memory-management data structures (e.g., page table register should now point to the page table of process P) Restore execution context of P (registers, program counter, etc.)

Execution of the Operating System Nonprocess Kernel execute kernel outside of any process operating system code is executed as a separate entity that operates in privileged mode Execution Within User Processes operating system software within context of a user process process executes in privileged mode when executing operating system code

Execution of the Operating System Process-Based Operating System major kernel functions are separate processes a process is invoked by the operating system

UNIX Process State Transition Diagram fork return to user Preempted enough memory Created not enough memory (swapping system only) User Running system call, interrupt return Kernel Running preempt reschedule process Ready to Run In Memory swap out swap in Ready to Run Swapped interrupt, interrupt return exit sleep wakeup wakeup Zombie Asleep in Memory swap out Sleep, Swapped