060010304 – Fundamentals of Operating...

33
060010304 – Fundamentals of Operating Systems 2015 Mr. Hardik Vyas Page 1 Unit : 1 Introduction of Operating Systems, File Systems and Management Short Questions:- 1. What act as an intermediary between User and Hardware of Computer? Define it. 2. What is the significance of Operating System? 3. List out resources that are managed through the management functions provided within an OS. 4. List of any three examples of Operating System. 5. Define the term memory with reference to Volatility characteristic. 6. What is Non-volatile Memory? 7. Give name of three I/O devices. 8. Define the term interrupt. 9. What process is carried out in interrupt mode of data transfer? 10. What is the purpose of DMA mode at the time of data transfer? 11. State two stages of DMA mode of data transfer. 12. Define Mutual Exclusion. 13. What is Client and Server machine? 14. Define Shell of an OS. 15. Define core component of an OS. 16. Give full form of HCI. 17. Define file. 18. What is file system? 19. What is Compaction? 20. Define file descriptor. 21. List various attributes of file. 22. List any four file type along with their extension. 23. List out operations that can be carried out on file. 24. Which is the UNIX command use to list files from the directory? 25. What is the importance of Inode in UNIX? 26. What information is obtained after the execution of ls-l command? 27. What do you understand by mutual exclusion? 28. State the full form of IPC. 29. What is use to encrypt file in UNIX operating system? Give its name and syntax. 30. Give full form of FCB. 31. State the usage of FCB. 32. State any two flash memory commands Long Questions:- 1. Explain Real Time Control Application. 2. Why we need Operating System? Explain it with reference to the responsibilities of Operating System. 3. Give overview of Operating System by considering modern computer for managing primary resources. 4. Explain how does services provided by an operating system are used efficiently. 5. Discuss various file attributes. 6. Explain various file types. 7. Explain operations that can be performed on file. 8. Describe various file access permissions. 9. Write a short note on file access with its command and security concerns. 10. Explain the structure used to manage all information of file in UNIX operating system. 11. Explain root file system.

Transcript of 060010304 – Fundamentals of Operating...

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 1

Unit : 1 Introduction of Operating Systems, File Systems and Management

Short Questions:- 1. What act as an intermediary between User and Hardware of Computer? Define it. 2. What is the significance of Operating System? 3. List out resources that are managed through the management functions provided within an OS. 4. List of any three examples of Operating System. 5. Define the term memory with reference to Volatility characteristic. 6. What is Non-volatile Memory? 7. Give name of three I/O devices. 8. Define the term interrupt. 9. What process is carried out in interrupt mode of data transfer? 10. What is the purpose of DMA mode at the time of data transfer? 11. State two stages of DMA mode of data transfer. 12. Define Mutual Exclusion. 13. What is Client and Server machine? 14. Define Shell of an OS. 15. Define core component of an OS. 16. Give full form of HCI. 17. Define file. 18. What is file system? 19. What is Compaction? 20. Define file descriptor. 21. List various attributes of file. 22. List any four file type along with their extension. 23. List out operations that can be carried out on file. 24. Which is the UNIX command use to list files from the directory? 25. What is the importance of Inode in UNIX? 26. What information is obtained after the execution of ls-l command? 27. What do you understand by mutual exclusion? 28. State the full form of IPC. 29. What is use to encrypt file in UNIX operating system? Give its name and syntax. 30. Give full form of FCB. 31. State the usage of FCB. 32. State any two flash memory commands Long Questions:- 1. Explain Real Time Control Application. 2. Why we need Operating System? Explain it with reference to the responsibilities of Operating

System. 3. Give overview of Operating System by considering modern computer for managing primary

resources. 4. Explain how does services provided by an operating system are used efficiently. 5. Discuss various file attributes. 6. Explain various file types. 7. Explain operations that can be performed on file. 8. Describe various file access permissions. 9. Write a short note on file access with its command and security concerns. 10. Explain the structure used to manage all information of file in UNIX operating system. 11. Explain root file system.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 2

12. Explain file organization that manages data transfer in terms of blocks. 13. When does fragmentation takes place? Explain its types. 14. State the concept of FCB. 15. Write short note on disk partitions. 16. Describe flash memory. 17. Write a note on Portable storage. 18. Discuss various commands along with its usage that can be used to manage flash memory. 19. Explain allocation methods that are to be considered for file storage management.

Fill in the blanks:- 1. We need ______________ to provide that software layer in a computer system which schedules all

the operations and manages all the computing. 2. The software layer, nearest to hardware, which facilitates launching all the other software

utilities and applications, is called __________. 3. The Operating System ensures each user gets sufficient ___________. 4. A computer executes programs and access data from its main memory, also called ____________. 5. The ___________ helps to manage movement of information between different levels of memory as

well as from and to I/O devices. 6. _________ is also known as volatile memory and ___________ is also known as non-volatile memory. 7. A user usually maintains a large amount of information on bulk storage i.e. ___________ and uses

OS commands to bring in or move out information. 8. The system uses ____________ at an intermediate level of storage technology. 9. User interaction with the system takes place through ___________________. 10. ______________ Mode of data transfer is used wherever a user, or a critical application, requires

immediate attention where as _________ mode of data transfer is used bulk transfer of information.

11. Operating System service routines are resident in a _________ which cannot be directly accessed by a user program or by an application.

12. UNIX user operates in _______________ environment. 13. ____________ is concern with the selection mechanism which allows a user to choose from among

the possibilities such as to open a file, to store or trash. 14. The __________ interprets the Operating System commands and elicits OS services by

communicating with the Kernel. 15. Interprocess communication forms the primary basis for _________________. 16. The program in execution is regarded as a _______________. 17. The machine that seeks the services from other is called _________ and the machine that offers the

services to other is called __________. 18. _____________ is the general-purpose utilities provided by OS that helps us to think in terms of

higher level of operations. 19. _______________ is software which empowers users and applications to organize and manage their

file. 20. ________________ is kept within a file structure and is used by the file system software to help OS to

provide management services. 21. A _____________ as a layer of software provides a logical view of files to user or to an application. 22. The files are stored in secondary storage which provides ______________ view of the file. 23. The owner of the file can alter the permissions using ___________ command of UNIX. 24. _______ File of the system indicates who accessed when and did what. 25. ______________ are the most elementary and constitute a fairly effective form of security measure

in a standalone single-user system. 26. ______________ offers all the information about access rights, file size, its date of creation, usage,

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 3

and modification. 27. _______________ allows better management of the disk space. 28. _______________ memory can be used as an extension to secondary memory. 29. The cell is capable of storing ________ bit information.

State True or False:- 1. Operating system is a software layer nearest to hardware, which facilities launching of other

software utilities and application. 2. The primary resources that one can identify are only memory and I/O devices. 3. Processor time needs to be used by every running application. 4. Secondary storage comes under the Volatile type of memory. 5. Caching is done between Registers and secondary memory. 6. The interrupt mode of data transfer is used for bulk data transfer. 7. OS services are sought by the user via a command interpreter provided by a shell around kernel. 8. HCI provides user the interface through which they can perform various operations in very easy

