MS-DOS 6.22 Drive Mapping Using JOIN

The JOIN command in MS-DOS 6.22 enables dynamic drive mapping by linking a separate disk drive to an empty directory on another drive, effectively presenting the guest drive as a subdirectory within the host file system. This article examines the mechanics of the JOIN utility, detailing its command syntax, internal kernel operations via the Current Directory Structure, critical execution requirements, and system restrictions imposed to preserve file system integrity.

Purpose and Basic Syntax

The JOIN command is an external DOS utility that merges the directory tree of a physical or logical drive into an empty directory on a specified target drive. Once joined, users and applications can access all files and directories on the guest drive via the host drive's path, bypassing the need to reference the guest drive letter directly.

The standard syntax is structured as follows:

  • Map a drive: JOIN [drive1:] [drive2:\path]
    • drive1: specifies the guest drive to be mapped (e.g., D:).
    • drive2:\path specifies the host drive and the empty directory where the guest drive will appear (e.g., C:\DRIVED).
  • Remove a mapping: JOIN drive1: /D
  • View active mappings: Running JOIN without parameters displays all current assignments.

Internal Kernel Management and the CDS

MS-DOS 6.22 manages dynamic drive mapping at the operating system level through an internal array known as the Current Directory Structure (CDS). The system allocates one CDS entry for each supported drive letter up to the limit defined by the LASTDRIVE directive in CONFIG.SYS.

When JOIN is invoked:

  1. Validation: The DOS kernel verifies that the target directory exists and contains no files or subdirectories other than the standard . and .. entries.
  2. Flag Modification: The kernel modifies the internal flags inside the CDS entry corresponding to drive1:. The drive status flag is updated to denote a "joined" state (specifically marking bit 0x2000 in the CDS structure).
  3. Redirection Routing: The CDS stores a redirection pointer linking the root of drive1: to the fully qualified path of drive2:\path.
  4. Path Resolution via INT 21h: Subsequent file access requests through Interrupt 21h are parsed against the CDS. When DOS encounters access directed to the host path, it resolves the file operations against the underlying File Allocation Table (FAT) and physical sector layout of the joined drive, effectively masking its original root directory.

Requirements and Limitations

To avoid directory tree recursion and file system corruption, MS-DOS 6.22 enforces strict constraints on the JOIN command:

  • Empty Directory Requirement: The target directory must be newly created and completely empty before running the command.
  • Active Drive Restrictions: You cannot join the current active drive, nor can you join a network redirector drive.
  • Prohibited Utilities: To prevent catastrophic FAT desynchronization, MS-DOS disallows critical disk and maintenance commands from running on joined drives. Utilities including CHKDSK, FORMAT, DISKCOPY, DISKCOMP, FDISK, RESTORE, and SYS will abort execution if a joined drive is detected.

Availability in MS-DOS 6.22

While the MS-DOS 6.22 kernel retains full native support for joined CDS entries, JOIN.EXE was removed from the default installation floppies due to software conflicts with the Windows 3.1x 32-bit file access system and caching tools like SMARTDRV. In MS-DOS 6.22, the utility is provided on the official Microsoft MS-DOS 6.22 Supplemental Disk to support legacy environments that require directory-based disk grafting.