Operating System
Short Questions

Q1. List five services provided by an operating system that are designed for convenient use?

Ans: The five services are: a. Program execution. b. I/O operations. c. File-system manipulation. d. Communications. e. Error detection.

Q2. Define system call.

Ans: System calls provide an interface between the process and the Operating System. System calls allow user-level processes to request some services from the operating system which process itself is not allowed to do.

Q3. State the actions taken by a kernel to context-switch between processes?

Ans: When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run.

Q4. Explain Belady’s Anomaly.
Ans: Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady’s Anomaly.This is true for certain page reference patterns.

Q5. What are the scheduling criterias needed for scheduling technique?

Ans: Scheduling Criteria
• CPU utilization – keep the CPU as busy as possible
• Throughput – Number of processes that complete their execution per time
unit
• Turnaround time – amount of time to execute a particular process
• Waiting time – amount of time a process has been waiting in the ready
queue
• Response time – amount of time it takes from when a request was submitted
until the first response is produced, not output (for time-sharing
environment)

Q6. Differentiate between logical vs physical address space.

Ans:

  1. Logical address is generated by CPU in perspective of a program whereas the physical address is a location that exists in the memory unit.
  2. Logical Address Space is the set of all logical addresses generated by CPU for a program whereas the set of all physical address mapped to corresponding logical addresses is called Physical Address Space.
  3. The logical address does not exist physically in the memory whereas physical address is a location in the memory that can be accessed physically.
  4. logical address is generated by the CPU while the program is running whereas the physical address is computed by the Memory Management Unit (MMU).

Q7. What is the purpose of an I/O status information?

It tells about data in and out from input device to register

It tells about data in and out from input device to memory

Q8. When designing the file structure for an operating system, what attributes are considered?

Ans:  The different attributes for a file structure are naming,size, identifier, a level of protection, supported file types and location for the files.

Q9. Compare between Batch processing system and Real Time Processing System.

Ans: Batch data processing is an efficient way of processing high volumes of data is where a group of transactions is collected over a period of time. Data is collected, entered, processed and then the batch results are produced. Batch processing requires separate programs for input, process and output. An example is payroll and billing systems. In contrast, real time data processing involves a continual input, process and output of data. Data must be processed in a small time period (or near real time). Radar systems, customer services and bank ATMs are examples.

Q10. Define asymmetric clustering.

Ans: In this system, one of the nodes in the clustered system is in hot standby mode and all the others run the required applications. The hot standby mode is a failsafe in which a hot standby node is part of the system . The hot standby node continuously monitors the server and if it fails, the hot standby node takes its place. example- Electronic trading system

Q11.What is context switch ?

Ans:Switching the CPU to another process required performing a state save of the current process and state restore of different process and this task is known as context switching. This allows multiple processes to share a single CPU.

Q13.) Process is
a.program in High level language kept on disk
b.contents of main memory
c. a program in execution
d. a job in secondary memory
e. None of the above

Q14. The strategy of allowing processes that are logically runnable to be temporarily suspended is called

a. preemptive scheduling
b. non preemptive scheduling
c. shortest job first
d. first come first served
e.None of the above

Q15. Interprocess communication
a. is required for all processes
b. is usually done via disk drives
c. is never necessary,
d. allows processes to synchronize activity

Q16. The time required to create a new thread in an existing process is:

a. greater than the time required to create a new process
b. less than the time required to create a new process
c. equal to the time required to create a new process
d. none of the mentioned

Q16. User-Friendly Systems are:

a. required for object-oriented programming
b. easy to develop
c. common among traditional mainframe operating systems
d. becoming more common
e. None of the above

Q17. Page stealing

Ans: a.is a sign of an efficient system
b.is taking page frames from other working sets
c. should be the tuning goal
d. is taking larger disk spaces for pages paged out
e. None of the above

Q18. The LRU algorithm

a.pages out pages that have been used recently
b.pages out pages that have not been used recently
c. pages out pages that have been least used recently
d. pages out the first page in a given area
e. None of the above

Q19. Thrashing

