Site hosted by Angelfire.com: Build your free website today!
This text file was originally located at: panda.bg.univ.gda.pl/pub/teksty/pc/tips/memory.txt I found the page remaining only in the Google cache and will maintain this information here so that the author's efforts will remain with us for a while longer. CPA
[ Homepage ]
 MEMORY.TXT Topics Contents: I. MS-DOS 6.22/Win3.1x Memory Management Tips II. F1-F12 Remapping (DOS mode, using ANSI.SYS) I. MS-DOS 6.xx/Windows 3.1x Memory Management Tips How to squeeze a few more KB of low (conventional) memory for your DOS programs and optimize your AUTOEXEC.BAT and/or CONFIG.SYS in MS-DOS 6.xx and Windows 3.1x: I included here my own MS-DOS 6.22 startup files: AUTOEXEC.BAT and CONFIG.SYS. You can read these files by opening them in Windows (any version above and including 3.1) with Notepad, or in MS-DOS mode (any version above 5.00) with EDIT.COM (the MS-DOS default text editor). I use MS-DOS 6.22's HIMEM.SYS and EMM386.EXE memory managers in CONFIG.SYS. My CONFIG.SYS also uses QEMM ver 8.01 and NetRoom ver 3.04 updated, 386 enhanced memory managers, and if you read MSD62.TXT and MEM62.TXT, you'll see how much low RAM I've gained by using each one of them. The file MSD62.TXT was created by running MSD.EXE: MSD /P C:\MSD62.TXT NOTE: All the CONFIG.SYS and AUTOEXEC.BAT command lines in these examples are customized to my system, and you'll need to follow the guidelines in this text file, and then edit your own files (after you've made backup copies) to adapt them to your own system configuration ! These are my CONFIG.SYS and AUTOEXEC.BAT lines explained: ========================================================= DEVICE=C:\DOS\HIMEM.SYS /NUMHANDLES=128 /TESTMEM:OFF For more info on "himem.sys" parameters, type: HELP HIMEM.SYS at dos prompt and press enter (DOS 6.xx and up users). /NUMHANDLES=128 represents the maximum number of extended memory block handles (has no influence in Windows). /TESTMEM:OFF loads HIMEM.SYS without taking an extra few miliseconds to test all your system's extended memory. Most of the newer system BIOS-es do this at bootup time anyway. NOTE: the HIMEM.SYS ane EMM386.EXE memory managers MUST be loaded in CONFIG.SYS by the "DEVICE" command, before ANY OTHER DEVICE or/and DEVICEHIGH command ! The CONFIG.SYS commands DEVICE AND DEVICEHIGH, and the AUTOEXEC.BAT commands LOADHIGH and LH are internal DOS commands, built in the OS, loaded automatically at bootup time from the system, hidden files MSDOS.SYS and IO.SYS, located in the root directory of the boot drive, C: by default (the first hard drive on your system) DEVICE=C:\DOS\EMM386.EXE X=C000-C7FF I=EE00-EFFF I=E000-ECFF I=B000-B7FF M3 A=64 H=128 D=256 RAM AUTO ALTBOOT For detailed help on EMM386.EXE parameters, type (DOS 6.xx users): HELP EMM386.EXE at dos prompt, press enter to READ the topic! Generic EMM386 line (fits almost all systems with a standard setup): DEVICE=C:\WINDOWS\EMM386.EXE X=C000-C7FF I=B000-B7FF D=256 RAM AUTO ALTBOOT Change the path to EMM386.EXE if different than C:\DOS. Including and excluding addresses in upper memory (the "I" and "X" switches) depends on your system CMOS, ROM and Video BIOS configuration and video card upper ROM memory addresses and can be tricky. Use these switches with extreme caution (if not properly set, you can hang your machine, or worse, loose data!). You can see how these regions of upper memory are set on your system, by running MSD.EXE at the DOS prompt, and pressing M (for the memory config screen). To visualize the upper ROM regions (color coded in grey) occupied by VGA/Video, CMOS and Extended BIOS memory hardware configuration you can click "Utilities" on MSD's menu bar and then click "Memory Browser". A classical method to make more upper memory available to drivers/devices is to add these 2 switches: X=C000-C7FF I=B000-B7FF to the EMM386.EXE line. C000-C7FF is usually reserved for the video ROM BIOS, and B000-B7FF region is only used for text on black and white (monochrome) monitors, so it's safe to add them to your EMM386 line. For Windows 3.1x Enhanced mode to take advantage of the unused monochrome region, include the line: device=c:\dos\monoumb.386 into the [386enh] section of your SYSTEM.INI file, located in your Windows 3.1x directory. The file MONOUMB.386 comes with MS-DOS 6.xx, and is usually installed by MS-DOS setup, in your \DOS directory (default). Check out your upper memory configuration with MSD.EXE (comes with MS-DOS 5.0 and up). Type: MSD at DOS prompt (AFTER YOU EXIT Windows 3.1x) and press Enter. Then press M. The "M3" switch loads EMM386's page frame to the C800 upper memory address (hex). On my system this gives maximum contiguous Upper Memory Blocks (UMBs) used for loading drivers/TSRs "high". The switch "NOTR" is not documented (prevents EMM386 from detecting a Token Ring Network Adapter, which detection may hang some machines). "NOTR" is NOT enabled by default (you need to add it to EMM386.EXE's line yourself!). Try to avoid the "HIGHSCAN" switch on the EMM386.EXE line! It may be dangerous to your health (it may hang your machine on bootup!). The "RAM" switch does the same job on searching the Upper Memory Area (UMA) for unused UMB-s (Upper Memory Blocks). NOTE: For more info on EMM386 parameters run "HELP EMM386.EXE" at DOS prompt (MS-DOS 6.xx users). To load: FILES, BUFFERS, FCBS, STACKS and LASTDRIVE high in CONFIG.SYS (MS-DOS 6.xx users ONLY), I recommend the excellent DOSMAX version 2.1 utility found at keyword "DOS" for AOL-ers, at "Memory utilities" (or type DOSMAX when you bring up the File Search screen, after signing up on AOL. Click the magnifier glass sitting on top of a floppy disk icon, on the AOL menu bar). Download the archive DOSMAX21.ZIP. Using the DosMax utilities can save you an extra 16-48KB of low memory! This is the DOSMAX line in my config.sys: DEVICE=C:\MAX\DOSMAX.EXE N+ Q+ P- R- U02 U08 U09 U0A U0B U0C U0D U0E U70... ... U72 U73 U74 U76 U77 * NOTE 1: to understand how to use DosMax/ShellMax/EnviMax, READ the documentation files that come with the DosMax package. * NOTE 2: DO NOT USE DOSMAX/SHELLMAX/ENVIMAX WITH WINDOWS 95 OS ! DosMax loads itself high, no need for a "DEVICEHIGH" command. It is useful to load drivers/devices/TSRs with the "DEVICEHIGH" command, to gain more low (conventional) memory (RAM). Use MEMMAKER to gain more memory. (MS-DOS 6.00 and up users only!). Or change the order of loading drivers in config.sys and autoexec.bat until you're satisfied with the amount of conventional memory reported by the "MEM /C /P" command. You can fiddle with the "/L:1", "/L:2", "/L:3", etc. switches to determine your own best high memory loading configuration. Example: DEVICEHIGH /L:3 C:\DOS\ANSI.SYS to load the ANSI.SYS driver in Upper Memory (UMA)--region 3 (located on my system between hex addresses EE00 and EFFF). NOTE: READ REGIONS.TXT (Courtesy of Mr. Dale F. Ogden and included here) FOR PRECIOUS INFO ON MS-DOS UPPER MEMORY MANAGEMENT AND UPPER MEMORY REGIONS MAPPING, IF YOU WANT TO MASTER YOURSELF THE WAY DEVICES, DRIVERS AND TSR-S LOAD IN YOUR CONFIG.SYS AND AUTOEXEC.BAT. The order of loading the devices/drivers/TSRs is of utmost importance (bigger first, smaller last). Same principles apply to loading TSRs high in AUTOEXEC.BAT, using "LOADHIGH" ("LH" for short). Example: LH /L:2 C:\MOUSE\MOUSE This means that my MS-DOS mode Mouse.com Driver loads in the 2nd upper memory region, located between C800 and ECFF (addresses in hex), on my system. NOTE: THE EMM386.EXE LINE MUST FOLLOW THE HIMEM.SYS LINE IN CONFIG.SYS! All "DEVICE"/"DEVICEHIGH" commands in CONFIG.SYS MUST follow the HIMEM.SYS and EMM386.EXE lines! SWITCHES=/F - skips the 2 second delay before processing the startup files after bootup. DOS=HIGH,UMB - loads the DOS kernel high and provides UMBs (upper memory blocks) for loading devices/drivers/TSRs in UMA (upper memory area). FILES=n - where 'n' MUST be at least 40 to run MS Windows 3.x and CPU intensive DOS applications/games. Set files to at least 50 in your config.sys to play safe! FCBS=1,0 - not to take extra memory. Higher values are needed only by older DOS programs (very probable that you'll never need more than that) If you don't specify a value for FCBS, MS-DOS loads the default value of 4. Newer programs use the "FILES" setting instead. BUFFERS=10,0 - if you use ANY hard disk cache utility (SMARTDRV.EXE is strongly recomended if you run Windows 3.1x with 32bit access enabled and DOS programs that access your hard disk frequently). Try to avoid 3rd party disk caches that may crash your computer, especially if you run 32bit disk access in Windows. The first number here (10) is the number of disk buffers. Its value must be between 1-99. Default is 30 (if not mentioned) and occupies too much memory (30 buffers are not needed, and cannot fit into the HMA). The second number here (0) is the number of buffers in the secondary buffer cache. Its value must be between 0-8. Default is 0 (no secondary cache buffers). Secondary cache buffers are needed ONLY if your hard disk (a SCSI disk) is not recognized or cached by SmartDrive. Use Smartdrv with Win31 (add a SMARTDRV line in your MS-DOS 6.xx AUTOEXEC.BAT), if you use any DOS programs/games that require frequent files access (huge files/directories). Doing so, it won't interfere with the Win31 disk operations. STACKS=n,m - where 'n' can be: 8-64 and 'm' can be: 32-512. If you are running older programs that rely on DOS stacks, set STACKS to at least 12,128 (default is STACKS=9,256, set by DOS if you don't mention a STACKS= line in config.sys!). Newer DOS programs and Windows 3.1x/95 do not use DOS stacks! Set STACKS=0,0 in your config.sys to save RAM, if your DOS programs don't need any (your older DOS software specifications should tell you if you should increase the STACKS!). LASTDRIVE=n - where 'n' is the letter following your last drive on your system (counting all your floppy, hard, CD-ROM, removable, dblspace, drvspace, Stacker, or other compressed drives, network drives, and RAM virtual drives, if you installed any). You can specify any letter from A to Z. Default is the letter following the last drive on your system (including floppy, CD-ROM, tape, external, RAM and compressed drives) if not mentioned. If you are not using a Network Card connection, or/and a RAM disk, you don't need to specify this switch in CONFIG.SYS. DEVICEHIGH /L:1 C:\path\CD_ROM.SYS /D:MYCDROM - your CD_ROM device driver. You also need to load MSCDEX.EXE in your AUTOEXEC.BAT, for your CD-ROM drive to be recognized by the system! Typical mscdex line: LH C:\path\MSCDEX /D:MYCDROM /M:24 /E with EMM386 configured to provide expanded memory (EMM386's "RAM" switch) to load the buffers in expanded memory ("/M:24") with the "/E" switch. "/D:MYCDROM" is the cd-rom drive's "name" and MUST be the same as the one on your cd-rom device driver line in config.sys! DEVICEHIGH /L:1 C:\WINDOWS\IFSHLP.SYS - MS Windows 32 bit access support driver DEVICEHIGH /L:1 C:\DOS\ANSI.SYS - or any other ANSI driver found on AOL, that supports extended keys (F1-F12) remapping (READ chapter II further bellow on how to remap your extended keys: F1 to F12 in DOS). The MS-DOS 6.xx version of SHELL= line in CONFIG.SYS: SHELL=C:\MAX\SHELLMAX.COM /N+ /P- /R- /S- C:\COMMAND.COM C:\ /E:512 /P /F ShellMax is part of DosMax 2.1 package and loads COMMAND.COM shell high! NOTE: USE SHELLMAX ONLY WITH MS-DOS 6.xx (NOT with Win95)! NOTES: You can use any other third party memory manager on the market: QEMM 7.x/8.01, NetRoom 3.x, 386MAX 7.x/8.00 with similar (or better) results. Using DosMax (MS-DOS 6.xx only) with these memory managers may conflict with their own "DosUp/DosHigh" features! I recomend to disable these "dosup/doshigh" features and use DosMax's. Also if you use any 3rd party memory managers, I recommend to NOT enable the moving of Video / ROM BIOS to high / extended memory (like QEMM's Stealth or NetRoom's VidCloak / SysCloak features!). Also try to use MS-DOS's internal (any version above 5.00) "DEVICEHIGH" (in your config.sys) and "LOADHIGH" ("LH" for short in your autoexec.bat) commands to load devices/drivers/TSR-s high, instead of your third party memory managers external high memory loaders (like QEMM's "LOADHI", or NetRoom's "XLOAD") for better compatibility reasons. * To load devices/drivers high, you can also use the INSTALLHIGH command ONLY in your CONFIG.SYS (MS-DOS 6.xx users). INSTALLHIGH is needed only if you have, for example, a big driver that you want to load before the smaller ones that load in your AUTOEXEC.BAT (using LH command). Example: INSTALLHIGH C:\MOUSE\MOUSE.COM <parameters> A disadvantage to using this command, is that you can't specify an upper memory region (by using the /L:x switches, as you can use with DEVICEHIGH and LH). Therefore, that particular driver will load into the largest contiguous upper memory area. * Lines you might need in your AUTOEXEC.BAT (MS-DOS 6.xx): LH C:\DOS\MSCDEX /D:MYCDROM /M:24 /E The cd-rom drive's name (/D:MYCDROM in this example) HAS TO BE EXACTLY THE SAME as the one specified on your CONFIG.SYS cd-rom driver line (read the config.sys cd-rom driver topic above); /M:24 - gives MSCDEX 24 buffers to handle cd-rom cache (if you don't specify this switch, the default is 8); /E - loads MSCDEX's buffers into expanded memory, provided you have a line for EMM386.EXE in your config.sys (example of EMM386 line to provide expanded memory): DEVICE=C:\DOS\EMM386.EXE X=C000-C7FF I=B000-B7FF D=256 RAM AUTO ALTBOOT NOTE: Always use the latest version of MSCDEX.EXE (the newest is 2.23, the one included with MS-DOS 6.22). C:\DOS\SMARTDRV 2048 A+ C+ D /N I presumed that A is your 3.5 inch floppy drive, C your hard drive, and D your CD-ROM drive. Change the drive letters if different on your system. Load Smartdrv after the MSCDEX line, if you want your CD-ROM drive to be cached in DOS mode. Run SMARTDRV /? at DOS prompt to see all Smartdrv related parameters, to understand how to adapt Smartdrv to your system. SET MOUSE=C:\MOUSE LH C:\MOUSE\MOUSE <parameters> to load your DOS mode mouse driver. You only need a DOS mouse driver in Windows, if you run any DOS programs/games that use a mouse. Change the DOS mouse driver's directory if different and adapt the parameters to your own mouse driver specifications. * My MS-DOS 6.22 CONFIG.SYS and AUTOEXEC.BAT files, with EVERYTHING loaded high, give me 624kb of free low (conventional)memory and 2kb of free upper memory (with MS-DOS's own HIMEM.SYS and EMM386.EXE memory managers). This IS ENOUGH to run ANY memory hungry DOS program/game in MS-DOS mode. ALWAYS make sure to alocate ALL your computer's memory as expanded or extended memory with your expanded memory manager (use EMM386's "RAM" switch to provide expanded memory combined with "AUTO", OR use "NOEMS" to provide ONLY extended memory). NOTE: DO NOT USE "NOEMS" IF YOUR DOS PROGRAMS/GAMES NEED EXPANDED MEMORY! * If you don't use any DOS communications software, or if you're not connected to a network, DO NOT LOAD SHARE.EXE in your MS-DOS 6.xx autoexec.bat! Remove the: C:\DOS\SHARE.EXE line from autoexec.bat. Instead use Win31's file-sharing/locking program called "vshare.386". Add up this line to the [386enh] section of your SYSTEM.INI: device=vshare.386 and make sure the file VSHARE.386 is located in your \WINDOWS\SYSTEM directory! There are DOS applications need a sharing-violation message. Turn it on in SYSTEM.INI, [386Enh] section, by adding this line: EnableSharingPopups=TRUE Windows 95 has its own 32bit (VXD) driver for loading VShare, that loads at boot time in extended memory: device=*vshare this being the line in your Win95's SYSTEM.INI file (no need to load a DOS driver in autoexec.bat). * There is a good probability that if you're using a relatively new computer (386DX/33 and up) and not using a network (or an old ESDI hard disk, or an old hard disk compression utility), you won't need SETVER.EXE loaded in your config.sys. If you determined that you don't need SETVER.EXE loaded (you're not using any older IBM or third party ESDI/IDE hard disk drivers, or old disk compressors, or older DOS network drivers), delete the file SETVER.EXE from the \DOS directory (default) and remove the: DEVICE=C:\DOS\SETVER.EXE line from your config.sys. If you'll need it later on, you can expand the file SETVER.EXE again and copy it to your hard disk from your OS install disks. * If you run DOS mode TSRs/drivers/devices loaded high in your CONFIG.SYS and AUTOEXEC.BAT files (loaded with "DEVICEHIGH" and "LH" by EMM386.EXE), and have a memory configuration (on bootup, before launching Windows) of less than 16KB of free upper RAM (the first 384KB of memory above the 640KB boundary), make sure to remove the following line, or better remark it with a semicolon (;), or change its numeric value to "0", in the [386enh] section of your SYSTEM.INI file, located typicaly in C:\WINDOWS: LocalLoadHigh=0 If this line has a value of "1", you won't be able to start Windows with less than 16KB of free upper memory! This applies to Windows 3.1x, 386 enhanced mode only. * Other helpful lines to add to the [386enh] section of SYSTEM.INI (Windows 3.1x and Windows for Workgroups 3.1x): MaxBPs=768 => maximum number of break points used by Win31's virtual memory manager EMMExclude=A000-FFFF => not to allow Windows to search for unused RAM in the upper memory area (UMA): safer on some systems DualDisplay=on => to make use of the B000-B7FF upper memory area on VGA monitors, if not using a secondary display DMABuffersize=64 => to let your 16bit sound card have enough room to play music (MID, RMI, MOD) files (16bit DMA channel HI-FI buffer) PageBuffers=32 => for better hard disk buffered operations SyncTime=on => MUST have this line if TrapTimerPorts=off TrapTimerPorts=off => might help running time sensitive programs/games better (that rely on the computer's timer) in Win31 InitPS2MouseAtExit=off => saves a few miliseconds upon exiting Win31 (not looking for a PS/2 style mouse on exit) UniqueDOSPSP=TRUE => to start every application at a unique address in memory (especially if using some networks) IRQ9Global=on => use this line if your system hangs when reading from your floppy drive(s) COMBoostTime=1 => decrease character download time with high speed communication software (increase it if you are loosing characters during modem high speed transfers) COM2Buffer=1024 => your fast modem port (at least 9600bps) COM2FIFO=1 => if your modem is hooked to COM2 with a 16550AxN UART VGAMonoText=off => to allow Win31 to use the B000-B7FF area if not used by other hardware devices/applications 32BitDiskAccess=on => turn on 32 bit disk access in Windows 3.1x/WfWG 3.1x FileSysChange=off => not to update files in DOS mode (speeds things up in DOS windows) Some of these parameters can be loaded at Windows startup, as command line parameters. To see which ones suit you, run: WIN /? at DOS prompt (outside Windows). NOTE 1: If you don't know what these lines do, YOU MUST READ MS-DOS and Windows help and documentation files and manuals BEFORE altering your configuration files and beware that if you type in the wrong things you can damage the data on your hard disk and / or have unexpected machine hangups !!! Win31 afficionados may want to purchase Microsoft's "Windows 3.1" or "Windows for WorkGroups 3.11 Resource Kit" for more info on tweaking Win31 startup files (sells for 19 bucks or less). NOTE 2: ALWAYS BACKUP YOUR DOS / WINDOWS STARTUP FILES BEFORE MAKING ANY MODIFICATIONS !!! * MS-DOS 6.xx STARTUP FILES (default location in C:\ root): AUTOEXEC.BAT CONFIG.SYS * WINDOWS 3.1x STARTUP FILES (located in your Win31 directory, \WINDOWS is default): SYSTEM.INI WIN.INI II. Extended Keys (F1-F12) Remapping (in DOS mode, using ANSI.SYS) The included KEY.TXT and X.TXT files are simple "ANSI" batch files designed to reassign the "extended" keys on 101 keyboards: F1 to F12 through the ANSI device driver capabilities. First, you need to load MS-DOS's ANSI.SYS device driver in your CONFIG.SYS with the "/X" switch to allow for key remapping (after the lines that load HIMEM.SYS AND EMM386.EXE, MS-DOS 6.xx users): DEVICEHIGH C:\DOS\ANSI.SYS /X You can use any other compatible ANSI device that has the ability to remap the extended keys: F1-F12 to replace MS-DOS's ANSI.SYS. A good example is NNANSI.COM version 1/93 (a public domain utility written by Tom Almy and found in the DOS area on AOL). This version of NNANSI provides support for DOS/V, the Japanese version of MS/DOS. NNANSI.COM can be loaded from autoexec.bat (read the author's manual): LH C:\path\NNANSI D or from config.sys: DEVICEHIGH=C:\path\NNANSI.COM To get back to F1-F12 remapping: You can add this line at the end of your AUTOEXEC.BAT: TYPE C:\path\KEY.TXT and press one of the function keys (F1 thru F12) at DOS prompt, to start whatever DOS command you want, including starting Windows (any version). To assign your own DOS commands to F1-F12 in KEY.TXT, open it with any DOS text editor, (MS-DOS's EDIT.COM does just fine) and type in the commands you want inside 'quote' 'unquote': " ". Leave NO spaces! Example: "WIN". Make sure that the files (commands) mentioned in key.txt are in your path, set in your AUTOEXEC.BAT, otherwise you need to add the path to the commands. Example: "c:\path\program" in key.txt. You can assign DOS commands to ANY key on your keyboard as long as it doesn't interfere with any other functions that particular key might have (example: some of the function keys are remapped by the MS-DOS DOSKEY.COM TSR driver). To remap any key, you need to get that specific key's ASCI code. Type: HELP ANSI.SYS at DOS prompt, press Enter and look for the ASCI codes (MS-DOS 6.xx). Then open KEY.TXT (with EDIT.COM or Notepad) and change a key's ASCI code to the one you want, to have that particular key start your favorite DOS program. Example: change "WIN" to "MSD" (no quotes). To run certain DOS programs that rely on their own key remapping, you need to temporarily disable extended key F1-F12 remapping and go back to DOS's own original configuration. For this purpose, I created the file X.TXT and you need to enter the following at the DOS prompt to use it: TYPE C:\path\X.TXT You can rename X.TXT to whatever you want (the same for KEY.TXT). If you start a program that needs its own key remapping, use the 2 commands in a DOS batch file: @echo off type c:\path\x.txt your_program_executable type c:\path\key.txt and start your program from the above batch file, after you included: 'type c:\path\key.txt' command as the last line to your autoexec.bat. It is neat to assign your most used DOS commands to KEY.TXT, for running them just by pressing the designed function key, from F1 to F12. This works only on 101/102 extended keyboards with ANSI.SYS loaded (MS-DOS 6.00 and up)! Final Note: I uploaded all these hints/tips/tricks in the hope that people like you and me will find useful to have "shortcut" keys to their favorite programs and plenty of low free RAM to run any "nasty" (read "memory hungry") DOS program or game on the planet! Good luck!