Operating Systems - Exam #1

There are 100 possible points. Write all answers on the answer sheets provided.

  1. (4 pts) What is an operating system?

  2. (4 pts) List four responsibilities of an operating system (there are more than four).

  3. (3 pts each) Briefly define/explain these terms:
    1. fetch-execute cycle
    2. kernel
    3. thread
    4. quantum
    5. PCB

  4. (4 pts) Name the primary reason that cache's are used. Name at least one problem that arises from the use of a cache.

  5. (4 pts) What does DMA stand for? How does it improve the performance of a computer system?

  6. (6 pts) Draw a diagram showing the (three) possible states of a process in a multiprogramming system.
    1. (3 pts) Give a phrase or sentence describing each state in your diagram.
    2. (4 pts) For each transition (i.e., arrow) in your diagram, give one example of an event that could cause such a transition.

  7. (4 pts) Explain how selection of quantum size affects response time and throughput.

  8. (2 pts) What are the responsibilites of a high-level scheduler?

  9. (3 pts) Name two things a thread shares with its parent.

  10. (4 pts) To what does the term ``kernel mode'' refer?

  11. (8 pts) What is an interrupt? Name 3 kinds of interrupts and give an example of each.

  12. (4 pts) Explain why a plain round-robin scheduling algorithm might not be the best approach in a modern, multi-user, interactive, networked operating system.

  13. (3 pts) For what scenario in CPU scheduling does SJF (shortest job first) make sense?

  14. (16 pts) Use the space provided in the classes on this page and the next page to Write a complete Java program in which a parent process reads a list of integers from a text file named num.txt that is arranged with 1 number per line. For each number ($n$), the parent process should create a child who will in turn display its process id number and then return the value of $n^2$. The calculated result should be returned to the parent process which will in turn display the received value. The parent should not wait on any child until all the children have been created.
import java.util.Scanner;
import java.io.File;

public class exam1
{
  public static void main(String [] args) throws Exception
  {




























  }
}
class FunThread implements Runnable
{
  private Data data;
  public FunThread(Data d) { data= d; }
  public void run()
  {









  }
}


class Data
{
  public Data(int num) { n= num; }
  public int n,squared;
}