OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Oct 20, 2017 5:09 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Request for some extra resources relating to ATA/SATA/etc.
PostPosted: Fri Jul 08, 2016 2:27 am 
Offline
Member
Member
User avatar

Joined: Thu Apr 16, 2015 7:37 am
Posts: 64
Hello,

I've been trying to get ATA (or IDE, still not entirely sure whether they're interchangeable terms) stuff working recently, and the Wiki has quite a lot of great information on the ATA PIO Mode page. However, I like to read through the standards one I read the explanation for something in order to get a feel for exactly what I need to do to get my code working. On that note, I was trying to find some more definitive information for the different Commands that a ATA drive supports, and the kind of information they give back, since the wiki only seems to contain what directly relevant to reading and writing to and from the disk. They make mention of the IDENTIFY command and detail some of the important fields in it, but it would be nice to have a more complete description of how things could be done.

I'm not saying that the wiki should just become a pile of standards, because that's certainly going to lead to confusion, but some more concrete links would be nice. It also seems like there's no free (as in free beer) copy of the standard either, which of course makes it hard to get a complete idea of what many of the fields mean. So, I was just wondering if there's any way I can contribute or make suggestions to the wiki. I've applied for editing rights, so I'm waiting till then, but I wanted to check with the people who know what they're doing to make sure I'm not screwing anything up.

To start, I just wanted to put a link either in the section on the IDENTIFY command, or in the external links section, to a table I found that could be useful for people trying to figure out what the data returned from the IDENTIFY command meant: https://msdn.microsoft.com/en-us/library/windows/hardware/ff559006(v=vs.85).aspx This page, at the very least, has a summary of most of the fields of the information returned by the IDENTIFY command, which might be useful if somebody's wants a particular piece of information from the drive, but doesn't know how to obtain it.
(As a side note, is there a good way to make an archive of that page, so that if it disappears in the future there's still a link to it on the wiki?)

I was also wondering if anybody had a summary or similar of the different ATA commands, what they did, and how to use them. The wiki only seems to talk about READ_SECTORS, READ_SECTORS_EXT, WRITE_SECTORS, WRITE_SECTORS_EXT, IDENTIFY and a few other commands, and it only really provides detailed instructions on how to use a select few of them. If not, if somebody had a technical document, I'd be happy to try and summarize it and put it on a new page on the wiki, so that other people can use it in the future (It seems hard to find a document which outlines the commands you can send to a drive and how to use them.)

Again, I just wanted to check that I had the right idea, and wasn't making a mess of the wiki, it's in pretty good condition now, and I want to help keep it that way. Let me know if there's anything I'm doing wrong or changes I need to make. The ATA PIO Mode page might not even be the right place for it, but it seems like a good of a place as any to put a link like that (unless a new page gets made about all the different ATA commands).

- Mikumiku747


Top
 Profile  
 
 Post subject: Re: Request for some extra resources relating to ATA/SATA/et
PostPosted: Fri Jul 08, 2016 11:13 am 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 260
Location: USA
Almost all of the specification files are freely available, you just have to know where to look. For example, the ATA specs are available from www.t10.org, all you have to do is sign up. There you can find most of the specification you need.

I have also written a book that explains how to communicate with the ATA/ATAPI/SATA/AHCI interface and read and write from each one.

I agree, there is more to the ATA then reading or writing sectors. For example, the last few ATA posts found on this forum have been about reading and writing sectors, but each needed to detect whether the controller/drive was an ATAPI first. This must be done in a specific sequence of events. Also, once an ATAPI device is detected, you must know which command interface to use which is specified in the IDENTIFY block.

One concern I have is the statement on the WIKI:
Quote:
uint16_t 0: is useful if the device is not a hard disk.
A hard drive (though not likely) can still be an ATAPI device. You should not identify a device as either a Hard drive or a CDROM drive, but identify a device as either a ATA device or an ATAPI device. Also note that the IDENTIFY block is different whether it is an ATA or ATAPI device.

Another note is that some of the ATA commands, especially the read command, is not available if the device is an ATAPI device, something a newbie will not know and wonder why their driver isn't working...

Anyway, good luck with your work. If you have any questions, be sure to post here.
(Note to self: I think at one time I had write access to the wiki. I should check that and see what I can do to help out)
Ben


Top
 Profile  
 
 Post subject: Re: Request for some extra resources relating to ATA/SATA/et
PostPosted: Sat Jul 09, 2016 10:19 am 
Offline
Member
Member
User avatar

Joined: Thu Apr 16, 2015 7:37 am
Posts: 64
Thanks for the response, I've since found an older copy of the standard that was on the wiki page itself (the link titled "HDD Guru", it was the only link on that page I hadn't tried, of all things). I still added that page I found to the external links section, in case anybody is like me and they just want a quick reference for most of the fields of that structure. Let me know if there's any corrections I need to do or something like that.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 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