Re: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
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