Principles of Operating Systems CS 446/646

Similar documents
Operating Systems Introduction

OPERATING SYSTEM OVERVIEW

Introduction. What is an Operating System?

Chapter 2: OS Overview

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

Types Of Operating Systems

Operating Systems 4 th Class

1. Computer System Structure and Components

Components of a Computing System. What is an Operating System? Resources. Abstract Resources. Goals of an OS. System Software

Overview and History of Operating Systems

Computer-System Architecture

Operating System Structures

Operating System Tutorial

Chapter 1 Computer System Overview

OPERATING SYSTEM SERVICES

Chapter 3 Operating-System Structures

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Chapter 1: Introduction. What is an Operating System?

How To Understand And Understand An Operating System In C Programming

Have both hardware and software. Want to hide the details from the programmer (user).

Chapter 6, The Operating System Machine Level

Contents. Chapter 1. Introduction

CS161: Operating Systems

Overview of Operating Systems Instructor: Dr. Tongping Liu

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

EECS 678: Introduction to Operating Systems

Chapter 3. Operating Systems

Operating Systems Prof. Ashok K Agrawala

Chapter 1: Introduction. Chapter 1: Introduction. Operating System Concepts, 7th Edition. Objectives

Lecture 1 Operating System Overview

Operating system Dr. Shroouq J.

Chapter 11 I/O Management and Disk Scheduling

Operating System Components

CHAPTER 15: Operating Systems: An Overview

3 - Introduction to Operating Systems

OPERATING SYSTEM INDEX

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

System Virtual Machines

Traditional IBM Mainframe Operating Principles

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Origins of Operating Systems OS/360. Martin Grund HPI

COMPUTER SCIENCE AND ENGINEERING - Microprocessor Systems - Mitchell Aaron Thornton

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

Chapter 3: Operating-System Structures. Common System Components

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Operating Systems. Lecture 03. February 11, 2013

Virtualization. Pradipta De

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Operating Systems Overview

ELEC 377. Operating Systems. Week 1 Class 3

Unit 4 i5/os Work Management

Operating Systems: Basic Concepts and History

This tutorial will take you through step by step approach while learning Operating System concepts.

UNIT 1 OPERATING SYSTEM : AN OVERVIEW

Efficiency of Batch Operating Systems

CPS221 Lecture: Operating System Structure; Virtual Machines

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Exception and Interrupt Handling in ARM

Principles of Operating Systems CS 446/646

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

International Engineering Journal For Research & Development

Components of a Computer System

How To Understand The Principles Of Operating Systems

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

COS 318: Operating Systems. I/O Device and Drivers. Input and Output. Definitions and General Method. Revisit Hardware

System Structures. Services Interface Structure

Introducción. Diseño de sistemas digitales.1

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement

Central Processing Unit

Operating Systems. Rafael Ramirez (T, S)

Computer Systems Structure Input/Output

Virtualization for Cloud Computing

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203


CPS104 Computer Organization and Programming Lecture 18: Input-Output. Robert Wagner

Storage. The text highlighted in green in these slides contain external hyperlinks. 1 / 14

I/O Device and Drivers

8051 MICROCONTROLLER COURSE

Operating Systems, 6 th ed. Test Bank Chapter 7

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I DR. S. A. SODIYA

Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO

Operating Systems CSE 410, Spring File Management. Stephen Wagner Michigan State University

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Devices and Device Controllers

Read this before starting!

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

CA VM:Operator r3. Product Overview. Business Value. Delivery Approach

Recommended hardware system configurations for ANSYS users

Operating System Overview. Otto J. Anshus

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Transcription:

Principles of Operating Systems CS 446/646 1. Introduction to Operating Systems a. Role of an O/S b. O/S History and Features Serial processing Simple batch systems Multiprogrammed batch systems Time-sharing systems Personal computers c. Types of O/S d. Major O/S Components e. System Calls f. O/S Software Architecture g. Examples of O/S 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 27

Note: This section is not a history of computer models or a year-by-year chronology of the origins of specific operating systems, like UNIX or Windows. Our purpose is to highlight the generic features of operating systems through major periods in their evolution. 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 28

Serial processing First generation: 1945 55 room full of armoires: mechanical relays, then vacuum tubes http://ftp.arl.mil/ftp/historic-computers/ The ENIAC (Electronic Numerical Integrator And Computer) 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 29

Serial processing Human operator-programmer-user the machine was run from a console that had display lights, toggle switches, a plugboard or punched cards, a printer the programmer also operated the machine as she/he interacted directly with the bare hardware at first the computer was programmed by physically re-wiring it; later, through stored programs ( von Neumann architecture ) Operating systems were unheard of programs were entirely written in machine or assembly language one running program had complete control of the entire computer 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 30

Serial processing Programs directly access the hardware, one at a time program program program program time 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 31

Serial processing Problems? 1: scheduling users had access to the computer one by one in series machine time was reserved in blocks of half hours with a hardcopy sign-up sheet either the user was finished early and computer processing time was wasted or, more frequently, the user could not finish debugging her/his program during the allotted time Problem 2: duplication of programming efforts user wrote again and again the same routines (ex: I/O devices) no concept of libraries 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 32

