You are on page 1of 3

Chapter 9 & 10 – Operating System Concepts

*Please do NOT write a book for each question. 1-3 Sentences or short and to the point answers
are adequate for all lab questions. Feel free to free draw, use shapes, SmartArt, or other Word
tools to answer “Illustrate” questions. Chapter 9 questions are in blue. Chapter 10 questions
are in black.

1. Name two differences between logical and physical addresses.


If we look at it from two different angles, we can see where they differ. A Logical address is entirely
virtual and can be seen by a user. Whereas a physical address is something that isn’t seen by the user,
nor stored virtually instead having a place in the computer memory.

2. Why are page sizes always powers of 2?


Computers operate under bits, where the smallest increment is 2. This makes it so that bit sizes are 2,
and all works derived from it are best suited by this method.

3. Consider a logical address space of 64 pages of 1,024 words each, mapped onto a physical
memory of 32 frames.

A. How many bits are there in the logical address? 16 bits.

B. How many bits are there in the physical address? 15 bits


2^6 * 2^10 = 2^16
2^5 * 2^10=2^15

4. What is the effect of allowing two entries in a page table to point to the same page frame in
memory? Explain how this effect could be used to decrease the amount of time needed to copy
a large amount of memory from one place to another. What effect would updating some byte
on one page have on the other page?

They’d effectively be using the same page, this would allow different programs to use it, and can happen
frequently due to zeroed pages to allow for new pages to be made more easily for the user. This means
that any changes in bytes on one page would change the other page the same, and since it’s already
stored in one location, it can be used to more easily be changed. By having it elsewhere, it doesn’t really
require the information to be stored elsewhere simply the address, until the other entry was removed at
least, in which case the data would be linked with only one entry.

5. Under what circumstances do page faults occur? Describe the actions taken by the operating
system when a page fault occurs.
In such cases it is due to the page not being in the main memory. If this does happen it will check and
verify if that page exists and will bring it out from wherever it may be stored using a free frame, if not it
would abort the program requesting the nonexistent page.

6. Assume that you have a page-reference string for a process with m frames (initially all empty).
The page-reference string has length p, and n distinct page numbers occur in it. Answer these
questions for any page-replacement algorithms:

A. What is a lower bound on the number of page faults?


N is the lower bound, where if n is smaller than m.
B. What is an upper bound on the number of page faults?
P is the upper bound where all the p page references cause page faults.

7. Consider the page table for a system with 12-bit virtual and physical addresses and 256-byte
pages.

The list of free page frames is D, E, F (that is, D is at the head of the list, E is second, and F is
last). A dash for a page frame indicates that the page is not in memory. Convert the following
virtual addresses to their equivalent physical addresses in hexadecimal. All numbers are given ib
hexadecimal.

• 9EF -> 0EF


• 111 ->211
• 700 –> D00
• 0FF ->EFF

8. Consider the following page-replacement algorithms. Rank these algorithms on a five-point scale
from “bad” to “perfect” according to their page-fault rate. Separate those algorithms that suffer
from Belady’s anomaly from those that do not.

A. LRU replacement Belady, 4


B. FIFO replacement Belady, 1
C. Optimal replacement , 3
D. Second-chance replacement , 2
1: Optimal Replacement no
2: LRU no
3: Second-Chance belady
4: FIFO belady

You might also like