Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DOS memory location BAR0 BAR1

How does one obtain the DOS memory locations for BAR0 and BAR1 for a NI-DAQ MIO PCI card? I have the two BAR addresses on the card.
A sample of NI's Linux code for iBus generation appears below. I would like to find out how to get &mem0, &mem1, &fd for DOS. If I have those numbers I might be able to generate an iBus and a chip object to develop a driver for the DAQ card. I would appreciate any brief explanations as to how to access DOS memory allocation information.

Wes


struct LinuxSpecific{
u32 _fileDescriptor;
};

i32 FindPCICard(u32,u32*,u32*,u32*,u32*);
i32 MapPCIMemory(u32,u32,u32,u32,void**,void**,i32*);


/* Return iBus of first matching PCI/PXI card.
*/
iBus* acquireBoard(const u32 devicePCI_ID)
{
u32 temp_PCIID,devBAR0,devBAR0Len,devBAR1,devBAR1Len;
i32 retval,fd;
void *mem0,*mem1;
iBus *bus;
LinuxSpecific *privateIBus;
//Find the PCI memory ranges from /proc/bus/pci/devices
retval=FindPCICard(devicePCI_ID,&devBAR0,&devBAR1,&devBAR0Len,&devBAR1Len);
if(retval<0) return NULL;
printf("PCI Device ID 0x%lx, BAR0 %lx-%lx, BAR1 %lx-%lx \n",devicePCI_ID,devBAR0,devBAR0Len,devBAR1,devBAR1Len);
//Memory map /dev/mem to get access to the PCI Card's memory
retval=MapPCIMemory(devBAR0,devBAR1,devBAR0Len,devBAR1Len,&mem0,&mem1, &fd);
if(retval<0) return NULL;
printf("PCI Device ID 0x%lx, mem0 0x%lx, mem1 0x%lx\n",devicePCI_ID,mem0,mem1);
//create a new iBus which uses the mmaped addresses of /dev/mem
bus = new iBus(0, 0, mem0, mem1);
bus->_physBar[0] = (u32)devBAR0;
bus->_physBar[1] = (u32)devBAR1;
bus->_physBar[2] = (u32)NULL;
bus->_physBar[3] = (u32)NULL;
bus->_physBar[4] = (u32)NULL;
bus->_physBar[5] = (u32)NULL;
privateIBus = new LinuxSpecific;
privateIBus->_fileDescriptor = fd;
bus->osSpecific = (void*)privateIBus;
return bus;
}
0 Kudos
Message 1 of 3
(3,158 Views)
Hello Wes,

go to www.ni.com/support and request support either by phone or email. In the meantime, you can check the following document: http://digital.ni.com/public.nsf/websearch/DF1B9F3FF562E71F86256C72007FA953?OpenDocument
0 Kudos
Message 2 of 3
(3,149 Views)
There are some old DOS register-level programming examples on the ftp site. They are referenced in the E Series register level programming manual. The example code is no longer supported, but it should help you.

ftp.ni.com/support/daq/pc/reg-level/dos/pci-eser.zip
0 Kudos
Message 3 of 3
(3,130 Views)