Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is adding code to the stubs in osiUserMemory.cpp of the MH DDK all that is needed to make the DMA examples (12 & 13) work under Linux?

There are 13 examples in the MH Driver Development Kit (DDK) [ni6533.zip + nimhddk_linux.zip]. The first 11 examples (which do not use DMA) compile and link using 4 *.cpp (and their *.h) files:

dio_ex#.cpp
osiBus.cpp
osiUserCode.cpp
tDIO.cpp

Examples 12 and 13 use DMA. These 2 examples require 3 additional C++ files (and their *.h files) to compile and link:

tMITE.cpp
osiUserMemory.cpp
dma.h

There are 2 function stubs (i.e., bufAlloc and bufFree) defined in the Linux version of osiUserMemory.cpp. There is an #error preprocessor statement in the file to flag (I guess) to a user that he can't compile, link, and run the
se 2 examples until the functions are completed and the #error statement removed.

Is adding code to the stubs in osiUserMemory.cpp of the MH DDK all that is needed to make the DMA examples (12 & 13) work under Linux? Has anyone added code to this file and successfully executed it? With a PCI-DIO-32HS?
0 Kudos
Message 1 of 4
(8,505 Views)
SLC,

You are correct. All you should need to do is to fill out those two functions for Linux and then the example code should work. I have not run them in Linux myself though.

Christian L
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
Message 2 of 4
(8,503 Views)
I've just starting tackling this problem, but I noticed this post is over a year old, and was wondering if you've had any success.
 
Any advice would be much appreciated. Also, I'll post any useful information I find as I find it. I realize it may be a bit late to help you, but hopefully it proves useful to others in the future.
 
Thanks in advance for your help!
0 Kudos
Message 3 of 4
(8,101 Views)
I have been messing around with the PCI 6533 card for a while tryign to get DMA working.  I have it working pretty well with a minor bug somewhere.  Anyway, I wrote a kernel module/ device driver using pci_alloc_consistent to allocate a DMA buffer.  This returns a handle you can map to user space through a device file.  Then you can edit the file osiUserMemory.cpp.  Hope that helps.
0 Kudos
Message 4 of 4
(7,860 Views)