Displaying the Config.NT Commands
Normally, you won't see any information about the commands that execute before the command window opens; all you see is a command prompt. Adding an ECHOCONFIG to the Config.NT file displays each of the commands as they execute. Using this feature can help you diagnose problems with the Config.NT file contents.
Controlling the Expanded Memory EMM Entry
Older applications, especially character mode (DOS) games, rely on the Expanded Memory Specification (EMS) memory to overcome command prompt memory limitations. It's important to remember that the command line effectively limits the amount of memory available to DOS applications to 640 KB minus any memory that the operating system uses. Normally, you set the amount of this memory as part of the application's PIF. However, the PIF doesn't let you control the Expanded Memory Manager (EMM), which is the application that actually makes the memory accessible. The EMM entry lets you change how the EMM works. This option uses the following syntax:
EMM = [A=AltRegSets] [B=BaseSegment] [RAM]
The following list describes each of the command line arguments.
A=AltRegSets Defines how many alternative mapping register sets the EMM has available for mapping memory between extended memory and conventional memory. You can provide any value between 1 and 255. The default setting of 8 works fine in most cases. Check your application documentation for additional requirements.
B=BaseSegment Defines the base segment, the location where the EMM places code within the DOS conventional memory area from extended memory as needed. Generally, any setting you choose works fine. However, some applications use specific segments for their use. Using the same memory segment for two purposes causes memory corruption and can cause the application to fail. The application documentation should tell you about any requirements. You can set the base segment to any hexadecimal value between 0x1000 and 0x4000. The default setting is 0x4000.
RAM Specifies that the EMM should only use 64 KB of address space from the UMB area for the EMM page. Normally, the EMM uses the entire UMB for the EMM page to improve EMM performance. However, your application may require more conventional memory than this practice allows. Using the RAM option reduces the EMM page size, which makes it easier for the command environment to load more applications in upper memory-freeing conventional memory for application use.
Setting the Number of Accessible Files
The Files setting may not seem very important, but every file handle you provide to the command environment uses conventional memory. Remember that conventional memory is already quite small and many older applications barely load in the space provided. The default Files=40 setting usually provides a good compromise. This setting means that the command environment can open 40 files, which is more than sufficient for most older applications. You can increase the number to as many as 255 when your application complains that it's out of file handles or decrease the number to as little as 8 when the application complains about a lack of memory.
Controlling Extended Memory with HIMEM.SYS
The HIMEM.SYS driver provides extended memory support at the command prompt. The eXtended Memory Specification (XMS) is a method that applications use to overcome the DOS memory limitations. You set the amount of available XMS using the PIF for the application. However, you can further refine XMS functionality by relying on the command line switches described in this section. As with all device drivers that you add to the Config.NT file, you begin the HIMEM.SYS entry using the device= entry, followed by the drive and path to the HIMEM.SYS file. This driver uses the following syntax:
DEVICE=[drive:][path]HIMEM.SYS [/HMAMIN=m] [/INT15=xxxx]
[/NUMHANDLES=n] [/TESTMEM:{ON|OFF}] [/VERBOSE]
The following list describes each of the command line arguments.
NOTE: HIMEM.SYS includes a number of command line switches, many of which are archaic. For example, even though HIMEM.SYS still supports the /A20CONTROL command line switch, you'd have to have a very old computer (over 10 years old) to need it. In short, unless you have a very old system, you'll never have a use for these older command line switches. In addition to the /A20CONTROL command line switch, I haven't discussed the /CPUCLOCK, /EISA, /MACHINE, and /SHADOWRAM command line switches. This section contains descriptions of the command line switches that are still useful.
/HMAMIN=m Specifies how many kilobytes of HMA memory an application must request in order for HIMEM.SYS to fulfill the request. Some applications ask for small pieces of the HMA area, which fragments an already small memory area and makes it unavailable for other applications. It becomes a question of efficient memory use. An application that can use a larger piece of the HMA will likely free more conventional memory for use by other applications. You can specify any value between 0 and 63. The default value is 0. Setting this command line switch to 0 or omitting it from the command line lets HIMEM.SYS allocate the HMA memory to the first application that requests it, regardless of how much HMA memory that application will use.
/INT15=xxxx Specifies the amount of extended memory in kilobytes that HIMEM.SYS should reserve for the Interrupt 15h interface. You may wonder what the Interrupt 15h interface is all about; it's the method that applications use to interact with XMS. The only time you need to use this command line switch is if you have an older DOS application, very likely a game or graphics application, that relies on XMS memory. The application will very likely display a nebulous error message that specifically mentions the Interrupt 15h interface. Make sure you set the amount of XMS memory to 64 KB larger than the amount required by the application. You can specify any value from 64 KB to 65,535 KB. However, you can't specify more memory than your system has installed. When you specify a value less than 64, HIMEM.SYS sets the value to 0. The default value is 0.
/NUMHANDLES=n Specifies the maximum number of Extended Memory Block (EMB) handles that the system can use simultaneously. Every time an application requests more memory, it needs a handle to access that memory. Generally, you don't need to provide this command line switch unless you have an older graphics-intensive application. You can specify a value from 1 to 128. The default setting is 32, which is more than enough for most applications. Changing the number of handles uses more memory for housekeeping chores, so you'll want to use this command line switch with care.
/TESTMEM:{ON|OFF} Determines whether HIMEM.SYS performs a memory check when you open the command prompt. Most people don't actually know whether the memory they're using is good, so checking it from time to time is a way to reduce unwelcome surprises. However, running the test takes time. You'll see a noticeable delay in displaying the command prompt when you use this command line switch. In most cases, it's far better to test your memory using a third-party diagnostic program that works outside of Window's influence. Otherwise, you can't be sure that you're testing all of the memory and won't know which surprises Windows has hidden from view. The HIMEM.SYS test is more thorough than the test that runs when you start your computer, so you can use it when you don't have any other means of testing available.
/VERBOSE Displays additional status and error messages while HIMEM.SYS is loading. The system normally doesn't display any messages unless it encounters a problem loading or initializing HIMEM.SYS. Adding this command line switch can point out potential problems in your system setup and aid in diagnosing application problems that you wouldn't normally detect. You can abbreviate this command line switch as /V. Unfortunately, despite the documentation for HIMEM.SYS online, you can't display the verbose messages by pressing the Alt key as the system loads HIMEM.SYS into memory; you must use the /VERBOSE command line switch to see the extended messages.
In this tutorial:
- CMD and BAT Files
- Starting the Command Interpreter
- Using the CMD Switches
- Working with the Command Interpreter in the Registry
- Modifying Config.NT
- Displaying the Config.NT Commands
- Modifying AutoExec.NT
- Saving Memory Using the LH Command
- Defining Application Compatibility with the SetVer Utility
- Using Common DOS Utilities
- Formatting a Disk with the Format Utility
- Terminating a Session Using the Logoff Utility
- Managing Environment Variables with the Set Command
- Managing Environment Variables with the SetX Utility
- Using Debugging Utilities
- Working at the Command Prompt
- Managing Usernames and Passwords with CmdKey
- Changing Screen Colors with the Color Command
- Obtaining Command Line Help with the Help Utility
- Creating Batch Files
- Using the Choice Command
- Using the For Command
- Using the Goto Command
- Using the Prompt Command
- Using the WaitFor Utility