Sie sind auf Seite 1von 10

Model Question Paper Operating Systems (MC251)

Section A : Basic Concepts (30 Marks)


This section consists of questions with serial number 1 - 30. Answer all questions. Each question carries one mark. Maximum time for answering Section A is 30 Minutes.

1. Command interpreter is an interface between (a) (b) (c) (d) (e) Application program and operating system Operating system and hardware Operating system and user User and hardware Hardware and operating system.

2. Send and receive is part of (a) (b) (c) (d) (e) Process control system call Control system call Communication system call Process communication system call User and hardware.

3. Virtual machine can be defined as (a) (b) (c) (d) (e) Multiple processor distributed between multiple processes Single processor distributed between multiple processes Multiple processes distributed between multiple processor Single process distributed between multiple processor Process control system call.

4. A process consists of (a) (b) (c) (d) (e) Text section, program counter, stack, data section, heap Program, program counter, data section Text section, data section Program, program counter, stack, heap Single process distributed between multiple processor.

5. Degree of multiprogramming means (a) (b) (c) (d) (e) Number of program in the system Number of users in the system Number of process in the system Number of CPUs in the system Program, program counter, stack, heap.

6. What does a thread mean? Choose the correct statement? (a) (b) (c) (d) (e) Process within processes Process in execution Heavy weight process within a process Light weight process within a process Number of users in the system.

7. In multilevel feedback-queue scheduling processes (a) (b) (c) (d) (e) Can move between queues Cannot move between queues Are assign a queue permanently Numbers programs in the system Numbers users in the system.

8. Readers and writers problem is related to (a) (b) (c) (d) (e) CPU scheduling Process scheduling CPU synchronization Process synchronization Batch Operating System.

9. Which of the following allows a single user to share a computer system simultaneously? (a) (b) (c) (d) (e) Batch Operating System Network Operating System Time sharing Operating System Distributed Systems Multiprocessor System.

10.Time Sharing System is also known as (a) (b) (c) (d) (e) Multiprogramming System Multitasking System Single programming System Multiprocessor System Distributed Systems.

11.Multiprocessor System is also known as (a) (b) (c) (d) (e) Tightly coupled System Loosely couple System Decoupled System Tolerant System Multiprocessor System.

12.Distributed System is also known as (a) (b) (c) (d) (e) Tightly coupled System Loosely cohesive System Decouple System Tolerant System Loosely couple System.

13.Components of a computer system follow which of the following order? (a) (b) (c) (d) (e) Operating system, hardware, system and application program, user Hardware, operating system, system and application program, user User, operating system, system and application program, user User, operating system, hardware, system and application program Hardware, operating system, user, system and application program.

14.Which of the following system call creates a new process? (a) (b) (c) (d) (e) Create Load Fork Execute Open.

15.Schedulers have been heavily studied over the last three decades for which of the following reason? (a) (b) (c) (d) (e) Designers of multiprogramming operating systems knew the scheduler's behavior was critical to the performance of the individual process's perspective Those designers believed the scheduler's behavior might be critical to the overall behavior of the system The methodologies used to study schedulers were well-entrenched in operations research Schedulers were a nice theoretical computer science problem All (a), (b), (c) and (d) above.

16.ACL stands for (a) (b) Attribute Control List Access Connection List

(c) (d) (e)

Access Control Line Access Connection Line Access Control List.

17.What is the high paging activity? (a) (b) (c) (d) (e) Paging Segmentation Swapping Thrashing Mapping.

18.Number of process that completes their execution per unit time is called (a) (b) (c) (d) (e) Throughput Output Process speed CPU speed Clock counter.

19.The job of short-term scheduler is to I. Create new processes. II. Select processes those are ready to execute. III. Allocate Program to one process. (a) (b) (c) (d) (e) Only (I) above Only (II) above Only (III) above Both (I) and (II) above Both (II) and (III) above.

20.Which scheduling determines the following statement? CPU allocated to a process is taken back. (a) (b) (c) (d) (e) Pre-emptive Non-preemptive Plain Blocked Non-blocking.

21.Saving the state of old process and loading the saved state of the new process is called as (a) (b) (c) (d) (e) Process transfer Context loading Process loading Context switching Process switching.

22.Information regarding each process in a system is kept in (a) (b) (c) (d) (e) Information block Process block Process control block Control block Program control block.

23.Find out the correct statement (a) (b) (c) (d) (e) Processes share same address space a thread does not Processes and thread share same address space Threads share same address space processes do not Processes and thread have there own address space All (a), (b), (c) and (d) above.

24.Program counter indicates (a) (b) Address of first instruction Address of next program

(c) (d) (e)

Address of last instruction Address of current instruction Address of next instruction.

