Sample Code
OSX Driver and Kext Samples/ SMARTQuery/ SMARTQuery/ ReadMe.rtf/
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420 {\fonttbl\f0\fnil\fcharset77 LucidaGrande-Bold;\f1\fnil\fcharset77 LucidaGrande;\f2\fnil\fcharset77 Monaco; } {\colortbl;\red255\green255\blue255;} \vieww12480\viewh14600\viewkind0 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 Read Me for SMARTQuery 1.0 \f1\b0 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \fs24 \cf0 04/17/07 \fs28 \ \fs24 \ This sample illustrates how to retrieve the S.M.A.R.T. disk monitoring and diagnostics information using I/O Kit.\ \ \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 Sample Requirements \f1\b0 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \fs24 \cf0 This sample requires Mac OS X 10.4.0 or later on PowerPC-based Macs and 10.4.4 or later on Intel-based Macs to run. It is designed to be built using Xcode 2.4.1 or later using the MacOSX 10.4u SDK.\ \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 \ Using the Sample\ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f1\b0\fs24 \cf0 The sample contains a Cocoa-based application called "S.M.A.R.T. Query". When launched, this application provides one window containing a list of all of the S.M.A.R.T. capable disks currently connected and has several columns of information they report. The columns shown are as follows:\ \ SMART Does this device implement S.M.A.R.T. monitoring?\ Device OK Does this device think that it is still functional?\ Firmware The firmware revision of the device\ Serial number The device serial number\ Temp (C) The current temperature of the device in degrees Celsius\ Gbps The maximum interface speed of this device in Gbps, as reported by the device\ Queue Depth The maximum number of concurrent transactions this device supports\ LBA-48 Checked if the device implement 48-bit logical block addressing\ PM The device includes power management support\ APM Support for advanced power management\ NCQ Support for Native Command Queuing on SATA devices\ CF Device is or can support compact flash media\ Write Cache Device implements a write cache\ FLUSH CACHE Device implements the FLUSH CACHE operation\CocoaLigature0 \ \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 Implementation Notes\ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f1\b0\fs24 \cf0 \CocoaLigature1 The application launches with one window containing an NSTableView object. This object is populated from within the awakeFromNIb method in windowSMARTs.m. The IORegistry is scanned for S.M.A.R.T.-capable devices with each capable device being probed for information. Some additional information is gathered and not displayed - this choice was one of most likely relevance and display space.\ \ S.M.A.R.T.-capable devices are required to provide a minimal set of commands and information, although most devices provide more. The ATA identification information block is part of this required set and the \f2\fs20 \CocoaLigature0 PrintIdentifyData:withResultsDict: \f1\fs24 \CocoaLigature1 method parses this information into a dictionary.\ \ The other portion of required information is a pass/fail score from the device. This is retrieved from inside of the \f2\fs20 \CocoaLigature0 PrintSMARTData:withResultsDict: \f1\fs24 \CocoaLigature1 method after calls to \f2\fs20 \CocoaLigature0 SMARTEnableDisableOperations \f1\fs24 \CocoaLigature1 and \f2\fs20 \CocoaLigature0 SMARTEnableDisableAutosave \f1\fs24 \CocoaLigature1 are made to enable access to the S.M.A.R.T. information.\ \ All other information from S.M.A.R.T.-enabled devices is optional and implemented at the discretion of the vendor. As many devices do implement these calls, \f2\fs20 \CocoaLigature0 PrintSMARTData:withResultsDict: \f1\fs24 \CocoaLigature1 contains an example of how to retrieve the vendor-specific attribute and threshold data that is used to calculate the pass/fail score obtained earlier. Information about these other attributes can be obtained from several sources, although obtaining them from a manufacturer is recommended for accuracy.\ \ \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 \CocoaLigature0 Related Information\ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f1\b0\fs24 \cf0 \CocoaLigature1 T-13 Standards Committee:\ <http://www.t13.org>\ \ SMART Command Transport:\ <http://www.t13.org/Documents/UploadedDocuments/docs2005/DT1701r5-SCT.pdf>\ \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \cf0 \CocoaLigature0 ATA-7, Vol. 1:\ <http://www.t13.org/Documents/UploadedDocuments/docs2007/D1532v1r4b-AT_Attachment_with_Packet_Interface_-_7_Volume_1.pdf> \f2\fs20 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f1\fs24 \cf0 \CocoaLigature1 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs28 \cf0 Feedback \f1\b0\fs24 \ Please send all feedback about this sample to \ http://developer.apple.com/contact/feedback.html\ }
Our Services
-
What our customers say about us?
Read our customer testimonials to find out why our clients keep returning for their projects.
View Testimonials