Introduction. What is an Operating System?



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

Operating Systems 4 th Class

Operating System Structures

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

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

Chapter 3: Operating-System Structures. Common System Components

CSC 2405: Computer Systems II

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Chapter 3 Operating-System Structures

Operating Systems Overview

Types Of Operating Systems

Computer-System Architecture

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

Overview of Operating Systems Instructor: Dr. Tongping Liu

OPERATING SYSTEM OVERVIEW

Chapter 2: OS Overview

1. Computer System Structure and Components

Chapter 3. Operating Systems

OPERATING SYSTEM SERVICES

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Lecture 1 Operating System Overview

CHAPTER 15: Operating Systems: An Overview

How To Understand The Principles Of Operating Systems

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

Operating System Tutorial

Operating System Components

Chapter 3: Operating Systems

Operating system Dr. Shroouq J.

Chapter 6, The Operating System Machine Level

CS161: Operating Systems

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

Operating System Overview. Otto J. Anshus

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

Chapter 1: Introduction. What is an Operating System?

Overview and History of Operating Systems

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

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

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

CS3600 SYSTEMS AND NETWORKS

OPERATING SYSTEMS STRUCTURES

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Example of Standard API

Chapter 2 System Structures

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

Chapter 11 I/O Management and Disk Scheduling

1 Organization of Operating Systems

Traditional IBM Mainframe Operating Principles

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

System Structures. Services Interface Structure

ELEC 377. Operating Systems. Week 1 Class 3

I/O. Input/Output. Types of devices. Interface. Computer hardware

Computer Engineering

Operating Systems Prof. Ashok K Agrawala

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

How To Understand The History Of An Operating System

Chapter 1 Computer System Overview

SYSTEM ecos Embedded Configurable Operating System

Operating System Structures

Input / Output and I/O Strategies

Operating Systems: Basic Concepts and History

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

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Common Operating-System Components

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Principles of Operating Systems CS 446/646

I/O Device and Drivers

Components of a Computer System

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

Operating System Components and Services

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

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

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

CS420: Operating Systems OS Services & System Calls

Contents. Chapter 1. Introduction

COS 318: Operating Systems

Operating System Structure

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

Operating Systems. Lecture 03. February 11, 2013

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

Embedded Systems. 6. Real-Time Operating Systems

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203

Origins of Operating Systems OS/360. Martin Grund HPI

LSN 10 Linux Overview

OPERATING SYSTEM INDEX

Real Time Programming: Concepts

Device Management Functions

Computers: Tools for an Information Age

CPS221 Lecture: Operating System Structure; Virtual Machines

Computer Organization & Architecture Lecture #19

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

Operating System Organization. Purpose of an OS

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

OS Concepts and structure

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Lecture 25 Symbian OS

Virtualization. Pradipta De

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

System Virtual Machines

Transcription:

Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization of CPU and I/O 5 Types of Operating Systems An Operating System is a Program It acts as an interface between the user and the hardware System/Application Barrier add x,y mov a,b jump label Operating System Software (Code and Data Structures) User Application Programs P M Computer Hardware (ors, Memory & Devices) A Primitive Its purpose is to: Make the computer convenient to use Simulate features the hardware does not have Improve efficiency of the computer CS Basic OS 1 CS Basic OS 2 Historical Perspective Historical Perspective (cont) Bare Machine Early 1950 s Structure Single User System Programmer/User as the Operator Tape/Card Based Early Software Loaders Assemblers Libraries of Common Subroutines (birth of the first operating systems) Linkers Compilers Run-time System Secure Inefficient use of Expensive Resources Problem: Job to Job Setup Time Simple Batch Systems (single user at a time) Reduce Set Up Time by Batching Jobs Add a Card Reader Hire an Operator (User is not the Operator) Automatic Job Sequencing Problem: How to distinguish: 1 Job from Job 2 Data from Program CS Basic OS 3 CS Basic OS 4