Simple batch systems Second generation: 1955 65 advent of transistors and printed circuits http://www.columbia.edu/acis/history/1965.html The IBM 7094 at Columbia University 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 33

Simple batch systems Separation between operators and programmers first commercially viable machines the programmer prepares her/his job off-line on punched cards, brings the card deck to the machine room and waits for results the human operator runs the job and delivers a printed output New problem: problem? still basically serial processing one single job at a time huge setup time for each job: loading the compiler, the source program, saving the compiled program, loading, linking, etc. also mounting and dismounting tapes, handling card decks, etc. a lot of time was wasted manipulating things and walking around 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 34

Simple batch systems Solution? Solution: batch the jobs together 1. the human operator pre-reads a tray full of jobs onto a magnetic tape 2. the human operator loads a special program, the monitor, that will automatically read the jobs from the tape and run them sequentially 3. the effect of the monitor program is to write the output of each job on a second magnetic tape 4. finally, the human operator brings the full output tape for offline printing 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 35

Simple batch systems Tanenbaum, A. S. (2001) Modern Operating Systems (2nd Edition). a) programmer brings cards to IBM 1401 b) 1401 reads batch of jobs onto tape c) operator carries input tape to IBM 7094 d) 7094 does computing e) operator carries output tape to 1401 f) 1401 prints output An early IBM batch system 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 36

Simple batch systems The monitor program automates some of the human operator s tasks and is the ancestor of modern O/S the monitor is a special program that controls the sequence of events it always resides in main memory it reads in jobs one at a time, places a job in the user program area of the memory, and passes control to it upon completion, the user program branches back to the monitor, which immediately loads and executes the next job therefore, the CPU alternates between fetching/executing instructions from the monitor program and fetching/executing instructions from the user program 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 37

Simple batch systems Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Memory layout for a resident monitor 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 38

Simple batch systems A Job Control Language (JCL) operates the monitor primitive programming language: $JOB, $FTN, $LOAD, $RUN gives instructions to the monitor about what compiler to use, what data to work on, etc. JCL instructions were the early system calls Tanenbaum, A. S. (2001) Modern Operating Systems (2nd Edition). Structure of a typical Fortran Monitor System (FMS) job s card deck 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 39

Simple batch systems A batch system monitor is a special program that cohabitates in memory with the job being executed the monitor must alternate between seize and relinquish control the monitor must switch among various portions of memory Hardware features needed to support batch? memory protection timer (long-term, NOT preemptive) privileged instructions voluntary interrupts (monitor calls) this led to the concept of modes of operation 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 40

Simple batch systems Memory protection a job must not alter the memory area containing the monitor Timer (long-term) a global time limit prevents a job from monopolizing the system Privileged instructions certain machine-level instructions can only be executed by the monitor, for ex: access to all CPU registers or I/O access Voluntary interrupts (traps to monitor) make it easier to relinquish control to, and regain control from user programs (early computers did not have this capability) 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 41

Simple batch systems This led to the concept of modes of operation user programs execute in user mode: certain instructions may not be executed monitor executes in monitor mode (or system mode, control mode, kernel mode, privileged mode, supervisor mode, etc.) in monitor mode, privileged instructions can be executed, protected areas of memory and I/O devices may be accessed user/monitor mode is generally flagged by a bit in the Program Status Word (PSW) register of the CPU 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 42

Note: The history of computer systems reveals the problems faced by the early designers and operators, and the key ideas and solutions still around today. Computer science is fundamentally an empiric science: features have mainly evolved from needs. 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 43

Multiprogrammed batch systems Third generation: 1965-80 first major use of small-scale Integrated Circuits (ICs) http://www.thocp.net/hardware/pictures/ The IBM 360 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 44

Multiprogrammed batch systems Problem? Problem: despite batching,. a. lot. of CPU time is still wasted waiting for I/O instructions to complete I/O devices much slower than processor (especially tapes!) 15µs 1µs 15µs Time Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Example of system utilization with uniprogramming 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 45

Multiprogrammed batch systems Solution? Solution: load two jobs in memory while one job is waiting for I/O, the processor could switch to the other job Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Multiprogramming with two programs 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 46

Multiprogrammed batch systems Expand to three, four or more jobs jobs are kept in main memory at the same time and the CPU is multiplexed among them, or multiprogrammed multiprogramming ( multitasking ) is a central O/S theme Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Multiprogramming with three programs 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 47

Multiprogrammed batch systems Example of multiprogramming with three jobs Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Example of program execution attributes 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 48

Multiprogrammed batch systems Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). (a) uniprogramming Utilization histograms (b) multiprogramming 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 49

Multiprogrammed batch systems Multiprogramming results in more efficient resource utilization Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). Effects of multiprogramming on resource utilization 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 50

Multiprogrammed batch systems Summary: serial, batched uni-, and multiprogramming user job resident monitor operating system user job user job 1 user job 2 (a) serial uniprogramming (b) batched uniprogramming Evolution of memory management user job 3 (c) multiprogramming 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 51

