Unit 7-Operating System
Unit 7-Operating System
OPERATING SYSTEM
INTRODUCTION
• Operating system (OS) is the software that
provides an interface between the computer
hardware, and the application programs or
users
INTRODUCTION
OBJECTIVES OF OPERATING SYSTEM
A Real Time OS is defined as a data processing cycle in which the time interval required
To process and response to input is so small
• Process Management
• process management activities handled by the
OS are—
• (1) control access to shared resources like file,
memory, I/O and CPU,
• (2) control execution of applications,
• (3) create, execute and delete a process
(system process or user process),
Process Management
activities
• (4) cancel or resume a process
• (5) schedule a process, and
• (6) synchronization, communication and
deadlock handling for processes.
FUNCTIONS OF OS
Process Management
• A process is a program in a state of execution.
• The various states that a process changes
during execution are as follows:
• New—process is in a new state when it is
created,
• Ready—process is in ready state when it is
waiting for a processor,
• Running—process is in running state if
processor is executing the process,
FUNCTIONS OF OS
Process Management
• Waiting—process is in waiting state when it
waits for some event to happen (I/O etc), and
• Terminated—process that has finished
execution is in terminated state.
IT IS A PROBLEM
IT IS A SITUATION WHEN TWO OR MORE PROCESSES SHARING THE SAME RESOURCE ARE
PREVENTING EACH OTHER FROM ACCESSING THE RESOURCE
FUNCTIONS OF OS
Process Management
• Deadlock
FUNCTIONS OF OS
Process Management
• Deadlock
• In a multiprogramming environment, multiple
processes may try to access a resource.
• A deadlock is a situation when a process waits
endlessly for a resource and the requested
resource is being used by another process that
is waiting for some other resource.
FUNCTIONS OF OS
Process Management
• Deadlock
A deadlock arises when the four necessary
conditions hold true simultaneously in a system:
• Mutual Exclusion: Only one process at a time can
use the resource. Any other process requesting
the resource has to wait until the resource is
released.
• No Pre-emption: A process releases the resource
by itself. A process cannot remove the resource
from another process.
FUNCTIONS OF OS
Process Management
• Deadlock
• Hold and Wait: A process holds a resource
while requesting another resource, which may
be currently held by another process.
• Circular Wait: In this situation, a process P1
waits for a resource held by another process
P2, and the process P2 waits for a resource
held by process P1.
FUNCTIONS OF OS
Process Management
Deadlock handling.
• Deadlock Avoidance requires that the
operating system be given information in
advance regarding the resources a process will
request and use. This information is used by
the operating system to schedule the
allocation of resources so that no process
waits for a resource.
FUNCTIONS OF OS
Process Management
Deadlock handling.
• Deadlock Prevention is a set of method that
ensures that at least one of the above four
necessary conditions required for deadlock,
does not hold true.
Memory Management