Sei sulla pagina 1di 2

CS3523 (OS-2) 2019

Homework on Memory Management, Virtual Memory and Flash memory architecture

1. Only pdf is acceptable as a solution. If you work in docx or scan a hand-


written solution, convert your file to pdf.
2. Any comment made on Google-classroom either before or after deadline
will not be considered as a solution. Only your final uploaded solution
will be graded (considered).

1. (1 mark) Assuming a 2KB page size, find page number and offset for the following
address reference: (4095)10
2. (2 mark) Consider an OS with 32-bit virtual address and 24-bit physical address.
System page size is 2KB. Find number of entries in an inverted page table.
3. (1 mark) We have a 512KB chunk available and buddy system needs to fulfill
a kernel request of 57KB memory. Just with text (i.e., without drawing any
figure), show how this request will be fulfilled.
4. (3 mark) An OS has following segment table.
Segment Base Length
0 239 420
1 95 105
2 5450 1400
3 1981 555
4 1020 321

For each logical address given below, find the physical address.

(a) 0, 345 (b) 3, 666 (c) 2, 876

5. [2 mark] For the figure above, show the segment table.


6. [1 mark] What is the use of page-length register (note: it is not page-table length
register). [max 2 sentence]
7. [2 mark] Show the address-subdivision (that means how many bits for each level) for
a 4-level hierarchical page table which has following properties: The outer-most
page table has 536870912 entries. A second-level table has 8192 entries. A third
level page table has 512 entries. A fourth-level table has 64 entries. The address is
64 bit.
8. [4 mark] Given memory partitions of 320 KB, 580 KB, 480 KB, 220 KB, 890 KB, 600
KB and 155 KB (in order), how would the best-fit and worst-fit algorithms place
processes of size 135 KB, 650 KB, 398 KB, 220 KB, 520KB and 440 KB (in order)?
For both the algorithms, assume that when a process of size k is allotted a memory
partition of size P, then, the leftover space (P-k) can be used when we do the next
allotment.
9. [7 mark] Consider a Flash memory which has 3 pages in each block of its physical
space. There a total of 15 pages (i.e., 5 blocks).
In logical space, there are 9 pages and writes to them are made as follows
0, 2, 4, 5, 7, 8, 1, 6, 6, 2, 3, 5, 8, 6, 0, 5, 8, 2, 3, 4, 1, 7, 0, 6
Given this, show the final state (free/invalid/valid) of each page in physical space of
Flash memory (5 marks). Also, show after which write operations, erase operations
were performed and how many total number of erase operations were performed. (2
marks). (Assume that in case of tie between two blocks having same number of
invalid pages, the block selected for erase is one which got the pages invalid the
earliest.)
You should show the final state in the following format. Also assume that blocks are
NOT shifted during erase operations (which is different from what is shown on the
slides).

10. [2 mark] Consider the logical page information of a flash memory: total size is 64GB
and each block has 64 pages of 4KB size.
Number of physical pages is 4 times the logical pages. Find the size of Flash
translation table. (You can leave your answer in terms of log or multiplication).

Potrebbero piacerti anche