BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES-2013-3 1.

Slides:



Advertisements
Similar presentations
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Advertisements

Chapter 3 Process Description and Control
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Introduction to Processes
6/9/2015B.Ramamurthy1 Process Description and Control B.Ramamurthy.
Process Description and Control
The Process Model.
Processes CSCI 444/544 Operating Systems Fall 2008.
Unix Processes.
Page 1 Processes and Threads Chapter 2. Page 2 Processes The Process Model Multiprogramming of four programs Conceptual model of 4 independent, sequential.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CSSE Operating Systems
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Process Concept An operating system executes a variety of programs
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Processes Tarek Abdelzaher Vikram Adve.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
8-Sep Operating Systems Yasir Kiani. 8-Sep Agenda for Today Review of previous lecture Process scheduling concepts Process creation and termination.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Computer Studies (AL) Operating System Process Management - Process.
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
1 A Seven-State Process Model. 2 CPU Switch From Process to Process Silberschatz, Galvin, and Gagne  1999.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Topic 3 (Textbook - Chapter 3) Processes
Protection of System Resources
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Process Concept
Chapter 3: Processes.
System Structure and Process Model
Chapter 3: Processes.
System Structure and Process Model
Processes in Unix, Linux, and Windows
CGS 3763 Operating Systems Concepts Spring 2013
System Structure B. Ramamurthy.
Processes in Unix, Linux, and Windows
System Structure and Process Model
Operating Systems Lecture 6.
Process & its States Lecture 5.
Chapter 3: Processes.
Process Creation Process Termination
Process Description and Control
Process Description and Control
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Processes in Unix, Linux, and Windows
Processes in Unix and Windows
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CS510 Operating System Foundations
Process Description and Control
Process Description and Control
Process Description and Control in Unix
Process Description and Control in Unix
Chapter 3: Process Concept
Presentation transcript:

BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES

Traditional unix structure System call Standard C libraries 5/30/2013 Amrita-UB-MSES

Page 3 Traditional UNIX System Structure 5/30/2013 Amrita-UB-MSES

5/30/2013 Amrita-UB-MSES System Call There are 11 steps in making the system call read (fd, buffer, nbytes)

Page 5 API – System Call – Operating system Relationship 5/30/2013 Amrita-UB-MSES

Page 6 Standard C Library Example C program invoking printf() library call, which calls write() system call 5/30/2013 Amrita-UB-MSES

Pag e 7 What is a process? A process is simply a program in execution: an instance of a program execution. Unit of work individually schedulable by an operating system (OS). A process includes:  program counter  stack  data section OS keeps track of all the active processes and allocates system resources to them according to policies devised to meet design performance objectives. To meet process requirements OS must maintain many data structures efficiently. The process abstraction is a fundamental OS means for management of concurrent program execution. Example: instances of process co- existing. 5/30/2013 Amrita-UB-MSES

Page 8 Process in Memory 5/30/2013 Amrita-UB-MSES

Pag e 9 Process control Process creation in unix is by means of the system call fork(). OS in response to a fork() call:  Allocate slot in the process table for new process.  Assigns unique pid to the new process..  Makes a copy of the process image, except for the shared memory.  both child and parent are executing the same code following fork()  Move child process to Ready queue.  it returns pid of the child to the parent, and a zero value to the child. 5/30/2013 Amrita-UB-MSES

Pag e 10 Process control (contd.) All the above are done in the kernel mode in the process context. When the kernel completes these it does one of the following as a part of the dispatcher:  Stay in the parent process. Control returns to the user mode at the point of the fork call of the parent.  Transfer control to the child process. The child process begins executing at the same point in the code as the parent, at the return from the fork call.  Transfer control another process leaving both parent and child in the Ready state. 5/30/2013 Amrita-UB-MSES

Page 11 Process Creation (contd.) Parent process create children processes, which, in turn create other processes, forming a tree of processes Generally, process identified and managed via a process identifier (pid) Resource sharing  Parent and children share all resources  Children share subset of parent’s resources  Parent and child share no resources Execution  Parent and children execute concurrently  Parent waits until children terminate 5/30/2013 Amrita-UB-MSES

Page 12 Process Creation (Contd.) Address space  Child duplicate of parent  Child has a program loaded into it UNIX examples  fork system call creates new process  exec system call used after a fork to replace the process’ memory space with a new program 5/30/2013 Amrita-UB-MSES

Page 13 Process Creation (contd.) 5/30/2013 Amrita-UB-MSES

Pag e 14 A five-state process model Five states: New, Ready, Running, Blocked, Exit New : A process has been created but has not yet been admitted to the pool of executable processes. Ready : Processes that are prepared to run if given an opportunity. That is, they are not waiting on anything except the CPU availability. Running: The process that is currently being executed. (Assume single processor for simplicity.) Blocked : A process that cannot execute until a specified event such as an IO completion occurs. Exit: A process that has been released by OS either after normal termination or after abnormal termination (error). 5/30/2013 Amrita-UB-MSES

Pag e 15 State Transition Diagram NEW READY RUNNING BLOCKED EXIT Admit Dispatch Time-out Release Event Wait Event Occurs Think of the conditions under which state transitions may take place. 5/30/2013 Amrita-UB-MSES

Pag e 16 Process creation - Example main () { int pid; cout << “ just one process so far”<<endl; pid = fork(); if (pid == 0) cout <<“I am the child “<< endl; else if (pid > 0) cout <<“I am the parent”<< endl; else cout << “fork failed”<< endl;} 5/30/2013 Amrita-UB-MSES

5/30/2013 Amrita-UB-MSES System Calls For Process Management and File Management