kolderman wrote:I thought DPMI simply standardized the interface used by DOS extenders, i.e. basically how they make system calls back to DOS. Win95s VDMs provided a DPMI compatible interface so programs requiring extenders could run, although it did not simply pass the calls back to DOS, but Win95 itself could handle them.
There's two sides to DPMI.
One side is the DPMI provider/host (which in this case is Windows), the other side is the DPMI client (which would be your DOS program).
The problem with DPMI is that it got conflated when DOS Extenders started supporting DPMI so they could co-exist with Windows.
Windows itself is a 'DOS Extender' basically, because it takes over from DOS and switches the CPU in 32-bit mode. If you then start a DOS session from Windows, it will not run in true realmode, but in v86 mode.
In fact, you don't even need full Windows for that. Just loading EMM386 will already switch your DOS to a v86-session, because EMM386 will virtualize some of your system to perform its memory management tasks (so technically EMM386 is a DOS Extender as well).
A 'pure' DOS extender simply switches the CPU to 32-bit mode and takes over the system. That works fine in pure DOS, but not from a v86 environment.
So, DPMI was invented as an interface for programs in a v86 environment to let the host (the one that put you in the v86 environment) manage the CPU and memory for you in a way that your application can run in 32-bit mode anyway.
Many DOS extenders are 'dual mode': if you have not loaded EMM386, Windows or anything else that creates a v86 session, it will create its own environment and will manage CPU state and memory itself. I don't think DOS Extenders would actually use DPMI in this case.
If you are already in some kind of virtual environment, it will try to use DPMI services to run. So it is the DPMI client (so technically it is not the DOS Extender, it is just using the API of the DOS Extender, it's a facade pattern). EMM386, Windows or whatever will be the DPMI provider.
Not all DOS extender environments support DPMI, so they won't work from a v86 session.
So yes, it sorta standardized the interface used by DOS extenders, but it is only required when your DOS extender needs to talk to another environment.
It's not something the developer of a 32-bit application normally has to bother with. They just link the DOS extender to their program, and the compiler will just generate the correct calls, regardless of what interface is used.