MS-DOS 6.22 Execution Calls to Missing Drive Letters
This article examines how MS-DOS 6.22 handles system execution calls directed at non-existent or unmapped drive letters. It covers the internal validation mechanisms of DOS, the behavior of low-level execution interrupts such as INT 21h Function 4Bh, the specific return codes generated, and how the command interpreter presents these failures to the user.
Drive Letter Allocation and Structure Validation
MS-DOS 6.22 manages drive availability through an internal array of
structures known as the Current Directory Structure (CDS). The total
number of addressable drive letters is bounded by the
LASTDRIVE directive in CONFIG.SYS (defaulting
to the drive letter after the last physical/logical drive detected, or
drive E: if fewer are present).
When an execution request occurs, DOS evaluates the target drive letter through two primary criteria:
- Out-of-Bounds Drives: Drive letters that exceed the
configured
LASTDRIVElimit. - Unassigned In-Bounds Drives: Drive letters within
the
LASTDRIVErange that lack an associated Device Parameter Block (DPB), network redirector, or virtual drive assignment (such as viaSUBST).
Low-Level Execution Handling (INT 21h, Function 4Bh)
Program execution requests in MS-DOS are initiated via system call
INT 21h, Function 4Bh (EXEC). The calling
process passes an ASCIIZ string defining the program path and an
execution parameter block.
When the path string contains a drive letter (e.g.,
Z:\PROGRAM.EXE):
- Drive Parsing: DOS parses the path prefix to
identify the logical drive number (where
1 = A:,2 = B:,3 = C:, etc.). - Bounds Verification: If the drive number exceeds
the system's
LASTDRIVEceiling, DOS fails the operation immediately. The processor's Carry Flag (CF) is set to1to signify an error, and registerAXreturns error code0Fh(Invalid drive). - CDS Inspection: If the drive is within
LASTDRIVElimits but lacks a mapped physical or logical device, the drive’s entry in the CDS has its attributes checked. If the entry is marked invalid/inactive, the call halts immediately without dispatching any hardware-level commands. - Return Code: In this case, DOS clears the hardware
access pipeline, sets the Carry Flag (
CF = 1), and loadsAXwith either error code0Fh(Invalid drive) or03h(Path not found), depending on the specific execution sub-path and parser stage.
Critical Error Handler (INT 24h) Bypassing
Unlike scenarios involving a valid drive with missing media (such as
an empty floppy drive, which triggers an INT 24h Critical
Error like "Abort, Retry, Fail?"), execution attempts on missing or
unmapped drive letters completely bypass INT 24h.
Because no device driver header is linked to the requested drive letter, there is no underlying hardware device to query or fail on. MS-DOS treats the request purely as a logical path failure and returns control directly to the parent process via software error flags.
User Interface and Shell Response (COMMAND.COM)
When an execution call is invoked directly from the standard MS-DOS
6.22 shell (COMMAND.COM) via the command line or a batch
file, the shell evaluates the path before invoking
INT 21h, AH=4Bh.
- Missing Target Drive: If a user specifies an
execution path targeting a missing drive,
COMMAND.COMintercepts the invalid drive designator during path normalization. It outputs the standard diagnostic message:Invalid drive specification - Execution Failure: If a script or wrapper attempts
the execution directly, the return code is stored in the system's exit
status (
ERRORLEVEL), allowing batch processes to detect that the target binary failed to launch due to an invalid path.