From: jcmorris@mwunix.mitre.org (Joe Morris)
Subject: Re: Environment size hack in DOS 5?
Organization: The MITRE Corporation
Date: Fri, 13 Nov 1992 15:05:30 GMT

pynq@quads.uchicago.edu (George Jetson) writes:

>In versions of DOS prior to 4.0, there was a well known patch location
>in COMMAND.COM that allowed you to change the default environment size.
>The default was usually something like 160 bytes (0A paragraphs), which
>is ridculously low.  However, it was a simple matter to use DEBUG to
>patch it to something reasonable (e.g., setting the byte to 30 would get
>you a 768 char [minimum] environment, in all your subshells.)

>I have spent fruitless hours perusing the DOS 5 COMMAND.COM, and have
>not been able to solve this problem.  (I did it originally on a version
>of DOS 3.3, long ago, in a couple of hours, so I know it should not be
>that hard).  I have also spent time on DR DOS 6.0, with the same dismal
>results.  I have also perused the usual gang of archive sites, and have
>not found anything.  So, my question to the net is, "Does anyone know
>the magic patch locations for DOS 5.0?"

>Anyone know the magic formula?

<<<< CCC RRR EEE AAA KKK >>>>   <--- sound of archive doors opening

The following is an extract from a posting last year.  I don't know
if it ever made it to someone's FAQ list.

I've edited the text to remove patches which make ECHO OFF the default
for batch files since you get the same result be starting a .BAT file
with the line '@echo off'.  Also deleted were some general comments
about finding the patch points.

I've left the headers in place but edited them so that digest programs
won't mistake them for a new article.


=-=-=-=-=-=-=-=-=-=  begin included text  =-=-=-=-=-=-=-=-=-=


**From: NETOPRWA@ncsuvm.ncsu.edu (Wayne Aiken)
**Newsgroups: comp.sys.ibm.pc.misc
**Subject: Larry Rainey's DOS 5.0 patches
**Date: 1 Jul 91 04:17:44 GMT
**Organization: North Carolina State University Computing Center
**Lines: 108

Below, I present sections of code from MicroSoft MSDOS 5.00, dis-assembled with
DEBUG so that those with versions of DOS other than the ones listed above
can find the offsets for their COMMAND.COM.

Here are the sections of code from MicroSoft MSDOS 5.00:

The environment size

-u 165b

1111:165B 58            POP   AX
1111:165C C706C01E5100  MOV   WORD PTR [1EC0],0051
1111:1662 C706BE1E1000  MOV   WORD PTR [1EBE],0010  <<default envir. size>>
1111:1668 BAD498        MOV   DX,98D4
1111:166B B104          MOV   CL,04
1111:166D D3EA          SHR   DX,CL
1111:166F 8916CE1E      MOV   [1ECE],DX
1111:1673 2BC2          SUB   AX,DX
1111:1675 A39802        MOV   [0298],AX
1111:1678 A12C00        MOV   AX,[002C]

Just searching for '10 00' should find this one.


Larry Rainey  6/11/91

Recapped in easy keyin format:

DEBUG COMMAND.COM 
E 1666 20
W
Q

will set you environment to 512 (x'20')

Wayne Aiken             netoprwa@ncsuvm.bitnet         "You can BE what
PO Box 30904            netoprwa@ncsuvm.cc.ncsu.edu     you WON'T!!"
Raleigh, NC  27622      slack@ncsu.edu                   --"Bob"
(919) 782-8171          StarFleet BBS: (919) 782-3095

=-=-=-=-=-=-=-=-=-=  end included text  =-=-=-=-=-=-=-=-=-=

Joe Morris / MITRE
Newsgroups: comp.os.msdos.programmer,comp.msdos.programmer,comp.os.ms-windows.programmer.tools