WIN.COM AUTOMATIC STARTUP PARAMETERS ==================================== WIN.COM starts up automatically in the appropriate operating mode for your machine and the amount of memory installed. Operating modes are real mode (similar to Windows/286 2.x), which is only available in Windows 3.0; 286 standard mode (also known as 286 protected mode); and 386 enhanced mode (also known as 386 protected mode). However, Windows may be forced into any of the modes through the following command-line switches (provided the mode is supported by your hardware): Command Line Mode ----------------------------------------------- win /r Real (Windows 3.0 only) win /s or win /2 Standard win /3 386 enhanced Real Mode Requirements ---------------------- The requirements for WIN.COM to automatically start up in real mode are the following: - Windows 3.0 - 8088 processor or above - 384K of free conventional memory (393,216 bytes reported by chkdsk)Standard Mode Requirements The requirements for WIN.COM to automatically start up in standard mode are the following: - 80286 processor or above - 192K of free extended memory - XMS driver loaded (HIMEM.SYS) Practical Standard Mode Requirements ------------------------------------ Standard mode conventional/extended memory requirements are mutually dependent and are not fixed. A typical installation requires a minimum of 128K of memory free at the MS-DOS prompt to run standard mode, assuming sufficient extended memory is free. Standard mode requires between 384K and 512K of combined conventional and extended memory to run (approximately). For example, if only the minimum 192K of extended memory is free, approximately 322K of conventional memory is required to run standard mode. However, if available extended memory is increased to approximately 208K or greater, only 128K of conventional memory is required. 386 Enhanced Mode Requirements ------------------------------ The requirements for WIN.COM to automatically start up in 386 enhanced mode are the following: - 80386 processor or above - 1024K of free extended memory - XMS driver loaded (HIMEM.SYS) Practical 386 Enhanced Mode Requirements ---------------------------------------- See the above notes for standard mode regarding the interrelationship of conventional and extended memory requirements. A typical installation requires a minimum of 182K of memory free at the MS-DOS prompt to run 386 enhanced mode, assuming sufficient extended memory is free. Windows 386 enhanced mode requires between 580K and 624K combined conventional and extended memory to run (approximately). NOTE: 386 enhanced mode can start up in low memory situations because it provides virtual memory support; however, it may be extremely slow due to the large amount of disk swapping it must perform. All numbers are approximate and may vary widely depending on the configuration (for example, Windows device drivers chosen, MS-DOS version, display adapter, and so on). 128K of extended memory is recovered from shadow RAM usage on COMPAQ 386 machines. Memory requirements take into account memory that can be recovered from SMARTDrive (down to the minimum cache size specified). THE FREE SYSTEM RESOURCES PERCENTAGE ==================================== The Program Manager and File Manager About boxes in the Help menus of Windows 3.1's standard and 386 enhanced modes give percentage figures for free system resources and free memory. In Windows 3.0, these figures can be obtained from the About box of the Program Manager Help menu. To understand what the free system resources percentage means, you must understand some of the anatomy of Windows's internal structure. The part of Windows that runs Windows applications is made up of three main segments called KERNEL, GDI (graphics device interface), and USER. KERNEL loads and runs Windows applications and handles their memory management. GDI manages graphics and printing. USER controls user input and output, including the keyboard, mouse, sound driver, timer, and communications ports. These three segments exist as separate .EXE files and are located in the WINDOWS\SYSTEM subdirectory. GDI has a storage area limited to 64K, which is known as a local heap. Currently, USER has two such areas, hence 128K storage. The free system resources percentage reflects the remaining free percentage of USER or GDI local heap space, whichever is lower. Although Windows 3.1 allows you to run a much larger number of simultaneous Windows applications than any previous Windows version, like Windows 3.0, it is not without limitations. If you receive an "Out of memory" error and the Help About box shows a large amount of free memory, look at the free system resources percentage. Chances are you are low on system resources. Every window and icon that is created requires USER local heap space. It is theoretically possible to exhaust the system resources with only one application, such as Program Manager, if enough objects are created by the application. Another important aspect of Windows application memory management that is not included in the free system resources percentage is the number of selectors. A selector is a memory pointer that is consumed with each memory allocation made by a Windows application. Windows 3.1 has a fixed number of selectors (4096 in standard mode, 8192 in 386 enhanced mode). If a Windows application allocates a very large number of small data objects, it is possible to run out of selectors. This will also produce an "Out of memory" error message. Writing a Windows application to handle its own data objects more efficiently can help in this situation. If you experience a chronic problem with a particular application while few or no other applications are loaded, contact the application vendor. It is important that the vendor become aware of the problem so it can be corrected if possible. Writing an application to handle data objects more efficiently can help reduce "Out of memory" conditions. 386 ENHANCED MODE PERFORMANCE TIPS: GETTING THE MOST FROM YOUR MACHINE ====================================================================== The following suggestions should assist you in maximizing the performance of your Windows 386 enhanced mode installation. Many of these suggestions apply to standard and real modes as well. 1. USE SMARTDRIVE. The Microsoft SMARTDrive disk caching driver can produce the largest single Windows 3.1 performance improvement. Use SMARTDrive whenever possible. For basic information on SMARTDrive installation and operation, refer to the "Microsoft Windows User’s Guide" version 3.1 manual. 2. KEEP YOUR HARD DISK OPTIMIZED. A fragmented hard disk greatly impacts Windows's performance, especially when a temporary swap file and/or SMARTDrive is installed. Use a hard disk optimizer program on a weekly basis to keep your disk contiguous. 3. CREATE A PERMANENT SWAP FILE. Using a permanent swap file improves performance over using a temporary one. Under Windows 3.1, if supported by your hardware, also select the Use 32-Bit Disk Access check box in Control Panel by choosing the 386 Enhanced icon, choosing the Virtual Memory button, then choosing the Change button. See "386 Enhanced Mode and Virtual Memory" section of this application note for more information on permanent swap file allocation. 4. TURN OFF GRAPHICS PORT TRAPPING. The speed of MS-DOS applications running under 386 enhanced mode can be noticeably improved by not selecting any of the Monitor Ports options in the Advanced section of the PIF Editor. The High Graphics option provides the widest range of MS-DOS application compatibility but is not required for most applications. 5. TURN OFF THE FILESYSCHANGE= SETTING. Windows 3.1 386 enhanced mode can monitor disk access by MS-DOS applications and send directory update messages to File Manager. This allows File Manager to be automatically updated by changes MS-DOS applications have made to files or directories. However, this option is not a necessity, and leaving it off (the default) speeds file access by MS-DOS applications. To disable this feature, set FileSysChange=no in the [386enh] section of the SYSTEM.INI file. 6. TURN OFF THE RESERVEPAGEFRAME= SETTING. Turn this setting off if you do not require expanded memory support for MS-DOS applications. Turning this option off ensures that you're getting the most possible memory in virtual MS-DOS machines. To disable this feature, set ReservePageFrame=no in the [386enh] section of the SYSTEM.INI file. 7. USE THE RIGHT NUMBER OF MS-DOS BUFFERS. If you are using SMARTDrive, set the number of MS-DOS disk access buffers in your CONFIG.SYS file to 15 (that is, BUFFERS=15). Using a greater number of buffers with SMARTDrive will actually decrease efficiency. If you are not using SMARTDrive, use BUFFERS=30. 8. USE THE LOWEST COMMON DISPLAY DRIVER. Using a display driver with a high resolution or large number of colors results in slower display performance. If you do not require the extra features of the display driver, use a driver with less capability. Usually this suggestion applies to display systems that are VGA compatible but offer an extended mode driver, such as the Video Seven or 8514. Using the standard VGA driver instead offers faster display performance but less resolution and/or color support. 9. USE THE PROPER HARD DISK INTERLEAVE. Frequently, a hard disk is formatted with the wrong interleave at the dealer or factory. You can use a program such as Gibson Research's SpinRite or Central Point's DiskFix to verify that you are using the proper interleave. Some programs can correct your interleave without reformatting the hard disk. 10. ENABLE 32-BIT DISK ACCESS. 32-Bit Disk Access is a method for accessing the hard disk with fewer changes in the processor mode. Windows can do this by using a device driver that traps interrupt 13 calls and handles them itself. To take advantage of this feature of Windows 3.1, you need to have a Western Digital WD-1003 or compatible hard disk controller. NOTE: To enable 32-Bit Disk Access in Windows 3.1, choose the 386 Enhanced icon in Control Panel. Choose the Virtual Memory button, then choose the Change button and create a permanent swap file. When you do this, select the 32-Bit Disk Access check box. EXPANDED MEMORY FOR MS-DOS APPLICATIONS ======================================= Under Real Mode Windows 3.0 --------------------------- Real mode Windows 3.0 and MS-DOS applications can both use the same external expanded memory manager (EMM). Expanded memory can be provided either by a physical expanded memory board, or by a 386 EMM. Common expanded memory boards include the AST RAMpage! and Intel Above Board. Common 386 EMMs include Microsoft's EMM386.SYS (included with Windows), Compaq's CEMM.EXE (included with COMPAQ 386 machines), Qualitas's 386 to the Max (386MAX.SYS), and Quarterdeck's QEMM.SYS. If a physical expanded memory board is used, you will get the best performance from real mode Windows by backfilling to provide large page frame LIM 4.0 support. Some boards do not have the hardware register support to provide large page frame LIM 4.0--only small page frame (see "Expanded Memory" section of this application note). All 386 EMMs provide large page frame LIM 4.0 support. Remember that MS-DOS applications require LIM 3.2 (a 64K contiguous page frame) to use expanded memory, but real mode Windows requires LIM 4.0 (does not require a 64K contiguous page frame). If you see expanded memory in Windows but not in your MS-DOS applications, you probably do not have a 64K contiguous page frame (LIM 3.2), and you may need to rearrange adapter locations. For more information, see "Expanded Memory" section of this application note. Under Standard Mode Windows 3.x ------------------------------- As noted in the "Standard Mode and Conventional Memory" section of this application note, Windows 3.x standard mode does not use expanded memory. MS-DOS applications running under standard mode can use expanded memory only with a physical expanded memory board such as an AST RAMpage! or Intel Above Board. You cannot use 386 EMMs to provide expanded memory support for MS-DOS applications running under standard mode. Still, 386-compatible EMMs can be loaded to provide MS-DOS- application expanded memory support outside standard mode in Windows 3.1. Such EMMs cannot be used in conjunction with standard mode Windows 3.0. Under 386 Enhanced Mode Windows 3.x ----------------------------------- Expanded memory emulation is provided internally for MS-DOS applications running under 386 enhanced mode. The only requirement is the presence of a 64K contiguous page frame for LIM 3.2 compatibility. For more information on page frame placement, see the "386 Enhanced Mode and the 384K Upper Memory Area (UMA)" section of this application note. Expanded memory for MS-DOS applications can be allocated and/or limited through PIF settings. External 386 Expanded Memory Managers ------------------------------------- Some 386 EMMs have a special feature that allows standard or 386 enhanced mode Windows to turn them off when Windows is run. Memory managers with this capability are EMM386.EXE and CEMM.EXE. Windows can turn off EMM386.EXE even if expanded memory is in use at the time. CEMM.EXE requires that no expanded memory be in use when standard or 386 enhanced mode Windows is run. Some 386 EMMs provide the capability of loading MS-DOS device drivers into free areas of the 384K UMA. CEMM.EXE does not provide this capability, but the combination of MS-DOS 5.0 and EMM386.EXE, or 386MAX.SYS and QEMM386.SYS does. DPMI AND VCPI ============= Specifications for Different Purposes ------------------------------------- The MS-DOS Protected Mode Interface (DPMI) was developed by a group of industry leaders including Borland, Eclipse, IBM, IGC, Intel, Locus, Lotus, Microsoft, Phar Lap, Quarterdeck, and Rational Systems. Several members of the DPMI committee were also involved in the creation of the Virtual Control Program Interface (VCPI). DPMI is primarily a creation of Microsoft, and VCPI was formulated primarily by Phar Lap Software. MS-DOS Extended Applications ---------------------------- MS-DOS extended applications execute code in the protected mode of the 80286 or 80386 processor. Unlike OS/2 applications, MS-DOS extended applications are launched from standard MS-DOS. Creating an MS-DOS extended application requires a method to switch the processor to protected mode and to allocate extended memory. Until DPMI, there was no standard method for MS-DOS extended applications to perform these tasks and multitask memory with other applications on 80286 processors. Hundreds of existing applications have been created using various types of MS-DOS extenders. OS/2 extender applications that do not already support DPMI will require minor modifications to do so. Comparing VCPI to DPMI ---------------------- VCPI and DPMI solve two different problems. VCPI provides an interface between applications using MS-DOS extenders on an 80386 machine and 386 EMMs. For example, the 386 EMMs (EMM386.EXE, QEMM.EXE, 386MAX.EXE, and CEMM.EXE) support the VCPI specification. VCPI allows applications using MS-DOS extenders to run simultaneously with 386 EMMs on a 386 machine. However, multitasking operating environments such as Windows 386 enhanced mode, OS/2, UNIX 386, and VM386 have memory and protection models that are not compatible with the VCPI interface. DPMI was created so these environments can run extended MS-DOS applications. Additionally, DPMI provides support for 80286-based machines, while VCPI does not. DPMI has the capability of running MS-DOS extended applications on a variety of processors and operating environments. GLOSSARY ======== 386 Expanded Memory Manager (EMM) --------------------------------- A device driver loaded that provides expanded memory on an 80386-based computer without a physical expanded memory board. 386 expanded memory managers (EMMs) operate through the 80386 processor’s hardware capabilities. 386MAX.SYS ---------- A 386 expanded memory manager (EMM) from Qualitas Corporation. CEMM.EXE -------- A 386 EMM from Compaq. CEMM is provided with all Compaq 386-based computers. It has an extension of .EXE rather than .SYS, even though it is installed in the CONFIG.SYS file like other 386 EMMs. Conventional Memory ------------------- The memory in your machine from zero K to 640K. DPMI ---- The MS-DOS Protected Mode Interface (MS-DOS extender industry standard). Applications that use the DPMI specification can run in protected mode and break the 640K barrier under standard or 386 enhanced mode. The DPMI specification is available from Intel Corporation. EMM386.EXE ---------- The Microsoft 386 expanded memory manager (EMM). See the "Microsoft Windows 3.1 User’s Guide" for more information. EMM --- Expanded memory manager. EMS --- Expanded Memory Specification. Expanded Memory Specification (EMS) ----------------------------------- There are two expanded memory specifications, which are designated LIM 3.2 and LIM 4.0. Expanded Memory Manager (EMM) ----------------------------- A device driver that provides an interface to expanded memory. An expanded memory manager, or EMM, is either specific to a particular physical expanded memory board, or uses the 386 processor. Extended Memory --------------- Memory in your machine above 1 MB. Extended memory always starts at 1024K. Extended Memory Specification (XMS) ----------------------------------- The XMS provides a standard way for real mode applications to access extended memory. MS-DOS applications running under Windows 3.x can use the XMS to access extended memory. The XMS document and sample source code is available from Microsoft End User Sales at (800) 426-9400; international callers should call (206) 936-8661. HIMEM.SYS --------- Microsoft's high memory manager. Manages extended memory in accordance with the Extended Memory Specification (XMS). Large Page Frame ---------------- A slang term denoting the presence of bankable expanded memory pages in conventional memory. Large page frame is usually used to refer to a number of bankable pages equal to or greater than 384K (that is, bankable pages ranging from 256K to 640K). Note that the term "large page frame" is a misnomer. The page frame is actually never any larger than four 16K pages and is always located in the 384K UMA. Additional bankable pages in conventional memory do not make the page frame larger; they simply provide additional bankable pages. LIM 3.2 ------- The Lotus/Intel/Microsoft Expanded Memory Specification (EMS) version 3.2. It provides for a maximum of four 16K bankable pages that must be contiguous. LIM 4.0 ------- The Lotus/Intel/Microsoft Expanded Memory Specification (EMS) version 4.0. It provides for a maximum of 64 16K bankable pages that do not have to be contiguous. Page Frame ---------- An area within the 384K upper memory area (UMA) that is designated the expanded memory page frame. The page frame itself can be a maximum of four 16K pages. QEMM386.SYS ----------- A 386 expanded memory manager (EMM) by Quarterdeck Office Systems. Small Page Frame ---------------- A slang term denoting the presence of expanded memory that does not place bankable pages within conventional memory. UMA --- Upper memory area. Upper Memory Area (UMA) ----------------------- The area between 640K and 1024K present on all IBM-compatible machines. Sometimes called the reserved address space because this area was originally reserved by IBM for the ROM BIOS, video memory, and other hardware functions. VCPI ---- Virtual Control Program Interface. An 80386 memory management standard created by Phar Lap Software in conjunction with other software developers. VM -- Virtual (8086) machine. The VM exists in a protected memory space created through the hardware capabilities of the 80386 processor. Virtual Memory -------------- The space on a hard drive partition that 386 enhanced mode Windows can address as physical memory. Often referred to as the (temporary or permanent) "swap" file. VMM --- Virtual memory manager. Virtual Memory Manager (VMM) ---------------------------- Manages the disk space used as virtual memory. XMS --- Extended Memory Specification.