Answer14789

Question 1
a. Describe the essential properties of the following types of operating systems. (9 marks)
i)
Multi-processor
Multi-processor system with more than one CPU in communication
Tightly coupled system---processors share memory and a clock; communication usually takes
place through the shared memory
Increased throughput, economical, increased reliability
ii)
Distributed
Distribute the computation among several processors
Loosely coupled system---each processor has its own memory; processors communicates with one
another through various communication lines, such as high speed buses or telephone lines
Resource sharing, computation speed up
iii)
Real time
Often used as a control device in a dedicated application such as controlling scientific experiments,
medical imaging systems and display systems.
Well-defined fixed-time constraints
Real-time systems maybe either hard or soft real-time
b. with necessary diagram, explain any five storage-device hierarchies of a computer
system.(6 marks)
c. Explain four components: hardware, operating system, application programs and users
d. Distinguish between preemptive and non-preemptive scheduling.
Non-preemptive – once CPU given to the process it cannot be preempted until completes its CPU
burst.
Preemptive – if a new process arrives with CPU burst length less than remaining time of current
execution process
Question 2
a. As a process executes, it changes state. Explain this with the necessary diagram. (7
marks)
New: the process is being created.
Ready: the process is waiting to be assigned to a process
Running: instructions are being executed
Waiting: the process is waiting for some event to occur
Terminated: The process has finished the execution.
b. What information about a process needs to be saved, changed or updated when ‘context
switching” occurs? Using the diagram explain the purpose for having this information
saved. (9 marks)
Process state: any one of the five states.
Program counter: indicates the address of the next instruction.
CPU registers: includes accumulators, index registers, stack pointer
CPU scheduling information: includes process priority, pointer to scheduling queue and
scheduling parameters.
Memory-management information: value of registers, page tables
Accounting information: amount of CPU and real time used,
I/O status information: includes list of I/O devices allocated to the process.
c.
1)
2)
3)
describe the three(3) type of scheduling queues in an operating system.(6 marks)
Job queue: set of all processes in the system also called as job pool.
Ready queue: set of all processes reside in main memory, ready and waiting to execute.
Device queue: set of all process waiting for a particular I/O device.
Question 3
a. Explain the criteria in CPU-scheduling
1) CPU utilization: keep CPU as busy as possible. Utilization may vary from 0 to 100
percent.
2) Throughout: if the CPU is busy executing processes, the work is being done. Number of
processes completed per time unit.
3) Turnaround time: the interval from the time of submission of a process to the time of
completion
4) Waiting time: amount of time a process has been waiting in the ready queue.
5) Response time: amount of time it takes from when a request was submitted until the first
response is produced.
Question 4
a. i) Explain what is meant by deadlock?
A process requests resources, if the resources are not available then the process enters a wait
state. Waiting processes may never change state because the resources they have requested
are held by other waiting process.
ii) Four necessary conditions must hold in a system for a deadlock to occur. What are
they? Explain them. (4 marks)
1) mutual exclusion: one resource must be held in a non-sharable mode. Only one
process at a time can use the resource.
2) Hold and wait: a process holding at least one resource is waiting to acquire
additional resources held by other processes.
3) No preemption: a resource can be released only after the process has completed its
task.
4) Circular wait: there exists a set (P0,P1,P2…Pn) of waiting processes, such that P0 is
waiting for the resource that is held by P1,P1 is waiting for the resource that is held
by P2…Pn-1 is waiting for the resource that is held by Pn.
iii) Elaborate the approach of deadlock prevention (8 marks).
1) Mutual exclusion: not required for sharable resources. Must hold for non-sharable
resources. Can not prevent deadlock by denying this.
2) Hold and wait: must guarantee that whenever a process requests a resource, it does
not hold any other resources.
3) No preemption: if a process is holding some resources requests another resource that
cannot be immediately allocated to it, then all resources currently being held are
released.
Preempted resources are added to the list of resources for which the process is
waiting.
Processes will be restarted, only it can regain its own resources.
4) Circuit wait: impose a total ordering of all resource types and require that each
process requests resources in an increasing order of enumeration.
b. Write short notes on Application Programming Interface (API). (5 marks)
c. With the diagram, explain the contiguous allocation scheme of files. (6 marks)
Each file occupies a set of contiguous blocks on the disk.
Only starting location and length are required.
Question 5
a. State Five(5) components which are newly introduced in Java Swing API. (5 marks)
b. Identify the various categories of device drivers. Explain their functionalities. (10 marks)
1) block device drivers
perform I/O in block sized buffer
perform I/O through a block cache supplied by the kernel
suitable for disk drives
2) character device drivers
Perform I/O in character
Can acquire variable sized chucks from buffers on the controller sometimes
Can be used to copy data and form a user process
Suitable for line printers, terminals
3) network device drivers
attach a network subsystem to a network interface
prepare a network interface for operation
controls transmissions and receptions of data frames over the network interface
4) pseudo device drivers
Make use of the device driver interface to connect a user process to a replacement for a
physical I/O device
c.
i. what is the purpose of system call? (2 marks)
ii. what is the purpose of system programs? (2 marks)
Question 6
a. Explain any three advantages and disadvantages of participatory design. (12 marks)
b. Describe the concept and use of metaphor in user interface design. (6 marks)
c. Explain briefly event driven programming. (7 marks)
FCFS
SSTF
A trap is a software-generated interrupt caused either by an error or a user request.
System call – request to the operating system to allow user to wait for I/O completion