Homework 3

CS 318

50 pts., due Apr. 20

  1. (15 pts.) 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:

    Assume that three new blocks with sizes 500, 1200, and 200 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. (15 pts.) 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 occupied 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. (10 pts.) Consider the Intel address translation scheme shown in Figure 8.28 in the text.
    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. (10 pts.) 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
Mon Apr 13 09:47:06 EDT 1998
Tom Kelliher