Professional Documents
Culture Documents
Operating Systems: Basic Concepts and History
Operating Systems: Basic Concepts and History
1 2
WhatisanOperatingSystem? WhatisanOperatingSystem?
Any code that runs with the hardware kernel bit set For any OS area (CPU scheduling, file systems, memory
An abstract virtual machine management), begin by asking two questions
A set of abstractions that simplify application design Whats the hardware interface? (The Physical Reality)
Files instead of bytes
bytes on a disk
disk What is the application interface? (The Nicer Interface for
programmer producivity)
Core OS services, written by pros
Processes, process scheduling
Address spaces
Key questions:
Why is the application interface defined the way it is?
Device control
Should we push more functionality into applications, the OS, or the
~30% of Linux source code. Basis of stability and security
hardware?
Device drivers written by whoever What are the tradeoffs between programmability, complexity, and
Software run in kernel to manages a particular vendors
vendor s flexibility?
hardware
E.g. Homer Simpson doll with USB
~70% of Linux source code
OS is extensible
Drivers are the biggest source of OS instability
3 4
OperatingSystemFunctions Whydoweneedoperatingsystems?
Service provider
Provide standard facilities Convenience
File system
Standard libraries
Provide a high-level abstraction of physical resources.
Window
Wi d system
t Make hardware usable by getting rid of warts & specifics.
specifics
Enable the construction of more complex software systems
Coordinator: three aspects Enable portable code.
Protection: prevent jobs from interfering with each other MS-DOS version 1 boots on the latest 3+ GHz Pentium.
Communication: enable jobs to interact with each other
Would games that ran on MS-DOSv1 work well today?
Resource management: facilitate sharing of resources across jobs.
Operating systems are everywhere
Single-function
Single function devices (embedded controllers
controllers, Nintendo
Nintendo, )) Efficiency
y
OS provides a collection of standard services Share limited or expensive physical resources.
Sometimes OS/middleware distinction is blurry
Multi-function/application devices (workstations and servers) Provide protection.
OS manages application interactions
5 6
Computer Architecture & Processes Evolution of Operating Systems
User processes may not: Phase 1: Hardware is expensive, humans are cheap
address I/O directly
User at console: single-user systems
use instructions that
Batching systems
manipulate
p OS memory y
(e.g., page tables) Multi-programming
M lti i systems
t
set the mode bits that
determine user or kernel Phase 2: Hardware is cheap, humans are expensive
mode Time sharing: Users use cheap terminals and share servers
disable and enable
interrupts Phase 3: Hardware is very cheap, humans are very expensive
halt the machine Personal computing: One system per user
Distributed computing: lots of systems per user
but in kernel mode, the OS does all these things
a status bit in a protected processor register indicates the mode Phase 4: Ubiquitous computing/Cloud computing
Protected instructions can only be executed in kernel mode. Cell phone, mp3 player, DVD player, TIVO, PDA, iPhone, eReader
On interrupts (e.g., time slice) or system calls
Software as a service, Amazons elastic compute cloud
11 12
ABriefHistoryofOperatingSystems
HistoryofOperatingSystems:Phases Handprogrammedmachines(4555)
13 14
Batch/Offlineprocessing(5565) Batchprocessing(5565)
Batching v. sequential execution of jobs Operating system = loader + sequencer + output processor
Operating
Ope at g Syste
System
Card Reader: Read Batch 1 Batch 2 Batch 3
Keep several jobs in memory and multiplex CPU between Keep several jobs in memory and multiplex CPU between
jobs jobs
program P Simple,
Simple synchronous
synchronous input: I/O
Program 1 OS
begin What to do while we wait Device
User Program n : for the I/O device? User Program n main{
Read(var)
...
...
: read{
k: read()
end P
User Program 2 User Program 2 startIO()
system call Read() waitIO()
User Program 1 begin User Program 1
StartIO(input device) endio()
System Software WaitIO(interrupt) System Software interrupt
EndIO(input device) k+1:
: }
Operating System Operating System
end Read
}
17 18
Multiprogramming(6580) HistoryofOperatingSystems:Phases
Keep several jobs in memory and multiplex CPU between Phase 1: Hardware is expensive, humans are cheap
jobs User at console: single-user systems
Batching systems
I/O Multi-programming
M lti i systems
t
Program 1 OS Program 2 Device
User Program n main{ Phase 2: Hardware is cheap, humans are expensive
Time sharing: Users use cheap terminals and share servers
...
read{
k: read()
Phase 3: Hardware is very cheap, humans are very expensive
User Program 2 startIO()
schedule() main{ Personal computing: One system per user
} Distributed computing: lots of systems per user
User Program 1
endio{
System Software interrupt Phase 4: Ubiquitous computing
k+1: schedule()
}
Operating System
}
19 20
Timesharing(70 ) HistoryofOperatingSystems:Phases
A timer interrupt is used to multiplex CPU among jobs Phase 1: Hardware is expensive, humans are cheap
User at console: single-user systems
Batching systems
Program 1 OS Program 2
Multi-programming
M lti i systems
t
main{
User Program n Phase 2: Hardware is cheap, humans are expensive
timer Time sharing: Users use cheap terminals and share servers
...
interrupt
k: schedule{
main{ Phase 3: Hardware is very cheap, humans are very expensive
User Program 2 }
Personal computing: One system per user
User Program 1 timer Distributed computing: lots of systems per user
interrupt
schedule{
System Software k+1: } Phase 4: Ubiquitous computing
NetworkLAN/WAN
23 24
HistoryofOperatingSystems:Phases Whatiscloudcomputing?
Phase 3: Hardware is very cheap, humans are very expensive Platform as a service (PaaS)
Personal computing: One system per user Google gears
Distributed computing: lots of systems per user Microsoft azure
Software as a service (SaaS)
Phase 4: Ubiquitous computing/Cloud computing
Everything will have computation, from pacemakers to toasters gmail
Computing centralizing facebook
I think there is a world market for maybe five computers Tomas flickr
J. Watson, 1943 (president of IBM)
25 26
RicherOperatingSystems
Intellectualproperty
Is it better to search for data (google), or organize it OS Structure, Processes and Process Management
hierarchically (file folders)?
CPU scheduling
Organization along a particular set of ideas (schema) might not
be ideal for a different set of ideas. Threads and concurrent programming
Gmail search vs. mail folders
Thread coordination, mutual exclusion, monitors
Integration of search in Vista and MacOS.
Deadlocks
Do you use My Documents folder, or do you maintain your own
directories? use both a lot? Virtual memory & Memory management
Disks & file systems
Distributed file systems
Security
29 30