CS2411-Model question with key.doc

Embed Size (px)

Citation preview

CS2411 OPERATING SYSTEMS

PART A

1. Define operating system.

An operating system is a program that manages the computer hardware. it act as an intermediate between a users of a computer and the computer hardware. It controls and coordinates the use of the hardware among the various application programs for the various users.

2. Define context switch.

Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as context switch.

3. What is critical section problem?

Consider a system consists of 'n' processes. Each process has segment of code called a critical section, in which the process may be changing common variables, updating a table, writing a file. When one process is executing in its critical section, no other process can allowed to execute in its criticalsection.

4. Define monitor. What does it consist of?

High-level synchronization construct is the monitor . A monitor is characterized by a set of programmer-defined operators. The representation of a monitor type consists of declarations of variables whose values define the state of an instance of the type, as well as the bodies of procedures or functions that implement operations on the type.5. Differentiate between internal and external fragmentation.

6. What is an Overlay? What is the use of it?

To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructions and data that are needed at a given time. When other instructions are needed, they are loaded into space occupied previously by instructions that are no longer needed.

7. What are the disadvantages of log-structured file system?

8. Define Mount Point.File systems can be mounted at any directory. This is implemented by setting a flag in the in-memory copy of the node for that directory. The flag indicates that the directory is a mount point. A field then points to an entry in the mount table, indicating which device is mounted there. The mount table entry contains a pointer to the superblock of the file system on that device.9. List the outcomes produced on a disk write.

1. Successful completion: The data were written correctly on disk.

2. Partial failure: A failure occurred in the midst of transfer, so only some of the sectors were written with the new data, and the sector being written during the failure may have been corrupted.

3. Total failure: The failure occurred before the disk write started, so the previous data values on the disk remain intact.

10. What are seek time and rotational latency?

The seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector. The rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head.Part B - (5 x 16 = 80)11. (a) i)What is thread and what are the advantages of threads? Explain multi-threading models in detail.

(8)

A thread, sometimes called a lightweight process (LWP), is a basic unit of CPU utilization; it comprises a thread ID, a program counter, a register set, and a stack. It shares with other threads belonging to the same process its code section, data section, and other operating-system resources, such as open files and signals. A traditional (or heavyweight) process has a single thread of

control. If the process has multiple threads of control, it can do more than

one task at a time.

single-threaded process and a multithreaded process.

Advantages of Thread

1. Responsiveness

2. Resource sharing

3. Economy

4. Utilization of multiprocessor architectures

Multithreading:

1.Many-to-One Model

One-to-one Model

Many-to-Many Model

14. ii)Explain inter process communication mechanism in Linux.

(8)

IPC provides a mechanism to allow processes to communicate and to syn- chronize their actions without sharing the same address space. IPC is particu- larly useful in a distributed environment where the communicating processes may reside on different computers connected with a network.Message-Passing SystemNaming

Direct Communication

In- direct CommunicationSynchronizationBuffering(or)

14. (b) i) What is a process? Describe the operation on a process in detail.

(8)

1. ii) What is a remote procedure call? Describe the steps involved in executing a remote

procedure call.

(8)

Remote Procedure CallsThe RPC was designed as a way to abstract the procedure-call mechanism for use between systems with network connections.

2. (a) Write in detail about FCFS, SJF, Priority and RR Scheduling Algorithms with an

3. example.

(16)

4. (or)

5. (b) i)What is deadlock detection and recovery? Describe the methods for recovery from

deadlock.

(10)

6. ii) Discuss about the Linux real time scheduling strategies in detail.

(6)

7. (a) Consider the following page reference string: 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,and 6.

8. How many page faults would occur for the page replacement algorithms, assuming three

9. and four as frame size? Assume all the frames are initially empty. Compare the results of

10. all the algorithms with respect to frame size.

1. LRU Replacement

2. FIFO Replacement

3. Optimal Replacement

(16)

11. (or)

12. (b) i) Explain segmentation with paging.

(10)

13. ii) Explain the Linux memory management components in detail.

(6)14. (a) i) Describe file structure, File attributes and file operations in detail.

(10)

15. ii) Write a note on free space management of file system.

(6)

16. (or)

17. (b)i) Explain File system in Linux in detail.

(8)

18. ii) Explain various file allocation techniques in detail with their relative advantages and disadvantages.

(8)

19. 15. (a) i) Describe the life cycle of an I/O request with an example.

(8)

20. ii) Explain various RAID levels in detail.

(8)

21. (or)22. (b). i) Explain the various tertiary storage devices with their advantages and limitations. (8)

23. ii) Given the following queue - 95, 180, 34, 119, 11, 123, 62, 64 with the Read-write head initially at the track 50 and the tail track being at 199. Discuss the FCFS, SSTF, SCAN, C-SCAN and C-LOOK algorithms and calculate the total head movements. (8)

24.