Clarified wording in design question A2 for vm
[pintos-anon] / ta-advice / hw2.txt
1 HW2 DESIGN SUMMARY
2 ==================
3
4 OVERALL
5
6   DOCUMENTATION
7     -20 Egregious violation of style versus design document example
8     -10 Numerous excessively long lines (> 79 characters)
9     -10 Numerous capitalization, punctuation, spelling, or grammar errors
10
11   DESIGN
12     -10 Failure to check return value of malloc()
13     -10 Use of ASSERT to check something that can actually fail, e.g. malloc()
14     -10 Fails to free all resources during normal execution [specify where]
15      -5 Fails to free all resources when handling errors [specify where]
16
17   CODING STYLE
18     -10 Inconsistent or bad coding style: no indentation, cramming
19         many statements into one line, other issues at TA's discretion
20     -10 Numerous very long source code lines (> 100 characters)
21     -10 Commented-out or #if'd out code makes real code hard to read
22     -10 Many missing comments on structure, structure members, 
23         global or static variables, or function definitions
24     -10 Function(s) should be decomposed for clarity [indicate function]
25     -10 Cut-and-pasted code should be made into function [indicate where]
26     -10 Uninformative or deceptive identifiers
27     
28 Total deductions (capped at -40): XXX
29
30 PROBLEM 1: ARGUMENT PASSING
31
32   DOCUMENTATION
33     -20 Grossly inaccurate: documentation has no resemblance to code
34     -10 Important inaccuracies: documentation and code differ significantly
35         [indicate how]
36      -5 Minor inaccuracies: documentation and code differ [indicate how]
37      -5 A1: Missing entirely/missing comments or purpose/too long
38     -10 A2: Missing/non-responsive/too long/too short
39     -10 A3: Missing/non-responsive/too long/too short
40     -10 A3: Claims that strtok_r() does not modify the string it parses
41      -0 A3: Claims that strtok() uses a static buffer for parsing
42     -10 A4: Missing/non-responsive/too long/too short
43      -5 A4: Claims time or space advantage for user-space parsing
44      -5 A4: Claims that the shell implements relative paths
45      -5 A4: Claims that user space parsing reduces context switches
46      -5 A4: Claims that the shell enforces security policy
47  
48   DESIGN
49     -30 Not implemented
50     -10 Uses global variables, locks, etc.
51     -15 Doesn't check for stack overflow
52      -5 Stack overflow checking incomplete/buggy
53     -10 Assumes any command line under N bytes long will fit in a page
54         [change N to the value assumed, where N >= 1,366]
55     -10 Assumes that the command line is capped at 128 bytes
56      -1 Assumes that individual strings must be word-aligned for performance
57     -10 Argument passing code is difficult to read or poorly abstracted
58     -10 Uses buffer on stack to copy command, possibly overflowing the
59         kernel stack
60     -10 Uses buffer on stack to hold pointers to each argument, possibly
61         overflowing the kernel stack
62     
63 Total deductions (capped at -30): XXX
64
65 PROBLEM 2: SYSTEM CALLS
66
67   DOCUMENTATION
68     -40 Grossly inaccurate: documentation has no resemblance to code
69     -20 Important inaccuracies: documentation and code differ significantly
70         [indicate how]
71     -10 Minor inaccuracies: documentation and code differ [indicate how]
72     -10 B1: Missing entirely/missing comments or purpose/too long
73      -1 B1: Omitted global file system synchronization
74      -3 B1: Omitted data for tracking file descriptors
75      -3 B1: Omitted data for "wait" system call
76      -3 B1: Omitted data for "exec" to wait for process loading to complete
77      -6 B2: Missing/non-responsive/too long/too short
78      -0 B2: Claims that Pintos has stderr file descriptor
79      -6 B3: Missing/non-responsive/too long/too short
80      -3 B3: Claims that struct intr_frame's eax member is on user stack
81      -6 B4: Missing/non-responsive/too long/too short
82      -6 B4: Inspects page table for every byte accessed
83      -6 B4: Inspects page table for each N-byte block (N <= 1,024)
84      -6 B4: Can miss inspection for some pages in a block
85      -6 B4: Claims that each byte in 4 kB can be on separate page
86      -6 B4: Wrong answer for "ideal" case
87     -12 B5+B8: Missing/non-responsive/too long/too short
88      -3 B5+B8: "wait" or "exit" disables interrupts
89      -3 B5+B8: "wait" or "exit" calls thread_block() (use semaphores instead)
90      -3 B5+B8: "wait" or "exit" uses global lock or semaphore
91      -3 B5+B8: "wait" always returns -1 if child has already exited
92      -3 B5+B8: "wait" or "exit" searches a global list of all processes
93      -6 B5+B8: "wait" or "exit" has race condition [which]
94      -3 B5+B8: each additional, independent race condition for exec/wait/exit.
95         (e.g. unsynchronized global list access vs. race in setting return
96         values vs. race for cleanup of shared state)
97      -6 B6: Missing/non-responsive/too long/too short
98      -6 B7: Missing/non-responsive/too long/too short
99      -3 B7: Calls thread_block() directly (use semaphores instead)
100      -3 B7: Success flag in child struct thread needs too much synchronization
101      -6 B9: Missing/non-responsive/too long/too short
102      -6 B10: Missing/non-responsive/too long/too short
103      -6 B11: Missing/non-responsive/too long/too short
104      -6 B11: Claims that Pintos supports multi-threaded processes
105
106   DESIGN
107     -60 Not implemented
108      -5 Global counter for file descriptors lacks synchronization
109     -10 Global table of file descriptors lacks synchronization
110      -5 Global table of file descriptors has synchronization bugs
111     -10 No external synchronization in handling filesystem calls.
112      -5 Global table allows multiple processes to access same file descriptor
113      -5 Added big array (>= 512 bytes) to struct thread without justifying
114     -10 Added big array (>= 1024 bytes) to struct thread
115      -5 Superfluous locking on per-thread data structure [which]
116     -10 System call handler is poorly abstracted or unreadable
117      -5 Failed to update comment on process_wait() function after implementing
118      -5 "open" system call fails to release all resources in error cases
119     -10 strlen before (in the call to) validate a null terminated string
120      
121 Total deductions (capped at -60): XXX
122
123 Total score (100 - deductions): YYY