Xref: news2.mv.net comp.os.msdos.djgpp:2666 From: u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw (Jih-Shin Ho) Newsgroups: comp.os.msdos.djgpp Subject: Re: Detecting drives Date: 13 Apr 1996 01:11:25 GMT Organization: Computer Center, National Chiao-Tung University, Taiwan Lines: 51 Message-ID: <4kmuvu$ndp@ccnews.nctu.edu.tw> References: <4kkbrm$1rk AT news DOT manawatu DOT gen DOT nz> NNTP-Posting-Host: bicmos2.ee.nctu.edu.tw NNTP-Posting-User: u7711501 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Malcolm Taylor (malcolm AT manawatu DOT gen DOT nz) wrote: : Eli Zaretskii 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 #include #include 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/