Jump to content

HILASTDRIVE (CONFIG.SYS directive)

From Alfawiki
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
Headquarters
N/A
ProductsConfiguration commands for DOS BIOS

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text ASCII file holds configuration commands 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 tailor DOS settings for hardware devices, software applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL directive or defaults to COMMAND.COM, which subsequently executes AUTOEXEC.BAT.

Primarily, the file contains name=value pairs that establish configuration parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs). This file is located in the root directory of the system’s boot partition.

Certain DOS variants look for alternative configuration filenames. For instance, advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 search for CCONFIG.SYS or CCONFIG.INI instead of CONFIG.SYS. These support extra settings stored in binary files like CCONFIG.BIN, which can be modified using CONFIG.EXE.

In DR DOS versions 3.31 and later, DCONFIG.SYS supersedes CONFIG.SYS to facilitate disk compression and multi-boot configurations. Other variants such as OpenDOS 7.01 also check for files named ODCONFIG.SYS or DRCONFIG.SYS. From DR-DOS 6.0 onward, it is possible to alter default file extensions through SYS /DR:ext, allowing multiple sets of system files to coexist and be managed by boot loaders like LOADER.

Enhanced features include SHELL options to specify alternative AUTOEXEC.BAT files, as well as the CHAIN=filespec directive that enables continuation of configuration processing with files located outside the root directory. Starting with DR-DOS 7.02, jumping to specific labels within chained files is supported, while version 7.03 introduced a SYS /A option to copy both CONFIG.SYS and AUTOEXEC.BAT alongside system files.

Other DOS implementations use different configuration filenames: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS, and CONFIG.PTS in PTS-DOS.

In Windows 95 and 98 (which are DOS-based), CONFIG.SYS and AUTOEXEC.BAT remain present but are usually left empty. Windows Me does not process CONFIG.SYS during startup; instead, environment variables are loaded from the Windows Registry.

For FlexOS, CONFIG.SYS is a binary format file that specifies resource managers and device drivers loaded during 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 that serve as jump destinations for , , , , and commands.
Functions similarly to , also used to insert inline comments after directives. (MS-DOS/PC DOS treats inline comments differently when enclosed in quotes.)
Used at the start of inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS extends this with optional conditions via boot menus.) DOS 6.0+ offers a comparable feature by appending after directives.
Executes the following CONFIG.SYS command without any condition.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Controls the storage of file access timestamps on drives using FAT file systems.
Enables conditional command execution on AT-compatible hardware.
Manages boot loading processes.
Adjusts the level of detail for error messages.
Alters the default serial driver assigned to the AUX device.
Prevents character devices from being accessible outside the \DEV directory.
Loads a fundamental device driver into system memory.
Produces an audible beep even if alerts are turned off.
Specifies which operating system to boot next.
Enables or disables extended Ctrl-C interrupt checking.
Sets the quantity of disk buffers to allocate.
Loads disk buffers into either HMA or UMB memory regions.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Adjust cache block allocation and timing parameters.
Executes programs during CONFIG.SYS processing, pausing until completion.
Sets the keyboard Caps Lock state on or off.
, CDDBUFFERS (PTS-DOS only)
Defines CD-ROM driver name and buffer quantity.
Continues processing CONFIG.SYS from a new file or label location.
, CLS, CODEPAGE (various OS-specific)
Configures system clock, clears display screen, and sets OEM codepage parameters.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Specifies serial port count, order, I/O addresses, and timeout settings.
, COMMENT(S), COUNTRY (various OS versions)
Defines DMA buffer sizes, inline comment characters, and internationalization options.
, CPSW (MS-DOS specific), CPU directives (PTS-DOS only)
Controls cursor positioning, codepage switching, and CPU-specific conditional commands.

This set of CONFIG.SYS directives exemplifies their function in enhancing system performance and resource allocation across various DOS platforms, facilitating effective device management and boot configuration vital for legacy enterprise systems.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Defines memory segment address used for multi-sector disk data deblocking operations.
Activates built-in debugger functionality.
Boot manager configuration.
Loads device drivers into conventional memory.
Loads device drivers into upper memory blocks (referred to as in DRDOS 5.0).
Sets country and codepage parameters for keyboard, screen, and printer devices.
Configures sizes for cache memory allocation.
Determines floppy disk compatibility mode settings.
Specifies display font selection.
Manages loading of DOS into high memory and/or usage of upper memory areas.
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory space.
Defines an alternative directory path for DOS system files.
Specifies search paths for data files.
Establishes physical disk drive parameters.
Sets parameters for undefined or unknown drives.
See .
Enables specifying drives for PDUMP.nnn error log files.
Displays messages on-screen during processing.
Allows message display with ANSI escape sequences included.
Adds extra checks when starting programs.
Assigns assumed error or return codes for following commands.
; Sets A20 gate state upon program launch.
; Terminates CONFIG.SYS processing early except for certain SWITCHES and SHELL directives.
; Defines hash table size to optimize file open speed, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
; Sets number of cached File Control Blocks (FCBs) allowed open simultaneously; shares buffer with FILES under DR-DOS systems.
; Similar to FCBS but explicitly loads FCBs into upper memory areas.
; Boot manager parameter setting.
; Specifies maximum number of files that can be opened concurrently.
; Similar to FILES but explicitly loads file handles into upper memory space.
; Includes execution of specified CONFIG.SYS subsections (refer to IGNORE).

