Lecture 1 - Suraj @ LUMS
Download
Report
Transcript Lecture 1 - Suraj @ LUMS
Tuesday, June 06, 2006
I hear and I forget,
I see and I remember,
I do and I understand.
-Chinese Proverb
Today
Course Overview
Why a course on operating systems?
What is an operating system?
CS 381 : Operating Systems
Course URL
http://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.
Assumptions
Unix shell commands
gcc, gdb, makefile
Text editor emacs, vi
C programming
Pre-requisites
Computer Organization & Assembly
Language (CS 223)
Load registers, interrupts, DMA …
Data Structures
What is an OS?
editor
browser
spreadsheet
compiler
OS
hardware
Software between applications and reality: Makes reality
pretty!
Abstracts the underlying hardware.
Gives illusion of changing finite into (almost) infinite.
Provides protection (from malicious or buggy
programs).
Components of a simple personal computer?
Components of a simple personal computer
Monitor
Bus
Operating System:
•Manages all the devices
•Provides users simpler interface to the
hardware
• Efficiency.
• Convenience, ease of use.
• Optimize utilization
• E.g. mainframes: expensive
• Fairness
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 accesses
Device 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 techniques
Multiprogramming
Spooling (Simultaneous Peripheral
Operation On Line)
From Batch systems to Timesharing
Introduction of key techniques (cont’d)
From Batch systems to Timesharing
I/O “people’s speed”
Response time
Memory management
CPU scheduling
Process 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
popular
First 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 drivers
Run inside the kernel.
Dynamically loaded drivers.
Input/Output
Controllers have registers for
communication
Memory mapped I/O
Separate I/O space
Hybrid
Some design issues
I/O Space
Special IN/OUT instructions (use of
assembly code)
Memory mapped
Caching of device registers should not be
done!
Multiple buses