Grading for Question 1 -- 10 points
There are three important activities that happen in this question. First,
the operating system detects the bad file descriptor on the
first write() call, and then deals with it.
Second, the operating system detects the bad pointer on the second
write() call, and then deals with it. Third, a segmentation
violation is generated and the program is terminated.
The way I graded this question was as follows:
- You started with zero points. If you mentioned the OS identifying
the first error, you got 4 points. If you mentioned the OS identifying
the second error, you got 4 more points, and if you mentioned the
segmentation violation (the correct one, not one at the second
write() statement) causing the premature termination of the process,
you got 2 more points.
- I took off a point if you said that either write() statment
terminated the program.
- I took off a point if you said that the write statements printed
anything out. This includes printing out "bad file descriptor".
The only way that this would get printed would be if the user's program
called perror().
- I took off a point if you didn't mention the operating system
returning -1 and setting errno (or the JOS equivalent of returning
-errno).
- I took off a point if you mentioned the segmentation violation, but
you didn't state that the operating system catches the hardware error
and terminates the program.
- The point of this question was to identify the points where the
OS catches program errors, and how it deals with them gracefully. If
you did mentioned the OS catching errors, you got an extra point
(unless you already had a perfect score).
Grade Histogram