[comp.sys.dec.micro] Environment size

hart@TAURUS.BITNET (09/09/88)

[]

In reply to my query about increasing the environment space, I received
the following message, which I think others may find interesting.  I
have used it successfully for about a week now, without any ill
effects!

Many thanks to Claude for making this available.

           Sergiu Hart
---------------------------------------------------------------------
     MAIL:      School of Mathematical Sciences
                Tel-Aviv University
                69978  Tel-Aviv,  Israel
     E-MAIL:    hart@taurus.bitnet,    hart@math.tau.ac.il,
                hart%math.tau.ac.il@cunyvm.cuny.edu,
                hart%taurus.bitnet@cunyvm.cuny.edu,
                hart%taurus.bitnet@cornellc.ccs.cornell.edu,
                hart%taurus.bitnet@cnuce-vm.arpa
---------------------------------------------------------------------

=======================================================================
>From hayes@urvax.bitnet Sat Sep  3 01:08:37 1988

Sergiu:
After reading your message:
>>>
I need something called ENVSIZE, which is supposed to increase the size
of the environment.  Can someone e-mail it to me please ? (arc'ed,
uuencoded, anything ...).
>>>
and assuming you use a DEC-100 Rainbow, the file which follows my signature
may help you.  I say *may* only because I do not know if it works.

Please let me know if it was of some help.  Regards,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Claude Bersano-Hayes       VAX785::HAYES                  (UR/MCV Decnet)
                           HAYES @ URVAX                         (Bitnet)
University of Richmond     hayes%urvax.bitnet@cunyvm.cuny.edu  (Internet)
Richmond, VA  23173        ...!psuvax1!urvax.bitnet!hayes          (UUCP)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

>From the Univesity of Richmomd Public Domain library:

         M S - D O S   E n v i r o n m e n t   S p a c e
                    How I Increased Its Size

The environment space in MS-DOS is a portion of memory that is
allocated upon booting for storing system logicals, default path,
and, optionally, a custom prompt.  As my MS-DOS V2.11 system was
supplied, it was allocated approximately 160 bytes which is not
very much, as I soon found out.  If you are at all like me, then
you like to take advantage of all the neat features that
Microsoft has given us, you've found you absolutely NEED to
increase that number.  And, if you are like me and you've tried
the BOOT program that's available on the Public Domain to fool
the system into thinking it's got more room, you've found out
that that is almost more  trouble than it's worth (especially if
you ever have to re-install it w/o the documentation)!  If you're
like me, then you've said to yourself, "There MUST be _some_ way
of telling MS-DOS to increase that silly limitation!" If you're
like me then you are going to be very happy when you learn about
this little patch that I found!

First, make a backup copy of COMMAND.COM (just in case).

Next, from the MS-DOS prompt (which is probably not "E>",
if you're like me!) type DEBUG COMMAND.COM

When you get the DEBUG prompt (-), check to see what value your
system has now.   The number, in hexadecimal, can be found at
offset location 0DF3.  (My system said 000A when I started.)  You
can either say:   U 0DF2, or:  D 0DF2 to display this number
which stands for the number of 16-byte paragraphs of memory to
allocate for the environment.

Now, from the DEBUG prompt, say:  A 0DF2 to put you into Assemble
mode.  You are going to insert the assembly code for that line
with the changed number.  The line reads as follows:
     MOV BX, nnn    where nnn  stands for the new number you're
                    going to insert.  For example, I typed:  MOV
                    BX,39 because I want to have all the
                    environment space that I can have.

Once you've made the change, you need to type:
<Ctrl/C> to exit Assemble mode.
This should bring you back to the DEBUG prompt.

>From here, you need to type W to  Write the changed COMMAND.COM
back to the disk.

When you get the prompt again, you may type Q to Quit and return
to MS-DOS.

NOTE:     I have found from trial and error that the MAXIMUM is
          39(hex).  I don't know why, but if you say 40 or more,
          MS-DOS will not execute your AUTOEXEC.BAT file
          (perhaps, MS-DOS only has a 1k window into  memory with
          which to play?  I don't know -- I'm not a systems
          programmer).

            Q u i c k   R e f e r e n c e   G u i d e
              For Changing MS-DOS Environment Size

MS-DOS Prompt> DEBUG COMMAND.COM
- U 0DF2
1302:0DF2 BB0A00    MOV  BX,000A
1302:0DF5 B448      MOV  AH,48
1302:0DF7 CD21      INT  21
1302:0DF9 8E1E250A  MOV  DS,[0A25]
1302:0DFD A3250A    MOV  [0A25],AX
                 etc.
                  .
                  .
                  .

A 0DF2
1302:0DF2 mov bx,39      ;Replace 39 with number of
1302:0DF5 C              ; 16-byte paragraphs to
                         ; allocate for environment.
- w
Writing 3E65 bytes
- q
MS-DOS Prompt> <Set-Up> <Ctrl/Set-Up>

NOTE:     Maximum number of paragraphs is 39(hex).  That  equals
          912 bytes of environment space.

ACKNOWLEDGEMENT:
I must give credit to Lynn Jarrett of the DECUS PC Sig, who
searched around to find this patch for me.  Thank you Lynn.

=======================================================================