All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: how to detect the presence of ata-device(HDD)
PostPosted: May 6th, 2012, 6:32 
Offline

Joined: December 20th, 2011, 22:12
Posts: 30
Location: china
Why doesn't ATA-spec(ATA/ATAPI-6) provide the standard about how to detect the presence of ATA-DEVICE(HDD or CD)?
Recently, I look for the stuff about detect ATA-DEVICE in ATA/ATAPI-6 SPEC.
But, what I got is implicit description.

Summary:
ATA/ATAPI-6 wrote:
Chapter 13: Application Layer
Section 13.1: Parallel ATA Emulation
BIOS and system software writers should be aware of the 10 ms latency the interface may incur
in determining device presence, and either ensure the Shadow Status register is read no sooner
than 10 ms after initialization or ensure the Shadow Status register is re-read 10 ms after having
read a value of 7Fh in order to positively determine presence of a device.


Any info should be appreciated


Top
 Profile  
 
 Post subject: Re: how to detect the presence of ata-device(HDD)
PostPosted: May 6th, 2012, 7:02 
Offline

Joined: December 20th, 2011, 22:12
Posts: 30
Location: china
Sorry, the summary come from SATA3.0-SPEC


Top
 Profile  
 
 Post subject: Re: how to detect the presence of ata-device(HDD)
PostPosted: May 7th, 2012, 17:30 
Offline

Joined: May 6th, 2008, 22:53
Posts: 2138
Location: England
corner wrote:
Why doesn't ATA-spec(ATA/ATAPI-6) provide the standard about how to detect the presence of ATA-DEVICE(HDD or CD)?

I last worked in this area many years ago, but try reading section 9.1 of ATA-4. That section describes & explains the concept of the "drive signature" quite well. Then in ATA-6 you will see an expanded list of signature values, including SATA devices (which are not included in the ATA-4 document).

You haven't explained what type of software / firmware you are writing, and there can be other issues you will need to consider in your code, but hopefully the information above will be helpful to you. :)


Top
 Profile  
 
 Post subject: Re: how to detect the presence of ata-device(HDD)
PostPosted: May 11th, 2012, 22:18 
Offline

Joined: December 20th, 2011, 22:12
Posts: 30
Location: china
Thank you, I've read section 9.11(Signature and persistence) in ATA-6, not including SATA devices Signature, may included in ATA-7(the Gen1 ATA-spec that support SATA).
After read the section(9.11), I also don't know how to detect the presence of ATA-DEVICE clearly, just via check the master/slave Register-Block ?


Top
 Profile  
 
 Post subject: Re: how to detect the presence of ata-device(HDD)
PostPosted: May 11th, 2012, 22:54 
Offline

Joined: May 6th, 2008, 22:53
Posts: 2138
Location: England
Sorry, I meant to say that the SATA signatures are in ATA-8 (I rarely read ATA-7, so I didn't spend time checking that one), but the discussion about Signatures in that version of the spec is not so good IMHO - which is why I recommended reading ATA-4.

To answer your question, yes, the basic process I used (long ago) was to check the registers which contain the signature - but as I said before, there is more to consider (e.g. think about when the drive signature is put into the registers!), and I have not seen enough details about exactly what you are doing and what results you have got so far, for me to offer further comments at the moment.


Top
 Profile  
 
 Post subject: Re: how to detect the presence of ata-device(HDD)
PostPosted: May 14th, 2012, 7:39 
Offline

Joined: December 20th, 2011, 22:12
Posts: 30
Location: china
Thank you very much, Vulcan!
Consider there are two ATA-DEVICE(e.g HDD\CDROM) attached to one port of SATA-Controller. They are Primary-DEV0(master) \ Primary-DEV1(slave).
Now, I try to deliver a SOFTWARE-RESET(or other similar command could got the "Signatures"), then I read the appropriate register to get "Signatures". How could I know the "Signatures" is for which Device (for DEV0 or for DEV1)?
ATA-6 wrote:
A device not implementing the PACKET command feature set shall place the signature in the Command
Block registers listed below for power-on reset, hardware reset, software reset, and the EXECUTE DEVICE
DIAGNOSTIC command.
If the device does not implement the PACKET command feature set, the signature shall be:
Sector Count 01h
Sector Number 01h
Cylinder Low 00h
Cylinder High 00h
A device implementing the PACKET command feature set shall place the signature in the Command Block
registers listed below for power-on reset, hardware reset, software reset, the EXECUTE DEVICE
DIAGNOSTIC command, and the DEVICE RESET command. The DEVICE RESET command shall not
change the value of the DEV bit when writing the signature into the Device/Head register for a device
implementing the PACKET command feature set. If the device implements the PACKET command feature
set, the signature is also written in the registers for the IDENTIFY DEVICE and READ SECTOR(S)
commands.
If the device implements the PACKET command feature set, the signature shall be:
Sector Count 01h
Sector Number 01h
Cylinder Low 14h
Cylinder High EBh
Device/Head 000x0000b where x equals 0
except when responding to a
DEVICE RESET command. For
the DEVICE RESET command
the value of x is not changed from
that existing when the command
is written to the Command
register.
Device/Head 00h


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: No registered users and 6 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