Return to the Homework #1 Index

Homework #1 Grading, Solutions, and General Comments

Index

Statistics
General Comments
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7

"Lies, Damn Lies, and Statistics"

  Overall (100 points):
    Mean:      75.80
    Median:    81
    Std. Dev:  20.37

  Question 1 (5 points):
    Mean:      4.08
    Median:    4
    Std. Dev:  0.96

  Question 2 (5 points)
    Mean:      4.52
    Median:    5
    Std. Dev:  0.90

  Question 3 (20 points)
    Mean:      16.80
    Median:    18
    Std. Dev:  3.89

  Question 4 (15 points)
    Mean:      13.18
    Median:    18
    Std. Dev:  3.89

  Question 5 (15 points)
    Mean:      8.05
    Median:    9
    Std. Dev:  3.96
 
  Question 6 (20 points)
    Mean:      19.03
    Median:    20
    Std. Dev:  3.20

  Question 7 (20 points)
    Mean:      13.34
    Median:    15
    Std. Dev:  6.74

General Comments

Question 1

Answers varied, but the following were important characteristics to mention. In most cases, incorrect or missing characteristics cost 1 point each. Traditional Interrupt-based I/O

DMA-based I/O

Question 2

The three mechanisms include interrupts, traps, and exceptions. Full credit was given for answers that described these mechanisms and specifically mentioned at least two of the three. A few words also needed to be said about privileged instructions, and "kernel vs. system mode" (by any name).

Any errors or omissions cost 1-2 points each.

Question 3

Answers varied with assumptions. Plenty of variety was accepted. If required or unusual assumptions weren't stated and we could figure them out, we typically took off only a point or two. Other errors typically cost 2 points each, up to a total of 6 points for each part.

Question 4

Each part was weighted equally at three points.

DMA-based network transfers do not allocate or free any PCBs. The default behavior is typically not to block, but we accepted answers either way.

Execve() does not allocate or free any PCBs. The old PCB is recycled. It typically will move to a wait queue while the process is read from disk and is moved back once this is done.

An exit call removes a process from the runnable queue. It typically frees the resources, except the PCB, and places the PCB into a terminated queue until a wait_() reads the status and frees the PCB. Other answers were accepted, as long as the answer here or under wait mentioned handling process exit status. Many modern OSs free the PCB, but keep the smaller amount of process status information around until it is collected by wait_().

fork() creates a PCB. It places one or both processes into the runnable queue. One process might continue running (but not both).

By default, waitpid() blocks until the child information can be collected. It can be used in a non-blocking mode, so if this was explicitly assumed, a non-blocking answer was accepted. Either here or in exit() the PCB needed to be freed. If it was freed in exit, a few words needed to be said about the exit status information of the child.

Question 5

A complete answer to this question addressed 4 issues:

Grading information:

Question 6

The time to service an interrupt is 10 us (for saving and restoring the CPU) + 80 us (for copying the packet from the interface) = 90 us.

(100 us is considered a valid interpretation and gets full credit).

The number of packets received per second is: (5*220 b/s) / ((1024 B/packet) * (8 b/B)) = 640 packets/sec.

(either binary or decimal representation of MB and KB are OK here)

So, the amount of time spent servicing interrupts in 1 second is:

(90 us/packet * 640 packets/s) / 106 us/s = 0.0576 s.

which comes out to a 5.76% overhead.

Grading information:

Question 7

This code trivially reduces to Peterson's Algorithm. Correct solutions either stated this fact and cited the classroom discussion, or provided a proof similar to the proof of Peterson's Algorithm.