Reserves time on a paper sign-up sheet. Programmer runs his own program. Relays or vacuum tube hardware. Plug board or punch card input.

Similar documents
Unit 2 : Computer and Operating System Structure

Principles of Operating Systems CS 446/646

Andrew S. Tanenbaum, Operating Systems, Design and Implementation, (Second Edition), Prentice Hall.

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

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

Operating Systems CS 571

Introduction to OS. Introduction MOS Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Fundamental Concepts and History

Operating Systems. I. Introduction. Eurecom

Operating Systems ( )

OPERATING SYSTEMS UNIT - 1

Operating Systems, Fall

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

CS450/550 Operating Systems

Overview of Operating Systems

Master level: Operating systems, distributed systems, networking,

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Computer System Overview

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Operating Systems. Antônio Augusto Fröhlich LISHA/UFSC. December 20, 2008

ELEC 377 Operating Systems. Week 1 Class 2

Chapter 13: I/O Systems

Operating Systems Overview. Chapter 2

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

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

CSC 453 Operating Systems

Operating Systems ( )

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

Operating Systems ( )

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

History, Hardware, OS Concepts

Introduction To Operating System

Operating-System Structures

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

CMPS 111: Introduction to Operating Systems

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

Overview of Operating Systems

Operating Systems CS3502 Spring 2018

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

Implementation should be efficient. Provide an abstraction to the user. Abstraction should be useful. Ownership and permissions.

File Systems Ch 4. 1 CS 422 T W Bennet Mississippi College

The Challenges of X86 Hardware Virtualization. GCC- Virtualization: Rajeev Wankar 36

SMD149 - Operating Systems

Roland Parviainen Phone: Office:? Web:

Operating Systems ( )

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

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Memory Management Ch. 3

Main Points of the Computer Organization and System Software Module

