Board.KolibriOS.org

Official KolibriOS board
It is currently Wed Sep 18, 2019 6:24 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: HDD S.M.A.R.T
PostPosted: Tue Jun 24, 2014 2:47 pm 
Offline
Kernel Developer

Joined: Sun Feb 10, 2013 12:37 pm
Posts: 2329
Задумался над реализацией сабжа, но информации по собственно низкоуровневому доступу шиш да маленько. Нашел статью на хабре, по похоже там уже тоже со встроенными средствами Шиндовс работа идет. Из остального только описание. Если у кого есть информация по непосредственному (низкоуровневому) программированию поделитесь пожалуйста.

_________________
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!


Top
   
 Post subject: Re: HDD S.M.A.R.T
PostPosted: Tue Jun 24, 2014 3:09 pm 
Offline

Joined: Mon Sep 24, 2007 11:11 am
Posts: 2814
Возможно, поможет: http://www.smartmontools.org/wiki/TocDo ... Attributes
http://www.smartmontools.org/browser/tr ... s_scsi.xml


Top
   
 Post subject: Re: HDD S.M.A.R.T
PostPosted: Tue Jun 24, 2014 5:59 pm 
Offline

Joined: Sat Nov 30, 2013 4:07 pm
Posts: 39
Interesting discussion giving some interesting background information and
some opinions regarding the S.M.A.R.T feature;
http://www.dslreports.com/forum/r288672 ... ID-234-is-


Top
   
 Post subject: Re: HDD S.M.A.R.T
PostPosted: Wed Jun 25, 2014 6:28 am 
Offline
Kernel Developer

Joined: Sun Feb 10, 2013 12:37 pm
Posts: 2329
buyerninety
Thank you! Your link will probably be useful.

Probably here this part of the text - this is what I need:
Spoiler: Show
If you want to reverse-engineer this, you can use smartctl -H -r ataioctl,2 /dev/sda to dump the full payload data. The ATA command for SMART attribute retrieval is 0xb0 ("SMART READ DATA" / "SMART READ ATTRIBUTE VALUES"), feature request 0xd0. The hexadecimal data you get back are all the attributes and their values. For the format of most (but not all) of the data, you will need to read the smartmontools source code. Taken from my own code comments:
Code:
+/*
+ * Obtain SMART attributes and their values
+ *
+ * Feature 0xd0 result (see ATA8-ACS, section 7.53.6.2, table 49):
+ *
+ * The 512-byte result of SMART READ DATA is documented per ATA8-ACS
+ * specification, section 7.53.6.2, table 49.  However, you'll find
+ * bytes 0-361 marked "Vendor specific"; these are (mostly) the
+ * actual SMART attributes themselves.  Example:
+ *
+ * Offset   Size (B)  Description
+ * -------- --------- ---------------------------------------------------
+ * 0        2         SMART attribute revision (16-bit, big endian)
+ * 2        12        SMART attribute data entry #0
+ * 14       12        SMART attribute data entry #1
+ * .....
+ * 348      12        SMART attribute data entry #29
+ * .....              <see ATA8-ACS specification from here onwards>
+ * -------- --------- ---------------------------------------------------
+ *
+ * The SMART attribute data format is completely undocumented.  It
+ * consists of 12 bytes per attribute in the following format:
+ *
+ * Offset   Size (B)  Description
+ * -------- --------- ---------------------------------------------------
+ * 0        1         Attribute ID number
+ * 1        2         Attribute flags
+ * 3        1         Attribute CURRENT value (adjusted)
+ * 4        1         Attribute WORST value (adjusted)
+ * 5        6         Attribute data
+ * 11       1         <reserved - 0x00>
+ * -------- --------- ---------------------------------------------------
+ */

_________________
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!


Top
   
 Post subject: Re: HDD S.M.A.R.T
PostPosted: Wed Jun 25, 2014 7:06 am 
Offline

Joined: Mon Sep 24, 2007 11:11 am
Posts: 2814
Ого, похоже, всё просто.


Top
   
 Post subject: Re: HDD S.M.A.R.T
PostPosted: Wed Jun 25, 2014 8:57 am 
Offline
Kernel Developer

Joined: Sun Feb 10, 2013 12:37 pm
Posts: 2329
SoUrcerer wrote:
Ого, похоже, всё просто.

Ага, также как просто скомпилировать NetSurf для Колибри - вроде все очевидно, но есть нюансы.

_________________
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!


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

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 1 guest


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® Forum Software © phpBB Limited