Page 1 of 1
Question about int 13h
Posted: Mon Dec 31, 2007 5:27 pm
by matias_beretta
Hello, thanks for reading my topic. Should I reset the disk before reading sectors?
Posted: Tue Jan 01, 2008 1:12 am
by Dex
From my understanding (if your talking in Dos) you only need to reset the disk, if a preceding disk operation has reported a error.
Posted: Tue Jan 01, 2008 10:10 am
by Red Shaya
A general pseudo code for a read function will look like
Code: Select all
nRetries = 5
tryRead:
try to read sectors
if OK then JMP :end
reset disk
nRetries -= 1
if nRetries > 0 then JMP :tryRead
end:
RET
Try to look at code samples for a read function using INT 13 to get a better grip of the idea.
Posted: Mon Jan 07, 2008 1:23 pm
by jerryleecooper
What happens if you reset the disk if no error was reported?
Posted: Mon Jan 07, 2008 2:53 pm
by Dex
You get a hard reset, that is the next time the drive is accessed, it first resets to cylinder 0 .