Subject Name:Operating system. Subject Code:10EC35. Prepared By:Remya Ramesan and Kala H.S. Department:ECE. Date:

Similar documents
Introduction to Operating Systems

OPERATING SYSTEM. Functions of Operating System:

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

Introduction. CS3026 Operating Systems Lecture 01

GENERAL I ARTICLE. Operating Systems. 1. Objectives and Evolution. operating systems, and then we trace the evolution of operating

Chapter 1: Introduction

Chapter 5: CPU Scheduling

Contents. Today's Topic: Introduction to Operating Systems

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

Module 1: Introduction

Module 1: Introduction

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


CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Processes and Threads

OPERATING SYSTEMS. Systems with Multi-programming. CS 3502 Spring Chapter 4

Module 1: Introduction. What is an Operating System?

Process- Concept &Process Scheduling OPERATING SYSTEMS

Operating Systems Overview. Chapter 2

Part I Overview Chapter 1: Introduction

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Multiprocessor and Real-Time Scheduling. Chapter 10

Computer System Overview

Multiprocessor and Real- Time Scheduling. Chapter 10

OPERATING SYSTEMS OVERVIEW

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Overview of Operating Systems

Introduction to Computer Systems and Operating Systems

CS3733: Operating Systems

OPERATING SYSTEMS. COMS W1001 Introduction to Information Science. Boyi Xie

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Main Points of the Computer Organization and System Software Module

Operating Systems : Overview

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Frequently asked questions from the previous class survey

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

Computer Fundamentals : Pradeep K. Sinha& Priti Sinha

Operating Systems Overview

Introduction to Operating System. Dr. Aarti Singh Professor MMICT&BM MMU

CS418 Operating Systems

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Overview of Operating Systems

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Some popular Operating Systems include Linux, Unix, Windows, MS-DOS, Android, etc.

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

Multiprocessor scheduling

Scheduling. The Basics

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

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

CPU Scheduling: Objectives

Chapter 1 Computer System Overview

CSI3131 Final Exam Review

Scheduling of processes

Introduction to Operating Systems. Chapter Chapter

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/os, etc.

Introduction to Operating. Chapter Chapter

Properties of Processes

Chapter 14 Operating Systems

Chapter 14 Operating Systems

Introduction. What is an Operating System? A Modern Computer System. Computer System Components. What is an Operating System?

UNIT 1 JAGANNATH UNIVERSITY UNIT 2. Define Operating system and its functions. Explain different types of Operating System

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Introduction to Operating System

Operating Systems Fundamentals. What is an Operating System? Focus. Computer System Components. Chapter 1: Introduction

Computer System Overview

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Example: CPU-bound process that would run for 100 quanta continuously 1, 2, 4, 8, 16, 32, 64 (only 37 required for last run) Needs only 7 swaps

Operating System. Operating Systems Structure Chapter 2. Services Provided by the OS. Evolution of an Operating System

Introduction to Operating Systems. Chapter Chapter

Operating System Review Part

Ch 4 : CPU scheduling

Process Description and Control

Operating System Overview. Chapter 2

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory

Operating Systems. Instructor: Dmitri A. Gusev. Spring Lecture 16, April 17, CSC : Introduction to Computer Science

SAZ4B/SAE5A Operating System Unit : I - V

Chapter 6: CPU Scheduling

Today s class. Scheduling. Informationsteknologi. Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1

CS 450 Fall xxxx Final exam solutions. 2) a. Multiprogramming is allowing the computer to run several programs simultaneously.

Department of CSIT ( G G University, Bilaspur ) Model Answer 2013 (Even Semester) - AR-7307

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

Scheduling II. Today. Next Time. ! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling. !

CSC 553 Operating Systems

CHAPTER 2: PROCESS MANAGEMENT

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

Chapter 1: Introduction. Operating System Concepts 8th Edition,

Computer Hardware and System Software Concepts

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Transcription:

