Midterm, CMSC 4000, Spring 2026
Name ______________________________________
- The weight for each question is given.
- Use as much paper as you wish, but make your answers are legible.
- Please label your answers with the question number.
- Please answer each question thoughtfully and carefully.
- Please staple this page on top of your answers.
- Answer should reflect the material presented in class.
- [2 points Each] Define the following
- Operating System
- Kernel
- Multiprogramming
- Multiprocessing
- Timesharing
- Processes
- [2 point] What is a process?
- [4 points] What is a context switch and when does it occur?
- [4 points] Describe the operation of the system call
fork - [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;
- Polling vs Interrupts
- [6 points] Describe how a program can use polling to retrieve data.
- [6 points] What is an interrupt and how are interrupts involved in I/O?
- [6 points] Describe the advantages of interrupt driven code over polling code.
- Timers
- [3 points] What is a hardware timer?
- [4 points] Name two uses for a hardware timer.