How to create a PCI device driver?

i have some experience in creating pci device driver in windows. In windows i can use ddk to develop. How can i create driver in qnx?
Use ddk? But how?

The question would be what kind of PCI device you want to do.

There is Network DDK for PCI NIC, there is audio-pci for sound card.
However, I don’t know if these DDK come with the free download
version though.

My pci device is made by our hardware teammates. so I know
everything about this card, except how to create a device driver
for it. :frowning:

http://hichun.nease.net/qnx_prog_DAS_driver.htm

a simple example!

thank all of you, tang and power. :smiley:

Thank Power for your article. Although a little simple, it means a lot to me.
But how can i get more information about creating device driver? :wink:

On QNX, a “device driver” is usually a userland program,
sometime called “Resource Manager”. The document above shows
the detail of how to write a resource manager

Basically, it is a program that probe & initialize the hardware,
and then waiting for servicing user. User application, use
open()/read()/write()/devctl()/close() to send different request
to the program, and it response back to the user application.

Things Specific to PCI is that, there will be a “PCI Server” application
running, that application will enumerate all the PCI devices,
and all you need to call pci_*() functions (check http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/lib-p.html)
to get these informathins.

You can of cause, mmap_device_*() the specific address
area, if you have full control of your board and device.

If the PCI device you are talking about is some specific device,
then above is all you need.

If this is a common used PCI device, (a NIC, a sound card …),
to be able to let other already-exist application to use your
driver (allow tcpip use you NIC driver, allow media player use
your sound card …), your device driver also need to support
some specific interface. In this case, more likely, you will need
specific DDK.

tang, thank you very much.

Now I can not open the above webpage. Can you update it or email this simple example to me. ( email: wdxchj1981@yahoo.com.cn )
Thanks very much !