SlideShare a Scribd company logo
1 of 13
DMA Versus
Polling or Interrupt Driven I/O
• Polling and Interrupt driven I/O concentrates on data
transfer between the processor and I/O devices.
• An instruction to transfer (mov datain,R0) only occurs
after the processor determines that the I/O device is
ready
– Either by polling a status flag in the device interface or
– Waits for the device to send an interrupt request.
• Considerable overhead is incurred, because several
program instructions must be executed for each data
word transferred.
• Instructions are needed to increment memory address
and keeping track of work count.
• With interrupts, additional overhead associated with
saving and restoring the program counter and other state
information.
Direct Memory Access (DMA)
• To transfer large blocks of data at high
speed, an alternative approach is used.
• Blocks of data are transferred between an
external device and the main memory,
without continuous intervention by the
processor.
DMA Controller
• DMA controller is part of the I/O interface.
• Performs the functions that would normally
be carried out by the processor when
access main memory. For each word
transferred, it provides the memory
address and all the bus signals that control
data transfer.
DMA Controller
• Although DMAC can transfer data without
intervention by the processor, it’s operation must
be under the control of a program executed by
the processor.
• To initiate the transfer of a block of data, the
processor sends the starting address, the
number of words in the block, and direction of
the transfer. Once information is received, the
DMAC proceeds to perform the requested
operation. When the entire block has been
transferred, the controller informs the processor
by raising an interrupt signal.
Processor Main Memory
Disk
Printer Keyboard
DMA
Controller
Disk
Use of DMA Controllers in a Computer
System
Network
Interface
Disk/DMA
Controller
How is OS involved
• I/O operations are always performed by the OS in
response to a request from an application program.
• OS is also responsible for suspending the execution of
one program and starting another.
– OS puts the program that requested the transfer in the Blocked
state,
– initiates the DMA operation,
– starts execution of another program.
• When the transfer is complete, the DMA controller
informs the processor by sending an interrupt request.
– OS puts suspended program in the Runnable state so that it can
be selected by the scheduler to continue execution.
Registers in a DMA Interface
Status and Control
Starting Address
Word Count
31 30 1 0
IRQ
IE
Done
R / W’
Cycle Stealing
• Requests by DMA devices for using the bus are alwas
given higher priority than processor requests.
• Among different DMA devices, top priority is given to
high-speed peripherals (disks, high-speed network
interface, graphics display device)
• Since the processor originates most memory access
cycles, it is often stated that DMA steals memory cycles
from the processor (cycle stealing).
• If DMA controller is given exclusive access to the main
memory to transfer a block of data without interruption,
this is called block or burst mode..
Buffers and Arbitration
• Most DMACs have a data storage buffer –
network interfaces receive data from main
memory at bus speed, send data onto
network at network speed.
• Bus Arbitration is needed to resolve
conflicts with more than one device (2
DMACs or DMA and processor, etc..) try
to use the bus to access main memory.
Bus Arbitration
• Bus Master – the device that is allowed to
initiate bus transfers on the bus at any
given time. When the current master
relinquishes control, another device can
acquire this status.
• Bus Arbitration – the process by which the
next device to become bus master is
selected and bus mastership is transferred
to it.
Arbitration Approaches
• Centralized – a single arbiter performs the
arbitration.
• Distributed – all devices participate in the
selection of the next bus master.
Centralized Arbitration
• Bus arbiter may be processor or a
separate unit connected to the bus.
Processor
DMA
Controller
1
DMA
Controller
2BG1 BG2
BR
BBSY
Distributed Arbitration
• No central arbiter used
• Each device on bus is assigned a 4-bit
identification number.
• When one or more devices request the bus, they
assert the Start-Arbitration signal and place their
4-bit ID number on ARB[3..0].
• The request that has the highest ID number
ends up having the highest priority.
• Advantages – offers higher reliability (operation
of the bus is not dependent on any one device).
• SCSI bus is an example of distributed
(decentralized) arbitration.

More Related Content

What's hot

Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
ankush_kumar
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
Tech_MX
 

What's hot (20)

Direct Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationDirect Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and Implementation
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memory
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
 
Internal memory
Internal memoryInternal memory
Internal memory
 
Direct Memory Access
Direct Memory AccessDirect Memory Access
Direct Memory Access
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Dd sdram
Dd sdramDd sdram
Dd sdram
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Applications of paralleL processing
Applications of paralleL processingApplications of paralleL processing
Applications of paralleL processing
 