25.RPC means (a) (b) (c) (d) (e) Remote Program Creation Remote Procedure Call Remote Procedure Creation Restricted Procedure Call Regulated Procedure Call.

26.The round robin CPU scheduling uses (a) (b) (c) (d) (e) LIFO Stack FIFO Stack FIFO Queue FILO Queue Control block.

27.Wait time can be defined as (a) (b) (c) (d) (e) Time taken by a process waiting to execute Sum of periods spent waiting in ready queue Sum of time taken by a process in ready queue, suspend queue Sum of periods spent in suspend queue Control block.

28.Critical section problem must satisfy which of the following order? (a) (b) (c) (d) (e) Mutual exclusion, race condition and threading Progress, bounded waiting and starvation Mutual exclusion, progress and bounded waiting Program deadlock Process deadlock.

29.Semaphore is tool related to (a) (b) (c) (d) (e) Process deadlock Process synchronization Deadlock synchronization CPU scheduling All (a), (b), (c) and (d) above.

30.In multilevel queue scheduling processes (a) (b) (c) (d) (e) Can move between queues Are assigned a queue permanently Are allowed to move once Are not assigned a queue permanently Process deadlock. END OF SECTION A

Operating Systems (MC251)


Section B : Problems (50 Marks)
This section consists of questions with serial number 1 5. Answer all questions. Marks are indicated against each question. Detailed workings should form part of your answer. Do not spend more than 110 - 120 minutes on Section B.

1.

a.

Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here:

2.

i T(pi) 0 80 1 20 2 10 3 20 4 50 i. Suppose a system uses FCFS scheduling. Create a Gantt chart illustrating the execution of these processes. ii. What is the turnaround time for process p3? iii. What is the average wait time for the processes? ( 5 marks) b. Using the process load in the previous problem, suppose a system uses SJF scheduling. i. Create a Gantt chart illustrating the execution of these processes. ii. What is the turnaround time for process p4? iii. What is the average wait time for the processes? ( 5 marks) Consider the segment table: What are the physical address for the following logical addresses: a. 0,430 b. 1,10 c. 1,11 d. 2,500 Segment Base Length 0 219 600 1 2300 14 2 90 100 3 1327 580 4 1952 96 A system has four processes P1 through P4 and two resource types R1 and R2. It has 2 units of R1 and 3 units of R2. Given that: P1 requests 2 units of R2 and 1 unit of R1 P2 holds 2 units of R1 and 1 unit of R2 P3 holds 1 unit of R2 P4 requests 1 unit of R1. Show the resource graph for this state of the system. Is the system in deadlock, and if so, which processes are involved? a. List three examples of deadlocks that are not related to a computer system environment. b. Give briefly the various ways of establishing interprocess communication. a. What are the properties inherited by a child process from parent process? b. Describe critical section problem. What are the basic requirements for solution to a critical section problem must satisfy? END OF SECTION B

( 12 marks)

3.

( 10 marks) ( 2 marks) ( 6 marks) ( 5 marks) ( 5 marks)

4.

5.

Section C : Applied Theory (20 Marks)


This section consists of questions with serial number 6 - 7 . Answer all questions. Marks are indicated against each question.

6. 7.

Do not spend more than 25 -30 minutes on Section C. ( 10 marks)

Explain the various deadlock techniques. Explain about bankers algorithm.

Find the average seek time by implementing FCFS, SSTF, CSCAN for the given requested tracks 55, 58, 39, 18, 90, 160, 150, 38, 184 if initially header is located at 100. ( 10 marks)

END OF SECTION C END OF QUESTION PAPER

Suggested Answers Operating Systems (MC251)


Section A : Basic Concepts
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Answer Reason A Command interpreter is an interface between Application program and operating system. D Send receive is part of Process communication system call. A Virtual machine is a multiple processor distributed between multiple processes. D A process consists of Program, program counter, stack, heap. A Degree of multiprogramming means Number of programs in the system. A Thread can be define as Process within processes. B In multilevel feedback-queue scheduling processes Cannot move between queues. D Readers and writers problem is related to Process synchronization. D Distributed systems allows a single user to share a computer system simultaneously. B Time sharing system is also known as Multitasking system. A Multiprocessor system is also known as Tightly coupled system. B Distributed system is also known as loosely couple system. E Hardware, operating system, user, system and application program is the correct order. C Fork creates a new process. E Have been heavily studied over the last three decades as Designers of multiprogramming operating systems knew the scheduler's behavior was critical to the performance of the individual process's perspective. Those designers believed the scheduler's behavior might be critical to the overall behavior of the system. The methodologies used to study schedulers were well-entrenched in operations research. Schedulers were a nice theoretical computer science problem. E ACL stands for Access control list. D The high paging activity is called Thrashing. A Throughput is the no of processes that completes their execution per unit time. B The job of short-term scheduler is to select processes those are ready to execute. A Where allocated CPU to a process can be taken back is called Pre-emptive Scheduling. D Context switching is saving the state of old process and loading the saved state of new process. C PCB strores information about process. C Threads share same address space processes do not E Program counter indicates Addrest of Next instruction. B RPC stands for Remote procedure Call. C The round robin CPU scheduling uses FIFO Queue. B Wait time can be defined as Sum of periods spent waiting in ready queue C Critical section problem must satisfy Mutual exclusion, progress and bounded waiting B Semaphore is related to Process synchronization. B In multilevel queue scheduling processes are assigned a queue permanently.