Historical Perspective (cont) Historical Perspective (cont) Solution: Control Cards Special Cards to Indicate What to Do: $JOB, $FTN, $RUN, $DATA, $EOJ Special Characters for Some Control $ in Column 1 // in Column 1 and 2 Control Card Interpreter (first Resident OS) forever { read a card; execute it; } Another Problem: How to Keep User From Reading Control Cards? One Routine to Read Input In Library Everyone Uses it Never Reads Past a Control Card Device Driver Eventually, One For Every Device Which Knows Device Characteristics and Properties Virtual Device eg Read one Card or Print One Line CS Basic OS 5 CS Basic OS 6 Historical Perspective (cont) Historical Perspective (cont) Off Line Operation Even More Problems: 1 System is Not Secure User Could do Own I/O and Avoid Device Driver Memory for Device Driver not Protected 2 Poor Performance I/O and CPU Cannot Overlap Work I/O Devices Cannot Either Goal Speed up Computation; How Add Tapes Card Reader Printer Satellite or IN OUT IN OUT Main Computer IN IN User Could do I/O System Insecure CS Basic OS 7 CS Basic OS 8

Historical Perspective (cont) Historical Perspective (cont) Spooling: Overlap the I/O of One Job With the Computation of Another Job Buffering: Overlap the I/O of a Job With the Job s Own Computation While Executing One Job, Read the Next Job From the Card Reader Into a Storage Area on the Disk While Executing One Job, Print the Output From Another Job Synchronous CPU SIO I/O Asynchronous CPU I/O SIO CS Basic OS 9 CS Basic OS 10 How to do Asynchronous I/O Buffering Example Direct Memory Access (DMA) I/O Commands CPU I/O Devices Memory Read one Command at a Time From the Terminal and it 1 Allocate 2 Buffers (B 1 and B 2 ) 2 Read First Line Into B 1 3 Read Next Line Into B 2 While ing B 1 4 When Done ing B 1 Wait Until B 2 is Full Channels I/O Commands 5 Read Next Line Into B 1 While ing B 2 6 When Done ing B 2 Wait Until B 1 is Full 7 Goto Step 3 CPU Channel Memory I/O Devices CS Basic OS 11 CS Basic OS 12

Problem: How Do We Know That the I/O is Done? Interrupts and Traps (Exceptions) 1 Polling Add a Flag Which is Set By The Device While it is Busy Test the Flag and Loop When The Result of a I/O Request is Needed 2 Interrupts Have the Device Tell the CPU When it is Done The CPU Stops What it is Doing, Does Some Work for the Device, Then Continues Where it Left Off Interrupts Device I/O Completion Device Attention Request Hardware Failure Traps Arithmetic Overflow Memory Fault Illegal Instruction CS Basic OS 13 CS Basic OS 14 Interrupt (Trap) ing How to use Interrupts for Buffering 1 Finish Executing The Current Instruction 2 Save Program Counter 3 Transfer to an Interrupt (Trap) Handler at a Predefined Location 4 Save the CPU State 5 Service the Interrupt (Trap) 6 Restore the CPU State 7 Resume at the Instruction Following the Instruction Interrupted There is Usually an Unique Interrupt (Trap) Handler for Each Possible Kind of Interrupt (Trap) program() { busy = true; send request to read buffer 2; process buffer 1; while( busy ) skip; busy = true; send request to read buffer 1; process buffer 2; while( busy ) skip; } io_device() { receive request; process request; send interrupt; } interrupt_handler() { busy = false; } CS Basic OS 15 CS Basic OS 16

Multiprogramming Problems With Multiprogramming Allow Multiple Programs to Reside in the Memory of the Computer at the Same Time When a Program Blocks, Instead of Waiting for Interrupt, Execute Another Program When that Program Blocks, Execute Yet Another Program Etc 1 Protect I/O Devices One Program May Corrupt Another Program by Directly Accessing That Programs Data on the I/O Devices 2 Protect Memory One Program May Corrupt Another Program by Directly Accessing That Programs Memory 3 Protect CPU One Program May Monopolize the or by Never Blocking CS Basic OS 17 CS Basic OS 18 Protecting I/O Problem: How Do We Get Into System Mode in the First Place Disallow Users to Access I/O Devices Introduce Privilege Operation Modes Monitor/User Supervisor/User Master/Slave Kernel/User System/Application Only all I/O While Executing in System Privilege Mode Whenever an Interrupt or Trap Occurs Add a Special Trap For Program to Request Service From the Operating System (SVC) CS Basic OS 19 CS Basic OS 20

