delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/03/13:50:03

From: velman AT alumni DOT caltech DOT edu (John Velman)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Some things don't run under bash--(Resolution)
Date: 1 Jul 1997 20:52:20 GMT
Organization: Hughes Aircraft Company
Lines: 56
Message-ID: <5pbqm4$atc@hacgate2.hac.com>
References: <5orulb$lln AT hacgate2 DOT hac DOT com>
NNTP-Posting-Host: x-147-17-14-184.es.hac.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <5orulb$lln AT hacgate2 DOT hac DOT com>, velman AT alumni DOT caltech DOT edu says...
>
>I must be missing something.  Bash is wonderful, as is the whole djgpp suite. 
>However, some programs (or scripts) are unable to find files they are looking 
>for, even though they can find them if run in a plain dos box under windows. 

I got very helpful responses to this (from both Eli Zaretskii and 
Hans-Bernhard Broeker) that led me to the answer.  The answer is just a little 
bit subtle, so I thought I would post it.  

First, lest there be any missunderstanding, I had no intention of saying there 
was a bug in bash.  I said "I must be missing something."

The issue is the DOS environment size. I had already set my environment to 
what seemed to be a reasonable size in config.sys ( as one of the djgpp faq's 
suggests).  Specifically, my config.sys contains this line:
	
	shell=c:\dos\command.com c:\dos\ /E:2048 /p

Since everything ran ok under plain dos, I thought I had taken care of the 
environment problem.  Hans suggested guarenteeing a large enough enviroment 
for programs needing it by using an alias, like:

	'alias latex2e='command.com /e:2000 /c latex2e.bat' 

This worked, so I decided to read some of the fine print in the DOS help 
files.

Here is what I found in (/dos/help command.com, notes).

When you run a new command interpreter, the default environment size for the 
child  is the larger of 256 bytes and the actual memory **in use** by the 
parent command interpreter.  It has nothing to do with the E switch used when 
calling the parent. To override the default, you have to set an E switch on 
the call to the child.  

Interesting default.  

Thus, even if you set /E:2048 in your config.sys, and you use only - say - 256 
bytes of environment, then when you invoke a new command.com with no E switch 
it gets only 256 bytes of environment.


So, when running programs that need a lot of envirnment, use a new command.com 
with an appropriately large E:/nnnn. 


Unfortunately, I haven't figured out how to get a windows PIF  to start bash 
directly with a large environment space.

By the way, I'm running windows 3.11, dos 6.22.

-- 
   John Velman
   velman AT igate1 DOT hac DOT com

- Raw text -


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