Processes Introduction to Operating Systems: Module 3.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Chap 2 System Structures.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
1 Operating Systems and Protection CS Goals of Today’s Lecture How multiple programs can run at once  Processes  Context switching  Process.
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 2: Operating-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Common System Components
Os31 Chapter 3 Operating-System Structures. os32 Outlines System Components Operating System Services System Calls System Programs System Structure Virtual.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: Operating-System Structures.
Prof. Hsien-Hsin Sean Lee
UNIX System Administration OS Kernal Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept Kernel or MicroKernel Concept: An OS architecture-design.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
Kernel, processes and threads Windows and Linux. Windows Architecture Operating system design Modified microkernel Layered Components HAL Interacts with.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
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.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Operating Systems Structure what is the organizational principle?
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
1.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 2: OS Structures (Chapter 2.7)
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.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
CENG334 Introduction to Operating Systems 1 Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Programs (p73) System programs provide a convenient environment.
What is a Process ? A program in execution.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Module 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Introduction to Operating Systems Concepts
Computer System Structures
Module 3: Operating-System Structures
Operating System Structures
Process Management Presented By Aditya Gupta Assistant Professor
Operating System Structure
KERNEL ARCHITECTURE.
Chapter 2: Operating-System Structures
Chapter 3: Operating-System Structures
Chapter 1 Introduction to Operating System Part 5
Basic Concepts Protection: Security:
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Outline Chapter 2 (cont) OS Design OS structure
Operating Systems: A Modern Perspective, Chapter 3
System calls….. C-program->POSIX call
Chapter 2: Operating-System Structures
Operating Systems Structure
Presentation transcript:

Processes Introduction to Operating Systems: Module 3

System Calls u System calls provide the interface between a running program and the operating system  Generally available as assembly-language (trap) instructions  Languages defined to replace assembly language for systems programming allow system calls to be made directly u Methods used to pass parameters to the operating system  Pass parameters in registers  Store the parameters in a table in memory, and the table address is passed as a parameter in a register  Push (store) the parameters onto the stack by the program, and pop off the stack by operating system

System Design Goals u User goals – operating system should be convenient to use, easy to learn, reliable, safe, fair, and fast u System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient  System goals and user goals may conflict  efficiency vs. fairness  easy vs. flexible

System Structure – Layered Approach u The operating system is divided into a number of layers or levels, each built on top of lower layers. The lowest layer is the hardware; the highest is the user interface. u Layers are selected such that each uses functions and services of only lower-level layers.

An Operating System Layer Functions implemented at layer M layer M layer M -1 Functions hidden by layer M Functions passed by layer M

Monolithic vs. Microkernel OS u Monolithic  Every thing resides in the kernel  process and memory management  Interrupts, I/O, device drivers, file systems  Networking  Other functions and system calls  The Kernel is big  Everything is part of every application's address space Process in a monolithic OS OS KERNEL Process mngmt Memory mngmt I/O File systems Networking Interrupts All system calls App1 code Shared Libraries App1 Stack App1 data Not used BIG

Monolithic vs. Microkernel OS u Microkernel  The kernel contains code for the most basic OS services  All other OS services are provided by separate processes running in user space  Can modify components while system is running, don’t need to recompile to change a driver or other component  kernel, drivers export function tables to each other so they can interact Microkernel Client Microkernel File Server Microkernel Memory Server Microkernel Client Message from client to server

Mechanisms and Policies u Mechanisms determine how to do something, policies decide what will be done u The separation of policy from mechanism is a very important principle: it allows maximum flexibility if policy decisions are to be changed later u Micro-kernel design supports this separation  Easy to replace system components u Monolithic design encourages combined mechanism and policy at a low level

Unix System Structure u The UNIX OS consists of two parts:  Systems programs  The kernel  Consists of everything below the system-call interface and above the physical hardware  Provides the file system, CPU scheduling, memory management, and other OS functions

Windows Architecture u Interaction among executive components similar to a microkernel system  But not all components run as user level services u Executive components communicate by passing messages through a component called the kernel u Hardware abstraction layer (HAL) maps generic hardware interaction to specific platforms. HAL isolates the kernel from architecture-specific details.

Windows Architecture

What is a Process u A program in execution u A sequentially executing piece of code that runs on one processing unit of the system u An asynchronous computational activity (i.e., it proceeds at its own pace, independent of another process) u The locus of control of a program in execution u A process is:  an encapsulation of program, data, resources and a virtual processor  controlled and supported by the underlying OS kernel  Which can interact with other processes and I/O devices through the OS kernel

The System View of Processes u Processes are an abstraction  The computer hardware executes instruction  Instructions are grouped into multiple programs in execution by software constructs u Processes do not exist when the computer starts  The instructions initially run set up the data structures needed to implement the process abstraction  The operating system is responsible more maintaining the data structures that implement the process model  The OS needs a system that supports exceptions to do this

In the Beginning u Hardware defines a location from which the initial instruction is fetched after system start-up  This bootstrap program loads the operating system code and initializes operating system data  Then “real” processes can be created  Though the process abstraction is not yet defined when it runs, the bootstrap program can be viewed as the initial process

Address Space u In the process abstraction, an address space is more than just memory  Inter-process communication objects  Files  Other resources u Any entity which can be referenced by a process is part of its address space

Program (text) Data (global variables) Stack (temporary data) Heap (dynamic memory) Inter-process Communication File & I/O Operations System Calls OS/Kernel The operating system can handle all interaction between a process and other system entities; each communication requires a system call Process-OS interaction

Program (text) Data (global variables) Stack (temporary data) Heap (dynamic memory) Inter-process Communication File & I/O Operations System Calls OS/Kernel The operating system can set up communication channels between a process and other system entities; once the channel is established, further interaction does not require a system call Process-OS interaction

A UNIX Process Abstract Machine Environment Program Text Stack Process Status Data Resources Files Object instructions Static variables Temporary variables a.out

Listing unix processes u list processes (Solaris 2): u ps — my processes, little detail u ps -l — my processes, more detail u ps -al — all processes, more detail miller.cs: ps -l F UID PID PPID %C PRI NI SZ RSS WCHAN S TT TIME COMMAND ??? S pts/103 0:00 -csh ??? S pts/103 0:03 find / ??? S pts/108 0:00 -csh

Process states terminated ready waiting running terminate block dispatch pre-empt wakeup inactive create activate suspend