Jump to content

CACHEFLUSH (CONFIG.SYS directive)

From Alfawiki
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
Headquarters
N/A
ProductsConfiguration file for DOS and OS/2 operating systems

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text ASCII file holds setup instructions that the operating system's DOS BIOS—usually 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 manage devices, applications, and memory managers. Once CONFIG.SYS is processed, DOS launches the command shell designated by the SHELL directive; if none is specified, it defaults to COMMAND.COM, which subsequently executes the AUTOEXEC.BAT script.

This file primarily contains name=value pairs that adjust configuration parameters or load 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 produced by East-German manufacturer VEB Robotron.

Certain DOS versions check for alternative filenames that take precedence over CONFIG.SYS:

- Advanced releases of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) instead of CONFIG.SYS. These platforms support extended configuration options stored in binary files like CCONFIG.BIN, which are usually edited via CONFIG.EXE.

- In DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and later, DCONFIG.SYS supersedes CONFIG.SYS. Originally introduced alongside disk compression utilities to handle drive letter reassignment, it also enables multi-boot setups.

- OpenDOS 7.01 and DR-OpenDOS 7.02 look for ODCONFIG.SYS, while some DR-DOS editions check for DRCONFIG.SYS.

- From DR DOS 6.0 onward, it is possible to alter default system file extensions using SYS /DR:ext, allowing multiple independent system file sets selectable through boot loaders such as LOADER in Multiuser DOS and DR-DOS 7.x.

- The SHELL command has been enhanced to specify alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM supporting extensions beyond .BAT; this functionality is also available in 4DOS.

- Starting with DR-DOS 6.0+, the CHAIN=filespec directive enables continued processing of an additional configuration file, with the option in DR-DOS 7.02+ to jump to a particular label via CHAIN=filespec,label.

- DR-DOS 7.03 and later introduce a SYS /A option that copies CONFIG.SYS and AUTOEXEC.BAT alongside system files during setup.

Other DOS derivatives offer comparable features: FreeDOS uses FDCONFIG.SYS, RxDOS employs RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.

In Windows 95 and Windows 98 environments, both CONFIG.SYS and AUTOEXEC.BAT remain present on boot drives but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it retrieves environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

On the FlexOS platform, CONFIG.SYS is a binary configuration file specifying resource managers and device drivers that load during system initialization.

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>

:;*?!

Marks labels within CONFIG.SYS as targets for , , , , and .
Functions similarly to , used for inline commentary. (MS-DOS/PC DOS handles inline comments differently, requiring quotes.)
Used at the start of inline comments along with ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS allows optional conditions via boot menus.) DOS 6.0 and later provide a comparable feature by appending after directives.
Forces unconditional execution of the next command.

ATemplate:NbndC

Determines whether programs can be aborted upon encountering errors.
Specifies which drives record file access timestamps in FAT file systems.
Enables conditional execution on AT-compatible hardware.
Acts as a boot manager.
Adjusts the verbosity level of error messages.
Changes the default serial driver assigned to the AUX device.
Prevents access to character devices outside the phantom \DEV directory.
Loads a base device driver into memory.
Forces an audible beep even if notifications are disabled.
Sets the operating system to boot next.
Enables or disables Ctrl-C checking.
Defines the number of disk buffers.
Explicitly loads buffers into HMA or UMB memory areas.
, , (Embedded DOS 6-XL)
Configures cache block sizes and flush intervals.
Runs programs specified in CONFIG.SYS in the foreground, pausing further processing until completion.
Sets Caps Lock state during startup.
, (PTS-DOS only)
Specifies CD-ROM driver name and buffer allocations.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS from another file or label.
, , and other PTS-DOS specific commands control system features such as screen clearing and clock type.
(OS/2 only)
Defines OEM codepages for internationalization support.
, ..., (DR-DOS 7.02+)
Configures COM port quantity, sequence, I/O addresses, and timeouts.
, also known as COMMENTS (DOS 4.0+ and others)
Redefines lead characters for inline comments or causes following lines to be ignored under certain OS versions.
, (DOS 3.0+, DR DOS 3.31+, OS/2)
Enables and sets parameters for international language support.

Additional CPU-specific conditional commands are mainly found in PTS-DOS and DR-DOS variants, allowing execution based on CPU model and features (e.g., CPU386, CPU486+).

DTemplate:NbndF