Subject Name:Operating system Subject Code:10EC35 Prepared By:Remya Ramesan and Kala H.S. Department:ECE Date:24-02-2015

UNIT 1 INTRODUCTION AND OVERVIEW OF OPERATING SYSTEM

Operating system, Goals of an O.S Operation of an O.S Resource allocation and related functions User interface related functions Classes of operating systems O.S and the computer system Batch processing system Multi programming systems Time sharing systems CONTENTS Real time operating systems, distributed operating systems

What is an operating system? An operating system (OS) is a collection of programs that achieve effective utilization of a computer system by providing Convenient methods of using a computer Saves users time and boosts their productivity Efficient use of the computer An OS has several kinds of users The OS meets diverse requirements of different kinds of users Each user has a different view of what an OS is, and what it does. Each of these views is called an abstract view

Abstract views An abstract view focuses on the essential characteristics of a system It contains some selected characteristics, and ignores others It helps to control complexity in designing and understanding a system, by hiding unnecessary detail For example, two abstract views of a car: The driver s view contains the rear-view mirror, steering, gear shift, and speedometer but ignores engine details The mechanic s view contains fluid levels, electrical system, Q: Give examples of abstract views A: View of an abstract data type, object,..

Abstract views Abstract views are used in Software requirements specification Specify what functions a system should perform The abstract view of a specific function helps in understanding the system data and fundamental operations on them Software design and implementation Hiding the details of functions and subsystems while designing or implementing other functions and subsystems helps to control complexity

A designer s abstract view of an OS User interface: Accepts commands from users: GUI, command line interface Non-kernel programs: Implement user commands Kernel: Core of the OS controls the computer, provides functions & services

A designer s abstract view of an OS The abstract view consists of three components The kernel programs interact with the computer s hardware and implement the intended operation The non-kernel programs implement creation of programs and use of system resources by them. These programs use kernel programs to control operation of the computer The user interface interprets the commands of a user and activates non-kernel programs to implement them

Goals of an OS Two primary goals of an OS are Efficient use of the computer s resources To ensure cost-effectiveness of the computer User convenience A user should find it easy to use the computer These two goals sometimes conflict Prompt service can be provided through exclusive use of a computer; however, efficient use requires sharing of a computer s resources among many users An OS designer decides which of the two goals is more important under what conditions That is why we have so many operating systems!

User convenience The computing environment influences the notion of user convenience The computing environment is comprised of The computer system Its interfaces with other systems Nature of computations performed by its users Computing environments change with the architecture and use of a computer, e.g. personal computing, online applications, embedded applications Hence the notion of user convenience has several facets that depend on the computing environment

User convenience User convenience has several facets Fulfillment of a necessity Use of programs and files Good service Speedy response Ease of Use User friendliness New programming model e.g., Concurrent programming Web-oriented features e.g., Web-enabled servers Evolution Addition of new features, use of new computers

Operation of an OS During operation, an OS performs two primary functions Program management Perform program initiation/termination Provide means through which many programs can work toward a common goal Helps in more convenient or faster fulfillment of user requirements Resource management Ensure efficient use of resources Use of CPU, I/O devices

Operation of an OS Program management and resource management require three fundamental tasks Scheduling Deciding which program should be serviced by the CPU and for how long Resource allocation Sharing of resources among user programs Security and protection Ensuring non-interference between programs Security: guarding against interference by external entities Protection: guarding against interference by internal entities

Operation of an OS To facilitate scheduling, resource management, and security and protection OS maintains various kinds of information to facilitate operation Names of registered users identity of a user who is executing a specific program status of a program status of a resource which users can access a resource OS performs several tasks repeatedly to implement scheduling, resource management, and security and protection

Common tasks performed by operating systems

