This item is from the Yet Another Enhanced IDE/Fast-ATA/ATA-2 FAQ, by John Wehman and Peter den Haan with numerous contributions by others. (v1.92).
MS-DOS assigns drive letters as follows.
o Letters a: and b: are reserved for floppy drives.
o All primary partitions on all (system and adapter) BIOS supported harddisks get their drive letters starting from c:, in order. Normally, you can have just one primary DOS/Windows partition on every drive.
o Only then, all logical drives inside extended partitions get their letters. This means, for example, that if you had one drive with c: and d:, adding a second drive with one primary partition on it will bump the former d: partition up to e:. If you want to avoid this, do not define primary partitions on all drives except the first one.
o After that, MS-DOS parses the CONFIG.SYS and AUTOEXEC.BAT files. Some devices such as CD-ROMs have no BIOS support and get their drive letters only here.
Remember that some programs, including disk compression software, may do shuffling tricks with drive letters. Be also warned that some BIOS setup screens, in a misguided attempt at user friendliness, refer to harddisk units using drive letters. In trivial cases, this may be right, but in nontrivial setups the BIOS may be all wrong.