# Thread: Virtual Memory System

1. ## Virtual Memory System

Hi I am studying for my operating system programming exam and we been provided with a sample exam but no answers have been given.I have answered a) and b) (not sure if they are right) but I am not sure how to answer c) and d). It will be much appreciated if you explain how to get the right answer. Thanks.

Consider a virtual memory system with the following parameters:

- 64-bit virtual address
- 32-kbyte virtual page size
- 64-bit Page Table Entry (PTE)
- 2-Gbyte physical memory

(a) Draw a diagram of the 32-bit address showing the length and placement of all bit 1elds i.e. the offset in the page(O), and the page number (P).

= PPPP PPPP PPPP PPPP PPPP | OOOO OOOO OOOO

(b) How many virtual pages are available in this system?

= 2^20 pages (the number of bits for the page number)

(c) How many physical frames are available in this system?

(d) What is the size, in bytes, of the page table?

2. (a) How many bits would fit a value between 0 and 32-kiB?
(b) How many bits are left after you subtract the offset ones? That is the 2^N you need.
(c) Isn't this a simple division, disregarding memory-mapped IO and such?

(d) Now, this question is misleading, because it implied that there's only a page table associated with paging, but in reality there are more tables available to ease on memory usage( which end up using more memory if you need them all... ). Anyways, assuming there exists only the main page table, it would need to have (2-GiB/32-KiB) entries, obviously right? Now, each entry needs to be at least 64-bits, so let's assume it's 64-bit, that's 8-B. Multiply the amount of the entries by the size of each entry and you max the maximum size of the page table

3. Thanks, ok so is this right:
a) PPPP PPPP PPPP PPPP P | OOOO OOOO OOOO OOO
b) 2^17 entries
c)2GB/32KB = 2^31/2^15 = 2^16
d)8GB/32KB X 8B = 2MB ??? Not sure if this is correct

4. (a) You put an extra zero there, remove it and it should be fine.
(d) Isn't physical memory 2-GiB, as you stated earlier? Your math is right, I just don't know if your numbers are the right ones.

Popular pages Recent additions