90 likes | 289 Views
Ecs150 Spring 2013 final. Name: Student ID: Email:. Open book and totally 8 questions (4% each, you need to answer all 8 questions), 8 pages.
E N D
Ecs150 Spring 2013 final Name: Student ID: Email: Open book and totally 8 questions (4% each, you need to answer all 8 questions), 8 pages. Please write precise and clean answers. But, please do not leave it blank there as I will give partial credits. Please READ the questions VERY CAREFULLY before putting down the final answer. And, also please mark your answer clearly. You can use the back of the pages. Every page of this exam book needs to be returned back. If we suspect any cheating behavior, we will pass the case to the academic committee immediately. Score: ___/32 ecs150 fall 2011, final
Q-01 (V-node and snoopfs, 4%) In running Homework assignment #4, we need to mount snoopfs using the following command line: # /root/snoopfs/mount_snoopfs –t snoopfs /usr/download /root/mnt If I want to download a MP3 file and to listen the MP3 music simultaneously, then under which directory path I should save the Bit Torrent content, and under which directory path I should let my MP3 player to open the MP3 file? Please explain the reason for your answers here. ecs150 fall 2007, FINAL exam
Q-02 (strcpy, 4%) What is the logical error with the following implementation of strcpy? This is a question under the ecs30 context and it appears in job interviews a lot. char *strcpy(char *dst, const char *src){ char *ptr; ptr = dst; while(*src != ‘\0’) { *dst = *src; dst++; src++; } return(ptr);} Please check/run the following two cases and then provide your answer. unsigned char s1[999] = "0123456789";unsigned char s2[999] = "0123456789";printf(“s1 = %s\n”, strcpy(s1+2, s1+4)); printf(“s2 = %s\n”, strcpy(s2+4, s2+2)); ecs150 fall 2007, FINAL exam
Q-03 (Soft Update, FSCK, Background FSCK, Snapshot, 4%) Under Soft Update, TWO critical consistency properties of our File system are guaranteed. Please write down these two properties and what scenarios these two properties are trying to prevent. ecs150 fall 2011, final
Q-04 (Soft Update, FSCK, Background FSCK, Snapshot, 4%) Following Question #3, if these TWO properties were violated for some unknown reasons, can we still run the task of Background FSCK (File System Checker) on a snapshot, and use the file system immediately (I.e., before the Background FSCK finishes)? If your answer here is YES, please explain how these two violated properties can be recovered. If your answer is NO here, please explain the details regarding the danger of using the File system immediately. ecs150 fall 2011, final
Q-05 * (On-demand Paging, 4%) Please complete the following diagrams for FIFO, LRU, CLOCK, and Optimal. And, please remember to put down F in the circles if page faults occur. Access Reference String: 2 3 4 1 2 4 3 1 5 6 5 3 1 2 3 2 4 FIFO LRU CLOCK Optimal ecs150 fall 2011, final
Q-06 • (I-Node, 4%) What is the largest possible file that can be represented by an I-node for the following file system: • 1. UFS2 inode: 256 bytes per inode and the block pointer is 64 bits (or 8 bytes) • each disk block is 16K (214) bytes • di_size (the logical size of the file) is 8 bytes • Please describe also how you derive your final answer. (If you final answer is wrong but your procedure is somewhat correct, you will still receive partial credits.) ecs150 fall 2011, final
Q-07 (Mutual Exclusion, 4%) Please analyze the following two-processes mutual exclusion code segment (which implements a busy-waiting type of critical sections) and decide whether it is SAFE and/or DEADLOCK FREE? Please provide REASONS and/or COUNTER EXAMPLES to support your claim. No credit will be given if without any reasons and/or counter examples (EVEN IF your analysis answer is correct). Process 0 Process 1 …. ….. turn = 0; turn = 1; flag[0] = true; flag[1] = true; while (flag[1] && (turn = = 0)); while (flag[0] && (turn = = 1)); <critical section>; <critical section>; flag[0] = false; flag[1] = false; …. …... ecs150 fall 2011, final
Q-08 (Journaling versus Soft Update, 4%) Soft update and Journaling are two mechanisms for FreeBSD and Linux, respectively, to protect their meta-data. Which method is better in YOUR opinion, and please justify your choice. (** in order for you to receive the full points, you must provide valid reason(s), and provide some examples if appropriate. **) ecs150 fall 2011, final