a.is a natural consequence of virtual memory system
b. can always be avoided by swapping
c. always occurs on large computers
d. can be caused by poor paging algorithms
e. None of the above

Q20. At a particular time of computation the value of a counting semaphore is Ans: 7


Q21. The memory allocation scheme subject to “external” fragmentation is
a. segmentation
b. swapping
c. pure demand paging
d. multiple contiguous fixed partitions
e. None of the above

Q22. Explain What is OS and the main purpose of an operating system?

Ans: An operating system is the level of programming that lets you do things with your computer. It acts as a communication bridge (interface) between the user and computer hardware. The Main purpose of an operating system is to provide a platform on which a user can execute programs in a convenient and efficient manner.An operating system has three main functions: (1) manage the computer’s resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.

Q23. What are the advantages of multiprocessor system?

Ans:  Multiprocessor systems can save cost, by sharing power supplies, housings, and peripherals. Increased Throughput − more work can be completed in unit time by increasing the number of processors.

Q24. What is scheduling? What criteria affects the scheduler’s performance?

Ans: Scheduling is an activity which allows one process to utilise the CPU in effectively manner. Criteria affects the scheduler’s performance: CPU Utilization and Throughput.

Q25. What is binary semaphore? What is its use?

Ans: A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes

Q26. What necessary conditions can lead to a deadlock situation in a system. Ans: necessary conditions are:

  1. Mutual Exclusion: At least resource must be held in non-shareable mode.
  2. Hold & Wait: A process is holding at least one resource and waiting for others which is held by some other process.
  3. No Pre-emption: No resource can be forcibly removed from a process
    holding it.
  4. Circular Wait: A closed chain of processes exist such that each process holds at least one resource needed by another process in the chain.

Q27. What are the benefits of multithreaded programming?

Ans: Multithread is used to maximize the utilization of CPU by multitasking.using multithread we can run different parts of program at the same time in same memory space which can save cost and time. It can share resources with other threads and can minimize the risk of deadlock.

Q28. What are demand-paging and pre-paging?

Ans: With demand paging, a page is brought into memory only when a location on that page is actually referenced during execution. With pre-paging, pages other than the one demanded by a page fault are brought in. The selection of such pages is done based on common access patterns, especially for secondary memory devices

Q29. What are overlays?

Ans: The process of transferring a block of program code or other data into main memory, replacing what is already stored”. Overlaying is a programming method that allows programs to be larger than the computer’s main memory.

Q30. What is cycle stealing?

Ans: cycle stealing is a method of accessing computer memory (RAM) or bus without interfering with the CPU. It is similar to direct memory access (DMA) for allowing I/O controllers to read or write RAM without CPU intervention.


Q31. What is the function of dispatcher?

Ans: The main function of the dispatcher is assign ready process to the CPU. When the scheduler completes its job of selecting a process, it is the dispatcher which takes that process to the desired queue. It gives a process control over the CPU after it has been selected by the short-term scheduler. This function involves the following:

  • Switching context
  • Switching to user mode
  • Jumping to the location in the user program to restart that program


Q32. To access the services of operating system, the interface is provided by the?

Ans: System call

Q33.Define latency, transfer and seek time and dispatcher with respect to disk I/O.

Ans: Seek time is the time required to move the disk arm to the required track. Rotational delay or latency is the time it takes for the beginning of the required sector to reach the head. Sum of seek time (if any) and latency is the access time.
Time taken to actually transfer a span of data is transfer time. Dispatcher is a module which gives a process control over the CPU after it has been selected by the short-term scheduler

Q34. How many types of fragmentation occur in Operating System? How they can overcome? Ans:
Q35. The bounded buffer problem is also known as

Ans: _producer–consumer
Q36. Which facility dynamically adds probes to a running system, both in user processes and in the kernel?

Ans:DTrace
Q37. Specify the benefits of multithreaded programming?

