Hubbry Logo
search
logo

CONFIG.SYS

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
CONFIG.SYS

CONFIG.SYS is the configuration file for the DOS and OS/2 operating systems that specifies startup options – options that cannot be changed after the system has booted. The data it contains is read by the system and used to configure many aspects including memory management, peripherals and applications. Each line can contain a name-value pair that is either a directive that sets the value of a system setting or with name "DEVICE" extends system capability by loading a file such as a device driver or a terminate-and-stay-resident (TSR) program. CONFIG.SYS was introduced with DOS 2.0.

As Windows technology diverged from DOS over time, use of CONFIG.SYS diminished. Both CONFIG.SYS and AUTOEXEC.BAT are in the root folder of the Windows 95 and Windows 98 boot drives, but typically, they are empty. Windows Me does not use a CONFIG.SYS file at all. Instead, it loads environment variables from the Windows Registry key: HKLM\System\CurrentControlSet\Control\SessionManager\Environment.

The file is maintained by a user in order to control the behavior of the system. As an ASCII text file, a user generally edits it via a text editor.

During boot, the DOS BIOS loads the file from the root directory of the drive from which the system boots. After processing the file, the system loads and executes the command shell specified in the SHELL line, or COMMAND.COM if there is no such line. The command shell in turn is responsible for processing the AUTOEXEC.BAT file.

Even though loading CONFIG.SYS is part of a normal bootup process, the system can boot if the file is missing or corrupt. A system probably requires troubleshooting if the file gets deleted or corrupted.

If CONFIG.SYS does not contain a SHELL directive (or the file is corrupt or missing), DOS typically searches for COMMAND.COM in the root directory of the boot drive. If this is not found, versions of DOS before 6.0 will not start up. MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and higher will instead display a prompt to enter the path and filename of a command processor. This recovery prompt is also displayed when the primary command processor is aborted due to faults or if it is exited deliberately. (In the case of COMMAND.COM, the internal EXIT command is disabled only when the shell was started with /P.) This also provides limited means to replace the shell at runtime without having to reboot the system. Since the MS-DOS 7.0 and higher COMMAND.COM executable is incompatible with DR-DOS, but typically resides in the root of drive C: in dual-boot scenarios with DR-DOS, DR-DOS 7.02 and higher no longer allow to bypass SHELL directives in (Ctrl+)F5/F7/F8 "skip"/"trace"/"step" modes. (Some later issues added (Ctrl+)F6 to reinvoke the former F5 "skip" behaviour in order to allow recovery from problems with invalid SHELL arguments as well.) Also, if no SHELL directive could be found when skipping CONFIG.SYS processing via (Ctrl+)F5 (and also with (Ctrl+)F7/F8, when the default file extension has been changed with SYS /DR:ext), the user is prompted to enter a valid shell file name before trying to load COMMAND.COM from the root. Pressing ↵ Enter without specifying a file will assume the former default.

Depending on the version, the size of the CONFIG.SYS file is limited to a few kilobytes under MS-DOS/PC DOS (up to 64 KB in most recent versions), whereas the file's size is unlimited under DR-DOS. This is because the former operating systems (since DOS 3.0) will compile the file into some tokenized in-memory representation before they sort and regroup the directives to be processed in a specific order (with device drivers always being loaded before TSRs), whereas DR-DOS interprets the file and executes most directives line-by-line, thereby giving full control over the load order of drivers and TSRs via DEVICE and INSTALL (for example to solve load order conflicts or to load a program debugger before a device driver to be debugged) and allowing to adapt the user interaction and change the flow through the file based on conditions like processor types installed, any type of keys pressed, load or input errors occurring, or return codes given by loaded software. This becomes particularly useful since INSTALL can also be used to run non-resident software under DR-DOS, so that temporary external programs can be integrated into the CONFIG.SYS control flow.

In MS-DOS/PC DOS 2.0 through 4.01, the length of the SHELL line was limited to 31 characters, whereas up to 128 characters are possible in later versions. DR-DOS even accepts up to 255 characters. CONFIG.SYS directives do not accept long filenames.

See all
User Avatar
No comments yet.