manner. 9. Server is the machine that seeks services from other machines. 10. The utilities supported by an Operating System make it possible to execute a sequence of

instructions stored in a device driver. 11. Shell protects the system service routines. 12. A program in execution is known as thread. 13. UNIX recognizes only three categories of users: Owner, Group and others. 14. UNIX provides Crypt command to decrypt the files. 15. Flash memory is also used as physically portable memory. 16. The command CE: Chip enable for flash memory. 17. The command ADE: Address latch enable. 18. MTD stands Memory Technology Device.

Multiple Choice Questions:- 1. Which of the following is the software layer nearest to the hardware?

A. Operating System B. Application Software C. Compiler D. Loader

2. Operating System is responsible for A. Providing resources that are required by the user or applications B. Providing initial set-ups C. Services that is required for the communication over the network. D. All of the above

3. Operating System schedules the operations in order. A. Input, Data, Output B. Input, Output, Data C. Data, Input, Output D. Data, Output, Input

4. Operating System ensures that all users get sufficient A. Processor time B. Throughput C. Turnaround time D. Response time

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 4

5. Operating System records the ____________________ that leads to the error condition. A. Parallel events B. Event handler C. Sequence of events D. None of the above

6. Which of the following is increased by having intermediate storage that can absorb different rates or timing of Input and output? A. Processor time B. Throughput C. Turnaround time D. Response time

7. When we turn off the computer, the data from which of the following is lost? A. Non-Volatile Memory B. Volatile Memory C. All of the above D. None of the above

8. Which of the following memory is at the intermediate level of technology? A. Main memory B. Secondary memory C. Registers D. Cache

9. Which of the following is used for User interaction with the system? A. Connection B. I/O devices C. Internet D. Computer

10. Instructions stored in which of the following can be executed by utilities supported by Operating System? A. DMA B. Device Controller C. Device Driver D. registers

11. In which of the following OS service routines are resident? A. Shell B. Kernel C. Main memory D. Cache

12. Which software allows users and applications to organize their files? A. Compiler B. Interpreter C. Loader D. File System

13. The setup stage of DMA mode indicates ___________data will be transfer and ________ it may be located. A. How much, where B. When and where C. What and why D. What and when

14. Three categories of user of file are____________.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 5

A. Owner, group, Other B. User, Owner, Other C. User, group, Other D. Owner, group, user

15. Ls command lists _____________and _____________. A. Files and subdirectories B. Files and folders C. Directories and subdirectories D. Directories and folders

16. ________________are the most elementary and constitute a fairly effective form of security measure in a standalone single-user system. A. Access permission B. Access C. Rights D. Demand

17. ___________offers all the information about access rights, file size, its date of creation, usage, and modification. A. Inode B. Index C. Table D. File

18. A user may use his own _____________________ to encrypt his file when an enhanced level of security is provided for important files. A. Encryption key B. Secret password C. Decryption key D. Master key

19. Subdirectory sbin contains _________________for system use. A. Codes B. Binaries C. Libraries D. Variable data

20. Which of the following is the MS DOS equivalent command for mv command of UNIX? A. Rename B. Copy C. Mkdir D. Move

21. Which of the following command is used to encrypt the files in UNIX? A. Encrypt B. Crypt C. Decrypt D. None of the above

22. Which of the following are the types of files supported by UNIX? A. Directory B. Special C. Named D. All of the above

23. Which of the following subdirectory of Root file system contains shareable binaries in UNIX? A. Sbin

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 6

B. Lib C. Usr D. Etc

24. Which of the following is Command latch enable command for flash memory pins? A. CE B. CLE C. CDE D. CL

Unit : 2 Process and Process Management Short Questions :-

1. Define following terms: a. Process b. Program c. Multi-programming operating system. d. Time-sharing operating system e. Response time f. Waiting time g. Throughput h. Turnaround time i. Processor utilization j. Degree of multi-programming k. CPU burst l. Paging m. Priority n. Short term schedulers o. Long term schedulers. p. Medium term schedulers.

2. What is the purpose of index register? 3. When the system is known as real-time system? 4. List out the terms to be considered within performance evaluation. 5. List out various states of process. 6. Which tasks are performed by OS when the process is created? 7. How identify is given to the process by the OS? 8. What do you understand by Process Control Block (PCB)? 9. What is time slice? 10. What is the significance of Dispatcher? 11. When is a process said to be in ready-to-run state? 12. When process is marked as blocked for IO? 13. What is starvation? 14. What do you understand by scheduling? 15. What is the purpose of scheduler? 16. List out types of scheduler. 17. Which type of scheduler controls the degree of multiprogramming? 18. What do you mean by preemptive scheduling and non-preemptive scheduling? 19. What is batch processing? 20. What is the pitfall of FCFS algorithm? 21. What do you mean by priority in priority scheduling algorithm?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 7

22. What is the solution for indefinite blocking in priority scheduling algorithm? 23. What is meant by context switching? 24. What is the purpose of exponential averaging? 25. On which factor, performance is dependent in Round robin scheduling algorithm? 26. When is process in zombie state in UNIX operating system? 27. Give the command to obtain the information about in UNIX operating system.

Long Questions :- 1. Explain the terms process and program with an example 2. Write a note on Multiprogramming Operating System and Time Sharing Operating System. 3. Discuss process states in detail with diagram. 4. Write a short note on Queuing Model. 5. Give difference between the following:-

a) Process and Program. b) Ready state and running state. c) Preemptive scheduling and Non-preemptive scheduling. d) Long term scheduler and Short term scheduler. e) CPU bound processes and IO bound processes.

6. Explain with example different types of scheduling policies. 7. How to estimate completion time? 8. Which tasks are carried out when context switching occurs? 9. Write a note on exponential averaging technique. 10. Which are the situations considered for processor scheduling? 11. Describe UNIX process state information. 12. Explain with example First Come First Served scheduling algorithm with non-preemption

policy 13. Discuss Shortest Job First scheduling algorithm with non preemption policy. 14. Write short note on Priority scheduling algorithm. 15. Describe Round Robin algorithm with example 16. Explain with example Shortest Remaining Time First scheduling algorithm. 17. Suppose a new process in a system arrives at an average of six processes per minute and each

such process requires an average of 8 seconds of service time. Estimate the fraction of time the CPU is busy in a system with a single processor.

18. What are the factors that need to be considered to determine the degree of multiprogramming in a system?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 8

Algorithm Questions :- 1. Assume you have the following jobs to execute with one processor, with the jobs arriving in

the order listed here. Use FCFS, SJF and Priority non-pre-emptive scheduling algorithm. Processes Execution

Time(milliseconds) Priority

P1 80 2 P2 20 1 P3 10 3 P4 20 5 P5 50 4

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

2. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here. Use FCFS, SJF and Priority non-pre-emptive scheduling algorithm.

Processes Execution Time(milliseconds)

Priority

P1 20 1 P2 10 2 P3 25 0 P4 15 4 P5 5 3

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

3. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here. Use FCFS, SJF and Priority non-pre-emptive scheduling algorithm.

Processes Execution Time(milliseconds)

Priority

