Operating Systems: HW 1

Due Friday September 24 at 5PM


Answer each of the following questions with a few sentences. If possible, submit your answers in txt or pdf format.

1. (10 points) What is a system call? What are the steps taken when an application makes a system call.

2. (15 points) State whether each of the following actions require the OS to use kernel mode or only user mode. If kernel mode is required, explain why.
a) Reading the current system time.
b) Exiting an application.
c) Multiplying two floating point numbers stored in an application's memory
d) Writing the results of the multiplication to a temporary log file on disk

3. (10 points) What is memory protection and why is it important? Would you still need memory protection in an operating system which only allowed one program to execute on top of the operating system at a time?

4. (10 points) Why do modern operating systems support context switches? What must the operating system do as part of a context switch?

5. (10 points) What is the difference between synchronous and asynchronous I/O? List an application which would require synchronous I/O and one that would benefit from asynchronous.

6. (10 points) Some hardware and OS features are required for system correctness, others are only used to improve performance. State which of the following features are for correctness and which are for performance.
(a) The cache layer in the memory hierarchy.
(b) The separation of user and kernel mode.
(c) Process synchronization.
(d) Asynchronous I/O.
(e) Multiprogramming (support for multiple simultaneous processes).

7. (10 points) Describe two different ways to structure an operating system (e.g. layered, microkernel, monolithic, etc). Compare the two approaches and provide one drawback and benefit of each.

8. (10 points) What are two ways for processes on the same computer to communicate with each other? What is a benefit and drawback of each?

9. (15 points) List out the process execution states that the OS would go through when running the following pseudo code:

  // Start of new program
  x=0;
  i=0;
  while(i<2) {
  	x+=i;
  	x=x*2;
  	print_to_screen(x);
  	write_to_file(x);
  	i++;
  }
  // end of program


Prashant Shenoy