Organization of I/O functions
Organization of Input Output FunctionsEdit
/ 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.
- Control Command :- Each device needs control signal generated by CPU.
- Test Command :- CPU may test Status of device through test command.
- Read Command :- CPU can accept data from input device through read command.
- Write command :- CPU can send data to Output device through write command.
Three methods of I / O organizationEdit
- Programmed Input / Output
- Interrupt driven Input / Output
- 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
- The CPU sends a request to an I / O device
- The I / O device processes the request and sets a device – ready signal when it is ready.
- The CPU reads this signal
- 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
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.
I / O Mapped I / O
There are separate control lines for memory and Input / Output devices
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.)
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 LayersEdit
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.
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