P1 15 1 P2 20 0 P3 60 2 P4 17 4 P5 4 3

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

4. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here. Use FCFS, SJF and Priority non-pre-emptive scheduling algorithm.

Processes Execution Time(milliseconds)

Priority

P1 35 2 P2 10 3 P3 60 1 P4 10 5 P5 45 4

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 9

c) What is the average waiting time for the processes? 5. Assume you have the following jobs to execute with one processor, with the jobs arriving in

the order listed here. Use Round Robin pre-emptive scheduling algorithm. Time slice is taken as 10 milliseconds.

Processes Execution Time(milliseconds)

P1 20 P2 10 P3 25 P4 15 P5 5

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

6. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here. Use Round Robin pre-emptive scheduling algorithm. Time slice is taken as 4 milliseconds.

Processes Execution Time(milliseconds)

P1 10 P2 25 P3 17 P4 3 P5 12

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

7. Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here. Use Round Robin pre-emptive scheduling algorithm. Time slice is taken 10 milliseconds.

Processes Execution Time(milliseconds)

P1 20 P2 10 P3 25 P4 15 P5 5

a) Create a Gantt (timeline) chart illustrating the execution of these processes? b) What is the average turnaround time (time of execution) for the processes? c) What is the average waiting time for the processes?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 10

Fill in the blanks :- 1. _________ is a passive text script where as _____________ is a program in execution. 2. _________ OS allows and manages several programs to be simultaneously resident in main

memory. 3. When the resident programs in a multi-programming environment belong to different users

then it is ________________ OS. 4. ___________ computing requires that, to execute program it must be resident in _________. 5. Having just single program in main memory may result in gross ________________________ of the

processor. 6. For a system to be time sharing, it must support_____________________________. 7. The greater is the utilization of processor; the ____________ is the information is processed. 8. If the system responds in reasonably ___________ time, then the user would not even aware of

the presence of other users and the services rendered to them. 9. ________________________ is the time interval which spans the time from when the last character

has been input to the time when the first character of the output appears. 10. When processor is engaged by the process, it is said to be in __________ state. 11. When process is waiting for IO to be completed it is considered in __________ state. 12. When a process terminates then it moves to ___________ state. 13. A ________ process can be scheduled by the OS to execute. 14. The process marked as ________ can be scheduled to run. 15. Sometimes the process is not able proceed till it gets _____________ signals. 16. ______________ plays an important role in the management of the process. 17. ______________ is like Denial of Services. 18. The operating system has _______________ program which chooses one of the ready-to-run

processes and assign it to the processor. 19. The maximum delay of lower priority process ____________ when the higher priority process

begin to populate the system. 20. The operating system estimate the processing time for the process by monitoring a process’s

_______ estimate and __________ activity. 21. _______________________________ formula for exponential averaging. 22. The process of moving processes in and out of main memory to disk is called____________. 23. The process context area is also called_____________________________. 24. OS performance tuning is done by making a choice of a scheduling policy which enhances the

____________. 25. ___________ policy consideration influences immediate productivity concerns.

State true or false:

1. Process is a live mechanism that is passive where as program is an active. 2. When several programs are managed and resident simultaneously in memory it is called

Time sharing OS. 3. The system where the resources are shared by many users is called Time Sharing System. 4. The processor manages all the migration of the processes between the process states. 5. The process data structure records the state of the process. 6. The OS is not able to allocate time slots to run the process. 7. Scheduling policy selection criteria indicate that the measures for processor utilization and

throughput are user-centered requirements. 8. When processes are scheduled according to the importance of the process is called priority

based scheduling. 9. In non-preemptive operations, the process is suspended to attend interrupt or the process

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 11

has consumed its allocated time slot. 10. The process of moving process in and out of main memory is called swapping. 11. Scheduling policy selection criteria indicate that the measures for response time and turn-

around are system-centered requirements. 12. A long term policy consideration influences immediate productivity concerns. 13. The processes that are in secondary memory and not loaded yet would be in long-term

concerns. 14. In UNIX all the processes are created by a parent process by issuing a system call. 15. The OS monitors the progress of every process during its lifetime.

Multiple Choice Questions :- 1. Which of the following is the central and key element of the computer system?

A. Processor B. Secondary device C. Keyboard D. mouse

2. Which of the following is enhanced, when multiple programs are resident in memory? A. Throughput B. Memory utilization C. Response time D. Waiting time

3. When process is having all the resources except processor then it is considered in which of the following state?

A. Wait B. Ready-to-run C. Exit D. New

4. Which of the following expression provides CPU utilization, if the waiting time for a process is p and there are n processes in the memory? A. p / n B. p ^ n (p raised to n) C. 1 – p ^ n D. n – ( p ^ n)

5. When a program is in execution it is called A. action B. task C. process D. activity

6. Which of the following term is given to the time interval which spans the time from when the last character has been input to the time when the first character of the output appears? A. Waiting time B. Turnaround time C. Response time D. Throughput

7. A process is which of the following type of entity. A. active B. passive C. moral D. blocked

8. When the process is loaded in the memory it is in which of the following queue?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 12

A. device B. ready C. job D. circular

9. Which of the following is called the process context area? A. Process control block B. Process state C. Program counter D. Processor time

10. Which of the following manages all the migrations between process states? A. Processor B. Dispatcher C. Operating system D. IO

11. Which of the following data structure is maintained by OS to manage the process? A. Stack B. Link list C. Tree D. Queue

12. In round robin algorithm, which of the following type of value (q) for time slice creates overhead of context switching? A. large B. small C. regular D. moderate

13. Which of the following term is used for the technique of moving the process in and out of memory? A. Connection B. swapping C. switching D. shifting

14. In exponential averaging technique, which of the following value of alpha ignore the past history? A. 1 B. 0 C. maximum D. minimum

15. Up till which of the following the operating system monitors the overall progress of process? A. lifetime B. lifeline C. deadline D. response time

16. Which of the following scheduler implement the technique of swapping? A. Short term B. Long term C. Medium term D. Coarse term

17. Which of the following is the alias name of the short term scheduler? A. CPU

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 13

B. Job C. Strict D. Routine

18. Which of the following scheduling allows a higher priority process to replace a currently running process even if it’s time slice is not over or it has not requested for any IO? A. Pre-emptive B. Non-pre-emptive C. Distinctive D. Supportive

19. A process is said to be in which of the following state when it is waiting for IO to be completed. A. Wait B. Ready C. Run D. exit

20. Which of the following instruction address is stored by the program counter element of PCB? A. Next B. First C. Last D. previous

Unit 3 Memory Management

Short Questions :- 1. Define the following terms :

a) Compile time b) Load time c) Execution time d) Page e) Page-fault f) frame g) Paging h) Page-table i) Frame j) Segment k) Segmentation l) Locality of reference m) Fragmentation n) Garbage Collection o) Compaction p) Swapping q) Virtual Memory r) Logical Address s) Physical Address t) Overlay u) Thrashing v) TLB w) Compile time binding x) Load time binding y) Execution time binding

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 14

