Page 1 of 1

Writing to PCIe Device.

Posted: Thu Jul 23, 2020 8:26 am
by I3ooI3oo
I am trying to write a interface to a PCIe device in FreeDos. I had a FPGA PCIe designed and produced. I have read everything I can find on the subject however I still can't write any code that actually does what I am expecting. The company that produced the card has provided me with a Linux test program. Using the linux program I can turn on an Isolated digital output and turn on a LED, so I know my card is wired and functioning.
My device is currently installed Bus = 2 device = 0 function =0 Bar0 = 0xF7c40000 and Bar1 = 0xf7c00000
If I could write 0x01 to offset 0x0202 the LED I have wired up should turn on.
While I know that dos is a 16bit OS I thought I could write 386 instructions in assembly to get this device functioning.

If anyone can point me in the write direction I would really appreciate it.

Re: Writing to PCIe Device.

Posted: Wed Jul 29, 2020 8:54 pm
by Octocontrabass
If you want your program to run on a variety of DOS configurations, you must use DPMI. I'm not familiar with the details, since DOS has been obsolete for more than 20 years.

If you're not worried about compatibility and just want something that will run in your installation of FreeDOS, I suggest using the XMS driver to enable A20 and then switching to either protected mode or unreal mode. From either of those modes, you can directly address your device's MMIO.