flat assembler
Message board for the users of flat assembler.

Index > DOS > Read/Write Floppy Three Times

Author
Thread Post new topic Reply to topic
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
rain_storm
Ralf Browns interrupt list states that you should read / write a sector to/from a floppy disc drive at least three times to ensure that the operation completed successfully. Is this absolutely necessary, I had no issues before I decided to go "by the book" on this. But now it's taking the best part of an hour to write a 1.4MB image. Where as before I could live with the 15 min time frame.

Edit:
read int 0x13 ah=0x02
write int 0x13 ah=0x03
Post 31 Mar 2011, 21:13
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You do not need to read/write more than once unless you get a error.
Only on error do you try 3-4 times

Example
Code:
        mov   [FloppyTest],0
ReadWriteLoop:
        ;fill the right reg here
      int   13h
   jnc   ReadWriteOK
   inc   [FloppyTest]
  cmp   [FloppyTest],4
        jb    ReadWriteLoop

ReadWriteError:
       ;some code
ReadWriteOK:
    


Also if your using Dos, you can use int 21h functions for open, read, write, close, etc.


Last edited by Dex4u on 31 Mar 2011, 21:37; edited 2 times in total
Post 31 Mar 2011, 21:22
View user's profile Send private message Reply with quote
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
rain_storm
Thanks, should have spotted that one myself

Edit - MenuetOS still fails to boot, thought it was my program not writing properly but now it looks like its my hardware, DexOS boots just fine.
Post 31 Mar 2011, 21:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.