Mail Archives: djgpp-workers/1997/09/09/09:59:35
On Tue, 9 Sep 1997, Diego Zuccato wrote:
> Well, couldn't we have a 'locked' memory out the first MB and use it for
> all DJGPP programs that need a lot of arguments ?
AFAIK, no, you can't, because this will break with DPMI 1.0 servers
(currently, there is only 386Max that supports 1.0). In DPMI 1.0, the
descriptors aren't global, they are local to the process. So you have no
means of passing the address of the block where long command line is
stored to the child program. Conventional memory addresses are always
global, so passing the seg:off address of a conventional memory block
works in both DPMI 0.9 and 1.0.
> In DOS memory there should be at most a single pointer
> (descriptor:offset) to the memory that programs have to use.
> So the tb remains only a bucket where we pass stuff that MUST be in the
> first MB and where we get the results. So a single tb (or at least one
> for each process running, if/when mtasking implemented) should be
> enough.
A single tb is not good enough, even if there's no multitasking, because
the child program would overwrite the contents of the buffer, and when
controls gets back to the parent, it will see in the tb something
different from what it put there before spawning the child. This might
lead to very subtle bugs.
> Well, I'm really non a so low-level programmer, but I can't see why
> shouldn't it work. If I remember well it's nearly what Win31 does...
You can do anything in a software that is many megabytes large and takes
up about 10MB of memory when it runs. In particular, Windows catches all
the software interrupts and serves as a DOS extender, in addition to
being a DPMI server. You can do a lot if you have such a complete
control of the machine. Simple DOS DPMI servers cannot do all that.
- Raw text -