59.305 1997 Exam Paper

Answer all questions - 3 hours



1. a) Many Operating Systems use a Software Interrupt as a mechanism for making system calls.

i) Briefly explain this process.

ii) What are the implications of using a subroutine call instead of a Software Interrupt.

[4]

b) Many modern CPUs have an instruction such as

XCHG r,[n]

This instruction will atomically swap the values in a register and a memory location. Explain what this instruction is used for in a modern Operating System.

[2]

c) Name three causes of interrupts that must be handled by an Operating System for a typical Personal Computer.

[3]

d) What are the minimum services which must be provided by the kernel in a microkernel Operating System.

[3]

e) What is the function of the dispatcher in an OS?

[2]




2. a) When a process is not running, what states can it be in? Give a brief description of each of these states.

[3]

b) What is the difference between a context switch that occurs from one task to another and a context switch that occurs between sibling threads.

[2]

c) Consider the following table showing part of the execution of four processes.


Process

Arrival Time

Burst Time

p1

0

25

p2

10

10

p3

15

20

p4

30

5

Draw a diagram to show the scheduling of these processes using the following algorithms.


i) First Come First Served (FCFS)

[3]

ii) Preemptive Shortest Job First (SJF)

[3]


d) Briefly describe the relative merits of Shortest Job First (SJF) and Round Robin (RR) scheduling.

[4]



3) a) Consider the following system which has three resource types A,B and C. There are 5 instances of A, 4 instances of B and 7 instances of C.



Process


Allocation

Maximum

A

B

C

A

B

C

p1

0

0

2

3

3

3

p2

1

0

1

2

4

2

p3

1

2

1

4

3

4

p4

0

1

0

4

4

6

i) Is this system in a safe state? Use the safety algorithm to prove your answer.

[3]

ii) If p3 now requests 2 more instances of resource C is the system still safe? Use the Resource-Request algorithm to prove your answer.

[3]

b) Give brief definitions of the following terms.

i) Starvation

ii) Monitor

iii) The Readers and Writers Problem

iv) Virtual Machine

v) Shared Library

vi) Remote Procedure call

vii) Thrashing

viii) Public key encryption



[8]

4) a) The New Zealand Meteorological Office needs to write a complex scientific application for weather prediction. Choose three of the following operating systems and discuss their suitability for use in this project.

i) VMS

ii) Amoeba

iii) Solaris

iv) JavaOS

v) Hurd

vi) Plan 9

vii) Windows NT

vii) QNX

ix) Rhapsody

x) Linux


[14]

5) a) a machine uses two level paging and has a memory access time of 120ns; it uses a TLB with an access time of 10ns.

i) What is the effective memory access time if the TLB has a hit ratio of 95%.

[2]

ii) Describe how paging hardware may be used to share data between processes.

[2]

iii) briefly explain the advantages of demand paging

[3]

b) A system has a virtual memory size of 6 pages and a physical memory of 3 frames, how many page faults occur fior the following string of page references.

0,2,4,0,2,5,2


i) Using FIFO page replacement

[2]

ii) Using LRU page replacement

[3]

c) Briefly explain the difference between indexed and linked allocation methods for the design of a filesystem.

[2]