home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / maxupper.zip / MAXUPPER.ART < prev   
Text File  |  1994-01-02  |  14KB  |  236 lines

  1.         How to Get Maximum Upper Memory with MS-DOS Memory Management
  2.         -------------------------------------------------------------
  3.                               by Lou A. Moccia
  4.                 (PCA Lou of the DOS Forum on America Online)
  5.                                   12/10/93
  6.  
  7.  The MS-DOS memory management system is good, but sometimes just not good 
  8.  enough.  Before running out to get a better memory management package like 
  9.  Quarterdeck QEMM, Qualitas 386Max, or Helix NetRoom -- which can cost more 
  10.  than a DOS upgrade itself -- this article will present ways to configure 
  11.  the MS-DOS 5.0, 6.x, and Windows 3.1 EMM386.EXE memory manager to help you 
  12.  get the most Upper memory possible.  In most cases, those who are currently 
  13.  unable to load everything they need into Upper memory on 386 or better 
  14.  computers will benefit greatly from this information.
  15.  
  16.  Unfortunately, MS-DOS doesn't provide memory management for 286 or lower 
  17.  computers, other than Extended (XMS) memory services via the HIMEM.SYS 
  18.  driver (and in most cases, it only works for a system with more than 1 meg 
  19.  of memory installed).  There's not much you can do on a 286 without the use 
  20.  of Upper memory, which is where you could load device drivers and TSRs 
  21.  high, out of conventional memory.  There is hope, though!  A few good 
  22.  shareware Upper memory managers that support a lot of 286 systems do exist, 
  23.  the best being LastByte, MemKit, UMB_DRVR, and UMM (all of which are 
  24.  available online).  Popular commercial offerings that support some 286 
  25.  systems include Quarterdeck QRAM, Qualitas MOVE'EM, and Helix NetRoom.
  26.  
  27.  If the following information doesn't help you load everything you need into 
  28.  Upper memory, or one of the EMM386 configuration settings does not work on 
  29.  your computer, then your only options are the following:  Invest in another 
  30.  memory management package (mentioned above); load only the device drivers 
  31.  and TSRs that you absolutely need; or live with the reduced conventional 
  32.  memory, but use a multi-config setup for running those huge applications or 
  33.  games.
  34.  
  35.  Now on with the show... The MS-DOS memory management system consists of 
  36.  three parts:
  37.  
  38.  First is the HIMEM.SYS device driver.  HIMEM.SYS provides access to the 
  39.  computer's Extended memory, which is that above 1 meg.  HIMEM.SYS makes the 
  40.  physical Extended memory accessible as XMS memory to programs that are 
  41.  designed to take advantage of it.  (XMS is short for "eXtended Memory 
  42.  Specification"; XMS memory and Extended memory generally refer to the same 
  43.  thing these days, but they are technically different.)  HIMEM.SYS also 
  44.  creates the High Memory Area (HMA) from the first 64K of Extended memory, 
  45.  which DOS can use for loading its own kernel into and free up close to 50K 
  46.  of conventional memory (which is that below 640K and being the most 
  47.  important to programs).  For the HMA to be available on most systems, there 
  48.  must be at least 64K of Extended memory above 1 meg in the computer; 
  49.  computers with only 1 meg of total system memory usually will not be able 
  50.  to take advantage of loading DOS into the HMA.
  51.  
  52.  Second is the EMM386.EXE device driver, which provides access to Upper 
  53.  memory and/or Expanded (EMS) memory.  Upper memory is what EMM386.EXE 
  54.  creates from the areas of Reserved memory between 640K and 1 meg that are 
  55.  not occupied by any ROM BIOS.  Expanded (or EMS, short for "Expanded Memory 
  56.  Specification") memory is a special type of memory in a computer, a 
  57.  standard for extra memory that came long before XMS.  On 386 or better 
  58.  systems, EMM386.EXE simulates EMS memory from the XMS memory provided by 
  59.  HIMEM.SYS.  That's one reason why EMM386.EXE requires that HIMEM.SYS be 
  60.  loaded first in CONFIG.SYS to work.
  61.  
  62.  Third is the line DOS=HIGH,UMB in CONFIG.SYS.  The UMB part is necessary 
  63.  for DOS to be able to access the Upper memory provided by EMM386.EXE.  The 
  64.  HIGH part isn't really required, but it does perform a very important 
  65.  function in that it frees up close to 50K of conventional memory by moving 
  66.  the DOS kernel into the HMA created by HIMEM.SYS -- Its use is highly 
  67.  recommended!  Note that you can have separate DOS=HIGH and DOS=UMB lines if 
  68.  you want (something MS-DOS 6 MemMaker likes to do), but combining them as 
  69.  DOS=HIGH,UMB is a bit more tidy and it is one less line for DOS to process 
  70.  at bootup.
  71.  
  72.  So, lines similar to the following must exist in CONFIG.SYS for DOS to 
  73.  manage the memory in the computer:
  74.  
  75.  DOS=HIGH,UMB
  76.  DEVICE=HIMEM.SYS
  77.  DEVICE=EMM386.EXE
  78.  
  79.  HIMEM.SYS must be the first of any DEVICE lines to load in CONFIG.SYS, and 
  80.  EMM386.EXE must always load directly after HIMEM.SYS (in normal setups).  
  81.  By the way, it actually doesn't matter where lines like DOS=HIGH,UMB, 
  82.  FILES, BUFFERS, etc. appear in CONFIG.SYS; the only order that matters to 
  83.  DOS is that of DEVICE and DEVICEHIGH lines.  Note that the path to 
  84.  HIMEM.SYS and EMM386.EXE is not shown above, since that of course varies 
  85.  per setup and depends on whether you're using MS-DOS 5.0, 6.x, or Windows 
  86.  3.1.  The MS-DOS 6.2 versions of HIMEM.SYS and EMM386.EXE are the newest, 
  87.  the MS-DOS 6.0 versions are older, the Windows 3.1 versions are older 
  88.  still, and the MS-DOS 5.0 versions are the oldest.  Even if you have 
  89.  Windows 3.1 installed, always use the newest versions of HIMEM.SYS and 
  90.  EMM386.EXE since they contain fixes and enhancements over previous versions 
  91.  and are meant to replace them.
  92.  
  93.  Now EMM386.EXE must be specially configured to get what we want:  Maximum 
  94.  Upper memory.  To do this, one of the following EMM386.EXE lines is to be 
  95.  used:
  96.  
  97.  1)  For Upper memory only, no EMS memory support:
  98.  
  99.  * MS-DOS 5.0, 6.x, or Windows 3.1:
  100.  DEVICE=EMM386.EXE NOEMS I=B000-B7FF I=C800-F7FF
  101.  
  102.  * MS-DOS 6.x only alternative:
  103.  DEVICE=EMM386.EXE NOEMS I=B000-B7FF I=C800-EFFF HIGHSCAN
  104.  
  105.  This EMM386.EXE line is used when you want Upper memory only, and don't 
  106.  need EMS memory support for DOS programs, which is specified by the NOEMS 
  107.  parameter.  You gain an extra 64K of Upper memory for loading things high 
  108.  when not using EMS memory support.
  109.  
  110.  2)  For both Upper memory and EMS memory support:
  111.  
  112.  * MS-DOS 5.0 or Windows 3.1:
  113.  DEVICE=EMM386.EXE [memory] RAM FRAME=C800 I=B000-B7FF I=D800-F7FF
  114.  
  115.  * MS-DOS 6.x only alternatives:
  116.  DEVICE=EMM386.EXE MIN=0 RAM FRAME=C800 I=B000-B7FF I=D800-F7FF
  117.    or
  118.  DEVICE=EMM386.EXE MIN=0 RAM FRAME=C800 I=B000-B7FF I=D800-EFFF HIGHSCAN
  119.  
  120.  This EMM386.EXE line is used when you need both Upper memory and EMS memory 
  121.  support for DOS programs, which is specified by the RAM parameter.  With 
  122.  the MS-DOS 5.0 or Windows 3.1 EMM386.EXE, you must specify a value for the 
  123.  amount of EMS memory you wish to have available to DOS programs if you want 
  124.  more than the default of 256K.  With MS-DOS 6.x, a number no longer has to 
  125.  be specified to set the amount of EMS memory, because its EMM386.EXE will 
  126.  dynamically allocate as much EMS memory as a program requests, and then 
  127.  release it back to XMS memory when the program is done.  Using the MIN=0 
  128.  parameter means to not permanently reserve any EMS memory from the XMS 
  129.  memory pool (otherwise the default is 256K reserved), thereby making the 
  130.  largest amount of XMS memory available when EMS is not actually in use.  
  131.  (This is just like how Quarterdeck QEMM has been working all these years!)
  132.  
  133.  The following explains the parameters common to both EMM386.EXE lines:
  134.  
  135.  The I=B000-B7FF parameter tells EMM386.EXE to convert the area of Reserved 
  136.  memory that is normally for a monochrome video adapter into Upper memory.  
  137.  This is perfectly safe to do if you do not use monochrome, and gains 32K 
  138.  more Upper memory.  The only major problems this may cause are when using 
  139.  special high-resolution video modes or monochrome emulation modes of 
  140.  certain SuperVGA video adapters; and with Windows 3.1, depending on the 
  141.  Windows video driver used.  The video mode problem will vary greatly with 
  142.  the ton of video cards out there, but it is quite rare.  The Windows 
  143.  problem can be solved by using the MONOUMB.386 driver available from 
  144.  Microsoft or included with MS-DOS 6.x, which involves adding the line 
  145.  DEVICE=MONOUMB.386 under the [386Enh] section of the SYSTEM.INI file in the 
  146.  Windows directory (either copy the MONOUMB.386 file to the Windows System 
  147.  directory, or supply the full path to the MONOUMB.386 on the DEVICE line).
  148.  
  149.  The I=C800-F7FF parameter (or alternate I=C800-EFFF HIGHSCAN parameters for 
  150.  MS-DOS 6.x only; HIGHSCAN is really the same as I=F000-F7FF) converts the 
  151.  largest free area of Reserved memory normally empty on most systems (with 
  152.  one hard disk controller, no special expansion cards, and that are not IBM 
  153.  PS/2s) into Upper memory.  If the RAM parameter is being used, then D800 is 
  154.  used instead of C800 because of the 64K EMS Page Frame required in Upper 
  155.  memory for EMS memory support.  The EMS Page Frame is placed at the lowest 
  156.  free area by the FRAME=C800 parameter so the largest free area of Upper 
  157.  memory is created.  Either of these settings is the most common, but it 
  158.  will of course differ per system.  Some things to note about this memory 
  159.  range:
  160.  
  161.  - Including the F000-F7FF area (or using HIGHSCAN with MS-DOS 6.x) converts 
  162.  the first half of the System ROM BIOS into Upper memory.  This gains an 
  163.  extra 32K of Upper memory, but unfortunately it causes problems on quite a 
  164.  few systems.  For example, many system will exhibit erratic floppy drive 
  165.  behavior or plain old system lockups at some point.  In my experience, I've 
  166.  found it necessary with a 1990 AMI BIOS to use F6FF instead of F7FF (or 
  167.  HIGHSCAN) to avoid floppy drive problems in certain DOS programs and in 
  168.  Windows; however, F7FF (and HIGHSCAN) works fine with a Pheonix BIOS on 
  169.  another system I use.  You will just have to test it out on your system.  
  170.  Some less-compatible systems may not like Upper memory in the System ROM 
  171.  BIOS area at all.
  172.  
  173.  - Adapter cards like secondary IDE hard disk controllers and SCSI 
  174.  controllers may use 8K or more for their own ROM starting at the C800 
  175.  address.
  176.  
  177.  - Network interface cards may place their RAM buffers in the D000-DFFF 
  178.  area.
  179.  
  180.  - IBM PS/2 computers use the E000-EFFF range for their Advanced BIOS.  Some 
  181.  computers (such as Epsons) use this range for the VGA BIOS instead of the 
  182.  normal C000-C7FF range.
  183.  
  184.  To avoid memory conflicts, your best bet would be to first examine the 
  185.  Reserved memory area for the spaces that do not contain ROM.  This way you 
  186.  can see if multiple I= parameters must be used instead of one big range, 
  187.  and what would be the best range for the 64K EMS Page Frame (if using EMS 
  188.  memory support).  Such a utility to do this is called MSD (Microsoft 
  189.  Diagnostics) and comes with Windows 3.1, MS-DOS 6.x, and most other 
  190.  Microsoft products.  There is also a utility from PC Magazine called 
  191.  UMASCAN that displays a nice map of the Reserved memory area.
  192.  
  193.  There is one more trick for MS-DOS 6.x users.  Using the EMM386.EXE 
  194.  parameter NOHI will prevent EMM386.EXE from taking 4K of Reserved memory 
  195.  for its own code.  That 4K will then take away from free conventional 
  196.  memory, however if you have a device driver or TSR that requires just a 
  197.  couple more K to load resident in Upper memory, then that trade off is well 
  198.  worth it.  I had to do this myself in order to fit SHARE into Upper memory; 
  199.  EMM386.EXE now takes up 4K more conventional memory, but the 17K SHARE 
  200.  driver fits into Upper memory now.
  201.  
  202.  After you have configured EMM386.EXE for maximum Upper memory, you should 
  203.  optimize the loading order of your device drivers and TSRs so hopefully all 
  204.  of them fit into Upper memory now.
  205.  
  206.  The easiest way to do this with MS-DOS 6.x is to run MemMaker in its Custom 
  207.  mode, and then if necessary change the EMM386.EXE line back to the way you 
  208.  configured it for maximum Upper memory.  Since MemMaker puts a size value 
  209.  (the /L parameter) on each device driver and TSR load line, you can easily 
  210.  reorder them to load the ones with the largest size values first since they 
  211.  require the most free Upper memory to initialize in before going resident.  
  212.  Usually MemMaker does this reordering for you, but not always for the best.
  213.  
  214.  If you are not using MS-DOS 6.x, then optimizing the loading order of your 
  215.  device drivers and TSRs is a more involved trial-and-error deal.  You first 
  216.  have to check memory usage with the MEM /C command and note what device 
  217.  driver or TSR is not loading into Upper memory.  Then move the line that 
  218.  loads that device driver or TSR higher up in CONFIG.SYS or AUTOEXEC.BAT.  
  219.  Reboot and check with MEM /C again.  Keep trying if necessary until you 
  220.  hopefully get everything to load into Upper memory.  Remember that no other 
  221.  device driver should be loaded before HIMEM.SYS and EMM386.EXE in 
  222.  CONFIG.SYS (in normal setups).
  223.  
  224.  If you use a certain device driver or TSR that must load after another one 
  225.  to work properly, then you can't always optimize the loading order of them.  
  226.  An example of this is the new SmartDrive 5.0 included with MS-DOS 6.2, 
  227.  which can now cache a CD-ROM drive.  In order to cache a CD-ROM drive, 
  228.  SmartDrive must be loaded after the MSCDEX.EXE driver.  Since MSCDEX.EXE 
  229.  must be loaded first, and most load it into Upper memory, SmartDrive may 
  230.  not be able to completely fit into Upper memory anymore (depending on what 
  231.  else has been loaded into Upper memory already).
  232.  
  233.  Hopefully the information discussed here will help you load everything you 
  234.  need to load into Upper memory, without having to spend more on a third-
  235.  party memory management package!
  236.