Ans: Benefits are:

  • Resource Sharing: All the threads of a process share its resources such as memory, data, files etc.
  • Responsiveness: it allows a program to run even a part of it is blocked using multithreading. This can be observed if the process is performing a lengthy operation.
  • Utilization of multiprocessor architectures: The benefits of multithreading can be greatly increased in a multiprocessor architecture, where each thread may be running in parallel on a different processor. A single threaded process can only run on one CPU, no matter how many are available.Multithreading on a multi-CPU machine increases concurrency. In a single processor architecture, the CPU generally moves between each thread so quickly as to create an illusion of parallelism, but in reality only one thread is running at a time.
  • Economy: Allocating memory and resources for process creation is costly. Alternatively, because threads share resources of the process to which they belong, it is more economical to create and context switch threads.

Q38. Differentiate between mutex and semaphore.

Ans: The difference between a mutex and a semaphore is that only one thread at a time can acquire a mutex, but some preset number of threads can concurrently acquire a semaphore. That’s why a mutex is sometimes called a binary semaphore. A mutex is used for mutual exclusion.

Q39. Enlist the different RAID levels.

Ans: * RAID-0 (Striping) * RAID-1 (Mirroring) * RAID-4 (Block-Level Striping with Dedicated Parity) * RAID-5 (Block-Level Striping with Distributed Parity)

Q40) Which process can be affected by other processes executing in the system?

Ans: Cooperating Process.

Q41. When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called?

Ans: Race condition

Q42. What factors determine whether a detection-algorithm must be utilized in a deadlock avoidance system?

Ans: it depends on how often a deadlock is likely to occur under the  implementation of this algorithm. The other has to do with how many processes will be affected by deadlock when this algorithm is applied.

Q43. List out the disadvantages of paging and segmentation?

Ans: External fragmentation. Costly memory management algorithms. Segmentation: find free memory area big enough. Paging: keep list of free pages, any page is ok. Segments of unequal size not suited as well for swapping

Q44. When does thrashing occur?

Ans: A process is thrashing if it is spending more time paging than executing. This leads to: low CPU utilization and the operating system thinks that it needs to increase the degree of multiprogramming.

Q45. When designing the file structure for an operating system, what attributes are considered?

Ans: Typically, the different attributes for a file structure are naming, identifier, supported file types, and location for the files, size, and level of protection.

Q46. What is the purpose of an I/O status information? Ans: Status Register The status register contains bits that can be read by the host. These bits indicate states such as whether the current command has completed, whether a byte is available to be read from the data-in register, and whether there has been a device error.

Answer the following questions: (2×10)
Q47. The interval from the time submission of a process to the time of completion is termed as .
(a). Throughput (b). Turnaround Time (c). Waiting Time (d). Response Time

Ans: Turnaround Time

Q48. Each process in a system has a segment of code, called , in which the process may be changing common variables, updating a table, writing a file.
(a). Critical section (b). semaphore (c). race condition (d). segment table.

Ans: Critical section

Q49. A solution to the problem of indefinite blockage of low-priority process is
(a). Priority Scheduling (b). Paging (c). aging (d). None Of These.

Ans: Aging


Q50. Which page replacement algorithm is not practically possible?
(a). FIFO (b). LRU (c). Optimal (d). None Of These.

Ans: Optimal.

Q51. The hole created within a block of memory is fragmentation.
(a). External (b). Internal (c). Immediate (d). None of These.

Ans: Internal.

Q52. Which section is shared by a Process and its thread?
(a). stack (b). register (c). code (d). both a and b.

Ans: code.

Q53. Which scheduler is responsible for selecting a good process mix of I/O-bound and CPU-bound?
(a). short-term (b). long-term (c). medium-term (d). average-term.

Ans: long-term.

Q54. Which one map the logical address to physical address?
(a). processor (b). MMU (c). memory address register (d). none of these.

Ans: MMU.

Q55. Which makes possible transfer of data from and to the memory without help of main CPU?
(a). Bus (b). DMA (c). IDE (d). none of these.

Ans: DMA.

Q56. Which of the scheme describe that the IO device are accessed by generating a memory address?
(a). Shared memory (b). IPC (c). Memory-Mapped IO (d). IO-Mapped Memory.

Ans: Memory-Mapped IO.

