NOTE: There are 11 Questions in all.
· Question 1 is compulsory and carries 16 marks. Answer to Q. 1. must be written in the space provided for it in the answer book supplied and nowhere else.
· Answer any THREE Questions each from Part I and Part II. Each of these questions carries 14 marks.
· Any required data not explicitly given, may be suitably assumed and stated.
Q.1 Choose the correct or best alternative in the
following: (2
8)
a. A parser which is a variant of top-down parsing without backtracking is
(A) Recursive Descend. (B) Operator Precedence.
(C) LL(1) parser. (D) LALR Parser.
b. The expansion of nested macro calls follows
(A) FIFO rule. (B) LIFO rule.
(C) LILO rule. (D) priority rule.
c. In a two-pass assembler, the task of the Pass II is to
(A) separate the symbol, mnemonic opcode and operand fields.
(B) build the symbol table.
(C) construct intermediate code.
(D) synthesize the target program.
d. A linker program
(A) places the program in the memory for the purpose of execution.
(B) relocates the program to execute from the specific memory area
allocated to it.
(C) links the program with other programs needed for its execution.
(D) interfaces the program with the entities generating its input data.
e. Which scheduling policy is most suitable for a time-shared operating system
(A) Shortest-job First. (B) Elevator.
(C) Round-Robin. (D) First-Come-First-Serve.
f. A critical section is a program segment
(A) which should run in a certain specified amount of time.
(B) which avoids deadlocks.
(C) where shared resources are accessed.
(D) which must be enclosed by a pair of semaphore operations, P and V.
g. An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlocks will ever arise is
(A) 4. (B) 3.
(C) 5. (D) 6.
h. Locality of reference implies that the page reference being made by a process
(A) will always be to the page used in the previous page reference.
(B) is likely to be the one of the pages used in the last few page references.
(C) will always be to one of the pages existing in memory.
(D) will always lead to a page fault.
Answer any THREE Questions. Each question carries 14 marks.
Q.2 a. Differentiate between program translation and program interpretation. (6)
b. Construct parse trees for the following statements:
(i) if (5. Eq. MAX) GOTO 100
(ii) while A > B & A <= 2 * B –5 do A := A + B (4)
c. Design a DFA for accepting the language
. (4)
Q.3 a. Explain the differences between macros and subroutines. (4)
b. Explain the stack storage allocation model. (6)
c. Write a recursive descent parser for the grammar
(4)
Q.4 a. Give an account of the issue pertaining to compilation of if statement in C language. (6)
b. Discuss the design details of pass I in a two pass assembly scheme. (8)
Q.5 a. Describe call by value-result, call by reference, and call by name parameter passing mechanisms in terms of execution efficiency and power to produce side effects. (8)
b. Differentiate between non-relocatable, relocatable and self relocatable programs. (6)
Q.6 a. Explain briefly any three of the commonly used code optimisation techniques. (6)
b. Write short notes on:
(i) YACC.
(ii) Debug monitors. (8)
Answer any THREE Questions. Each question carries 14 marks.
Q.7 a. What is an operating system? List the typical functions of operating systems. (4)
b. What are interrupts? How are they handled by the operating system? (5)
c. Define process. Describe the contents of a Process Control Block (PCB). (5)
Q.8 a. What are interacting processes? Explain any two methods of implementing interacting processes. (8)
b. Consider the following set of jobs with their arrival times, execution time (in minutes), and deadlines.
|
Job Ids |
Arrival Time |
Execution time |
Deadline |
|
1 |
0 |
5 |
5 |
|
2 |
1 |
15 |
25 |
|
3 |
3 |
12 |
10 |
|
4 |
7 |
25 |
50 |
|
5 |
10 |
5 |
12 |
Calculate the mean turn-around time, the mean weighted turn-around time and the throughput for FCFS, SJN and deadline scheduling algorithms. (6)
Q.9 a. What are the differences between user level threads and kernel supported threads? (4)
b. Define deadlock? Explain the necessary conditions for deadlock to occur. (5)
c. An operating system contains 3 resource classes. The number of resource units in these classes is 7, 7 and 10. The current resource allocation state is shown below:
|
Processes |
Allocated resources |
Maximum requirements |
||||
|
R1 |
R2 |
R3 |
R1 |
R2 |
R3 |
|
|
P1 |
2 |
2 |
3 |
3 |
6 |
8 |
|
P2 |
2 |
0 |
3 |
4 |
3 |
3 |
|
P3 |
1 |
2 |
4 |
3 |
4 |
4 |
(i) Is the current allocation state safe?
(ii) Can the request made by process P1 (1, 1, 0) be granted? (5)
Q.10 a. What are semaphores? How do they implement mutual exclusion? (6)
b. Give a solution for readers-writers problem using conditional critical regions. (8)
(i) Logical and physical address space.
(ii) Internal and external fragmentation.
(iii) Paging and segmentation. (6)