Midterm, CMSC 4000, Spring 2026

Name ______________________________________


  1. [2 points Each] Define the following
    1. Operating System
    2. Kernel
    3. Multiprogramming
    4. Multiprocessing
    5. Timesharing

  2. Processes
    1. [2 point] What is a process?
    2. [4 points] What is a context switch and when does it occur?
    3. [4 points] Describe the operation of the system call fork
    4. [5 points] Draw a diagram representing the following code. Label this diagram well, including each part which involves the kernel.
      
      if (fork()==0) {
          // code to perform some operation
          return 0;
      }
      wait(nullptr);
      return 0;

  3. Polling vs Interrupts
    1. [6 points] Describe how a program can use polling to retrieve data.
    2. [6 points] What is an interrupt and how are interrupts involved in I/O?
    3. [6 points] Describe the advantages of interrupt driven code over polling code.

  4. Timers
    1. [3 points] What is a hardware timer?
    2. [4 points] Name two uses for a hardware timer.