Yoghoo wrote on 2023-12-12, 14:42:
mbbrutman wrote on 2023-12-12, 14:32:
Did you load mscdex to get the drive letter before loading the device driver?
Tried it before and after loading mscdex. In both cases it will take drive letter E:. So it's overwriting the assigned drive for my CD when mscdex is already loaded and was assigned drive letter E:.
MSCDEX is not a DOS block device driver and does not influence DOS driver device letter assignment. In DOS, there are two ways in which you can install a handler for a drive letter:
- The first one is to provide a block device driver. This kind of driver can read (and possibly write) sectors of a (possibly virtual) disk. DOS then adds its FAT driver on top of this driver so that you can access files on the drive. You can not teach DOS any new kind of file system this way. The block device driver does not get any clue about opening and closing files. It does not deal with file name. The only thing it deals with is sectors. Drive letters are assigned to block devices starting at C:, floppy drives do not count, they get the dedicated A:/B: letters; every partition on BIOS-supported hard disks is a different "block device". There is no way of assigninig specific letters to block drivers.
- The second one is to install a hook for opening files on a specific drive letter. This code path is called the "network redirector", as this way of providing a virtual drive allows to redirect the open call (and if it succeeds, also the read/write/sync/close calls) to somewhere else, e.g. a network server. When installing a redirector, you can specifify which drive letter you want to listen to. If a file on that drive is going to get openend, DOS will call the redirector for this drive instead of the DOS-integrated FAT driver. You can use the network redirector interface to implement network file access (the DOS LANMAN client uses this interface, as does the VLM version of the Novell client, or does ETHDOSFS), or to implement file systems that the DOS kernel does not understand. MSCDEX is a "ISO9660 filesystem driver" that uses the network redirector interface to listen on a certain drive letter, and then parses the ISO9660 filesystem structures on a CD to provide file access.
Installing a network redirector requires the drive you want to redirect to be before LASTDRIVE, and it prevents any access to that drive letter to get into the FAT / block device layer. You can hide a drive supported by FAT/block-device-driver by "redirecting" this drive to somewhere else, most likely a network drive. On the other hand, the block device layer is completely inaware of redirected drives, so if you have two partitions, getting C: and D: as drive letters, NETDRIVE will get E: as drive letter, even if E: has already been redirected on at the redirector layer. (for example using ethdosfs or mscdex). Unless you load a dummy block device driver, you can not create "holes" between drive letters assigned to block device drivers.
You might be able to use DRIVER.SYS as "dummy block device driver" to shift drive letters, e.g. by creating a "duplicate" of drive A:, which is latter hidden using MSCDEX.