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

Tutorial 08 Questions

This document discusses various concepts related to virtual memory management and page replacement algorithms in an operating system. It includes examples of page tables, calculating physical addresses from virtual addresses, determining if a virtual address causes a page fault, calculating effective memory access times, and examples of applying First-In First-Out, Least Recently Used, and other page replacement algorithms to given page reference strings.

Uploaded by

1221301985
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Tutorial 08 Questions

This document discusses various concepts related to virtual memory management and page replacement algorithms in an operating system. It includes examples of page tables, calculating physical addresses from virtual addresses, determining if a virtual address causes a page fault, calculating effective memory access times, and examples of applying First-In First-Out, Least Recently Used, and other page replacement algorithms to given page reference strings.

Uploaded by

1221301985
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TSN2101/TOS2111 OPERATING SYSTEMS

Tutorial 8 (Virtual-Memory Management)

1. Consider the page table for a system with 12-bit virtual and physical addresses with
256-byte pages. The list of free page frames is D, E, F (D is at the head of the list,
E is second, and F is last)

Page Frame
0 -
1 2
2 C
3 A
4 -
5 4
6 3
7 -
8 B
9 0

Convert the following virtual addresses to their equivalent physical addresses in


hexadecimal. All numbers are given in hexadecimal. A dash for frame indicates that the
page is not in memory. If the frame is not in memory, it will be brought to one of the
free page frames in order.

(i) 9EF
(ii) 111
(iii) 700
(iv) 0FF

2. Consider the following page table in a demand paging system. Assume the page
size of 2000 bytes. Assume the usage of decimal values.

Frame Valid-Invalid bit


5 v
22 i
300 v
150 v
30 i
50 i
120 v
101 v

Check whether the virtual addresses given below would generate a page fault?
If it do not generate page fault, identify the physical address.

(i) 10230
(ii) 5213
(iii) 100
(iv) 8125
3. On a system using demand-paged memory, it takes 200ns to satisfy a memory
request if the page is in memory. If the page is not in memory, the request takes
7ms if a free frame is available or the page to be swapped out has not been modified.
It takes 15ms if the page to be swapped out has been modified. What is the effective
access time if the page fault rate is 5%, and 60% of the time the page to be replaced
has been modified/free frame is not available?

4. Consider a demand-paging system with a paging disk that has an average access
and transfer time of 20 milliseconds. Addresses are translated through a page table
in main memory, with an access time of 1 microsecond per memory access. Thus
each memory reference through the page table takes two accesses.

To improve this time, an associative memory is added that reduces access time to
one memory reference if the page-table entry is in the associative memory.

Assume that 80 percent of the accesses are in the associative memory and 10 percent
cause page faults. What is the effective memory access time?

5. Consider the following page reference string:

1,2,3,4, 2,1,5,6, 2,1,2,3, 7,6,3,2, 1,2,3,6

Assume the availability of FOUR frames and al the frames are initially empty. How
many page faults would occur for First in First out (FIFO) page replacement
algorithm? Identify the final pages in the frames.

6. Consider the following page reference string:

1,2,3,4, 2,1,5,6, 2,1,2,3, 7,6,3,2, 1,2,3,6

Assume the availability of FOUR frames and al the frames are initially empty. How
many page faults would occur for Least Recently Used (LRU) page replacement
algorithm? Identify the final pages in the frames.

7. Consider the following page reference string:

1,2,3,4, 2,1,5,6, 2,1,2,3, 7,6,3,2, 1,2,3,6

Assume the availability of FOUR frames and al the frames are initially empty. How
many page faults would occur for optimal page replacement algorithm? Identify the
final pages in the frames.
8. Given a system with four page frames, the following table indicates page number,
load time, last reference time, dirty bit, and reference bit.

Page number Load Time Last Dirty Bit Reference bit


Reference
Time
0 167 374 1 1
1 321 321 0 0
2 254 306 1 0
3 154 331 0 1

Identify the victim (page to be replaced) for the following algorithms.

(i) First-In-First-Out (FIFO)


(ii) Least-Recently-Used (LRU)
(iii) Reference bit – Dirty bit combination
(iv) Second Chance

9. Assume that a computer system has four frames and uses six reference bits to
implement additional-reference bits (aging) page-replacement algorithm. At the
first clock tick, the reference bits for pages 0 through 3 are 1,0,1, and 1 respectively.
Values at subsequent ticks are 0011,1001,0110,1100, and 0001.

(i) After the last tick, what is the value of the reference bits for all four pages?
(ii) Identify the victim page for page replacement.

References:

1. Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, “Operating System


Concepts”, 9/E, John Wiley & Sons, 2013.
2. William Stallings, "Operating Systems: Internals and Design Principles",
7th Edition, Prentice Hall, 2011
3. J. Archer Harris, “Operating Systems”, McGraw-Hill,2002.

You might also like