Tutorial Week 2

Questions

Computer Architecture

Q1: What are some of the differences between a processor running in privileged mode (also called kernel mode) and user mode? Why are the two modes needed?

Q2: 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?

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

Q4: 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.

Q5: Cache memory is divided into (and loaded in) blocks (also called cache lines). Why divide the cache into cache lines? What might limit the size of a line? You can ignore implementation issues of the cache itself.

Operating System Intro

Q6: What are the two main responsibilities or identifying features of an Operating System?

Q7: Which of the following instructions (or instruction sequences) should only be allowed in kernel mode?

  1. Disable all interrupts.
  2. Read the time of day clock.
  3. Set the time of day clock.
  4. Change the memory map.
  5. Write to the hard disk controller register.
  6. Trigger the write all buffered blocks associated with a file back to disk (fsync).

Q8: On UNIX, which of the following are considered system calls? Why?

  1. read()
  2. printf()
  3. memcpy()
  4. open()
  5. strncpy()

General Questions

Q9: 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.