Professional Documents
Culture Documents
BSGMM 4a Os A3 F22 017
BSGMM 4a Os A3 F22 017
BSGMM 4a Os A3 F22 017
Operating Systems
Assignment 3
1|Page
i.Explain demand paging and demand segment. And also explain
associate mapping and page fault?
In Demand Paging, a page is loaded from the secondary memory into
the primary memory, only when it is needed. On the other hand,
Segmentation follows a strategy whereby the entire memory space is
divided into discrete segments and each segment is allocated to a
process.
Associative mapping :
A technique of cache mapping that allows mapping of the main memory
block to a freely available cache line.
Here the mapping of the main memory block can be done with any of
the cache block. The memory address has only 2 fields here: word & tag.
Page Fault :
It mainly occurs when any program tries to access the data or the code
that is in the address space of the program, but that data is not currently
located in the RAM of the system.
2|Page
3. Least Recently Used:
In this algorithm, page will be replaced which is least recently used.
4. Most Recently Used (MRU): In this algorithm, page will be
replaced which has been used recently. Belady’s anomaly can occur in
this algorithm.
(Bélády’s anomaly is the name given to the phenomenon where
increasing the number of page frames results in an increase in the
number of page faults for a given memory access pattern.)
Local page replacement algorithm selects for replacement some page
that belongs to that process (or a group of processes sharing memory
partition), whereas global replacement algorithm is free to select any
page in memory.
7 0 1 2 0 3 0 4 2 3 0 3 0 3 1 7 0 1
7 7 7 7 7 3 3 3 3 3 3 3 3 3 3 7 7 7
0 0 0 0 0 0 4 4 4 4 4 4 4 4 4 4 4
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
2 2 2 2 2 2 2 2 2 2 2 1 1 1 1
F F F F H F H F H H H H H H F F H H
Page faults = 9
Page hits = 9
3|Page
iv.Solve these Reference string: LRU
7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 using 5 frames
7 0 1 3 2 0 0 4 2 3 0 3 0 3 2 1 2 0 1 7 0 1
7 7 7 7 7 7 7 4 4 4 4 4 4 4 4 4 4 4 4 7 7 7
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
F F F F H F H F H H H H H H H H H H H F H H
Page faults= 7
Page hits = 15
7 0 1 2 0 3 0 4 2 3 0 3 0 3 2 1 2 0
7 7 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
0 0 0 0 0 0 4 4 4 0 0 0 0 0 0 0 0
1 1 1 3 3 3 3 3 3 3 3 3 3 1 1 1
F F F F H F H F H H F H H H H F H H
1 7 0 1 4 3 6 2 5
2 7 7 7 7 7 6 6 6
0 0 0 0 4 4 4 2 2
1 1 1 1 1 3 3 3 5
H F H H F F F F F
Page faults= 14
Page hits = 13
4|Page
5|Page