=========================preview======================
(COMP252)midterm-2006Fall-sol.pdf
Back to COMP252 Login to download
======================================================
Lecture Section
Dept. of Computer Science, HKUST (circle one below)
COMP 252 Operating Systems 1 2 3
Fall Semester 2006

Midterm Examination
Date: October 21, 2006 (Saturday) Time: 14:30 pm - 16:00 pm (1. hours)

Name: _______________________ Student ID: _______________ Email: ____________________
Instructions:
1.
Please write your name, student ID, and email address on this page. Read the following instructions carefully.

2.
Thisis a CLOSED book exam!

3.
This examination paper consists of 7 questions and 8 pages (including this page).

4.
You have 90 minutes to complete this exam.

5.
Answer all questions within the space provided on the examination paper. You may use back of the pages for your rough work. Be concise! This is NOT an essay contest.

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

7.
Show all the steps used in deriving your answer, wherever appropriate.


Question Points Score
1 10
2 10
3 10
4 25
5 15
6 15
7 15
Total 100

1. (10 points) Answer the following questions in two or three sentences each: (2 points each)
a) What is busy waiting? Give one disadvantage of busy waiting. Busy waiting:
A technique in which a process repeatedly checks to see if a condition is true (1 pt)
Disadvantage:
Waste of processor time (1 pt)
b) Can you please name the main function in Bootstrap process in one sentence?
To load initial OS components into memory (2 pts)
If a student answered initialize hardware (1 pt)

c) Can you specify the main function of a shell in one sentence?
The program that lets users interact with the machine; also known as a command interpreter. (2 pts)
d) What do we mean by mutual exclusion in the context of a critical section?
Only one process or thread is allowed to enter the critical section at one time while others must wait until the critical section is unlocked (2 pts)
e) Give one advantage and one disadvantage of using Virtual Machines? Advantage:
Allow multiple instances of an operating system to execute concurrently on the same hardware.
Promote portability. (1 pt)
Disadvantage:
They are slow; it takes time for interpretation and then execution as opposed to an actual machine where only execution is required. (1 pt)
2. (10 points) Hardware/software Concepts
a) (5 points) Can you please specify the main function of a compiler in one sentence (please be sure to specify the input and output)? Can you specify the role of address binding process of a loader in one sentence?
Compiler translates high-level code into machine code; the input is the high-level code while the output is the machine code. (3 pts)
Address binding process of a loader converts relative addresses in the machine code to the actual physical addresses in main memory (2 pts)
b) (5 poin