News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

S.M.A.R.T hard drives

Started by sinsi, October 29, 2006, 05:25:05 AM

Previous topic - Next topic

sinsi

I went to look at a computer that wouldn't boot XP properly 3 out of 4 times. Sat down, booted it up and...waited.
Listened closely and could hear a lot of disk-thrashing going on so thought "Aha! Bad sectors, HDD failure".
Looking through the BIOS options there was one for "SMART options" - not just enable/disable. The BIOS will do a test for you - quick or thorough.
Chose quick, this test "Failed" straight away.

I thought this would be a good program for my emergency disk and went looking for some SMART information. Lots of programs to buy, but no
info on how to actually *get* the info from the HDD. I understand disk I/O via the ports (ATAPI etc) but would like the commands for SMART.

Does anyone know where I can get the specs? GoogleTMing was not much help...
Light travels faster than sound, that's why some people seem bright until you hear them.

MichaelW

#1
I once started such a project, back when IBM's 70 and later 60 GXP drives were having so many problems. IIRC I dropped the project when it became apparent that the bulk of the SMART data is proprietary. I think you can read some status information from the drive, but I also seem to recall that there was some detail that made this unreasonably difficult.

EDIT: I can't find the code, but thinking more about this I think the detail was either that you had to use the packet interface, or DMA (or UDMA) instead of PIO.

The best source of information that I know of is in the various ATA/ATAPI and related standards, available here:

http://www.t13.org/

The published standards are expensive, but the drafts are free for download. I think the final draft is generally close enough to the published standard to be used for a hobby application or a free utility.
eschew obfuscation

sinsi

I found some good ATAPI stuff at www.ati-atapi.com but no SMART stuff.
Ralf Brown's Interrupt List comes with ports.doc which has some SMART stuff, so I will give that a sqizz.

Thanks for the link, it is now in my (bulging) favourites...

QuoteI think the final draft is generally close enough to the published standard to be used for a hobby application or a free utility.
heh heh but remember the INT 1Ah PCI specs that reversed BH and BL...bus and device/function...ouch!
Light travels faster than sound, that's why some people seem bright until you hear them.

Mark_Larson

  I remember us adding support for SMART to the Dell Desktop BIOS a number of years ago.  The guy who did the code ( Ron) had a draft of the ATAPI spec that had the SMART commands as part of the spec.  As far as I know he didn't use any proprietary stuff in doing our interface ( which makes sense because it has to work on all drives that support SMART).  I'll see if I can dig up something later, I'm in the middle of doing something.



BIOS programmers do it fastest, hehe.  ;)

My Optimization webpage
htttp://www.website.masmforum.com/mark/index.htm

sinsi

#4
Mark_Larson,
That would be bloody beaut mate. I was hoping that a BIOS dude would see this and help  :bg

Edit: Seems I owe Ralf an apology, the commands are in his ports file, this should be enough to get the info
since it seems if you know about ATAPI commands to get HDD names etc then this is just another interface.
But still, another perspective on it would be good since there isn't much on it anyway.
Light travels faster than sound, that's why some people seem bright until you hear them.

BogdanOntanu

Besides a few common ones (including temperature) the SMART attributes are vendor specific.
So you will need info for every HDD vendor/version out there... neddless to say: they are not public nor free...
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

sinsi

Quote from: BogdanOntanu on October 30, 2006, 11:27:31 AM
Besides a few common ones (including temperature) the SMART attributes are vendor specific.
So you will need info for every HDD vendor/version out there... neddless to say: they are not public nor free...

So how did the BIOS in an HP fail a HDD test? Surely HP didn't use the exact same model HDD in all of their computers, and the BIOS
surely can't hold all past, present and future proprietary data? There has to be a standard way of reporting, doesn't there? (I am hoping...)
Light travels faster than sound, that's why some people seem bright until you hear them.

MichaelW

IIRC the IBM GXP drives logged a large amount of information, but I think only a small part of it is necessary to implement the BIOS S.M.A.R.T function. Large OEMs and the major BIOS makers should have no problem getting the required information from the drive manufacturers. Compatibility, in both directions, is pretty much a necessity. I think the drive manufacturers are unlikely to make the information generally available because it would prevent them from doing things like hiding defects (to avoid frivolous "the platters have defects therefore the drive is defective" warranty claims).
eschew obfuscation

sinsi

I don't want any info beyond "won't/might/did fail" since that's what I've found the available programs do, so there must (hah) be
some sort of standard info available.

Wasn't there a smart vxd or something for windows? (Now I'm grasping at straws...)
Light travels faster than sound, that's why some people seem bright until you hear them.

Mark_Larson

  Too funny, I misread your comment.  I thought you wanted to do the smart "test". hehee.  Couple things to search for document wise;

SMART Applications Guide for the ATA Interface SFF-8055i
SMART Specification Draft SFF-8035i
I did a search on the first document, and found a hit on an open source project.  They have links to various specs:

http://smartmontools.sourceforge.net/#references


  You write a command 0B0h - Smart Command
 
  You write a sub-command 0D0h - read SMART data.  this will return data from the drive.  It returns 512 bytes.  The code I saw read it a word at a time ( 256 reads).




  You write a command 0B0h - Smart Command
 
  You write a sub-command 0DAh - return SMART status.  this will return smart status



I left out a lot of steps.  I am assuming you know how to talk to a hard drive.  I am just giving you the basic jist.  You'll have to poll for the controller not to  be busy, etc.
  I also gave you more information than what you were asking for, in case you decide to use it.

BIOS programmers do it fastest, hehe.  ;)

My Optimization webpage
htttp://www.website.masmforum.com/mark/index.htm

sinsi

One can never have too much information.
Thankyou for taking the time to look for those references, I had no idea where to start!

Cheers, mate  :U
Light travels faster than sound, that's why some people seem bright until you hear them.