Professional Documents
Culture Documents
Introduction
Muhammad Najmul Islam Farooqui
Assistant Professor, CED
Week 1
23-Jan-14
Introduction
Week 2
30-Jan-14
Processes
Week 3
06-Feb-14
Week 4
13-Feb-14
CPU Scheduling
Week 5
20-Feb-14
Memory Management
Week 6
27-Feb-14
Virtual Memory
Paging, Segmentation
Page placement and page replacement Algorithms
Page tables
Week 7
05-Mar-14
Week 9
26-Apr-14
Week 10
02-Apr-14
Week 11
09-Apr-14
Week 12
16-Apr-14
Disk Management
Week 13
23-Apr-14
Week 14
30-Apr-14
Week 15
7-May-14
Week 16
14-May-14
Reading Resources
Text Book
Reference Books
Internet Sources
Text Book
Reference Books
Operating System
Interface between users and
the machine
Manages hardware and
software resources of the
system
Provides environment in
which other applications can
run
What is an Operating
System?
An OS is a program that acts an
intermediary between the user of a
computer and computer hardware.
Major cost of general purpose computing is
software.
Initial OS interfaces
Modern OS Interfaces
Bill Gates
Linus Torvalds
Steve Vozniak
Andy Rubin
Operating System
Computers
Mobile Phones
Tablets
Router/ Switches/ Wireless Access Points
Gaming Consoles
Microwave Oven
Operating Systems
Timeline
Operating System Year
Author/ Company
LEO I
1951
OS/360
1964
IBM
MULTICS
1965
Unix
1969
Cray
1976
Cray Research
BSD
1977
Berkley University
86-DOS
1980
PC-DOS
1981
IBM
MS-DOS
1982
Microsoft
Novell NetWare
1983
Novell Inc.
Mac OS
1984
Apple
Windows 1.0
1985
Microsoft
MINIX
1987
Andrew S. Tanenbaum
Operating
System
Year
Writer/ Company
OS/2
1987
IBM/ Microsoft
SCO UNIX
1989
BeOS
1990
Be Inc.
Linux
1991
Linus Torvalds
Solaris
1992
SUN Microsystems
FreeBSD
1993
Windows95
1995
Microsoft
Windows NT 4.0
1996
Microsoft
Windows XP
2001
Microsoft
2000
Red Hat
Fedora Core 1
2003
Ubuntu
2004
Canonical Ltd.
Windows Vista
2006
Microsoft
Windows 7
2009
Microsoft
Windows 8*
Oct 26,
Microsoft
Goals of an Operating
System
Simplify the execution of user programs and
make solving user problems easier.
Use computer hardware efficiently.
17
18
Computer System
Components
Hardware
Provides basic computing resources (CPU, memory, I/O devices).
Operating System
Controls and coordinates the use of hardware among application
programs.
Application Programs
Solve computing problems of users (compilers, database systems, video
games, business programs such as banking software).
Users
People, machines, other computers
19
Transaction systems
Personal Computing Systems
Mobile Platforms, devices (of all sizes)
20
Hardware Complexity
Increases
Moores Law: 2X
transistors/Chip Every 1.5 years
IntelMulticoreChipsets
Moores Law
FromHennessyandPatterson,ComputerArchitecture:AQuantitative
Principles of Operating Systems Approach,4thedition,Sept.15,2006
Lecture 1
21
22
compiler
User
User
22
User
User
33
assembler
...
Text editor
User
User
nn
Database
system
System
Systemand
andApplication
ApplicationPrograms
Programs
Operating
OperatingSystem
System
Computer
Computer
Hardware
Hardware
23
Resource allocator
to allocate resources (software and hardware) of the
computer system and manage them efficiently.
Control program
Controls execution of user programs and operation of
I/O devices.
Kernel
The program that executes forever (everything else
is an application with respect to the kernel).
24
Transaction systems
Personal Computing Systems
Mobile Platforms, devices (of all sizes)
25
Structure
Large machines run from console
Single user system
Programmer/User as operator
Early software
Assemblers, compilers, linkers, loaders, device
From drivers,
John Ousterhout slides
libraries of common subroutines.
Secure execution
Inefficient use of expensive resources
Low CPU utilization, high setup time.
27
Resident Monitor
Holds initial control, control transfers to job and then back to monitor.
Problem
Need to distinguish job from job and data from program.
28
Supervisor/Operator
Control
Secure monitor that controls job processing
Special cards indicate what to do.
User program prevented from performing I/O
IBM 7094
Problems
Long turnaround time - up to 2 DAYS!!!
Low CPU utilization
From John Ousterhout slides
I/O and CPU could not overlap; slow mechanical devices.
29
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.
30
Speeding up I/O
31
Interrupts:
On completion of I/O, device forces CPU to jump to a
specific instruction address that contains the
interrupt service routine.
After the interrupt has been processed, CPU returns
to code it was executing prior to servicing the
interrupt.
32
Multiprogramming
33
Timesharing
Hardware getting cheaper; Human getting expensive
34
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.
35
Personal Computing
Systems
36
Parallel Systems
Multiprocessor systems with more than one
CPU in close communication.
Improved Throughput, economical,
increased reliability.
Kinds:
Programming models:
Tightly coupled vs. loosely coupled ,message-based vs.
shared variable
37
Parallel Computing
Systems
ILLIAC 2
(UIllinois)
Climate
modeling,
earthquake
simulations,
genome
analysis,
protein folding,
nuclear fusion
research, ..
Kcomputer(Japan
)
Tianhe-1(China)
Connection Machine
(MIT)
38
Distributed Systems
Hardware very cheap ; Human very expensive
client/server architectures
Advantages:
resource sharing
computation speed-up
reliability
communication - e.g. email
39
Distributed Computing
Systems
Globus Grid Computing Toolkit
PlanetLab
Real-time systems
Correct system function depends on
timeliness
Feedback/control loops
Sensors and actuators
Hard real-time systems
Key Elements of an
Operating System
Different Architectural
Approaches
Demands
on operating systems
require new ways of organizing the
OS
Different approaches and design elements have
been tried:
Microkernel architecture
Multithreading
Symmetric multiprocessing
Distributed operating systems
Object-oriented design
Microkernel Architecture
interprocess
communicatio
n (IPC)
basic
scheduling
The approach:
simplifies
implementatio
n
provides
flexibility
is well suited
to a
distributed
environment
Multithreading
Thread
dispatchable unit of work
includes a processor context and its own data area to enable subroutine
branching
executes sequentially and is interruptible
Process
a collection of one or more threads and associated system resources
programmer has greater control over the modularity of the application and the
timing of application related events
Symmetric
Multiprocessing (SMP)
SMP Advantages
Performan
ce
Availability
Increment
al Growth
performance of a system
can be enhanced by adding
an additional processor
Scaling
Mul
tipr
ogr
am
min
g
OS Design
Distributed Operating
System
Object-Oriented Design
Virtualization
enables a single PC or server to simultaneously run
multiple operating systems or multiple sessions of a
single OS
a machine can host numerous applications, including
those that run on different operating systems, on a
single platform
host operating system can support a number
of virtual machines (VM)
each has the characteristics of a particular
OS and, in some versions of virtualization,
the characteristics of a particular hardware
platform
Virtual
Memor
y
Concep
t
Virtual Machine
Architecture
Process perspective:
the machine on which it executes consists of the virtual memory
space assigned to the process
the processor registers it may use
the user-level machine instructions it may execute
OS system calls it may invoke for I/O
ABI defines the machine as seen by a process
Application perspective:
machine characteristics are specified by high-level language
capabilities and OS system library calls
API defines the machine for an application
OS perspective:
processes share a file system and other I/O resources
system allocates real memory and I/O resources to the processes
ISA provides the interface between the system and machine
Symmetric Multiprocessor OS
Considerations
A multiprocessor OS must provide all the
functionality of a multiprogramming
system plus additional features to
Reliabilit
Simultaneo
Memory
with
multiple
Scheduli
Synchroniza
accommodate
multiple
processors
y and
us
manageme
active
ng
tion
fault
any
concurrent
ntreuse
the
processes
toleranc
Key design
issues:having
processor
processes
of
kernel
or threads
routines
need to be
reentrant to
allow
several
processors
to execute
the same
kernel code
simultaneou
sly
may
perform
scheduling,
which
complicate
s the task
of
enforcing a
scheduling
policy
potential
access to
shared
address
spaces or
shared I/O
resources,
care must be
taken to
provide
effective
physical
pages is
the
biggest
problem
of
concern
e
the OS
should
provide
graceful
degradatio
n in the
face of
processor
failure
Multicore OS
Considerations
The design challenge
for a many-core
multicore system is to
efficiently harness the
multicore processing
power and
intelligently manage
the substantial onchip resources
efficiently
Potential for
parallelism exists at
three levels:
Microsoft Windows
Overview
Windows 2000
included services and functions
to support distributed processing
Active Directory
plug-and-play and powermanagement facilities
16-bit
GUI interface
Windows 95
32-bit version
Windows Azure
Windows Architecture
Kernel-Mode Components of
Windows
Executive
contains the core OS services
Kernel
controls execution of the processors
Device Drivers
dynamic libraries that extend the functionality of the
Executive
User-Mode Processes
Special System
Processes
Service Processes
Environment
Subsystems
User Applications
Client/Server Model
Windows OS services,
environmental
subsystems, and
applications are all
structured using the
client/server model
Common in distributed
systems, but can be
used internal to a single
system
Processes communicate
via RPC
Advantages:
Windows Objects
Windows draws heavily on the concepts
of object-oriented design
Key object-oriented concepts used by
Windows are:
Encapsulati
on
Object
class
and
instance
Inheritance
Polymorphis
m
tc
e
O
b
j lorC
n
o
tn
le
K
re
W
n
d
w
os
i
Windows 7
Description
of
UNIX
Traditional
UNIX
Kernel
Modern
UNIX
Kernel
LINUX Overview
Modular
Monolithic Kernel
Linux is structured as a
collection of modules
Relatively independent
blocks
A module is an object file
whose code can be linked
to and unlinked from the
kernel at runtime
A module is executed in
kernel mode on behalf of
the current process
Have two important
Loadable
Modules
characteristics:
Dynamic linking
Stackable modules
Linux
Kernel
Modul
es
Linux Signals
chroot
chroot UNIX
UNIX or
or
Linux
command
Linux command to
to
make
make the
the root
root
directory
directory become
become
something
something other
other
than
than its
its default
default
chcontext
chcontext allocates
allocates
a
a new
new security
security
context
context
chbind
chbind executes
executes a
a
command
command and
and locks
locks
the
the resulting
resulting process
process
and
and its
its children
children into
into
using
using a
a specific
specific IP
IP
address
address
capabilities
capabilities a
a
partitioning
partitioning of
of the
the
privileges
privileges available
available
to
to a
a root
root user
user
Linux Vserver
Architecture
Summary of lecture
What is an operating system?
Early Operating Systems
Simple Batch Systems
Multiprogrammed Batch Systems
Time-sharing Systems
Personal Computer Systems
Parallel and Distributed Systems
Real-time Systems
79