Organization of I/O functions

Organization of Input Output Functions


Input / Output operation refers to a data transfer between Input/ Output device and main memory , or between an Input / Output device and CPU.
User program never interact directly with Input / Output devices.
All Input / Output operations are performed with the help of system calls.
Whenever a system call is made, CPU executes driver or interrupt service routine. These specialized routines interact with an Input / Output device with the help of Input / Output commands.
There are 4 types of Input / Output commands.

  1. Control Command :- Each device needs control signal generated by CPU.
  2. Test Command :- CPU may test Status of device through test command.
  3. Read Command :- CPU can accept data from input device through read command.
  4. Write command :- CPU can send data to Output device through write command.

Three methods of I / O organization

  1. Programmed Input / Output
  2. Interrupt driven Input / Output
  3. Direct Memory Access.

Programmed Input / Output  Polling method

Q      Explain polling method.                                                                                 ---- ( 6 M)

Ans :-    In polling method CPU continuously checks for device either it requires service or not ? If data transfer operations are completely controlled by the CPU, then it is said to be programmed Input / Output.

Polling method steps
  1. The CPU sends a request to an I / O device
  2. The I / O device processes the request and sets a device – ready signal when it is ready.
  3. The CPU reads this signal
  4. If signal is set, CPU performs the data transfer. If not, it loops back.

In this way polling takes place. When the processor, main memory, and

        Input / Output share a common bus, two modes of addressing are possible.

Memory Mapped I / O

 Single address space for memory locations and Input / Output devices. For memory as well as for I / O single read as well as write line is used.
Memory Mapped I / O

I / O Mapped I / O

There are separate control lines for memory and Input / Output devices

I / O Mapped I / O

Interrupt driven I / O

Q      Explain interrupt driven I / O method.                    -- (4 M)

Ans :-    In polling method CPU utilizes its maximum time in polling I / O devices which is useless. Another method that can considerably improve CPU performance is interrupt driven I / O. In this method, the CPU issues the Input / Output command to Input / Output device and start executing other operation. When the Input / Output operation is complete, input / output device interrupts CPU by informing the CPU that Input / Output has finished. By this way CPU can handle parallel activities of Inputs / Outputs.

                This perform same operation as interrupt service routine (ISR ).

I  / O Using DMA  DMA ( Direct Memory Access )

Q      Explain I / O using DMA.                                                                ----- 4 M

Ans :      In both programmed and interrupt driven I / O CPU is responsible for either sending or receiving of data. If we use separate hardware to transfer a block of data to and from memory without intervention of CPU. This mode of operation is known as DMA ( Direct Memory Access.)

I  / O Using DMA  DMA ( Direct Memory Access )

The following sequence of steps takes place for a DMA transfer :-

1) DMA controller is programmed by CPU.

2) Data transfer is start by DMA controller by issuing read request over the bus

3) Disk controller fetches the next word from the internal buffer, it knows where to write it.

4) Disk controller sends an acknowledgement to DMA controller.

Input Output Software Layers


Q      Explain I / O software layers with diagram.                                           --- 6 M

Ans :      I / O software is organized as a series of layers. Lowermost layer interacts with the hardware. Uppermost layer provide a nice interface to user.

Input Output Software Layers

a) Interrupt handler = It handles entire interrupts related with I / O.

b) Device Driver = A device driver is a software program that handles all device dependent tasks.  It controls a particular type of device that is attached to a computer. It simplifies programming by acting as a translator between a hardware device and the operating system.

c) Device -Independent I / O software = The basic function of device – independent software is to perform functions common to all devices. It provides a uniform interface to the user level software. The basic functions of device independent software are : device naming, buffering, device protection , etc.

In this way user can access hardware of I / O devices.


  • WikiNote Foundation


  • WikiNote Foundation

Last modified: Friday, 20 September 2019, 1:54 PM