Answer the following questions: (2×10)

Q57. What is the difference between binary and counting semaphores?

Ans: A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes. On the other hand, counting semaphores take more than two values, they can have any value you want. The max value x they take allows x process/threads to access the shared resource simultaneously.


Q58. What is the purpose of medium-term-scheduler and short-term-scheduler and Long term scheduler?

Ans: Long term scheduler determines which programs are admitted to the system for processing. It controls the degree of multiprogramming. Once admitted, a job becomes a process.
Medium term scheduling is part of the swapping function. This relates to
processes that are in a blocked or suspended state. They are swapped out of real memory until they are ready to execute. The swapping-in decision is based on memory-management criteria.
Short term scheduler, also know as a dispatcher executes most frequently, and makes the finest-grained decision of which process should execute next. This scheduler is invoked whenever an event occurs. It may lead to interruption of one process by preemption.


Q59. What are the basic functions of an operating system

Ans: Following are some of important functions of an operating System.

  • Memory Management.
  • Processor Management.
  • Device Management.
  • File Management.
  • Security.
  • Control over system performance.
  • Job accounting.
  • Error detecting aids.


Q60. What is belady’s anamoly ?

Ans: Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady’s Anomaly.This is true for certain page reference patterns.

Q61. Define Thrasing.

Ans: It is a phenomenon in virtual memory schemes when the processor spends most of its time swapping pages, rather than executing instructions. This is due to an inordinate number of page faults.


Q62. A computer has 6 tape drives among n programs. Each need two tape drives. For a system to be deadlock free what is maximum value of n.

Ans: Given : tape drive = 6 ,each process need 2 drive.

When we give 1 drive to 1 process then total process will be 6 but in this case there will be deadlock because every process contain 1 drive and waiting for another drive which is hold by other process therefore when we reduce 1 process then system will be deadlock free. So,maximum value of n = 6 – 1 = 5.

Q63. What is spooling?

Ans: A spool is a buffer that holds output for a device, such as a printer, that cannot accept interleaved data streams. Although a printer can serve only one job at a time, several applications may wish to print their output concurrently, without having their output mixed together. The operating system solves this problem by intercepting all output to the printer.

Q64. What is the difference between multiprogramming and multitasking?

Ans:

Multitasking Multiprogramming
It works on the concept of time sharing.It works on the concept of context switching.
It occurs when more than one task is executed at a single time utilising multiple CPU’s.In this multiple processes run concurrently at the same time on a single processor.
It enables execution of multiple process and task at same time to increase CPU performanceMultiple programs reside in the main memory to improve CPU performance.
it uses multiple CPU’s for task allocationit uses single CPU for execution of processes
It takes less time to execute the processes.It takes more time to execute the processes.



Q65. What is a process? What is a PCB?

Ans: In the Operating System, a Process is a program that is currently under execution. So, an active program can be called a Process.  A process control block (PCB) is a data structure used by computer operating systems to store all the information about a process. It is also known as a process descriptor.

Q66. What is the advantage of using threads compared to processes?

Ans: Threads are faster than process.It is relatively easier for a context switch using threads. Sharing Threads allow the sharing of a lot resources that cannot be shared in process, for example, sharing code section, data section, Operating System resources like open file etc.

Q67. What do you mean by graceful degradation in multiprocessor
systems?

Ans: The ability to continue providing service proportional to the level of
surviving hardware is called graceful degradation.

Q68. List the three requirements that must be satisfied by critical section problem.

Ans: A solution to the critical-section problem must satisfy the following three requirements:

  1. Mutual Exclusion: If process Pi is executing in its critical section, then no other processes can be executing in their critical sections.
  2. Progress: If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing
    in their remainder section can participate in the decision on which will enter its critical section next, and this selection cannot be postponed indefinitely.
  3. Bounded Waiting: There exists 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.

Q69. What is kernel of an Operating System?
Ans: Kernel is an active part of an OS i.e., it is the part of OS running at all times. It is a programs which can interact with the hardware. Ex: Device driver, dll files, system files etc.