Operating System
A paging system uses 16-bit address and 4K pages. The following shows the page tables of two running processes, Process 1 and Process 2. Translate the logical address 16,000 of Process 1 and the logical address 9,000 of Process 2 to their physical addresses. Fill your answers into the table below (10 pts)
Process 1 Process 2
0 ----------- 0 0 ----------- 3
1 ----------- 4 1 ----------- 1
2 ----------- 5 2 ----------- 7
3 ----------- 2 3 ----------- 6
4 ----------- 8
Processes Address Page# Offset Physical Address
Process 1 16,000 ---------- ---------- ---------------------------
Process 2 9,000 ---------- ---------- ---------------------------
Suppose both processes ask for a shared memory of 4K, and suppose further that the system decides to allocate page frame 10 for this purpose. What virtual (or logical) addresses processes Process 1 and Process 2 will receive and what are the new page tables? You should provide sufficient reasoning.
First need to find out page number:
6000 % 4096(4K) = 1904
Floor (6000 / 4096) = 1
So 6000 maps to the 1904 address of page 1.
Page 1 virtual address mapped to frame 4.
So physical address is: 4 * 4096 = 16384 So frame 4 have base address of 16384 in the physical memory.
So 1904th byte of frame 4 is at: 16384 + 1904 = 18288
2. Logical address: 19000
First need to find out page number:
19000 % 4096(4K) = 2616
Floor (19000 / 4096) = 4
So 19000 maps to the 2616 address of page 4.
Page 4 virtual address mapped to frame 8.
So physical address is: 8 * 4096 = 32768 So frame 8 have base address of 32768 in the physical memory.
So 2616th byte of frame 8 is at: 32768 + 2616 = 35384
| Process | Address | Page# | Offset | Physical Address |
|---|---|---|---|---|
| Process 1 | 6,000 | 1 | 1904 | 18288 |
| Process 2 | 19,000 | 4 | 2616 | 35384 |
Operating System A paging system uses 16-bit address and 4K pages. The following shows the page...