Lecture - 2
Lecture - 2
Lecture : 03
Operating System Concepts – 9th Edition 1.2 Silberschatz, Galvin and Gagne
Objectives
Distributed Systems
Process Management
Memory Management
Storage Management
Operating System Concepts – 9th Edition 1.3 Silberschatz, Galvin and Gagne
Distributed Systems
A distributed system contains multiple nodes that are
physically separate but linked together using the network. All
the nodes in this system communicate with each other and
handle processes in tandem.
Communication is via a network. These systems are termed
loosely-coupled or distributed systems. The processors vary
in size and function and are called nodes.
Operating System Concepts – 9th Edition 1.4 Silberschatz, Galvin and Gagne
Distributed Systems (contd.)
Some advantages of Distributed Systems are as follows −
All the nodes in the distributed system are connected
to each other. So nodes can easily share data with
other nodes.
More nodes can easily be added to the distributed
system i.e. it can be scaled as required.
Failure of one node does not lead to the failure of the
entire distributed system. Other nodes can still
communicate with each other.
Resources like printers can be shared with multiple
nodes rather than being restricted to just one.
Operating System Concepts – 9th Edition 1.5 Silberschatz, Galvin and Gagne
Pipeline Processing
Pipelining is the process of accumulating instruction from
the processor through a pipeline. It allows storing and
executing instructions in an orderly process. It is also
known as pipeline processing.
Pipelining is a technique where multiple instructions are
overlapped during execution. Pipeline is divided into stages
and these stages are connected with one another to form a
pipe like structure. Instructions enter from one end and exit
from another end.
Pipelining increases the overall instruction throughput.
In pipeline system, each segment consists of an input
register followed by a combinational circuit. The register is
used to hold data and combinational circuit performs
operations on it. The output of combinational circuit is
applied to the input register of the next segment.
Operating System Concepts – 9th Edition 1.6 Silberschatz, Galvin and Gagne
Pipeline Processing
An instruction in a process is divided into 5
subtasks likely,
Operating System Concepts – 9th Edition 1.7 Silberschatz, Galvin and Gagne
Pipeline Processing
Now, understanding the division of the instruction into subtasks. Let us
understand, how the n number of instructions in a process, are pipelined.
Look at the figure below the 5 instructions are pipelined. The first instruction gets
completed in 5 clock cycle. After the completion of first instruction, in every new
clock cycle, a new instruction completes its execution.
Operating System Concepts – 9th Edition 1.8 Silberschatz, Galvin and Gagne
Pipeline Processing
Operating System Concepts – 9th Edition 1.9 Silberschatz, Galvin and Gagne
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
Operating System Concepts – 9th Edition 1.10 Silberschatz, Galvin and Gagne
Process Management Activities
Operating System Concepts – 9th Edition 1.11 Silberschatz, Galvin and Gagne
Memory Management
To execute a program, all (or part) of the instructions
must be in memory
All (or part) of the data that is needed by the program
must be in memory.
Memory management determines what is in memory and
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
Operating System Concepts – 9th Edition 1.12 Silberschatz, Galvin and Gagne
Storage Management
OS provides uniform, logical view of information storage
Abstracts physical properties to logical storage unit -
file
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 directories
Mapping files onto secondary storage
Backup files onto stable (non-volatile) storage media
Operating System Concepts – 9th Edition 1.13 Silberschatz, Galvin and Gagne
Mass-Storage Management
Usually disks used to store data that does not fit in
main memory or data that must be kept for a “long”
period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk
subsystem and its algorithms
OS activities
Free-space management
Storage allocation
Disk scheduling
Some storage need not be fast
Such storage includes optical storage, magnetic
tape
Still must be managed – by OS or applications
Operating System Concepts – 9th Edition 1.14 Silberschatz, Galvin and Gagne
Performance of Various Levels of Storage
Operating System Concepts – 9th Edition 1.15 Silberschatz, Galvin and Gagne
Migration of Integer A from Disk to Register
Multitasking environments must be careful to use most
recent value, no matter where it is stored in the storage
hierarchy
Operating System Concepts – 9th Edition 1.16 Silberschatz, Galvin and Gagne
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), and
spooling (the overlapping of output of one job with input
of other jobs)
General device-driver interface
Drivers for specific hardware devices
Operating System Concepts – 9th Edition 1.17 Silberschatz, Galvin and Gagne
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
The main difference between protection and security is
that the protection focuses on internal threats in
a computer system while security focuses on external
threats to a computer system.
Systems generally first distinguish among users, to
determine who can do what
User identities (user IDs, security IDs) include name
and associated number, one per user
User ID then associated with all files, processes of
that user to determine access control
Group identifier (group ID) allows set of users to be
defined and controls managed, then also associated
with each process, file
Operating System Concepts – 9th Edition 1.18 Silberschatz, Galvin and Gagne
Protection and Security
Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne
Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne
Hardware Protection
Dual-Mode operation
I/O Protection
Memory Protection
CPU Protection
Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne
I/O Protection
All I/O instructions are privileged instructions.
A user process might disrupt normal operation of the
system by issuing the illegal I/O instructions, by accessing
memory locations and addresses within the operating
system itself, or by refusing to surrender CPU. We can use
of several mechanisms to ensure that such disruptions
should not take place in the system.
To prevent the users from performing the illegal I/O, we
define all the I/O instructions to be as privileged
instructions. Therefore users cannot issue the I/O
instructions directly; they should do it by making use of the
operating system.
For I/O protection and security to be complete, we should
be sure that the user program can never gain control of the
computer in the monitor mode. If it could, then the I/O
protection could be compromised.
Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne
Memory Protection
Must provide memory protection at least for the interrupt
vector and the interrupt service routines.
Memory protection is a way to control memory access rights
on a computer, and is a part of most modern operating
systems.
The main purpose of memory protection is to prevent a
process from accessing memory that has not been allocated
to it. This prevents a bug within a process from affecting
other processes, or the operating system itself
In order to have memory protection, add two registers that
determine the range of legal addresses a program may
access:
base register – holds the smallest legal physical memory
address.
Limit register – contains the size of the range
Memory outside the defined range is protected.
Base and limit registers are special hardware registers.
When a process is run, the base register is loaded with the
physical
Operating System Concepts location
th
– 9 Edition where the1.23
process begins in memory.
Silberschatz, Galvin and Gagne
A Base And A limit Register Define A Logical Address Space
Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne
Protection Hardware
Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne
CPU Protection
Timer – interrupts computer after specified period to ensure
operating system maintains control.
Timer is decremented every clock tick.
When timer reaches the value 0, an interrupt occurs.
CPU protection is needed to prevent a user program from
getting stuck in an infinite loop and never returning control
to the O/S.
Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne
Operating System Structure
Multiprogramming (Batch system) needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times
Multiprogramming organizes jobs (code and data) so CPU
always has one to execute
A subset of total jobs in system is kept in memory
One job selected and run via job scheduling
When it has to wait (for I/O for example), OS switches to
another job
Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne
Computing Environments - Mobile
Handheld smartphones, tablets, etc
What is the functional difference between them and a
“traditional” laptop?
A technology that is capable of providing an environment
which enables users to transmit data from one device to
other device without the use of any physical link/cables is
known as Mobile Computing.
It means, data transmission is done wireless-ly with the
help of wireless devices such as mobiles, laptops etc.
Whenever any device is connected to a network without
being connected physically over a link or cable, data
transmission such as messages, voice recording, videos etc.
can be done be done by using the concept of mobile
computing.
Mobile Computing technology helps users to access and
transmit data from any remote locations without being
present there physically.
Thus, having such a big coverage diameter, it is one of the
fastest and most reliable sectors
Operating System Concepts – 9 Edition
th 1.29
of computingSilberschatz,
technology Galvin and Gagne
Computing Environments – Distributed
Distributed computing
Collection of separate, possibly heterogeneous, systems
networked together
A distributed computing environment contains multiple nodes
that are physically separate but linked together using the
network. All the nodes in this system communicate with each
other and handle processes in cycle. Each of these nodes
contains a small part of the distributed operating system
software.
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
Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne
Computing Environments – Client-Server
Client-Server Computing
A Computer networking model where one or more powerful computers
(servers) provide the different computer network services and all other
user'of computer network (clients) access those services to perform
user's tasks is known as client/server computer networking model.
In such networks, there exists a central controller called server. A
server is a specialized computer that controls the network resources
and provides services to other computers in the network.
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
Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne
Computing Environments - Peer-to-Peer
Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne
Computing Environments - Virtualization
Operating System Concepts – 9th Edition 1.35 Silberschatz, Galvin and Gagne
Open-Source Operating Systems
Operating System Concepts – 9th Edition 1.36 Silberschatz, Galvin and Gagne
Web-Based Computing
Operating System Concepts – 9th Edition 1.37 Silberschatz, Galvin and Gagne
Web-Based Computing
Operating System Concepts – 9th Edition 1.38 Silberschatz, Galvin and Gagne
Open-Source Operating Systems
Operating System Concepts – 9th Edition 1.39 Silberschatz, Galvin and Gagne
End of Chapter 1