[comp.sys.ibm.pc] DOS 2.11 environment space

dd26+@andrew.cmu.edu (Douglas F. DeJulio) (02/22/89)

I need to be able to enlarge the environment space under DOS 2.11

Switches applied to COMMAND.COM don't seem to do this.
Alternativeley, if anyone has a csh-like replacement for COMMAND.COM,
that I could put as my shell in config.sys and that has a large
environment space, I'd like a pointer to it.

Please don't tell me to get a new version of DOS right now -- I can't
afford it at the moment.  Maybe in a couple of months.
--
Doug.deJ | dd26@andrew.cmu.edu 	           | Carnegie-Mellon University
******** | ...!harvard!andrew.cmu.edu!dd26 | Do not attend this college.

shurr@cbnews.ATT.COM (Larry A. Shurr) (02/24/89)

In article <0Y0dvGy00WB7M14foD@andrew.cmu.edu> dd26+@andrew.cmu.edu (Douglas F. DeJulio) writes:
>I need to be able to enlarge the environment space under DOS 2.11

O.K. here it is:

	(Enter the following:)

	A>DEBUG command.com				<- load command.com
	-r						<- show registers

	(debug replies with:)

	AX=aaaa  BX=bbbb  CX=cccc  DX=dddd  etc...	<- debug replies
	DS=dddd  ES=eeee  etc...			<- with register
	etc...						<- & next instr info

	(You are interest in cccc which is the file length.  Now enter:)

	-s100l<cccc> BB 0A 00 B4 48 CD 21		<- search for data

	(where <cccc> is the value in the CX register.  Debug replies:)

	ssss:oooo					<- segment:offset

	(this is the hex address where the specified sequence of bytes 
	was found.  Now enter:)

	-u<ssss>:<oooo>					<- unassemble

	(where <ssss> is the segment and <oooo> the offset from the above.
	You are now looking at the code which allocates the memory for
	the environment:)

	ssss:oooo BB0A00	MOV	BX,000A
	etc	  B448		MOV	AH,48
	etc	  CD21		INT	21
	etc	  etc		etc	etc
	.	  .		.	.
	.	  .		.	.
	.	  .		.	.

	(This allocates 10 paragraphs (160 bytes) for the initial
	environment.  By changing the value loaded into BX, you change
	the environment size.  For instance to change the environment
	to 256 paragraphs (hex 0100) enter:)

	e<ssss>:<oooo> BB 00 01				<- enter new data

	(where <ssss> and <oooo> are as before.  To make that permanent,
	enter:)

	-w						<- write file

	(you're finished now, so quit:)

	-q						<- quit command


Needless to say do this using a copy of COMMAND.COM.  Keep your original
safe.  Some versions of DOS apparently checksum COMMAND.COM  to verify that
it is "valid" so you may not be able to put just any old value you want.
If your DOS has this "feature" and you use a value which alters the check-
sum, you get a message complaining about COMMAND.COM being invalid during
boot.  You will have to reboot using a disk with a "good" (unmodified)
COMMAND.COM and try again.  In my case, the 0100h value worked so even
though this value may seem excessive, I was satisfied to find a usable
value.

Good luck.

regards, Larry

Disclaimer: You perform this modification at your own risk.  Be careful.

-- 
Signed: Larry A. Shurr (att!cbnews!cbema!las or osu-cis!apr!las)
Clever signature, Wonderful wit, Outdo the others, Be a big hit! - Burma Shave
(With apologies to the real thing.  The above represents my views only.)