SlideShare a Scribd company logo
1 of 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
Group discusses DMA, interrupts and polling
Group discusses DMA, interrupts and polling

More Related Content

What's hot

Generate pwm signal through arduino of various duty
Generate pwm signal through arduino of various dutyGenerate pwm signal through arduino of various duty
Generate pwm signal through arduino of various dutyPANKAJPRAJAPATI45
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.ATUL KUMAR YADAV
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentalsJLoknathDora
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notesDr.YNM
 
Serial Communication
Serial CommunicationSerial Communication
Serial CommunicationRashmi
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesFellowBuddy.com
 
Motorola microprocessor
Motorola microprocessorMotorola microprocessor
Motorola microprocessorIffat Anjum
 
Io processing
Io processingIo processing
Io processingTech_MX
 
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.kVijay Kumar
 
Memory banking-of-8086-final
Memory banking-of-8086-finalMemory banking-of-8086-final
Memory banking-of-8086-finalEstiak Khan
 

What's hot (20)

Generate pwm signal through arduino of various duty
Generate pwm signal through arduino of various dutyGenerate pwm signal through arduino of various duty
Generate pwm signal through arduino of various duty
 
8086 modes
8086 modes8086 modes
8086 modes
 
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentals
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
 
DDR3
DDR3DDR3
DDR3
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture Notes
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Motorola microprocessor
Motorola microprocessorMotorola microprocessor
Motorola microprocessor
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
DDR4 SDRAM : Notes
DDR4 SDRAM : NotesDDR4 SDRAM : Notes
DDR4 SDRAM : Notes
 
Memory system
Memory systemMemory system
Memory system
 
Io processing
Io processingIo processing
Io processing
 
Interrupts
InterruptsInterrupts
Interrupts
 
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
 
DDR3 SDRAM : Notes
DDR3 SDRAM : NotesDDR3 SDRAM : Notes
DDR3 SDRAM : Notes
 
Memory banking-of-8086-final
Memory banking-of-8086-finalMemory banking-of-8086-final
Memory banking-of-8086-final
 
Programmable Timer 8253/8254
Programmable Timer 8253/8254Programmable Timer 8253/8254
Programmable Timer 8253/8254
 

Similar to Group discusses DMA, interrupts and polling

Direct memory access
Direct memory accessDirect memory access
Direct memory accessshubham kuwar
 
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...rsaravanakumar13
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzationdaxesh chauhan
 
computer system structure
computer system structurecomputer system structure
computer system structureHAMZA AHMED
 
Direct memory access
Direct memory accessDirect memory access
Direct memory accessWBUTTUTORIALS
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingmadhuributani
 
I/O systems chapter 12 OS
I/O systems chapter 12 OS I/O systems chapter 12 OS
I/O systems chapter 12 OS ssuser45ae56
 
Unit v: Device Management
Unit v: Device ManagementUnit v: Device Management
Unit v: Device ManagementArnav Chowdhury
 
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 .pptxwebip34973
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its typesNehal Naik
 
Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. pratikkadam78
 
Input Output Operations
Input Output OperationsInput Output Operations
Input Output Operationskdisthere
 
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 OrganizationMOHIT AGARWAL
 
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 interfacingDeepak John
 

Similar to Group discusses DMA, interrupts and polling (20)

Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
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
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
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
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
 
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
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Group discusses DMA, interrupts and polling

  • 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