2. What is the significance of first fit memory allocation policy? 3. From where does scanning for blocks begin in next fit memory allocation policy? 4. State the drawback of best fit memory allocation policy. 5. What do you understand by worst fit memory allocation policy? 6. What do you understand by TSR? 7. What is page hit and page miss? 8. Differentiate between logical address space and physical address space. 9. State the functionality of the following:

PTBR, PTLR, STBR, STLR 10. What is dynamic linking? 11. What do you understand by fixed partitioning and variable partitioning? 12. What do you mean by overlays? 13. Differentiate between physical memory and virtual memory. 14. When does the page fault occur? 15. What is the significance of Page Replacement Policy? 16. What do you mean by trap? Long Questions :-

1. Give the relative pros and cons of load time dynamic linking and run-time dynamic linking. Differentiate them from static linking.

2. Explain stages of linking and loading. 3. Explain the three different stages for binding of instructions and data to memory with

necessary diagram. 4. Differentiate between contiguous memory allocation and non-contiguous memory allocation. 5. Give arguments to support variable partitioning for main memory management. 6. Describe the first fit, best fit, next fit and worse fit strategies for disk space allocation. 7. Write a note on memory management technique of segmentation with necessary diagram. 8. Explain the memory management technique of paging with necessary diagram. 9. Justify: There are pros and cons of choosing a small as well as large page size. 10. Discuss the scheme that falls between fixed and dynamic partitioning. 11. Write the steps for handling page fault with necessary diagram. 12. Describe the technique of swapping with necessary diagram. 13. Why page size is always power of 2? 14. Describe FIFO, LRU and NFU page replacement algorithm with their advantages and

disadvantages. 15. Give difference between the following :-

a) Paging and Segmentation b) Internal fragmentation and External fragmentation

16. When does thrashing occur? How does system detects it? What system can do to overcome this problem?

17. What is fragmentation? Different types of fragmentation? 18. Consider a movie player application that supports functions like play movie, skip forward x

frames and skip backward x frames. Suggest a memory management policy that will be best suited for this application.

Algorithm Questions :-

1. 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,6 How many page faults is occur for the following replacement? Consider the memory is empty

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 15

initially. And memory having 5 frame: 1) LRU Page Replacement 2) FIFO Page Replacement 3) Optimal Page Replacement

2. Consider following page reference string:

1, 2, 3, 4, 1, 4, 5, 6, 2, 1, 3, 7, 4, 2, 1, 3, 5, 6, 2, 1 How many page faults is occur for the following replacement? Consider the memory is empty initially. Memory having 4 frames.

1) LRU page replacement 2) FIFO page replacement

3. Consider the following page reference string:

1,2,3,4,1,6,5,6,2,1,3,7,4,2,1,3,5,7,2,1 How many page faults are occurring for the following replacement? Consider the memory is

empty initially and memory having 4 frame. 1) LRU Page Replacement 2) FIFO Page Replacement 3) Optimal Page Replacement

4. Consider the following page reference string:

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 How many page faults are occurred for the following replacement? Consider the memory is

empty initially. And the memory with 3 frames: 1) LRU Page Replacement 2) FIFO Page Replacement 3) NFU Page Replacement

Fill in the blanks :- 1. If a program is moved out or terminates, it creates a __________ in main memory. 2. If an item is deleted from a dynamic data structure, then OS does not collect free space

immediately for allocation. So such areas are called ____________. 3. When the executable is resident in the main memory, it is a ________ process. 4. We cannot load the process even if space is there in memory as some process other is

currently occupying the area which is needed by the process. So to overcome this problem processes are generated to be ______________.

5. The address allocation by the compiler is called _____________. 6. ___________ involve moving data and program segments in and out of memory essentially

reusing the area in main memory. 7. Both fixed and dynamic partitioning suffers from ______________ fragmentation. 8. Paging suffers from ___________ _______________ and Segmentation suffers from __________

____________. 9. Base register holds the _________________. 10. TLB stands for ___________________________________________________. 11. ______________fragmentation refers to the wasted space internal to a partition due to the fact

that the block of data loaded is smaller than the partition. 12. __________fragmentation is a phenomenon associated with dynamic partitioning, and refers to

the fact that a large number of small areas of main memory external to any partition. 13. The technique that has been used to keep both internal and external fragmentations low is

_____________ partitioning.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 16

14. The actual size of main memory is referred to as ____________ memory and the logical addressable space is referred to as _________ memory.

15. During the execution of the process it generates instructions and data references from within a small range which is referred to as __________________.

16. Paging implementation requires _________ and _________. 17. The memory management technique paging implements _____________ linking of data and

instructions. 18. The memory management technique segmentation implements _______________ linking of data

and instructions. 19. ____________ is caused by under-allocation of the minimum number of pages required by a

process, forcing it to continuously page fault. 20. The system can detect ___________ by evaluating the level of CPU utilization as compared to the

level of multiprogramming. 21. The set of pages being used by a process is referred to as _________ and the set of pages needed

by a process at a time is referred to as ______________. 22. OS defines ___________ as a fixed time interval preceding the current time. 23. The drop in the level of system throughput resulting from frequent page replacement is

called ____________. 24. Thrashing can be eliminated by reducing the level of __________________________. 25. Physical memory is divided into _____________. 26. Logical memory is divided into __________. 27. A frame has a same size as ________ size. 28. The ______________ memory allocation policy allocates the smallest block among those that are

large enough for the new process. 29. Logical address space is a collection of ____________. 30. ____________ supports table look-up for a segment and an offset within that segment.

State True or False :- 1. Block oriented devices are recognized as special files. 2. Logical and physical addresses are the same in compile-time and load-time address-binding

schemes. 3. Linking postponed until execution time is referred to as static. 4. A small piece of code, stub, used to locate the appropriate memory-resident library routine. 5. The memory allocation policies first-fit and best-fit are better than worst-fit in terms of speed

and storage utilization. 6. External fragmentation means that the total memory space exists to satisfy a request, but it is

not contiguous. 7. To minimize external fragmentation, a technique known as compaction is used. 8. The buddy system of partitioning relies on the fact that space allocations can be conveniently

handled in sizes of power of 2. 9. Paging implementation requires HW and SW support. 10. Page can be defined as same sized blocks in logical memory. 11. Page offset is used as an index into a page table which contains base address of each page in

physical memory. 12. Page-table length register (PRLR) indicates size of the page table. 13. The buddy system has the advantage that it minimizes external fragmentation. 14. In paging, a process address space is linear (uni-directional). 15. Paging support locality of reference for efficient access 16. The FIFO page replacement policy simply removes pages in the order they arrived in the

main memory.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 17

17. In thrashing technique, a process is busy swapping pages in and out. 18. A program is a collection of segments. 19. Segmentation is the scheme that supports virtual memory. 20. TLB decrease the performance of page frame access. 21. With best fit, variable partitions minimize internal fragmentation.

Multiple choice questions:-

1. Which of the following are issues related to main memory? A. Allocation B. Garbage collection C. Protection D. All of the above

2. Fixed and dynamic partitioning suffers from which of the following fragmentation? A. Internal B. External C. None D. Both A and B

3. Which of the following is/are fastest memory allocation policy? A. First Fit B. Best Fit C. Worst Fit D. Next Fit