Multiprogrammed batch systems job 1 job 2 job 3 (a) serial uniprogramming job 1 job 2 job 3 human overhead (b) batch uniprogramming job 1 I/O job 1 job 2 I/O job 2 I/O job 3 (b ) batch uniprogramming showing actual CPU usage and I/O wait...... job 1 I/O (c) multiprogramming job 1 job 2 I/O job 2 I/O job 3 Evolution of CPU utilization... time human operator s setup (mount tape, etc.) human operator s takedown (unmount) spooling 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 52

Multiprogrammed batch systems A multiprogramming O/S is fairly sophisticated compared to a uniprogramming O/S it requires. memory.. management: the system must allocate the memory to several jobs it requires CPU scheduling: the system must choose among several jobs ready to run Multiprogramming also relies on I/O hardware features? I/O interrupts: asynchronous interrupts from I/O device, upon completion Direct Memory Access (DMA) 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 53

Multiprogrammed batch systems Forward Note: Three I/O Techniques? (see 5.) Programmed I/O ( busy waiting ): the CPU is blocked and must poll the device to check if the I/O request completed Interrupt-driven I/O: the CPU can switch to other tasks and is (frequently) interrupted by the I/O device Direct Memory Access (DMA): the CPU is involved only at the start and the end of the whole transfer; it delegates control to an independent I/O controller that accesses memory directly without bothering the CPU needed for multiprogramming 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 54

Multiprogrammed batch systems Spooling (Simultaneous Peripheral Operation On-Line) is an important I/O feature for multiprogramming instead of preparing a batch of jobs on tape, new jobs are continuously and directly read in from cards onto disk as soon as they are brought to the computer room producer/consumer scheme: spooling decouples job loading from job execution through a buffer (on disk or in memory) useful because I/O devices access (read, write) data at different rates; the buffer provides a waiting station where data can rest while the slower device catches up same in the output direction (printers) 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 55

Multiprogrammed batch systems Reminder: The Memory Hierarchy? 1. registers inboard memory outboard offline 2. cache 3. main memory 4. disk 5. tape cost per bit capacity frequency of access access time 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 56

Multiprogrammed batch systems Forward Note: Types of Scheduling Long-term scheduling: which jobs (stored on disk) will be considered for execution Medium-term scheduling ( swapping ): which jobs are actually loaded into memory Short-term (CPU) scheduling ( dispatching ): which job available in memory is run next 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 57

Time-sharing systems Batch multiprogramming was not fully satisfactory why? multiprogramming alone does not give any guarantee that a program will run in a timely manner users had a growing need to control more closely the execution of their jobs and intervene (fix, retry, etc.) There was a need for multiple-user... interactivity each user wants to see their program running as if it was the only program in the computer but without reverting back to single-user signup sheets therefore the advent of time-sharing or preemptive multitasking systems 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 58

Time-sharing systems In the original multiprogramming systems tasks kept running until they performed an operation that required waiting for an external event such as I/O multiprogramming was designed to maximize CPU usage In time-sharing systems running tasks are required to relinquish the CPU on a regular basis through hardware interrupts (timer) time-sharing is designed to minimize response time and allow several programs to execute apparently simultaneously time sharing is a logical extension of multiprogramming for handling multiple interactive jobs among multiple users birth of Unix in the 1960 s: CTSS MULTICS UNIX 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 59

Personal computers Fourth generation: 1980-Present Large Scale Integration (LSI) makes personal computing real http://www.it.unr.edu/facilities/cordlab.asp E. L. Cord computer lab at UNR 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 60

Personal computers So From what s multiple happening users back now? to a single user preemptive multitasking was developed in the 1960 s to share big and costly mainframe computers among multiple users since then, single-user interactive computing has become possible on dedicated personal computers (PCs) Resource sharing not critical anymore, yet multitasking still a central feature of modern PC operating systems a single-tasking environment is tedious: one must close the drawing application before opening the word processor, etc. multitasking makes it possible for a single user to run multiple applications at the same time (or background processes) while retaining control of the computer 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 61

Personal computers Other mainframe system features have been integrated into PC systems, for example: file protection in multi-user systems, file protection was critical in single-user PCs, it was not considered necessary at first, but reappeared with the advent of networking PC systems emphasize user convenience the primary goal of the mainframe multiprogrammed systems was to maximize CPU utilization as in time-sharing systems, the primary goal of PC systems is rather to maximize user convenience and responsiveness 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 62

Personal computers Ontogeny recapitulates phylogeny Silberschatz, A., Galvin, P. B. and Gagne. G. (2003) Operating Systems Concepts with Java (6th Edition). Migration of operating system concepts and features 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 63

Principles of Operating Systems CS 446/646 1. Introduction to Operating Systems a. Role of an O/S b. O/S History and Features Serial processing Simple batch systems Multiprogrammed batch systems Time-sharing systems Personal computers c. Types of O/S d. Major O/S Components e. System Calls f. O/S Software Architecture g. Examples of O/S 1/26/2006 CS 446/646 - Principles of Operating Systems - 1. Introduction 64