delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/09/09:59:35

Date: Tue, 9 Sep 1997 16:58:07 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Diego Zuccato <dz AT bo DOT dada DOT it>
cc: djgpp-workers AT delorie DOT com
Subject: Re: fread slowstart
In-Reply-To: <341541B4.2462@bo.dada.it>
Message-ID: <Pine.SUN.3.91.970909164758.7594C-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019