OperatingSystems
David Goldschmidt, Ph.D.
Computer Science
The College of Saint Rose
CIS 432
What is an Operating System?
An Operating System is the software interfacebetween hardware and its users(via application software)
Operating systems:
Execute user and system programs
Manage & coordinate computer hardware
Serve as resource allocators
Are typically interrupt-driven
MCj04121940000[1]
MCj04122000000[1]
Operating Systems
System Software
Computer programs that directlycontrol the operations of thecomputer and its devices
Operating System
Coordinates and orchestrates all activitiesof the hardware devices in a computer
Provides a Graphical User Interface (GUI) forusers to interact with the computer
j0285750
Design Goals of an Operating System
From a user’sperspective, anoperating systemshould be:
easy to use
easy to learn
reliable
safe
fast
System goals ofan operating systemtypically include:
reliability
flexibility
extensibility
speed
efficiency
maintainability
MCj04241780000[1]
Functional Components
Functional components of anoperating system include:
Process manager
Memory manager
Virtual memory manager
File manager
Device manager
History of Operating Systems
In the beginning…
…the 1940s
eniac
eniac
ENIAC
History of Operating Systems
Automation in the 1950s using punch cards
4506VV4002
29idea190
card2
computerprograminside
Batch Jobs
job is a unit of work submitted by a user tothe operating system, typically consisting of:
program either in a sourcelanguage or in binary form
a set of input data used bythe program when it executes
card2
card2
card2
card2
card2
card2
History of Operating Systems
IBM 360 introduced…
…in 1964
IBM-360-1964-2
IBM360-photo3
IBM360-photo
Multiprogramming
Multiprogramming
In multiprogramming, several jobs reside inmemory simultaneously
CPU use is sharedand managed by theoperating system
Multiprogramming
Multiprogramming provides efficient use of thecomputer (CPU) and its resources (e.g. I/O)
One user cannot keep theCPU and I/O devices busyat all times
Each running program iscalled a job
Multiprogramming organizesjobs such that the CPU alwayshas exactly one to execute
Multiprogramming
Computer is often idle – why?
CPU and hardware muchfaster than I/O
When a user or process isblocked waiting for I/O,the operating system switchesto another job
A subset of jobs is storedin memory, awaiting CPUor other resources
Timesharing (Multitasking)
To ensure fairness, consider a timesharing schemein which the CPU cycles through all jobs
Each job (process) is givena fixed amount of CPU time
Switching from one runningprocess to another is calledcontext switch
A process may relinquish itstime if blocked on an I/O request
Timesharing (Multitasking)
Unless blocked on I/O, processes line up,awaiting their turn with the CPU
CPU scheduling algorithmis necessary to efficientlydecide the order in whichprocesses execute
If processes do not fit intomemory, the operating systemwill swap them in and out ofmemory from virtual memory
History of Operating Systems
Personal computer revolution…
…of the late 1970s and early 1980s
AppleII
AppleIIeDD
and the Apple IIe
IBM_PC_5150
History of Operating Systems
photos-when-bill-gates-met-steve-jobs_6
History of Operating Systems
World Wide Web and Internet revolution…
…of the 1990s and 2000s
network2
ist2_2356788_computer_network
1591119155_b1f9667e08
Computer System Organization
Computer systems are increasingly complex
Require an operating system to coordinate andcontrol hardware activities
system bus
…and networked
Computer Networks
Local Area Network (LAN) is a networkof machines coveringa limited geographicalarea
Metropolitan AreaNetwork (MAN)covers more denselypopulated area
Fig02-07
Computer Networks
Wide Area Network(WAN) covers multiplelocations
Each location consistsof one or moreLANs or MANs
Fig02-08
Computer Networks
LANs connect to other networks via a router
35744_CH01_FIG02
Central Processing Unit (CPU)
Software instructions are executed byCentral Processing Unit (CPU)
An external hardware event triggersan interrupt by signaling the CPU
e.g. mouse movement, keyboard event
Software triggers an interrupt byexecuting a system call
e.g. disk read, graphics output, printer output
MCj04339050000[1]
Interrupt Mechanism
Interrupts are handled much like calling afunction or method in a programming language
35744_CH01_FIG03
I/O devicestypically use abuffering strategy
Typical Interrupt Timeline
…as do I/O transfer times
interrupt processing
times vary…
Synchronous & Asynchronous I/O
    Synchronous
    Asynchronous
Hierarchical Storage Architecture
very fast
very slow
very small
very large
non-volatile
volatile
What is Caching?
Caching is a technique totemporarily store data ina smaller and fastermemory component
why implement caching
in an operating system?
Performance
A key goal in operating system design isachieving fast and efficient performance
Retrieving Data from a Cache
When the operating system attempts to readfrom memory, check to see if the requesteddata is already in the cache
If it is, data is read from the cache (fast!)
If not, data is copied from memory to the cache                                        (maybe next time…)
Principle of Locality
When a running program reads from memorylocation X, the principle of locality predicts thatthe next memory location requested will be near X
Store pages of data in a cache, where each page istypically the same size (e.g. 16KB)
Large grid
memory location X