PDA

View Full Version : When does DMA gets activated?



kcode
November 10th, 2008, 10:38 AM
When data transfer among peripheral devices is needed, either CPU does it || it is done by DMA. What i cant understand is that when does DMA gets activated? Does it gets activated by the CPU || it gets activated by requests from the peripheral devices it needs to act upon?

Another thing, where in the kernel code can i find such transfer of control?
And can i control the transfer dnyamically??

(I have extremely inefficient teachers in my college and i just hate them like hell, and this is the only place where i can find my answers!)

thanks

Ferrat
November 10th, 2008, 01:06 PM
http://en.wikipedia.org/wiki/Direct_memory_access

kcode
November 11th, 2008, 11:11 AM
http://en.wikipedia.org/wiki/Direct_memory_access

I got that!
But where in kernel the switch is implemented??

thanks

Zugzwang
November 11th, 2008, 12:16 PM
I got that!
But where in kernel the switch is implemented??

thanks

Just out of curiosity: Why do you need that information? Does it have something to do with your question regarding the playing of sound? From a developer's point of view, you should *never* worry about those details *except* if you want to make your own drivers.

Desty
November 11th, 2008, 06:26 PM
Another thing, where in the kernel code can i find such transfer of control?
And can i control the transfer dnyamically??

(I have extremely inefficient teachers in my college and i just hate them like hell, and this is the only place where i can find my answers!)
These are really specific questions; if you expect your lecturers to know answers to special mechanisms like this that are different in each operating system, then you're kidding yourself.

It's like expecting a geography teacher to know the population of every town in the world.

Have you checked the source code from some kernel drivers that deal with DMA? (e.g. disks, audio, video, network adapters)

kcode
November 12th, 2008, 07:03 AM
Just out of curiosity: Why do you need that information? Does it have something to do with your question regarding the playing of sound? From a developer's point of view, you should *never* worry about those details *except* if you want to make your own drivers.

I want to know only to play with my machine so that i can control it well, and then to break it and then build it, which goes on and on. I was just going through basic computer architecture (Morris Mano), during which i thought of how kernel implements this.


Does it have something to do with your question regarding the playing of sound?

No it has to nothing with that. Using Lenovo y-410, which has this problem.

kcode
November 12th, 2008, 07:21 AM
These are really specific questions; if you expect your lecturers to know answers to special mechanisms like this that are different in each operating system, then you're kidding yourself.

It's like expecting a geography teacher to know the population of every town in the world.


Teacher couldnt even explain what DMA is. I dont expect anything from teachers. They are all s***! They care more how you sit in the
lab than what you are doing in the lab. I just dont want to go to college...it is a daily torture for me.
I apologize for talking this s***, but sometimes i just feel to take it all out.

No i havent gone through those device drivers.

Npl
November 12th, 2008, 07:52 PM
I think it should be abstracted in the PCI-interface, thats where DMA typically occurs in a regular PC.

On the lowest level a DMA-Transfer needs to be triggered by either the CPU or another device. For example by writing source and destination parameters to a specific area in memory and then writing to a special address to initiate transfer. Could be initiated with interrupts aswell, that depends on the specific Bus-System used.