GTemplate:NbndI

Waits for a key press or timeout, then assigns 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 additional information.
See also .
Consult .
Refer to or for details.
Refer to or as needed.
Consult .
Loads a TSR program into memory similarly to , but after relocating the DOS data segment. Compare with INSTCDEX.
See , , or for further context.
Consult .
Refer to or for more details.
Activates console and command line history buffer with advanced pattern matching capabilities.
Defines the HMA segment address.
Configures the HLT power-saving mode.
Determines whether the system performs boot sector virus checks.
Loads installable file systems into memory.
Prevents execution of certain CONFIG.SYS subsections.
Permits designated programs to operate at ring 2, enabling direct hardware I/O access.
Incorporates directives from another menu block (can be emulated using GOSUB/RETURN in DR-DOS).
Sets the status of the keyboard Insert mode.
Installs a TSR program into memory.
Loads TSR programs into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocating the DOS data segment (compare with INSTCDEX).
Adjusts PIC interrupt priorities to assign highest priority to a specified IRQ.

KTemplate:NbndM

Defines keyboard layout settings.
Specifies address for relocated keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory.
Lists search paths for DLL files.
Manages compatibility settings for legacy software.
Specifies the number of file locks allowed.
Configures boot logo display when using PTS-DOS boot manager.
Defines count, sequence, I/O address, and timeout parameters for LPT1 device.
Configures LPT2 device with similar parameters.
Applies similar configuration to LPT3 device.
Enables and sets up LPT4 device operation.
Sets delay before increasing process priority level.
Configures memory allocation methods.
Determines default DOS memory allocation strategy.
Defines options available in menus.
Specifies menu color schemes (emulatable under DR-DOS).
Sets default menu block (emulatable under DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Enables or disables multitrack disk functionality.
Continues processing CONFIG.SYS from a new file, optionally loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default No () character response 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 similarly to and , displaying text and awaiting key press input.
Specifies whether user confirmation is required for errors encountered in CONFIG.SYS processing.
Configures buffer sizes for LPT1, LPT2, and LPT3 devices.
Conditional execution restricted to PC-compatible hardware only.
Configures scheduler priority settings.
Adjusts priority for programs performing disk I/O operations.
Changes internal default printer driver (e.g., switching from LPT1 to LPT3 or LPT4).
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 display.

RTemplate:NbndT

Determines whether the system should automatically restart upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Designates a drive letter to be excluded from local block device driver usage.
Sets the default Resume () response character in Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH directive location, optionally providing a return code.
Specifies the amount of real mode memory available.
Functions like CALL but initiates programs in CONFIG.SYS asynchronously in the background.
Indicates whether the first character of deleted filenames is preserved in the FAT reserved area.
Defines video mode settings under FreeDOS or screen access methods under PTS-DOS.
Sets the Scroll Lock key status on the keyboard as either enabled or disabled.
Establishes environment variables.
Loads the command interpreter shell.
Similar to SHELL but supports a SIZE parameter for pre-allocating COMMAND.COM into HMA or UMBs to prevent fragmentation.
Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines if files are closed when Ctrl+Alt+Del is pressed.
Controls whether POST is bypassed during system reboot.
Acts as a compatibility placeholder due to differing stack layouts in earlier DR DOS releases.
Defines the number of stacks allocated for hardware interrupts.
Sets the default stack size assigned to new threads.
Similar to STACKS but explicitly loads buffers into upper memory areas.
Configures boot manager settings.
Directive intended for internal use only.
Manages behavior of the XMS A20 gate.
Defines a submenu block, emulatable in DR-DOS environments.
(OS/2 3.0+)
Redirects error logging to a drive instead of displaying popup dialogs.
(OS/2)
Specifies the location path for the swap file.
(DR DOS 6.0+)
Allows conditional continuation of nested CONFIG.SYS processing at specified labels based on key input, with RETURN resuming prior execution points.
(Various DOS versions)
Sets the default switch character, either '/' or '-'.
(DOS 4.0, Novell DOS 7+)
Defines special options that are disregarded under PTS-DOS.
(OS/2 Warp 4 FixPak 1+)
Enables a fix addressing an FPU rounding error.
(PTS-DOS)
Specifies an alternative filename for DOS OS during booting.
(PTS-DOS)
Configures memory locations where DOS components reside.
(PTS-DOS)
Loads system components from an alternate disk area.
(Embedded DOS 6-XL)
Determines size of the dynamic system memory pool allocation.
(PTS-DOS)
Loads DOS data and code into UMBs when specified.
(OS/2)
Sets the number of concurrent threads allowed.
(DR DOS 6.0+, PTS-DOS)
Adjusts timeouts for CONFIG.SYS single-stepping and sets default answers for prompts such as Yes/No and SWITCH selections.
(OS/2)
Configures minimum and maximum scheduler time slices for thread execution.
(PTS-DOS)
Defines file extension used for temporary files.
(DR-DOS 7.02+, PTS-DOS, OS/2)
Enables or disables single-step execution of CONFIG.SYS and AUTOEXEC.BAT globally or locally, with behavior varying between OS/2 and DOS systems.
(OS/2)
Sets size of TRACE log buffer for diagnostic purposes.
(OS/2 3.0+)
Logs comprehensive error information to assist diagnostics.

UTemplate:NbndZ

Assigns a specific memory segment to be treated as an Upper Memory Block (UMB).
Configures the UMB server component.
Defines address ranges allocated for UMB RAM usage.
Enables or disables verification of disk writes.
Specifies which DOS version is reported to applications and utilities.
Controls VGA display status settings.
Sets the active video mode, similar to SCREEN functionality in FreeDOS.
Permits utilization of virtual DMA capabilities.
Enables or disables processor Virtual Mode Extensions support.
Configures support for VxD drivers used by Windows operating systems.
Manages Windows system integration features.
Adjusts relocation parameters for the Extended BIOS Data Area (EBDA).
Executes conditionally on XT-class compatible machines only.
Activates built-in Year 2000 compliance features.
Defines the default character used for affirmative responses in prompts.
Handles tracking of file deletions within the system.

Issues

Although the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these files are crucial for complete operating system customization and meeting software prerequisites. Troubleshooting becomes necessary if these files are missing or corrupted.

In the absence of a SHELL directive within CONFIG.SYS, or if the file itself is damaged or unavailable, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to DOS 6.0 will fail to boot if COMMAND.COM cannot be found. However, MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions prompt users to specify the location of the command interpreter when it is missing, offering recovery options without requiring a reboot.

Due to compatibility issues between MS-DOS 7.0+ COMMAND.COM and DR-DOS, DR-DOS versions 7.02 and above enforce the presence of SHELL directives during skip and trace modes, thereby preventing users from bypassing them during troubleshooting. If no valid shell is detected while processing skip commands, users are asked to provide one before COMMAND.COM is loaded.

CONFIG.SYS file size limitations differ among systems: MS-DOS and PC DOS impose a maximum size (commonly up to 64 KB), whereas DR-DOS permits an unrestricted file size limited only by the underlying file system. MS-DOS processes CONFIG.SYS by compiling it into a tokenized structure in memory that loads device drivers first followed by TSR programs. In contrast, DR-DOS reads CONFIG.SYS directives sequentially, allowing detailed control over loading order and conditional execution based on factors such as CPU type or error conditions.

This sequential parsing in DR-DOS enables the use of temporary external utilities through the INSTALL directive, enhancing flexibility in managing drivers and resident programs.

Limits on the length of SHELL command lines also vary: MS-DOS/PC DOS versions 2.0 through 4.01 restrict this to 31 characters; later releases extend this limit to 128 characters; DR-DOS supports up to 255 characters. It is important to note 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 installation, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed CONFIG.DOS and AUTOEXEC.DOS respectively, facilitating dual-boot capability between Windows 9x and DOS environments. During a DOS boot session, these files are temporarily restored to their original names. Meanwhile, backups of the Windows 95 configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.

In systems where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, Windows retains its CONFIG.SYS and AUTOEXEC.BAT unchanged. Instead, DR-DOS uses separate startup files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 / Windows NT

OS/2 relies heavily on CONFIG.SYS for setting up device drivers and environment parameters before launching its graphical user interface.

Within the OS/2 subsystem included in Windows NT, configuration data traditionally held in CONFIG.SYS is instead maintained within the system registry.

A variety of undocumented CONFIG.SYS commands exist in OS/2, reflecting its sophisticated configuration requirements.

CONFIG.SYS continues to play a vital role in OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details | Computer Hope | 2017-12-29 | [1]
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS directives | Microsoft Support | [2]
  • Reference for CONFIG.SYS commands | Caldera (company) | 1998 | [3] (DR-DOS 7 directives)
  • FreeDOS CONFIG.SYS directive documentation | [4]
  • PTS-DOS 2000 Pro manual including CONFIG.SYS commands | [5]
  • Unofficial German PTS-DOS FAQ (PTS/FAQD) as of April 25, 2004 with additional CONFIG.SYS information | [6]