{ "q1": { "type": "multiple", "question": "\n\n\nWhich of the following statements regarding segmentation\nand paging are true (select all that apply)?\n\n\n", "responses": { "seg_sharing": "Segmentation allows for code sharing between different processes.", "pag_sharing": "Paging allows for code sharing between different processes.", "seg_fixed": "Segmentation allocates fixed size blocks of memory.", "pag_fixed": "Paging allocates fixed size blocks of memory.", "seg_internal": "Segmentation is prone to internal fragmentation.", "pag_internal": "Paging is prone to internal fragmentation.", "seg_external": "Segmentation is prone to external fragmentation.", "pag_external": "Paging is prone to external fragmentation." } }, "q2": { "type": "multiple", "question": "\n\n\nWhich of the following statements regarding swapping and page\nreplacement are true (select all that apply)?\n\n\n", "responses": { "pagefault": "If a page is not present in physical memory, then the hardware triggers a page fault.", "segfault": "If a page is not present in physical memory, then the hardware triggers a segfault.", "oom_evict": "If there are no free frames in physical memory, then the OS evicts one to disk.", "oom_crash": "If there are no free frames in physical memory, then the OS crashes.", "replace_mru": "During page replacement, we generally want to select the most recently used page.", "replace_lru": "During page replacement, we generally want to select the least recently used page.", "clock_lru": "The clock algorithm is an approximation of the LRU strategy.", "clock_used": "The clock algorithm involves checking and clearing the used bit of each PTE." } }, "q3": { "type": "blank", "question": "\n\n\nGiven a virtual memory system with the following properties:\n\n\n\n

    \n\n
  1. 14-bit Virtual Address
  2. \n
  3. 16-bit Physical Address
  4. \n
  5. 64 byte Pages
  6. \n
  7. 4 bytes per PTE and PDE
  8. \n\n

\n\n

Sketch all the data structures needed to support a multi-level paged\nvirtual memory system by filling in the table below. When appropriate, you\nwrite the solution as a power of 2 (ie. 2^14) or simplify\nthe number in terms of K, M, G, or T units (ie. 16K).

\n\n

Pages

\n\n

\n

    \n
  1. Number of addressable bytes: ____
  2. \n
  3. Number of Pages in Address Space: ____
  4. \n
  5. Number of VPN bits in Virtual Address: ____
  6. \n
  7. Number of Offset bits in Virtual Address: ____
  8. \n
\n

\n\n

Page Table

\n\n

\n

    \n
  1. Number of PTEs: ____
  2. \n
  3. Number of bytes for just Page Table: ____
  4. \n
  5. Number of Pages for just Page Table: ____
  6. \n
\n

\n\n

Page Directory

\n\n

\n

    \n
  1. Number of PDEs: ____
  2. \n
  3. Number of PDI bits in VPN: ____
  4. \n
  5. Number of PTI bits in VPN: ____
  6. \n
  7. Number of bytes for just Page Directory: ____
  8. \n
  9. Number of Pages for just Page Directory: ____
  10. \n
\n

\n" } }