MultiDrive – free backup, clone & wipe disk utility from Atola Technology

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Is it safe to check for DRDY only once per sector?
PostPosted: August 9th, 2014, 1:48 
Offline

Joined: July 6th, 2014, 12:10
Posts: 15
Location: USA
The majority of programmers seem to check if data is ready only once per sector, like in the first example. But is it safe? Shouldn't we check for DRDY every time we read a word from the Data Register, like in the second example?
--------------------------------------------------------------------------------------------------------------------------------------------
[READ SECTORS ATA command]
[...]
mov BX, 120d ;Read 120 sectors.
L120:
mov CX, 256d ;1 sector = 256 words.
WaitForNotBusyAndDRDY ;The majority of programmers seem to check if data is ready only once per sector. But is it safe?
L256:
in AX, DX
loop L256

dec BX
cmp BX, 0
jne L120
--------------------------------------------------------------------------------------------------------------------------------------------
[READ SECTORS ATA command]
[...]
mov BX, 120d ;Read 120 sectors.
L120:
mov CX, 256d ;1 sector = 256 words.
L256:
WaitForNotBusyAndDRDY ;Shouldn't programmers check if data is ready once per word?
in AX, DX
loop L256

dec BX
cmp BX, 0
jne L120
--------------------------------------------------------------------------------------------------------------------------------------------


Top
 Profile  
 
 Post subject: Re: Is it safe to check for DRDY only once per sector?
PostPosted: August 9th, 2014, 11:06 
Offline

Joined: August 5th, 2014, 16:46
Posts: 55
Location: Slovakia
I programmed only apps for CD Roms, so I am not sure if i am right and it might be different for current HDDs.

If you use Read Sector, HDD should have buffer where it stores data, after HDD loads data in buffer, it should set DRQ and you should transfer one sector safely without checking DRQ.
I hope i am right, but wait for somebody who is 100 % sure with his answer :)

EDIT: oh wait you are asking for DRDY not DRQ :oops: I have to do small research i forgot how it works exactly :lol:


Top
 Profile  
 
 Post subject: Re: Is it safe to check for DRDY only once per sector?
PostPosted: August 9th, 2014, 12:45 
Offline

Joined: July 6th, 2014, 12:10
Posts: 15
Location: USA
That's correct, my question is not about DRQ, it's about "Device Ready" (DRDY). Let me modify the examples to get DRQ out of the picture:
--------------------------------------------------------------------------------------------------------------------------------------------
[READ SECTORS ATA command]
[...]
mov BX, 120d ;Read 120 sectors.
WaitForNotBusyAndDRDYandDRQ
L120:
mov CX, 256d ;1 sector = 256 words.
WaitForNotBusyAndDRDY ;The majority of programmers seem to check if device is ready (DRDY bit set to 1) only once per sector. But is it safe?
L256:
in AX, DX
loop L256

dec BX
cmp BX, 0
jne L120
--------------------------------------------------------------------------------------------------------------------------------------------
[READ SECTORS ATA command]
[...]
mov BX, 120d ;Read 120 sectors.
WaitForNotBusyAndDRDYandDRQ
L120:
mov CX, 256d ;1 sector = 256 words.
L256:
WaitForNotBusyAndDRDY ;Shouldn't programmers check if device is ready (DRDY bit set to 1) once per word?
in AX, DX
loop L256

dec BX
cmp BX, 0
jne L120
--------------------------------------------------------------------------------------------------------------------------------------------


Top
 Profile  
 
 Post subject: Re: Is it safe to check for DRDY only once per sector?
PostPosted: August 9th, 2014, 14:26 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3577
Location: Chicago
It is safe to check for ready once per sector.

_________________
SAN, NAS, RAID, Server, and HDD Data Recovery.


Top
 Profile  
 
 Post subject: Re: Is it safe to check for DRDY only once per sector?
PostPosted: August 13th, 2014, 4:10 
Offline

Joined: March 14th, 2014, 11:06
Posts: 61
Location: EARTH
> It is safe to check for ready once per sector.
Could you elaborate a little, Doomer? Because the reasoning statement or a prooflink is absent.

TY


Top
 Profile  
 
 Post subject: Re: Is it safe to check for DRDY only once per sector?
PostPosted: August 13th, 2014, 10:28 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3577
Location: Chicago
It's based on my experience with drives.

_________________
SAN, NAS, RAID, Server, and HDD Data Recovery.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 44 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group