Homework #7

Assigned: December 2
Due: December 9, 2:00pm, in class


  1. (2+3=5 points) [OSCJ] exercise 8.2 on p. 342. Consider the following process for generating binaries. A compiler is used to generate the object code for individual modules, and a linkage editor is used to combine multiple object modules into a single program executable. How does the linkage editor change the binding of instructions and data to memory addresses? What information needs to be passed from the compiler to the linkage editor to facilitate the memory binding tasks from the linkage editor?

  2. (4+2=6 points) [OSCJ] exercise 8.3 on p. 342. 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?

  3. (2+2+2=6 points) [OSCJ] exercise 8.5 on p. 343. 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

  4. (1+2+2=5 points) [OSCJ] exercise 8.8 on p. 343. Program binaries in many systems are typically structured as depicted in this diagram which we have 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

  5. (2+3=5 points) [OSCJ] exercise 8.9 on p. 343. 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).

  6. (1+1+1+1+1=5 points) [OSCJ] exercise 8.12 on p. 344. 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

  7. Return Home