Jump to content

STACKSIZE (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article STACKSIZE (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
Headquarters
N/A
ProductsConfiguration settings for DOS and OS/2

CONFIG.SYS serves as the main configuration file for the DOS and OS/2 operating system families. This specialized ASCII text document contains setup commands accessible to users, which the operating system's DOS BIOS interprets during startup. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

CONFIG.SYS directives are utilized to set up DOS for hardware devices and software applications, including memory management utilities. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL directive, defaulting to COMMAND.COM if none is provided. The shell then executes the instructions found in the AUTOEXEC.BAT file.

The file primarily consists of name=value pairs that establish configurable parameters or load essential components such as device drivers and terminate-and-stay-resident programs (TSRs). CONFIG.SYS is located in the root directory of the bootable drive.

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

Certain DOS versions search for alternative filenames that override CONFIG.SYS:

Earlier releases of Concurrent DOS from 3.2 through 4.1 did not utilize CONFIG.SYS; however, subsequent editions like Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 look for CCONFIG.SYS (derived from "Concurrent") instead. Some Multiuser DOS variants use CCONFIG.INI, while REAL/32 may adopt MCONFIG.SYS. These platforms also support extended configuration options stored in binary files such as CCONFIG.BIN, commonly edited with CONFIG.EXE.

In environments like DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and above, a file named DCONFIG.SYS (from "DR DOS") takes precedence over CONFIG.SYS. This approach facilitates configurations for disk compression and multi-boot arrangements by managing multiple configuration files.

OpenDOS 7.01 and DR-OpenDOS 7.02 also check for ODCONFIG.SYS, while certain DR-DOS 7.02+ editions recognize DRCONFIG.SYS. Since DR DOS 6.0, the command SYS /DR:ext enables modification of default file extensions, allowing multiple system file sets to coexist and be selected via boot loaders such as LOADER.

The SHELL command allows specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM accepting extensions other than ".BAT"—a capability also supported by 4DOS. From DR-DOS 6.0 onward, the CHAIN=filespec directive permits continuation of configuration processing from another file located outside the root folder; versions 7.02+ enhance this with CHAIN=filespec,label, enabling jumps to designated labels within those files.

Starting with DR-DOS 7.03+, the SYS /A option copies both CONFIG.SYS and AUTOEXEC.BAT alongside system files during setup.

Other operating systems have their own equivalents: FreeDOS utilizes FDCONFIG.SYS; RxDOS version 7.24 and later use RXCONFIG.SYS; and PTS-DOS employs CONFIG.PTS.

Both CONFIG.SYS and AUTOEXEC.BAT are present in the root directories of boot drives for Windows 95 and Windows 98, although these files are usually left empty.

Unlike its predecessors, Windows Me does not interpret CONFIG.SYS during startup, instead loading environment variables directly from the Windows Registry at: HKLM\System\CurrentControlSet\Control\SessionManager\Environment

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

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>

:;*?!

Acts as label identifiers within CONFIG.SYS, serving as jump points for , , , , and commands.
Functions similarly to , but additionally allows inline comments following other CONFIG.SYS instructions. (Note that under MS-DOS/PC DOS, inline commentary enclosed in double quotes is not ignored.)
Used to initiate inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS supports optional conditions through boot menus but lacks optional messages.) DOS version 6.0 and later enable a comparable feature by appending after the command (e.g., ).
Forces unconditional execution of the next CONFIG.SYS command.

ATemplate:NbndC

Determines whether programs can be aborted upon encountering errors.
Controls which drives record file access timestamps within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Functions as a boot manager.
Adjusts the level of detail shown in error messages.
Alters the default internal serial device driver assigned to the AUX device.
Prevents character devices from being accessible outside the virtual \DEV directory.
Loads core device drivers into memory.
Produces an audible beep even if sound notifications are disabled.
Specifies the operating system to be loaded next.
Enables or disables extended Ctrl+C checking functionality.
Sets the quantity of disk buffers allocated.
Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
, ,
Configure cache parameters including size, timeout duration, and flushing intervals.
Executes programs specified in CONFIG.SYS, pausing further processing until they return control.
Sets the Caps Lock key state on the keyboard.
,
Defines CD-ROM driver name and buffer allocation count.
Continues processing of CONFIG.SYS from another file or label.
, , , etc.
Various options for configuring system clock, screen clearing, OEM codepages, primarily targeting OS/2 or PTS-DOS environments.

Additional directives manage hardware communication ports (COM1–COM4), memory buffer settings, keyboard configurations, CPU-based conditional execution (e.g., CPU386), and internationalization support through COUNTRY. These allow detailed customization of system resources and driver behavior to enhance compatibility and performance across diverse DOS versions and hardware setups.

DTemplate:NbndF

Sets relocation parameters for drive descriptor tables.
Defines memory segment address used for multi-sector disk data deblocking processes.
Activates internal debugger support features.
Functions as a boot manager utility.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Configures country and codepage settings for keyboard, screen, and printer devices.
Sets cache memory sizes for improved performance.
Selects floppy disk compatibility mode settings.
Specifies display font parameters.
Controls loading DOS into high memory and usage of upper memory areas (similar to in DRDOS 5.0).
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Defines alternate search paths for DOS files.
Sets search paths for data files used by DOS utilities.
Describes physical characteristics of disk drives for proper operation.
Establishes parameters for handling unknown or unrecognized drives.
See .
Enables creation of PDUMP.nnn error log files and specifies drive location.
Displays a text message on screen during boot or processing.
Shows messages including ANSI escape sequences for enhanced formatting.
Determines whether additional validation checks occur when launching programs.
Assigns an assumed error or return code for subsequent operations.
Controls A20 gate status when starting applications to manage address line behavior.
Terminates CONFIG.SYS processing prematurely except for certain SWITCHES and SHELL commands.
Sets hash table size used to accelerate file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Specifies number of cached File Control Blocks (FCBs) allowed concurrently (shares buffer with FILES under DR-DOS).
Identical to FCBS but explicitly loads FCBs into upper memory space.
Boot manager functionality similar to other entries above.
Defines maximum number of simultaneously open files allowed by DOS.
Same as FILES but loads file handles into upper memory explicitly for optimization purposes.
Includes execution of designated subsections within CONFIG.SYS (refer to IGNORE directive).

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 processing of CONFIG.SYS at the indicated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for additional details.
Consult for further information.
See for related commands.
Refer to or for more context.
See or for supplementary details.
Consult for related usage.
Installs a TSR program following DOS data segment relocation; compare with INSTCDEX.
See , , or for related functions.
Consult for further reference.
Refer to or for additional context.
Activates console and command line history buffer with enhanced pattern search capabilities.
Defines the address of the HMA segment.
Configures the HLT power-saving mode.
Enables scanning of the boot sector for viruses.
Loads installable file system drivers.
Prevents execution of specific CONFIG.SYS subsections.
Permits certain applications to operate at ring 2, allowing direct hardware I/O access.
Incorporates directives from another menu block (simulated via GOSUB/RETURN in DR-DOS).
Sets the status of keyboard Insert mode.
Loads TSR programs into memory.
Installs TSR programs into upper memory areas (similar to HIINSTALL in DR DOS 5.0).
Installs TSR programs after DOS data segment relocation, comparable to INSTCDEX.
Rotates PIC interrupt priority levels, assigning highest priority to a specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address of the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads Current Directory Structure into upper memory.
Lists paths for DLL searches.
Manages handling of legacy applications.
Determines the number of file locks allowed.
Configures boot logo display using PTS-DOS boot manager.
Specifies count, order, I/O port, and timeout parameters for LPT1 device.
Defines count, order, I/O port, and timeout settings for LPT2 device.
Sets count, order, I/O port, and timeout values for LPT3 device.
Enables and configures LPT4 device with similar parameters.
Sets delay before increasing process priority level.
Configures memory allocation policies.
Specifies default DOS memory allocation strategy.
Defines menu option settings.
Specifies colors used in menus (emulatable on DR-DOS).
Sets default menu block (emulatable in DR-DOS environment).
Defines various menu blocks (emulation supported under DR-DOS).
Enables multitrack disk operation support.
Continues processing CONFIG.SYS in a new file after loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default No () character used in Yes/No/Resume prompts.
Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
Executes conditionally based on last error code, e.g., .
Displays a message and waits for key press, similar to and commands under DR-DOS.
Requires user confirmation when errors occur in CONFIG.SYS processing.
Configures buffer size for LPT1, LPT2, and LPT3 devices.
Conditional execution on PC-compatible systems only.
Adjusts scheduler priority settings.
Sets priority level for disk I/O-related programs.
Changes default printer driver device (e.g., switching from LPT1 to LPT3 or LPT4).
Specifies whether DOS applications are permitted to run.
Loads a user interface module.
Conditional execution on IBM PS/1-compatible machines only.
Conditional execution on IBM PS/2-compatible machines only.
Suppresses output sent to STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Allocates a drive letter to prevent usage by local block device drivers.
Sets the default character for Resume () responses in Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH statement, optionally with a return value.
Defines the size of real mode memory available.
Enables concurrent loading of programs specified in CONFIG.SYS in the background.
Determines if the first character of deleted filenames is stored in the reserved section of FAT directory entries.
Specifies video display modes under FreeDOS or screen access methods under PTS-DOS environments.
Controls the status of the Scroll Lock key, setting it on or off.
Sets environment variables for system use.
Loads the command interpreter shell program.
Similar to SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM into HMA or UMBs, reducing fragmentation.
Defines keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files are closed automatically upon pressing Ctrl+Alt+Del.
Specifies whether the Power-On Self-Test (POST) should be bypassed during reboot sequences.
, STACKSIZE, STACKSHIGH
Configure hardware interrupt stack sizes and buffer locations across multiple DOS versions and embedded platforms.
, SYSBOOT, SYSGEN, SYSLOAD
PTS-DOS commands managing boot procedures, alternative DOS boot files, memory location settings, and loading systems from alternative disk areas.
, SUPPRESSPOPUPS
Controls submenu blocking (from DOS 6.0 onwards) and sets error logging drives instead of popup notifications in OS/2 environments.
, THREADS, TIMESLICE
OS/2 parameters for defining swap file paths, setting the number of concurrent threads, and adjusting scheduler time slices.
, SWITCHES, SWITCHAR
Manage conditional processing flow in CONFIG.SYS, specify special options, and set default switch characters across DOS variants including DR-DOS and PTS-DOS.
, TRACE, TRACEBUF
OS/2 options for addressing FPU bugs and enabling or disabling single-step execution in CONFIG.SYS with configurable log buffer sizes.
, TRAPDUMP
PTS-DOS directive for handling temporary file extensions and logging error information within OS/2.

This concise summary highlights essential directives used for system configuration management across various DOS platforms such as DR-DOS, PTS-DOS, OS/2, and FreeDOS. These settings play a crucial role in optimizing system behavior within professional IT infrastructures.

UTemplate:NbndZ

Designates a specific memory segment to be utilized as Upper Memory Block (UMB) space by DOS management.
Specifies which UMB server is employed for memory allocation.
Defines address ranges allocated as UMB RAM areas.
Enables or disables verification of disk write operations.
Sets the DOS version string reported to applications.
Configures VGA display status parameters.
Indicates current video mode settings, comparable to FreeDOS's SCREEN directive.
Enables or disables the use of virtual DMA capabilities.
Determines whether the CPU's Virtual Mode Extensions (VME) should be turned off.
Configures VxD driver settings for Windows environments.
Sets system support parameters related to Windows operation.
Adjusts relocation settings for the Extended BIOS Data Area (XBDA).
Allows conditional execution based on XT-compatible hardware detection.
Enables built-in Year 2000 compliance support features.
Specifies the default character used for Yes responses in prompts.
Configures tracking mechanisms for file deletions.

Issues

The system is capable of booting even in the absence or corruption of CONFIG.SYS; however, this file, together with AUTOEXEC.BAT, plays a crucial role in customizing the complete boot process and meeting software prerequisites. Any damage to these files requires diagnostic measures.

In cases where CONFIG.SYS is missing a SHELL directive or is damaged or absent, DOS attempts to locate COMMAND.COM in the root directory. Versions prior to MS-DOS 6.0 will not boot without it. Conversely, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt the user to specify a command processor path, allowing limited shell substitution during runtime without needing a reboot.

Because MS-DOS 7.0 and newer COMMAND.COM versions are incompatible with DR-DOS, yet often found in the root of drive C: in dual-boot environments, DR-DOS 7.02 and beyond restrict skipping SHELL directives when using skip/trace/step modes (Ctrl+F5/F7/F8). Subsequent revisions introduced Ctrl+F6 to re-enable skip functionality for recovery from invalid shell parameters. If no SHELL directive is present during skipping, users receive a prompt to enter a shell path before COMMAND.COM loads; pressing ENTER defaults to the standard shell.

Under MS-DOS/PC DOS, CONFIG.SYS size is limited to a few kilobytes (up to 64 KB in later editions), whereas DR-DOS imposes no such restriction due to its distinct processing approach. MS-DOS compiles CONFIG.SYS into tokenized memory and organizes directives by category, while DR-DOS parses the file line-by-line, offering granular control over the loading sequence of drivers and TSRs through DEVICE and INSTALL commands. This method enables resolving conflicts during loading and tailoring initialization based on hardware conditions or errors. Furthermore, the INSTALL command permits execution of non-resident programs integrated within CONFIG.SYS.

For MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL directive is restricted to 31 characters; later versions expand this limit to 128 characters, while DR-DOS supports up to 255 characters. Notably, CONFIG.SYS commands do not support long filenames.

Dual booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS or Windows configuration, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality between Windows 9x and DOS. Upon booting into DOS mode, these files are temporarily reverted to their original filenames. The Windows 95 versions are backed up as CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, Windows’ CONFIG.SYS and AUTOEXEC.BAT remain untouched. Instead, DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT as its startup configurations.

OS/2 / Windows NT

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

Within the OS/2 subsystem on Windows NT, the CONFIG.SYS environment perceived by OS/2 applications is actually maintained within the system registry.

A variety of undocumented CONFIG.SYS directives exist specifically for OS/2.

CONFIG.SYS continues to be employed by OS/2 derivatives such as eComStation and ArcaOS.

See also

External links

  • Information on AUTOEXEC.BAT and CONFIG.SYS 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
  • Explanation of FreeDOS CONFIG.SYS directives (archived)
  • User Manual for PTS-DOS 2000 Pro including CONFIG.SYS directives (archived)
  • German-language unofficial PTS-DOS FAQ (archived) – comprehensive CONFIG.SYS directives guide