FOR PUBLIC DISTRIBUTION: Hayes(r) Microcomputer Products, Inc. LANstep(r) Technical Note "Memory Management on a DOS Workstation Using MS-DOS 5.0" File Number LS-5, Rev. B. September 1993 Technical Summary: This Technical Note outlines different ways of getting the best use out of memory on a LANstep DOS Workstation using MS-DOS 5.0. MS-DOS 5.0 offers a number of methods of using extended, high and upper memory that can all result in larger amounts of conventional memory being made available for larger applications. While exact amounts vary with the hardware available and methods used, you'll learn how to maximize the amount of conventional memory available on even the most basic configurations. What This Note is About If you've upgraded a 80286, 80386 or 80486 based DOS Workstation with DOS 5.0, you can take advantage of some DOS 5.0-only techniques and software to make more conventional memory available for application usage. It's important to keep in mind that not all memory management options described in this document will necessarily work with all PCs. However, a large number of PCs can use these methods to obtain more usable memory. About Memory It's rumored that only a select few people in the world know the formula for Coca-Cola and even fewer still understand the different types of memory used in a modern PC. Read this section and you'll learn too. Conventional DOS (Application) Memory Conventional memory is the first 640K of memory found in a PC. This is the memory used by nearly all applications (word processors, spreadsheets, etc.) programs, including DOS, TSR's, device drivers, etc. Upper Memory Area The Upper memory area is the 384K found between 640K and 1MB. This memory is normally reserved for system use, such as video cards and other hardware, but it is possible to use some upper memory blocks of the upper memory area when you have an 80386 or 80486 based PC with extended memory. Upper Memory Blocks These are parts of the upper memory area that aren't used by the system. You can typically use some of this memory if you have an 80386 or 80486 with extended memory. Extended Memory This type of memory is only available on 80286, 80386 or 80486 based PCs. Extended memory begins at the 1MB address. High Memory Area (HMA) The first 64K of extended memory is called the high memory area and is where DOS 5.0 may be loaded, if the CONFIG.SYS file includes these two lines: DEVICE=HIMEM.SYS DOS=HIGH HIMEM.SYS is a device driver provided with DOS 5.0 that may be put anywhere on the disk, provided the DEVICE statement properly points to that location. Notes About Memory Managers: Memory managers refer to software that can utilize areas of memory not normally available for application programs. DOS 5.0 provides two different types of memory managers: HIMEM.SYS and EMM386.EXE. HIMEM.SYS This device driver file insures no two programs use the same areas of extended memory. Like other device drivers, HIMEM.SYS is loaded via the CONFIG.SYS file. EMM386.EXE EMM386.EXE can be used as an upper memory area manager, thus making more memory available for application programs. As the name implies, EMM386.EXE can only be used with 80386 / 80486 based PCs, and such systems must be using DOS 5.0. Some Sample Configurations The remainder of this note outlines some possible configurations for different types of PCs and how the memory manager software provided with DOS 5.0 can make more memory available for use by application programs. Each of these examples shows: * A sample CONFIG.SYS * A sample AUTOEXEC.BAT * Memory usage listing 80286 With No Extended Memory: On 80286 PCs with no extended memory, the default DOS Workstation memory configuration is shown here. Notice the CONFIG.SYS and AUTOEXEC.BAT are loading all necessary commands and drivers for DOS and LANstep, while the NETROOM batch file loads Office, Mail, and All Points Bulletins. Sample CONFIG.SYS: FILES=25 BUFFERS=3 LASTDRIVE=J DEVICE=PROTMAN.SYS DEVICE=NDISDRVR.SYS Sample AUTOEXEC.BAT: ECHO OFF NETRDR SET WMCMDS=E: SET PATH=%WMCMDS%\;%PATH%;A:\; SET TMP=%WMCMDS%\TMP\NW000 NETROOM Conventional Memory Usage: Name Size (decimal) Size (hex) MSDOS 52240 (51.0K) CC10 PROTMAN 2176 (2.1K) 880 NDISDRVR 14192 (13.9K) 3770 COMMAND 4768 (4.7K) 12A0 NETRDR 94224 (92.0K) 17010 OFFICE 2544 (2.5K) 9F0 MAILNOTF 2720 (2.7K) AA0 APB_TSR 9488 (9.3K) 2510 COMMAND 2800 (2.7K) AF0 Free Memory Sizes: Total FREE: 469808 (458.8K) Total bytes available to programs: 469808 (458.8K) Largest executable program size: 469808 (458.6K) 80286 With Extended Memory 80286 PCs with extended memory used as a DOS Workstation benefit from extended memory when configured as shown here. Notice the CONFIG.SYS file has been modified to load HIMEM.SYS and set DOS=HIGH, which puts DOS in the High Memory Area. The AUTOEXEC.BAT and CONFIG.SYS are still loading all necessary commands and drivers for DOS and LANstep, while Office, Mail, and All Points Bulletin's are loaded by NETROOM. Best of all, the amount of available conventional memory has increased. Sample CONFIG.SYS: DEVICE=HIMEM.SYS BUFFERS=3 LASTDRIVE=J DEVICE=PROTMAN.SYS DEVICE=NDISDRVR.SYS DOS=HIGH Sample AUTOEXEC.BAT: ECHO OFF NETRDR SET WMCMDS=E: SET PATH=%WMCMDS%\;%PATH%;A:\; SET TMP=%WMCMDS%\TMP\NW000 NETROOM Conventional Memory Usage: Name Size (decimal) Size (hex) MSDOS 11728 (11.5K) 2DD0 HIMEM 1184 (1.2K) 4A0 PROTMAN 2144 (2.1K) 860 NDISDRVR 14192 (13.9K) 3770 COMMAND 2688 (2.6K) A80 NETRDR 94224 (92.0K) 17010 OFFICE 2544 (2.5K) 9F0 MAILNOTF 2720 (2.7K) AA0 APB_TSR 9488 (9.3K) 2510 COMMAND 2800 (2.7K) AF0 Free Memory Sizes: Total FREE: 509392 (497.5K) Total bytes available to programs: 509392 (499.5K) Largest executable program size: 509392 (499.2K) 80386 With No Extended Memory On 80386 based PCs without extended memory, the default DOS Workstation memory configuration doesn't do quite as well as a 80286 based machine with extended memory. Note that CONFIG.SYS and AUTOEXEC.BAT are loading all necessary commands and drivers for DOS and LANstep, while NETROOM is loading Office, Mail, and All Points Bulletin's. Sample CONFIG.SYS: FILES=25 BUFFERS=3 LASTDRIVE=J DEVICE=PROTMAN.SYS DEVICE=NDISDRVR.SYS A Sample AUTOEXEC.BAT: ECHO OFF NETRDR SET WMCMDS=E: SET PATH=%WMCMDS%\;%PATH%;A:\; SET TMP=%WMCMDS%\TMP\NW000 NETROOM Name Size (decimal) Size (hex) MSDOS 52112 (50.9K) CB90 PROTMAN 2176 (2.1K) 880 NDISDRVR 14192 (13.9K) 3770 COMMAND 4768 (4.7K) 12A0 NETRDR 94224 (92.0K) 17010 OFFICE 2544 (2.5K) 9F0 MAILNOTF 2729 (2.7K) AA0 APB_TSR 9488 (9.3K) 2510 COMMAND 2800 (2.7K) AF0 Free Memory Sizes: Total FREE: 468944 (458.0K) Total bytes available to programs: 468944 (458.0K) Largest executable program size: 468720 (457.7K) 4456448 bytes total contiguous extended memory 4456448 bytes available contiguous extended memory 80386 With Extended Memory and Using HIMEM.SYS Here's an example of an 80386 PC with extended memory that uses HIMEM.SYS. Notice the CONFIG.SYS has been modified to load HIMEM.SYS and set DOS=HIGH which will put DOS in the High Memory Area. The AUTOEXEC.BAT and CONFIG.SYS are still loading all necessary commands and drivers for DOS and LANstep and NETROOM loads Office, Mail, and All Points Bulletin's. As you might expect, the available conventional memory has increased. Sample CONFIG.SYS: DEVICE=HIMEM.SYS FILES=25 BUFFERS=3 LASTDRIVE=J DEVICE=PROTMAN.SYS DEVICE=NDISDRVR.SYS DOS=HIGH Sample AUTOEXEC.BAT: AUTOEXEC.BAT ECHO OFF NETRDR SET WMCMDS=E: SET PATH=%WMCMDS%\;%PATH%;A:\; SET TMP=%WMCMDS%\TMP\NW000 NETROOM Name Size (decimal) Size (hex) MSDOS 14160 (13.8K) 3750 HIMEM 1136 (1.1K) 470 PROTMAN 2176 (2.1K) 880 NDISDRVR 14192 (13.9K) 3770 COMMAND 2688 (2.6K) A80 NETRDR 94224 (92.0K) 17010 OFFICE 2544 (2.5K) 9F0 MAILNOTF 2720 (2.7K) AA0 APB_TSR 9488 (9.3K) 2510 COMMAND 2800 (2.7K) AF0 Free Memory Sizes: Total FREE: 507696 (495.9K) Total bytes available to programs: 507808 (495.9K) Largest executable program size: 507584 (495.7K)) 4456448 bytes total contiguous extended memory 0 bytes available contiguous extended memory 4390912 bytes available XMS memory MS-DOS resident in High Memory Area 80386 With Extended Memory and Using EMM386.EXE Finally, here's an example of what is possible when loading EMM386.EXE. Starting EMM386 as shown provides UMB support which allows NETRDR to automatically go into UMBs. In this case, we're excluding the memory area where the network interface card resides, to avoid memory conflicts. Notice the changes to the CONFIG.SYS file and the fact that all but 0.3K of the NETRDR goes into extended memory. Sample CONFIG.SYS: DEVICE=HIMEM.SYS DEVICE=EMM386.EXE noems x=CC00-CF00 FILES=25 BUFFERS=3 LASTDRIVE=J DEVICE=PROTMAN.SYS DEVICE=NDISDRVR.SYS DOS=HIGH Sample AUTOEXEC.BAT: ECHO OFF NETRDR SET WMCMDS=E: SET PATH=%WMCMDS%\;%PATH%;A:\; SET TMP=%WMCMDS%\TMP\NW000 NETROOM Name Size (decimal) Size (hex) MSDOS 14160 (13.8K) 3750 HIMEM 1136 (1.1K) 470 PROTMAN 2176 (2.1K) 990 NDISDRVR 14192 (13.9K) 3770 COMMAND 2688 (2.6K) A80 NETRDR 256 (0.3K) 100 OFFICE 2544 (2.5K) AA0 MAILNOTF 2720 (2.7K) AA0 APB_TSR 9488 (9.3K) 2510 COMMAND 2800 (2.7K) AF0 Free Memory Sizes: Total FREE: 593360 (579.3K) Total bytes available to programs: 593360 (579.5K) Largest executable program size: 593136 (579.2K) 4456448 bytes total contiguous extended memory 0 bytes available contiguous extended memory 4189184 bytes available XMS memory MS-DOS resident in High Memory Area Conclusion While there are many different ways of manipulating the various segments of memory, you'll need to make your own decisions on which is best for you. Even if your DOS Workstation is a 80286-based PC with no extended memory, DOS 5.0 can help somewhat, since it uses less memory than some previous versions. However, as illustrated in the previous examples, a 80386 PC with extended memory and the EMM386.EXE driver can offer the most. Hayes is a registered trademark and LANstep is a trademark of Hayes Micrcomputer Products, Inc. Other trademarks appearing in this document are trademarks of the respective companies (Copyright) 1993 Hayes Microcomputer Products, Inc. USA