Tuning DOS inside of Virtual PC

Tuning DOS inside of Virtual PC

Rate This
  • Comments 5

Well - I think it's time to go over how to tune DOS for running inside of Virtual PC.  When it comes to DOS applications there is only one thing that counts - base memory.  DOS starts with 640k of base memory - and every TSR* / Driver that you load uses up part of this memory.  The problem starts when you end up with less base memory than you need to run your programs.  As a general rule of thumb - 580k is enough for most programs you will need - though occasionally you will come across a program that needs up to 610k.  So how do you keep this amount of memory available?  Well there are three options:

1) Don't load as many drivers and TSRs

This isn't very fun - as generally speaking these things provide you with needed functionality (like CDROM access, networking, etc)

2) Find substitute TSRs that use less memory

A good substitute mouse TSR is cute mouse - http://cutemouse.sourceforge.net/ - and it only uses 3k

A good substitute CD-ROM TSR is SHSUCDX from the FreeDOS project -
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/shsucdx/ - and it only uses 6k

3) Load high!

By loading both HIMEM.SYS and EMM386.EXE in you config.sys file - you can enable the ability to load drivers and TSRs into upper memory instead of base memory.  First add the following lines to your config.sys file:

DEVICE=C:\DOS\HIMEM.SYS                                                      
DEVICE=C:\DOS\EMM386.EXE RAM
DOS=HIGH,UMB                                                                 

And then change the rest of the 'DEVICE=' lines in your config.sys file to 'DEVICEHIGH=', and add 'LH' to the beginning of any lines in your autoexec.bat file that load TSRs.

4) Get serious about tweaking memory when loading high

Step three will get you some base memory back - but to get the most out of the system you should do the following:

Use this EMM386 line in your config.sys file:

DEVICE=C:\DOS\EMM386.EXE RAM I=B100-B7FF I=C600-C7FF I=CC00-CFFF I=E600-EFFF FRAME=D000

This will get you the most efficient mapping of memory inside of Virtual PC.  Then you should start manually allocating drivers and TSRs to memory blocks.  The above EMM386 line will give you 4 blocks of upper memory - you can check the size of these blocks by running 'mem /f' - they should be 23k, 8k, 16k and 40k in size.  The problem here is that drivers and TSRs can only load into a single contiguous block of memory - and by default LH just places these guys in the first block that it finds - which means that large blocks can be misused by smaller TSRs and cause larger TSRs to fail to load high.  You can hand tune this by changing the 'LH' to 'LH /L:x' and the 'DEVICEHIGH=' to 'DEVICEHIGH=/L:x' - where x is the block of memory to use TSRs(1 through 4).

Using these techniques - I have a DOS setup with Mouse, CDROM, SetVer, Folder Sharing, Idle and DOSKey loaded - but it still has 617k of base memory available.

Cheers,
Ben

*TSR stands for 'Terminate and Stay Resident'

Leave a Comment
  • Please add 8 and 6 and type the answer here:
  • Post
  • I've almost forgotten about the DEVICEHIGH stuff, until your post!

    Oh boy, config.sys!

    And it only seemed like yesterday we were all just fiddling around with MS DOS 6.22 trying to get various games working... (Commander Keen! Lemmings, and a few others... Oh, Wolf3D!)

    Ah, memories ;)
  • Ah the memories are flooding back :)

    Great blog BTW!
  • If only I had known all the nitty-gritty tweaks when I was actually running DOS!
  • The beauty of custom configuring UMA (Upper Memory Area or "high memory") in a VM is the emulated hardware always has the same UMA regions free. With real hardware your free UMA regions would depend on your video card and other factors. That's why Ben can include some very specific UMA regions.

    Noting smaller replacement TSRs is a stroke of genius I had not considered. Excellent information. With this info someone can create an optimized config.sys with specific memory placements for each driver. Thanks!

    FYI: For a full length lucid description of MS-DOS memory regions try to find an old copy of "Managing Memory with MS-DOS 6" by Dan Gookin (Microsoft Press).
  • who still uses dos?

    I still do :)

Page 1 of 1 (5 items)