CH 1
CH 1
Operating Systems
1.2
Operating Systems
1.3
Course Objective
This course is an introductory course in
operating systems (OS), focusing on the core
concepts of operating systems.
Processes and Threads
Memory Management
Storage and File Systems
I/O Systems
Establish a foundation for building higher-
level programs
How to optimize programs
How to debug large systems
How to deal with complexity
1.4
Logistics
Lectures
Friday 10:35-12:00, 24-404
Instructor
Asso. Prof. Xiangbin Zhu
1.5
Administrative
Course has five components
Lectures
Homework
Experiments
Projects
Quizzes
Textbook
Silberschatz, Galvin & Gagne
Operating System Concepts, 7th/9th ed.
1.6
Grading
1.7
Chapter 1: Introduction
What Operating Systems Do
Computer-System Organization
Operating-System Structure
Operating-System Operations
Computing Environments
Open-Source Operating Systems
1.8
Objectives
1.9
Computer System Structure
1.10
Abstract View of System
User
1 User User User
2 3 ... n
Operating System
Computer
Hardware
1.11
What is an Operating System?
Definition has changed over years
Originally, very bare bones
Now, includes more and more
Operating System(OS)
Interface between the user and the architecture
Implements a virtual machine that is hopefully easier to
program than raw hardware.
Operating system goals:
Execute user programs and make solving user problems easier
Make the computer system convenient to use
Use the computer hardware in an efficient manner
Make application software portable and versatile
Provide isolation, security and protection among user programs
Improve overall system reliability
1.12
Top-Level View of an OS
1.13
OS Provides Abstraction
Device Driver
Graphics Card
1.14
Operating System Definition
No universally accepted
definition
“Everything a vendor ships
when you order an operating
system” is a good approximation
But varies wildly
“The one program running at all
times on the computer” is the
kernel.
Everything else is either
a system program (ships with the
operating system) , or
an application program.
1.15
What Operating Systems Do
User View:
Users want convenience, ease of use and good
performance
Don’t care about resource utilization
But shared computer such as mainframe or minicomputer
must keep all users happy
Users of dedicate systems such as workstations have
dedicated resources but frequently use shared resources
from servers
Handheld computers are resource poor, optimized for
usability and battery life
Some computers have little or no user interface, such as
embedded computers in devices and automobiles
1.16
What Operating Systems Do
System View:
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient
and fair resource use
OS is a control program
Controls execution of programs to prevent errors
and improper use of the computer
1.17
OS is a resource allocator
1.18
Operating System Spectrum
Transaction systems
Personal Computing Systems
Mobile Platforms, devices (of all sizes)
1.19
Early Systems - Bare Machine (1950s)
Early software
Assemblers, compilers, linkers, loaders, device drivers, libraries of
common subroutines.
Secure execution
Inefficient use of expensive resources
Low CPU utilization, high setup time.
1.20
punch card
1.21
1.22
Simple Batch Systems (1960’s)
Reduce setup time by batching jobs with similar requirements.
Add a card reader, Hire an operator
User is NOT the operator
Automatic job sequencing
Forms a rudimentary OS.
1.23
Supervisor/Operator Control
Secure monitor that controls job processing
Special cards indicate what to do.
User program prevented from performing I/O
Separate user from computer
User submits card deck IBM 7094
cards put on tape
tape processed by operator
output written to tape
tape printed on printer
Problems
Long turnaround time - up to 2 DAYS!!!
Low CPU utilization
– I/O and CPU could not overlap; slow mechanical devices.
1.24
Batch Systems - Issues
Solutions to speed up I/O:
Offline Processing
load jobs into memory from tapes, card reading and line
printing are done offline.
Spooling
Use disk (random access device) as large storage for reading
as many input files as possible and storing output files until
output devices are ready to accept them.
Allows overlap - I/O of one job with computation of another.
Introduces notion of a job pool that allows OS choose next job
to run so as to increase CPU utilization.
1.25
1.26
Batch Systems - I/O completion
1.28
IBM/360
1.29
Example: Uniprogramming
(only one program running on the system)
1.30
Example: Multiprogramming
(multiple programs simultaneously running)
1.31
Timesharing
Hardware – getting cheaper; Human – getting expensive
Programs queued for execution in FIFO order.
Like multiprogramming, but timer device interrupts after
a quantum (timeslice).
Interrupted program is returned to end of FIFO
Next program is taken from head of FIFO
1.32
Timesharing (cont.)
Interactive (action/response)
when OS finishes execution of one command, it seeks the next
control statement from user.
File systems
online filesystem is required for users to access data and code.
Virtual memory
Job is swapped in and out of memory to disk.
1.33
Personal Computing Systems
Hardware – cheap ; Human – expensive
1.34
Parallel Systems
Programming models:
– Tightly coupled vs. loosely coupled ,message-based vs. shared
variable
1.35
Parallel Computing Systems
ILLIAC 2
(UIllinois) Climate modeling,
earthquake
simulations, genome
analysis, protein
folding, nuclear fusion
research, ….. K-
computer(Japan
)
Tianhe-1(China)
Connection Machine
(MIT)
1.36
Distributed Systems
Hardware – very cheap ; Human – very expensive
client/server architectures
Advantages:
– resource sharing
– computation speed-up
– reliability
– communication - e.g. email
1.37
Distributed Computing Systems
1.38
Real-time systems
1.39
Computer System Organization
Computer-system operation
One or more CPUs, device controllers connect through
common bus providing access to shared memory
Concurrent execution of CPUs and devices competing for
memory cycles
1.40
Computer Startup
1.41
Computer-System Operation
1.42
Common Functions of Interrupts
1.43
Interrupt Handling
1.44
Interrupt Timeline
1.45
I/O Structure
1.46
Storage Structure
Main memory – only large storage media that the
CPU can access directly
Random access
Typically volatile
1.48
Storage-Device Hierarchy
1.49
Caching
1.51
How a Modern Computer Works
1.52
Operating System Structure
1.54
Operating-System Operations
1.55
Operating-System Operations (cont.)
1.56
Transition from User to Kernel Mode
1.57
Computing Environments - Traditional
1.58
Computing Environments - Mobile
1.59
Computing Environments – Distributed
Distributed computiing
Collection of separate, possibly heterogeneous, systems
networked together
Network is a communications path, TCP/IP most common
– Local Area Network (LAN)
– Wide Area Network (WAN)
– Metropolitan Area Network (MAN)
– Personal Area Network (PAN)
Network Operating System provides features between
systems across network
Communication scheme allows systems to exchange
messages
Illusion of a single system
1.60
Computing Environments – Client-Server
Client-Server Computing
Dumb terminals supplanted by smart PCs
Many systems now servers, responding to requests generated
by clients
Compute-server system provides an interface to client to
request services (i.e., database)
File-server system provides interface for clients to store
and retrieve files
1.61
Computing Environments - Peer-to-Peer
1.65
Computing Environments – Cloud Computing
Delivers computing, storage, even apps as a service across a
network
Logical extension of virtualization because it uses virtualization as
the base for it functionality.
Amazon EC2 has thousands of servers, millions of virtual
machines, petabytes of storage available across the Internet,
pay based on usage
Many types
Public cloud – available via Internet to anyone willing to pay
Private cloud – run by a company for the company’s own use
Hybrid cloud – includes both public and private cloud
components
Software as a Service (SaaS) – one or more applications
available via the Internet (i.e., word processor)
Platform as a Service (PaaS) – software stack ready for
application use via the Internet (i.e., a database server)
Infrastructure as a Service (IaaS) – servers or storage available
over Internet (i.e., storage available
1.66
for backup use)
Computing Environments – Cloud Computing
1.67
Computing Environments – Real-Time Embedded Systems
1.68
Open-Source Operating Systems