CSC 4103 - Operating System

Dr. Xian-He Sun

Sample Exam #1

Name ___________________________________( Last, First )

Score _________________________ (100 pts.)

Make sure there are ten problems. Read each problem very carefully before answering it. Try to make your answer short and clear.

1. Define operating systems in terms of what they do? (5 pts.)

2. What is process? (5 pts.)

3. How is an interrupt executed? (5 pts.)

4. What are the five major intellectual achievement of OS development? (5 pts.)

5.What is multiprogramming? (5 pts.)

6. Define the difference between preemptive and nonpreemptive scheduling? (6 pts.)

7. What is FCFS? What is SJF? What is RR? ( 9pts.)

8. Semaphore is a tool of process synchronization. Critical region is a high-level language construct for process synchronization. Transform the 'wait' and 'signal' operation on a semaphore 'S' into equivalent critical regions without busy waiting. (20 pts.)

9. Consider the following snapshot of a system answer the following questions using the banker's algorithm

( show your work, 20 pts.)

Process

Allocation

Max

Available

 

A B C D 

A B C D 

A B C D

P1

0 0 1 2

0 0 1 2

1 5 2 0

P2

1 3 5 4

2 3 5 6

 

P3

0 6 3 2

0 6 5 2

 

P4

1 0 0 0

1 7 5 0

 

P5

0 0 1 4

0 6 5 6

 

(a) Is the system in a safe state?

(b) If a request from process P4 arrives for (0, 4, 2, 0) can the request be granted immediately?

10. Mutual exclusion can be provided by using Lock and Unlock functions as follows

Lock(gate);

critical section;

Unlock(gate);

(a) Use hardware instruction Swap to implement the function Lock and Unlock. (15 pts.)

(b) Does your implementation satisfy the Bounded Waiting requirement? If it does not, give a solution which satisfies this requirement. (10 pts.)