=========================preview======================
(COMP252)[2010](f)final~=ppa033^_66331.pdf
Back to COMP252 Login to download
======================================================
HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Fall 2010 COMP 252 Operating System Final Examination ANSWER December 15, 2010 Name: Student ID: Email: Lab Section Number:
Instructions:
1. The examination paper (13 pages) consists of 7 questions.
2. Write your name, student ID, email and lab section number on this page.
3. Please answer the questions in the spaces provided on the exam paper.
4. Please read each question very carefully before attempting to answer them.
5. Please answer each question clearly and to the point. Make sure that your answers are neatly written.
6. Keep all pages stapled together.
7. The examination period will last for 2 hours, 12:30 amC2:30 am
8. Stop writing immediately when the time is up.
Question
Percentage (%)
Scores
1
4
2
10
3
3
4
16
5
15
6
27
7
25
TOTAL
100
Question 1 The Monitor for Synchronization (4 points)
A. How does a monitor ensure the mutual exclusion? (1 point)
Answer: A monitor only allows one process to enter. Or the lock of a monitor ensure no more than one process enter the monitor.
B. How can a process inside a monitor go to sleep? Please be specific. (1 point)
Answer: When the process waits for a conditional variable or using x.wait()
C. Can another process enter the monitor after a process inside the monitor goes to sleep, why? (2 points)
Answer: Yes, the process will release the monitor (or the lock) before it goes to sleep Question 2 File System (10 points)
A. What is the main advantage of using an acyclic graph directory over a tree director? (1 point)
Answer, acyclic graph directory enables file and directory sharing.
B. A sample UNIX directory with the following permission: drwx--xrw-. How to interpret the given permission? (2 points)
Answer: rwx is the permission for owner -- x is the permission for group (same group as owner) rw- is the permission for public (everyone)
C. The following shows a contiguous allocation scheme for a file called "Sample1". Can you please illustrate how this file can be represented with an indexed allocation in the Graph 2 below, assuming the index block has 8 entries. (3 points)
D. Suppose the largest file in a Unix file system is represented by a triply indirect (index) block, each index block contains 512 block pointers. Suppose the size of a data block is 1KB. Please compute the maximum file size. (4 points)
Answer: 512 x 512 x 512 x 1KB = 128 GB Question 3 I/O System (3 points)
A. What is the main advantage for using DMA over programmable I/O? (1 point)
Answer: free up CPU
B. Who is responsible for the data transfer within a DMA (1 point)
Answer: DMA controller
C. Devices vary a great deal in different dimensions. Wha