www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/02/24/09:30:05

Date: Wed, 24 Feb 93 09:07:05 EST
From: DJ Delorie <dj AT ctron DOT ctron DOT com>
To: bergman AT panix DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: long args, go32, and DOS.

>Th 128 character limitation is in command.com, correct? I'm using the
>MKS Toolkit supplied Kornshell in place of command.com. I can pass
>arguments up to 8K bytes between any programs that will accept them. Do
>the DJGPP executables read only the first 128 characters on the command
>line?  Couldn't that limit be changed to, say, 8K? In this case, there
>would be no apparent change under command.com, because it is truncating
>long arguments. Other shells, MKS, 4DOS, the public domain csh and ksh
>available for PCs, DOS 6 if it is sane, etc., would each impose their
>limits, hopefully greater than 128 bytes.

The limit is imposed by the DOS exec interrupt.  go32 understands three
methods of passing longer command lines:

1. `proxy' - stub uses this to talk to go32.  An encoded far pointer
to argc/argv is passed on the command line instead of the actual
arguments.

2. response files - pass "@filename" where the filename refers to a
file containing the actual command line.

3. environment variables - set __argc and __argv0 ... __argvN and go32
will use them for the command line.

If you can document the method that these other shells use, then that
method can be integrated into go32 as well, and then all djgpp
programs will accept the longer command lines.

>I'm sorry if this is sounds redundant, but I don't see where the
>problem lies. Unfortunatly, I also don't feel capable of hacking the
>DJGPP utilities, unless the change is simply redefining a buffer like
>	char *argument_length[128]
>to
>	char *argument_length[8096]

MS-DOS starts each program with a PSP (program segment prefix).  This
buffer is 256 bytes long, and the last 128 bytes are used for the
command line.  You would have to rewrite DOS to change it.

>I'm really pleased [amazed] that I can port so many Unix programs
>simply by typing "make". The most dificult problem I usually run into
>is one of filenames, so you can see why this is frustrating.

It frustrates me also.

DJ

- Raw text -


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