tuesday, june 06, 2006 i hear and i forget, i see and i remember, i do and i understand. -chinese...

36
Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Post on 19-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Tuesday, June 06, 2006

I hear and I forget,

I see and I remember,

I do and I understand.

-Chinese Proverb

Page 2: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

TodayCourse OverviewWhy a course on operating systems?What is an operating system?

Page 3: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Course URLhttp://suraj.lums.edu.pk/~cs381m05

Folder on indus\\indus\Common\cs381m05

Website – Check Regularly: Course announcements, Slides, Resources, Policies …

Course Outline

CS 381 : Operating Systems

Page 4: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Several programming exercises will be given throughout the course. The purpose of these exercises will be to give students practice in using the UNIX system calls, library functions, and algorithms.

The development environment will be C on UNIX.

CS 381 : Operating Systems

Page 5: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Assumptions

Unix shell commandsgcc, gdb, makefileText editor emacs, viC programming

Page 6: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Pre-requisites

Computer Organization & Assembly Language (CS 223) Load registers, interrupts, DMA …

Data Structures

Page 7: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

What is an OS?

Software between applications and reality: Abstracts the underlying hardware. Gives illusion of changing finite into (almost) infinite. Provides protection (from malicious or buggy programs).

compilereditor browser

OS

hardware

spreadsheet

Makes reality pretty!

Page 8: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Components of a simple personal computer?

Page 9: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Components of a simple personal computer

Monitor

Bus

Page 10: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

• Efficiency.

• Convenience, ease of use.

• Optimize utilization

• E.g. mainframes: expensive

• Fairness

Operating System: •Manages all the devices•Provides users simpler interface to the hardware

Page 11: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Intermediary between a user of a computer and the computer hardware.

Page 12: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Monitor

Bus

Extended Machine : Simpler Interface

Disk (Mechanical and Electrical components)

Disk I/O?

Page 13: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Monitor

Bus

Extended Machine : Simpler Interface

Disk I/O

•Instructions for loading device registers

•Motor On/Off, Speed, Movement of disk arm, sectors/tracks …

•Different for different devices!

Page 14: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Hide Complexity

E.g. File interface.

Page 15: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

OS as Resource Manager

Orderly and controlled access, Resolve conflicts

Prevent illegal accessesDevice I/O (Maintain queues)

E.g. Printers

Sharing Resources CPU (Time multiplexing) Memory (Space multiplexing)

Page 16: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

OS: Extended example of a complex system

Deal with complexity.

Millions of lines of code.

Page 17: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Hardware and Operating Systems have influenced each other.

Page 18: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Charles Babbage (1792-1871) First analytical Engine Purely mechanical

Page 19: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Vacuum Tubes (1945-55) Calculating Engines Entire rooms Tens of thousands of Vacuum Tubes

(problems of burn outs) Wiring up plug boards!

Seen a vacuum tube?

Page 20: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Vacuum Tubes (1945-55) Calculating Engines Entire rooms Tens of thousands of

Vacuum Tubes (problems of burn outs)

Wiring up plug boards!

Page 21: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Transistors (1955-65) Reliability FORTRAN Program

punched on cards

Problems:

•CPU idle time

•I/O speeds vs CPU speeds (Mechanical vs Electrical)

•Costly equipment

•What if a ; missed?

Page 22: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Transistors (1955-65) Reliability FORTRAN Program

punched on cards

Problems:

•CPU idle time

•I/O speeds vs CPU speeds (Mechanical vs Electrical)

•Costly equipment

Page 23: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

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

Mostly used for scientific and engineering calculations

Page 24: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

• What if a ; missed?What if it runs over the cards of another

program? No protection between users

Page 25: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

ICs and Multiprogramming (1965-1980)

•IBM 360 series: Software compatible machines

•Enormous and complex operating systems

•Costly machines

•Lead to multiprogramming

•CPU bound (scientific calculations)

•I/O bound

Page 26: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

ICs and Multiprogramming (1965-1980)

•Software compatible machines

•Enormous and complex operating systems

•Costly machines

•Lead to multiprogramming

Protection among users!

Page 27: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Introduction of key techniquesMultiprogrammingSpooling (Simultaneous Peripheral

Operation On Line)From Batch systems to Timesharing

Page 28: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Introduction of key techniques (cont’d)

From Batch systems to TimesharingI/O “people’s speed”

Response time

Memory managementCPU schedulingProcess Synchronization

Page 29: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

MIT, Bell Labs and GE

“Machine that would support hundreds of time sharing users”

MULTICS (MULTIplexed Information and Computing Service)

Ahead of time.

Page 30: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

At Bell Labs …

One user version of MULTICS.

Developed into UNIX

Page 31: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Linus Benedict Torvalds (August 1991)“ I'm doing a (free) operating system (just a

hobby …) for 386(486) clones …”

Linus himself didn't believe that his creation was going to be big enough to change computing forever.

Linux version 0.01 was released by mid September 1991, and was put on the net.

Enthusiasm gathered around this project and codes were downloaded, tested, tweaked, and returned to Linus.

Page 32: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Personal Computers (1980 – Present)Large Scale Integration (LSI)Intel came with 8080 which became hugely

popularFirst microcontroller with disk

DOS (Disk Operating Systems)• Seattle Computer Products • MS-DOS (does not support multiprogramming)

Doug Engelbart (Mouse, GUI) Apple GUI Windows

Page 33: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Monitor

Bus

Disk I/O

•Commands and accepts responses

•Instructions for loading device registers etc.

•Different for different devices!

•Device drivers (by each controller manufacturer)

•One for each OS supported.

Page 34: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Device driversRun inside the kernel.Dynamically loaded drivers.

Page 35: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Input/OutputControllers have registers for

communicationMemory mapped I/OSeparate I/O space Hybrid

Page 36: Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb

Some design issues

I/O SpaceSpecial IN/OUT instructions (use of

assembly code)

Memory mappedCaching of device registers should not be

done!Multiple buses