August 1999
SW204 : SOFTWARE AND
FILE DESIGN

QUESTION 2

Total Marks: 20 Marks

Click here to access other questions

SUGGESTED SOLUTIONS
Solutions and allocated marks are indicated in green.
Return to
Question 2

(a) Describe each of the following operating system structures :

(i) Monolithic.

(ii) Client-server.

 

[2]

[2]

(i)
  • Monolithic systems have no structure.
  • They are designed as a collection of procedures, with each procedure being able to call any other procedure.
  • To construct an object program of the operating system, all procedures are compiled and binded into a single object file.
  • There is no information hiding, as every procedure is visible to every other.

(ii)

  • The operating system functions are moved up to a higher level, leaving the kernel to handle communication between the clients and servers.
  • Any bugs will affect only the particular server, and not the entire machine.
  • The operating system is split into smaller, more manageable parts.

 

(b) Describe three tasks which are carried out by memory manager. [3]
  • It keeps track of which parts of memory are in use.
  • It allocates memory to processes when required.
  • It reallocates memory when suitable.
  • It manages swapping between main memory and disk when the main memory is not big enough to hold all of the processes.

 

(c) Describe two ways of implementing fixed partitioning. [4]
  • Separate input queues. A job is put into an input queue where it best fits the partition.
  • Single input queue. A job in the front of the queue is allocated an empty partition in which it can fit.

 

(d) Describe how each of the following situations can lead to deadlock :

(i) Mutual exclusion

(ii) Hold and wait

(iii) No preemption

 

[1]

[1]

[1]

(i) Only one process can use a particular resource; if another process requests that resource, the process must be delayed until that resource has been released.

(ii) One process already holds at least one resource, and is waiting to acquire further resources which are currently held by other processes.

(iii) Resources cannot be preempted; they can only be released voluntarily by the process holding them.

 

(e) Deadlock avoidance involves the tactful allocation of resources to processes.

(i) Describe how Banker's algorithm for a single resources is implemented.

(ii) For each of the following examples, identify whether it is in a safe or an unsafe state :

A: The number of free resources is 10.

Process Has Max
A 1 5
B 1 4
C 1 3
D 1 6

B: The number of free resources is 2.

Process Has Max
A 2 6
B 2 5
C 3 4
D 5 7

C: The number of free resources is 1.

Process Has Max
A 1 6
B 2 5
C 2 4
D 4 7

 


[3]

[3]

(i) Banker's algorithm considers each request for a resource as it occurs and checks, if by granting that resource, a safe or unsafe state will be entered. If it leads to an unsafe state, the request is postponed.

(ii)

A: safe
B: safe
C: unsafe