Question

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...

Was it helpful?

Solution

For those who wish to know: eventually I found no good solution for this and worked around it with read-copy-modify-write operations. Quite expensive, but since the original program is 45 years old, we had some cpu power to spare :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top