Context
Hi, I'm porting an ancient 1977 flight simulator program from a SEL computer to a Windows 7 x64 PC system. The program is 500.000 lines written in Fortran, with a large /common/ memory block that is accessed across all modules. This memory is allocated statically.
Additionally, and there my problems begin, there is also a hardware device, that used to access the /common/ block using DMA. We've successfully ported the hardware device to a FPGA PCI device, written a device driver for it and DMA works well.
The problem:
I want to share the static memory of the Fortran application with the PCI device.
Possible solutions
Things I have considered:
Allocate memory in the driver and re-map the user space Fortran common block to that area.
Lock the user space common block in physical memory and tell the PCI device where to read/write.
My preference would be the fist option, because that will avoid lifetime issues. So far I haven't found an acceptable solution. Any tips you could share with me?
Henk.
Note: we have full control over hardware and driver, since we built it ourselves, so exotic ideas might help too...