Answer all questions. You should note that although question 5 is by far the most time consuming question, it has a point value roughly equal to questions 2, 3 and 4, and far less than question 1. In other words, save it for last.
Part G: I am going to dedicate an entire disk partition to a very large software package that I have purchased. It will be heavily used. Which block allocation scheme is ideal for my partition? (1-5 words).
Question 2: (9 points): Describe RAID-0, RAID-1 and RAID-4, both in words and with pictures. In each, briefly detail the performance of large writes and the tolerance to failures.
If PTEs are four bytes and pages are 512 bytes, answer the following questions:
Question 5: (10 points) You are co-writing an operating system with a collection of colleagues. You are responsible for the scheduling algorithm. You are to implement the following four procedures:
Make the following assumptions:
typedef struct dllist { struct dllist *flink; struct dllist *blink; Jval val; } *Dllist; extern Dllist new_dllist(); extern void free_dllist(Dllist); extern void dll_append(Dllist, Jval); extern void dll_prepend(Dllist, Jval); extern void dll_delete_node(Dllist); extern int dll_empty(Dllist); |
typedef struct jrb_node { struct jrb_node *flink; struct jrb_node *blink; Jval key; Jval val; } *JRB; extern JRB make_jrb(); extern JRB jrb_insert_str(JRB tree, char *key, Jval val); extern JRB jrb_insert_int(JRB tree, int ikey, Jval val); extern JRB jrb_insert_dbl(JRB tree, double dkey, Jval val); extern JRB jrb_find_str(JRB root, char *key); extern JRB jrb_find_int(JRB root, int ikey); extern JRB jrb_find_dbl(JRB root, double dkey); extern JRB jrb_find_gte_str(JRB root, char *key, int *found); extern JRB jrb_find_gte_int(JRB root, int ikey, int *found); extern JRB jrb_find_gte_dbl(JRB root, double dkey, int *found); extern void jrb_delete_node(JRB node); extern void jrb_free_tree(JRB root); |