Home > Commands A-M > Configuration H

HIMEM.SYS


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

HIMEM is an extended-memory manager--a program that coordinates the use of your computer's extended memory, including the high memory area (HMA), so that no two applications or device drivers use the same memory at the same time.

You install HIMEM by adding a DEVICE command for HIMEM.SYS to your CONFIG.SYS file. The HIMEM.SYS command line must come before any commands that start applications or device drivers that use extended memory.


Syntax

DEVICE=[drive:][\path\]HIMEM.SYS [/A20CONTROL:ON | OFF] [/CPUCLOCK:ON | OFF] [/EISA] [/HMAMIN=m] [/INT15=xxxx] [/MACHINE:xxxx] [/NUMHANDLES=n] [/SHADOWRAM:ON | OFF] [/TESTMEM:ON | OFF] [/V[ERBOSE]]


Parameters
[drive:][\path\] (v5.0)
Specifies the location of the HIMEM.SYS file. HIMEM.SYS should always be located on the same drive that contains your operating system files. If the HIMEM.SYS file is in the root directory of your startup drive, you don't need to include a path. However, you must always include the complete filename (HIMEM.SYS).

Switches
/A20CONTROL:ON | OFF (v5.0)
Specifies whether HIMEM is to take control of the A20 line even if A20 was on when HIMEM was loaded. The A20 handler gives your computer access to the HMA. If you specify /A20CONTROL:OFF, HIMEM takes control of the A20 line only if A20 was off when HIMEM was loaded. The default setting is /A20CONTROL:ON.
/CPUCLOCK:ON | OFF (v5.0)
Specifies whether HIMEM is to affect the clock speed of your computer. If your computer's clock speed changes when you install HIMEM, specifying /CPUCLOCK:ON may correct the problem; however, enabling this option slows down HIMEM. The default setting is /CPUCLOCK:OFF.
/EISA (v5.0)
Specifies that HIMEM should allocate all available extended memory. This switch is necessary only on an EISA (Extended Industry Standard Architecture) computer with more than 16 MB of memory; on other computers, HIMEM automatically allocates all available extended memory.
/HMAMIN=m (v5.0)
Specifies how many kilobytes of memory an application must require for HIMEM to give that application use of the HMA. Only one application can use the HMA at a time; HIMEM allocates the HMA to the first application that meets the memory-use requirements set by this option. You can specify a value from 0 to 63.
Set /HMAMIN to the amount of memory required by the application that uses the most HMA memory.
The /HMAMIN option is not required; the default value is zero. Omitting this option (or setting it to zero) specifies that HIMEM allocate the HMA to the first application that requests it, regardless of how much of the HMA the application is going to use.
The /HMAMIN option has no effect when Windows is running in 386 enhanced mode.
/INT15=xxxx (v5.0)
Allocates the amount of extended memory (in kilobytes) to be reserved for the Interrupt 15h interface. Some older applications use the Interrupt 15h interface to allocate extended memory rather than using the XMS (eXtended-Memory Specification) method provided by HIMEM. If you use these applications, you can ensure enough memory is available to them by setting xxxx to 64 KB larger than the amount required by the application.
You can specify a value from 64 to 65535; however, you cannot specify more memory than your system has available. If you specify a value less than 64, the value becomes 0. The default value is 0.
/NUMHANDLES=n (v5.0)
Specifies the maximum number of extended-memory block (EMB) handles that can be used simultaneously. You can specify a value from 1 to 128; the default value is 32. Each additional handle requires an additional 6 bytes of memory.
The /NUMHANDLES option has no effect when Windows is running in 386 enhanced mode.
/MACHINE:xxxx (v5.0)
Specifies what type of computer you are using. Usually, HIMEM can detect your computer type successfully; however, there are a few computers that HIMEM cannot detect. On such systems, HIMEM uses the default system type (IBM AT or compatible). You might need to include the /MACHINE option if your computer is a type that HIMEM cannot detect and if HIMEM does not work properly on your system by using the default system type.
Currently, systems that require this option include Acer 1100, Wyse, and IBM 7552.
The value for xxxx can be any of the codes or their equivalent numbers in the table:
/SHADOWRAM:ON|OFF (v5.0)
Specifies whether to disable shadow RAM (SHADOWRAM:OFF) or to leave the ROM code running from RAM (SHADOWRAM:ON).
Some computers make ROM code run faster by "shadowing" it in RAM -- that is, by copying the ROM code into faster RAM memory at startup, which uses some extended memory. On computers that use shadow RAM and have less than 2 MB of RAM, HIMEM usually attempts to disable shadow RAM to recover additional extended memory for Windows to use. (HIMEM can disable shadow RAM only on certain types of systems.) When HIMEM disables shadow RAM, the ROM code runs in the slower ROM instead of RAM; therefore, your computer might run slightly slower than it did before.
/TESTMEM:ON|OFF (v6.22)
Determines whether HIMEM performs a memory test when your computer starts. By default, HIMEM tests the reliability of your computer's extended memory each time your computer starts. This test can identify memory that is no longer reliable; unreliable memory can cause system instability or loss of data. HIMEM's memory test is more thorough than the standard power-up memory test performed by most computers. To prevent HIMEM from performing the memory test, specify /TESTMEM:OFF. Disabling the memory test will shorten the startup process. (The default setting is /TESTMEM:ON.)
/V[ERBOSE] (v5.0)
Directs HIMEM to display status and error messages while loading. By default, HIMEM does not display any messages unless it encounters an error. (To display status messages without adding the /VERBOSE switch, press and hold the ALT key while HIMEM starts and loads.)

