Question about int 13h

Programming, for all ages and all languages.
Post Reply
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

Question about int 13h

Post by matias_beretta »

Hello, thanks for reading my topic. Should I reset the disk before reading sectors?
Matías Beretta
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
User avatar
Red Shaya
Posts: 15
Joined: Wed Oct 03, 2007 4:21 pm
Contact:

Post 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.
The Bina OS - More of a challenge then an OS
The Eddie OS - OS for kids and for fun loving adults
User avatar
jerryleecooper
Member
Member
Posts: 233
Joined: Mon Aug 06, 2007 6:32 pm
Location: Canada

Post by jerryleecooper »

What happens if you reset the disk if no error was reported?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

You get a hard reset, that is the next time the drive is accessed, it first resets to cylinder 0 .
Post Reply