Mail Archives: djgpp/1996/04/15/15:05:21
u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw (Jih-Shin Ho) wrote:
>Malcolm Taylor (malcolm AT manawatu DOT gen DOT nz) wrote:
>: Really? Which DPMI providers do this? I use a findfirst on the drive
>: looking for a volume label, which of course fails with no disk in the
>: drive. Would this cause a GP fault on some DPMI providers?
>:
>This is what I write to detect disk drive (physical and virtual):
> for (i = 0; i < 26; ++i) {
> regs.x.ax = 0x4409; /* get drive flags */
> regs.h.bl = i + 1; /* 1-based dos drive */
> intdos(®s,®s);
> if (!regs.x.cflag) printf("%c ",'A' + i);
Does this catch cd-rom drives, remapped Floppies (ie a floppy drive
that is mapped as B: even though it is A:)?
The question I had was about detecting whether the disk was in the
drive. It seems that some DPMI providers will give GP faults if you
try to use a DOS call on an empty drive (ie to see if it is empty).
The only way of detecting a ready CD-ROM drive that I know of (using
int 0x2f) may also cause a crash.
It seems that reading a sector with the BIOS is the only way to get
around this (on floppies).
Malcolm
- Raw text -