Skip to content
FreeDOSDeep Dive Published Updated 6 min readViews unavailable

MSCDEX INT 2Fh Services: Discover CD-ROM Drives Without Guessing

Trace MSCDEX-compatible INT 2Fh discovery, drive mapping, version checks, and request dispatch while separating redirector results from device-driver status.

DOS CD-ROM access crosses two interfaces that are easy to mistake for one. A hardware-specific device driver talks to the drive; a redirector such as MSCDEX or FreeDOS SHSUCDX assigns DOS drive letters and exposes files to applications. Programs that need more than ordinary file reads can interrogate the redirector through the INT 2Fh multiplex interface. The 15xxh service family is a contract with that resident software, not a direct ATAPI command channel.

This article concerns the discovery and dispatch contract, not how to install a drive. A setup guide can tell you where to put DEVICE= and a /D: name. An application or diagnostic tool must still find out which letters were assigned, whether a given letter is a CD-ROM, and which layer reported an error.

Installation check is not a generic Boolean

Ralf Brown’s Interrupt List documents INT 2Fh, AX=1500h, with BX=0000h on entry. On return, BX is the number of CD-ROM drive letters in use and CX is the starting letter encoded as 0=A:. This is not the installation-check pattern used by many other multiplex clients. Do not merely compare a returned register to an arbitrary “installed” signature. The Interrupt List also records a conflict with DOS 4.00 GRAPHICS.COM and an incorrect starting-letter result when INTERLNK is installed. Those historical caveats are reasons to validate the mapping rather than hard-code D: or trust one probe as a complete inventory.

The returned starting letter is not itself a list of every letter. A diagnostic that needs an explicit mapping can use the documented AX=150Dh service available in the 2.00+ interface. It fills a caller-provided buffer with one drive number per CD-ROM drive, again using 0=A:. AX=1501h provides a parallel device list, with five bytes per drive: a subunit number followed by the device-driver header address. Entry order corresponds to the letter list. Allocate buffer space from a verified drive count, keep both buffers valid through the interrupt call, and do not treat a device-driver address as an ordinary application data pointer to write through.

For one candidate letter, AX=150Bh is a narrower check. Pass the drive number in CX; the documented return includes BX=ADADh for MSCDEX and an AX support status that is zero for an unsupported drive. This is useful when a tool has been given a letter by a user. A successful file open is a separate observation: media can be absent, unreadable, or not the expected format even when a letter belongs to the CD-ROM redirector.

Version numbers describe compatibility, not identity

The 2.00+ version query is AX=150Ch, BX=0000h. The documented result places the major version in BH and minor in BL. The zero input matters: versions before MSCDEX 2.00 left BX unchanged. But a plausible 2.x return does not authenticate the Microsoft binary. The Interrupt List records substitutes and emulators returning MSCDEX-like version values. Feature-probe the function actually needed and identify the installed redirector separately when that distinction matters.

On FreeDOS, SHSUCDX explicitly presents itself as an unloadable MSCDEX substitute. Its documentation allows each unit of a driver to be assigned a specific drive letter, and its /D query after installation displays assignments. That makes “the CD drive is always the first free letter” a poor assumption. A driver can expose multiple units, and two letters may map to different subunits of one driver. The redirector’s mapping is the authoritative layer for DOS letters; the hardware driver’s own name is not a drive letter.

Dispatch has two outcome layers

AX=1510h sends a CD-ROM device-driver request. The caller supplies CX as the DOS drive number and ES:BX as a pointer to a properly formed request header. The Interrupt List distinguishes two outcomes. If the carry flag is set, the driver was not called; AX carries an error such as invalid drive or invalid function, and the request header is unchanged. If carry is clear, the driver was called - but that is not a success verdict. The caller must inspect the request header’s status word for the driver’s result.

This distinction is essential in a debugger. A trace saying “INT 2Fh succeeded” after carry cleared can hide a device-driver error. Conversely, a set carry flag points to rejection at the redirector boundary before the hardware driver handled the request. Record the input letter, driver/subunit mapping, carry flag, AX, and header status separately. Do not issue a raw request merely to probe whether a CD-ROM is present: the request header has its own command and memory-layout requirements, and some commands change device state. Use the discovery calls for inventory.

The documented implementation differences also matter. MSCDEX 2.21–2.25 may reject nested 1510h calls with AX=0001h; an older Novell NWCDEX release did not initialize the request header’s subunit field; Windows 95 had an inconsistent carry-flag behavior for a valid CD-ROM drive. A robust tool should not assume every historical redirector clone has identical corner-case behavior. Those notes are compatibility evidence, not a reason to deliberately invoke reentrant calls on a live machine.

A safe diagnostic sequence

For a non-mutating inventory tool, begin with 1500h, bound the drive count, then obtain explicit letters via 150Dh when the interface supports it. Cross-check each candidate with 150Bh and compare the result with an ordinary DOS directory listing of a known data disc. If the tool also inspects 1501h, label its addresses as device-driver metadata, not proof that the disc is mounted or readable. Record redirector name and version outside the interrupt results where possible; SHSUCDX’s own post-installation /D display is one such check.

Test with no redirector, one drive, multiple units, a drive letter gap, no media, and a damaged or incompatible disc. These conditions exercise different layers. “No assigned letter” is not the same as “letter exists but no media,” and neither is the same as “driver request reached the device and failed.” Emulators may implement a useful subset of MSCDEX behavior without reproducing every physical driver quirk, so label emulator-only results accordingly.

Keep the scope of the diagnostic narrow. AX=1508h is an absolute disk read interface, while RBIL marks AX=1509h as a reserved, currently nonfunctional absolute-write function; neither belongs in drive discovery. A tool that only needs drive mapping should never dispatch speculative device requests. The main design rule is simple: discover at the redirector layer, test file access at the DOS layer, and interpret hardware-driver status only after a valid driver request was actually delivered.

Related:

Sources:

Comments