OSY MSBTE CHP5
OSY MSBTE CHP5
OSY MSBTE CHP5
Paging Segmentation
In paging, the program is divided into fixed or In segmentation, the program is
mounted size pages. divided into variable size segments.
For the paging operating system For segmentation compiler is
is accountable. accountable.
Page size is determined by Here, the segment size is given by
hardware. the user.
It is faster in comparison to Segmentation is slow.
segmentation.
Paging is invisible to the user. Segmentation is visible to the user.
For 6m
Types of partitioning
• When a process enters in main memory, it is allocated exact size that is required by that
process. So in this method, partitions can vary in size depending on memory space
required by a process entering in main memory.
• The operating system keeps a table indicating which parts of memory are available and
which are occupied. Initially all memory is available for user programs and is
considered as one large block of available memory, a hole.
• When a job arrives and needs memory, we search for a hole large enough for this job. If
we find one, we allocate only as much as is needed, keeping the rest available to satisfy
future requests.
For example, assume 256K memory available and a resident monitor of 40K. This situation
leaves 216K for user programs
7. Explain Fixed size memory partitioning
Ans. Memory is divided into number of fixed size partitions, which is called as fixed or
static memory partitioning. Each partition contains exactly one process. The number of
programs to be executed depends on number of partitions. When the partition is free, a
selected process from the input queue is loaded into the free partition. When the process
terminates, the partition becomes available for another process. The operating system
keeps a table indicating parts of memory which are available and which are occupied.
Initially, all memory is available for user processes and it is considered as one large block
of available memory, a hole. When a process arrives, large enough to hole of memory is
allocated to the processes.
9. *Explain LRU page replacement algorithm for following reference string.
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Calculate the page fault
Ans. LRU:
• The Least Recently Used (LRU) page replacement policy replaces the page that has not
been used for the longest period of time.
• LRU replacement associates with each page the time of that page's last use.
• When a page must be replaced, LRU chooses the page that has not been used for the
longest period of time.
• The LRU policy is often used as a page-replacement algorithm and is considered to be
good.
10. *Find out the total number of page faults using:
70120304230321201701
Extra
Explain system call implementation and explain how parameter passing
is done in system call
Ans.