Homework 6

CS 311

30 pts., due Apr. 18

Each problem is worth eight points. A reminder: Show work.

  1. Consider a system with 4200 words of main memory using variable partitions. At some time, the memory is occupied by three blocks of code/data as follows:

    Starting Length
    Address in Words
    1000 1000
    2900 500
    3400 800

    Assume that three new blocks with sizes 500, 1200, and 200 (all sizes in words) are to be loaded in the order listed. For the best-fit and worst-fit placement strategies, show the memory contents after all three blocks have been loaded and the total time for loads/moves. If the placement strategy fails to find a hole for a block, then compact blocks toward address 0, starting with the block closest to address 0 and stopping once enough space has been created to place the new block. Assume that it takes 1 microsecond to load/move a word.

  2. Below is the listing of a short assembly language program for a computer with 512-byte pages. The program is located at address 1020 (all addresses are decimal), and its stack pointer is at 8192 (the stack grows toward 0). Give the page reference string (i.e., the list of page references) generated by this program. Each instruction occupies 4 bytes (1 word), and both instruction and data references count in the reference string.
    load word 6144 into register 0
    push register 0 onto the stack
    call a procedure at 5120, pushing the return address onto the stack
    subtract the immediate constant 16 from the stack pointer
    compare the actual parameter to the immediate constant 4
    jump if equal to 5152
    
    You'll need to make appropriate, valid assumptions. Don't forget to state them.

  3. Consider the Intel address translation scheme shown in this figure:

    \includegraphics[width=6in]{Figures/x86MemMapping.eps}

    1. Describe all the steps taken by the Intel x86 in translating a logical address to a physical address.

    2. What are the advantages to the operating system of hardware that provides such complicated memory translation hardware?

    3. Are there any disadvantages to this address translation system? Explain.

  4. A group of operating system designers for the Gigasloth Computing Company are thinking about ways of reducing the amount of swap space needed in their new, disk-hungry operating system: Tiptoes 00. The head guru has just suggested not bothering to save the text segment in the swap file at all, but just swap it in directly from the binary image whenever necessary. Discuss the advantages and disadvantages of this approach.



Thomas P. Kelliher 2012-04-10
Tom Kelliher