COS431 Prelim 1 Study Guide
Exam Date: October 11, 2002
University of Maine Department of Computer Science
Prelim Time: 50 minutes
Remember: You are allowed 1 3x5 index card of notes.
OS Definition :
Describe the major function of an operating system, both from the viewpoint
of the user and the viewpoint of the hardware.
Tips: Recall that an OS interface, like any other ABSTRACTION, serves a
dual purpose. It provides a straightforward model for the application writer
to express a task, and it hides the underlying complexity of the hardware.
Operating System Structure:
The UNIX system interface consists of system calls grouped into a number
of specific categories. Briefly describe each category, giving an example
of a specific system call in each category. In general, you should know
the purpose of each of the Unix system calls discussed in the book and
in class, and you should be prepared to describe in detail how they are
used under C program control. Obviously I will emphasize the details of
the system calls experimented with in the first project.
Explain why it is important to understand about pointers, addressing, and
storage management in C/C++ in order to properly use the Unix system interface.
Hint: system and library call are defined within the context of C/C++.
Describe the purpose of the fork system call, and sketch a skeleton implementation
of how it is used together with the exec, exit, and wait system calls in
a typical shell command interpretor.
Explain why the fork system call is a difficult concept to grasp for someone
coming strictly from COS220 and COS221. Hint: This relates to the difference
between a process and a program.
It is said that the problem with writing a multi-process system is primarily
one of synchronization and timing. Based on your experience with part 1
of project 1, justify such a statement.
Although the Unix system interface purports to provide the abstraction
of processes running in parallel, application programmers using processes
and forking DO have to be aware of how processes are implemented in order
to avoid usage ``problems''. Discuss. (This is a tricky one. Think about
all of the problems you had in implementing, testing, and debugging your
It is said that signals are analogous to interrupts. Explain.
Why is it a simple matter to run a Unix process in "the background"?
Interrupt Handling, and Process Implementation:
In a monolithic system, describe the typical steps in processing a system
Describe the philosophy behind the construction of an operating system
What is the role of the virtual machine monitor in VM/370?
Describe the philosophy behind the use of the client-server model in the
design of an OS.
Why is it a "straightforward" matter to port a centralized client-server
architecture to a distributed system? For example, why is it a straightforward
task to move a local file system server process to a remote site?
What is the role of the shell in Unix? That is, what types of services
does it provide to the user that the lower Unix system interface doesn't?
Explain how the methods we used in designing the pipelined sorter result
in a clean separation of ``scaffolding'' from formatter ``mechanism''.
How did this separation facilitate debugging?
How do software processes communicate with the kernel? How is this communication
hidden from the user process, and why is it hidden. Think about the fact
that although user processes communicate with the kernel every time they
do a send or receive, they really don't want to know that the kernel exists.
From the point at which the hardware fields an interrupt, describe the
steps taken for the kernel to process the interrupt. What is really the
``problem'' here? (Hint: It sounds strange to say that the processor is
used to save the state of the processor.)
Continuing the previous bullet, the first step in processing an interrupt
is to save the interrupted processes state. Why is that a tricky task on
the x88 architecture? How may more advanced architectures simplify this
process? In general, what do you think needs to be discussed between a
hardware and software designer before the hardware/operating system is
Why is it useful do some of the kernel interrupt handling work in assembler
and some in a high-level language such as C?
How has your perspective of parallel systems changed by studying the ``magic''
of multi-process implementation? Do you think differently now about parallel
programs? This is a very open-ended question. I add it here not necessarily
because there will be a test question like this, but because thinking about
this forces you to think about many of the implementation issues you had
to deal with in project 1.
Describe how the kernel maintains the illusion of multiple sequential processes
on a machine with one CPU and many I/O devices.
The BRAIN02 Interpretor:
What is the difference between a process and a program? What does Tanenbaum
mean when he says that "a process is a program in execution"? What type
of information needs to be "kept track of" in a process state?
Describe the states that a process can be in at any one time, and the means
by which a process can transition from one state to another.
How is message passing implemented in the kernel? How does message passing
implementation differ between two processes sending/receiving a message,
and a process receiving a message originating from the kernel (from, for
example, the completion of a disk I/O operation by a disk controller)?
Describe typical data structures that might be used to implement the process
table, ready lists, and blocked lists.
In class I said that a process is always on some list in the process table.
What lists are these, how might a process transition from one list to another,
and how do these transitions relate to the different states a process can
be in at any one time?
The send and receive typically are "blocking" commands, in that a process
doing the sending/receiving is blocked until a corresponding process sends/receives
the message. Suppose we wanted to provide a "non-blocking" send. That is,
suppose we wanted to allow a process to send a message, but not wait around
until the other process receives it. What are the ramifications of this?
That is, how do the implementation data structures and algorithms change?
What about the number of sends that one process can do before a process
receives any of the messages?
Describe the BRAIN02 virtual machine in detail.
Write a simple program to read and print 10 input data lines, and another
program to sum and print 1 + 2 + 3 + ...+ 10.
Why are we implementing BRAIN02?
How does a multi-process kernel using BRAIN02 differ from a multi-process
kernel in Minix? Hint: What is "the problem" in implementing Minix context
Tips: When you are asked to describe steps, don't just list them,
but don't write ``War and Peace'' either. Pictures are worth a thousand
words. Make liberal use of them, but be sure to carefully annotate them
with English comments. Answers to all three questions above can be enhanced
with such sketches. Also, I obviously am not expecting you to memorize
code, but you should be familiar enough with code examples that you are
able to properly extract the essence of their ``trickiness''.
Last Updated: 10/11/2002