Mail Archives: djgpp/1996/04/13/07:53:48
Malcolm Taylor (malcolm AT manawatu DOT gen DOT nz) wrote:
: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
:
:
: >where DJGPP can run. (You could think that DOS calls are also a solution,
: >but some DPMI servers will GP fault if you try to access an empty drive
: >with a DOS call, so you should hook Int 24h if you want to prevent this.)
:
: 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?
:
: Malcolm
:
This is what I write to detect disk drive (physical and virtual):
(I compile it with TC)
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
int main()
{
union REGS regs;
int i;
printf("Disk drive found : ");
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);
}
printf("\n");
return(0);
}
Of course, still many things are left to do.
--
Jih-Shin Ho, National Chiao Tung University
u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw
DISPLAY -- universal image/movie viewer, converter, and indexer for DOS.
Package name : disp???a.zip, disp???b.zip. ??? is version number.
Official site : NCTUCCCA.edu.tw:/PC/graphics/disp.
Other site : oak.oakland.edu:/SimTel/msdos/graphics.
WWW page : http://bicmos.ee.nctu.edu.tw/
- Raw text -