You are on page 1of 24

Principles of Operating Systems -

Lecture 1 1
Introduction
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
Principles of Operating Systems -
Lecture 1 2
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.
OS simplifies and manages the complexity of running
application programs efficiently.
Principles of Operating Systems -
Lecture 1 3
Goals of an Operating System
Simplify the execution of user programs and
make solving user problems easier.
Use computer hardware efficiently.
Allow sharing of hardware and software resources.
Make application software portable and versatile.
Provide isolation, security and protection among
user programs.
Improve overall system reliability
error confinement, fault tolerance, reconfiguration.
Principles of Operating Systems -
Lecture 1 4
Why should I study Operating
Systems?
Need to understand interaction between the
hardware and applications
New applications, new hardware..
Inherent aspect of society today
Need to understand basic principles in the design of
computer systems
efficient resource management, security, flexibility
Increasing need for specialized operating systems
e.g. embedded operating systems for devices - cell phones,
sensors and controllers
real-time operating systems vehicles, aircraft control,
multimedia services
Principles of Operating Systems -
Lecture 1 5
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
Principles of Operating Systems -
Lecture 1 6
Abstract View of System
System and Application Programs
Operating System
Computer
Hardware
User
1

User
2
User
3
User
n
compiler assembler
Text editor
Database
system
...
Principles of Operating Systems -
Lecture 1 7
Operating System Views
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).
Principles of Operating Systems -
Lecture 1 8
Operating System Spectrum
Monitors and Small Kernels
special purpose and embedded systems, real-time systems
Batch and multiprogramming
Timesharing
workstations, servers, minicomputers, timeframes

Simple Batch Systems
(1960s)
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.

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.
Principles of Operating Systems -
Lecture 1 9
From J ohn Ousterhout slides
Principles of Operating Systems -
Lecture 1 10
Multiprogramming
Use interrupts to run multiple programs
simultaneously
When a program performs I/O, instead of polling, execute
another program till interrupt is received.
Requires secure memory, I/O for each program.
Requires intervention if program loops
indefinitely.
Requires CPU scheduling to choose the next job
to run.

Principles of Operating Systems -
Lecture 1 11
Timesharing

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
Control card interpreter replaced by command
language interpreter.

Hardware getting cheaper; Human getting expensive
Principles of Operating Systems -
Lecture 1 12
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.
Principles of Operating Systems -
Lecture 1 13
Real-time systems
Correct system function depends on timeliness
Feedback/control loops
Sensors and actuators
Hard real-time systems -
Failure if response time too long.
Secondary storage is limited
Soft real-time systems -
Less accurate if response time is too long.
Useful in applications such as multimedia, virtual reality.
Process Management

A process is a program in execution. It is a
unit of work within the system. Program is
a passive entity, process is an active entity.
Process needs resources to accomplish its
task
CPU, memory, I/O, files
Initialization data
Process termination requires reclaim of any
reusable resources

Single-threaded process has one program counter
specifying location of next instruction to execute
Process executes instructions sequentially, one at a
time, until completion
Multi-threaded process has one program counter per
thread
Typically system has many processes, some user, some
operating system running concurrently on one or more
CPUs
Concurrency by multiplexing the CPUs among the
processes / threads

Principles of Operating Systems -
Lecture 1 15
Process Management Activities
Creating and deleting both user and system
processes
Suspending and resuming processes
Providing mechanisms for process
synchronization
Providing mechanisms for process
communication
Providing mechanisms for deadlock handling
The operating system is responsible for the following activities in
connection with process management:
Memory Management
All data in memory before and after
processing
All instructions in memory in order to
execute
Memory management determines what is in
memory when
Optimizing CPU utilization and computer
response to users
Memory management activities
Keeping track of which parts of memory are currently
being used and by whom
Deciding which processes (or parts thereof) and data
to move into and out of memory
Allocating and deallocating memory space as needed


Principles of Operating Systems -
Lecture 1 18
Storage Management
OS provides uniform, logical view
of information storage
Abstracts physical properties to
logical storage unit - file
Each medium is controlled by
device (i.e., disk drive, tape drive)
Varying properties include access
speed, capacity, data-transfer rate,
access method (sequential or random)
File-System management
Files usually organized into directories
Access control on most systems to
determine who can access what
OS activities include
Creating and deleting files and directories
Primitives to manipulate files and dirs
Mapping files onto secondary storage
Backup files onto stable (non-volatile)
storage media

Principles of Operating Systems -
Lecture 1 20
I/O Subsystem
One purpose of OS is to hide peculiarities of
hardware devices from the user
I/O subsystem responsible for
Memory management of I/O including buffering
(storing data temporarily while it is being
transferred), caching (storing parts of data in
faster storage for performance), spooling (the
overlapping of output of one job with input of
other jobs)
General device-driver interface
Drivers for specific hardware devices
Protection and Security
Protection any mechanism for
controlling access of processes or
users to resources defined by the
OS
Security defense of the system
against internal and external
attacks
Huge range, including denial-of-
service, worms, viruses, identity
theft, theft of service
OPERATING SYSTEM
SERVICES
Program execution: The system must be able
to load a program into memory and to run the
program.
I/O operations: A running program may
require I/O. This I/O may be a file or an I/O
device.
File system manipulation: The OS must
provide means to manage and work with file.
Principles of Operating Systems -
Lecture 1 23
Error detection: Errors may occur in CPU,
memory hardware, I/O devices or user
programs.
Communication: One process needs to
exchange information with another process.

Principles of Operating Systems -
Lecture 1 24

You might also like