Tutorial Week 3


MIPS R3000 Questions

Q1: What is a branch delay?

Q2: What is the EPC register? What is it used for?

Q3: The R3000 divided the address space into 4 regions. Which regions are accessible in what mode? Why is kuseg accessible to the kernel? Why is the cache bypassed when accessing kseg1?

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

General Questions

Q5: A computer has a pipeline with 4 stages. Each stage takes the same time to do its work, namely, 1 nsec. How many instructions per second can this machine execute?

Q6: Compute the effective access time of the following memory hierarchy. The first level consists of accessing an entire disk block cached in main memory. It takes 10 microseconds to copy the disk block from the main memory block cache to the application. The second level of the hierarchy is the hard disk itself which takes 4 milliseconds on average to locate a block on disk and copy it to the main memory block cache. Assume a hit rate of 90% in the disk block cache.

System Calls

Q7: Why must kernel programmers be especially careful when implementing system calls?

Q8: Why is recursion or large arrays of local variables avoided by kernel programmers?

Q9: How does the 'C' function calling convention relate to the system call interface between the application and the kernel? At minimum, what additional information is required beyond that passed to the system-call wrapper function?

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

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