How to access a custom PCI device from a user app

  • Thread starter Thread starter Wai Chan
  • Start date Start date
W

Wai Chan

The product we are developing needs a custom PCI NVRAM
device to be plugged into one of the open PCI slots. I
am looking for a way in which I can access the memeory on
that device directly from a Win32 app. Are there any
good API's available for this (Setup API's)? All I need
is to find out where the memory region starts and ends
after the bus-enumeration by pci.sys, and be able to read
from and write to that region. I am trying to avoid
writing a driver just for this simple task. Any help
will be greatly appreciated.

Thanks!

Wai Chan
 
Read more about functions like:
CM_Get_Next_Res_Des_Ex

Also find devcon source in DDK.
devcon resources * will list all hardware and resources allocated to them.

But eventually you will need to use some third party driver that will allow
you to map physical addresses to virtual address space of your process.

You already have, but just in case you did not: Create dummy inf file that
will expose resources.

Regards,
Slobodan
 
Native API is solution that you seek. It's been a while since last time I
have used it, so I forgot its power ;)
http://www.sysinternals.com/files/physmem.zip
I have completely forgot about this sample since I'm creating drivers for
handling all our devices, but I have stumbled on it while I was reorganizing
files on my disk. This should allow you to map physical memory to your
process without using any extra drivers.

Regards,
Slobodan
 
Back
Top