IO Management: Operating System Class Notes

Updated: Aug 18

Mobiprep has created last-minute notes for all topics of operating system to help you with the revision of concepts for your university examinations. So let’s get started with the lecture notes on Operating System (OS).

  1. Introduction of Operating System

  2. Process

  3. Scheduling

  4. Threads

  5. Memory Management

  6. File Management

  7. Synchronization

  8. Disk Management

  9. IO Management

  10. Protection And Security

Our team has curated a list of the most important questions asked in universities such as DU, DTU, VIT, SRM, IP, Pune University, Manipal University, and many more. The questions are created from the previous year's question papers of colleges and universities.

  1. What does the processor talk to the I/O device?

  2. What is DMA?

  3. Give a description about Device Drivers?

  4. What is the Life Cycle of an I/O request?

  5. What do you understand by Synchronous and Asynchronous I/O System?

  6. What are the Blocking and Non-Blocking input output?

  7. What are the characteristics of I/O Devices?

  8. Write about the Kernel I/O subsystem.

  9. What are the different modes of Interrupt? How is polling achieved?

  10. Explain the difference between an internal interrupt and software interrupt.

  11. How is an interrupt enabled and detected?

  12. Explain the concepts of spooling.

  13. Explain the architecture of DMA controller in detail.

IO Management


Question- 1) What does the processor talk to the I/O device?

Answer: The old processors accessed the I/O devices using special I/O instructions. But, today’s processors communicate with the I/O devices via bus. I/O devices are accessed through memory mapped addresses.

There are three methods with which the I/O devices can be accessed by the processor. They are:

  1. Programmed I/O- In programmed I/O, special I/O instructions are used to communicate with the I/O device

  2. Interrupt driven I/O- Here, the I/O device sends an interrupt signal when it wants to communicate with the processor. When an interrupt occurs, the processor executes the interrupt service routine

  3. Direct Memory Access- In this method, the data is transferred from the memory to the I/O device without the involvement of the CPU. This method is very efficient than the other two methods.


 

Question- 2) What is DMA?

Answer: Direct Memory Access allows the computer to transfer the data directly from the main memory to the I/O device and vice versa. The CPU (or processor) is not involved in this transaction. The DMA is an efficient method because it improves the efficiency of the processor. It speeds up the overall operation of the computer.


 

Question- 3) Give a description about Device Drivers?

Answer: Device drivers help the external I/O device to communicate with the Operating System. Without the device drivers, the interaction between the processor and the I/O devices is impossible. The device driver is a set of files which are hardware specific. The device drivers are needed when the features of the I/O device are not known to the computer.


 

Question- 4) What is the Life Cycle of an I/O request?

Answer: The following flow chart explains the life cycle of an I/O request:


Life Cycle of an I/O request in operating system

When an I/O request occurs, the current process is blocked if the request is appropriate. Then, the request is processed. Once the I/O operation is completed, the control is transferred to the process, and the output of the I/O operation is returned.


 

Question- 5) What do you understand by Synchronous and Asynchronous I/O System?

Answer:

Synchronous I/O system

In a synchronous I/O system, the I/O operations block the current process that is executed by the CPU. Here, the I/O operations are blocking. Synchronous I/O systems can perform either read operation or write operation at a time.

Asynchronous I/O system

In an asynchronous I/O system, the I/O operation and the user processes are executed simultaneously. Many simultaneous read/write operations are allowed. Here, the I/O operations are non-blocking. This system starts the execution of another process before completing the I/O operation. Such systems are more complex and less secure.


 

Question- 6) What are the Blocking and Non-Blocking input output?

Answer:

Blocking IO

In a blocking IO, the control is not returned to the process thread until the I/O operation is complete. Blocking IO is used in cases in which the process utterly needs the data from the I/O operation, and the process cannot be executed further until the I/O operation is over.

Non-Blocking IO

In a non-blocking I/O, the call is returned to the thread before the completion of the I/O operation. After the completion of the I/O call, the resulting data is returned to the corresponding application.


 

Question- 7) What are the characteristics of I/O Devices?

Answer: The following are the characteristics of an I/O device

  1. An I/O device enables the users to communicate with the computer

  2. The I/O devices can send data to the computer and receive data from the computer

  3. The I/O devices require corresponding device drivers to interact with the CPU

  4. The I/O devices can directly communicate with the memory through the DMA controller.

  5. When an I/O device wants to interact with the CPU, it generates an interrupt signal.


 

