Computer Organization I, Spring 2011, Exercise 5

You are expected to (try to) solve the problems on your own or with your study team before the meeting.

The problems are (partially) covered in Book. Book Chapters 6, 7 and 8 should cover the content. They are slightly too detailed.

The team task is now defined (at least in Finnish).

Problems:

  1. Assume that there is an operating system for TTK-91. One part of that OS is the process control.  Assume further that due to a timer clock interrupt we need to switch the process that runs on the processor.
    1. How and where are the data for the process earlier in execution stored? Which data must be stored (e.g., SP, IR, MAR, MBR, TR, etc.)?
    2. How and from where does one find the data for the new process? Where is the first instruction for the new process? How is the processor turn actually given to the new process?
    3. What is the processor state (user, priviledged) from the time just before the clock interrupt until the execution of the first instruction of the new process?
  2. Process states. In Lesson 8 [Stal06, Ch 8.2] we introduced the process life time model, which included five model states. Give two clearly different examples to each situation given below. Mention also, who (which process) caused the state transition and what happens in the operating system data structures during the transition.
    1. Process P moves from "New" state to "Blocked" state.
    2. Prosess P moves from "Running" state to "Blocked" state.
    3. Prosess P moves from "Ready" state to "Running" state.
    4. Prosess P moves from "Running" state to "Ready" state.
    5. Prosess P moves to "Exit" state.
  3. Memory mapped I/O. In the example driver.k91 there is a device driver implemented with direct I/O.
    1. How does the device driver know that the device has printed the given number?
    2. What does the device driver do while the device is printing the number? How long can this take?
    3. How does the device (device controller) tell the device driver that the given task is done? 
    4. Hoe does the application program (that called the device driver) know when the task given to the device is done?
    5. How should one modify the device driver, if one wanted to use indirect I/O instead? The purpose is not to give a precise answer, but just the general ideas on what needs to be changed in the driver in case indirect I/O was used.
      What is good/bad with this change? Are there any changes to the specifications for the device (device controller) because of this change.
  4. Assume that a disk spins with speed 7200 rpm, it has one read/write head per surface, there are 2000 cylinders (tracks per surface), each track has 50 sectors, and sector size is 0.5 KB. Assume (unrealistically), that seek time (head transfer time) is linear to the number of tracks passed, and that it is 0.02 ms/track. Assume (unrealistically), that the location of each sector for one file is random, and from this one can deduce (with probability theory) that the average number of tracks passed is 667. Assume further (unrealistically), that the file is read from the disk one sector at a time.How long does it take, in average, to read one 333.33 KB file? What about 24 MB file?
  5. Do level D TitoTrainer problems d-210, d-220, d-350 and d-400.

  6. (If you want, you may do all other level d TitoTrainer problems)


Tiina.Niklander@cs.helsinki.fi