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

Preview:

Citation preview

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?

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

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

Assumptions

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

Pre-requisites

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

Data Structures

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!

Components of a simple personal computer?

Components of a simple personal computer

Monitor

Bus

• 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

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

Monitor

Bus

Extended Machine : Simpler Interface

Disk (Mechanical and Electrical components)

Disk I/O?

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!

Hide Complexity

E.g. File interface.

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)

OS: Extended example of a complex system

Deal with complexity.

Millions of lines of code.

Hardware and Operating Systems have influenced each other.

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

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?

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

Vacuum Tubes (problems of burn outs)

Wiring up plug boards!

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?

Transistors (1955-65) Reliability FORTRAN Program

punched on cards

Problems:

•CPU idle time

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

•Costly equipment

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

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

program? No protection between users

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

ICs and Multiprogramming (1965-1980)

•Software compatible machines

•Enormous and complex operating systems

•Costly machines

•Lead to multiprogramming

Protection among users!

Introduction of key techniquesMultiprogrammingSpooling (Simultaneous Peripheral

Operation On Line)From Batch systems to Timesharing

Introduction of key techniques (cont’d)

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

Response time

Memory managementCPU schedulingProcess Synchronization

MIT, Bell Labs and GE

“Machine that would support hundreds of time sharing users”

MULTICS (MULTIplexed Information and Computing Service)

Ahead of time.

At Bell Labs …

One user version of MULTICS.

Developed into UNIX

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.

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

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.

Device driversRun inside the kernel.Dynamically loaded drivers.

Input/OutputControllers have registers for

communicationMemory mapped I/OSeparate I/O space Hybrid

Some design issues

I/O SpaceSpecial IN/OUT instructions (use of

assembly code)

Memory mappedCaching of device registers should not be

done!Multiple buses

Recommended