Tutorial Week 5

Questions

    Kernel Entry and Exit

  1. What is the EPC register? What is it used for?

  2. What happens to the KUc and IEc bits in the STATUS register when an exception occurs? Why? How are they restored?

  3. What is the value of ExcCode in the Cause register immediately after a system call exception occurs?

  4. Why must kernel programmers be especially careful when implementing system calls?

  5. The following questions are focused on the case study of the system call convention used by OS/161 on the MIPS R3000 from the lecture slides.
    1. How does the 'C' function calling convention relate to the system call interface between the application and the kernel?
    2. What does the most work to preserve the compiler calling convention, the system call wrapper, or the OS/161 kernel.
    3. At minimum, what additional information is required beyond that passed to the system-call wrapper function?

  6. In the example given in lectures, the library function read invoked the read system call. Is it essential that both have the same name? If not, which name is important?

  7. To a programmer, a system call looks like any other call to a library function. Is it important that a programmer know which library function result in system calls? Under what circumstances and why?

  8. Describe a plausible sequence of activities that occur when a timer interrupt results in a context switch.


  9. Memory Hierarchy and Caching

  10. Describe the memory hierarchy. What types of memory appear in it? What are the characteristics of the memory as one moves through the hierarchy? How can do memory hierarchies provide both fast access times and large capacity?


  11. Given that disks can stream data quite fast (1 block in tens of microseconds), why are average access times for a block in milliseconds?


  12. You have a choice of buying a 3 Ghz processor with 512K cache, and a 2 GHz processor (of the same type) with a 3 MB cache for the same price. Assuming memory is the same speed in both machines and is much less than 2GHz (say 400MHz). Which would you purchase and why? Hint: You should consider what applications you expect to run on the machine.


  13. Files and file systems

  14. What permissions would you have on the following files:

    om:[/tmp]% ls -ld t* .
    drwxrwxrwt    6 root     root         4096 May 21 12:19 .
    -rw-rw----    1 nash     stud          216 May 18 18:59 t1
    -rw--w----    1 nash     stud          260 May 18 18:59 t2
    -rw-------    1 nash     stud          458 May 18 18:59 t3
    -rwsrwsr-x    1 nash     stud          138 May 21 12:19 t4
    -rwsrwxr-x    1 nash     stud          285 May 21 12:19 t5