Why use an Operating System? Operating System Definition

Similar documents
Major Requirements of an OS

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

Operating System Control Structures

IT 540 Operating Systems ECE519 Advanced Operating Systems

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

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

آنستیتیوت تکنالوجی معلوماتی و مخابراتی ICTI

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

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

Process Description and Control

Chapter 3 Process Description and Control

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

Process Description and Control

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

Operating Systems Process description and control

Process Time. Steven M. Bellovin January 25,

SMD149 - Operating Systems

Process. Discussion session 3 1/30/2016

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

Process Description and Control. Chapter 3

Process Management Rab Nawaz Jadoon

Chap 4, 5: Process. Dongkun Shin, SKKU

Process Description and Control

Process Description and Control. Chapter 3

Operating Systems: Internals and Design Principles, 7/E William Stallings. Chapter 1 Computer System Overview

Computer Systems II. First Two Major Computer System Evolution Steps

CSC 4320 Test 1 Spring 2017

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

CS3600 SYSTEMS AND NETWORKS

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

Chapter 3 Process Description and Control

OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).

Operating Systems Structure and Processes Lars Ailo Bongo Spring 2017 (using slides by Otto J. Anshus University of Tromsø/Oslo)

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

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

Processes and Non-Preemptive Scheduling. Otto J. Anshus

What is a Process? Processes and Process Management Details for running a program

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

Lecture 4: Process Management

OS Structure, Processes & Process Management. Don Porter Portions courtesy Emmett Witchel

Unit 2 : Computer and Operating System Structure

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

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

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

Processes and Threads

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

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

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

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

3.1 Introduction. Computers perform operations concurrently

csci3411: Operating Systems

Introduction to Concurrency (Processes, Threads, Interrupts, etc.)

CS5460: Operating Systems

PROCESS STATES AND TRANSITIONS:

CSE 380 Computer Operating Systems. Instructor: Insup Lee. University of Pennsylvania Fall 2003

Computer System Overview

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Processes. Dr. Yingwu Zhu

To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

7/20/2008. What Operating Systems Do Computer-System Organization

Course: Operating Systems Instructor: M Umair. M Umair

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

EE458 - Embedded Systems Exceptions and Interrupts

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

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

CS510 Operating System Foundations. Jonathan Walpole

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

Lecture 1 Introduction (Chapter 1 of Textbook)

LINUX OPERATING SYSTEM Submitted in partial fulfillment of the requirement for the award of degree of Bachelor of Technology in Computer Science

Inter-Process Communication and Synchronization of Processes, Threads and Tasks: Lesson-1: PROCESS

Processes and Threads Implementation

Rab Nawaz Khan Jadoon

CSE 153 Design of Operating Systems

W4118 Operating Systems. Junfeng Yang

Background: Operating Systems

Threads and Concurrency

Lecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay

Threads and Concurrency

Getting to know you. Anatomy of a Process. Processes. Of Programs and Processes

Review: Program Execution. Memory program code program data program stack containing procedure activation records

by Marina Cholakyan, Hyduke Noshadi, Sepehr Sahba and Young Cha

518 Lecture Notes Week 3

NAME: KEY (FIRST NAME FIRST) TOTAL:

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

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Implementation of Processes

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

CSCE Introduction to Computer Systems Spring 2019

CSCE 313: Intro to Computer Systems

Processes & Threads. Process Management. Managing Concurrency in Computer Systems. The Process. What s in a Process?

CSE 120 Principles of Operating Systems

Lecture 7: Signals and Events. CSC 469H1F Fall 2006 Angela Demke Brown

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

Transcription:

Why use an Operating System? Operating System Definition Provides a set of services to system users (collection of service programs) Shield between the user and the hardware Resource manager: CPU(s) memory and I/O devices A control program Controls execution of programs to protect information against accidental or unauthorized access No universally accepted definition Everything a vendor ships when you order an operating system is good approximation But varies wildly The one program running at all times on the computer is the kernel. Everything else is either a system program (ships with the operating system) or an application program 1 2

Interrupts The machine has two modes, user mode and kernel mode. The machine has a status register (PSW - processor status Word) that determines the machine s priority level and mode (user/kernel mode) Then an interrupt occurs, the machine s PSW and PC are saved on kernel stack and a new PSW with the kernel mode bit set is loaded from the interrupt vector area. At execution of the return-from-interrupt instruction, PSW and PC are restored from kernel stack. Certain instructions are privileged and can only be carried out in kernel mode - for example load-psw. Definition of process A process is a program in execution. A program is passive while a process is active. A process consists of: Program code. Data area. Stack. General registers. Program counter. 3 4

Concurrent processes Process State Diagram Why do we want concurrent processes? Sharing of physical resources (CPU, disks). Convenience. It may be good to be able to run several programs at the same time. Increased speed of calculation. 1. Decreased waiting times through more efficient use of the processor. 2. On a multiprocessor a program may be divided in several processes that execute concurrently. Most of these reasons are valid also for a single user system. Sleep Running: Ready: Blocked: Blocked Wakeup Timer Interrupt Running The executing process Processes ready to run Ready Dispatch Processes waiting for other resource than CPU 5 6

Process Control Block () Process Queues Data structure that contains information about the process. A contains among other things: Pointer to the next. Process state. Process identifier. Scheduling information. e.g. process priority. Central System Table Running Ready Q ID=2 RUNNING Memory-management information. Pointers to child and parent processes. Save area for processor registers. ID=3 READY ID=1 READY ID=4 READY The is the data structure that defines the process for the operating system. Blocked Wakeup Ready Sleep Timer Interrupt Running Dispatch 7 8

State transitions Unix sleep and wakeup routines The assignment of the processor to the first process in the ready queue is performed by a system entity called the dispatcher. The dispatcher performs: Save the state (registers) of the interrupted process in it s. Fetch the state for the next process to run from it s. Activate the next process. This state change can be described as: dispatch(process-name): ready -> running. The dispatcher is often called by other operating system subroutines as: sleep(process name): running -> blocked. wakeup(process name): blocked -> ready. The only state transition that is initiated by the process itself is block. The other transitions are initiated by events outside the process. Unix/Linux processes that execute user code executes in user mode. Preemptive scheduling is used in user mode. A process that has made a system call - and is executing operating system code - executes in kernel mode. Older Unix systems used non-preemptive scheduling in kernel mode but nowadays preemptive scheduling is used also in kernel mode. A process that needs to wait (for example for data from a disk memory) releases the processor by calling the subroutine sleep. When the awaited event occurs the process is woken up by the interrupt handler calling the subroutine wakeup. Wakeup can also be called by another process executing in kernel mode. Wakeup changes the state for the awoken process from sleeping to ready. 9 10

Operations on processes System calls for process management: Create process. Kill process. Start execution of a program. Create a communication channel to another process. 11