Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

00 E8 CD 01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ENEL4OS H1 - Operating systems for Engineers - 2011

Tutorial 2:Memory Management and Virtual Memory (14 April 2011)


Due date: Wednesday 20 April 2011

Exercise 1: Review questions

(a) Explain the difference between logical and physical addresses.

(b) Why are page sizes always powers of 2?

(c) Why is it that, on a system with paging, a process cannot access memory it does not
own? How could the operating system allow access to other memory? Why should it or
should it not?

(d) List cases where entire program need not be in memory, traditionally.

(e) List benefits of having only part of a program in memory

Exercise 2: Physical Address Calculation


Consider the following segment table:

Segment Base Length


0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96

What are the physical addresses for the following logical addresses?

(a) 0,430

(b) 1,10

(c) 2,500

(d) 3,400

(e) 4,112

1
Exercise 3: Virtual Address
A certain computer provides its users with a virtual-memory space of 232 bytes. The computer
has 218 bytes of physical memory. The virtual memory is implemented by paging, and the
page size is 4096 bytes. A user process generates the virtual address 11123456. Explain how
the system establishes the corresponding physical location. Distinguish between software and
hardware operations.

Exercise 4: page-fault rate


Suppose we have a demand-paged memory. The page table is held in registers. It takes 8
milliseconds to service a page fault if an empty page is available or the replaced page is not
modified, and 20 milliseconds if the replaced page is modified. Memory access time is 100
nanoseconds. Assume that the page to be replaced is modified 70 percent of the time. What
is the maximum acceptable page-fault rate for an effective access time of no more than 200
nanoseconds?

Exercise 5: Page replacement


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. How many page faults would occur for the following replacement algorithms, assuming one,
two, three, four, five, six, or seven frames? Remember all frames are initially empty, so your
first unique pages will all cost one fault each.

• LRU replacement

• FIFO replacement

• Optimal replacement

You might also like