Program management A computational structure is a configuration of several programs. Three typical computational structures are: A single program Execution of a program on a given set of data A sequence of single programs A program should be executed only if previous programs in the sequence executed successfully Programs should pass their results to other programs through files Co-executing programs The OS must execute these programs at the same time The OS must provide an interface between co-executing programs so that their results are available to one another

A schematic of scheduling Programs waiting for CPU attention are entered in a pool The scheduler picks one program from the pool for execution on the CPU The CPU may be forcibly taken away from a program. This action is called pre-emption A pre-empted program is again entered into the pool

Resource management Criteria and techniques of resource management Criterion: Resource utilization efficiency Share the resources wherever possible Avoid idling of resources Speedy resource allocation and de-allocation is desirable Technique 1: Partitioning of resources A resource partition is a collection of resources A resource partition is allocated to a process Simplifies resources allocation and also speeds it up Technique 2: Allocation from a pool Resources are allocated individually when needed Q: Pros & cons of the two techniques?

Virtual resources A virtual resource is an illusion presented to a program A virtual resource is an abstraction; its implementation is hidden from a program Use of virtual resources simplifies resource allocation Virtual resources may be created if several programs need a resource. It permits more programs to execute at the same time A virtual I/O device is a virtual resource The OS implements a virtual device as follows: When a program performs an operation on a virtual device, the operation may be actually performed on some real resource Example: virtual printer When a program prints on a virtual printer, the data is actually stored in memory; printing takes place sometime later

Security and Protection An OS must ensure non-interference with users programs and data Aspects of non-interference Resources must not be used by un-authorized persons There should be no interference with use of resources by authorized persons and their programs Terminology An intruder is a person or program that causes interference Security measures avoid interference by non-users and their programs Protection measures avoid interference by users and their programs

Security and protection techniques Two key techniques of security and protection Authentication Verification of a user s identity Performed when a person logs in (typically through passwords) Authorization: has two aspects The owner of a resource selectively permits other users to access them When a user/program tries to access a resource, the OS verifies whether the user has the permission to perform the access

Overview of security and protection threats Authentication checks whether a person is a registered user Threats posed by non-users are security threats Threats posed by a user are protection threats

OS and the Computer System In this module, we study - Fundamental features of computer systems that are important to an OS * Memory hierarchy * Interrupt structure * I/O organization - Fundamentals of how a program interacts with an OS

Memory utilization during operation of an OS

Model of a Computer System

Fields of Program Status Word (PSW)

(a) Program (b) State of CPU after executing COMPARE instruction

Memory hierarchy containing cache, main memory and disk

Memory hierarchy Cache memory * Organization Cache block or cache line -- Inclusive or exclusive -- Direct, fully associative, set associative * Different levels of caches Why? How many levels? * Cache hit ratio What factors influence it? Main memory * Memory protection * Virtual memory?

Memory protection using bound registers

A schematic of virtual memory operation

Input/Output organization Involvement of the CPU in I/O operations -- Should be the minimum possible due to imbalance between CPU and I/O speeds -- CPU should be free to execute instructions while I/O operations are in progress Different I/O modes -- Programmed I/O -- Interrupt I/O -- Direct memory access (DMA)

Input Output Modes

Interrupts An interrupt signals the occurrence of an event to the CPU The CPU is diverted to execution of an OS routine Different classes of interrupts convey occurrence of different kinds of events

Classes of Interrupts

The interrupt action

Steps in interrupt action

An operating system in its computing environment

Interrupt driven operation of a kernel

