CS4320 (Principles of Operating Systems):
Homework 2

Assigned:
October 24, 2000.

Due:
October 31, 2000, by 5pm.

Credit:
30 points.

Reading

Be sure you have read chapters 8 and 9. (You can skim sections 8.7, 9.5, 9.6, 9.7, and 9.9.)

Problems

Turn in hardcopy answers (either handwritten or generated by your favorite word-processing or text-formatting program) to the following problems.

  1. (3 points)

    Consider a simple contiguous-allocation scheme for assigning memory to processes, as described in class and in section 8.4.2 of Silberschatz and Galvin. Suppose that as a result of previous activity memory contains the following. (To keep the notation simple, memory amounts will be in bytes and ridiculously small.)

    Locations Contents
    0 - 1999 Operating system
    2000 - 2999 Free
    3000 - 4999 Process A
    5000 - 5499 Free
    5500 - 6499 Process B
    6500 - 9499 Free
    9500 - 9999 Process C

    Now suppose we want to start a process requiring 400 bytes of memory. At what location will main memory be allocated for this process if we use

  2. (4 points) Exercise 8.8 from Silberschatz and Galvin. (Interpret ``word'' to mean the smallest addressable unit of memory.)

  3. (4 points) Exercise 8.9 from Silberschatz and Galvin.

  4. (4 points) Exercise 8.11 from Silberschatz and Galvin.

  5. (3 points) Suppose you have a system in which pages are of size 64K (65536) bytes and addresses (both logical and physical) are 18 bits, and suppose you have the following page table for a particular process.

    Page number Page frame number
    016 216
    116 316
    216 116
    316 invalid

    What are the physical addresses (in base 16) for each of the following logical (``program'') addresses?

  6. (4 points) Suppose you are designing a multiuser system that is to provide each process with a virtual address space of 231 bytes, and you would like to make it possible to have at least 16 users at a time. How much main memory do you need? (Or is this not a fixed number, and if not, why not?) How much secondary memory do you need? (Or is this not a fixed number, and if not, why not?)

  7. (4 points) For each of the following programming techniques and data structures, explain whether you think its use would or would not contribute to good program performance in a demand-paged environment and why.

  8. (4 points) Exercise 9.9 from Silberschatz and Galvin.