COA asynchronous data transfer
COA asynchronous data transferCOA asynchronous data transfer
COA asynchronous data transfer
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Memory organisation ppt final presentation
Memory organisation ppt final presentationMemory organisation ppt final presentation
Memory organisation ppt final presentation
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Memory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/OMemory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/O
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
 

Viewers also liked

Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
Nehal Naik
 
Dma transfer
Dma transferDma transfer
Dma transfer
gmnithya
 

Viewers also liked (20)

DPA
DPADPA
DPA
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
I/O Channel IBM 370
I/O Channel IBM 370I/O Channel IBM 370
I/O Channel IBM 370
 
8051 memory
8051 memory8051 memory
8051 memory
 
Interrupts
InterruptsInterrupts
Interrupts
 
Fpga 02-memory-and-pl ds
Fpga 02-memory-and-pl dsFpga 02-memory-and-pl ds
Fpga 02-memory-and-pl ds
 
Input output module
Input output moduleInput output module
Input output module
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
 
Dma
DmaDma
Dma
 
Dma transfer
Dma transferDma transfer
Dma transfer
 
8085 interrupt.....
8085 interrupt.....8085 interrupt.....
8085 interrupt.....
 
memory 8051
memory  8051memory  8051
memory 8051
 
PyCoRAM: Yet Another Implementation of CoRAM Memory Architecture for Modern F...
PyCoRAM: Yet Another Implementation of CoRAM Memory Architecture for Modern F...PyCoRAM: Yet Another Implementation of CoRAM Memory Architecture for Modern F...
PyCoRAM: Yet Another Implementation of CoRAM Memory Architecture for Modern F...
 
8051 Inturrpt
8051 Inturrpt8051 Inturrpt
8051 Inturrpt
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
07 Input Output
07  Input  Output07  Input  Output
07 Input Output
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontroller
 
Interrupt of 8085
Interrupt of 8085Interrupt of 8085
Interrupt of 8085
 
8 interrupt 8051
8 interrupt 80518 interrupt 8051
8 interrupt 8051
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 

Similar to Direct memory access

Dma and dma controller 8237
Dma and dma controller 8237Dma and dma controller 8237
Dma and dma controller 8237
Ashwini Awatare
 

Similar to Direct memory access (20)

DMA Versus Polling or Interrupt Driven I/O
DMA Versus Polling or Interrupt Driven I/ODMA Versus Polling or Interrupt Driven I/O
DMA Versus Polling or Interrupt Driven I/O
 
A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Ca 2 note mano
Ca 2 note manoCa 2 note mano
Ca 2 note mano
 
DMA operation
DMA operationDMA operation
DMA operation
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
DMA Controller Presentation
DMA Controller PresentationDMA Controller Presentation
DMA Controller Presentation
 
fathima.pptxjhvjhvjhvjhvhvjhchvhvjvjhvjhj
fathima.pptxjhvjhvjhvjhvhvjhchvhvjvjhvjhjfathima.pptxjhvjhvjhvjhvhvjhchvhvjvjhvjhj
fathima.pptxjhvjhvjhvjhvhvjhchvhvjvjhvjhj
 
coadma-150401131446-conversion-gate01.pptx
coadma-150401131446-conversion-gate01.pptxcoadma-150401131446-conversion-gate01.pptx
coadma-150401131446-conversion-gate01.pptx
 
DMA
DMADMA
DMA
 
Direct access memory
Direct access memoryDirect access memory
Direct access memory
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
 
computer system structure
computer system structurecomputer system structure
computer system structure
 
I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptx
 
DMA
DMADMA
DMA
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk scheduling
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
 
07 input output
07 input output07 input output
07 input output
 
Dma and dma controller 8237
Dma and dma controller 8237Dma and dma controller 8237
Dma and dma controller 8237
 
07 input output
07 input output07 input output
07 input output
 

More from WBUTTUTORIALS (12)

Software testing-and-analysis
Software testing-and-analysisSoftware testing-and-analysis
Software testing-and-analysis
 
Query optimisation
Query optimisationQuery optimisation
Query optimisation
 
Fuzzy logic-introduction
Fuzzy logic-introductionFuzzy logic-introduction
Fuzzy logic-introduction
 
