Jump to content

STACKSHIGH (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article STACKSHIGH (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 20251 source
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsSystem configuration for DOS and OS/2

CONFIG.SYS serves as the main configuration file utilized by DOS and OS/2 operating systems. This distinctive ASCII text document contains initialization commands that the operating system’s DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—interprets during the boot sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for setting up DOS to support hardware devices, software applications, and memory management utilities. Once CONFIG.SYS is processed, DOS launches the command interpreter specified by the SHELL directive; if none is provided, it defaults to COMMAND.COM, which then executes the commands in the AUTOEXEC.BAT file.

This file primarily consists of name=value entries that configure adjustable settings or load components such as device drivers and terminate-and-stay-resident programs (TSRs). In DOS environments, CONFIG.SYS is located in the root directory of the system’s boot partition.

The same filename is also employed by (DCP), a variant of MS-DOS developed by East-German company VEB Robotron.

Certain DOS variants recognize alternative configuration filenames that supersede CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS, which supports enhanced configuration options stored in CCONFIG.BIN, managed through CONFIG.EXE. Some Multiuser DOS releases also implement CCONFIG.INI.

- In DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and later, DCONFIG.SYS takes precedence over CONFIG.SYS. Originally designed for disk compression configurations, it also facilitates multi-boot setups.

- OpenDOS 7.01 and DR-OpenDOS 7.02 search for ODCONFIG.SYS, while select DR-DOS 7.02+ editions reference DRCONFIG.SYS.

Starting with DR-DOS 6.0, users can modify default system file extensions using the SYS /DR:ext command, allowing multiple sets of system files to coexist for versatile boot options. The SHELL command supports specifying alternate AUTOEXEC.BAT filenames via /P[:filename.ext], with COMMAND.COM accepting extensions beyond ".BAT"—capabilities also found in 4DOS. The CHAIN=filespec directive permits continuation of processing in another configuration file, optionally targeting specific labels in DR-DOS 7.02+.

From DR-DOS 7.03 onward, the SYS /A option copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

Other DOS variants use different configuration filenames: FDCONFIG.SYS for FreeDOS, RXCONFIG.SYS for RxDOS version 7.24 and above, and CONFIG.PTS for PTS-DOS.

In Windows 95 and Windows 98—which are based on DOS—CONFIG.SYS and AUTOEXEC.BAT reside in the root directory of the boot drive but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers to be loaded at boot time.

Example

Below is a sample CONFIG.SYS configuration for MS-DOS 5: <syntaxhighlight lang="ini" line="1"> DOS=HIGH,UMB DEVICE=C:\DOS\HIMEM.SYS DEVICE=C:\DOS\EMM386.EXE RAM DEVICEHIGH=C:\DOS\ANSI.SYS FILES=30 SHELL=C:\DOS\COMMAND.COM C:\DOS /E:512 /P </syntaxhighlight>

:;*?!

Marks labels in CONFIG.SYS to serve as jump targets for , , , and commands.
Functions similarly to , also used for inline comments following other directives. (Note: In MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
Introduces inline comments alongside the ; directive.
Prompts a Yes/No confirmation with an optional message before executing subsequent directives.[1] (FreeDOS supports conditional boot menus defined via and .) DOS 6.0 and later versions offer a comparable feature by appending after the directive, e.g., , which is also supported by DR DOS.
Executes the next CONFIG.SYS directive without condition.

ATemplate:NbndC

Determines whether programs can be interrupted upon encountering errors.
Sets which drives record file access dates within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Boot management utility.
Controls the verbosity level of error messages.
Alters the default serial device driver assigned to the AUX: device.
Restricts character device availability outside the phantom \DEV directory.
Loads fundamental device drivers into memory.
Produces a brief beep even if audible alerts are disabled.
Specifies the operating system to load next during boot.
Enables or disables extended Ctrl+C detection.
Allocates a specified number of disk buffers.
Similar to BUFFERS but loads buffers into HMA or UMB areas (comparable to HIBUFFERS in DR DOS).
Sets the maximum count of cache blocks allocated from the system pool.
Defines the maximum duration before unused cache blocks return to the system pool.
Specifies the maximum interval before dirty cache blocks are flushed to disk.
Loads programs within CONFIG.SYS and runs them in the foreground, pausing further processing until completion.
Sets the keyboard Caps Lock state.
Names the CD-ROM hardware driver in use.
Assigns the number of buffers for CD-ROM access.
Continues processing CONFIG.SYS from a new file and optional label, available since DR-DOS 7.02.
Specifies the type of system clock used.
Clears the display screen.
Defines OEM codepage(s).
Indicates CMOS RAM address location.
Configures colors for boot menus.
, ;, ;, ;
  Define count, sequence, I/O addresses, and timeouts for COM ports (available from DR-DOS 7.02 onwards).
Specifies DMA buffer parameters.
Redefines characters that introduce inline comments or causes the following line to be ignored.
Activates and configures internationalization support.
Sets cursor position on display for configuration menus.
Supports codepage switching functionality.
CPU-specific directives (CPU88, CPU86, CPU286, CPU386, CPU486 variants) allow conditional execution based on processor type (support varies between PTS-DOS and DR-DOS).

DTemplate:NbndF

Manages relocation of drive descriptor tables in memory.
Assigns memory segment address for multi-sector disk data deblocking operations.
Enables support for an internal debugger environment.
Boot management utility.
Loads device drivers into conventional memory.
Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
Sets country and codepage parameters for keyboard, screen, and printer devices (KBD, SCR, LPT).
Configures sizes of cache memory areas.
Defines floppy disk compatibility mode settings.
Specifies font used for display output.
Controls loading of DOS into high memory area and usage of upper memory blocks.
Loads DOS configuration tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory space.
Specifies alternative directory path for DOS system files.
Defines search paths for data files used by DOS utilities.
Describes physical characteristics of disk drives connected to the system.
Sets parameters for unidentified or unsupported drives.
Refer to .
Enables error logging with PDUMP.nnn files on specified drives.
Outputs a text message on screen during CONFIG.SYS processing.
Displays messages that include ANSI escape sequences for enhanced formatting.
Specifies additional verification steps when launching programs.
Defines assumed error or return codes for subsequent operations in CONFIG.SYS scripts.
Controls A20 gate state at program startup to manage memory addressing modes.
Terminates CONFIG.SYS processing prematurely except under certain conditions involving SWITCHES and SHELL directives.
Sets hash table size used by fast file opening mechanisms (distinct from MS-DOS FASTOPEN driver).
Defines number of File Control Blocks (FCBs) cached simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but explicitly loads FCBs into upper memory area for performance optimization.
Boot management utility command variant.
Specifies maximum number of files that can be open concurrently by DOS processes.
Similar to FILES but loads file handles explicitly into upper memory areas for enhanced efficiency.
Incorporates execution of specified subsections within CONFIG.SYS (see IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, then assigns the error level to the ASCII value of the key or 1024 if timed out.
Resumes CONFIG.SYS execution at a designated label.
Continues nested CONFIG.SYS processing at a specified label, returning afterwards to the prior point.
Refer to , , or for additional details.
Consult for further information.
See for more context.
Refer to or for related commands.
See or for related instructions.
Consult for additional guidance.
Loads a TSR (Terminate and Stay Resident) program into memory after relocating the DOS data segment. Compare with INSTCDEX.
See , , or for more information.
Refer to for further details.
See or for related commands.
Activates console and command line history buffer with enhanced pattern matching search capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures energy-saving settings using HLT instruction.
Specifies system checks for boot sector virus detection.
Loads installable file system drivers.
Prevents execution of certain CONFIG.SYS subsections as specified.
Lists programs authorized to operate at ring 2, allowing direct hardware I/O access.
Includes directives from another menu section (emulated by GOSUB/RETURN in DR-DOS).
Sets the keyboard Insert mode status.
Installs a TSR program into memory resident status.
{{
Loads TSR program into upper memory, equivalent to HIINSTALL in DR DOS version 5.0).
Installs TSR after relocating the DOS data segment, similar to INSTALL command.
Rotates Programmable Interrupt Controller (PIC) priorities to assign the highest priority to a specified IRQ line.

KTemplate:NbndM

Defines the keyboard layout configuration.
Sets the address for the relocated keyboard buffer area.
Determines the maximum number of accessible drives in the system.
Functions like LASTDRIVE but also loads the Current Directory Structure (CDS) into upper memory space.
Specifies search paths for Dynamic Link Libraries (DLLs).
Manages loading of legacy applications.
Sets the allowable number of file locks in use.
Configures display of boot logo alongside PTS-DOS boot manager interface.
Defines count, sequence, I/O address, and timeout parameters for LPT1 device port.
Mirrors LPT1 settings for LPT2 device port configuration.
Applies LPT1 parameters similarly to LPT3 device port.
Enables and configures LPT4 device port with analogous settings.
Establishes wait duration before elevating process priority levels.
Adjusts memory allocation strategies utilized by DOS.
Specifies default method used by DOS for memory allocation tasks.
Defines available menu options presented during startup or configuration.
Sets menu color schemes (simulated via ECHO command in DR-DOS).
Specifies default menu block selection (emulated through TIMEOUT and SWITCH commands in DR-DOS).
Defines alternative menu blocks (simulated using ECHO and SWITCH commands within DR-DOS).
Enables support for multitrack disk operations on compatible drives.
Continues processing CONFIG.SYS from a new file after loading a device driver, setting %NEWFILE% environment variable accordingly.

NTemplate:NbndQ

Sets default character used as No () response in Yes/No/Resume prompts.
Controls keyboard [[Num Lock|Template:Keypress]] state—turning it on or off at startup.
Executes commands conditionally depending on last error code returned, e.g., .
Displays text and pauses until a key is pressed, similar in function to and under DR-DOS systems.
Requires user confirmation when errors occur during CONFIG.SYS processing.
Configures buffer sizes specifically for LPT1 through LPT3 parallel ports.
Enables conditional execution based on PC-compatible hardware detection.
Adjusts scheduler priority settings affecting task management performance.
Sets priority levels assigned to disk I/O-related processes and programs.
Changes default printer device driver assignment, such as switching from LPT1 to LPT3 or LPT4 ports.
Specifies whether DOS programs are permitted to run under current configuration.
Loads user interface components during system initialization.
Enables conditional execution when running on IBM PS/1-compatible machines only.
Enables conditional execution when operating on IBM PS/2-compatible hardware exclusively.
Suppresses display output directed to standard output (STDOUT).

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Allocates a drive letter for local block device drivers.
Establishes the default character for Resume () prompts in Yes/No/Resume dialogs.
Returns control from nested CONFIG.SYS processing to the prior GOSUB or SWITCH point, optionally with a return value.
Sets the size of real mode memory.
Enables concurrent loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands under DOS.
Saves the first character of deleted files in the FAT reserved area.
Defines video mode (in FreeDOS) or screen access methods (in PTS-DOS).
Controls the status of the keyboard Scroll Lock key, turning it on or off.
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but includes support for the SIZE parameter to allocate COMMAND.COM within HMA or UMBs, minimizing fragmentation.
Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files are closed when pressing Ctrl+Alt+Del.
Skips Power-On Self-Test (POST) during reboot.
, STACKSIZE, STACKSHIGH, STACK
Various stack-related settings for different DOS variants, primarily for compatibility with minimal effect on modern systems.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
Settings specific to PTS-DOS that manage boot processes and memory loading techniques.
, SUPPRESSPOPUPS, SWAPPATH
OS/2-specific configurations controlling submenu blocks, error popup suppression, and swap file directory paths.
, SWITCHES
Enables conditional processing within CONFIG.SYS for DR DOS and Novell DOS platforms.
, STRING
Sets the default switch character ('/' or '-') and includes internal parameters mainly aimed at maintaining compatibility across DOS variants.
, THREADS, TIMESLICE
OS/2-exclusive options for activating hardware fixes, managing thread concurrency, and defining scheduler time slices.
, TRACE, TRACEBUF
Manages timeout durations and enables step-by-step execution tracing within CONFIG.SYS across multiple DOS systems including DR-DOS and PTS-DOS.
, TRAPDUMP
Defines temporary file extensions (PTS-DOS) and detailed error logging options (OS/2).

UTemplate:NbndZ

Directs DOS to utilize a designated segment as Upper Memory Block (UMB) space.
Specifies which UMB server is in use.
Defines address ranges treated as UMB RAM areas.
Enables or disables verification of disk writes.
Sets the DOS version number reported to applications.
Configures VGA display parameters.
Indicates the current video mode setting.
Determines whether virtual DMA usage is permitted.
Controls deactivation of Virtual Mode Extensions.
Configures VxD drivers for Windows environments.
Sets system support parameters for Windows operation.
Adjusts relocation settings for the Extended BIOS Data Area.
Enables conditional execution specifically on XT-compatible hardware.
Manages built-in Year 2000 compliance features.
Defines the default affirmative character in query prompts.
Configures tracking of file deletions.

Issues

Although it is possible for the system to start without CONFIG.SYS or AUTOEXEC.BAT files present, these files are crucial for complete DOS initialization and customization tailored to software needs. File corruption necessitates diagnostic efforts.

When CONFIG.SYS does not include a SHELL directive or if it is absent or damaged, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Prior to version 6.0, systems fail to boot without this file. However, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt users to provide a command interpreter path if COMMAND.COM is missing. This prompt also appears when the main command processor terminates or is exited intentionally, allowing runtime substitution of the shell with limited functionality.

Due to incompatibilities between MS-DOS versions starting at 7.0 and DR-DOS, DR-DOS versions from 7.02 onward prevent skipping SHELL directives during skip/trace/step modes in boot processing to improve system stability. If no valid shell is detected when bypassing CONFIG.SYS processing, users must specify one before COMMAND.COM loads.

The maximum size allowed for CONFIG.SYS varies by DOS distribution—MS-DOS and PC DOS impose limits up to approximately 64 KB, whereas DR-DOS imposes no fixed size restriction beyond filesystem constraints. MS-DOS processes CONFIG.SYS by compiling it into an internal tokenized format that ensures device drivers load before TSRs. In contrast, DR-DOS parses directives sequentially line-by-line, allowing precise control over load order and enabling conditional execution based on system conditions or user input. This approach facilitates complex startup sequences and supports temporary program loading through INSTALL.

Early MS-DOS iterations restricted SHELL command lines to a maximum of 31 characters. Later releases expanded this limit up to 128 characters, while DR-DOS permits lengths up to 255 characters. It should be noted that none of these CONFIG.SYS directives accommodate long filenames.

Dual Booting DOS with Windows 9x

When Windows 95 is installed over a pre-existing DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between Windows 9x and DOS. During a DOS boot, these files are temporarily reverted to their original filenames. Additionally, Windows 95 system files are preserved under the names CONFIG.W40 and AUTOEXEC.W40.

In configurations where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT remain unaltered. Instead, DR-DOS initiates startup using separate files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 and Windows NT

OS/2 extensively depends on CONFIG.SYS for loading device drivers and setting environment parameters prior to launching its graphical user interface.

Within the OS/2 subsystem integrated into Windows NT, the CONFIG.SYS file as perceived by OS/2 applications is actually maintained within the system registry.

There exists a variety of undocumented CONFIG.SYS commands specific to OS/2.

CONFIG.SYS continues to be utilized by OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • Comprehensive details on AUTOEXEC.BAT and CONFIG.SYS at Computer Hope
  • Archived overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS commands
  • Caldera’s archived CONFIG.SYS Command Reference for DR-DOS 7 directives
  • Explanation of FreeDOS CONFIG.SYS commands
  • Archived PTS-DOS 2000 Pro User Manual covering CONFIG.SYS directives
  • Archived unofficial German PTS-DOS FAQ including CONFIG.SYS information
  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2000_CONFIG