MS-DOS 6.22 Unformatted Disk Access Explained
When MS-DOS 6.22 receives a storage access request targeting an unformatted disk volume, it attempts to read the volume's essential metadata, encounters physical or logical access failures through low-level system services, translates these hardware-level faults into internal DOS errors, and invokes the critical error handler to halt the operation or prompt the user.
1. The High-Level Request and Device Mapping
Any file operation (such as DIR, COPY, or
an application opening a file via DOS Interrupt 21h,
Function 3Dh) begins with MS-DOS evaluating the target
drive letter. The operating system maps the drive letter to an internal
Drive Parameter Block (DPB). The DPB contains the structural layout of
the FAT (File Allocation Table) volume. If the volume is unformatted, or
if removable media has been changed, the DPB is either uninitialized or
marked dirty, requiring MS-DOS to read the media before proceeding.
2. Reading Logical Sector 0
To build or validate the DPB, MS-DOS must inspect Logical Sector 0 of
the volume—the Volume Boot Record (VBR). The kernel calls the
responsible block device driver, which requests the sector through the
system BIOS via Interrupt 13h (Low-Level Disk Services),
typically Function 02h (Read Sectors).
At this stage, an unformatted volume creates one of two scenarios:
- Physically Unformatted Media (Raw Floppy or Uninitialized
Platter): The drive controller cannot locate sector address
marks or synchronization fields. The BIOS Interrupt
13hcall immediately fails, returning hardware error flags in the CPU'sAHregister, such as Error04h(Sector not found) or Error02h(Address mark not found). - Partitioned but Logically Unformatted Media (Raw Hard Disk Partition): The BIOS successfully reads the sector from the drive, but the sector does not contain a valid VBR.
3. BIOS Parameter Block (BPB) Validation
If the hardware read succeeds, MS-DOS 6.22 analyzes the 512-byte
buffer representing the sector. It specifically looks for the BIOS
Parameter Block (BPB), located starting at offset 0Bh of
the boot sector. The BPB contains critical volume geometry:
- Bytes per sector (must match standard increments, typically 512)
- Sectors per cluster
- Number of FAT copies
- Total sector count
- Media descriptor byte
On an unformatted volume, this area contains random data or all zeros. MS-DOS 6.22 evaluates these fields. If values are nonsensical (such as zero bytes per sector or zero sectors per cluster, which would cause divide-by-zero errors in cluster calculation routines), MS-DOS flags the volume as having an "Unknown Media Type."
4. Translation by the Block Device Driver
The MS-DOS block device driver inspects the result of the read attempt. It converts the raw BIOS status codes or the BPB validation failure into a standardized DOS driver status word:
- A hardware read failure sets bit 15 (Error) and error code
08h(Sector not found) or02h(Drive not ready). - An invalid BPB structure sets bit 15 and error code
07h(Unknown media type).
5. Invocation of the Critical Error Handler (INT 24h)
The DOS kernel receives the driver error and determines that the file
system cannot navigate the volume. It packages the error information
into registers (passing the error code in DI and drive
information in BP:SI) and triggers Interrupt
24h—the Critical Error Handler.
The default MS-DOS 6.22 command line handler translates this state into the standard error message:
General failure error reading drive X:
Abort, Retry, Fail?
6. Resolution
At this prompt, the system awaits user input:
- Abort (
A): MS-DOS terminates the executing program immediately, returning control to the command interpreter (COMMAND.COM) with a termination code. - Retry (
R): The system clears the error flags and re-executes the exact Interrupt13hread routine, which will fail again unless formatted media has been inserted. - Fail (
F): MS-DOS aborts the current system call without terminating the program, returning extended error code1Fh(ERROR_GEN_FAILURE) to the calling application via Interrupt21h.