Failure mode-and-effects-analysis
Failure mode-and-effects-analysisFailure mode-and-effects-analysis
Failure mode-and-effects-analysis
 
Cost volume-profit-relationships
Cost volume-profit-relationshipsCost volume-profit-relationships
Cost volume-profit-relationships
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementation
 
Relational model
Relational modelRelational model
Relational model
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-concepts
 
Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
 
Ajax toolkit-framework
Ajax toolkit-frameworkAjax toolkit-framework
Ajax toolkit-framework
 
Ajax
AjaxAjax
Ajax
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Direct memory access

  • 1. DMA Versus Polling or Interrupt Driven I/O • Polling and Interrupt driven I/O concentrates on data transfer between the processor and I/O devices. • An instruction to transfer (mov datain,R0) only occurs after the processor determines that the I/O device is ready – Either by polling a status flag in the device interface or – Waits for the device to send an interrupt request. • Considerable overhead is incurred, because several program instructions must be executed for each data word transferred. • Instructions are needed to increment memory address and keeping track of work count. • With interrupts, additional overhead associated with saving and restoring the program counter and other state information.
  • 2. Direct Memory Access (DMA) • To transfer large blocks of data at high speed, an alternative approach is used. • Blocks of data are transferred between an external device and the main memory, without continuous intervention by the processor.
  • 3. DMA Controller • DMA controller is part of the I/O interface. • Performs the functions that would normally be carried out by the processor when access main memory. For each word transferred, it provides the memory address and all the bus signals that control data transfer.
  • 4. DMA Controller • Although DMAC can transfer data without intervention by the processor, it’s operation must be under the control of a program executed by the processor. • To initiate the transfer of a block of data, the processor sends the starting address, the number of words in the block, and direction of the transfer. Once information is received, the DMAC proceeds to perform the requested operation. When the entire block has been transferred, the controller informs the processor by raising an interrupt signal.
  • 5. Processor Main Memory Disk Printer Keyboard DMA Controller Disk Use of DMA Controllers in a Computer System Network Interface Disk/DMA Controller
  • 6. How is OS involved • I/O operations are always performed by the OS in response to a request from an application program. • OS is also responsible for suspending the execution of one program and starting another. – OS puts the program that requested the transfer in the Blocked state, – initiates the DMA operation, – starts execution of another program. • When the transfer is complete, the DMA controller informs the processor by sending an interrupt request. – OS puts suspended program in the Runnable state so that it can be selected by the scheduler to continue execution.
  • 7. Registers in a DMA Interface Status and Control Starting Address Word Count 31 30 1 0 IRQ IE Done R / W’
  • 8. Cycle Stealing • Requests by DMA devices for using the bus are alwas given higher priority than processor requests. • Among different DMA devices, top priority is given to high-speed peripherals (disks, high-speed network interface, graphics display device) • Since the processor originates most memory access cycles, it is often stated that DMA steals memory cycles from the processor (cycle stealing). • If DMA controller is given exclusive access to the main memory to transfer a block of data without interruption, this is called block or burst mode..
  • 9. Buffers and Arbitration • Most DMACs have a data storage buffer – network interfaces receive data from main memory at bus speed, send data onto network at network speed. • Bus Arbitration is needed to resolve conflicts with more than one device (2 DMACs or DMA and processor, etc..) try to use the bus to access main memory.
  • 10. Bus Arbitration • Bus Master – the device that is allowed to initiate bus transfers on the bus at any given time. When the current master relinquishes control, another device can acquire this status. • Bus Arbitration – the process by which the next device to become bus master is selected and bus mastership is transferred to it.
  • 11. Arbitration Approaches • Centralized – a single arbiter performs the arbitration. • Distributed – all devices participate in the selection of the next bus master.
  • 12. Centralized Arbitration • Bus arbiter may be processor or a separate unit connected to the bus. Processor DMA Controller 1 DMA Controller 2BG1 BG2 BR BBSY
  • 13. Distributed Arbitration • No central arbiter used • Each device on bus is assigned a 4-bit identification number. • When one or more devices request the bus, they assert the Start-Arbitration signal and place their 4-bit ID number on ARB[3..0]. • The request that has the highest ID number ends up having the highest priority. • Advantages – offers higher reliability (operation of the bus is not dependent on any one device). • SCSI bus is an example of distributed (decentralized) arbitration.