CS307
Midterm
Ondich
Due 5:00 PM, Monday, June 5, 2000
While taking this exam, you may use books, computers, the Internet,
and your own brain. You may, in addition, ask Jeff Ondich
questions. Otherwise, don't talk to other people about the
content of the exam.
Have fun.
- (15 points) The UNIX signals SIGBUS and SIGSEGV often get sent to the
processes run by beginning C/C++ programmers. Perhaps you have
even encountered a Bus Error or Segmentation Fault yourself
(no doubt this was only while you were helping a CS127 student
in the lab).
Describe the circumstances under which Linux sends SIGBUS and
SIGSEGV signals to processes. You will probably want to include
simple C/C++ programs that cause the errors in question, and
possibly excerpts from (or references to) relevant Linux
source code.
- (15 points) I have placed the book PowerPC System Architecture,
Tom Shanley, Addison-Wesley 1995, on closed reserve in the
Math Skills Center (bottom shelf straight ahead as you walk
in the 2nd-floor door). You will probably want to consult
this book while working on this exercise. DO NOT REMOVE
THE BOOK FROM THE MATH SKILLS CENTER!
If I were you, I would start work on this problem as soon as
possible, to avoid a rush of people trying to read the book
all at the same time. You may, of course, check the Web for
relevant information, but I haven't found anything as good
as this book.
You may assume that you're working with a 32-bit (not 64) PowerPC.
- Which of the bits of the MSR (machine state register)
are relevant to address translation? How would you set these
bits if you wanted to have the MMU (memory management unit)
do address translation for instruction fetches but not for
data loads and stores?
- In PowerPC terminology, what are segments, pages, and blocks?
- What are the Segment registers, the DBAT registers, the
IBAT registers, and the SDR1 used for?
- In the page table entry format as shown on page 201, what are
the R and C bits used for?
- Does PowerPC paging use two-level, three-level, or some other
kind of page tables? Explain.
- What needs to happen to the PowerPC registers on a context switch?
- Briefly summarize the parts of the Linux source code that would
have to be added or changed to port the memory management
code to the PowerPC.
- (10 points) The Therac-25 incident is arguably the worst disaster in the
history of software.
You can learn all about it in
An Investigation of the Therac-25 Accidents, Nancy Leveson and Clark S.
Turner, IEEE Computer, Vol. 26, No. 7, July 1993, pp. 18-41.
(Here's
another link to the same paper.) If you wish, you may also look
for other information on Therac-25 in books or on the Web.
- What was the Therac-25?
- How many people were killed by the
Therac-25? How many were injured?
- Briefly list the design flaws in the Therac-25 that
caused the injuries and deaths.
- One of the design flaws involved a race condition. As best
you can from the information available to you, list the sequence
of events that were required to cause the race, and explain the
practical results of the race.
- (2 points, to be awarded in advance) Have a great summer
and beyond. Keep in touch.
Jeff Ondich,
Department of Mathematics and Computer Science,
Carleton College, Northfield, MN
55057,
(507) 646-4364,
jondich@carleton.edu