Click to See Complete Forum and Search --> : DMA Question
hongman
December 13th, 2004, 01:25 PM
Hi all :D
Dont worry, this one shouldnt be a brain frizzler like the last one :D
Righto: DMA
Direct Memory Access. The way I understand it, this 'feature' lets devices access the memory directly, without going through the CPU, therefore reducing workload on the CPuU and letting devices access the memory resources quicker...
Question is, does it really bypass the CPU completely? I thought EVERYTHING had to go through the CPU...
Here's my theory. Is it that DMA simply 'reserves' a portion of the memery for that device, so that when that devices needs to, it just says to the CPU 'I need to access this address range' instead of 'allocate me a memory range'...thereby making it quicker and less stressful but not bypassin the CPU completely?
Or is it that simply the device talks with the memory controller directly??
Sorry guys, and thanks
Hong
Train
December 13th, 2004, 02:04 PM
Well that is about what webopedia says also.
http://www.webopedia.com/TERM/D/DMA.html
Short for direct memory access, a technique for transferring data from main memory to a device without passing it through the CPU. Computers that have DMA channels can transfer data to and from devices much more quickly than computers without a DMA channel can. This is useful for making quick backups and for real-time applications.
Now watch it, as this link may cause a fuse to blow.
http://cnx.rice.edu/content/m11867/latest/
And a excerp:
"Direct memory access is system that can control the memory system without using the CPU. On a specified stimulus, the module will move data from one memory location or region to another memory location or region. While it is limited in its flexibility, there are many situations where automated memory access is much faster than using the CPU to manage the transfers. Systems like the ADC, DAC and PWM capturing all require frequent and regular movements of memory out of their respective systems. The DMA can be configured to handle moving the collected data out of the peripheral module and into more useful memory locations (like arrays). Only memory can be accessed this way, but most peripheral systems, data registers, and control registers are accessed as if they were memory. The DMA is intended to be used in low power mode because it uses the same memory bus as the CPU and only one or the other can use the memory at the same time.
The DMA system is organized into three largely independent parts. Though the three compete for the same memory bus, they have can be configured for independent triggers and memory regions. "
hongman
December 13th, 2004, 02:26 PM
Thanks Train!
But alas...
The definition from Webopedia makes sense, but lacks detail. The quote (and indeed the link you provided) is a bit too in-depth!! Sorry!! :( Indeed, I think I just blew another couple of fuses!!
There are too many terms and acronyms there I dont know. :(
To simplify this:
Or is it that simply the device talks with the memory controller directly??
Yes or No?
We can go into detail a little later, if need be!! :D:D
Train
December 13th, 2004, 04:25 PM
Yes it talks directly.
All the mumbp jumo means it bypasses the cpu thus speeding things up.
hongman
December 13th, 2004, 04:39 PM
Yes it talks directly.
Sorry to be picky train, but does that mean directly with the memory OR the memory controller?
Train
December 13th, 2004, 04:51 PM
Originally posted by hongman
Sorry to be picky train, but does that mean directly with the memory OR the memory controller?
Yes, it can write dirctly to the ram. To quote "The DMA channel will copy the data from the starting memory location or block to the destination memory location or block. There are many variations on this."
Hope I did not lose you with that.
hongman
December 13th, 2004, 05:00 PM
Many Thanks Train :D:D
Train
December 13th, 2004, 05:06 PM
:D
DrMDJ
December 13th, 2004, 07:14 PM
Well, at least this question doesn't immediately cause one's head to start pounding.:D Train seems to have pretty much got ya covered, but I'll through in a couple thoughts.
First, on this issue of "directly communicating with memory"... Nothing, repeat nothing, directly interfaces with the actual memory (the memory sticks, the memory chips on the sticks) without going through the memory controller(s). The controllers provide the only electrical interface to the memory, and they also are the only things that have the built-in logic (code) to actual do the directing of traffic (so to speak) and issue the commands to actual get a piece of data in to the actual memory. So, whether you're talking about memory actually being accessed whether in conjunction with DMA or anything else, the memory controller(s) are in the picture. But, by convention it is common to leave the memory controllers out of the equation when talking about accessing memory. Much the same way we don't talk about some communication flowing throw say the north or south bridges of the chipset, or through the ide cable enroute to a disk drive, etc, etc. Though these things might not be explicitely mentioned as being in the flow of things they by default have to be because they provide an uncircumventable link (piece in the connection) to the piece of hardware. Follow?
Now, there are actually 2 types of DMA and that sometimes seem to get treated as the same, but they aren't. There's the kind of generic or "regular" or "conventional" DMA, and then there's what's called Bus Mastering DMA.
Let me stop and make a point here... Both types allow the CPU's involvement in various operations to be greatly reduced, freeing it to devote cycles to other things. Now ultimately the CPU (with few exceptions) is not cut out entirely/totally from an i/o operation, even when DMA is used. But as I say, its involvement is minimized greatly. Basically it can initiate the operation (I/O), turn the execution and management of the operation over to other hardware, and basically say "let me know when you've done what I've asked you to do" (which may then require the cpu to get involved again, such as when it needs to do something with data presented it from, say, a hard drive). Anyway...
The "regular" DMA (referred to above) is the older, original type DMA, and not really used that much today. Any time you hear/see references to DMA "channels" then what's being talked about is this older DMA. The channels are simply electrical paths, tied to a DMA controller, which has some intelligence to manage the transfers. This type of DMA only is applicable to devices attached through and communicated to via the ISA bus. Examples are parallel port printers, maybe modems, etc. Today's hard drives and such do not use this type of DMA. As said, this type of DMA involves the use of DMA channels, and devices that use this type of DMA get DMA channels (there are 8) assigned to them (another "resource", just like IRQs and I/O address ranges). You will (or can) see these assignments in something like Windows Device Manager. Now this "regular" DMA did/does (as said) remove a lot of burden/involvement from the CPU. But it had/has too many limitations to make it really viable and worthwhile for many devices. Like I said: a) it uses dedicated channels, which are finite in number, b) it only can be used by devices operated through the ISA bus, and c) it (because of things related to a and b and some other related stuff) is a bit cimbersome and does not offer tremendous speed advantages. So that's where Bus Mastering DMA comes in.
Bus Mastering DMA is what people are using and dealing with most of the time these days. This is the type of DMA invovled when you deal with things like hard drives, optical drives, etc. Bus Mastering DMA uses no channels, no DMA controllers. The communications are directly between the peripherals/devices and memory (subject to my caveat above) where the i/o data and commands are stored related to a read or a write operation. There is no DMA controller sitting in the middle acting as a traffic cop (so to speak) like with conventional DMA. Bus mastering DMA is used with (applies to) devices communicating via the PCI bus (like today's hard drives and their controllers). As a result, bus mastering dma is more streamlined and efficient overall and therefore provides greater speed benefits.
Alright I'll stop now.:D
Train
December 13th, 2004, 08:21 PM
Kind of goes counter to my learning, but still a point I have pondered over. So, the memory contollers are still in line up.
Thanks!
DrMDJ
December 13th, 2004, 08:30 PM
Got to be, there is no other electrical path between the sticks and the "outside world". Like I said.... It's kind of like we say that with say something like DMA (bus mastering) that the communication is directly between the drive and memory. Well forgetting even the memory end, you can't get to the drive without going (electrically) through the (say) drive controller and the ide cable (and a few other things). "Direct" often doesn't and can't truely mean totally one-to-one direct.
hongman
December 14th, 2004, 01:30 PM
Well, at least this question doesn't immediately cause one's head to start pounding
Hehe, maybe not yours, but mines started a long time ago!!
First, on this issue of "directly communicating with memory"... follow?
Yes!! (thank god)
Now, there are actually 2 types of DMA and that sometimes seem to get treated as the same, but they aren't. There's the kind of generic or "regular" or "conventional" DMA, and then there's what's called Bus Mastering DMA.
Now why couldnt they tutor explain this? She made out there were was only one type of DMA, or rather, failed to mention there were 2. :rolleyes:
Alright I'll stop now.
No, carry on doc!! The more I learn now the better...saves me some hassle along the way!!
I personally and gratefully thank everyone again...this A+ would have ben a done deal (FAIL) if it weren't for Vdr. At least now I have a fighting chance!! ;)
Regards
Hong
Train
December 14th, 2004, 02:04 PM
quote:
--------------------------------------------------------------------------------
Well, at least this question doesn't immediately cause one's head to start pounding
--------------------------------------------------------------------------------
Hehe, maybe not yours, but mines started a long time ago!!
Well when some one has to use a piledriver :D :D
A+ or no A+ still it is a good learning tool. I APPRECIATE it!
What better way to learn?
Helps clear the air so to speak.
hongman
December 14th, 2004, 02:38 PM
A+ or no A+ still it is a good learning tool. I APPRECIATE it!
What better way to learn?
Helps clear the air so to speak.
Yes, definately!! :D :D :D :D
DrMDJ
December 14th, 2004, 03:09 PM
Now why couldnt they tutor explain this? She made out there were was only one type of DMA, or rather, failed to mention there were 2.Perhaps because she was speaking of DMA from a conceptual standpoint or from the standpoint of what it fundimentally involves (how it operates) regardless of the actual implementation? Maybe because the older/conventional type of DMA has/is quickly going the way of all flesh? Don't know.:confused:
hongman
December 14th, 2004, 03:37 PM
or maybe she is just reading out her book and doesnt actually understand it :)
Still waiting for the shotgun to arrive ;) :p
hongman
December 14th, 2004, 05:00 PM
additional but related question:
What is the difference between DMA and UDMA?
Are there any more formats (lesser known perhaps?)
Hong
Train
December 14th, 2004, 07:32 PM
Why not start with just a dab of history on that subject. (http://www.pcguide.com/ref/hdd/if/ide/modes_DMA.htm) and it moves on to Ultra DMA mode 5.
DrMDJ
December 14th, 2004, 07:37 PM
A good link Train provided there Hong to maybe show where UDMA fits in to the DMA (bus mastering) scheme. It ya have questions after that, feel free to ask. We won't answer them of course, but feel free to ask.;) :D
hongman
December 15th, 2004, 04:16 AM
Why not start with just a dab of history on that subject. and it moves on to Ultra DMA mode 5.
Thanks train, i'll check it out later today (need coffee!)
We won't answer them of course, but feel free to ask
ROFLMAO :D:D
DRead
December 15th, 2004, 04:41 AM
thanks again guys if it wasn't for your help i'd agree with hong we'd both be sunk (were both on this bloody course).
user595212
December 15th, 2004, 04:43 AM
aaaaaaaagggggggggggggggghhhhhhhhhhhhhh!!!!!
Now my head is pounding, or will be. Sorry I stopped in at this thread! Ha ha. Though actually, I mostly was able to follow what DrMDJ said, as opposed to Webopedia. Zowie!!
Hongman: Time to find yourself a new tutor?????
That is, if you expect to pass the A+.
What were you paying her again? You could get it all from Virtual Dr., for free!!
Cheers
Wendy
:D
Train
December 15th, 2004, 08:45 AM
Originally posted by user595212
What were you paying her again? You could get it all from Virtual Dr., for free!!
Cheers
Wendy
:D
Seems he has ordered a shotgun and lots of ammo somewhere in these threads.
DRead and user595212, feel free to chime in anytime. The only supid question is the one you do not ask, Yep I do it too. Got proof in this thread also. Doc corrected it.
hongman
December 15th, 2004, 09:29 AM
Yeah Dread, chip in. He's sooo lazy (and sitting next to me...) :D
What were you paying her
Hehe, nothing. I work for the company that provides the training :D :eek:
Funny how you think you know something, but until you sit there and REALLY think about it, you realise that you know nothing at all short of what the acroymn stands for :rolleyes:
DrMDJ
December 15th, 2004, 04:29 PM
Funny how you think you know something, but until you sit there and REALLY think about it, you realise that you know nothing at all short of what the acroymn stands for LOL. Well, you're way ahead of a lot of people in that you are actually thinking about it and looking to understand things. It should come as no surprise to you how many people know (and are content to know) some jargon, some buzzwords and can regurgitate things, but when it comes to understanding...
hongman
December 15th, 2004, 05:37 PM
...A whole different story :p
virtualdr.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.