Adjusts relocation of drive descriptor tables.
Defines memory segment address for multi-sector disk data deblocking operations.
Activates internal debugger support.
Functions as a boot manager.
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.
Configures cache memory sizes.
Specifies compatibility mode for floppy disks.
Chooses display font type.
Controls loading of DOS into high or upper memory areas (similar to in DRDOS 5.0).
Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory segments.
Specifies an alternate path for DOS system files.
Defines search paths for data files.
Sets physical characteristics of disk drives.
Establishes parameters for unknown drives.
See .
Enables drive support for PDUMP.nnn error log files.
Outputs a message on the screen.
Displays messages including ANSI escape sequences.
; Specifies additional verification steps when launching programs.
; Defines expected error or return codes.
; Sets A20 line gate state upon program start.
; Terminates CONFIG.SYS processing early except for SWITCHES and SHELL directives.
; Determines hash table size to speed up file opening operations (distinct from MS-DOS FASTOPEN driver).
; Number of cached File Control Blocks (FCBs) allowed simultaneously (shares buffer with FILES in DR-DOS).
; Same as FCBS but loads FCBs into upper memory blocks.
; Boot manager function.
; Maximum number of files that can be opened concurrently.
; Same as FILES but loads file handles into upper memory blocks.
; Executes specified CONFIG.SYS subsections (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 CONFIG.SYS processing at a designated label.
Continues nested CONFIG.SYS execution at a specified label, then returns to the previous point.
Refer to , , or for related information.
See additional details at .
Refer to .
Consult or for further context.
See or for more information.
Refer to .
Loads a TSR program into memory similarly to , but after relocating the DOS data segment. Compare with INSTCDEX.
See references , , or .
Refer to .
Consult or for details.
Activates console and command line history with enhanced pattern searching capabilities.
Defines the address of the High Memory Area (HMA) segment.
Sets up HLT mode for energy conservation.
Determines whether boot sector virus scanning is enabled.
Loads installable file system drivers.
Prevents execution of particular CONFIG.SYS subsections.
Permits designated programs to operate at ring 2, granting direct hardware I/O access.
Incorporates directives from another menu block (can be emulated via GOSUB/RETURN in 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 after relocating the DOS data segment. Compare with INSTCDEX.
Adjusts PIC interrupt priorities, assigning highest priority to a specified IRQ number.

KTemplate:NbndM

Defines keyboard layout configuration.
Specifies the relocated address of the keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads the Current Directory Structure (CDS) into upper memory.
Lists search paths for DLL files.
Controls legacy program support handling.
Sets the quantity of file locks allowed.
Manages boot logo and startup messages using PTS-DOS boot manager.
Configures count, order, I/O address, and timeout parameters for LPT1 device.
Applies similar settings as LPT1 for LPT2 device.
Same configuration as LPT1 applied to LPT3 device.
Enables and configures LPT4 device in a similar manner.
Defines wait duration before increasing process priority.
Specifies strategy for memory allocation management.
Sets default DOS memory allocation method.
Defines menu option entries.
Specifies color schemes for menus (emulatable under DR-DOS).
Sets default menu block (emulatable under DR-DOS).
Defines multiple menu blocks (emulatable under DR-DOS).
Enables operations involving multitrack disks.
Continues CONFIG.SYS processing within a new file after loading a driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Specifies default No () character used in Yes/No/Resume prompts.
Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
Executes commands conditionally based on last return code or error status, e.g., .
Functions like and , displaying text and waiting for key input.
Requires user confirmation for errors occurring in CONFIG.SYS processing.
Configures buffer sizes for LPT1, LPT2, and LPT3 devices.
Executes conditionally on PC-compatible machines only.
Configures scheduler priorities for processes.
Adjusts priority settings specifically for disk I/O programs.
Changes default printer device driver among LPT1 through LPT4 ports.
Specifies whether DOS applications are permitted to run.
Loads user interface components.
Conditional execution limited to IBM PS/1-compatible systems.
Conditional execution limited to IBM PS/2-compatible systems.
Suppresses output sent to STDOUT.

RTemplate:NbndT

Enables automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Allocates a drive letter for local block device drivers.
Sets the default Resume () response character in Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally with a return code.
Defines the amount of real mode memory available.
Allows simultaneous loading of programs in CONFIG.SYS in the background.
Saves the initial character of deleted files within the FAT reserved area.
Determines video mode settings for FreeDOS or screen access methods under PTS-DOS.
Configures the Scroll Lock keyboard status as enabled or disabled.
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM in 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.
Controls whether files are closed when Ctrl+Alt+Del is pressed.
Indicates if POST should be bypassed during reboot.
, STACKSIZE, STACKSHIGH
Configure interrupt stack sizes and buffer locations across multiple DOS versions and embedded platforms to optimize system stability and performance.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS commands that manage boot options, system memory allocation, and loading procedures to improve boot speed and resource management.
, SUPPRESSPOPUPS, SWAPPATH
Directives specific to certain operating systems that regulate user interface popups, error log storage paths, and swap file locations for enhanced system optimization and error handling.
, SWITCHES, SWITCHAR
Facilitate conditional processing within CONFIG.SYS by defining customizable switch characters ('/' or '-') to increase script adaptability across DOS variants.
, THREADS, TIMESLICE
OS/2 parameters addressing hardware floating-point unit bugs, controlling concurrent thread numbers, and adjusting scheduler time slices to boost multitasking capabilities.
, TMPEXT
Manages timeout durations for CONFIG.SYS commands and temporary file extensions under DR-DOS and PTS-DOS for operational control.
, TRACEBUF, TRAPDUMP
Activate advanced debugging options in CONFIG.SYS handling and error logging on DR-DOS, PTS-DOS, and OS/2 to assist with diagnostics and troubleshooting.

UTemplate:NbndZ

Configures DOS to designate a specific memory segment as an Upper Memory Block (UMB).
Sets the UMB server parameters.
Defines address ranges to be treated as UMB RAM.
Enables or disables verification of disk write operations.
Specifies the DOS version number reported to applications.
Sets VGA display status parameters.
Defines the current video mode similarly to FreeDOS's SCREEN command.
Enables support for virtual DMA operations.
Controls processor features related to Virtual Mode Extensions (VME).
Configures Virtual Device Drivers (VxD) for Windows environments.
Manages system-level support settings for Windows integration.
Handles relocation procedures for the Extended BIOS Data Area (XBDA).
Allows conditional execution on XT-compatible machines only.
Configures built-in Year 2000 compliance support features.
Sets default affirmative response characters in prompts.
Tracks driver deletions.

Challenges

Although the system can initiate without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are crucial for comprehensive operating system customization and meeting software dependencies. Any damage or corruption to these files necessitates diagnostic efforts.

In cases where CONFIG.SYS is missing a SHELL statement or is absent/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 will fail to boot if COMMAND.COM is not found, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later will prompt users to specify the command processor’s location. This recovery prompt also appears if the main command processor terminates unexpectedly or exits intentionally, providing a limited opportunity to replace the shell at runtime without rebooting.

COMMAND.COM from MS-DOS 7.0 and newer is incompatible with DR-DOS, which commonly resides in the root of drive C: on dual-boot systems. Starting with DR-DOS 7.02, bypassing SHELL directives during skip/trace/step modes (triggered by Ctrl+F5/F7/F8) is no longer permitted. Subsequent releases introduced Ctrl+F6 to reinstate skip mode behavior, facilitating recovery from invalid SHELL parameters. If no valid SHELL is detected during skip mode, users are prompted to input a correct shell filename before COMMAND.COM loads.

CONFIG.SYS file size limitations differ depending on the version: MS-DOS and PC DOS constrain file size to a few kilobytes (recently up to 64 KB), whereas DR-DOS imposes no practical limit due to its line-by-line parsing method instead of tokenized compilation. This design grants precise control over the sequence in which drivers and TSRs load via DEVICE and INSTALL commands, enabling sophisticated conflict management and debugging techniques. Additionally, INSTALL supports loading non-resident programs, allowing temporary utilities to be incorporated into CONFIG.SYS processing.

The maximum length for the SHELL command line has increased over time—from 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01—to as many as 128 characters in later editions; DR-DOS supports up to 255 characters. It is important to note that CONFIG.SYS directives do not accommodate long filenames.

Dual Booting DOS with Windows 9x

When Windows 95 is installed atop an existing DOS or Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed CONFIG.DOS and AUTOEXEC.DOS to enable dual-boot functionality. When booting into DOS mode, these files are temporarily restored under their standard names. Backup copies of Windows 95’s configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, Windows’ CONFIG.SYS and AUTOEXEC.BAT remain unaltered. Instead, DR-DOS uses DCONFIG.SYS and AUTODOS7.BAT for its startup routines.

OS/2 and Windows NT

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

Within the OS/2 subsystem embedded in Windows NT, what OS/2 applications recognize as CONFIG.SYS is actually maintained within the Windows registry.

A variety of undocumented CONFIG.SYS commands exist in OS/2 environments.

CONFIG.SYS continues to play a vital role in OS/2 derivatives such as eComStation and ArcaOS.

See also

External links

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