中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-26 23:44
47,815 topics / 349,928 posts / today 0 new / 48,289 members
DOS启动盘 & LOGO技术 (启动盘室) » How can a program detect whether the floppy drive or USB flash drive is not installed?
Printable Version  661 / 2
Floor1 szxxbb Posted 2003-12-21 00:00
初级用户 Posts 8 Credits 133
Problem:
USBASPI.SYS and DI1000DD.SYS have already been loaded in CONFIG.SYS.
I can read and write the USB flash drive now. But after unplugging the USB flash drive and plugging it back in, I can no longer read or write it. DOS
will say it can't find the drive, "Rrtry /Aboart /Fail", and I have to press "A" to exit.
How should an application determine this so it won't hang?
Floor2 Wengier Posted 2003-12-21 00:00
系统支持 Posts 10,521 Credits 27,736
You can also use tools like DREADY (it's included in that super boot disk) to check it.
Floor3 szxxbb Posted 2003-12-21 00:00
初级用户 Posts 8 Credits 133
Many thanks to Wengier

DREADY can detect it now

But if I want to add it into my application for automatic detection, could you explain the principle?

Using DEBUG to look at DREADY.COM, it seems to use INT21 function 2F

AX=2524i
int 21
ax=352f
int 21
save ES:BX
ax=252f
int 21
..
dx=参数
ax=252f
int 21
reutnr al
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023