chapter 1 (part 1) introduction to os (concept, evolution, some keywords) department of computer...

27
Chapter 1 (PART 1) troduction to OS (concept, evolution, some keywords Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki E-mail: [email protected] S 414 Operating Systems Chapter_One/001

Upload: kristopher-atkinson

Post on 05-Jan-2016

223 views

Category:

Documents


1 download

TRANSCRIPT

Chapter 1 (PART 1) Introduction to OS (concept, evolution, some keywords)

Department of Computer ScienceSouthern Illinois University Edwardsville

Summer, 2004

Dr. Hiroshi FujinokiE-mail: [email protected]

CS 414 Operating Systems

Chapter_One/001

CS 414 Operating Systems

Two Primary Roles of Operating Systems

We discussed this subject in the previous PPT slides, but we godeeper into the technical details.

(1) A middleman between you (as a user) and computer hardware

(2) The government in your computer (the agent that allocate resources)

Operating systems as extended machine

Operating systems as resource manager

Keyword #1

Keyword #2

Chapter_One/002

CS 414 Operating Systems

Chapter_One/003

Operating systems as extended machine

OSComputerHardware

High-level commands(e.g., “READ” call)

Low-level commands(e.g., assembly I/O)

Raw output(a chain of memory buffers)

High-level outputs(e.g., “file”)

User(s)

Computer System

CS 414 Operating Systems

OS

ComputerHardware

Concept of Extended Machine

Chapter_One/004

User

A human user can manipulate computerHardware through operating system

High-levelcommands

Low-levelCommands

Extended Machine

CS 414 Operating Systems

Concept of Extended Machine

“Extended machine” is a virtual computer hardwarethat can be manipulated directly by high-level commands

Chapter_One/005

User(s)

OS

ComputerHardwareVirtual Hardware

Computer

High-levelcommands

CS 414 Operating Systems

Definition

Extended Machine (a.k.a virtual machine) =

= A virtual computer (as a hardware computer) that can bemanipulated directly by high-level user commands by abstractionoffered by an operating system

(this is for your quiz #1 in the next week)

Chapter_One/006

Resources

CS 414 Operating Systems

Operating systems as resource manager

CPUCPUMemoryMemory

DiskDisk

KeyboardKeyboard

Network Network

Etc.Etc.

Request resources

Request resources

Request resources

Request resources

Program A Program B

Program C

Program D

A computer System

Chapter_One/007

Memory

CPU

CS 414 Operating Systems

Operating systems as resource manager (continued)

Important Fact

Any physical computer resources (CPU, memory, keyboard, disk, etc)can not be assigned to multiple programs at a given time.

Example CPU

Program A Program B

A physical CPUcan not be assigned

to more than oneprogram at a time

Chapter_One/008

Memory

CS 414 Operating Systems

Program A Program B

CPUA physical CPU

can not be assignedto more than oneprogram at a time

Chapter_One/009

Question

We know that we can run multiple application programs in Windows XPat the same time. How is this possible, then?

Operating systems as resource manager (continued)

CS 414 Operating Systems

Chapter_One/010

Operating systems as resource manager (continued)

CS 414 Operating Systems

Chapter_One/011

Question

We know that we can run multiple application programs in Windows XPat the same time. How is this possible, then?

Operating systems as resource manager (continued)

Answer

By resource management, called “context switching”.

Time

Program A

Program B

Program C

CS 414 Operating Systems

Chapter_One/012

Operating systems as resource manager (continued)

Program A

Program B

Program C

Time

Program A

Program B

Program C

Looks like allthree running

At the same time

CS 414 Operating Systems

Chapter_One/013

Operating systems as resource manager (continued)

Time

Program A

Program B

Program C

Switching program executions in a short time

It is called “context switching”

(A part of OS process management)

CS 414 Operating Systems

Operating systems as resource manager (continued)

In the previous example, we discussed process managementas an example of resource management, similar (but different)resource management is performed for every and each resource available in a computer system

Examples

• Memory management (how much for which program?

• Printer spooling (= assign the order of printer use)

• Deadlock avoidance for other I/O devices

- Everyone got a little I/O resource but not enough

- Everyone waits for other forever

We will discuss all these topics.Chapter_One/014

CS 414 Operating Systems

Evolution of operating systems

(2) Why we do not use the oldest operating system any more?

(1) What is the oldest operating system?

(3) How operating systems evolved?

(4) How is our Windows XP different from those classical OS?

(and you can answer these questions in Quiz #1 next week )

We will see the answers for these questions!

Chapter_One/015

CS 414 Operating Systems

Evolution of operating systems (continued)

Pre-Operating Systems(no OS)

Computer System

CPU

Memory

User Program

User Program

Outputs

Process it(run the program)

Chapter_One/016

User(s)

CS 414 Operating Systems

Pre-Operating Systems(no OS)

• No process manager Only one program at a time

• No resource manager We don’t need it.

• No automatic program loader/starter You are the one who does this.

Major Properties

Advantages (Yes, you did read this correctly, I mean advantages)

• Hardware resources are all yours

No one can disturb you (= extremely fast!)

• Memory space for OS is not neededChapter_One/017

CS 414 Operating Systems

Pre-Operating Systems(no OS)

Disadvantages (There are many, but what was the most serious one?)

Price of computer hardware was extremely expensive

• A user can not leave the computer room and relax in his/her office

- Once your program is finished, you have to cleanup the computer system immediately.

Basically you have to work as a slave for the computer system (not as a user)

Solution is “batch system”Chapter_One/018

CS 414 Operating Systems

Batch Systems

Computer System

CPU

Memory

User Program

Outputs

Process it(run the program)

User Programs

A

B

C

D

E

Program Loader

Chapter_One/019

User(s)

CS 414 Operating Systems

Batch Systems

Major Properties

• The program loader monitors progress of program execution

• As soon as a program is completed, the program loader loads the next

• As long as programs (“jobs”) exists, a computer keeps running

• You have some time to relax (or do other work)

Advantages

Disadvantages

• What if your program has a bug? Computer does not fix it for you

• CPU utilization could be low Explained later

Chapter_One/020

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Computer System

Memory

Outputs

CPU

User Programs

A

B

C

D

E

Program Loader

ABCD

Multiprogramming

Chapter_One/021

User(s)

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Computer System

Memory

User Programs

A

B

C

D

E

Program Loader

ABCD

Multiprogramming & Timesharing

Chapter_One/022

CPU

useruseruseruser

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Multiprogramming

Chapter_One/023

• Multiple programs can be in memory at the same time

• A small program that was submitted after big ones could finish before the big ones

• While a program does not need the CPU, CPU can be assigned to another program

• CPU utilization will be improved

• Average waiting time will be improved

• It’s not “interactive”

Advantage

Advantage

Disadvantage

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Computer System

Memory

CPU

User Programs

A

B

C

D

E

Program Loader

ABCD

Multiprogramming

Chapter_One/024

If B has a bug

B stops and itleaves the systemB is placed at

the end of queue

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Chapter_One/025

• While a program does not need the CPU, CPU can be assigned to another program

• Multiple programs can be in memory at the same time

• CPU utilization will be improved

• A small program that was submitted after big ones could finish before the big ones

• Average waiting time will be improved

• It’s “interactive”

Advantage

Advantage

Multiprogramming & Timesharing

Advantage

CS 414 Operating Systems

Multiprogramming and Timesharing OS

Computer System

Memory

User Programs

A

B

C

D

E

Program Loader

ABCD

Multiprogramming & Timesharing

CPU

Chapter_One/026

B can be restarted(in an interactive way)

user

interact

CS 414 Operating Systems

Chapter_One/027

Summary of this presentation

In this presentation, we have covered the following key concepts in OS:

Two primary roles of OS

Context switching

Batch system

Multiprogramming

Time sharing

Extended machine and resource manager

Provide users with pseudo-parallelism

The most primitive operating system

Improve CPU utilization and execution time

Allows users interactive operations