contact information office: 225 neville hall office hours: monday and wednesday 12:00-1:00 e-main:...

35
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@ umcs . maine . edu Phone: 581-3967 Textbook: Tanenbaum, Modern Operating Systems (2nd edition) URL: http:// umcs . maine . edu /~dickens/COS431/COS431.html

Upload: silvester-cunningham

Post on 31-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Contact Information

Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: [email protected] Phone: 581-3967 Textbook: Tanenbaum, Modern Operating Systems

(2nd edition) URL: http://umcs.maine.edu

/~dickens/COS431/COS431.html

Page 2: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Introduction

Chapter 1

1.1 What is an operating system1.2 History of operating systems1.3 The operating system zoo1.4 Computer hardware review1.5 Operating system concepts1.6 System calls1.7 Operating system structure

Page 3: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Introduction

A computer system consists of hardware system programs application programs

Page 4: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Hardware: Physical Devices:

Memory, CPU, I/O devices…. Microarchitecture: Executes machine-level

instructions. Hardware or firmware. Machine language: Hardware and

instructions visible to an assembly language program.

System Components

Page 5: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Introduction

Operating System: Hides complexity of hardware and

provides simplified set of instructions.

Page 6: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Introduction

System programs: Generally execute in user mode. Command interpreter (shell),

compilers, editors, …..

Page 7: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

So 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

Don’t want to program I/O devices, handle interrupts, etc.

It is a resource manager (and scheduler) Each program gets time with the resource

E.g., CPU, I/O devices, memory Each program gets space on the resource

E.g., Disk space.

Page 8: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

History of Operating Systems

First generation 1945 - 1955 vacuum tubes, plug boards Scheduling algorithm was a signup sheet.

Second generation 1955 – 1965 Operator loading in programs from card deck one at

a time. Led to batch systems

Page 9: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Early batch system bring cards to 1401 read cards to tape put tape on 7094 which does computing put tape on 1401 which prints output

Page 10: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

History of Operating Systems (3)

Structure of a typical FMS job – 2nd generation

Page 11: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Early Operating Systems

Automatic job sequencing – automatically transfers control from one job to another. First rudimentary operating system.

Resident monitor initial control in monitor control transfers to job when job completes control transfers pack to monitor

Page 12: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Memory Layout for a Simple Batch System

Page 13: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Third generation 1965 – 1980 Machines were very expensive and CPU frequently

idle. Led to multiprogramming.

Page 14: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Multiprogramming system three jobs in memory – 3rd generation

Page 15: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Multiprogramming Batch Systems

Solution: Multiplex CPU between multiple jobs.

Page 16: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

OS Features Needed for Multiprogramming

Use of disk space to hold jobs not in system.

Job scheduling: Choose jobs to bring into memory.

Memory management – the system must allocate the memory to several jobs.

CPU scheduling – the system must choose among several jobs ready to run.

Allocation of devices.

Page 17: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Time-Sharing Systems–Interactive Computing

The CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory).

A job swapped in and out of memory to the disk. On-line communication between the user and the

system is provided; when the operating system finishes the execution of one command, it seeks the next “control statement” from the user’s keyboard.

i.e., the shell Goal is to give the illusion that each user has own

machines. Response time is a priority.

Page 18: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Computer Hardware Review

Components of a simple personal computer

Monitor

Bus

Page 19: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Special registers: Program counter. Stack pointer. Process Status Word (PSW).

Page 20: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Computer Hardware Review

(a) A three-stage pipeline(b) A superscalar CPU

Page 21: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

CPU has two modes: user and kernel. Application obtains OS services through a

system call. Traps to operating system and switches to

kernel mode.

Page 22: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Typical memory hierarchy numbers shown are rough approximations

Page 23: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Structure of a disk drive

Page 24: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

One base-limit pair and two base-limit pairs

Page 25: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

I/O Devices

Manufacturer provides device driver (talks to the device).

OS talks to device driver. Three ways to handle I/O operations:

Busy waiting. Interrupt driven Direct Memory Access (DMA)

Page 26: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

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

(a) (b)

Page 27: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Structure of a large Pentium system

Page 28: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Operating System Concepts

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

Page 29: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Operating System Concepts

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

Page 30: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Operating System Concepts

File system for a university department

Page 31: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Operating System Concepts

Before mounting, files on floppy are inaccessible

After mounting floppy on b, files on floppy are part of file hierarchy

Page 32: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Operating System Concepts

Two processes connected by a pipe

Page 33: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Steps in Making a System Call

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

Page 34: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Some System Calls For Process Management

Page 35: Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: dickens@umcs.maine.edudickens@umcs.maine.edu Phone:

Some System Calls For File Management