Mail Archives: djgpp/1998/02/01/08:47:03
Thomas Demmer writes:
>Thinking about this, wouldn't it be possible for CWSDPMI not to page
>out code? This could be overwritten and read back on demand from the
>.exe-file.
CWSDPMI doesn't have nearly enough information to do something like
that. The program code is loaded by the startup stub, and the DPMI
server has no idea where the data came from, what the executable format
is, or even which bytes are code at all! The only way to do something
like this would be to add some nonstandard extensions into CWSDPMI and
fill the stub with special checks to use different code when it is
running under CWSDPMI, which would essentially be going back to a sort
of DOS extender setup like the original djgpp 1.x. This would be
painfully inelegant, and wouldn't work with any other DPMI servers, so I
don't think it is a good idea.
Demand-loading code directly from the executable is widely used by other
systems, and can significantly improve the swapping performance because
code can just be discarded from physical memory and then reloaded from
the original location, rather than needing to be written out into a
swapfile. Most unix systems do this, and I think win32 as well, and
Linux can even share a single copy of the code between multiple
instances of a program! But I think you need to be a proper operating
system in order to have enough control over exactly how programs are
run: it isn't something that can be tacked onto a DPMI system.
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa
- Raw text -