[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Software Help
> From: "Bearzi, Anthony" <abearzi@harris.com>
>
> Hello,
>
> I am trying to develop a small console application to test out an adapter
> board and some of its onboard firmware routines. My platform is Windows NT
> and here is where I run into a snag. I would like to have my console
> application pass a local memory (CPU local) address to the PCI adapter card.
> This will assert an interrupt within the adapter and an ISR (within the
> adapter) will write a chunk of data from the adapter's memory to the address
> that was provided. Passing the address is a simple write to the adapter's
> inbound queue port. My problem is determining what is a valid address that I
> can use that will not make NT unhappy. I also do not understand how I
> translate this local memory address into a PCI address that makes sense to
> the adapter.
>
> I am guessing that first my application has to somehow lock or reserve a
> chunk of local memory. Then I have to somehow determine the address of the
> CPU's PCI bridge so that the adapter can write to BARx + some offset that
> corresponds to the reserved target memory block.
>
> Any and all help is greatly appreciated.
You need to write a kernel-mode device driver to do the necessary
address translations and memory locking. Your application will
talk through your device driver to your adapter. This is not a
trivial task if you have no experience of NT device drivers. All
the information you need, along with the driver development
environment, can be found in the appropriate Driver Development
Kit. Versions of this kit for all recent versions of Windows can
be downloaded free of charge from http://www.microsoft.com/ddk/ .
If you end up learning device driver writing for this project,
you might be better upgrading your platform to Windows 2000 - the
structure of device drivers changed considerably between NT 4 and
Windows 2000, so learning NT 4 drivers now will not be all that
useful for the future.