George Mason University
DEPARTMENT OF COMPUTER SCIENCE

CS571 Operating Systems Fall 2001

Assignment A1 (10 points)

Due 9/4/01




Before doing these problems, read Part One of Operating System Concepts (OSC Preface and Chs 1-3). (Alternatively, you can read Preface and Ch 1 of Tannenbaum, Modern Operating Systems, 2nd edition.) Also read the introduction part of the CS encyclopedia article and skim the remainder. Discuss all parts of this problem with your study partners. Write your own individual report. Acknowledge all sources.

NOTE: Prepare your report with a word processor using a 2" wide right margin to allow for grading.

ALSO NOTE: Explain or justify your answers. A simple "yes" or "no" does not reveal whether you understand or whether you merely guessed right.


(1) One of the two main purposes of an OS is to "manage resources". Write a paragraph on the meaning of "resource" in operating systems. Consider aspects such as resource types and units, resource requests and releases, whether or not one may have to wait after making a request, exclusive use of a resource after it is allocated, and whether the resource is consumed or is available for reuse.

(2) An expectation of an OS is that it will isolate individual jobs executing together on the same machine so that, aside from messages that jobs explicitly exchange, no job can interfere with another or read any data belonging to another. What steps do operating systems take to assure this property?

(3) A CPU's instruction set contains some instructions that are sensitive because they can alter the execution environment of jobs other than the one executing the instruction. Give three examples of sensitive instructions and explain why they are sensitive.

(4) CPUs contain a register indicating a privileged mode (usually called supervisor mode or kernel mode). What is the purpose of privileged mode? What is the relationship between privileged mode and sensitive instructions?

(5) Describe a method whereby a program can gain entry to the supervisor state and exit it. Is your method secure?

(6) The concept of process was created in the early 1960s to help design multiprogrammed and time-sharing systems. Early writers described processes as "threads of execution in an instruction sequence." But the Multics and Unix implementations were complex, more like self-contained virtual machines running application programs than "threads". In the 1980s some OSs introduced the "thread", a reincarnation of processes as envisioned in 1960. Modern OSs accommodate multiple processes each containing multiple threads. Write a paragraph giving clear distinctions between processes and threads, and clear guidelines to programmers on when they should use each concept.

(7) Our layer-structure map has threads at a lower level than processes. Why aren't these the same level?

(8) The layer structure of OS functions assumes that software of a given layer can be programmed using only the functions defined at lower-numbered layers (but not any function of a higher-numbered layer). What is the advantage of this for programming the OS and testing it?

(9) Shared memory and messages are two ways for processes to exchange data. Describe the two methods. What are advantages of each?

(10) Using the example of automatic teller machines (ATM), demonstrate how a race condition might arise and what damage it can do to the bank accounts of individual clients. (Limit 1/2 page.)