Homework #7

Assigned: April 17
Due: April 24, 3:00pm, in class


  1. (4+2=6 points) [OSCJ8] 8.11 on p. 388 (or exercise 8.3 on p. 342 of the 7th ed). Given five fixed memory parititons of 100k, 500k, 200k, 300k, and 600k (in order), how would each of the first-fit, best-fit, and worst-fit algorithms place processes of (p1) 212k, (p2) 417k, (p3) 112k, and (p4) 426k (in order)? Which algorithm makes the most efficient use of memory?

  2. (2+2+2=6 points) [OSCJ8] exercise 8.13 on pp. 388-389 (or exercise 8.5 on p. 343 of the 7th ed). Compare the main memory organization schemes of contiguous-memory allocation, pure paging, and pure segmentation with respect to the following issues:

    • external fragmentation
    • internal fragmentation
    • ability to share code across processes

  3. (1+2+2=5 points) [OSCJ8] exercise 8.16 on p. 389 (or exercise 8.8 on p. 343 of the 7th ed). Program binaries in many systems are typically structured as depicted in this diagram which we have shown and discussed often in class. Code is stored starting with a small fixed virtual address such as 0. The code segment is followed by the data segment which is used for storing the program variables. When the program starts executing, the stack is allocated at the other end of the virtual address space and is allowed to grow today the lower virtual addresses. What is the significance of the above structure on the following memory management schemes:

    1. contiguous-memory allocation
    2. pure paging
    3. pure segmentation

  4. (2+3=5 points) [OSCJ8] exercise 8.20 on pp. 389-390 (or exercise 8.9 on p. 343 of the 7th ed). Consider a paging system with the page table stored in main memory.

    1. If a memory reference takes 200 ns, how long does a paged memory reference take?
    2. If we add a TLB, and 75% of all page-table references are found in the TLB, what is the effective memory reference time? You may assume that finding a page-table entry in the TLB takes zero time if the entry is present (an unrealistic assumption).

  5. (2+2+2+2+2=10 points) [OSCJ8] exercise 8.23 on p. 390 (or exercise 8.12 on p. 344 of the 7th ed). 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?

    1. 0,430
    2. 1,10
    3. 2,500
    4. 3,400
    5. 4,112


Return Home