4. What replacement policy is used by Windows NT? A. LRU B. NFU C. FIFO D. Clock Replacement

5. If the hit ratio to a TLB is 80%, and it takes 15 nanoseconds to search the TLB, and 150 nanoseconds to access the main memory, then what must be the effective memory access time in nanoseconds?

A. 185 B. 195 C. 205 D. 175

6. If the no of pages in a 32 bit machine is 8kB then what is the size of the page table? A. 8kb B. 16kb C. 4kb D. Can’t say

7. In a 64 bit machine, with 256 MB RAM, and a 4KB page size, how many entries will there be in the page table if it’s inverted?

A. 2^16 B. 2^50 C. 2^14 D. 2^10

8. 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.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 18

D. will always lead to a page fault. 9. Relocatable programs

A. cannot be used with fixed partitions B. can be loaded almost anywhere in memory C. do not need a linker D. can be loaded only at one specific location

10. The memory allocation scheme subject to “external” fragmentation is A. segmentation B. swapping C. pure demand paging D. multiple fixed contiguous partitions

11. Page fault frequency in an operating system is reduced when the A. processes tend to the I/O-bound B. size of pages is reduced C. processes tend to be CPU-bound D. locality of reference is applicable to the process

12. Which of the following is a technique of temporarily removing inactive programs from the memory of computer system? A. Swapping B. Spooling C. Semaphore D. Scheduler

13. Which of the following is concern with Paging memory management scheme ? A. Permits the logical address space of a process to be non-contiguous B. Avoids external fragmentation and the need for compaction C. Solves the considerable problem of fitting memory chunks of fixed sizes onto the

backing store D. All of the above

14. Which of the following methods of binding instructions and data to memory is performed by most general-purpose operating systems? A. interrupt binding B. compile time binding C. execution time binding D. load time binding

15. Which of the following is an address generated by a CPU? A. physical address B. logical address C. post relocation register address D. Memory-Management Unit (MMU) generated address

16. Which of the following partitioning relies on the fact that space allocations can be conveniently handled in sizes of power of 2?

A. Fixed B. Variable C. Dynamic D. Buddy

17. Suppose we are operating with execution-time binding and the physical address generated is 305. The relocation register is set to 99. What is the corresponding logical address?

A. 404 B. 206

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 19

C. 200 D. 305

18. Which of the following is true for dynamically linked library? A. loading is postponed until execution time B. system language libraries are treated like any other object module C. more disk space is used than the option of using a statically-linked library D. a stub is included in the image for each library-routine reference

19. Which of the following dynamic storage-allocation algorithms results in the largest leftover hole in memory?

A. first fit B. best fit C. worst fit D. next fit

20. Which of the following is true of compaction? A. It can be done at assembly, load, or execution time. B. It is used to solve the problem of internal fragmentation. C. It cannot shuffle memory contents. D. It is possible only if relocation is dynamic and done at execution time.

21. Which if the following is the purpose of a Memory Management Unit? A. perform run-time mapping from virtual to physical addresses B. ensure protection of the memory space allocated to every process C. Both A and B are correct responses. D. Neither A nor B

22. What is the process called when executable are resident in main memory? A. Ready B. Runnable C. New D. None of the above

23. Which of the following type of partition has the problem of internal fragmentation? A. Fixed B. Variable C. Dynamic D. All of the above

24. Which of the following result when we find that a page frame reference is in main memory? A. Page hit B. Page miss C. Cache hit D. Cache miss

25. Which of the following problem is raised due to the frequent page replacement (Thrashing)?

A. Reduce throughput B. Minimize page fault C. Maximize page fault D. None of the above

Unit 4: Input Output Management

Short questions 1. Which are the three levels where device communication is required? 2. List out character-oriented devices. 3. What does OS provides for uniform and easy-to-use IO mechanism?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 20

4. List out various IO handling mechanisms. 5. List out four basic modes of IO operations. 6. What is the significance of Programmed Data mode of IO operation? 7. What is polling? 8. What is interrupt? 9. List three types of interrupt. 10. What is meant by system mode and user mode operations in software interrupt? 11. When DMA mode of data transfer is used? 12. Define Device Driver. 13. What do you mean by buffer? 14. Where does the information of DMA control stored? 15. Give full form for following:

PDA, IRQ, ISR, IVR, IVT, MMIO, USB, WUSB 16. What is the significance on MMIO operation? 17. List out the steps that are performed in MMIO. 18. Define single buffer, double buffer and circular buffer. 19. What do you understand by rotational latency? 20. What is downstream and upstream communication in terms of USB? 21. What is blind mating in USB? 22. In which categories USB specifications classifies device communication? 23. What is system bus? 24. List of modes of communication that are supported by PCI bus. 25. What is service discovery protocol? 26. What is logical link control and adaptation protocol? 27. What is link management protocol? 28. What do you mean by Hot-swappable in terms of USB? 29. What is the significance of CDE? 30. Define Spooling, IO channels, Caching. 31. What is the importance of Clock in CPU?

Long questions

1. Explain in detail issues in Input output management. 2. Explain any two basic modes of IO operations. 3. Write a note on Interrupt mode of IO operation. 4. Discuss Issues handling interrupts. 5. What are the different modes of Interrupt? How is polling achieved? 6. Describe programmed data mode of input output organization. 7. How is the interrupt enabled and detected? 8. What is an interrupt vector? How is the interrupt service obtained with vectored interrupt? 9. Write the steps for servicing an interrupt. 10. Explain in detail IO operation that supports the illusion that IO is performed at specified

memory address. 11. Explain Direct Memory Access mode of data transfer. 12. State memory mapped IO, port-mapped IO and logical port-based IO modes of data transfer. 13. What is a device driver? Give a schematic explaining how a device driver helps establish

device communication. 14. Explain the process that is performed to handle each IO request from an application. 15. Explain how interrupt can be handled using device drivers. 16. Discuss the concept of management of buffers.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 21

17. What is the purpose of resource table? 18. Explain the disk scheduling policies of FCFS, SSF, Elevator and circular scan. 19. Write a short note on universal serial bus (USB). 20. Explain PCI bus. 21. List out System calls supported by device driver for device specific functionalities. 22. Write a short note on Bluetooth interface. 23. Suppose that a disk drive has 200 cylinders, numbered from 0 to 199. The disk head is

initially at cylinder 53. The queue of pending requests, in FIFO order, is : 98, 183, 37, 122, 14, 124, 65, 67 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms?

a) FCFS c) Scan (Elevator) b) SSTF d) C-Scan

24. Suppose that a disk drive has 200 cylinders, numbered from 0 to 199. The disk head is initially at cylinder 90. The queue of pending requests, in FIFO order, is : 59, 41, 172, 74, 52, 85, 139, 12, 194, 87 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms?

c) FCFS c) Scan (Elevator) d) SSTF d) C-Scan

25. Discuss classification of devices and modes of communication given in USB specification. Fill in the blanks

1. OS provides ______________ for uniform and easy to use IO mechanism. 2. The OS manages buffer to comply with the requirements of both the ________ & ________ of data. 3. Most network cards are _________ enabled to facilitate DMA mode of IO with communication

