Re: XP SP2 WDM driver - Sharing Memory between driver and application
From: Arkady Frenkel (arkadyf_at_hotmailxdotxcom)
Date: 01/12/05
- Next message: Maxim S. Shatskih: "Re: Read Capacity"
- Previous message: Doron Holan [MS]: "Re: IoConnectInterrupt Continued..."
- In reply to: JimE: "RE: XP SP2 WDM driver - Sharing Memory between driver and application"
- Next in thread: Maxim S. Shatskih: "Re: XP SP2 WDM driver - Sharing Memory between driver and application"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 22:15:19 +0200
Really , that do possible and defined in
http://www.microsoft.com/whdc/driver/kernel/KM-UMGuide.mspx
Arkady
"JimE" <JimE@NOSPAMmacrolink.com> wrote in message
news:C11B2C1A-91AF-4E1D-BED9-07A54C349D2E@microsoft.com...
> Just a couple of suggestions - I've never worked on a driver like that:
>
> Get Walter Oney's Programming the Windows Driver Model 2nd edition. It has
> most everything you will need to know to write a WDM driver. NT is very
> different.
>
> You might attempt to allocate all the buffer space you need from
> NonPagedPool when you start your device. I have no idea if that much space
> can be allocated, but if it can, it will never get paged to disk.
>
> Sharing buffer space of any type between a user application and a kernel
> mode driver is generally not a good idea. A set of custom IOCTL codes to
> manipulate the data/device might be a better approach.
>
> Of course, these suggestions are provided without warranty, blah, blah,
> blah...
>
> "Paulo" wrote:
>
> > :
> > Hi all,
> >
> > I have to confess... I'm almost translating my application from
> > Windows to Linux just because I can't make a WDM driver for my PCI
> > card... Help me, please!
> > I have a motion control PCI card that can command 2 motors. That
> > card generate interrupts. I have an application and an old driver (VxD)
> > working very well with Windows 98 SE, but now I'm trying to make a WDM
> > driver for Windows XP Professional SP2 because Microsoft is not selling
> > Win98 anymore.
> > In my new WDM driver, the communication with the PCI card from the
> > driver and from the application (I pass an address from the driver to
> > the application, so the app can communicate directly with the card) is
> > tested and working fine. The interrupt service routine (ISR) is working
> > very weel too.
> > The only big problem is that I need to share 10 buffers between the
> > driver and the user app (velocity, aceleration, etc). Those buffers
> > can't be swaped to the disk and some of then are 1MB length, and one is
> > 9MB lentgth. They are filled with velocity, aceleration and other
> > information by the application, and the driver fill some buffers with
> > other kind of information.
> > My PCI card has no memory, so I have to make use of "user buffers"
> > (created in the app) or "system buffers" (created in the driver).
> > The most important thing is that those buffers MUST be used (read &
> > write) inside the ISR, at any moment, as weel as the buffers MUST be
> > accessed (read & write) from the user app at any time (of course, not
> > when the driver is inside the ISR). The app must be running all the time
> > because it needs to get events from the user to communicate the driver
> > to start or stop listening to interrupts, so it seems to me that I can't
> > return STATUS_PENDING with METHOD_DIRECT (can I?).
> > And the two big questions are:
> > 1. Is that realy possible? (Are you sure?)
> > 2. How?
> >
> > I've been reading all the posts about this subject from all lists
> > and years, since Jan.2004 to this day, and I couldn't find a way to get
> > that driver working ok.
> > I also have the Viscarola & Mason "Windows NT Device Driver
> > Development" book... Good help, but couldn't sove the problem.
> > Can you help me?
> > Thanks a lot.
> >
> > Paulo.
> >
> >
- Next message: Maxim S. Shatskih: "Re: Read Capacity"
- Previous message: Doron Holan [MS]: "Re: IoConnectInterrupt Continued..."
- In reply to: JimE: "RE: XP SP2 WDM driver - Sharing Memory between driver and application"
- Next in thread: Maxim S. Shatskih: "Re: XP SP2 WDM driver - Sharing Memory between driver and application"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|