STACK (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Headquarters | N/A , N/A |
| Products | Configuration for DOS and OS/2 startup |
CONFIG.SYS serves as the essential configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions that are interpreted by the system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—during the startup sequence. CONFIG.SYS was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS tailor DOS to manage devices, applications, and memory allocation. Once these commands are executed, DOS launches the command interpreter specified in the SHELL directive; if none is provided, it defaults to COMMAND.COM, which then runs AUTOEXEC.BAT.
Typically, the file is composed of name=value statements that either configure settings or load device drivers and terminate-and-stay-resident programs (TSRs) into memory.
In DOS systems, CONFIG.SYS is located in the boot drive’s root directory.
Certain MS-DOS variants and derivatives prioritize alternate configuration filenames over CONFIG.SYS:
- Versions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS), as well as MCONFIG.SYS (in REAL/32). These support advanced configuration data stored in binary files like CCONFIG.BIN, generally managed through CONFIG.EXE.
- In DR DOS 3.31 and subsequent releases—including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+—the file DCONFIG.SYS takes precedence over CONFIG.SYS. This allows support for disk compression drivers and multi-boot configurations.
- OpenDOS 7.01 and DR-OpenDOS 7.02 also check for ODCONFIG.SYS, while some DR-DOS 7.02+ editions look for DRCONFIG.SYS.
- Starting with DR-DOS 6.0, users can modify default file extensions using SYS /DR:ext, enabling multiple system files to coexist within a single root directory and be selected by boot loaders such as LOADER.
- The SHELL directive supports specifying alternative AUTOEXEC.BAT files via /P[:filename.ext], a feature also available in 4DOS.
- DR-DOS 6.0+ introduces a CHAIN=filespec command to continue processing another configuration file; versions 7.02+ optionally accept a label parameter.
- From DR-DOS 7.03 onward, the command SYS /A can copy CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Other DOS variants have implemented comparable mechanisms:
- FDCONFIG.SYS is used by FreeDOS,
- RXCONFIG.SYS is recognized by RxDOS version 7.24 and later,
- CONFIG.PTS is employed by PTS-DOS.
In Windows versions built upon DOS such as Windows 95 and 98, CONFIG.SYS and AUTOEXEC.BAT remain present but are generally left empty. Windows Me no longer processes CONFIG.SYS at all, instead loading environment variables directly from the registry.
Within the FlexOS operating system, CONFIG.SYS is formatted as a binary file that specifies resource managers and device drivers loaded during system initialization.
Example
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 within CONFIG.SYS that serve as jump destinations for , , , , and commands.
- Functions similarly to , but is also used to add inline comments after other directives in CONFIG.SYS. (Note that under MS-DOS/PC DOS, inline comments enclosed in double quotes are not disregarded.)
- Introduces inline comments alongside the ; comment symbol.
- Prompts the user with a Yes/No question before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional execution via boot menus.) Starting with DOS 6.0, a comparable feature exists by appending after directives (e.g., ).
- Executes the following CONFIG.SYS directive without any condition or prompt.
ATemplate:NbndC
- Determines whether programs may be terminated upon encountering errors.
- Sets which drives maintain file access timestamps within FAT file systems.
- Enables conditional command execution on AT-compatible hardware.
- Manages boot loading procedures.
- Adjusts the level of detail in error messages.
- Alters the default serial port driver (COM1 through COM4) associated with the AUX device.
- Prevents character devices from being accessible outside the virtual \DEV directory.
- Loads fundamental device drivers into system memory.
- Produces a beep sound even when audible alerts are turned off.
- Defines the subsequent operating system to load at startup.
- Activates or deactivates extended Ctrl+C interrupt handling.
- Specifies the quantity of disk buffers allocated.
- Similar to BUFFERS but allocates buffers within HMA or UMB areas.
- , , (Embedded DOS 6-XL exclusive)
- Adjusts cache block allocation and flushing intervals.
- Executes programs listed in CONFIG.SYS, pausing further processing until completion.
- Sets the initial state of the Caps Lock key upon boot.
- , (PTS-DOS specific)
- Configures CD-ROM driver settings and buffer sizes.
- (DR DOS 5.0+ and Embedded DOS)
- Continues CONFIG.SYS instructions from a new file or label reference.
- , , and other PTS-DOS directives manage system clock, screen clearing, color schemes, and similar settings.
- (OS/2 exclusive)
- Defines OEM codepage selections.
- , (DR-DOS 7.02+)
- Configures COM port quantity, sequence, I/O addresses, and timeout parameters.
- , (DOS 4.0+ and RxDOS)
- Redefines inline comment characters or skips the following line accordingly.
- , (DOS 3.0+, DR DOS 3.31+, OS/2)
- Enables support for internationalization.
Additional CPU-targeted conditional execution commands (PTS-DOS and DR-DOS) such as CPU88, CPU86, CPU286, CPU386, CPU486—including variants for specific processor models—allow tailoring CONFIG.SYS behavior to particular CPU architectures.
DTemplate:NbndF
- Adjusts relocation settings for drive descriptor tables.
- Specifies memory segment address used for multi-sector disk data deblocking operations.
- Activates internal debugging capabilities.
- Controls boot management functions.
- Loads device drivers into system memory.
- Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
- Sets country and codepage information affecting keyboard, screen, and printer devices.
- Defines cache memory size allocations.
- Determines floppy disk compatibility modes.
- Selects display font configurations.
- Controls whether DOS loads into high memory and/or utilizes upper memory areas.
- Loads DOS system tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
- Specifies an alternative directory path for DOS files.
- Defines search paths for data files.
- Provides parameters for physical disk drives.
- Establishes settings for unrecognized disk drives.
- Refer to .
- Enables specifying drives for PDUMP.nnn error log files.
- Outputs a message on the display screen.
- Displays messages incorporating ANSI escape codes.
- Adds extra verification steps when launching programs.
- Assigns an expected error or return code value.
- Configures A20 gate state during program startup.
- Terminates CONFIG.SYS processing prematurely except for certain directives.
- Sets hash table size to optimize file opening speed (distinct from MS-DOS FASTOPEN).
- Defines how many File Control Blocks can be cached simultaneously (shares buffer space with FILES under DR-DOS).
- Functions like FCBS but loads these into upper memory areas.
- Manages boot loading processes.
- Specifies maximum number of concurrently open files.
- Mirrors FILES but loads file handles into upper memory blocks.
- Executes specified subsections of CONFIG.SYS (refer to IGNORE).
GTemplate:NbndI
- Awaits a key press or timeout, then assigns the error level to the key's ASCII value or 1024 if timed out.
- Resumes processing of CONFIG.SYS at the indicated label.
- Continues nested CONFIG.SYS processing at a specified label, returning control to the previous point afterward.
- Refer to , , or for additional details.
- Consult for related information.
- See for further reference.
- Refer to or for more context.
- See or for supplementary information.
- Refer to for additional guidance.
- Loads a TSR program into memory similarly to , but after relocating the DOS data segment.
- See , , or for related commands.
- Consult for further details.
- Refer to or for more on this topic.
- Activates console and command line history buffers with advanced pattern search capabilities.
- Defines the segment address of the High Memory Area (HMA).
- Configures energy-saving mode using HLT instruction.
- Specifies system verification for boot sector virus detection.
- Loads installable file system drivers.
- Omits execution of designated CONFIG.SYS subsections.
- Permits applications to operate at ring 2, enabling direct hardware I/O access.
- Incorporates directives from another menu block (emulated via GOSUB/RETURN in DR-DOS).
- Sets the status of keyboard Insert mode.
- Loads a TSR program into memory.
- Installs TSR programs into upper memory area (equivalent to HIINSTALL in DR DOS 5.0).
- Installs TSR programs following relocation of DOS data segments.
- Adjusts PIC interrupt priorities, assigning highest priority to a specified IRQ.
KTemplate:NbndM
- Defines keyboard layout configuration.
- Specifies relocated keyboard buffer memory address.
- Sets maximum number of accessible drive letters.
- Equivalent to LASTDRIVE, loads Current Directory Structure into upper memory space.
- Enumerates DLL search directories.
- Controls handling of legacy applications.
- Determines the number of allowable file locks.
- Manages boot logo display when using PTS-DOS boot manager.
- Configures count, sequence, I/O port address, and timeout parameters for LPT1 device.
- Applies similar configuration settings for LPT2 device.
- Configures LPT3 device with analogous parameters.
- Enables and sets up LPT4 device operation.
- Defines delay before increasing process priority level.
- Adjusts strategy for memory allocation management.
- Specifies default method for DOS memory allocation.
- Establishes menu option definitions.
- Sets menu color schemes (can be emulated under DR-DOS).
- Defines default menu block (emulatable in DR-DOS environment).
- Specifies menu blocks (supported via emulation in DR-DOS).
- Enables or disables multitrack disk read/write operations.
- Continues CONFIG.SYS processing in a new file after loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Defines the default character representing No () in Yes/No/Resume prompts.
- Sets keyboard [[Num Lock|Template:Keypress]] state to enabled or disabled by default.
- Enables conditional execution based on the last error code, such as .
- Displays a message and pauses awaiting a keypress, similar to DR-DOS commands and .
- Requires user confirmation when errors occur in CONFIG.SYS processing.
- Configures buffer sizes for LPT port communications.
- Enables conditional execution specifically on PC-compatible hardware platforms.
- Sets scheduler priority levels for processes.
- Assigns priority levels to disk input/output operations.
- Changes default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
- Specifies whether DOS applications are permitted to execute.
- Loads a user interface shell environment.
- Enables conditional execution on IBM PS/1-compatible systems.
- Allows conditional execution on IBM PS/2-compatible machines.
- Suppresses output sent to standard output (STDOUT).
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS (not processed in PTS-DOS).
- Allocates drive letters for local block device drivers.
- Defines the default character used for Resume () prompts.
- Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally passing a return value.
- Sets the size of real mode memory.
- Executes programs listed in CONFIG.SYS simultaneously in the background, akin to CALL or INSTALL commands in DOS.
- Saves the initial character of deleted files within the FAT reserved area.
- Determines video mode (for FreeDOS) or screen access mechanisms (for PTS-DOS).
- Controls the keyboard Scroll Lock state, turning it on or off.
- Establishes environment variables.
- Loads the command interpreter shell.
- Similar to SHELL but includes a size parameter to load COMMAND.COM into HMA or UMBs, enhancing memory efficiency with third-party shells.
- Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Configures whether files close when Ctrl+Alt+Del is pressed.
- Indicates if POST routines are bypassed during reboot.
- Sets the count of hardware interrupt stacks.
- Defines default stack size for newly created threads.
- Loads buffer memory into upper memory areas explicitly, similar to STACKS but targeting high memory regions.
- Manages boot manager settings.
- Controls behavior of the XMS A20 gate.
- Defines submenu blocks (emulated within DR-DOS).
- Redirects error logging to disk instead of displaying popup dialogs.
- Specifies path location for swap files.
- Enables conditional continuation of nested CONFIG.SYS processing at labels based on key input with RETURN support.<ref>
- Sets the default switch character ('/' or '-').
- Defines special configuration options.
- Enables a fix for floating-point unit rounding errors.
- Specifies an alternative system file name for DOS booting.
- Configures memory placement of DOS components.
- Loads system from an alternate disk area.
- Defines size for dynamic system memory pool allocation.
- Loads DOS data and code into upper memory blocks (UMBs).
- Specifies how many concurrent threads the OS scheduler supports.
- Sets timeouts for single-step execution in CONFIG.SYS and default responses to prompts.<ref>
- Configures ranges for scheduler time slices.
- Defines file extensions used for temporary files.
- Globally or locally enables/disables single-step execution for CONFIG.SYS (and AUTOEXEC.BAT).<ref> OS/2 implementation differs substantially from DOS variants.
- Sets size for TRACE log buffer.
- Records detailed error information upon traps or faults.
UTemplate:NbndZ
- Assigns a specific segment for use as UMB memory by DOS.
- Configures parameters of the UMB server.
- Specifies address ranges designated as UMB RAM areas.
- Toggles disk write verification on or off.
- Reports a specific DOS version number to applications.
- Manages VGA display status settings.
- Specifies the current video mode in use.
- Determines whether virtual DMA is permitted.
- Enables or disables processor Virtual Mode Extensions features.
- Configures VxD driver settings for Windows environments.
- Sets up system support parameters for Windows operation.
- Relocates the Extended BIOS data area as configured.
- Allows conditional execution on XT-compatible hardware platforms.
- Enables built-in Year 2000 compliance support features.
- Sets default character used for Yes responses in prompts requiring Yes/No input.
- Manages tracking of file deletions.
Issues
While the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these files are crucial for comprehensive DOS customization and meeting software demands. If either file becomes damaged, troubleshooting is necessary.
In the absence of a SHELL directive within CONFIG.SYS—or if the file is missing or corrupted—DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 will fail to boot without this file, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later will prompt the user to specify a command processor path. This prompt also appears if the main command processor terminates unexpectedly or exits intentionally, providing an opportunity to replace the shell temporarily without rebooting.
COMMAND.COM from MS-DOS 7.0 onward is not compatible with DR-DOS, which is commonly installed in the root of drive C: in dual-boot environments. From DR-DOS 7.02 onwards, skipping or tracing modes (activated via Ctrl+F5/F7/F8) no longer allow bypassing SHELL directives. Subsequent updates introduced Ctrl+F6 to reinstate the skip function, facilitating recovery from invalid SHELL parameters. If no SHELL directive is found during skipped CONFIG.SYS execution, users receive a prompt requesting a valid shell filename before COMMAND.COM loads.
The maximum size of CONFIG.SYS varies depending on the operating system version: MS-DOS and PC DOS impose limits up to 64 KB, while DR-DOS effectively imposes no practical limit due to its line-by-line parsing approach rather than tokenization and sorting. This design allows precise management of driver and TSR loading order through DEVICE and INSTALL commands, enabling resolution of load conflicts and seamless incorporation of non-resident software during startup.
For MS-DOS/PC DOS versions 2.0 through 4.01, SHELL lines are restricted to 31 characters; later releases extend this limit to 128 characters, while DR-DOS supports up to 255 characters. It should be noted that CONFIG.SYS directives do not accommodate long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS or Windows configuration, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality between Windows 9x and DOS environments. During a DOS boot session, these files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Additionally, backups of the Windows 95 versions are stored under the names CONFIG.W40 and AUTOEXEC.W40.
In systems where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT remain intact without modification. Instead, DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT as its startup configuration files.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS for setting up drivers and environment variables prior to launching its graphical user interface.
Within the OS/2 subsystem integrated into Windows NT, CONFIG.SYS was visible to OS/2 applications but was actually stored within the Windows registry rather than as a physical file.
A variety of undocumented CONFIG.SYS commands exist specifically for OS/2 systems.
CONFIG.SYS continues to be employed by OS/2 successors such as eComStation and ArcaOS.
See also
- IBMBIO.COM / IO.SYS
- IBMDOS.COM / MSDOS.SYS
- CONFIG (environment variable)
- AUTOEXEC.BAT
- COMMAND.COM
- List of DOS commands
External links
- Information on AUTOEXEC.BAT and CONFIG.SYS available at Computer Hope
- Overview of CONFIG.SYS directives for Windows 98 / MS-DOS 7.10 (archived)
- Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
- Guide to FreeDOS CONFIG.SYS directives
- User Manual for PTS-DOS 2000 Pro including CONFIG.SYS directives (archived)
- Comprehensive German-language PTS-DOS FAQ (archived) covering detailed CONFIG.SYS directives