infrastructure. 4. Synchronizing Events for the process communicate through _______________. 5. In Programmed data mode, an IO instruction is issued to an IO device and the program

executes in ____________ mode till the IO is completed. 6. PDA stands for __________________. 7. A key characteristic of embedded systems is to recognize occurrence of __________which may

be by monitoring variable values or identifying an event. 8. In _______________________mode an IO instruction is issued to an IO device and the program

executes in “busy-waiting” (idling) mode till the IO is completed. 9. During the _____________ period the processor is continually interrogating to check if the device

has completed IO. 10. In _____________ mode of data transfer, the system interrogates each device in turn to

determine if it is ready to communicate. 11. In internal interrupt, the source of interrupt may be a _______________resident process or a

function from within the processor. 12. By setting ________________, user can disable some interrupt request lines to send interrupt

requests. 13. In __________ mode of data transfer, IO is performed on large data blocks. 14. If a higher priority device seeks an interrupt, the __________ priority device may be denied the

per-mission to raise an interrupt. 15. The direct memory access, or DMA ensures access to main memory without processor

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 22

intervention or support. Such independence from processor makes this mode of transfer extremely ____________.

16. The DMA control requires the information on __________address in main memory and size of data for transfer.

17. A device driver is a specialized _____________. 18. The buffers are usually set up in the ________ memory. 19. When a process initiates ___________ transfer, its execution is briefly suspended using an

interrupt to set up DMA control. 20. The network-oriented traffic between machines may be handled in __________ mode. 21. An IO operation is the combination of _______ and __________ instructions. 22. BT hardware node has _________ and ____________ module. 23. An additional arm movement is required when information is stored on different cylinder,

which results in some delay referred to as _______________. 24. ___________ refers to the time spent in waiting for a sector in rotation to come under the read or

write head. 25. BT protocol encourages devices to _____________ communicate. 26. BT is regulated by ____________ that can be mounted on communicating device.

State true or false

1. OS is not able to manage buffer for uniform and easy to use IO mechanism. 2. Event-generating devices and character-oriented devices are IO devices that operate at good

rate. 3. PDA or mobile phones can act as an access device. 4. Programmed data mode IO operation does not ensure that an execution of IO instruction

shall not advance till it is completed. 5. Polling is commonly used by systems to interrogate ports on a network. 6. In external interrupt source of interrupt is other than process or process-related events. 7. It is impossible to disable interrupt from interrupt request lines. 8. The three types of interrupts are internal interrupt, external interrupt and user defined

interrupt. 9. IO management requires that a proper set-up is created by an application on computer

system with an IO device. 10. DMA is the most preferred mode of communication to support network traffic. 11. The DMA controller records the receipt of relevant information and acknowledges the DMA

complete. 12. The modes of IO stipulate whenever IO happens with a device it requires writing into or

reading from device controller register. 13. MMIO operation supports illusion that the read or write operation is happening from or to

certain locations in the address space. 14. MMIO does not require sharing a part of virtual address space. 15. The networked systems employ the concept of a socket to connect hosts. 16. The interrupt transfer is ideally suited for a large amount of critical information. 17. Device driver is not able to communicate with IO devices. 18. Device Driver is specifically written to manage communication with an identified class of

devices. 19. Device drivers present a uniform interface to the OS. 20. In double buffer, there is single buffer. 21. The double buffer is a circular queue of size two. 22. The buffers are usually set up in the main memory.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 23

23. In the C-scan policy service is provided in one direction and then wraps round. 24. FCFS is not a very good policy. 25. The first come first served policy entails that the service be provided strictly in the sequence

in which the requests arrived. 26. With multi-programming, there will be many user jobs seeking disk access. 27. The disk IO is always in terms of blocks of data. 28. The IO is to read from, or write into, a main memory. 29. OS uses CPU clock to provide a variety of system-and application-based services. 30. Most OS reserves some address space for use as exclusive addresses for devices. 31. USB port is not able to support Plug-and-play devices. 32. Bulk transfer is usually medium speed devices such as printer. 33. Isochronous transfers are carried out without any error correction support. 34. BT is short range radio interface.

Multiple choice questions

1. Which of the following types of data are managed by OS with the help of buffer? A. Producer B. Consumer C. Instruction D. Both A & B

2. Which of the following can be used as an access device? A. PDA B. Mobile phones C. Processor D. Both A & B

3. Which of the following are character-oriented devices? A. Keyboard B. Voice-based input C. Mouse D. All of the above

4. Which of the following are the basic modes of IO operations? A. Programmed mode B. Polling mode C. DMA mode D. All of the above

5. In which of the following mode an IO instruction is issued to an IO devices and the program executes in busy waiting mode till the IO is completed?

A. Programmed Data mode B. Interrupt mode C. DMA mode D. Polling mode

6. In which of the following mode of data transfer, the system interrogates each device in turn to determine if it is ready to communicate or not?

A. Programmed Data mode B. Interrupt mode C. DMA mode D. Polling mode

7. Which of the following are the types of interrupts? A. Internal

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 24

B. External C. Software D. All of the above

8. Which of the following modes of operations are offered by OS? A. User mode B. System mode C. Both A & B D. None

9. Which of the following is the source of internal interrupt? A. Memory resident process B. Function within processor C. Other than processor related events D. Only A & B

10. Identify the form of communication best describes the IO mode amongst the following: A. Programmed mode of data transfer B. DMA C. Interrupt mode D. Polling

11. From amongst the following given scenarios determine the right one to justify interrupt mode of data transfer era Systems Prof. P. C. P. Science A. Bulk transfer of several kilo-byte B. Moderately large data transfer but more that 1 KB C. Short events like mouse action D. Key board inputs

12. Which of the following can be nested interrupts: A. Soft-ware interrupts B. Hardware interrupts C. External interrupts D. None of the above

13. DMA is set up using an interrupt A. True B. False

14. Suppose a DMA is set up to transfer 100KB data. Identify which of the following statements are true. A. The processor is interrupted after every byte of transfer B. The processor interrogates at the end of every clock cycle if the transfer is complete C. The DMA transfer the data independent of processor till the transfer is completed. D. None of the above

15. Which of the following is present in DMA controller? A. Acknowledge B. Interrupt C. Read/write lines of control D. All of the above

16. Which of the following requires sharing a part of virtual address space? A. Port-mapped IO B. Memory Mapped IO C. Logical Port-based IO D. B & C

17. Which of the following is the full form of SSTF?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 25

A. Shortest-Seek-time-first scheduling B. Small – small-time-first scheduling C. Simple-seek-time-first scheduling D. Small-simple-time-first scheduling

18. For what types of operations is DMA useful? A. For large & fast data transfers between memory & I/O devices. B. For large & slow data transfers between memory & I/O devices. C. For slow & small data transfers between memory & I/O devices. D. For small data transfers between memory & cache.

19. The programmed mode of IO is a blocking IO. A. True B. False

20. We describe a protocol of input device communication below. A. Each device has a distinct address B. The bus controller scans each device in sequence of increasing address value to

