Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mit-eddie!bbn!uwmcsd1!ig!agate!labrea!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!erix!mike
From: mike@erix.ericsson.se (Mike Williams)
Newsgroups: comp.sys.ibm.pc
Subject: How can you check that a readable floppy is in a drive?
Message-ID: <1736@erix.ericsson.se>
Date: 10 Aug 88 13:29:08 GMT
Organization: Ericsson Telecom, Stockholm, Sweden
Lines: 24

is in a cerain drive (for example b:). I have tried using
int 13h with ah=4 to do a verify on a sector on the floppy. This
always works OK on the second or third attempt. But if the disk
is not readable and one tries again with a new disk always
fails on the first new attempt with 'Drive failed to respond' in ah 
(80H) on return. The next attempt gives 'address mark not found'
and 'requested sector not found' (06H) in ah and the third attempt
works.

I have tried doing int 13h with ah=0 (reset diskette) first but this
seems only to eliminate the first error. I have also tried to do an
int 13h with ah=01 first (diskette status) but this makes no difference.

What's going on here? Do I really need to do 'verify' three times before
I can be sure that the result is OK?

I also see that ah=05h can be used to format one or more sectors, is there
any way of using this to write one's own 'format' program? I would like to
be able to format a disk from within my program without spawning a
format b:  task to let DOS do it for me.

Mike Williams

mike@erix.ericsson.se   or  ...uunet!enea!erix!mike