Tuning DOS inside of Virtual PC

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:DOSHIMEM.SYS                                                      
DEVICE=C:DOSEMM386.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:DOSEMM386.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’