Sie sind auf Seite 1von 3

Name:

Stud Id

CSC520 PRINCIPLES OF OPERATING SYSTEMS TETS 1 PART A (30 MARKS) 1. Briefly explain TWO (2) main responsibilities of the operating system. The OS provides standard facilities such as file systems, standard libraries, graphical interfaces, etc The OS provides the illusion of a dedicated machine with infinite memory and CPU protecting users from each other, allocating resources efficiently and fairly, and providing secure and safe communication Or any suitable answer 2. (4 marks) 2m 2m 2m

3.

What is the timer interrupt? How does the OS use it for scheduling? The timer interrupt is an interval timer device which produces an interrupt whenever the timer expires. The OS uses the timer interrupt to force periodic interrupts of any process execution, particularly in an involuntary CPU sharing environment. In this way, even though a particular process is executing an infinite loop, it cannot block other processes from running (4 marks) Briefly explain the characteristics of a distributed computing. Distribute computations among several processors in several locations 2m A loosely coupled system 2m Each processor has its own local memory, bus & clock 2m Any two or any suitable answer (4 marks) What is the mode bit used for? A flag, usually in hardware, that selects between two modes of operation: user mode and kernel/supervisor mode. The mode bit act as a mechanism by which a process does not interfere with others currently using the machine. (2 marks) The most critical part of the Operating System is a kernel. Briefly explain how to implement the kernel. Monolithic kernel All software and data structures are placed in one logical module with no explicit interface between any parts of OS software Modular/Hybrid kernel Functionality is partitioned among logically independent components with well-defined interfaces among the related modules. It is easier to maintain and modify Microkernel The near-minimum amount of software that can provide the mechanisms needed to implement and OS. Traditional kernel tasks are removed from the kernel to run in user space (4 marks) Briefly explain TWO (2) main types of resources. Reusable resource Resources that can be allocated and later returned to the system after the process has finished using them. The system always has a fixed, finite number of units of reusable resource Consumable resource Resources that can be allocated but that is never subsequently released. The number of units of a consumable resource is unbounded (4 marks) Shortest Job Next is a form of optimal CPU scheduling algorithm. Explain why it is not used in real operating systems. Main problem: starvation of large threads (4 marks) Briefly explain why Operating Systems are interrupt-driven. Since hardware has a slower speed than CPU, a mechanism is needed to notify the CPU when a particular hardware device becomes ready for service, rather than require the CPU to poll repeatedly for an I/O completion. In this manner, the CPU can increase its degree of multiprogramming by executing another program while the first program is blocked waiting for an I/O completion. (4 marks)

4.

5.

6.

7.

8.

PART B (45 MARKS) 1. Given the following diagram:

a. What are the entities represented by A and B? A CPU B Wait queue


FSKM/CTN/CSC520/ADORAENDUT/MAY2011/TEST1

Name:

Stud Id

2
(2 marks)

b. Name the action shown in C and D. C Swap out D Swap in (2 marks) c. The actions taken in C and D are controlled by a scheduler. Name the scheduler. Medium-term Scheduler (1 marks) d. Name the scheduler responsible for the transition from the Ready Queue to A and briefly describe one of its functions. CPU scheduler chooses one of the ready threads to use the CPU. Enqueuer component of CPU scheduler places a pointer to the descriptor into a list of processes that are waiting for the CPU. The context switcher component saves the contents of all CPU registers for the thread being removed from the CPU in its descriptor The Dispatcher component selects one of the ready threads from the ready list & then allocates the CPU to that thread (3 marks) 2. Given the following information: PROCESS BURST TIME A 6 B 7 C 4 D 3 E 8 F 2 a. Draw the Gantt Chart for the following scheduling algorithms: i. Priority
A 0 6 B 13 C 17

ARRIVAL TIME 0 3 5 9 12 15

PRIORITY NO 3 1 2 4 3 2

F 19

E 27

D 30

ii.

Round Robin (time quantum = 4)


A 0 4 B 8 C 12 D 15 E 19 F 21 A 23 B 26 E 30

iii.

Shortest Job Next


A 0 6 C 10 D 13 B 20 F 22 E 30

(12 marks) b. Calculate the turnaround time and waiting time for processes A and D in each of the above scheduling algorithms. Priority RR SJN Trnd(A) = 6 0 = 6 Trnd(A) = 23 0 = 23 Trnd(A) = 6 0 = 6 Wait(A) = 0 Wait(A) = 21 4 = 17 Wait(A) = 0 Trnd(D) = 30 9 = 21 Wait(D) = 27 9 = 18 Trnd(D) = 15 9 = 6 Wait(D) = 12 9 = 3 Trnd(D) = 13 9 = 4 Wait(D) = 10 9 = 1 (6 marks) c. Calculate the average waiting time for all the processes in each of the above scheduling algorithms. Priority RR SJN Wait(A) = 0 Wait(A) = 17 Wait(A) = 0 Wait(B) = 6 3 = 3 Wait(B) = 1 + 15 = 16 Wait(B) = 10 Wait(C) = 13 5 = 8 Wait(C) = 3 Wait(C) = 1 Wait(D) = 27 9 = 18 Wait(D) = 3 Wait(D) = 1 Wait(E) = 19 12 = 7 Wait(E) = 3 + 7 = 10 Wait(E) = 10 Wait(F) = 17 15 = 2 Wait(F) = 4 Wait(F) = 5 Avg = (0+3+8+18+7+2)/6 = 6.33 Avg = (17+16+3+3+10+4)/6 = 8.83 Avg = (0+10+1+1+10+5)/6 = 4.5 (9 marks) d. What is the effect of increasing the time quantum to a very large number for Round Robin scheduling? RR converges to FCFS scheduling since every job has its entire need met the first time it receives a time quantum.
FSKM/CTN/CSC520/ADORAENDUT/MAY2011/TEST1

Name:

Stud Id

3
(4 marks)

3.

Explain TWO (2) methods by which a program in user mode can request the services of the operating system. Two techniques by which program in user mode can request kernels services: System call A system call is how a program requests a service from an operating system's kernel that it does not normally have permission to run. System calls provide the interface between a process and the operating system. Most operations interacting with the system require permissions not available to a user level process, e.g. I/O performed with a device present on the system, or any form of communication with other processes requires the use of system calls Message passing In this model, processes or objects can send and receive messages (comprising zero or more bytes, complex data structures, or even segments of code) to other processes. By waiting for messages, processes can also synchronize. (6 marks)

FSKM/CTN/CSC520/ADORAENDUT/MAY2011/TEST1

Das könnte Ihnen auch gefallen