SlideShare une entreprise Scribd logo
1  sur  32
Group Members:
• Maryam Khalid (BCS18-002)
• Mahnoor Malik (BCS18-004)
• Abeera Mughal (BCS18-029)
• Aima Mohsin (BCS18-039)
• Linta Nasir (BCS18-038)
• Nimra Amjad (BCS18-033)
TOPICS:
• DMA(Direst Memory Access)
• Working Of DMA
• OS using DMA hardware
• Explanation of polling
• Explanation of interrupts
• Comparison of polling and interrupts
What is DMA?
Direct memory access (DMA) is a feature of most computers that
allows certain hardware submodules to access system the
memory for reading and writing. The interaction between the
subsystems and the memory is carried out independently of the
CPU. Some systems that use DMA include disk drive controllers,
graphics cards, network cards, sound cards, etc.
2 cycles
CPU
Memory
I/O
devices
1 cycle
CPU
Memory
I/O
devices
Why there is a need of DMA?
• Slow data transmission may easily cause a bottleneck on
program execution
• I/O devices cannot get synchronize with CPU.
Advantages and Disadvantages
Advantages of DMA include:
• high transfer rates
• fewer CPU cycles for each transfer
Some disadvantages include:
• DMA transfer requires a DMA controller to carry out
the operation, hence more expensive system,
• synchronization mechanisms must be provided in order
to avoid accessing non-updated information from RAM.
DMA CONTROLLER
• Direct Memory Access needs a special
hardware called DMA controller (DMAC) that
manages the data transfers.
• The Direct Memory Access (DMA) controller
enables the movement of blocks of data from
peripheral to memory, memory to peripheral,
or memory to memory without burdening the
processor.
How DMA Controller Operations are Performed?
• Following is the sequence of operations performed by a DMA −
• Initially, when any device has to send data between the device
and the memory, the device has to send DMA request (DRQ)
to DMA controller.
• The DMA controller sends Hold request (HRQ) to the CPU and
waits for the CPU for acknowledgement signal the HLDA.
• The CPU leaves the control over bus and acknowledges the
HOLD request through HLDA signal.
• Now the CPU is in HOLD state and the DMA controller has to
manage the operations over buses between the CPU,
memory, and I/O devices.
DMA Controller Transfer Mode
• The DMA transfers the data in three modes which include
the following.
• a) Burst Mode: In this mode DMA handover the buses to
CPU only after completion of whole data transfer.
• b) Cycle Stealing Mode: In this mode, DMA gives control
of buses to CPU after transfer of every byte.
• c) Transparent Mode: Here, DMA transfers data only when
CPU is executing the instruction which does not require the
use of buses.
Features
• It has four channels which can be used over four I/O devices.
• Each channel has 16-bit address and 14-bit counter.
• Each channel can transfer data up to 64kb.
• Each channel can be programmed independently.
• Each channel can perform read transfer, write transfer and
verify transfer operations
• THE OPERATING SYSTEM
USES DMA HARDWARE AS
FOLLOW:
• Step1:
Device driver is instructed to transfer
disk data to a buffer address X
• Step 2:
Device driver then instruct disk
controller to transfer data to buffer
• Step 3:
Disk controller then starts DMA transfer.
• Step 4:
Disk Controller then sends each byte to
DMA controller.
• Step 5:
DMA controller transfers bytes to buffer,
increases the memory
address,decreases the counter C until
C becomes zero.
Polling:
The process of periodically checking status of
the device to see if it is time for the next I/O
operation, is called polling.
Polling is the simplest way for an I/O device to
communicate with the processor
The I/O device simply puts the information in a
Status register, and the processor must come
and get the information
Most of the time, devices will not require
attention and when one does it will have to
wait until it is next interrogated by the polling
program.
Example:
Compare this method to a teacher
continually asking every student in a class,
one after another, if they need help.
Obviously the more efficient method would
be for a student to inform the teacher
whenever they require assistance.
Diagram:
DEVICE
A
DEVICE
B
DEVICE C
CPU
First
second
third
Advantages & Disadvantages of Polling:
• Advantages:
Simple program
Transmission reliability
No need for additional chips
• Disadvantages:
In efficient method as much of the processor
time wasted in unnecessary polls
Interrupt
An interrupt means to break the sequence of
operations
It is a hardware signal from a device to a CPU. It tells the CPU
that the device needs attention and that the CPU should stop
performing what it is doing and respond to the device. If a CPU
is available (it is not performing a task with higher priority), it
suspends the current thread and eventually invokes the interrupt
handler for that device. The job of the interrupt handler is to
service the device and stop it from interrupting.
Once the handler returns, the CPU resumes what it was doing
before the interrupt occurred.
Types
There are two types of interrupts:
1:Hardware Interupts
2:Software Interupts
Basic Operations of Interrupt
• CPU issues read command.
• I/O module gets data from peripheral
whilst CPU does other work.
• I/O module interrupts CPU.
• CPU requests data.
• I/O module transfers data.
Advantages&DisadvantagesofInterruptDriveI/O
Advantages
• Fast
• Efficient
Disadvantages
• can be tricky to write if using a low level language
• can be tough to get various pieces to work well
together
• usually done by the hardware manufacturer / OS
maker, e.g. Microsoft
Interrups vs Polling
• A computer must have a way of detecting
the arrival of any type of input. There are
two ways that this can happen, known
as polling and interrupts. Both of these
techniques allow the processor to deal with
events that can happen at any time and
that are not related to the process it is
currently running.
Interrups vs Polling
• CPU attention
• Protocol and mechanism
• Device serviced by..
• Time of services
• Request line & command ready
• Disturbance
DMA Controller Presentation
DMA Controller Presentation