determine if the entity wishes to communicate. C. The device ready to communicate leaves it data in IO register. D. The data is picked up and the controller moves to step-a above.

21. Which of the following system calls are supported by Device Driver? A. Open() B. Close() C. Lseek() D. All of the above

22. DMA is set up using an interrupt C. True D. False

23. Suppose a DMA is set up to transfer 100KB data. Identify which of the following statements are true. E. The processor is interrupted after every byte of transfer F. The processor interrogates at the end of every clock cycle if the transfer is complete G. The DMA transfer the data independent of processor till the transfer is completed. H. None of the above

24. A Double buffer is a cyclic buffer with cycle length of 2. A. True B. False

25. Who amongst the following sets the timer for pre-emptive scheduling: A. The user B. The processor clock C. The operating system scheduler D. None of the above

26. IO channels are merely communication wires with no buffers. A. True B. False

27. Put the following disk scheduling policies in the order that will result in minimum amount of head movement. A. FCFS B. Circular scan C. Elevator algorithm D. SSF

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 26

28. Which of the following is the term used for the time taken by the head to move to the appropriate cylinder or track?

A. response time B. seek time C. rotational latency D. waiting time

29. Which of the following is the term used for the total time to prepare a disk drive mechanism for a block of data to be read from? A. latency B. latency plus transmission time C. latency plus seek time D. latency plus seek time plus transmission time

30. Which of the following layers are present in Bluetooth stack architecture? A. Discovery layer B. L2CAP protocol layer C. Transport layer D. All of the above

31. Microprocessor architecture supports internal and external high speed bus. They are also known as A. Front-end bus and back-end bus B. Local bus and system bus C. Address bus and data bus D. Only A & B

32. Which of the following cable and connector configuration is offered by USB to cover the possibility of being able to connect the range of devices (Flexibility of connection)? A. Auto-detect B. Plug-n-play C. Blind mating D. None of above

Unit 5: Resource Sharing and Management

Short questions 1. What is the main responsibility of OS services? 2. On which characteristics of resource scheduling policy is depended? 3. Which policy of OS affects the overall throughput of a system? 4. Define the following terms :-

a) Deadlock b) Starvation c) Resource Allocation Graph d) Wait for graph e) Request Edge f) Assignment Edge g) Claim Edge

5. What must the banker’s know a priori in order to prevent deadlock? 6. List the four necessary conditions for deadlock. 7. What is safe state? 8. Give any one difference between deadlock and starvation. 9. How does one can avoid deadlock to occur? 10. What do you understand by the following terms:

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 27

Mutual exclusion, hold and wait, no preemption, circular wait 11. What is the other name for mutual exclusion? 12. What does available, allocation, need, maximum data structure represents in banker’s

algorithm? 13. List out various deadlock detection algorithm.

Long questions

1. Explain with example why there is need of scheduling. 2. Give the difference between co-operating process and independent process. 3. Explain the system model for resource utilization by the process. 4. Write short note on resource allocation graph. 5. Describe four general strategies for dealing with deadlocks. 6. Explain the four necessary conditions for the occurrence of deadlock. 7. Describe the general strategy behind deadlock prevention, and give an example of a practical

deadlock prevention method. OR Explain the technique of deadlock prevention.

8. What is a Safe State and its’ use in deadlock avoidance? OR Explain the technique of deadlock avoidance.

9. Describe the technique of deadlock detection and recovery. 10. Assuming the operating system detects the system is deadlocked, what can the operating

system do to recover from deadlock? 11. What is a deadlock? What is starvation? How do they differ from each other? 12. Explain any one deadlock detection algorithm.

Fill in the blanks

1. To enforce temporal sharing of a common resource, the _______ needs a policy to schedule its usage.

2. Many approaches to achieving mutual exclusion are software solutions that require the use of a technique called ______________.

3. The resource allocation policy of OS can affects the overall __________ of a system. 4. The classic concurrency problem that involves readers and writers that can both read from

and write to a shared data area is the _______________________ problem. 5. The permanent blocking of a set of processes that either compete for system resources or

communicate with each other is __________. 6. Access to shared data resource that establishes ________________ must be mutually exclusive. 7. All deadlocks involve conflicting needs for resources by ___________or more processes. 8. The __________________policy condition, which says a process may hold allocated resources

while awaiting assignment of others, must be present for a deadlock to be possible. 9. A/An___________ state is one in which every potential sequence of allocation of resources to

processes results in a deadlock. 10. In Deadlock Detection, the O/S periodically performs an algorithm that allows it to detect the

__________________ condition. 11. Once a deadlock has been detected, some strategy is needed for __________________. 12. The situation where Process 1 (P1) holds Resource 1 (R1), while P2 holds R2, and P1 needs

R2 to complete and P2 needs R1 to complete is referred to as __________________. 13. In Deadlock Avoidance, the Resource Allocation Denial strategy is also referred to as the

____________________________.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 28

14. Every process awaits release of at least one resource held by some other processes is called ___________.

15. __________ result in releasing resources which can help some processes to progress, thereby breaking the deadlock.

16. Non-deterministic nature of ____________ algorithm always detects deadlock but does not help to eliminate an existing deadlock.

State true or false

1. Scheduling policy can be used to enforce temporal sharing of a common resource. 2. The circular-wait condition for a deadlock implies the hold-and-wait condition. 3. Resource allocation policy does not affect the overall throughput of a system. 4. Protocols to prevent hold-and-wait conditions typically also prevent starvation. 5. The wait-for graph scheme is not applicable to a resource allocation system with multiple

instances of each resource type. 6. Starvation refers to the situation where competing processes are denied access to a resource

due to scheduling problems. 7. The condition in which each resource is assigned to at most one process only is called mutual

exclusion. 8. One of the most common approaches for recovery from deadlocked processes is to abort all

deadlocked processes. 9. It is possible to avoid deadlock. 10. All deadlocks involve conflicting needs for resources by two or more processes. 11. Although deadlock can potentially exist without it, the condition known as Circular Wait is

required for deadlock to actually take place. 12. An unsafe state may lead to a deadlocked state. 13. If a resource allocation graph has a cycle, the system must be in a deadlocked state. 14. A claim edge of a resource allocation graph indicates that a process may request a resource

at some time in the future. 15. A deadlock-free solution eliminates the possibility of starvation. 16. Banker’s and matrix-based deadlock detection algorithm does not help of eliminate existing

deadlock. Multiple choice questions

1. The scheduling policy of OS depends on which of the following characteristics of resource? A. Nature of resource B. Frequency of its use C. Context of its usage D. All of the above

2. Which of the following is affected by resource allocation policy? A. Throughput B. Latency C. Usage D. Response time

3. Which of the following term is given to the condition in which before proceeding with its execution, each process must acquire all the resources it needs? A. hold and wait B. no pre-emption C. circular wait D. starvation

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 29

4. In which of the following situation a deadlocked state occurs? A. A process is waiting for I/O to a device that does not exist.

B. The system has no available free resources.

C. Every process in a set is waiting for an event that can only be caused by another process

in the set.

D. A process is unable to release its request for a resource after use.