Protecting Memory Protecting the CPU (Timesharing and Interactive Computing) Bounds Registers Lower Bound Register Upper Bound Register System Program #1 Program #2 Program #3 Program #4 Use Multiprogramming But Add a Timer to Force a Program to Block After a Certain Quantum of Time Move Some (Idle) Programs Out of Memory to Mass Storage to Allow More Programs to Run Replace the Control Card Interpreter With a Command Language Must Be Executing in System Privilege Mode to Load Bounds Registers When in System Privilege Mode Ignore Bounds Registers CS Basic OS 21 CS Basic OS 22 Classes of Computers Summary Personal Computers Workstations Mainframes Multiprocessors Distributed Systems Real Time Systems Operating Systems: Provide Convenient Environment for the Development and Execution of Programs Schedule and Overlap Activities to Ensure Good Performance From the Computer Evolved From Batch Systems to Multiprogrammed and Timeshared CS Basic OS 23 CS Basic OS 24

Operating System Components Management Management Memory Management Secondary Storage Management I/O System File Management Protection System Networking System Programs Create and Delete es Suspend and Resume es Allow es to Synchronize Interprocess Communication Deadlock Detection, Avoidance, & Correction CS Basic OS 25 CS Basic OS 26 Memory Management Secondary Storage and I/O Keep Multiple es in Memory Decide When to Load and Unload es Share Memory Between es Allocate and Deallocate Memory to a Retrieve and Store Data Abstract Device Details Schedule Disk Activity Allocate Disk Space Buffer Data Handle I/O Interrupts CS Basic OS 27 CS Basic OS 28

File Systems Protection Create and Delete Files Create and Delete Directories Read/Write Files Map Files Onto Disks Protect Users From Each Other Protect User From Himself Protect System From Users CS Basic OS 29 CS Basic OS 30 Networks System Programs Let Users on Different Systems Exchange Data Let Different Systems Exchange Data Distributed Systems Command Interpreter (sh, csh, ksh) Print File (lpr) Copy File (cp) Edit File (ed, vi, emacs) Display Directory (ls) Sort (sort) Compare Files (cmp, diff) Send Mail (mail) Read News (rn) Compile Programs (cc) Command Interpreter Parses Commands and Executes Other System Programs CS Basic OS 31 CS Basic OS 32

Types of Operating System Services System Calls User Interface Program Execution Input/Output Operations File System Manipulation Error Detection System Control Resource Allocation Accounting Protection Assembly Language Macros or Subroutines Need to Use an SVC Instruction i = read(fd,80,buffer) --> push buffer push 80 push fd SVC read pop i Unix Has About 32 System Calls read(), write(), open(), close(), fork(), exec(), ioctl(), etc CS Basic OS 33 CS Basic OS 34 How System Calls Work System Design and Implementation 1 SVC Causes a Trap 2 System Privilege Mode Entered 3 Trap Handler Decodes Which SVC 4 Branch to System Function 5 Access Arguments From the Stack 6 Push Results on the Stack 7 Return to Trap Handler 8 Resume Application Privilege Mode 9 Return to Instruction Following SVC Establish Design Goals What are the Requirements What do Users Want (Know Your User) Batch, Time-Shared, Single-User, Multi-User, Distributed, Real-Time, General Purpose Use Good Software Engineering Separate Policy from Mechanisms Choose an Implementation Language CS Basic OS 35 CS Basic OS 36

Operating System Structuring Techniques A Monitor Single Monitor Kernel Layered Systems Hierarchy Functional Hierarchy Virtual Machine Message-Passing Port Based Based Object-Based Object-Oriented es Waiting for a Condition x: y: z: protected data es Waiting to Enter Monitor CS Basic OS 37 CS Basic OS 38 A Kernel Layered System user program logical communication user program Break Kernel up into Successive Layers of Abstraction Kernel physical communication process management interprocess communication interrupt handling User Programs Interface Primitives Device Drivers and Schedulers Virtual Memory I/O CPU Scheduling Hardware file system interrupt handler device driver CS Basic OS 39 CS Basic OS 40

Message-Passing System Object-Based System user program Send user program Object Object Object Reply operation system service program operation system service Computer 1 Computer 2 Object system service user program Object system service Object system service OS CS Basic OS 41 CS Basic OS 42 Object-Oriented System Summary Start With Object-Based Model Implement Very Efficient Message Send Add Very Lightweight Objects Add Classes to Define Objects Add a Hierarchy of Classes Operating System Components: Management, Memory Management, File Management, etc User Interface Command Interpreter System Programs System Calls Design and Implementation Structuring Techniques CS Basic OS 43 CS Basic OS 44

This page intentionally left blank This page intentionally left blank CS Basic OS 45 CS Basic OS 46 This page intentionally left blank CS Basic OS 47