CS 307
Final exam
Ondich
Due 12:00 noon, Wednesday, June 5, 1996
You may use your textbook, your notes and programs, and any
publically accessible on-line resources while working on this
exam. You may not consult with other people, nor may you
consult books other than the textbook.
Please submit your test on paper, printed 2- or 4-up.
- (15 points) The Unix signal numbers 10 (SIGBUS) and 11 (SIGSEGV)
often get sent to the processes run by
beginning C programmers. Perhaps you have
even encountered a Bus Error or Segmentation Fault yourself
(though, no doubt, only while you were
helping a CS 127 student in the lab).
For this problem, describe the circumstances
in which Linux sends SIGBUS and SIGSEGV signals. To help
your exposition, you will probably want to include simple
C programs that cause the errors in question, and excerpts from
(or references to) relevant Linux source code. Don't forget
about grep.
- (10 points) Do problems 2 and 12 on pages 262-263 of Tanenbaum.
- (15 points) Write a "Hello, world" program on a Linux machine.
When you run your program, how many page faults occur,
and for which pages? (I want you to modify the kernel to report
this information so you will have actual observations rather
than guesses.)
Discuss the order in which the pages get referenced for
your program. Does the order make sense? What portions
of the program are causing the various page faults?
- (15 points) Write a description of what happens
when you type the name of a simple executable program in response
to a Unix prompt. Tell the story of the program from the moment
the shell receives your command line to the moment the shell prints
the prompt again (assume the program is running in the foreground).
Your story should discuss (briefly) the relevant file system, virtual
memory, and process control actions. This story could hundreds of
pages long. Keep it under two pages.
- Clean up your mess on the Linux machine you've been
using. Have a nice summer and beyond.