Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,

Slides:



Advertisements
Similar presentations
Process Description and Control
Advertisements

Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
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
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Informationsteknologi Tuesday, September 18, 2007 Computer Systems/Operating Systems - Class 61 Today’s class Finish review of C Process description and.
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
Process Description and Control (Chapter 3)
6/9/2015B.Ramamurthy1 Process Description and Control B.Ramamurthy.
Chapter 3 Process Description and Control
Process Description and Control
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Process Description and Control Chapter 3. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Chapter 3 Process Description and Control
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
CSSE Operating Systems
1 Lecture 4: Processes Operating System Spring 2007 Chapter 4 of textbook.
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
Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Process Description and Control
Operating System 3 PROCESS DESCRIPTION AND CONTROL.
CSNB224 – AAG 2007 Process Description and Control Chapter 3.
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
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Chapter 3 Advanced Operating System
Operating System 3 PROCESS DESCRIPTION AND CONTROL.
Chapter 3 Process Description and Control
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
Requirements of an Operating System Fundamental Task: Process Management The Operating System must – Interleave the execution of multiple processes – Allocate.
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z.
Processes Processes Dr. Sunny Jeong & Mr. M.H Park Operating Systems: Internals and Design Principles William Stallings.
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z.
Politecnico di Milano © 2001 William Fornaciari Operating System Processes Lecturer: William Fornaciari Politecnico di Milano
Process Description and Control
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Process Description and Control Chapter 2. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
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.
Process Description and control G.Anuradha (Referred from william stallings and galvin 8 th edition)
CSNB224 – AAG 2007 Process Description and Control Chapter 3.
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.
Linux Development Lecture
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Process Description and Control
Day 08 Processes.
Day 09 Processes.
Intro to Processes CSSE 332 Operating Systems
Structure of Processes
Process & its States Lecture 5.
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Chapter 3 Process Description and Control
Operating System 3 PROCESS DESCRIPTION AND CONTROL
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Presentation transcript:

Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall

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

Concepts Computer platform consists of a collection of hardware resources Computer applications are developed to perform some task Inefficient for applications to be written directly for a given hardware platform

Concepts OS provides a convenient, feature rich, secure, and consistent interface for applications to use OS provides a uniform, abstract representation of resources that can be requested and accessed by application

Manage Execution of Applications Resources made available to multiple applications Processor is switched among multiptle application The processor and I/O devices can be used efficiently

Process A program in execution An instance of a program running on a computer The entity that can be assigned to and executed on a processor A unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system instructions

Process Elements Identifier (unique ID) State Priority (relative level to other processes) Program counter (next instruction address) Memory pointers (points to code & data) Context data (registers data in processor) I/O status information (I/O reqs, devices, list of files used) Accounting information (processor time, clock time, account number etc)

Process Control Block Contains the process elements Created and manage by the operating system Allows support for multiple processes

Trace of the Process Sequence of instruction that execute for a process Dispatcher switches the processor from one process to another

Example Execution

Combined Trace of Process Interrupt every 6 instructions

Two-State Process Model Process may be in one of two states –Running –Not-running

Queuing Diagram

Process Creation

Process Termination

Queuing Processes –Not-running ready to execute –Not-running block –Dispatcher must scan list to find process not- running, ready, and in queue the longest

A Five-State Model Running Ready Blocked New Exit

Five-State Process Model

Process States

Using Two Queues

Multiple Blocked Queues

Suspended Processes Processor 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/Suspend –Ready/Suspend

One Suspend State

Two Suspend States

Reason for Process Suspension

Processes and Resources

Operating System Control Structures Information about the current status of each process and resource Tables are constructed for each entity the operating system manages

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 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 on secondary memory Current Status Attributes Sometimes this information is maintained by a file management system

Process Tables Manage processes Process control block –Process image is the collection of program. Data, stack, and attributes

OS Control Tables

Elements of a Process Control Block

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 on Pentium processors

Pentium II EFLAGS Register

Modes of Execution User mode –Less-privileged mode –User programs typically execute in this mode System mode, control mode, or kernel mode –More-privileged mode –Kernel of the operating system

Process Creation Assign a unique process identifier Allocate space for the process Initialize process control block Set up appropriate linkages Create or expand other data structures

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

When to Switch a Process Trap –error or exception 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 of the process that is currently in the Running state Move process control block to appropriate queue – ready; blocked; ready/suspend

Change of Process State Select another process for execution Update the process control block of the process selected Update memory-management data structures Restore context of the selected process

Execution of the Operating System Non-process 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

Execution of the Operating System Process-based operating system –Implement the OS as a collection of system process

Execution of the Operating System

OS Executes in User Space

Security Issues System access threats –Intruders –Malicious software

Security Issues Countermeasures –Intrusion detection –Authentication –Access control –Firewalls

UNIX Process States

UNIX Process State Transition Diagram