5. Which of the following is the necessary condition for deadlock, which states that at least one resource must be held in a non-sharable mode? A. hold and wait B. mutual exclusion C. no pre-emption D. circular wait

6. Which of the following is true for system resource-allocation graph? A. a directed edge from a process to a resource is called an assignment edge

B. a directed edge from a resource to a process is called a request edge

C. a directed edge from a resource to a process is called a request edge

D. none of above

7. Which of the following statements is true? A. A safe state is a deadlocked state. B. A safe state may lead to a deadlocked state. C. An unsafe state is necessarily, and by definition, always a deadlocked state. D. An unsafe state may lead to a deadlocked state.

8. Which of the following is concerned with a cycle in a resource-allocation graph? A. a necessary and sufficient condition for deadlock in the case that each resource has more

than one instance B. a necessary and sufficient condition for a deadlock in the case that each resource has

exactly one instance C. a sufficient condition for a deadlock in the case that each resource has more than once

instance D. is neither necessary nor sufficient for indicating deadlock in the case that each resource

has exactly one instance 9. Which of the following is most often used by operating systems to handle deadlocks?

A. Pretend that deadlocks never occur B. Use protocols to prevent or avoid deadlocks C. Detect and recover from deadlocks D. None of above

10. Which of the following data structures in the banker's algorithm is a vector of length m, where m is the number of resource types?

A. Need B. Allocation C. Maximum D. Available

11. Suppose that there are 10 resources available to three processes. At time 0, the following data is collected. The table indicates the process, the maximum number of resources needed by the process, and the number of resources currently owned by each process. Which of the following correctly characterizes this state?

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 30

Process Maximum Needs Currently Allocated

Po 10 4

P1 3 1

P2 6 4

A. It is safe B. It is not safe C. It is in deadlock state D. Can’t determine state

12. The banker’s algorithm is used to A. Prevent deadlock in operating system B. Detect deadlock in operating system C. Rectify a deadlocked state D. Avoid deadlock in operating system

13. Which of the following is the situation in which a process is waiting on another process, which is also waiting on another process which is waiting on the first process? None of the processes involved in this circular wait are making progress A. Deadlock B. Starvation C. Dormant D. Mutual Exclusion

14. 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

15. In the resource allocation denial approach to Deadlock Avoidance, a safe state is defined as one in which :

A. At least one potential process sequence does not result in a deadlock B. All potential process sequences do not result in a deadlock C. Several potential process sequence do not result in a deadlock D. None of the above

16. A system has two types of resources, R1 and R2, both of which have two instances of their respective resource types. There are four processes competing for resources. Assume that the following system state exists: P1 : R1 is requested, R2 is allocated P2 : R1 is allocated P3 : R1 is allocated, R2 is requested P4 : R2 is allocated What does the system state?

A. contains a cycle, and it is deadlocked B. contains a cycle but it is not deadlocked C. contains no cycles and is not deadlocked D. contains no cycles and is deadlocked

17. Which of the following is not a necessary condition for a deadlock? A. Mutually exclusive use of a resource by processes. B. Partial allocation of resources to a process.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 31

C. Pre-emptive scheduling of resources. D. Circular waiting by processes

18. Which of the following is not the condition for a deadlock to occur? A. Mutual exclusion B. Hold and wait C. No preemption D. Race condition

19. Which of the following is deadlock detection algorithm? A. Banker’s B. Matrix-based C. Graph-based D. All of the above

Unit 6: Mutual Exclusion

Short questions 1. What do you mean by race condition? 2. Define the term Semaphore. 3. What do you understand by critical section? 4. What are two operations used by semaphore? 5. List the types of semaphore. 6. Which facility of provided by OS to allow use of critical sections in exclusion to other process? 7. What do you mean by binary semaphore and counting semaphore? 8. List the four parts used in critical section code. 9. What is busy waiting? 10. What is bounded waiting? 11. Give the name of two operation used by semaphore when implementing no busy waiting.

Long questions

1. Write a short note on critical section. 2. What are three requirements of any solution to the critical sections problem? Why are the

requirements needed? 3. What is a race condition? Give an example. 4. What is a critical region? How do they relate to controlling access to shared resources? 5. Write short note on semaphores (basic properties and its usage). 6. A semaphore is a blocking synchronization primitive. Describe how they work with the aid of

pseudo-code. You can assume the existence of a block () and a wakeup () function. 7. Write a note on defining semaphore is UNIX environment.

Fill in the blanks

1. Race conditions are prevented by requiring that critical regions be protected by _____________. 2. Several processes access and manipulate the same data concurrently and the outcome of the

execution depends on the particular order in which the access takes place, is called a(n) ____________________ .

3. Binary semaphore is also known as ________________. 4. The technique in which a process can do nothing until it gets permission to enter its critical

section but continues to test the appropriate variable to gain entrance is called ______________________.

5. _________ and _________ operations are used by semaphore. 6. A process is blocked if its _________ operation evaluates to a negative semaphore value.

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 32

7. A blocked process can be unblocked when some other process executes __________ operation to increment semaphore value to zero or positive value.

8. __________ and _____________ signals can be used to enforce indivisibility of operations. 9. Semaphore is also used in ____________ among processes. 10. ___________ system call is used in UNIX environment to define semaphore.

State true or false

1. Transaction-oriented processing is notorious for the race condition as it may lead to data integrity problems.

2. Semaphores cannot be utilized for synchronizing with events as the events are essentially detected by interrupts.

3. The solutions to critical section problem are: Mutual Exclusion, Progress and Bounded Waiting.

4. To make sure that system actually works, a notion of atomicity or indivisibility is invoked. 5. The condition mutual exclusion is also known as mutux locks. 6. The two operations on semaphore are wait () and signal (). 7. Semaphore uses floating point values. 8. The two types of semaphore are counting semaphore and binary semaphore. 9. A wait operation on a semaphore decreases its value by one. 10. Once a process is blocked, it cannot be unblocked in semaphore.

Multiple choice questions

1. Let S and Q be two semaphores initialized to 1, where Po and P1 processes the following statements wait (S); wait (Q); --; signal(S); signal (Q) and wait (Q); wait (S); --; signal (Q); signal (S); respectively. What does above situation depicts? A. semaphore B. deadlock C. signal D. interrupt

2. In order to implement mutual exclusion on a critical resource for competing processes. Only one program at a time should be allowed : A. In the critical section of the program B. To perform message passing C. To exhibit co-operation D. To sequence the instructions

3. To avoid race condition, the maximum number of processes that may be simultaneously inside the critical section is A. zero B. one C. two D. more than two

4. 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

5. Which of the following are the basic properties of semaphore? A. Wait and signal operation B. Atomic and indivisible

060010304 – Fundamentals of Operating Systems 2015

Mr. Hardik Vyas Page 33

C. Only A D. Both A & B

6. Which of the following is the primary usage of semaphore? A. To detect resources are in use B. To detect resources are free C. To detect deadlock D. Both A & B

7. A wait operation on a semaphore A. Decreases its value by one B. Increases its value by one C. Both A & B D. Only A

8. A process is blocked if its wait operation A. Evaluates to a negative B. Evaluates to Zero C. Evaluates to a positive D. None of the above