MS-DOS 6.22 Background Tasks System File

In MS-DOS 6.22, the system file that defines the initial execution search path and launches persistent background programs is AUTOEXEC.BAT, working in tandem with CONFIG.SYS for driver-level operations. Because MS-DOS is fundamentally a single-tasking operating system, background operations rely on Terminate-and-Stay-Resident (TSR) programs and system drivers. This article explains how AUTOEXEC.BAT defines the execution path, how background tasks function in DOS 6.22, and the role of related boot configuration files.

The Role of AUTOEXEC.BAT

AUTOEXEC.BAT is a dedicated batch file executed automatically by the command processor (COMMAND.COM) during the boot sequence. It controls the startup environment and is the definitive file for two major functions:

  1. Defining the Execution Path: The PATH command within AUTOEXEC.BAT sets the global search path (for example, PATH C:\DOS;C:\UTIL). This tells DOS where to look for executable binaries (.EXE, .COM, .BAT) when a command is issued from any directory.
  2. Launching Background Tasks: Standard background tasks in MS-DOS are loaded as TSR utilities. Programs such as PRINT.EXE (background print spooling), DOSKEY.COM (command-line recall), and SMARTDRV.EXE (disk caching) are declared and launched directly from AUTOEXEC.BAT.

The Complementary Role of CONFIG.SYS

While AUTOEXEC.BAT sets the application path and launches software-level TSRs, CONFIG.SYS is the initial configuration file processed by the DOS kernel (IO.SYS) before AUTOEXEC.BAT runs.

CONFIG.SYS is responsible for low-level background tasks implemented as system device drivers:

  • Device Drivers: Commands like DEVICE= or DEVICEHIGH= load persistent drivers into conventional or upper memory (such as HIMEM.SYS for extended memory management and EMM386.EXE for expanded memory).
  • Shell Path Configuration: The SHELL= command in CONFIG.SYS specifies the location and parameters of the primary command processor (typically SHELL=C:\DOS\COMMAND.COM C:\DOS /P), ensuring the environment is prepared before the path variable in AUTOEXEC.BAT is read.

Background Task Execution Mechanism

True preemptive multitasking does not exist natively in MS-DOS 6.22. When a background task is initialized through AUTOEXEC.BAT:

  • The executable hooks into specific hardware or software interrupts (such as the timer tick interrupt, INT 8h, or keyboard interrupt, INT 9h).
  • The utility executes the DOS INT 27h or INT 21h, Function 31h system call to terminate while leaving its code active in memory.
  • When system interrupts trigger, the TSR interrupts foreground execution momentarily, completes its background routine, and returns control to the active application.