Assignment 12, due Dec 5

Part of the homework for CS:2630, Fall 2019
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper in discussion section on Thursday. Some parts of assignments may be submitted on-line and completed in discussion section. Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!

  1. Recall that a trap handler has the following outline, given in more detail in Section 13.3 of the Hawk manual (but with one error):

    1. Save CPU state
    2. Handle trap (the error is in this part)
    3. Restore CPU state and return from trap

    This question deals with the middle segment, step 2 above.

    a) Suppose we wanted a trap handler to convert all undefined Hawk instructions to short (16-bit) no-op instructions. Give the shortest possible code to replace the code given in the hawk manual for step 2. (0.5 points)

    b) Give the smallest possible code that you could add to part a) above that makes all of the unimplemented instructions set the condition codes to the unlikely value 1100 (both negative and zero at the same time) before returning, while making no other changes to the PSW. (0.5 points)

    c) Find and correct the error in the code given in Section 13.3 of the Hawk manual. (0.5 points)

  2. Background: Look at the TLB entry format used by the Hawk, as documented toward the end of Chapter 14 of the Course Notes or in Section 1.3.5 of the Hawk Manual.

    a) Why is it necessary that it be possible to turn off cacheing for some particular page of memory? (Hint: The reason is related to exercise c in Chapter 14.) (0.5 points)

    b) For what range of addresses in the Hawk memory address space is it particularly likely that cacheing will be turned off? (Hint: This is a global question that integrates information from a wide range of different parts of this course.) (0.5 points)

  3. A problem: Look at the Hawk virtual address format. Suppose that each page table entry contained a 27-bit physical page number plus and the 5 flags (CRWXV) used in each HAWK TLB entry. How many bytes, total, will be occupied by the entire page table. (0.5 points)