16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.

Operating Systems (MC251)


Section B : Problems
1.a. i. The Gantt chart is as follows: P0 P1 P2 0 80 100 110 The turnaround time for process p3 is T.A. (p3) = T (p3) + T.A. (p2) = T (p3) + (T (p2) + T.A. (p1)) = T (p3) + (T (p2) + (T (p1) + T.A. (p0))) = T (p3) + (T (p2) + (T (p1) + T (p0))) = 20 + 10 + 20 + 80 = 130. Average waiting time calculation: Waiting Time for process p0 = 0 sec. p1 = 80 sec. p2 = 100 sec. p3 = 110 sec. p4 = 130 sec. Hence the average waiting time = (0+80+100+110+130)/5 = 84 sec. The Gantt chart is: P2 P1 P3 P4 100 P3 130 P4 180

ii.

iii.

b.

i.

0 10 30 50 ii.. The turnaround time for process P4 is = 100. iii.. Average waiting time calculation: Waiting time for process p0 = 0 sec. p1 =10 sec. p2 = 30 sec. p3 = 50 sec. p4 = 100 sec. Therefore, the average waiting time is = (0+10+30+50+100)/5 =38 219+430 = 649. 2.a. b. 2300+10=2310. c. 2300+11=2311 d. Illegal address since size of segment 2 is 100 and the offset in logical Address is 500. 3.

P0 180

4.a. Two cars crossing a single-lane bridge from opposite directions. A person going down a ladder while another person is climbing up the ladder. Two trains traveling toward each other on the same track. Pipes: In this process a pipe is described which is essentially an array that has two pointers, one is for input end and one for output. In this it imperative that if one process writes it closes it s reading end and vice versa 2. Shared Files: one process identified as a writers process writes in the file. Another process identified as readers file reads from this file. Another way could be that instead of using files we can have pointers . one process positions a pointer at the file location and another process reads from this file at the communication location 3. Shared memory communication: in this one process writes into a certain commonly accessed area and another process would read subsequently from that area. 1. Environment: all the variable=value pairs in the environment. 2. Process identifier: the new process gets his own process id 3. Parent process identifier : this is the spawning processs id 4. Real and effective user identifier 5. Code 6. Data space 7. Stack 8. Signal and umask 9. Priority Critical section problem Consider a system consisting of n processes. Each process has a segment of code, called a critical section, in which the process may be changing common variables, updating a table, writing a file, and so on. The execution of critical section by the processes is mutually exclusive in time. Basic requirements: 1.

b.

5.a.

b.

Mutual exclusion: If process pi is executing in its critical section, then no other processes can be executing in their critical sections. Progress: if no process is executing in its critical section and there exist some processes that wish to enter their critical sections, then only those processes that are not executing in their remainder section can participate in the decision of which will enter its critical section next, and this selection cannot be postponed indefinitely. Bounded waiting: There exist a bound on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.

Section C: Applied Theory


6. Deadlock techniques 1. Deadlock prevention Mutual exclusion Hold and wait No preemption Circular wait 2. Deadlock avoidance Safe state Resource-allocation graph algorithm Bankers algorithm 3. Deadlock Detection Single instance of each resource type Several instances of a resource type Bankers algorithm 1. let work and finish be vectors of length m and n, respectively. Initialize work:=available. for i=1,2,---,n, if allocation=0 then finish[i]:=false; otherwise, finish[i]:=true. 2. find an index I such that both a.finish[i]=false b.requesti<work if no such I exists,go to step4 3. work:=work+allocation Finish[i]:=true Goto step2. if finish[i]=false, for some I,1<i<n, then the system is in a deadlock state. Moreover, if finish[i]=falsef, then process pi is deadlocked. FIFO average seek length=55.3 SSTF-average seek length=27.5 SCAN-average seek length=27.8 C-SCAN-av

7.

Das könnte Ihnen auch gefallen