CSE 120 Homework #1

Fall 2007

Out: 10/2
In: 10/9

  1. [Silberschatz] We have stressed the need for an operating system to make efficient use of the computer hardware. When is it appopriate for the operating system to forsake this principle and waste resources? Why is such a system not truly wasteful?

  2. [Silberschatz 1.13] When are caches useful? What problems do they solve? What problems do they cause? If a cache can be made as large as the device it is caching for (for example, a cache as large as a disk), why not do so and eliminate the device?

  3. [Silberschatz 1.11] Direct memory access is used for high-speed I/O devices in order to avoid increasing the CPU's execution load.
    1. How does the CPU interface with the device to coordinate the transfer?

    2. How does the CPU know when the memory operations are complete?

    3. The CPU is allowed to execute other programs while the DMA controller is transferring data. Does this process interfere with the execution of user programs? If so, describe what forms of intererence are caused.

  4. [Tanenbaum] Give one reason why a closed-source proprietary operating system like Windows should have better quality than an open-source operating system like Linux. Now give one reason why an open-source operating system like Linux should have better quality than a closed-source proprietary system like Windows.

  5. [Silberschatz 2.14] What is the main advantage for an operating system designer of using a virtual machine architecture? What is the main advantage for a user?

  6. A question on signals in Unix, which is a software abstraction of interrupts and traps. You may need to look at the man pages on signals to answer this question.
    1. Write a C program that goes into an infinite loop. When the user enters ^C three times, then the program terminates. The first two times that the user enters ^C, however, does not terminate the program. You will do this by writing a signal handler that catches the SIGINT signal, which is generated when a user types ^C. Your program should not be longer than 25 lines of C code. Turn in the listing of your code.

    2. The signal SIGKILL can't be caught with a signal handler. Why is it useful to have such a signal that cannot be caught?




marzullo@cs.ucsd.edu