This document discusses indirect and direct I/O methods. Indirect methods include memory mapped I/O and I/O mapped I/O. Memory mapped I/O allows the CPU and I/O devices to share the same memory space, while I/O mapped I/O gives them separate memory spaces. Direct I/O uses DMA to transfer data without CPU involvement. DMA can operate in burst mode or non-burst modes like cycle stealing or transparent mode.
3. Indirect Methods
• The method that is used to transfer
information between internal storage and
external I/O devices under the supervision of
microprocessor is called as indirect methods.
• These methods have 2 modes –
1. Memory Mapped IO
2. IO Mapped IO
4. Memory mapped I/O
• Memory mapped I/O is a way to exchange data
and instructions between a CPU and peripheral
devices attached to it.
• Memory mapped IO is one where the processor
and the IO device share the same memory
location(memory),i.e., there is no separate space
for IO.
• Some space gets wasted and due to this addressing
capability becomes less.
• Port numbers are stored in memory area.
5. Memory mapped I/O
• Polled IO, as here the processor goes to each
device connected to it and check every port
which leads to unnecessary activity checking
in background.
• Its implementation is simple.
6.
7. IO mapped IO
• IO mapped IO is one where the processor and
the IO device have different memory located
to each other.
• Interrupt driven, here interrupt occurs and
processor looks at each device to see which
device needs service and according to priority
it services them.
8.
9. Direct Methods / DMA
• Stands for "Direct Memory Access." DMA is a
method of transferring data from the
computer's RAM to another part of the
computer without the supervision of
microprocessor.
• The DMA transfers the data in following
modes:
1. Burst Mode
2. Non Burst Mode
10.
11. Steps for DMA Transfer
• When a transfer from I/O device to the memory
has to be made the device sends a signal to DMA
Controller through control bus.
• DMA controller sends a signal to processor
requesting for the bus called as Bus Request
Signal.
• After receiving the BR signal, processor grants the
bus to the controller by raising the bus grant
signal.
• After BG signal is received by the DMA controller,
it sends an IO acknowledge signal to the device
that generated the request.
12. • Data is transferred.
• After the data transfer DMA controller sends a
signal to processor. The signal tells the
processor that the device activity is over and it
should take the access of buses back.
13.
14. • The DMA transfers the data in following modes:
1. Burst Mode - : In this mode DMA handover the
buses to CPU only after completion of whole
data transfer. Meanwhile, if the CPU requires
the bus it has to stay ideal and wait for data
transfer.
2. Non Burst Mode – There are 2 modes in non
burst mode –
a) Cycle Stealing Mode
b) Transparent / Memory Shared Mode
15. • Cycle Stealing Mode - In this mode, DMA gives
control of buses to CPU after transfer of every
byte. It continuously issues a request for bus
control, makes the transfer of one byte and
returns the bus. By this CPU doesn’t have to
wait for a long time if it needs a bus for higher
priority task.
• Transparent / Memory Shared Mode: Here,
DMA transfers data only when CPU is executing
the instruction which does not require the use
of buses. It is also the most efficient mode in
terms of overall system performance