Question- 8) Write about the Kernel I/O subsystem.

Answer: The kernel provides the following services to the I/O devices:

Scheduling

Scheduling refers to the order in which the I/O requests are processed. This order is decided by the priority of the I/O devices.


Caching

Caching helps in storage of data in a memory location which can be accessed by the processor faster than the other memory locations. The cache memory stores the duplicate copy of the data.


Buffering

Buffer stores the data to be transferred between the devices temporarily.


Spooling

A spool is a buffer which is similar to a queue. Spooling is the process in which the data is stored temporarily in a queue until the processor executes it.


Error handling

Any error that occurs during an I/O operation is handled by the kernel.


Device Reservation

The kernel provides exclusive access to an I/O device. The system calls are used for allocation and de-allocation of the device.


I/O protection

The I/O operation is considered as a privileged to prevent the usage of illegal I/O instructions by the user.


 

Question- 9) What are the different modes of Interrupt? How is polling achieved?

Answer: The two modes of interrupt are:

  1. Maskable interrupt- Maskable interrupts are the interrupt that can be disabled by the CPU. Usually, lower priority interrupts are maskable. These interrupts are masked, and executed after the execution of the current process.

  2. Non-maskable interrupt- Non-maskable interrupts are the interrupts that cannot be disabled by the CPU. These are higher priority interrupts. The current process being executed is stopped and the interrupt is handled.

Polling

When more than one interrupts occur at a time, the order in which the interrupts have to be serviced is determined the ISR. Polling method orders the interrupts according to their priority. The interrupts with the highest priority is handled first.


 

Question- 10) Explain the difference between an internal interrupt and software interrupt.

Answer:

​Internal Interrupt

Software Interrupt

  • It is generated by hardware.

  • It is generated by special CPU instructions.

  • These are interrupts that occur due to processing errors.

  • Software interrupts are caused by instructions that call the interrupt sub-routine.

  • Internal interrupts are also known as Exceptions.

  • Software interrupts are similar to JUMP or BRANCH instructions or sub-routine call.

  • Example: Keystroke

  • Example: the OS trap, page fault etc.,


 

Question- 11) How is an interrupt enabled and detected?

Answer: A processor enables an interrupt by stopping the execution of the current process. The address of the current instruction is stored in the stack and the interrupt is handled by the Interrupt Service Routine.

The interrupt input is sampled during each instruction cycle. If the processor detects any interrupt requests during sampling, the processor immediately services the interrupt.


 

Question- 12) Explain the concepts of spooling.

Answer: SPOOL 🡪 Simultaneous Peripheral Operations On-Line

Spooling is the process in which the data is stored temporarily in a queue until the processor executes it. Spooling is used when the external peripheral devices communicate with the processor. The I/O devices are much slower than the processor. Spooling is used to synchronize the speeds of both the peripheral device and the processor.

The spool is similar to a queue. It accumulates various data from the I/O devices until they are executed by the processor. FIFO order is maintained while processing the spool. i.e. the first instruction in the spool is executed first by the processor.


 

Question- 13) Explain the architecture of DMA controller in detail.

Answer: The DMA controller is a device which controls the direct transfer of data between the I/O device and the memory without the involvement of the CPU. It improves the performance of the CPU by not keeping the CPU busy in transferring data between the I/O device and the memory.

The block diagram of the DMA Controller is given below:

block diagram of the DMA Controller in operating system

Working of the DMA controller

The I/O device sends a request (DRQ Request) to the DMA controller, when the data has to be transferred between the I/O device and the memory. On receiving the request, the DMA controller sends the HOLD signal (HRQ Request) to the CPU, and waits for the HLDA signal from the CPU. Once the DMA controller receives the HLDA signal, it gets the control over the system buses. Now, the system buses are freed from the CPU.

When the write operation has to be performed by the peripheral device, it sends the MEMW and IOR signals. When the DMA controller receives the IOR signal, it loads the data on the data bus.

Once the data transfer is over, the control is returned back to the CPU. The switch position is shifted from Y to X. The CPU takes complete control of the system buses.

 



3 views0 comments