• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158


  • Subject: Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
  • From: Dirk Stegemann <email@hidden>
  • Date: Fri, 16 Jun 2006 01:48:28 +0300

Hello Pete,

Am 15.06.2006 um 22:25 schrieb Peter Cassidy:

On 15 Jun 2006, at 20:02, email@hidden wrote;

I'd like to retrieve the system volume's hard disk serial number.

(...)

It's part of the SMART API. I used it when hacking SMARTMonTools, some years back. Since (I think) MacOS X.3, the API to do an ATAIdentify has been in there.

You just need to create a plug-in interface to kIOATASMARTUserClientTypeID, query the plug-in to get a handle to the interface. Then send the Identify command.

From ATASMARTLib.h ;

	/*!
		@function GetATAIdentifyData
		@abstract Reads the 512-byte data provided by the drive in response
		to the ATA IDENTIFY DEVICE command.
(...)
	*/

	IOReturn ( *GetATAIdentifyData ) ( void *				interface,
									   void *				buffer,
									   UInt32				inSize,
									   UInt32 *				outSize );

Cool, I was looking for something like that :-)

As it seems, the 'GetATAIdentifyData()' API requires Mac OS X 10.3 minimum (it's not present in the 10.2.8 SDK) -- maybe there's some kind of predecessor available on those systems? On the other hand, "Jaguar" is older than the SMART technology, I'd say...

Do I assume correctly that a drive, which *doesn't* support the SMART technology cannot be queried by this API at all?
Or will such a drive simply return invalid data for calls like 'SMARTEnableDisableOperations()' which try to retrieve information which cannot be provided by the drive, but still returns its serial number (incase a S/N is present)?



I have some working dummy-code which does just this. Let me know if you want it. It's ancient but I built it on 10.4.6/ppc and it's fine. Here's a chunk of the Ident, including the s/n;

I'll dig a bit deeper and do some tests next week, and would gladly contact you again incase I encounter unresolvable difficulties or questions.



Thanks!


Best regards, Dirk Stegemann



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
      • From: Chris Sarcone <email@hidden>
References: 
 >ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158 (From: Peter Cassidy <email@hidden>)

  • Prev by Date: i386_signal_cpu
  • Next by Date: Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
  • Previous by thread: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
  • Next by thread: Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
  • Index(es):
    • Date
    • Thread