END TERM EXAMINATION
FIFTH SEMESTER (BCA) JANUARY-2024
(Batch: 2021 Onwards)
Paper Code: BCA-301
Subject: Operating System & Linux Programming
Time: 3 Hours
Maximum Marks: 75
Note: Attempt five questions in all including question no.1 which is compulsory. Selestine question from each unit.
- Q1. Answer the following (any five) (5x5=25)
- (a) Explain the role of Operating System. Give examples of each type of Operating System. 5
- (b) What is Thrashing? Mention possible solutions for this problem. 5
- (c) Explain Process State Transition with the help of diagram. 5
- (d) Explain the scheduling and performance criteria of various scheduling algorithms. 5
- (e) Explain the disk structure of secondary storage. 5
- (f) Explain the three modes of vi Editor. Explain how to write, save and execute a shell script in vi Editor. 5
- (g) Explain deadlock and four necessary conditions for its occurrence. 5
UNIT I
- Q2. (a) Explain Multi Programming, Time sharing, Distributed System and Real Time System in terms of memory management, process management and processor scheduling. 6
- (b) Write a shell program to find the factorial of a number accepted from user. 6.5
- Q3.(a) Explain the Linux Architecture with diagram. Describe the basic directory structure of Linux. 6
- (b) Explain the following Linux commands with syntax and the output of the command. 6.5
- i) cat
- ii) mv
- iii) who
- iv) pwd
- v) tty
- vi) apropos
UNIT II
- Q4. (a) What is process synchronisation? Explain how reader-writer problem can be solved using semaphore with the help of pseudocode. 6
- (b) Consider the following five process, with the length of the CPU burst time given in milliseconds. 6.5
- i) Draw five Gantt charts that illustrate the execution of these process using the following scheduling algorithms: FCFS, SJF, Pre-emptive SJF(SRTN), RR (quantum-2).
- ii) What is average turnaround time and average waiting time for each of the scheduling algorithm in part a.
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 3 |
P2 | 1 | 2 |
P3 | 3 | 6 |
P4 | 4 | 5 |
P5 | 5 | 3 |
- Q5. (a) What is critical section problem? How currently be solved using semaphores. 6
- (b) Explain the Linux Renice Command in Linux with examples. 6.5
- (c) Explain three different types of schedulers in operating system with the help of neat diagram. Explain specific role of each type of scheduler. 6.5
UNIT-III
- Q6. (a) Explain Continuous and Non-Continuous Memory Allocation with diagram. 6
- (b) Assuming demand paging with four frames, how many page faults would occur for the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 1, 0. 6.5
- i) LRU replacement
- ii) FIFO replacement
- iii) Optimal replacement
- Q7.(a) Explain segmentation in memory management. With a neat diagram explain hardware required to implement segmentation. 6
- (b) Consider the following snapshot of a system at time To: 6.5
- Answer the following questions using the banker's algorithm:
- i) What is the content of the matrix Need?
- ii) Is the system in a safe state? If yes, mention the safe sequence?
- iii) If a request from process P1 arrives for (1,1,2) can the request be granted immediately?
Process | Allocation | Max | Available |
---|---|---|---|
A B C | A B C | A B C | |
P0 | 0 0 0 | 7 5 3 | 3 3 2 |
P1 | 2 0 0 | 3 2 2 | |
P2 | 3 0 2 | 9 0 2 | |
P3 | 2 1 1 | 2 2 2 | |
P4 | 0 0 2 | 4 3 3 |
UNIT IV
- Q8. (a) Explain layered design of file system with diagram. 6
- (b) Explain the symbolic and numeric method of changing the permission of file and directory. What is the use of -R, -r, -V options of the command. 6.5
- Q9.(a) Explain the file protection mechanism of operating system. 6
- (b) Explain three types of file access methods in operating system with diagram. 6.5