Structure of Processes

Slides:



Advertisements
Similar presentations
Chapter 3 Process Description and Control
Advertisements

Case Study: Virtual Memory in UNIX Reference – Maurice J.Bach, The Design of the UNIX Operating System Terminology - Physical Memory (Main Memory) Secondary.
Unix-v5 Process Structure
System V IPC (InterProcess Communication) Messages Queue, Shared Memory, and Semaphores.
Day 11 Processes. Operating Systems Control Tables.
Lecture 6 & 7: PROCESSES Process states (PS)
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.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
Memory Management Policies: UNIX
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Process Process: the UNIX abstraction of a stand-along computer that manages resources (memory, CPU, I/O resources) comprising a running program. Processes.
Introduction to Kernel
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.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CSCE 351: Operating System Kernels
OS Spring’03 Introduction Operating Systems Spring 2003.
Processes and Resources
Process Processes are executing or executable instances of programs. Processes in a modern OS haveOS –management information –resources –unique process.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Control Process Control Block (PCB) Process State Information
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.
University of Pennsylvania 9/12/00CSE 3801 Multiprogramming CSE 380 Lecture Note 3.
Process Description and Control
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Chapter 3 Process Description and Control
The Structure of Processes (Chap 6 in the book “The Design of the UNIX Operating System”)
Operating Systems 1 K. Salah Module 2.0: Processes Process Concept Trace of Processes Process Context Context Switching Threads –ULT –KLT.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
4P13 Week 3 Talking Points 1. Process State 2 Process Structure Catagories – Process identification: the PID and the parent PID – Signal state: signals.
Silberschatz, Galvin and Gagne  Operating System Concepts Process Concept An operating system executes a variety of programs:  Batch system.
CSE 5343/7343UNIX Case Study1 CSE 5343/7343 Fall 2006 Case Studies UNIX History/Processes.
(a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not necessarily the same in each execution. What.
LINUX System : Lecture 7 Process Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CS 390 Unix Programming Environment
1 UNIX – The Kernel. 2 UNIX Internals: Motivations Knowledge of UNIX Internals helps in: –understanding similar systems (for example, NT, LINUX) –designing.
1 Structure of Processes Chapter 6 Process State and Transition Data Structure for Process Layout of System Memory THE DESIGN OF THE UNIX OPERATING SYSTEM.
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.
Process Description and Control
What is a Process ? A program in execution.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
WORKING OF SCHEDULER IN OS
Introduction to Kernel
Process Management Process Concept Why only the global variables?
Case Study 1: UNIX and LINUX
Structure of Processes
Threads and Scheduling
Operating Systems: A Modern Perspective, Chapter 6
Processes A process is a running program.
Structure of Processes
System Structure B. Ramamurthy.
Module 2.2 COP4600 – Operating Systems Richard Newman
More examples How many processes does this piece of code create?
System Structure and Process Model
Process Description and Control
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Process Description and Control
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Process Description and Control in Unix
Outline Process Management Process manager Hardware process
Process Description and Control in Unix
Process and Thread State Diagrams
Chapter 1: Introduction CSS503 Systems Programming
Structure of Processes
Process and Thread State Diagrams
Presentation transcript:

Structure of Processes Chapter 6 Structure of Processes Process State and Transition Data Structure for Process Layout of System Memory THE DESIGN OF THE UNIX OPERATING SYSTEM Maurice J. bach Prentice Hall

Process States and Transitions 1 2 9 7 3 4 6 5 8 User Running Preempted Zombie Asleep in Memory Sleep, Swapped Ready to Run, Swapped fork Created Ready to Run in Memory Kernel Running not enough mem (swapping system only) swap out wakeup enough mem sleep reschedule process preempt return to user system call, interrupt interrupt, interrupt return

Data Structures for Process Text Stack Data File Descriptor Table Per Process Region Table Kernel Process Table Kernel Region Table A Process U Area

Data Structure for Process (contd.) per process region table Kernel region table u area main memory Kernel process table

State of a Process Process table entry U area Contains general fields of processes that must be always be accessible to the kernel U area further characteristics of the process only need to be accessible to the running process itself

Process table entry State field: user running, kernel running etc. Fields that allow the kernel to locate the process and u area. Requires while context switch Process size : kernel know how much space to allocate for the process. User ID Process ID

Process table entry (contd.) Event descriptor. Used when the process is in the "sleep" state. Scheduling parameters. Allow the kernel to determine the order in which processes move to the states "kernel running" and "user running” A signal field. keeps the signals sent to a process but not yet handled. Various timers: process execution time, resource utilization etc.

U Area A pointer to the process table entry User IDs various Timer: Execution time in user mode Execution Time in kernel mode An error field: keeps error during system call Return value field: result of system call

U Area (contd.) I/O parameters The current directory and current root Amount of data transfer Address of source and target etc. The current directory and current root User file descriptor table Limit fields Restrict process size Restrict size of the file it can write The control terminal field: login terminal associated with the process, if one exists An array indicates how the process wishes to react to signal

Per Process Region Table (Pregion) Each pregion entry points to the kernel region table Starting virtual (absolute) address of the region Permission filed: read-only, read-write, read-execute

Kernel Region table Kernel region table contains the pointer to the page table which keeps the physical memory address

<Processes and Regions> 8K 16K 32K b a d c e 4K Text Data Stack Process A B Per Proc Region Tables (Virtual Addresses) Region <Processes and Regions>

Pages and Page Tables Logical Page Number Physical Page Number 0 177 0 177 1 54 2 209 3 17

Pages and Page Tables (contd.) 8K 32K 64K Text Data Stack 541K 783K 986K 897K 87K 552K 727K 941K empty 137K 852K 764K . 1096K 2001K 433K 333K Per Proc Region Table Page Tables(Physical Addresses) Virtual Addresses <Mapping Virtual Addresses to Physical Address>