First post, by clb
Hey all knowledged vogons veterans,
I am trying to read and write into a MMIO space of a PCI device from DOS.
Searching the web, I do find sources of how to read and write the PCI configuration space registers, e.g. https://github.com/TimmermanV/TweakPCI , but that is not what I'm looking to do.
Instead, what I would like to achieve is to write into a PCI device's memory mapped I/O space.
To my understanding, this I/O space is advertised by the PCI device's configuration space registers to have a physical starting address, defined by one or more of Base Address Registers:
I am already able to examine this configuration space to read the Base Address Register that I am interested in. In this case, it is physical address "0x6001". And I would like to access a byte in offset + 0xC0 to this base address, i.e. the physical address 0x60C1, to read and write the byte value located there.
My understanding is that this is something that would be easiest done via DJGPP in Protected Mode, it would somehow consist of mmap()ing this physical address into the virtual address space of the calling process, and then I would have a base pointer to that address 0x6001 and could do the interesting byte reads and writes. I tried to search for examples of this, but haven't found one so far.
Does anyone know if there might exist code examples of how to achieve this? Or possibly even ready-made programs/utilities? I could either write my own DJGPP program, or use an existing utility, doesn't matter in this case.
Also, if there was a way to shoehorn this kind of task into a real-mode program, that would simplify some things in my setup, since the rest of my utility is currently written in Borland Turbo C++ 3 real-mode (although I can imagine that could be tough, so not holding too much on this).
Thanks for any help!