=========================preview======================
(COMP252)midterm01F_sol.pdf
Back to COMP252 Login to download
======================================================
COMP 252 Principles of Systems Software
Fall Semester 2001
Midterm Examination Solution
Date: November 3, 2001 (Saturday) Time: 15:00- 16:30

Name: Student ID: Email:
Instructions:
1.
This examination paper consists of 6 pages (including this page) and 5 questions.

2.
This is a CLOSED book exam!

3.
Please write your name, student ID on this page.

4.
You have 90 minutes to complete this exam. Dont spend too much with one problem. Be smart, get to the questions that are relatively easier for you first.

5.
This is not an essay contest. Dont waste your time writing irrelevant materials; it DOES NOT add any points. Be concise; In most case, only one or two sentences will do!

6.
Please answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work.

7.
Please read each question very carefully and answer the question clearly and to the point. Make sure that your answers are neatly written, readable and legible.

8.
Show all the steps you use in deriving your answer, wherever appropriate.

9.
For each of the questions assume that the concepts are known to the graders. Concentrate on answering to the point what is asked. Do not define or describe the concepts.


Question Points Score
1 20
2 10
3 20
4 30
5 20

TOTAL 100

1. Questions and Answers [20 points]
(a) What are the two main objectives of an Operating System (OS)? [6 points]
Answers:
1) to provide the convenience for users(3 points), and 2) to manage the system resources (3 points)
(b) The speed mis-match between a fast CPU (processor) and slow I/O devices is one of the major issues that need to be addressed. Please name two techniques commonly used to deal with this problem? What is the main difference between these two techniques? [14 points]

Answer:
Interrupt (4 points) versu Direct Memory Access (DMA) (4 points), the difference is that in DMA during the I/O operation, there is no CPU intervention (6 points).
2. Consider the following five state process model, please fill out the events (in case there are multiple events, please name one) that trigger the transitions between the states. [10 points]

Answer:
Dispatch

Each arrow 2 points
3. Thread [20 points]
(a) Please name two items that all threads within the same process share? Why does each thread has its own register set? [10 points]

Answer:
Process control block and user address space. Or this can be answered as the state of the pro-cess, and the memory/resources of its process (3 points each)
Each thread needs its register set in order to save its context when not running (4 points) (b) Consider a process with multiple threads, can we implement them by using multiple pro-cesses? what are the main advantages of using the thread approach (name two). [10 points]

Answer:
This certainly can be implemented by multiple processes, with redundant