Contenu connexe

Tendances

Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
Nehal Naik
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
Mustapha Fatty
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
Tech_MX
 

Tendances (20)

Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
 
Direct Memory Access(DMA)
Direct Memory Access(DMA)Direct Memory Access(DMA)
Direct Memory Access(DMA)
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
8259 a
8259 a8259 a
8259 a
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 
8086 in minimum mode
8086 in minimum mode8086 in minimum mode
8086 in minimum mode
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Direct access memory
Direct access memoryDirect access memory
Direct access memory
 
Computer architecture input output organization
Computer architecture input output organizationComputer architecture input output organization
Computer architecture input output organization
 
8251 USART
8251 USART8251 USART
8251 USART
 
8259 programmable interrupt controller
8259 programmable interrupt controller8259 programmable interrupt controller
8259 programmable interrupt controller
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Direct Memory Access ppt
Direct Memory Access pptDirect Memory Access ppt
Direct Memory Access ppt
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 

Similaire à DMA Controller Presentation

Input Output Operations
Input Output OperationsInput Output Operations
Input Output Operations
kdisthere
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization
faria_khan
 

Similaire à DMA Controller Presentation (20)

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...
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
 
computer system structure
computer system structurecomputer system structure
computer system structure
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk scheduling
 
I/O systems chapter 12 OS
I/O systems chapter 12 OS I/O systems chapter 12 OS
I/O systems chapter 12 OS
 
Direct access memory
Direct access memoryDirect access memory
Direct access memory
 
Unit v: Device Management
Unit v: Device ManagementUnit v: Device Management
Unit v: Device Management
 
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
 
07 input output
07 input output07 input output
07 input output
 
Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture.
 
ch -6 IO.pptx
ch -6 IO.pptxch -6 IO.pptx
ch -6 IO.pptx
 
Input Output Operations
Input Output OperationsInput Output Operations
Input Output Operations
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output Organization
 
I/O Organization
I/O OrganizationI/O Organization
I/O Organization
 
Module 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacingModule 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacing
 
5120224.ppt
5120224.ppt5120224.ppt
5120224.ppt
 
Coa presentation4
Coa presentation4Coa presentation4
Coa presentation4
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization
 
I/O Management
I/O ManagementI/O Management
I/O Management
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

