Manoharbhai Patel Institute of Engineering AND Technology
Manoharbhai Patel Institute of Engineering AND Technology
AND
TECHNOLOGY
Department of Computer Engineering
Presented By:
Mr. Swayam C. Mule Miss. Sakshi S. Raut
Mr. Sahil H. Bhowate Miss. Trusha S. Dongarwar
Mr. Ujjwal M. Ladse Miss. Ankita R. Akare
Topic: I/O System , Programmed Driven I/O , Interrupt Driven I/O , DMA
I/O System
Programmed Driven I/O
3
What is System ?
4
Input and Output System
5
Input and Output System
Any program, device, or operation that transfers data to or from a computing
system.
I/O Hardware
I/O Software
7
I/O Hardware
There are many I/O devices handled by the operating system such as
mouse, keyboard, disk drive etc.
8
A diagram to represent this is −
9
I/O Application Interface
The user applications can access all the I/O devices using the
device drivers, which are device specific codes.
10
This is illustrated using the below image −
11
I/O Software
The I/O software contains the user level libraries and the kernel modules.
The kernel modules provides the device drivers that interact with
the device controllers.
12
The I/O software should be device independent so that the programs can
be used for any I/O device without specifying it in advance.
For example - A program that reads a file should be able the read the file
on a hard disk, floppy disk, CD-ROM etc. without having to change the
program each time.
13
Programmed Driven I/O
14
What is Programmed Driven I/O ?
Programmed I/O (PIO), also known as programmed input/output, is a method where the CPU
directly controls data transfer between itself and an I/O device, requiring the CPU to wait for
each I/O operation to complete before proceeding.
It is one of the simplest forms of I/O where the CPU has to do all the work. This technique is
called programmed I/O.
15
How Programmed I/O Works ?
In PIO mode, the CPU executes a specific program that gives it direct control over the entire I/O operation. Here’s a
breakdown of the process:
This process requires significant CPU overhead, as the processor must not only configure the data transaction but also
transfer the data itself.
16
Programmed I/O basically works in these ways:
17
Advantages of Programmed-Driven I/O
3. Direct control: The CPU has full control over the I/O process
18
Disadvantages of Programmed-Driven I/O
19
Interrupt Driven I/O
20
WHAT IS INTERRUPT DRIVEN I/O ?
Interrupt-driven I/O is a method where the CPU is notified by an interrupt when an I/O
device is ready, allowing the CPU to perform other tasks in the meantime.
The interrupt-driven I/O involves the use of interrupt to exchange data between I/O and
memory.
21
The figure shows you how with the help of interrupt I/O the data transfer is carried
out between memory and I/O.
Though it is more efficient than programmed I/O still it wastes some of the
processor’s time.
As the transfer of data from memory to the I/O module or from the I/O module to
memory passes through the processor.
22
TYPES OF INTERRUPTS
•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.
23
•Non-maskable interrupts: These are always in the enabled state. we cannot disable them.
•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.
24
Advantages of Interrupt-Driven I/O
1. Efficient CPU use: CPU can perform other tasks while waiting.
25
Disadvantages of interrupt-driven I/O
2. Interrupt overhead: Can slow down the system with frequent interrupts.
26
DMA
(Direct Memory Access)
27
What Is DMA ?
In modern computer systems, transferring data between input/output devices and memory
can be a slow process if the CPU is required to manage every step.
A Direct Memory Access (DMA) Controller solves this by allowing I/O devices to transfer
data directly to memory, reducing CPU involvement.
28
This increases system efficiency and speeds up data transfers, freeing the CPU to focus on
other tasks.
DMA controller needs the same old circuits of an interface to communicate with the CPU
and Input/Output devices
Data movement between devices and the computer is possible at a reduced cost for the CPU
through DMA.
Instead of DMA, we have the Ultra DMA delivering up to a transfer rate of 33 MBps. Hard
disks with ultra DMA/33 operate in PIO-1, PIO-3, PIO-4, and multiword DMA-2 mode at
16.8 MBs.
29
BLOCK DIAGRAM OF DMA
3. Data Transfer:
1. The DMA controller directly transfers data from the I/O device to memory (or vice versa) without CPU
intervention.
2. This happens in different modes of transfer:
1. Burst Mode: Transfers a complete block of data in one go.
2. Cycle Stealing Mode: Transfers one word per cycle, allowing CPU to work intermittently.
3. Transparent Mode: Transfers occur only when the CPU is idle.
•Single-Ended DMA
•Dual-Ended DMA
•Arbitrated-Ended DMA
•Interleaved DMA
32
Types of Direct Memory Access (DMA)
Single-Ended DMA: Single-Ended DMA Controllers operate by reading and writing from a single memory address.
They are the simplest DMA.
Dual-Ended DMA: Dual-Ended DMA controllers can read and write from two memory addresses. Dual-ended DMA is
more advanced than single-ended DMA.
Arbitrated-Ended DMA: Arbitrated-Ended DMA works by reading and writing to several memory addresses. It is more
advanced than Dual-Ended DMA.
Interleaved DMA: Interleaved DMA are those DMA that read from one memory address and write from another
memory address.
33
Differences
Programmed Driven I/O Interrupt Driven I/O
• CPU constantly checks the device status (polling). • Device sends an interrupt when it needs attention.
• CPU remains busy, even when the device is idle. • CPU performs other tasks until interrupted.
• Inefficient for high-speed data transfers • More efficient as CPU time is utilized better.
• Slower response time due to continuous checking. • Faster response time as CPU is notified only when
needed.
• Simple to implement but wastes CPU cycles. • More complex but improves system performance.
• Suitable for slow devices like basic I/O ports. • Suitable for high-speed devices like hard disks and
network cards.
• Used in early computing systems with simple • Common in modern systems for multitasking and
peripherals. efficiency.
34
References :
https://www.geeksforgeeks.org
https://www.w3school.org
https://www.tutorialspoint.com
https://www.louiewong.com
https://systeme.io/website
35
THANK YOU
36