I/O Interface (Interrupt and DMA Mode) - GeeksforGeeks (2024)

  • Read

  • Discuss

  • Improve

    The method that is used to transfer information between internal storage and external I/O devices is known as I/O interface. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between CPU and peripheral. There exists special hardware components between CPU and peripherals to supervise and synchronize all the input and output transfers that are called interface units.

    Mode of Transfer:

    The binary information that is received from an external device is usually stored in the memory unit. The information that is transferred from the CPU to the external device is originated from the memory unit. CPU merely processes the information but the source and target is always the memory unit. Data transfer between CPU and the I/O devices may be done in different modes. Data transfer to and from the peripherals may be done in any of the three possible ways

    1. Programmed I/O.
    2. Interrupt- initiated I/O.
    3. Direct memory access( DMA).

    Now let’s discuss each mode one by one.

    1. Programmed I/O: It is due to the result of the I/O instructions that are written in the computer program. Each data item transfer is initiated by an instruction in the program. Usually the transfer is from a CPU register and memory. In this case it requires constant monitoring by the CPU of the peripheral devices.
      Example of Programmed I/O: In this case, the I/O device does not have direct access to the memory unit. A transfer from I/O device to memory requires the execution of several instructions by the CPU, including an input instruction to transfer the data from device to the CPU and store instruction to transfer the data from CPU to memory. In programmed I/O, the CPU stays in the program loop until the I/O unit indicates that it is ready for data transfer. This is a time consuming process since it needlessly keeps the CPU busy. This situation can be avoided by using an interrupt facility. This is discussed below.
    2. Interrupt- initiated I/O: Since in the above case we saw the CPU is kept busy unnecessarily. This situation can very well be avoided by using an interrupt driven method for data transfer. By using interrupt facility and special commands to inform the interface to issue an interrupt request signal whenever data is available from any device. In the meantime the CPU can proceed for any other program execution. The interface meanwhile keeps monitoring the device. Whenever it is determined that the device is ready for data transfer it initiates an interrupt request signal to the computer. Upon detection of an external interrupt signal the CPU stops momentarily the task that it was already performing, branches to the service program to process the I/O transfer, and then return to the task it was originally performing.
      • The I/O transfer rate is limited by the speed with which the processor can test and service a device.
      • The processor is tied up in managing an I/O transfer; a number of instructions must be executed for each I/O transfer.
      • Terms:
        • Hardware Interrupts: Interrupts present in the hardware pins.
        • Software Interrupts: These are the instructions used in the program whenever the required functionality is needed.
        • Vectored interrupts: These interrupts are associated with the static vector address.
        • Non-vectored interrupts: These interrupts are associated with the dynamic vector address.
        • Maskable Interrupts: These interrupts can be enabled or disabled explicitly.
        • Non-maskable interrupts: These are always in the enabled state. we cannot disable them.
        • External interrupts: Generated by external devices such as I/O.
        • Internal interrupts: These devices are generated by the internal components of the processor such as power failure, error instruction, temperature sensor, etc.
        • Synchronous interrupts: These interrupts are controlled by the fixed time interval. All the interval interrupts are called as synchronous interrupts.
        • Asynchronous interrupts: These are initiated based on the feedback of previous instructions. All the external interrupts are called as asynchronous interrupts.
    3. Direct Memory Access: The data transfer between a fast storage media such as magnetic disk and memory unit is limited by the speed of the CPU. Thus we can allow the peripherals directly communicate with each other using the memory buses, removing the intervention of the CPU. This type of data transfer technique is known as DMA or direct memory access. During DMA the CPU is idle and it has no control over the memory buses. The DMA controller takes over the buses to manage the transfer directly between the I/O devices and the memory unit.
      1. Bus grant request time.
      2. Transfer the entire block of data at transfer rate of device because the device is usually slow than the speed at which the data can be transferred to CPU.
      3. Release the control of the bus back to CPU So, total time taken to transfer the N bytes = Bus grant request time + (N) * (memory transfer rate) + Bus release control time.
    4. Buffer the byte into the buffer
    5. Inform the CPU that the device has 1 byte to transfer (i.e. bus grant request)
    6. Transfer the byte (at system bus speed)
    7. Release the control of the bus back to CPU.

    Advantages:

    Standardization: I/O interfaces provide a standard way of communicating with external devices. This means that different devices can be connected to a computer using the same interface, which makes it easier to swap out devices and reduces the need for specialized hardware.
    Modularity: With I/O interfaces, different devices can be added or removed from a computer without affecting the other components. This makes it easier to upgrade or replace a faulty device without affecting the rest of the system.
    Efficiency: I/O interfaces can transfer data between the computer and the external devices at high speeds, which allows for faster data transfer and processing times.
    Compatibility: I/O interfaces are designed to be compatible with a wide range of devices, which means that users can choose from a variety of devices that are compatible with their computer’s I/O interface.

    Disadvantages:

    Cost: I/O interfaces can be expensive, especially if specialized hardware is required to connect a particular device to a computer system.
    Complexity: Some I/O interfaces can be complex to configure and require specialized knowledge to set up and maintain. This can be a disadvantage for users who are not familiar with the technical aspects of computer hardware.
    Compatibility issues: While I/O interfaces are designed to be compatible with a wide range of devices, there can still be compatibility issues with certain devices. In some cases, device drivers may need to be installed to ensure proper functionality.
    Security risks: I/O interfaces can be a security risk if they are not properly configured or secured. Hackers can exploit vulnerabilities in I/O interfaces to gain unauthorized access to a computer system or steal data.

    Level Up Your GATE Prep!
    Embark on a transformative journey towards GATE success by choosing as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.


    Last Updated : 14 May, 2023

    Like Article

    Save Article

    Previous

    Priority Interrupts | (S/W Polling and Daisy Chaining)

    Next

    Direct memory access with DMA controller 8257/8237

    The article delves into the intricacies of Input/Output (I/O) interfaces and the methods employed for transferring information between internal storage and external devices within a computer system. It introduces the concept of I/O interfaces acting as communication links between the CPU and peripherals, outlining three primary modes of data transfer: Programmed I/O, Interrupt-initiated I/O, and Direct Memory Access (DMA).

    Here's an overview of the concepts discussed:

    1. Programmed I/O:

      • Transfer initiated by instructions in the computer program.
      • CPU continuously monitors the peripheral devices, which can be time-consuming.
      • Involves input and output instructions executed by the CPU.
    2. Interrupt-initiated I/O:

      • Utilizes interrupt signals to notify the CPU when a device is ready for data transfer.
      • Allows the CPU to proceed with other tasks while monitoring the devices.
      • External interrupts are generated by devices, causing the CPU to momentarily stop its current task.
    3. Direct Memory Access (DMA):

      • Enables direct communication between peripherals and memory, bypassing CPU intervention.
      • DMA controller manages data transfer between I/O devices and memory independently.
      • Allows the CPU to remain idle during the data transfer process.

    The article also introduces various terms related to interrupts:

    • Hardware Interrupts
    • Software Interrupts
    • Vectored Interrupts
    • Non-vectored Interrupts
    • Maskable Interrupts
    • Non-maskable Interrupts
    • External Interrupts
    • Internal Interrupts
    • Synchronous Interrupts
    • Asynchronous Interrupts

    Furthermore, it discusses the DMA process, including the steps involved and the advantages such as increased transfer speeds and reduced CPU involvement.

    Additionally, it covers the advantages and disadvantages of I/O interfaces:

    • Advantages: Standardization, Modularity, Efficiency, Compatibility
    • Disadvantages: Cost, Complexity, Compatibility issues, Security risks

    The article's scope extends to considerations in computer systems such as compatibility, complexity, and security risks associated with I/O interfaces. It also mentions GATE preparation courses related to the topic, providing further resources for interested readers.

    If you're seeking a comprehensive understanding of I/O interfaces, data transfer methods, interrupt handling, and associated advantages and challenges, this article provides a solid foundation for exploration and learning.

    I/O Interface (Interrupt and DMA Mode) - GeeksforGeeks (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Geoffrey Lueilwitz

    Last Updated:

    Views: 6526

    Rating: 5 / 5 (80 voted)

    Reviews: 95% of readers found this page helpful

    Author information

    Name: Geoffrey Lueilwitz

    Birthday: 1997-03-23

    Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

    Phone: +13408645881558

    Job: Global Representative

    Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

    Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.