GOSUB (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | DOS version 2.0 |
| Products | Configuration directives for DOS and OS/2 boot process |
CONFIG.SYS serves as the central configuration file for DOS and OS/2 operating systems. This specialized ASCII text document includes setup instructions that the operating system's DOS BIOS (commonly found in IBMBIO.COM or IO.SYS) interprets during the boot sequence. The CONFIG.SYS file 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 is processed, DOS initiates the command interpreter specified on the SHELL line; if none is specified, it defaults to COMMAND.COM. Subsequently, the shell executes commands from AUTOEXEC.BAT.
CONFIG.SYS primarily contains name=value entries that either set configurable parameters or load essential components such as device drivers and TSR (Terminate and Stay Resident) programs into memory.
In DOS environments, CONFIG.SYS is located in the root directory of the system’s boot drive.
Certain DOS versions prioritize alternative configuration filenames over CONFIG.SYS:
Concurrent DOS 386/XM, Multiuser DOS, System Manager, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI, with configurations stored in CCONFIG.BIN. These files are managed through the CONFIG.EXE utility.
In DR DOS starting from version 3.31, including PalmDOS 1.0 and Novell DOS 7, DCONFIG.SYS takes precedence. This facilitates disk compression configurations and supports multi-boot setups by allowing multiple configuration files. Similarly, OpenDOS 7.01 and DR-OpenDOS 7.02 recognize ODCONFIG.SYS or DRCONFIG.SYS as alternatives.
From DR DOS 6.0 onwards, users can modify default system file extensions using SYS /DR:ext, enabling multiple sets of boot files to coexist and be selected via loaders such as LOADER from Multiuser DOS or DR-DOS 7.x. The SHELL directive also permits specifying different AUTOEXEC.BAT files or those with non-.BAT extensions—a capability shared with 4DOS. The CHAIN=filespec command allows continuation of processing another configuration file, optionally jumping to a specified label (available in DR-DOS 7.02+). Additionally, DR-DOS 7.03+ introduces SYS /A, which copies both CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Other systems employ distinct configuration filenames: FreeDOS uses FDCONFIG.SYS, RxDOS relies on RXCONFIG.SYS, and PTS-DOS uses CONFIG.PTS.
Windows 95 and Windows 98, which are built atop DOS, retain CONFIG.SYS and AUTOEXEC.BAT files on their boot drives but typically leave them empty. In contrast, Windows Me does not process CONFIG.SYS during startup; instead, it loads environment settings directly from the Windows Registry.
In the case of FlexOS, CONFIG.SYS is a binary-format file that specifies resource managers and device drivers loaded at system initialization.
Example
Sample CONFIG.SYS content 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 used as jump destinations for , , , and commands.
- Functions like , but additionally supports inline comments following other directives. (Note that in MS-DOS/PC DOS, inline comments enclosed in double quotes are not ignored.)
- Used to introduce inline comments alongside the ; directive.
- Presents a confirmation prompt (Yes/No) before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional processing with boot menus.) Starting with DOS 6.0, similar functionality is available by appending after directives; this is also supported by DR DOS.
- Causes unconditional execution of the following CONFIG.SYS command.
ATemplate:NbndC
- Determines whether programs can be terminated upon encountering errors.
- Sets which drives maintain file access timestamps in FAT file systems.
- Enables conditional command execution on AT-compatible hardware.
- Manages the boot loader functionality.
- Adjusts the verbosity level of error messages.
- Changes the default serial port driver for the AUX device (from COM1 through COM4).
- Prevents character devices from being accessible outside the phantom \DEV directory.
- Loads a fundamental device driver into system memory.
- Produces a beep sound even if audible alerts are turned off.
- Indicates the subsequent operating system to boot.
- Enables or disables extended Ctrl+C detection.
- Sets the quantity of disk buffers allocated.
- Similar to BUFFERS but allocates buffers within HMA or UMB regions.
- , ,
- Parameters for managing cache blocks.
- Loads programs specified in CONFIG.SYS, pausing further processing until completion.
- Sets the Caps Lock state on the keyboard.
- ,
- Names the CD-ROM hardware driver and specifies buffer counts.
- Continues processing CONFIG.SYS commands from a new file or label.
- , , and other display-related directives adjust system clock types and screen clearing behavior (specific to particular DOS versions).
- , , and related commands enable internationalization support and OEM codepage settings (mainly for OS/2 and certain DOS variants).
- , ...,
- Configure serial COM port properties including quantity, order, I/O addresses, and timeouts.
Additional commands handle device buffer management, CPU-dependent conditional execution (e.g., CPU386), keyboard status control, DMA buffer allocation, inline comment character definition, and boot menu color customization—essential for tailoring system operations across various DOS implementations and embedded platforms.
DTemplate:NbndF
- Controls relocation of drive descriptor tables in memory.
- Defines segment address limits for multi-sector disk data deblocking operations.
- Activates internal debugger support features.
- Configures boot manager settings.
- Loads device drivers into conventional memory.
- Loads device drivers into upper memory blocks (analogous to in DRDOS 5.0).
- Sets country and codepage parameters for keyboard, display, and printer devices.
- Specifies sizes for cache memory allocation.
- Determines floppy disk compatibility modes.
- Selects display font settings.
- Manages loading of DOS into high or upper memory areas (similar function to in DRDOS 5.0).
- Loads DOS-related tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
- Defines an alternative search path for locating DOS files.
- Specifies search paths for data files used by DOS.
- Sets physical parameters for disk drives.
- Defines configurations for unknown or unrecognized drives.
- Refer to .
- Enables PDUMP.nnn error logging and specifies target drive location.
- Outputs a message directly to the screen.
- Displays messages using ANSI escape sequences for enhanced formatting.
- Activates additional validation checks when launching programs.
- Assigns assumed error or return codes for subsequent operations.
- Determines A20 gate status when initiating programs.
- Terminates CONFIG.SYS processing before reaching the end of the file (with certain exceptions).
- Configures hash table size to optimize file opening speed (distinct from MS-DOS/PC DOS FASTOPEN driver).
- Sets the count of cached File Control Blocks that can be opened simultaneously (shares buffer space with FILES under DR-DOS).
- Functions like FCBS but loads these into upper memory areas.
- Boot manager configuration options.
- Defines maximum number of files that can be opened concurrently.
- Similar to FILES but loads file handles into upper memory segments.
- Executes specified subsections within CONFIG.SYS (see IGNORE).
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 a designated label.
- Continues nested CONFIG.SYS execution at a specified label, then returns to the previous point.
- Refer to , , or for further details.
- Consult for additional information.
- See for related commands.
- Refer to or for more context.
- See or for further explanation.
- Consult for relevant details.
- Loads a terminate-and-stay-resident (TSR) program into memory similarly to , but executes after DOS relocates its data segment. Compare with INSTCDEX.
- Refer to , , or for additional context.
- See .
- Enables enhanced console and command line history buffering with advanced pattern search capabilities.
- Defines the memory address of the High Memory Area (HMA) segment.
- Configures the energy-saving mode using HLT instructions.
- Determines whether the system should check for viruses on the boot sector.
- Loads installable file system drivers.
- Prevents execution of specified subsections within CONFIG.SYS. Also see .
- Permits designated programs to execute at CPU ring 2, granting direct hardware input/output access.
- Incorporates directives from an alternate menu block, emulated via GOSUB/RETURN commands under DR-DOS.
- Sets the status of the keyboard's Insert mode.
- Installs a TSR program into memory.
- Loads a TSR program into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
- Installs a TSR program post-DOS data segment relocation—compare with INSTCDEX.
- Adjusts PIC interrupt priorities to assign the highest priority level to a specific IRQ number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Specifies the address where the relocated keyboard buffer resides.
- Sets the maximum number of accessible drive letters.
- Functions like LASTDRIVE but additionally loads the Current Directory Structure into upper memory.
- Lists directories searched for Dynamic Link Libraries (DLLs).
- Controls compatibility handling for legacy applications.
- Determines the quantity of file locks permitted.
- Configures display settings for boot logos when using PTS-DOS boot manager.
- Specifies count, sequence, I/O port address, and timeout parameters for LPT1 printer device.
- Defines similar parameters (count, order, I/O address, timeout) for LPT2 device.
- Sets count, order, I/O port, and timeout values for LPT3 device configuration.
- Enables and configures LPT4 device with analogous settings.
- Establishes delay before process priority is elevated.
- Configures memory allocation policies and strategies.
- Specifies default DOS memory allocation behavior.
- Defines available menu options within CONFIG.SYS environment.
- Sets menu color schemes, which can be emulated under DR-DOS systems.
- Determines default menu block selection, also emulatable under DR-DOS.
- Establishes a menu block structure compatible with DR-DOS emulation.
- Activates multitrack disk operation support.
- Continues processing CONFIG.SYS commands in an external file after loading a device driver and setting %NEWFILE% environment variable.
NTemplate:NbndQ
- Sets the default character representing "No" in Yes/No/Resume prompts.
- Controls status of keyboard [[Num Lock|Template:Keypress]] key upon startup.
- Allows conditional execution based on previous error code values, such as .
- Displays a message and waits for user key input, similar to and commands in DR-DOS environments.
- Requires user confirmation when errors occur during CONFIG.SYS processing.
- Configures buffer sizes used by LPT ports for printing operations.
- Enables conditional command execution on PC-compatible hardware platforms.
- Sets process scheduling priority levels within DOS environment.
- Assigns priority levels specifically for disk input/output processes.
- ; Changes the default printer device driver assignment among LPT1 through LPT4 ports.
- ; Specifies whether DOS applications are permitted to run on the system.
- ; Loads user interface components during system initialization.
- ; Enables conditional execution exclusively on IBM PS/1-compatible machines.
- ; Enables conditional execution exclusively on IBM PS/2-compatible machines.
- ; Silences output directed 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 its use by local block device drivers.
- Defines the default character for Resume () prompts.
- Returns control from nested CONFIG.SYS processing to the previous point after GOSUB or SWITCH commands, optionally passing back a return code.
- Specifies the amount of real mode memory available.
- Enables simultaneous loading of programs in CONFIG.SYS in the background, functioning similarly to CALL or INSTALL commands in DOS.
- Saves the initial character of deleted files within the reserved FAT area.
- Determines video mode settings for FreeDOS or screen access methods for PTS-DOS.
- Manages the status of the keyboard’s Scroll Lock key.
- Sets environment variables for system use.
- Loads the command interpreter shell.
- Functions like SHELL but includes support for a SIZE parameter to pre-allocate COMMAND.COM within HMA or UMBs, minimizing fragmentation when using third-party shells.
- Specifies states for keyboard modifiers such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Controls whether files close upon pressing Ctrl+Alt+Del.
- Skips POST routines during system reboot.
- , STACKSIZE, STACKSHIGH
- Configure stack sizes and counts across different DOS versions with noted compatibility differences.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- PTS-DOS-specific commands managing boot configurations, system memory placement, and loading procedures.
- , SUPPRESSPOPUPS, SWAPPATH
- OS-specific features controlling submenu displays, error popup logging, and swap file directory paths.
- , SWITCHES, SWITCHAR
- Directives that govern conditional processing flow within nested CONFIG.SYS files and set default switch characters across various DOS variants.
- , THREADS, TIMESLICE
- Settings unique to OS/2 that address hardware fixes, concurrent threading capabilities, and scheduler time slices.
- , TRACE, TRACEBUF
- Manage prompt timeouts and enable single-step execution with configurable log buffer sizes across DR-DOS, PTS-DOS, FreeDOS, and OS/2 platforms.
- Additional PTS-DOS directives include TMPEXT (temporary file extensions), TRAPDUMP (error logging), among others focused on system management and fault handling.
UTemplate:NbndZ
- Assigns a specific memory segment for use as Upper Memory Block (UMB) space by DOS.
- Configures parameters for the UMB server functionality.
- Defines address ranges designated as UMB RAM areas.
- Toggles disk write verification on or off.
- Sets the DOS version number reported to applications.
- Adjusts VGA display operation status.
- Specifies the active video mode setting.
- Determines whether virtual DMA operations are permitted.
- Enables or disables CPU Virtual Mode Extensions support.
- Configures VxD driver options for Windows environments.
- Sets up Windows system support parameters.
- Manages relocation of the Extended BIOS Data Area (EBDA).
- Executes conditionally on XT-compatible hardware platforms.
- Enables built-in Year 2000 (Y2K) compliance features.
- Defines the default affirmative response character in prompts.
- Controls tracking of file deletions.
Issues
Although it is possible to boot without CONFIG.SYS or AUTOEXEC.BAT files present, these are critical for comprehensive DOS customization and fulfilling software dependencies. If these files are corrupted or missing, troubleshooting is necessary.
In cases where CONFIG.SYS does not contain a SHELL directive or if it is damaged or absent, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to DOS 6.0 will fail to boot without this file. However, later releases such as MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7+ will prompt users to specify the command interpreter path if it cannot be found. This prompt also appears when COMMAND.COM terminates unexpectedly or exits deliberately, allowing limited runtime replacement of the shell.
Because of incompatibilities between MS-DOS versions 7.0 and above COMMAND.COM and DR-DOS systems, DR-DOS versions 7.02+ enforce mandatory SHELL directives during skip/trace/step operations. This restriction prevents bypassing shell loading in dual-boot configurations. Certain key combinations provide recovery options from invalid shell arguments by requesting a valid shell filename before loading COMMAND.COM.
CONFIG.SYS file size limitations differ among operating systems: MS-DOS and PC DOS impose a maximum size limit (up to approximately 64 KB), whereas DR-DOS does not restrict size beyond file system constraints. MS-DOS processes CONFIG.SYS by tokenizing it into memory before executing directives sequentially—loading device drivers before TSRs. Conversely, DR-DOS interprets configuration lines individually at runtime, offering granular control over driver and TSR loading order using DEVICE and INSTALL commands. This approach facilitates conditional loading based on hardware detection, keypresses, error conditions, or return codes while supporting integration of temporary external utilities within CONFIG.SYS execution.
Earlier MS-DOS editions limited SHELL command line length to 31 characters. Later versions expanded this limit up to 128 characters, with DR-DOS accommodating 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 a pre-existing DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS, enabling a dual-boot setup between Windows 9x and DOS. During a DOS boot, these files are temporarily reverted to their original filenames. Meanwhile, backups of the Windows 95 versions are stored under the names CONFIG.W40 and AUTOEXEC.W40.
In scenarios where Caldera DR-DOS 7.02 or 7.03 is installed alongside Windows 95, the original CONFIG.SYS and AUTOEXEC.BAT files used by Windows remain untouched. Instead, DR-DOS utilizes its own startup files named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS to set up drivers and environment variables prior to loading its graphical user interface.
Within the OS/2 subsystem of Windows NT, the CONFIG.SYS file that OS/2 applications access is actually maintained within the system registry.
OS/2 includes numerous undocumented CONFIG.SYS commands, highlighting the complexity of its configuration requirements.
CONFIG.SYS continues to play a vital role in OS/2-based operating systems 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
- 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; DR-DOS 7 directives)
- FreeDOS CONFIG.SYS directive descriptions
- PTS-DOS 2000 Pro User Manual featuring CONFIG.SYS directives summary
- German-language unofficial PTS-DOS FAQ (PTS/FAQD) including CONFIG.SYS directives