Top Banner
CS 6560 Operating System Design Lecture 1
32

CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Dec 26, 2015

Download

Documents

Ralf Kelly
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

CS 6560 Operating System Design

Lecture 1

Page 2: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Overview

• 1.1 What is an operating system

• 1.2 History of operating systems

• 1.3 The operating system zoo

• 1.4 Computer hardware review

• 1.5 System Calls

Page 3: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Some References

Page 4: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Core References

Page 5: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer System

• A Computer System Consists of– Hardware

• Internal: CPU, CPU support, memory, bus, adapters, disk drives

• External: display, keyboard, disk drives, printers

– Software• Firmware

• Operating System

• Other System Software

• Application Programs

Page 6: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

A Computer System

• A computer system consists of– hardware– system programs– application programs

Physical devices

Microprogramming system

Machine Language interface

Kernel

Compilers EditorsInterpreters

Office Suite Web Browsers

Hardware

Operating System

Applications Multimedia tools

Page 7: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

What is an Operating System

• It is an extended machine– Hides the messy details which must be performed– Presents user with a virtual machine, easier to use

• It is a resource manager– Each program gets time with the resources– Each program gets space on the resources

Page 8: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

History of Computer Systems• First generation 1945 - 1955

– Technology: vacuum tubes, plug boards

– Sign up for time, exclusive use of the machine

– Languages: none

– OS: no operating system

• Second generation 1955 - 1965– Technology: transistors, punch cards

– Mainframes

– Languages: FORTRAN, COBOL,

– Jobs

– OS: batch systems, libraries

• Third generation 1965 – 1980– Technology: Integrated Circuits

– Large mainframes and smaller machines (IBM 360 family)

– Minicomputers (DEC)

– OS: multiprogramming, large systems (multipart), batch and timesharing, emergence of Unix

• Fourth generation 1980 – present– Technology: Mass production of integrated circuits (chips and boards)

– Personal computers/servers/Internet

– OS: embedded -> supercomputer, CP/M -> Windows, PARC->Macintosh, Unix -> Linux/Solaris

Page 9: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

History of Operating Systems (2nd Generation)

• Structure of a typical job – 2nd generation

Page 10: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

System Life Cycle

• Ontogeny Recapitulates Phylogeny (Ernst Haeckel, 1866)

• Ontogeny = "the development of an individual organism from egg to maturity”

• Recapitulates = “repeats”

• Phylogeny = “the development over time of a kind of organism”

Page 11: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

The Operating System Taxonomy

• Mainframe operating systems• Server operating systems• Multiprocessor operating systems• Personal computer operating systems• Real-time operating systems• Embedded operating systems• Smart card operating systems• Virtual systems• Clusters and grids

Page 12: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Insides

Page 13: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware

• Components of a typical computer

Bus

Memory CPUVideo

AdapterDisk

ControllerKeyboardController

MouseController

NetworkAdapter

DisplayMonitor

Hard Disks

DVD/CD Disk

Keyboard Mouse

Page 14: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Types of Devices

• Categories– CPU– Memory– Clock– Bus control: Arbitration, Interrupt, DMA– Block devices– Character– Memory mapped– Networking

• Performance• Wide range from 10 byes/sec (keyboard) to several hundred

megabytes/sec (PCI bus)

Page 15: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

CPU Architecture

• Memory Cache

• Instruction Decoding

• Arithmetic Logic Units

• Floating Point Unit

• Internal Buses

Page 16: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware Review

Structure of a Pentium-based system

Page 17: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

CPU Registers

• Program counter

• Stack Pointer

• Program Status Word

• Data

• Address

Page 18: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware - Memory

One base-limit pair and two base-limit pairs

Page 19: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware• Typical memory hierarchy

– numbers shown are rough approximations

Type Access Time Size

Registers 1 nanosecond < 1KB

Cache 2 nanoseconds 1 MB

Main Memory 10 nanoseconds 256 MB - 4 GB

Disk 10 microseconds 100 GB - 1 TB

Tape 10 seconds 200 GB - ?

Page 20: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Secondary and Third Level Storage

Page 21: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Disks• Types

– Magnetic (fixed and removable, internal and external, RAID)

– Optical (CD-ROM, CD-R, DVD)

• Interfaces– IDE, SCSI, USB, Fiber Channel, etc.

• Recall basic structure– Cylinders, tracks, sectors– Issues: Cylinder skew, sector interleaving, virtual

geometry, logical block addressing– Architecture

• Integrated disk drive (drive with embedded computer system)• Bus-interface controller (interfaces between system bus and

cable to integrated disk drive)

Page 22: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware Review

Structure of a disk drive

Page 23: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Examples of Disks

Tanenbaum, MOS

Page 24: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Computer Hardware Review

(a) Steps in starting an I/O device and getting interrupt(b) How the CPU is interrupted

(a) (b)

Page 25: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Kernel-based Systems (Monolithic)

System calls

File Management

Process Management

Interprocess Communication Management

Memory Management

General Purpose Functions Device tables Device Drivers

Page 26: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

System Calls

Some Win32 API calls

Page 27: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Steps for System Call

• 1-3) Push registers on stack• 4) call library function• 5) place function # in register (or stack)• 6) execute TRAP instruction• 7) dispatch to call handler• 8) runs a handler• 9) returns to library function• 10) returns back to program• 11) cleans up the stack

Page 28: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Steps in Making a System Call

There are 11 steps in making the system call read (fd, buffer, nbytes)

Page 29: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Operating System Concepts

• A process tree– A created two child processes, B and C– B created three child processes, D, E, and F

Page 30: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Operating System Concepts

Two processes connected by a pipe

Page 31: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Operating System Concepts

Typical file and directory system for a university department

Page 32: CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.

Operating System Concepts

(a) A potential deadlock. (b) an actual deadlock.