CPSC/ECE 3220 Fall 2017 Exam Give the definition (note: not the roles) for an operating system as stated in the textbook. (2 pts.

Module 1 Introduction/OS Overview

OS concepts and structure. q OS components & interconnects q Structuring OSs q Next time: Processes

COS 318: Operating Systems

OS - Introduction Ezio Bartocci Institute for Computer Engineering

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

OPERATING SYSTEMS OVERVIEW

Operating Systems. studykorner.org

Operating System Architecture. CS3026 Operating Systems Lecture 03

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

CS370 Operating Systems

Types and Functions of Win Operating Systems

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

CS370 Operating Systems

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

Four Components of a Computer System

Chapter 2: Operating-System Structures

Introduction to Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Operating Systems. Hadi Salimi Computer Engineering Department Iran University of Science and Technology Tehran, Iran

5 Lecture: Intro. to Concurrency

Operating-System Structures

Operating Systems Concepts

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

Operating System Review

Operating Systems Structure. Otto J. Anshus

Chapter 3: Operating-System Structures

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Introduction to Computer Systems and Operating Systems

EEE 435 Principles of Operating Systems

Computer System Architecture. CMPT 300 Operating Systems I. Summer Segment 3: Computer System Architecture. Melissa O Neill

Operating Systems Course 2 nd semester 2016/2017 Chapter 1: Introduction

references Virtualization services Topics Virtualization

The First Operating System Was Human

Chapter 2. OS Overview

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

Chapter 3: Operating-System Structures

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

Chapter 3: Operating-System Structures

CSC 453 Operating Systems

2. The system of... generally ran one job at a time. These were called single stream batch processing.

COS 318: Operating Systems. Overview. Jaswinder Pal Singh Computer Science Department Princeton University

TYPES OF OPERATING SYSTEMS. Dimple Juneja

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

14-Nov-11. Chapter 5: System Software: Operating Systems and Utility Programs. Learning Objectives. Learning Objectives. Overview

Preview. The Thread Model Motivation of Threads Benefits of Threads Implementation of Thread

Process Description and Control

Operating System Support

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Chapter 13: I/O Systems

Transcription:

Introduction & Ch1 Two Roles of an Operating System Extended Machine or virtual machine Device drivers, Processes, File systems, Networking protocols. Resource Manager Allocates and enforces Memory, Disk space, Devices (e.g. printer) Structure Web browser E-mail reader Music player User mode User interface program Kernel mode Operating system First Gen 1940 s and 1950 s Relays or vacuum tube hardware. Plug board or punch card input. Programmer runs his own program. Reserves time on a paper sign-up sheet. No Operating System Software Hardware Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 1 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 2 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 3 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 4

Problems Scheduling inefficiency. Time wasted mounting tapes and cards. Result: Low utilization of a very expensive piece of equipment. Second Gen: Batch Mainframes Mid-1950 s to Mid-1960 s Transistorized equipment. Punch-card input. Users distinct from the designers and builders. Equipment isolated and controlled by operators. User inputs a stream of jobs, usually on cards. Batch Systems Card reader Tape drive Input tape System tape Output tape 1401 7094 1401 (a) (b) (c) (d) (e) (f) Third Gen: Multiprocessing Integrated Circuits Multiprogramming Leader: IBM 360. One machine for both scientific and business DP. Multiprogramming: Leverage the mix of I/O and compute-bound jobs. Multiple jobs in memory. Each has its own contiguous region. Spooling: Main machine does its own job input. Printer Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 5 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 6 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 7 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 8

Time-sharing Desire to return to interactive use. Leader: Compatible Time Sharing System (CTSS) MULTICS: A centralized computing utility. Advanced the field Not a commercial success Unix: Created by ATT scientists left w/o MULTICS Written on spare minicomputer Very popular in academia and elsewhere BSD and SysV Linux Fourth Gen: Personal Computers 1975: Intel 8080 CP/M 1981: IBM PC DOS 1960 s: Douglas Englebert at SRI Xerox PARC GUI Steve Jobs (Apple) visited PARC Lisa Macintosh Fourth Gen: Personal Computers MS influenced by Mac Windows Windows 95 Windows 98 Windows ME Windows NT Windows 2000 Windows XP Vista Windows 7 Unix popular on engineering stations Linux occasionally X-Windows OS Types Mainframe Server Multiprocessor PC Handheld Embedded Sensor Node Smart-Card Real-Time Hard Soft Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 9 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 10 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 11 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 12

Hardware Overview Hardware Components CPU Memory Process abstraction I/O Devices Drivers, clean interfaces Storage Devices File system abstraction Hardware Overview CPUs Traditionally, there is one CPU. Multiple-CPUs used on high-end systems. Muliti-core systems are now the usual. Multithreading (or hyperthreading) makes it faster for the OS to change which program is running. Hardware Overview CPU Registers Program counter. Stack pointer. General purpose registers. Program Status Word (PSW) Collection of status values and flags. Collectively the CPU state Hardware Overview I/O I/O operations are slow. CPU must start the operation then wait for completion Polling Loop on a status query Are we there yet? Interrupt-Driven CPU start operation; device interrupts CPU on completion. Direct Memory Access (DMA) A DMA controller batches of I/O operations. Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 13 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 14 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 15 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 16

Hardware Overview Interrupts Much like an asynchronous function call. Similar to event handlers in a GUI. Peripheral device signals the CPU. CPU calls the interrupt vector in response. CPU saves its state, runs the vector, then restores the state. Restoring the PC returns to calling point. Avoids the need to poll. Hardware Overview Traps CPU interrupts itself. Program errors or exceptions. Divide by zero Illegal address Undefined op code etc Hardware Support for the OS Certain hardware features are required to implement a reasonable OS Traps and Interrupts CPU Modes Memory Protection Clock Interrupt Traps and Interrupts Interrupt vectors are part of the O/S. Interrupts give control to the O/S. O/S regains control when I/O completes. O/S Can let other other code run during I/O Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 17 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 18 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 19 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 20

CPU Modes User and supervisory mode. User code uses user mode OS uses supervisory mode Some instructions forbidden in user mode. Interrupts and syscall change to supervisory. OS switches to user before return. Reserves certain operations for the OS alone. I/O Operations are Privileged Most I/O operations are forbidden in user mode. Gives O/S exclusive control over disk operations. A user programs must ask the OS to perform IO for it. Keeps user code from violating file permissions. Memory Protection In user mode, CPU may access only a portion of the memory. Violations trap Base and limit registers. Segment codes. Virtual memory (ch. 3). Instructions to set or modify protection are privileged. OS sets memory limits, hardware enforces. Clock Interrupt Periodically interrupts the CPU. Setting the interrupt time is privileged. Makes certain the CPU always gets control eventually. Allows O/S to enforce CPU allocation. Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 21 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 22 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 23 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 24

System Calls How user software talks to the OS. Syscall instruction is a deliberate trap. Store arguments in a standard place. Push on the stack or store in standard registers Execute the syscall instruction. OS handles the operation and returns. Operations Performed With System Calls Create a file or directory. Read or write a file. Send or receive a network packet. Create or terminate a process. Anything that requires privileged instructions. Structure Monolithic Single supervisory-mode kernel provides all O/S services. Layered Kernel is build in layers each provided additional services to those above. Micro-kernel Minimal supervisory-mode kernel Linux Layered Kernel System calls I/O component Memory mgt component Process mgt component Virtual file system Terminals Sockets Character device drivers Network protocols Network device drivers File systems Generic block layer I/O scheduler Block device drivers Virtual memory Paging page replacement Interrupts Dispatcher Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 25 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 26 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 27 Line discipline Page cache Signal handling Process/thread creation & termination CPU scheduling Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 28

Micro-kernels Process Shell Make Other User progs.... User mode FS Proc. Reinc. Other... Servers Disk TTY Netw Print Other... Drivers Microkernel handles interrupts, processes, scheduling, IPC Clock Sys Micro-kernels Clean, extensible design. Message-passing easily distributed. Has not been commercially successful for performance reasons. Virtual Machines VM layer divides the resources to provide exact, shrunken copies of the hardware Virtual 370s System calls here I/O instructions here CMS CMS CMS Trap here Trap here VM/370 370 Bare hardware DOS mode under Windows Two Types Type 1: VM runs on the hardware. Used by IBM in the 70s. Type 2: VM runs on an OS VMWare, Virtual Box, Virtual PC Guest OS process Excel Word Mplayer Apollon Host OS process Guest OS Windows Linux... Type 2 hypervisor Type 1 hypervisor Host operating system (a) (b) Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 29 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 30 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 31 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 32

IBM Had It Easier VM must run in user mode and simulate privileged instructions. Easiest of the instructions cause traps. Pentium class machines tend to ignore privileged instructions. Pentium VMs have to do more simulation. Current generations translate binary by block. Sources Tanenbaum, Modern Operating Systems (Course textbook.) Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 33 Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 34