DMA,Interrupts and Ports

Hi there!
So far I was successfully tampering around with my driver, having a
userlandprogram,use my driver to perfom some actions.
Now I want expand my driver.
My sources are not very specific regarding some details of the mentioned
topics.
I don’t need Interrupts for a legacy driver and I don’t have a device
using DMA,but still, I would love to play around with those things, and
even if I had an urgent need for them now the questions will remaind the
same.

1.Interrupts
The IoConnectInterrupt-routine requests a variable which is named
Vector in the WDK-documentation, a lot of
variables following this variable can be found in the very same
structure this variable is supposed to be in, but how/where do I obtain
this structure(from)?
(If I’m not mistaken Interrupts are handed from one member of a device
stack to the next one,so a legacydriver will never see an interrupt)
2.DMA
The routine IoGetDmaAdapter() requires a parameter of type
DEVICE_DESCRIPTION.
Since I’m using another device this function is supposed to operate on,
how do I obtain the descriptor of that device?
(The idea behind this is the following:
There a tools out there which perform a memorydump( like dd
if=“/dev/mem” of=“./dump” under linux), I would like to make such a
program of my own)
3.Ports
As far as I know these Ports are similar to I/O-ports,like
stdin,stdout,stderr,etc.
I also saw some code dealing with the functionallity of functions
working with Ports, but I never got to know how to obtain a port,or
where to obtain it from.

sincerly

Frank


Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Comments inline:

“Frank Freud” wrote in message news:xxxxx@ntdev…
> Hi there!
> So far I was successfully tampering around with my driver, having a
> userlandprogram,use my driver to perfom some actions.
> Now I want expand my driver.
> My sources are not very specific regarding some details of the mentioned
> topics.
> I don’t need Interrupts for a legacy driver and I don’t have a device
> using DMA,but still, I would love to play around with those things, and
> even if I had an urgent need for them now the questions will remaind the
> same.
>
> 1.Interrupts
> The IoConnectInterrupt-routine requests a variable which is named
> Vector in the WDK-documentation, a lot of
> variables following this variable can be found in the very same
> structure this variable is supposed to be in, but how/where do I obtain
> this structure(from)?
> (If I’m not mistaken Interrupts are handed from one member of a device
> stack to the next one,so a legacydriver will never see an interrupt)

You get the interrupt data from the resource passed to AddDevice.

> 2.DMA
> The routine IoGetDmaAdapter() requires a parameter of type
> DEVICE_DESCRIPTION.
> Since I’m using another device this function is supposed to operate on,
> how do I obtain the descriptor of that device?
> (The idea behind this is the following:
> There a tools out there which perform a memorydump( like dd
> if=“/dev/mem” of=“./dump” under linux), I would like to make such a
> program of my own)

You do not muck with another drivers DMA. As far as your idea DO NOT DO
IT. Microsoft has just spent a ton of time getting rid of this concept
because it opens a huge security hole which no user should tolerate.

> 3.Ports
> As far as I know these Ports are similar to I/O-ports,like
> stdin,stdout,stderr,etc.
> I also saw some code dealing with the functionallity of functions
> working with Ports, but I never got to know how to obtain a port,or
> where to obtain it from.

Ports have nothing to do with the I/O ports you are describing. Ports are
in fact I/O Ports that some hardware supports. Again like everything else
you get ports from the resources of AddDevice.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

Information from ESET NOD32 Antivirus, version of virus signature database 5386 (20100822)

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

“Frank Freud” wrote in message news:xxxxx@ntdev…

> I would love to play around with those things, and
> even if I had an urgent need for them now the questions will remaind the
> same.

No, this is unlikely.
When you have a genuine problem on your hands, your questions will be
much more specific, focused and worth reading (and answering).
These who have the time to play around, perhaps can go read the books and
WDK samples as well.

/* besides, when there is iPad and other cool toys around, playing with
Windows drivers
can mean some of these, er, neurotic things…
Obsessive idea to push Linux concepts to Windows may be a call of “operating
system unconscious” */

Regards,
–pa