Jump to content

STACKS (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article STACKS (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
Headquarters
N/A
ProductsOperating system configuration

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions that the operating system's DOS BIOS interprets during the startup sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for configuring DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS has been processed, DOS proceeds to load the command interpreter specified by the SHELL directive; if none is specified, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.

Typically, this file is composed of name=value entries that establish adjustable settings or load device drivers and terminate-and-stay-resident (TSR) programs. CONFIG.SYS is located in the root directory of the system's boot drive.

Certain DOS variants employ alternative filenames that supersede CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI, incorporating extra configuration options saved in CCONFIG.BIN, which are commonly edited through CONFIG.EXE. - From DR DOS 3.31 onward, including PalmDOS and Novell DOS, DCONFIG.SYS takes precedence over CONFIG.SYS. This facilitates configurations involving disk compression and multi-boot environments. - OpenDOS versions 7.01 and DR-OpenDOS 7.02 search for ODCONFIG.SYS, while some DR-DOS releases also recognize DRCONFIG.SYS. - Starting with DR DOS 6.0, users can alter default configuration file extensions using SYS /DR:ext, allowing simultaneous sets of system files selectable through boot loaders such as LOADER. - The SHELL directive supports specifying alternate AUTOEXEC filenames, with COMMAND.COM accepting extensions other than .BAT in these instances. - DR DOS 6.0 and later introduce the CHAIN=filespec[,label] command to continue processing additional configuration files, even if they reside outside the root directory. - In DR-DOS 7.03 and newer, the SYS /A command copies CONFIG.SYS and AUTOEXEC.BAT alongside system files.

Comparable configuration file variants exist in other DOS-like systems: FDCONFIG.SYS for FreeDOS, RXCONFIG.SYS in RxDOS 7.24+, and CONFIG.PTS used by PTS-DOS.

Within Windows 95 and 98 environments, CONFIG.SYS and AUTOEXEC.BAT remain present but are generally left blank due to Windows' more sophisticated boot process. Windows Me does not process CONFIG.SYS at all; instead, it loads environment variables directly from the Windows Registry.

For FlexOS, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during system startup.

Example

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>

:;*?!

Defines labels within CONFIG.SYS that act as jump targets for commands such as , , , and .
Functions similarly to , but allows inline commentary following other directives. (In MS-DOS/PC DOS, inline comments enclosed in double quotes are not ignored.)
Used to start inline comments alongside the ; directive.
Prompts the user with a Yes/No question to confirm execution of subsequent directives. (FreeDOS does not support optional messages but allows conditional execution via boot menus.) DOS versions 6.0 and above provide a comparable feature by appending after directives (for example, ).
Causes unconditional execution of the next directive.

ATemplate:NbndC

Determines whether programs should be aborted upon encountering errors.
Sets which drives record file access timestamps on FAT file systems.
Enables conditional execution specifically on AT-compatible hardware.
Manages the boot process.
Adjusts the detail level of error message output.
Alters the default serial driver assigned to the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads the fundamental device driver into system memory.
Produces a brief beep even if sound alerts are turned off.
Defines the operating system designated for the next boot cycle.
Activates or deactivates extended Ctrl+C monitoring.
Specifies how many disk buffers should be allocated.
Similar to BUFFERS but loads these buffers into HMA or UMB areas.
, , (Embedded DOS 6-XL only)
Controls cache block allocation and flushing behavior.
Loads programs listed in CONFIG.SYS and pauses processing until they return control.
(DR-DOS 7.02+)
Sets the status of the keyboard Caps Lock key to on or off.
, , (PTS-DOS only)
Configures CD-ROM driver parameters and buffer sizes.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS from a new file or label.
, , (PTS-DOS, DR DOS)
Defines clock type and screen clearing commands.
, (OS/2 only)
Specifies OEM codepage settings.
, , (PTS-DOS only)
Configures CMOS RAM address and boot menu color schemes.
(DR-DOS 7.02+)
Defines count, sequence, I/O port, and timeout values for COM ports.
, (PTS-DOS only)
Specifies DMA buffer allocation.
, (DOS 4.0+, RxDOS)
Redefines comment lead-in characters or enables line ignoring.
, (DOS 3.0+, DR DOS 3.31+, OS/2)
Activates international support configuration options.
, (DR DOS 6.0+)
Sets the cursor position for configuration menus on screen.
, (MS-DOS 4.x only)
Supports codepage switching functionality.
, CPU88, CPU86, CPU286, CPU386, CPU486 variants (PTS-DOS, DR-DOS)
Executes conditionally based on CPU type or clock speed.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Defines memory segment address used for multi-sector disk data deblocking operations.
Enables support for an internal debugger tool.
Controls boot management functions.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices.
Configures sizes of cache memory areas.
Defines compatibility mode for floppy disk drives.
Specifies font used for display output.
Controls whether DOS loads into high memory and/or utilizes upper memory areas.
Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory regions.
Specifies an alternative search path location for DOS system files.
Defines search paths used for locating data files.
Describes physical parameters of disk drives.
Sets parameters applicable to unknown or unrecognized drives.
Refer to .
Enables PDUMP.nnn error log generation and specifies target drive for logs.
Outputs a message to the display screen.
Displays messages using ANSI escape sequences for formatting effects.
Adds extra verification steps when launching programs.
Assumes a specific error or return code for commands executed subsequently.
Controls A20 gate state during program startup sequences.
Terminates CONFIG.SYS processing before reaching file end, except directives SWITCHES and SHELL continue processing.
Defines hash table size used to accelerate file opening operations, differing from MS-DOS FASTOPEN driver behavior.
Sets maximum number of cached File Control Blocks (FCBs) that can be open at once (shares buffer with FILES in DR-DOS).
Similar to FCBS but explicitly loads FCBs into upper memory areas.
Manages boot process functions.
Specifies maximum number of files that can be opened simultaneously by the system.
Like FILES directive but loads file handles explicitly into upper memory blocks.
Facilitates execution of designated CONFIG.SYS subsections related to IGNORE directive functionality.

GTemplate:NbndI

Waits for a key press or timeout, setting the error level to the ASCII value of the key or 1024 if timed out.
Resumes CONFIG.SYS processing at a designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for further details.
See also .
Refer to .
Consult or for additional information.
Check or for related commands.
See .
Loads a TSR program into memory similarly to , but after relocating the DOS data segment. Compare with INSTCDEX.
Refer to , , or for more details.
See .
Consult or for related information.
Activates console and command line history buffers with enhanced pattern search capabilities.
Defines the segment address for HMA.
Configures power-saving mode using the HLT instruction.
Performs boot sector virus scanning.
Loads installable file system drivers.
Prevents execution of specified CONFIG.SYS subsections.
Permits certain applications to operate at ring 2, enabling direct hardware I/O access.
Incorporates directives from another menu block (implemented via GOSUB/RETURN in DR-DOS).
Sets the Insert mode status on the keyboard.
Loads a TSR program into memory.
Installs a TSR program into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
Loads a TSR program after relocating the DOS data segment (see also INSTCDEX).
Adjusts PIC interrupt priorities by rotating them so that a specified interrupt receives highest priority.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address of the relocated keyboard buffer area.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads the Current Directory Structure (CDS) into upper memory.
Lists directories for DLL search paths.
Manages backward compatibility for legacy applications.
Sets the quantity of file locks allowed.
Controls boot logo display when using PTS-DOS boot manager.
Configures count, sequence, I/O address, and timeout parameters for LPT1 device.
Applies same settings as LPT1 for LPT2 device.
Mirrors LPT1 settings for LPT3 device.
Enables and configures LPT4 device similarly to other LPT ports.
Defines priority wait duration before elevating process priority.
Specifies memory allocation policies and strategies.
Sets default DOS memory allocation method.
Defines options available within menus.
Specifies menu color schemes (can be emulated via ECHO commands in DR-DOS).
Sets default menu block (emulatable through TIMEOUT and SWITCH commands in DR-DOS).
Defines individual menu blocks (emulatable via ECHO and SWITCH in DR-DOS).
Enables or disables multitrack disk operations functionality.
Continues CONFIG.SYS processing within a new file after loading a device driver and setting %NEWFILE%.

NTemplate:NbndQ

Specifies the default "No" character response in Yes/No/Resume prompts.
Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
Executes conditionally based on the last error code, such as .
Displays a message and waits for key input, similar to and commands in DR-DOS environments.
Requires user confirmation upon encountering errors in CONFIG.SYS processing.
Configures buffer sizes for LPT port operations.
Enables conditional execution specific to PC-compatible machines.
Adjusts scheduler priority settings.
Sets priority levels for disk I/O-related programs.
Changes default printer device from LPT1 to LPT3 or LPT4 drivers as specified.
Determines whether DOS applications are permitted to run under current conditions.
Loads user interface components during system initialization.
Allows conditional execution on IBM PS/1-compatible hardware platforms.
Allows conditional execution on IBM PS/2-compatible hardware platforms.
Suppresses output display directed to STDOUT.

RTemplate:NbndT

Enables automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Prevents local block device drivers from using a specified drive letter.
Defines the default character for Resume () prompts in Yes/No/Resume dialogs.
Returns control from nested CONFIG.SYS processing to the prior GOSUB or SWITCH location, optionally passing back a return code.
Sets the size of real mode memory available.
Allows simultaneous loading of programs in CONFIG.SYS by running them in the background.
Determines whether the first character of deleted files is stored in the FAT reserved area.
Specifies video modes under FreeDOS or selects screen access methods under PTS-DOS.
{{nobold|(DR-DOS 7.02+)} }
Controls the Scroll Lock key status on the keyboard, turning it on or off.
Defines environment variables for the system.
Loads the command interpreter shell.
Similar to SHELL but includes a size parameter to preallocate COMMAND.COM in the High Memory Area (HMA), minimizing fragmentation. PTS-DOS attempts to load the shell into Upper Memory Blocks (UMBs).
Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files are closed automatically when Ctrl+Alt+Del is pressed.
Configures whether the Power-On Self-Test (POST) should be bypassed during reboot.
, STACKSIZE, STACKSHIGH
Define hardware interrupt stack sizes and buffer locations across multiple DOS versions and derivatives, enhancing system stability and performance.
, SYSBOOT, SYSGEN, SYSLOAD
Specific to PTS-DOS, these directives manage boot processes, alternative operating system boot files, memory arrangements, and overall system loading procedures for improved control.
, SWITCH, SWITCHES
Provide conditional processing and submenu capabilities within CONFIG.SYS for adaptable system configurations (support varies or is emulated differently among DOS variants).
, SWAPPATH
OS/2-specific commands that manage error logging locations and swap file paths to optimize resource handling and system reliability.
, TIMEOUT
Sets default switch characters ('/' or '-') and defines timeouts for CONFIG.SYS operations across various DOS platforms to streamline script execution.
, TRACEBUF
Enables or disables single-step execution tracing with configurable buffer sizes to assist debugging in DOS and OS/2 environments.
, SXFAKEHWFPU
OS/2 directives designed for detailed error logging and fixes related to hardware floating-point unit issues, improving system robustness.

This segment outlines essential CONFIG.SYS commands used to tailor DOS-based operating systems—including DR-DOS, PTS-DOS, FreeDOS, Novell DOS, and OS/2—addressing customization options such as error management, device handling, memory allocation, shell loading techniques, and conditional execution. These configurations are crucial for enhancing legacy system performance in professional settings relying on these platforms.

UTemplate:NbndZ

Assigns a specific memory segment for use as Upper Memory Block (UMB) space by DOS management routines.
Configures settings for the UMB server component.
Defines address ranges allocated as UMB RAM areas.
Toggles disk write verification on or off.
Specifies the DOS version number reported to applications.
Manages VGA display status parameters.
Sets the current video mode configuration.
Enables or disables usage of virtual DMA capabilities.
Controls whether the processor’s Virtual Mode Extensions (VME) are disabled.
Configures Virtual Device Driver (VxD) settings for Windows environments.
Establishes system support parameters for Windows operation.
Manages relocation of the Extended BIOS Data Area (XBDA).
Executes commands conditionally only on XT-compatible machines.
Enables built-in Year 2000 compliance support features.
Determines default affirmative response character (Yes/Y) in Yes/No/Resume prompts.
Configures tracking behavior for file deletions.

Issues

Although the system can initiate without CONFIG.SYS, both this file and AUTOEXEC.BAT are crucial for comprehensive DOS customization and meeting software prerequisites. When these files become damaged or corrupted, troubleshooting is necessary.

If the SHELL directive is absent from CONFIG.SYS or if the file is missing or compromised, DOS attempts to locate COMMAND.COM in the root folder. Versions prior to 6.0 will not boot if COMMAND.COM is unavailable. However, MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions prompt users to enter a command processor path if COMMAND.COM cannot be found, enabling a limited shell replacement at runtime without needing a reboot.

Because MS-DOS 7.0 and later COMMAND.COM versions are incompatible with DR-DOS, versions 7.02 and above of DR-DOS prevent skipping SHELL directives during skip, trace, or step modes. They require valid shell filenames before loading COMMAND.COM, which improves recovery options when invalid shell parameters are encountered.

The maximum size allowed for CONFIG.SYS varies depending on the operating system: MS-DOS and PC DOS limit the file size to a few kilobytes (up to approximately 64 KB), whereas DR-DOS imposes no explicit size restriction beyond filesystem limits. MS-DOS processes CONFIG.SYS by compiling it into a tokenized form in memory to ensure proper order—loading device drivers before TSRs—while DR-DOS interprets each line sequentially. This approach in DR-DOS offers greater control over the loading sequence of drivers and TSRs through DEVICE and INSTALL commands, facilitating resolution of load conflicts and enabling temporary external programs to be integrated into the CONFIG.SYS processing flow.

In MS-DOS and PC DOS versions 2.0 through 4.01, SHELL command lines were restricted to 31 characters; later editions expanded this limit to 128 characters, with DR-DOS supporting up to 255 characters. It is important to note that CONFIG.SYS directives do not support long filenames.

Dual booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS or Windows installation, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively. This allows dual booting between Windows 9x and DOS environments. Booting into DOS temporarily restores these files back to CONFIG.SYS and AUTOEXEC.BAT, while backups of the Windows 95 versions are saved as CONFIG.W40 and AUTOEXEC.W40.

In contrast, installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 retains the original Windows CONFIG.SYS and AUTOEXEC.BAT filenames. Instead, DR-DOS uses startup scripts named DCONFIG.SYS and AUTODOS7.BAT to maintain compatibility with earlier releases of DR DOS.

OS/2 / Windows NT

OS/2 extensively utilizes CONFIG.SYS for driver configuration and setting environment variables prior to loading its graphical user interface.

Within the OS/2 subsystem of Windows NT, CONFIG.SYS configurations are managed within the system registry rather than through conventional file-based settings.

Numerous CONFIG.SYS directives under OS/2 remain undocumented or only partially documented.

CONFIG.SYS continues to be supported in OS/2 derivatives such as eComStation and ArcaOS, ensuring backward compatibility with legacy applications.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details at Computer Hope
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS directives (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • Guide to FreeDOS CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Manual including CONFIG.SYS commands (archived)
  • German-language unofficial PTS-DOS FAQ (PTS/FAQD) with additional CONFIG.SYS details