0% found this document useful (0 votes)
16 views

Operating System

Paging is a memory allocation technique that divides both secondary storage and main memory into equal-sized partitions called pages and frames. It allows non-contiguous storage of data to avoid external fragmentation. While paging increases access time, it enables easy swapping between pages and frames. Segmentation divides processes into modules instead of fixed pages to reduce internal fragmentation and page table size. Demand paging loads pages into memory only when needed by the CPU to improve memory usage.

Uploaded by

pritishsamal5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Operating System

Paging is a memory allocation technique that divides both secondary storage and main memory into equal-sized partitions called pages and frames. It allows non-contiguous storage of data to avoid external fragmentation. While paging increases access time, it enables easy swapping between pages and frames. Segmentation divides processes into modules instead of fixed pages to reduce internal fragmentation and page table size. Demand paging loads pages into memory only when needed by the CPU to improve memory usage.

Uploaded by

pritishsamal5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Paging is a non-contiguous memory allocation technique in Functions: Types:

which secondary memory and the main memory is divided 1. Memory Management: It is the management of the main or 1. Batch Operating System: This operating system (OS) does not
into equal size partitions. The partitions of the secondary primary memory. Whatever program is executed, it has to be communicate directly with the computer system. This operator sorts
memory are called pages while the partitions of the main present in the main memory. Main memory is a quick storage jobs with the same requirements and groups them into many batches.
memory are called frames. They are divided into equal size area that may be accessed directly by the CPU. Advantages: 1. Difficult to predict the time needed for any job to be
partitions to have maximum utilization of the main memory The os: Allocates and deallocates the memory. Keeps a record completed. Its processors know how long the job would be if it is in the
of which part of primary memory is used by whom and how queue. 2. Multiple users can avail of the sharing facility of this batch
and avoid external fragmentation.
OS. 3. Very less idle time is present in it.
Advantages of Paging much. Distributes the memory while multiprocessing.
Disadvantages: 1. The operators should be familiar with the batch
There is no external fragmentation as it allows us to store the 2. Processor Management/Scheduling
operating systems. 2. It is difficult to debug the system. 3. It is
data in a non-contiguous way. Processor management is an execution unit in which a
sometimes an expensive computer system.
Swapping is easy between equal-sized pages and frames. program operates. The operating system determines the status 2.Time-Sharing Operating System: Every task is allotted some time
Disadvantages of Paging of the processor and processes, selects a job and its processor, frame to perform functions so that all tasks are operated smoothly.it
As the size of the frame is fixed, so it may suffer from internal allocates the processor to the process, and de-allocates the allows large number of users direct access to main computer.
fragmentation. It may happen that the process is too small processor after the process is completed. The OS: Allocates Advantages: 1. Equal opportunity is given to every task performed. 2.
and it may not acquire the entire frame size. and deallocates processor to the processes. Keeps record of Very less chances of software duplication in it. 3. The CPU idle time of
The access time increases because of paging as the main CPU status. the system can be reduced.
memory has to be now accessed two times. 3.Device Management Disadvantages: 1. Problem related to reliability. 2. Taking care of the
For every process, we have an independent page table and An operating system regulates device connection using drivers. security and integrity of computer user programs and data is
maintaining the page table is extra overhead. The processes may require devices for their use. This compulsorily needed here. 3. There is a data communication and
management is done by the OS. The OS: interaction problem.
3. Distributed Operating System: This operating system is the latest OS
Segmentation Allocates and deallocates devices to different processes. Keeps
in the world of computer technology.
In paging, we were blindly diving the process into pages of records of the devices. Decides which process can use which
Advantages: 1. The data exchange speed is increased by electronic
fixed sizes but in segmentation, we divide the process into device for how much time.
mail.
modules for better visualization of the process. Here each 4. File Management 2. The computation speed is more as well as durable enough in this
segment or module consists of the same type of functions. The operating system manages resource allocation and de- system as the resources are shared it. 3. Load on the host computer
Advantages of Segmentation allocation. It specifies which process receives the file and for system is lesser.
The size of the segment table is less compared to the size of how long. It also keeps track of information, location, uses, Disadvantages: 1. If the main network is failed to work then the entire
the page table. status, and so on. The OS: Keeps records of the status and communication system will be stopped. 2. The language used to build
There is no internal fragmentation. locations of files. Allocates and deallocates resources. Decides distributed systems is not properly defined yet. 3. It is not available
Disadvantages of Segmentation who gets the resources. abundantly as it is also costly and complex in nature.
When the processes are loaded and removed ( during 5. Storage Management 4. Network Operating System –
swapping ) from the main memory then free memory spaces Storage management is a procedure that allows users to This operating system operates on a server and enables the
maximize the utilization of storage devices while also organisation of data, users, groups, security, applications, etc.
are broken into smaller pieces and this causes external
Advantages: 1. It has a highly stable centralized server system. 2.
fragmentation. protecting data integrity on whatever media on which it lives.
Servers handle and manage security concerns. 3. Advanced
Here also the time to access the data increases as due to The OS uses storage management for: Improving the
technologies and the new versions of the hardware are easily
segmentation the main memory has to be now accessed two performance of the data storage resources. It optimizes the
integrated with the system.
times. use of various storage devices. Disadvantages: 1. Servers used in this OS are costly in nature. 2.
Computer user has to rely on the central position for most functions.
Demand paging can be described as a memory management 3. There is a need for regular care about its maintenance and updates.
technique that is used in operating systems to improve memory 5. Real-Time Operating System:
usage and system performance. Demand paging is a technique In this OS, a very less time period is needed to process the system and
used in virtual memory systems where pages enter main respond to inputs. This time period is known as response time.
memory only when requested or needed by the CPU. Advantages: 1. As the size of computer programs is small under this
Advantages of Demand Paging OS, the RTOS can also be employed in embedded systems like
Efficient use of physical memory transportation. 2. It is considered an error-free OS. 3. Memory
Support for larger programs allocation is best organized in it.
Faster program start Disadvantages: 1. It can operate only a few tasks at the same time. 2.
Reduce memory usage Sometimes its system resources are not proper so it becomes a costly
Disadvantages of Demand Paging OS. 3. The complex algorithms are involved in it so it is difficult for the
Page Fault Overload designer to write it again.
Degraded performance
Fragmentation METHODS OF HANDLING DEADLOCK
1. Deadlock Prevention: Prevent deadlock by resource scheduling so as
to negate at least one of the four conditions.
2. Deadlock Avoidance: Avoid deadlock by careful resource scheduling.
3. Deadlock Detection and Recovery: Detect deadlock and when it
occurs, take steps to recover.
DEADLOCK PREVENTION
Elimination of “Mutual Exclusion” Condition: The mutual exclusion
condition must hold for non-sharable resources. That is, several
processes cannot simultaneously share a single resource. This
condition is difficult to eliminate because some resources, such as the
Hard disc drive and printer, are inherently non-shareable.
Elimination of “Hold and Wait” Condition: There are two possibilities
for elimination of the second condition. The first alternative is that a
process request be granted all of the resources it needs at once,
prior to execution.
Elimination of “No-preemption” Condition: The non-preemption
condition can be alleviated by forcing a process waiting for a resource
that cannot immediately be allocated to relinquish all of its currently
held resources, so that other processes may use them to finish.
Resource-Allocation Graph Algorithm DEADLOCK AVOIDANCE
The deadlock avoidance algorithm uses a variant of the This approach to the deadlock problem anticipates deadlock before it
resource-allocation graph to avoid deadlocked state. It actually occurs. This approach employs an algorithm to access the
introduces a new type of edge, called a claim edge. A claim edge possibility that deadlock could occur and acting accordingly.
Pi Rj indicates that process Pi may request resource Rj at some A system is said to be in a Safe State, if there is a safe execution
time in the future. This edge resembles a request edge in sequence. An execution sequence is an ordering for process execution
direction, but is represented by a dashed line. When process Pi such that each process runs until it terminates or blocked and all
requests resource Rj, the claimedge Pi Rj is converted to a request for resources are immediately granted if the resource is
request edge. Similarly, when a resource Rj is released by Pi, the available.
assignment edge Rj Pi is reconverted to a claim edge Pi Rj. A system is said to be in an Unsafe State, if there is no safe execution
sequence. An unsafe state may not be deadlocked, but there is at least
one sequence of requests from processes that would make the system
Deadlocked.

You might also like