Operating System Concepts, Lecture 2
Operating System Concepts, Lecture 2
Operating System Concepts – 8th Edition Silberschatz, Galvin and Gagne ©2009
Operating System Course Plane
Course Books:
Operating System Concepts,
7th Edition by Silberschatz, Galvin, Gagne
Operating System Concepts – 8th Edition 1.2 Silberschatz, Galvin and Gagne ©2009
What is an Operating System?
Operating System Concepts – 8th Edition 1.3 Silberschatz, Galvin and Gagne ©2009
Computer System Structure
Operating System Concepts – 8th Edition 1.4 Silberschatz, Galvin and Gagne ©2009
Four Components of a Computer System
Operating System Concepts – 8th Edition 1.5 Silberschatz, Galvin and Gagne ©2009
Evolution of Operating Systems
Serial processing
Machines run from a console with display lights, toggle switches, input
device
Uni programming
Processor must wait for I/O instruction to complete before proceeding
Multiprogramming
Operating System Concepts – 8th Edition 1.6 Silberschatz, Galvin and Gagne ©2009
Evolution of Operating Systems ..
Multiprogramming with 3 programs
Operating System Concepts – 8th Edition 1.7 Silberschatz, Galvin and Gagne ©2009
Types of Operating Systems
Work Stations / PC / Single User/Client
Multiple Users/Main Frames/Servers
Micro OS
Operating System Concepts – 8th Edition 1.8 Silberschatz, Galvin and Gagne ©2009
What Operating Systems Do
Depends on the point of view
Users want convenience, ease of use
Don’t care about resource utilization(memory,ram,cpu cycles,i/o)
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
Operating System Concepts – 8th Edition 1.9 Silberschatz, Galvin and Gagne ©2009
Operating System Definition
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
Operating System Concepts – 8th Edition 1.10 Silberschatz, Galvin and Gagne ©2009
Computer-System Operation
I/O devices and the CPU can execute concurrently
Operating System Concepts – 8th Edition 1.11 Silberschatz, Galvin and Gagne ©2009
Interrupts
Interrupts an event external to the currently executing process that causes a
change in the normal flow of instruction execution.
An interrupt is a signal to the processor emitted by hardware or software
indicating an event that needs immediate attention.
Ex: i/o interrupt , power button press, Alt + f4 ,key press, new program load
Types of interrupts
1) Internal Interrupt : The Internal Interrupts are those which are occurred due to
Some Problem in the Execution For Example When a user performing any
Operation which contains any Error for example 1 / 0, reading file failure
2) External Interrupt : External Interrupt occurs when any Input and Output Device
request for any Operation and the CPU will Execute that instructions first For
Example When a Program is executed and when we move the Mouse on the
Screen then the CPU will handle this External interrupt first and after that he will
resume with his Operation.
Operating System Concepts – 8th Edition 1.12 Silberschatz, Galvin and Gagne ©2009
Sequential
Interrupt Processing
Operating System Concepts – 8th Edition 1.13 Silberschatz, Galvin and Gagne ©2009
Nested
Interrupt Processing
Operating System Concepts – 8th Edition 1.14 Silberschatz, Galvin and Gagne ©2009
More Example of
Nested Interrupts
Operating System Concepts – 8th Edition 1.15 Silberschatz, Galvin and Gagne ©2009
Direct Memory Access
A direct memory access (DMA) is an operation in which data is copied
(transported) from one resource to another resource in a computer
system without the involvement of the CPU.
Direct Memory Access is a capability provided by some computer bus
architectures that allows data to be sent directly from an attached
device (such as a disk drive) to the memory on the computer's
motherboard. The microprocessor is freed from involvement with the
data transfer, thus speeding up overall computer operation
Operating System Concepts – 8th Edition 1.16 Silberschatz, Galvin and Gagne ©2009
Storage Hierarchy
Storage systems organized in hierarchy
Speed
Cost
Volatility
Volatile memory or volatile storage is computer memory that
requires power to maintain the stored information. It retains its contents
while powered, but when power is interrupted stored data is
immediately lost.
Non Volatile memory is memory that maintains its content even
when unpowered.
Operating System Concepts – 8th Edition 1.17 Silberschatz, Galvin and Gagne ©2009
Storage-Device Hierarchy
Operating System Concepts – 8th Edition 1.18 Silberschatz, Galvin and Gagne ©2009
Storage Structure
Register
A special, high-speed storage area within the CPU. All data must be
represented in a register before it can be processed. For example, if
two numbers are to be multiplied, both numbers must be in registers,
and the result is also placed in a register. (The register can contain the
address of a memory location where data is stored rather than the
actual data itself.)
32 bit , 64 bit OS
Cache is memory that a computer microprocessor can access
more quickly than it can access regular RAM. As the microprocessor
processes data, it looks first in the cache memory and if it finds the
data there.
Operating System Concepts – 8th Edition 1.19 Silberschatz, Galvin and Gagne ©2009
Storage Structure …
Main memory(RAM) is where programs and data are kept when
the processor is actively using them. When programs and data
become active, they are copied from secondary memory into main
memory where the processor can interact with them. A copy
remains in secondary memory.
Main memory is intimately connected to the processor, so moving
instructions and data into and out of the processor is very fast.
Main memory is sometimes called RAM. RAM stands for Random
Access Memory. "Random" means that the memory cells can be
accessed in any order.
Magnetic storage is the storage of data on a magnetized
medium. Magnetic storage uses different patterns of
magnetization in a magnetizable material to store data and is a
form of non-volatile memory. The information is accessed using
one or more read/write heads.
Optical memory is computer memory that uses optical techniques
which generally involve an addressable laser beam.
Operating System Concepts – 8th Edition 1.20 Silberschatz, Galvin and Gagne ©2009
Performance of Various Levels of Storage
Operating System Concepts – 8th Edition 1.21 Silberschatz, Galvin and Gagne ©2009
How a Modern Computer Works
Operating System Concepts – 8th Edition 1.22 Silberschatz, Galvin and Gagne ©2009
Symmetric Multiprocessing Architecture
Operating System Concepts – 8th Edition 1.23 Silberschatz, Galvin and Gagne ©2009
A Dual-Core Design
Operating System Concepts – 8th Edition 1.24 Silberschatz, Galvin and Gagne ©2009
Clustered Systems
Like multiprocessor systems, but multiple systems working together
Usually sharing storage via a storage-area network (SAN)
Provides a high-availability service which survives failures
Asymmetric clustering has one machine in hot-standby mode
Symmetric clustering has multiple nodes running applications,
monitoring each other
Some clusters are for high-performance computing (HPC)
Applications must be written to use parallel processing
Hot standby is a redundant method of having one system running
simultaneously with another identical primary system. Upon failure of the primary
system, the hot standby system immediately takes over replacing the primary
system. However, data is still mirrored in real time, thus both the systems are
assured of having identical data.
Parallel Processing parallel processing is the processing
of program instructions by dividing them among multiple processors with the
objective of running a program in less time.
Operating System Concepts – 8th Edition 1.25 Silberschatz, Galvin and Gagne ©2009
Clustered Systems
Operating System Concepts – 8th Edition 1.26 Silberschatz, Galvin and Gagne ©2009
Process
Operating System Concepts – 8th Edition 1.27 Silberschatz, Galvin and Gagne ©2009
Process ..
Waiting
The process is waiting for some event to occur
Terminated
The process has finished execution.
Operating System Concepts – 8th Edition 1.28 Silberschatz, Galvin and Gagne ©2009
Process Management
Process needs resources to accomplish its task
CPU, memory, I/O, files
Initialization data
While the process is running it has a number of elements including
Identifier
State
Priority
Program counter
Memory pointers
Context data
I/O status information
Accounting information
Operating System Concepts – 8th Edition 1.29 Silberschatz, Galvin and Gagne ©2009
Process Management Activities
The operating system is responsible for the following activities in
connection with process management:
Operating System Concepts – 8th Edition 1.30 Silberschatz, Galvin and Gagne ©2009
Distributed Computing
A distributed computer system consists of multiple software components that are
on multiple computers, but run as a single system.
The computers that are in a distributed system can be physically close together
and connected by a local network, or they can be geographically distant and
connected by a wide area network. A distributed system can consist of any
number of possible configurations, such as mainframes, personal computers,
workstations, minicomputers, and so on. The goal of distributed computing is to
make such a network work as a single computer.
Distributed systems offer many benefits over centralized systems, including the
following :
• Scalability The system can easily be expanded by adding more machines as
needed.
• Redundancy Several machines can provide the same services, so if one is
unavailable, work does not stop. Additionally, because many smaller
machines can be used, this redundancy does not need to be prohibitively
expensive.
Operating System Concepts – 8th Edition 1.31 Silberschatz, Galvin and Gagne ©2009
Distributed Computing ..
In Distributed Computing Network is a communications path
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
Wireless Local Area Network (WLAN)
Campus Area Network (CAN)
Desk Area Network (DAN)
Operating System Concepts – 8th Edition 1.32 Silberschatz, Galvin and Gagne ©2009
Special-Purpose Systems
Real-time embedded systems most prevalent form of computers
Vary considerable, special purpose, limited purpose OS, real-time OS
Multimedia systems
Streams of data must be delivered according to time restrictions
Handheld systems
PDAs, smart phones, limited CPU, memory, power
Reduced feature set OS, limited I/O
Operating System Concepts – 8th Edition 1.33 Silberschatz, Galvin and Gagne ©2009
Peer-to-Peer Computing
A peer-to-peer (P2P) network is a type of decentralized and distributed
network architecture in which individual nodes in the network (called
"peers") act as both suppliers and consumers of resources.
Another model of distributed system
P2P does not distinguish clients and servers
Instead all nodes are considered peers
May each act as client, server or both
Node must join P2P network
Registers its service with central lookup service on network, or
Broadcast request for service and respond to requests for
service via discovery protocol
Examples include Napster and Gnutella
Operating System Concepts – 8th Edition 1.34 Silberschatz, Galvin and Gagne ©2009
Web-Based Computing
Web has become ubiquitous
Operating System Concepts – 8th Edition 1.35 Silberschatz, Galvin and Gagne ©2009
Computing Environments
Traditional computer
Office environment
PCs connected to a network, terminals attached to
mainframe or minicomputers providing batch and
timesharing
Now portals allowing networked and remote systems
access to same resources
Home networks
Used to be single system, then modems
Now firewalled, networked
Operating System Concepts – 8th Edition 1.36 Silberschatz, Galvin and Gagne ©2009
Computing Environments (Cont.)
Client-Server Computing
Dumb terminals supplanted by smart PCs
Many systems now servers, responding to requests generated
by clients
Compute-server provides an interface to client to request
services (i.e., database)
File-server provides interface for clients to store and
retrieve files
Operating System Concepts – 8th Edition 1.37 Silberschatz, Galvin and Gagne ©2009
Open-Source Operating Systems
Operating systems made available in source-code format rather than
just binary closed-source
Operating System Concepts – 8th Edition 1.38 Silberschatz, Galvin and Gagne ©2009