Related

none.


Notes
HIMEM tests the reliability of your extended memory

The MS-DOS 6.22 version of HIMEM.SYS includes a special safety feature: it tests your computer's extended memory each time your computer starts. HIMEM tests the memory by writing and reading data to each memory address and checking for differences in the data. If the data HIMEM reads from an address differs from the data it just wrote to that address, then the memory at that address is unreliable. Unreliable memory can cause system instability or loss of data. HIMEM's memory test is more thorough than the standard power-up memory test performed by most computers.

If HIMEM detects unreliable memory, it displays the following message and does not load:

    ERROR: HIMEM.SYS has detected unreliable extended memory at address
    XXXXXXXXh.

If you receive this message, you should have your computer's memory checked by a qualified computer hardware technician. Although you can disable the memory test and load HIMEM by using the /TESTMEM:OFF switch, it's not advisable to do so until you have had the memory checked by a technician.


Default memory allocation

Only one program at a time can use the high memory area (HMA). If you omit the /HMAMIN=m switch (or set it to 0), HIMEM reserves the HMA for the first program that requests it and that meets the memory requirements set by the /HMAMIN=m switch. To ensure the most efficient use of your system's high memory area, set /HMAMIN=m to the amount of memory required by the program that uses the most HMA memory.


Loading MS-DOS into the high memory area

HIMEM or another XMS driver must be loaded in order to load MS-DOS into the high memory area (HMA). You load MS-DOS into the HMA by using the DOS=HIGH command in your CONFIG.SYS file. (The DOS=HIGH command can appear anywhere in the CONFIG.SYS file.)


Examples

To run HIMEM using the default values, add to your CONFIG.SYS file:

    DEVICE=HIMEM.SYS

The command line shown above does not specify a path for the HIMEM.SYS file; therefore, the operating system searches for the HIMEM.SYS file only in the root directory of your startup drive. Because this command line does not include additional options, HIMEM uses the default values for those options. HIMEM allocates the HMA to the first program that requests it and allows the simultaneous use of up to 32 extended-memory handles.


Increasing the number of memory handles that HIMEM provides

To specify that a maximum of 128 extended-memory handles can be used simultaneously, add to your CONFIG.SYS file:

    DEVICE=C:\dos\HIMEM.SYS /NUMHANDLES=128

Errorlevels

none.


Availability
External
DOS (UNDOCUMENTED)
v4.0 v4.01 v4.01A
DOS
v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
none
Windows NT
none