| Title | [lDOS] Int 21h functions 5F07h and 5F08h assume a valid DPB is not at offset zero |
|---|---|
| Author | E. C. Masloch |
| Created | 2026-06-21 00:43:54 +0200 Jun Sun |
| State | open |
Refer to #1001 and https://github.com/LoopZ/TheList/blob/79f1774c/source/Interrupt%20List/INT%2021%20DOS%20Function%20Calls/INT%20215F07%20DOS%204%20ENABLE%20DRIVE.txt for descriptions of these functions. In particular:
in MS-DOS v4.01 and v5.00, the drive is checked to exist in the CDS array and it is checked that the DPB pointer's low word is not zero, see offset 45h in #01643. if these conditions are met, the offset 43h flag mask 4000h ("physical drive") is set, otherwise error 000Fh is returned.
The problem is that the DPB for the first drive, such as drive A:, will be found at offset zero of a memory block if it doesn't get relocated into the HMA. DPBs installed by a current DEVLOAD may also be installed with an offset of zero, causing the same problem: These function calls will reject CDS entries referring to such DPBs.
MS-DOS v5 installs DPBs into the same segment as the DOSDATA segment, behind the fixed size structures including List of Lists, System File Tables, Swappable Data Area, and the DOS stacks. (011Ch:1362h seen for drive A: DPB.) Therefore, this version of DOS by itself never creates a DPB addressed with offset zero. The bug still can be observed for DEVLOAD DPBs however.