From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: djgpp DLL's?; The generation gap Date: Mon, 14 Apr 1997 09:07:03 -0700 Organization: Two pounds of chaos and a pinch of salt Lines: 43 Message-ID: <33525627.2B83@NO.SPAM.cs.com> References: NNTP-Posting-Host: ppp108.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Anthony.Appleyard wrote: > > When will djgpp C+ and also C++ have some sort of overlay program system!?, > so that (code which not obeyed much) needn't stay in RAM all the time. As someone posted, check out DLM's, which are currently in development. But that's not why I posted... > The nearest to this that I can use now seems to be calling a child process > by one of the spawn() functions. But the only way that the parent can talk to > the child is via call parameters, which must be ascii and are limited in > length. If I write two programs, A.EXE and B.EXE, can I do this?:- > A reserves some conventional memory and keeps its address in a variable x. > A writes varions matter to that conventional memory. > A calls B as a child process, and in a call parameter tells B the value of > x. > B reads x from that parameter. > B looks for its data at conventional memory address x etseq. > B writes matter into conventional memory address x etseq. > B exits and returns to A. > A expects B's results to be at conventional memory address x etseq. > > Would that work? Or is A's conventional memory allocation swopped out to > disk while B is running? This is easy. You can allocate a buffer in conventional memory with standard dpmi calls, and pass the address of the buffer to your child process on the command line. DJGPP programs do NOT access conventional memory unless you specifically instruct them otherwise, nor is it possible (or even desirable) to swap out any part of conventional memory. The DPMI host does maintain its internal structures (heap, transfer buffer, etc.) in conventional memory, but these are technically part of the host, not part of the program. In short, buffers in conventional memory are a standard way of passing data between protected mode programs. -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | Proud owner of what might one | http://www.cs.com/fighteer | | day be a spectacular MUD... | Plan: To make Bill Gates suffer | ---------------------------------------------------------------------