D75P 34 – HNC Computer Architecture Week 8 Direct Memory Access. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated.

Slides:



Advertisements
Similar presentations
Homework Reading Machine Projects Labs
Advertisements

D75P 34 – HNC Computer Architecture Week 10 Computer Memory. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
D75P 34 – HNC Computer Architecture Week 4 Reading and writing to RAM. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where.
CS-334: Computer Architecture
DH2T 34 Computer Architecture 1 LO2 Lesson Two CPU and Buses.
DIRECT MEMORY ACCESS CS 147 Thursday July 5,2001 SEEMA RAI.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access (DMA)
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 2: Managing Hardware Devices.
IT Systems In and Out EN230-1 Justin Champion C208 –
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
1 Introduction to Computers Day 6. 2 Main Circuit Board of a PC The main circuit board (motherboard or system board) is the central nervous system of.
Prepared by Careene McCallum-Rodney Hardware specification of a computer system.
PHY 201 (Blum) Buses Warning: some of the terminology is used inconsistently within the field.
System Resources INFO1119 (Fall 2012).
Input / Output CS 537 – Introduction to Operating Systems.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
XP Practical PC, 3e Chapter 17 1 Upgrading and Expanding your PC.
Interconnection Structures
… when you will open a computer We hope you will not look like …
How Hardware and Software Work Together
CHAPTER 5 I/O PRINCIPLE Understand the principles of System Bus
D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except.
Bus structures Unit objectives Describe the primary types of buses, and define interrupt, IRQ, I/O address, DMA, and base memory address Describe the features.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 2: Managing Hardware Devices.
Organization of a computer: The motherboard and its components.
Day 4 Understanding Hardware Partitions Linux Boot Sequence.
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
D75P 34R HNC Computer Architecture 1 Week 9 The Processor, Busses and Peripherals © C Nyssen/Aberdeen College 2003 All images © C Nyssen /Aberdeen College.
System Resources.
Computer system components By Corey Burton. GPU GPU stands for ‘graphics processing unit’. The GPU can help the computer run smoothly. GPU is used for.
Block I/O. 2 Definition Any I/O operation in which the unit of data is several words, not just one word or byte.
Buses Warning: some of the terminology is used inconsistently within the field.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
THE PARTS OF A PERSONAL COMPUTER Adrian St.Hill Faith Christian Academy Basic Computer Training August 2010.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
Hardware. Make sure you have paper and pen to hand as you will need to take notes and write down answers and thoughts that you can refer to later on.
Chapter 19 Upgrading and Expanding Your PC. 2Practical PC 5 th Edition Chapter 19 Getting Started In this Chapter, you will learn: − If you can upgrade.
BUS IN MICROPROCESSOR. Topics to discuss Bus Interface ISA VESA local PCI Plug and Play.
Computer Architecture Part IV-B: I/O Buses. Chipsets Intelligent bus controller chips found on the motherboard Enable higher speeds on one or more buses.
BAT3O / BTX4C. Definition: A computer is an electronic machine that 1) takes in data and instructions (input) 2) works with the data (processing) 3) puts.
D75P 34 Computer Architecture Week 9 Austin And The Powers. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated.
Buses All devices in the computer are connected to the External Data Bus Extension to External Data Bus called Expansion Bus –Used for devices that might.
Chapter 3 System Configuration The Complete A+ Guide to PC Repair 5/e Update.
D75P 34 – HNC Computer Architecture Week 1 Main Components Of A Processor © C Nyssen/Aberdeen College 2003 All images © C Nyssen /Aberdeen College unless.
D75P 34 – HNC Computer Architecture Week 5 Memory Maps. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Prepared.
Input-Output Organization
DH2T 34 – HNC Computer Architecture 1 Lecture 14 The Fetch-Decode-Execute Cycle [1]. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.
D75P 34 – HNC Computer Architecture
D75P 34 – HNC Computer Architecture Week 10 Korean Text Support. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated.
AmendmentsAmendments Advanced Higher. The PCI bus was adequate for many years, providing enough bandwidth for all the peripherals most users might want.
1 Chapter 2 Central Processing Unit. 2 CPU The "brain" of the computer system is called the central processing unit. Everything that a computer does is.
Chapter 8: Installing Linux The Complete Guide To Linux System Administration.
D75P 34 – HNC Computer Architecture 1 Week 11 Polling and Interrupting. © C Nyssen/Aberdeen College 2004 All images © C Nyssen/Aberdeen College except.
System Bus.
Inside a PC Exploring the CPU. CPU: Objectives Students will identify and explain the function of the CPU Students will research various CPUs so they.
بسم الله الرحمن الرحيم MEMORY AND I/O.
 System Requirements are the prerequisites needed in order for a software or any other resources to execute efficiently.  Most software defines two.
Jeffrey Ellak CS 147. Topics What is memory hierarchy? What are the different types of memory? What is in charge of accessing memory?
Lecture Overview Shift Register Buffering Direct Memory Access.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Chapter 19 Upgrading and Expanding Your PC
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Bus Systems ISA PCI AGP.
Computer hardware f1031 – computer hardware.
IRQ, DMA and I/O Ports - Introduction -
I/O BUSES.
Presentation transcript:

D75P 34 – HNC Computer Architecture Week 8 Direct Memory Access. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Prepared 20/10/03

Direct Memory Access is an i/o technique enabling high speed data transfers. This is where a device is allowed to take over the main computer bus from the CPU and transfer bytes directly to/from main memory. This is also called Autonomous Data Transfer.

Normally the CPU would make such a transfer in a two step process: 1. reading from the I/O memory space of the device and putting these bytes into the CPU itself 2. writing these bytes from the CPU to main memory With DMA it's usually a one step process of sending the bytes directly from the device to memory.

A transfer using DMA is set up by a DMAC (Direct Memory Access Controller). Modern PC systems which still utilise ISA busses require DMAC chips to use this system.

The device must have such capabilities built into its hardware and thus not all devices can use DMA. Devices do not normally install to use DMA by default, and have to be manually set to utilise it.

Because the data can pass directly between the RAM and device, this saves both time and frees the processor up to get on with other things. The DMAC will either stop the CPU and access the RAM (cycle stealing DMA) or use the bus when the CPU does not required it (hidden cycle DMA). One of the limitations of DMA is that the DMAC still uses the same busses as the CPU, and only one can use it at a time.

 The DMAC makes a request to the CPU  The CPU hands over control of the bus  The DMAC reads the device and transfers the data to memory  The DMAC hands back control to the CPU at the end of the operation

The IBM series (successors and clones) all use 2 x Intel 8237 chips, mounted on one circuit, as a DMAC. Each chip provides 4 separate “lines”, or channels, giving a total of 8. DMA channels are numbered 0 – 7. Channel 4 is never used by devices as it is used by the DMAC itself!

Like IRQ lines, each DMA-enabled device should have it’s own channel. It is sometimes possible (but risky) to force two devices to share a channel, but only one can use it at the one time.

Devices on a PCI bus don’t need the DMAC. Instead they use a system called Bus Mastering. Photo © ExHardware, with permission This is, confusingly, sometimes called DMA as well - for example, hard disk drives may be marketed as "UDMA".

Bus Mastering transfers bytes in exactly the same way as DMA, but doesn’t need the channel numbers. This is why you won’t see any resource allocation of DMA channels for items on a PCI bus. This controller card fits into a PCI slot, and lets you add more devices if you have run out of IDE sockets. It is marketed as an ATA-133 standard card, another form of DMA that can transfer data at up to 133 MB/second. Photo © Alchemy, with permission

As part of your assessment, you will have to draw a graph showing the difference in efficiency between DMA-enabled and non-enabled devices. “A system can write from RAM to a hard drive at a rate of 10 bytes/ms where DMA cannot be used.” How long will it take to write a typical 512-byte sector?

512 bytes / 10 = 51.2 bytes per ms. We can plot this on a graph like this…

You will then be given a breakdown of the time the data spends, passing through each component buffer. “The data spends 25% of this time passing through RAM, 25% of the time through the hard drive buffer and the remaining 50% of time through the CPU.” The data would spend 25.6 ms in the CPU, 12.8 ms in the RAM buffer and 12.8 ms in the hard drive buffer.

At the moment, the total time taken is in direct proportion to the amount of data transferred. So 2 KB of data would take milliseconds to be written. The proportions would be the same – ms in the CPU, 51.2 ms each in the RAM and Hard Drive buffers. Because the amount of time taken will always vary in this way, this is a “Variable Cost”.

If we were to use DMA or Bus Mastering, we would save the time that the data would normally spend passing through the CPU. Our original 512 bytes of data would now only take 25.6ms to transfer – 12.8ms in the RAM and 12.8ms in the HDD buffer. We have dispensed with the CPU time completely, thus saving 25.6ms.

This is still totally variable – the 2kB of data would take 102.4ms (51.2ms in the RAM, 51.2ms in the HDD buffer, no time in the CPU). By dispensing with the CPU, we can transfer the same amount of data in 50% of the time. Or alternatively, double the amount of data in the same amount of time!

There is, however, something to pay for this extra speed. Some time has to be allowed to set up the DMAC or Bus Mastering so that the CPU can be bypassed. This is a “Fixed Cost” because it always takes the same amount of time, no matter how much data is being transferred.

“The DMA controller requires 2ms setup time”. This will always take 2ms, whether 512 bytes or 512 gigabytes are being transferred.

Our original 512 bytes will now take 27.6 ms to transfer – (12.8ms in HDD buffer) + (12.8ms in RAM) + (2.0ms for DMAC setup). The 2kB will take milliseconds - (51.2ms in HDD buffer) + (51.2ms in RAM) + (2.0ms for DMAC setup). The total time taken consists of two separate elements –  Variable time-cost (depending on amount of data being transferred through buffers) plus  Fixed time-cost (to set up the transfer).

To show the whole measurement on the graph, we have to add the 2ms on to every single point on the variable cost line. This has the effect of a vertical shift on the graph of 2 ms.

Summary DMA stands for "Direct Memory Access". This is where a device is allowed to take over the main computer bus from the CPU and transfer bytes directly to main memory. There are two “sorts” of DMA – DMAC chip control for ISA busses Bus Mastering for PCI busses Only DMA-enabled devices can use this system. Some time has to be allocated to set up the DMAC or Bus Mastering, but the data saves time by not having to pass through the CPU.