System Call A system call is a request made by a program through a special instruction called a `software interrupt instruction The software interrupt is a program interrupt When a software interrupt occurs, the interrupt hardware transfers control to a routine of the OS The operand of the software interrupt instruction indicates what kind of request is being made by a program

System Calls

Interrupt processing and scheduling

Simple and nested interrupt processing

Classes of Operating Systems

Efficiency, System Performance, and User Service Two of the fundamental goals of an OS: Efficiency of use Of a resource User convenience Measurable aspect: User service Turnaround time Response time To a system administrator, performance of a system in its environment is more important Typically measured as throughput

Efficiency, System Performance, and User Service (continued)

Batch Processing Systems Batch: sequence of user jobs formed for processing by the OS Batching kernel initiates processing of jobs without requiring computer operator s intervention Card readers and printers were a performance bottleneck in the 1960s Virtual card readers and printers implemented through magnetic tapes were used to solve this problem Control statements used to protect against interference between jobs Command interpreter read a card when currently executing program in job wanted the next card

Multiprogramming Systems Provide efficient resource utilization in a noninteractive environment Uses DMA mode of I/O Can perform I/O operations of some program(s) while using the CPU to execute some other program Makes efficient use of both the CPU and I/O devices Turnaround time of a program is the appropriate measure of user service in these systems

Multiprogramming Systems (continued)

Multiprogramming Systems (continued)

Multiprogramming Systems (continued) An appropriate measure of performance of a multiprogramming OS is throughput Ratio of the number of programs processed and the total time taken to process them OS keeps enough programs in memory at all times, so that CPU and I/O devices are not idle Degree of multiprogramming: number of programs Uses an appropriate program mix of CPU-bound programs and I/O-bound programs Assigns appropriate priorities to CPU-bound and I/Obound programs

Priority of Programs

Priority of Programs (continued) In multiprogramming environments, an I/O-bound program should have a higher priority than a CPU-bound program.

Performance of Multiprogramming systems How to improve performance?

Performance of Multiprogramming systems (continued) When an appropriate program mix is maintained, an increase in the degree of multiprogramming would result in an increase in throughput.

Time-Sharing Systems Provide a quick response to user subrequests Round-robin scheduling with time-slicing Kernel maintains a scheduling queue If time slice (δ) elapses before process completes servicing of a subrequest, kernel preempts it, moves it to end of queue, and schedules another process Implemented through a timer interrupt

Time-Sharing Systems (continued)

Time-Sharing Systems (continued) Response time (rt): measure of user service If processing of a subrequest requires δ CPU seconds rt = n (δ + σ) η = δ / (δ + σ) where η: CPU efficiency, σ: scheduling overhead, n: number of users using system, δ: time required to complete a subrequest Actual response time would be different because Some users may be inactive Some programs may require > δ CPU seconds

Time-Sharing Systems (continued)

Swapping of Programs Kernel performs swap-out and swap-in operations

Real-Time Operating Systems In real-time applications, users need computer to perform some actions in a timely manner To control activities in an external system, or to participate in them Timeliness depends on time constraints If application takes too long to respond to an activity, a failure can occur in the external system Response requirement Deadline: time by which action should be performed

Hard and Soft Real-Time Systems A hard real-time system meets response requirements under all conditions It is typically dedicated to processing real-time applications A soft real-time system makes best effort to meet response requirement of a real-time application Cannot guarantee that it will be able to meet it Meets requirements in a probabilistic manner E.g., multimedia applications

Features of a Real-Time Operating System

Distributed Operating Systems A distributed computer system consists of several individual computer systems connected through a network Each computer system could be a PC, a multiprocessor system, or a cluster Many resources of a kind exist in system This feature is used to provide the benefits summarized in Table 3.8 Handling network or individual computers failure requires special techniques Users must use special techniques to access resources over the network

Distributed Operating Systems (continued)

Special Techniques of Distributed Operating Systems

Modern Operating Systems

Summary A computing environment consists of a computer system, its interfaces with other systems, and the services provided by its OS to users and programs Evolved with advances in computer technology: Batch processing systems Multiprogramming operating system Priority-based scheduling Time-sharing operating systems Round-robin scheduling with time-slicing

Summary (continued) Evolution (continued) Real-time operating systems Priority-based scheduling and deadline-aware scheduling Distributed operating system Lets programs share resources across network Modern operating system Modern computing environment has elements of all the classic computing environments Uses different techniques for different applications