From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Physical memory, virtual memory. DJGPP+CWSDPMI, how they work? Date: Sun, 1 Feb 1998 12:55:22 +0000 Organization: None Distribution: world Message-ID: References: <3 DOT 0 DOT 1 DOT 32 DOT 19980130203727 DOT 006c24f8 AT adinet DOT com DOT uy> <34D34E7B DOT 945CA9A7 AT LSTM DOT Ruhr-UNI-Bochum DOT De> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 30 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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