Q4.
(a) NRU (Not Recently Used) makes an approximation to replace the page based on referenced and modified bits. Based upon R and M bits, there arise four cases as below-
case 1: not referenced and not modified (R = M = 0)
case 2: not referenced, modified (R=0 and M=1)
case 3: referenced, not modified (R=1 and M=0)
case 4: referenced and modified (M=1 R=1)
The NRU algorithm removes a page from lowest numbered nonempty case.
Here, page 0 belongs to case 1
page 1 belongs to case 2
page 2 belongs to case 4
page 3 belongs to case 4
So lowest numbered nonempty case, PAGE-0 needs to be replaced by NRU.
(b). FIFO replacement algorithm works in a way that it will replace the page that arrived the earliest. So, FIFO will replace PAGE-2.
(c). LRU (Least recently used) is a page replacement algorithm that replaces the page that is least recently used.
Thus LRU takes decision on the basis of the Last Reference and page having least Last Reference is being replaced.
LRU will replace PAGE-1.
(d). Second chance algorithm works by adding a 'second chance' bit to each memory frame whenever page is referenced associated to that frame, this bit is set and when replacement is needed, this bit is reset (set to 0).
FIFO with second chance replacement algorithm will replace PAGE-2.
4. (25 points ) A computer has four page frames, The time of loading, time of...
A computer has four page frames, whose the time of loading, time of last access, and the R and M bits are shown below (the timesare in clock ticks): (a) Which page will NRU replace? (b) Which page will second chance replace? Page Loaded Last ref. R M 0 126 280 1 0 1 230 265 0 1 2 140 270 0 0 3 110 285 1 1
2q62/Operating systems. PLs, detail of step1 tp step n A computer has five page frames. The time of loading, time of last access, and the Referenced and Modified bit for each page are shown below (with time in clock ticks) For each of the following algorithms, which page would be the next to be replaced? Least recently used Not recently used First in, first out Second chance Clock
Given that main memory is composed of four page frames for public use, use the following table to answer all parts of this problem: Page Frame Time When Loaded Time When Last Referenced Referenced BIT Modified BIT 0 09 307 0 0 1 17 362 1 0 2 10 294 0 1 3 160 369 1 1 The contents of which page frame would be swapped out by FIFO? The contents of which page frame would be swapped out by...
Name Olbinna COSC414/514 Quiz3 (1) Suppose a computer has 4 physical pages, and a process references its virtual pages (page o through page 7) in the following order: 021354637473355311172341 Also suppose the first four pages have been loaded in the physical memory as the following figure: Frame 0 Frame 1 Frame 2 Frame 3 a. Suppose the kernel uses First-In-First-Out (FIFO) page replacement algorithm. How many page faults would the process have? Which page references are page faults? b. Suppose...