DMA Controller Presentation

  • 1.
  • 2. Group Members: • Maryam Khalid (BCS18-002) • Mahnoor Malik (BCS18-004) • Abeera Mughal (BCS18-029) • Aima Mohsin (BCS18-039) • Linta Nasir (BCS18-038) • Nimra Amjad (BCS18-033)
  • 3. TOPICS: • DMA(Direst Memory Access) • Working Of DMA • OS using DMA hardware • Explanation of polling • Explanation of interrupts • Comparison of polling and interrupts
  • 4. What is DMA? Direct memory access (DMA) is a feature of most computers that allows certain hardware submodules to access system the memory for reading and writing. The interaction between the subsystems and the memory is carried out independently of the CPU. Some systems that use DMA include disk drive controllers, graphics cards, network cards, sound cards, etc.
  • 7. Why there is a need of DMA? • Slow data transmission may easily cause a bottleneck on program execution • I/O devices cannot get synchronize with CPU.
  • 8. Advantages and Disadvantages Advantages of DMA include: • high transfer rates • fewer CPU cycles for each transfer Some disadvantages include: • DMA transfer requires a DMA controller to carry out the operation, hence more expensive system, • synchronization mechanisms must be provided in order to avoid accessing non-updated information from RAM.
  • 9. DMA CONTROLLER • Direct Memory Access needs a special hardware called DMA controller (DMAC) that manages the data transfers. • The Direct Memory Access (DMA) controller enables the movement of blocks of data from peripheral to memory, memory to peripheral, or memory to memory without burdening the processor.
  • 10. How DMA Controller Operations are Performed? • Following is the sequence of operations performed by a DMA − • Initially, when any device has to send data between the device and the memory, the device has to send DMA request (DRQ) to DMA controller. • The DMA controller sends Hold request (HRQ) to the CPU and waits for the CPU for acknowledgement signal the HLDA. • The CPU leaves the control over bus and acknowledges the HOLD request through HLDA signal. • Now the CPU is in HOLD state and the DMA controller has to manage the operations over buses between the CPU, memory, and I/O devices.
  • 11.
  • 12.
  • 13. DMA Controller Transfer Mode • The DMA transfers the data in three modes which include the following. • a) Burst Mode: In this mode DMA handover the buses to CPU only after completion of whole data transfer. • b) Cycle Stealing Mode: In this mode, DMA gives control of buses to CPU after transfer of every byte. • c) Transparent Mode: Here, DMA transfers data only when CPU is executing the instruction which does not require the use of buses.
  • 14. Features • It has four channels which can be used over four I/O devices. • Each channel has 16-bit address and 14-bit counter. • Each channel can transfer data up to 64kb. • Each channel can be programmed independently. • Each channel can perform read transfer, write transfer and verify transfer operations
  • 15. • THE OPERATING SYSTEM USES DMA HARDWARE AS FOLLOW:
  • 16. • Step1: Device driver is instructed to transfer disk data to a buffer address X
  • 17. • Step 2: Device driver then instruct disk controller to transfer data to buffer
  • 18. • Step 3: Disk controller then starts DMA transfer.
  • 19. • Step 4: Disk Controller then sends each byte to DMA controller.
  • 20. • Step 5: DMA controller transfers bytes to buffer, increases the memory address,decreases the counter C until C becomes zero.
  • 21.
  • 22. Polling: The process of periodically checking status of the device to see if it is time for the next I/O operation, is called polling. Polling is the simplest way for an I/O device to communicate with the processor The I/O device simply puts the information in a Status register, and the processor must come and get the information Most of the time, devices will not require attention and when one does it will have to wait until it is next interrogated by the polling program.
  • 23. Example: Compare this method to a teacher continually asking every student in a class, one after another, if they need help. Obviously the more efficient method would be for a student to inform the teacher whenever they require assistance.
  • 25. Advantages & Disadvantages of Polling: • Advantages: Simple program Transmission reliability No need for additional chips • Disadvantages: In efficient method as much of the processor time wasted in unnecessary polls
  • 26. Interrupt An interrupt means to break the sequence of operations It is a hardware signal from a device to a CPU. It tells the CPU that the device needs attention and that the CPU should stop performing what it is doing and respond to the device. If a CPU is available (it is not performing a task with higher priority), it suspends the current thread and eventually invokes the interrupt handler for that device. The job of the interrupt handler is to service the device and stop it from interrupting. Once the handler returns, the CPU resumes what it was doing before the interrupt occurred.
  • 27. Types There are two types of interrupts: 1:Hardware Interupts 2:Software Interupts Basic Operations of Interrupt • CPU issues read command. • I/O module gets data from peripheral whilst CPU does other work. • I/O module interrupts CPU. • CPU requests data. • I/O module transfers data.
  • 28. Advantages&DisadvantagesofInterruptDriveI/O Advantages • Fast • Efficient Disadvantages • can be tricky to write if using a low level language • can be tough to get various pieces to work well together • usually done by the hardware manufacturer / OS maker, e.g. Microsoft
  • 29. Interrups vs Polling • A computer must have a way of detecting the arrival of any type of input. There are two ways that this can happen, known as polling and interrupts. Both of these techniques allow the processor to deal with events that can happen at any time and that are not related to the process it is currently running.
  • 30. Interrups vs Polling • CPU attention • Protocol and mechanism • Device serviced by.. • Time of services • Request line & command ready • Disturbance