Download Intro to Operating Systems - Computer Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!
CSE 410Computer Systems
L
t^
I t
t^
O
ti
S
t
Lecture 14 – Intro to Operating Systems
What is an Operating System?What
is an Operating System?
-^
An operating system (OS) is:– a software layer to abstract away and manage details
of hardware resources
- a set of utilities to simplify application development
ApplicationsOS Hardware
“all the code you didn’t write” in order to implementyour application
-^
Key idea:
virtualization
of resources
3
Why bother with an OS?Why
bother with an OS?
•^
Application benefits– programming simplicity
programming simplicity
- see high-level abstractions (files) instead of low-level
hardware details (device registers)
- abstractions are reusable across many programs
- portability (across machine configurations or architectures)
- device independence: 3Com card or Intel card?
•^
User benefits
f t
- safety
- program “sees” own virtual machine, thinks it owns
computer
- OS protects programs from each other (what if one
OS protects programs from each other (what if onecrashes?)
- OS fairly multiplexes resources across programs
- efficiency (cost and speed)
- share one computer across many users• concurrent execution of multiple programs
5
The major OS issuesThe
major OS issues
•^
structure
: how is the OS organized?
•^
sharing
: how are resources shared across users?
•^
naming
: how are resources named (by users or programs)?
•^
security
: how is integrity of the OS and its resources ensured?
security
: how is integrity of the OS and its resources ensured?
•^
protection
: how is one user/program protected from another?
•^
performance
: how do we make it all go fast?
li bilit
h t h
if^
thi
( ith
ith
•^
reliability
: what happens if something goes wrong (either with
hardware or with a program)?
-^
extensibility
: can we add new features?
•^
communication
: how do programs exchange information,
including across a network?
6
Hardware/Software Changes with TimeHardware/Software
Changes with Time
-^
1960s: mainframe computers (IBM)
p
(^
-^
1970s: minicomputers (DEC)
-^
1980s: microprocessors and workstations (SUN)
-^
1990s: PCs (rise of Microsoft, Intel, then Dell)
-^
2000: Internet Services / Clusters (Amazon)
G
C
C
(G
-^
2006: General Cloud Computing (Google, Amazon)
-^
-^
2020: it’s up to you!!
-^
2020: it s up to you!!
8
OS historyOS
history
-^
In the very beginning…
OS was just a library of code that you linked into your
- OS was just a library of code that you linked into your
program; programs were loaded in their entirety intomemory, and executedinterfaces were literally switches and blinking lights
- interfaces were literally switches and blinking lights -^
And then came
batch systems
- OS was stored in a portion of primary memory– OS loaded the next job into memory from the card reader
- job gets executed• output is printed, including a dump of memory (why?)
output is printed, including a dump of memory (why?)
- repeat…
- card readers and line printers were very slow
CPU
idl
h
f th
ti^
(^
t^
- so CPU was idle much of the time (wastes $$)
9
MultiprogrammingMultiprogramming •^
To increase system utilization, multiprogramming OSswere invented– keeps multiple runnable jobs loaded in memory at once– overlaps I/O of a job with computing of another
p
j^
p
g
- while one job waits for I/O completion, OS runs
instructions from another job
- to benefit need asynchronous I/O devices
to benefit, need asynchronous I/O devices
- need some way to know when devices are done
polling
- polling
- goal: optimize system throughput
- perhaps at the cost of response time…
11
TimesharingTimesharing •^
To support interactive use, create a timesharing OS:
lti l
t^
i^
l^
i t
hi
- multiple terminals into one machine– each user has illusion of entire machine to him/herself– optimize response time, perhaps at the cost of
throughputthroughput
-^
Timeslicing– divide CPU equally among the users
if job is truly interactive (e g editor) then can jump
- if job is truly interactive (e.g. editor), then can jump
between programs and users faster than users cangenerate load
- permits users to interactively view edit debug running
permits users to interactively view, edit, debug runningprograms (why does this matter?)
-^
MIT Multics system (mid-1960’s) was the first largetimeshared system– nearly all OS concepts can be traced back to Multics
12
Parallel systemsParallel
systems
•^
Some applications can be written as multiple parallel threads orprocessesprocesses– can speed up the execution by running multiple
threads/processes simultaneously on multiple CPUs[Burroughs D825, 1962]
t^
lti
i^
(^
t j
t^
lti
i^
•^
true multiprocesssing (not just multiprogramming)
- need OS and language primitives for dividing program into
multiple parallel activities
- need OS primitives for fast communication among activities
need OS primitives for fast communication among activities
- degree of speedup dictated by
communication/computation ratio
- many flavors of parallel computers today
- SMPs (symmetric multi-processors, multi-core)• SMT (simultaneous multithreading [“hyperthreading”])• MPPs (massively parallel processors)
NOW
(^
t^
k^
f^
k t ti
) [ l
t^
]
- NOWs (networks of workstations) [clusters]• computational grid (SETI @home)
14
Personal computingPersonal
computing
-^
Primary goal was to enable new kinds of interactive
li^
ti
applications
-^
Bit-mapped display [Xerox Alto,1973]– New graphic/visual apps
New graphic/visual apps
- new input device (the mouse) -^
Move computing near the display^ – why?
-^
Window systems– the display as a managed resource
the display as a managed resource
-^
Local area networks [Ethernet]– why?
15
-^
Effect on OS?
OS structureOS
structure
-^
The OS sits between application programs and thehardwarehardware– it mediates access and abstracts away ugliness– programs request services via exceptions (traps or faults)– devices request attention via interrupts
P
P
P
P
exception
dispatch
OS
D
D
D
D
exception
interrupt start
i/o
D
D
17
Major OS componentsMajor
OS components
-^
processesp
-^
memory
-^
I/O
-^
secondary storage
-^
file systems
-^
protection
-^
accounting
-^
shells (command interpreter or OS UI)
-^
shells (command interpreter, or OS UI)
-^
GUI
-^
networkingnetworking
18
OS structureOS
structure
-^
An OS consists of all of these components, plus:– many other components– system programs (privileged and non-privileged)
- e.g., bootstrap code, the init program, … -^
Major issue:– how do we organize all this?– what are all of the code modules, and where do they
y
exist?
- how do they cooperate? -^
Massive software engineering and design problem– design a large, complex program that:
- performs well, is reliable, is extensible, is
backwards compatible, …
20
Early structure: MonolithicEarly
structure: Monolithic
-^
Traditionally, OS’s (like UNIX) were built as a
lithi
tit
monolithic entity:
user programseverything
OS
hardware
21