Difference between revisions of "Active Protection System"

From ThinkWiki
Jump to: navigation, search
(Table of working / non-working drive firmware for the (experimental) hdaps driver park command)
(added category)
 
(81 intermediate revisions by 35 users not shown)
Line 4: Line 4:
 
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;">
 
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;">
 
=== The Active Protection System ===
 
=== The Active Protection System ===
With the new series of Thinkpads IBM introduced the Active Protection System (APS) in 2003. The APS is a protection system for the Thinkpad's internal harddrive. A sensor inside the Thinkpad recognizes when the notebook is accelerated. A software applet then is triggered to park the harddisk. This way the risk of data loss in case of when the notebook is dropped is significantly reduced since the read/write head of the harddrive is parked and hence can't crash onto the platter when the notebook drops onto the floor.
+
With the new series of ThinkPads IBM introduced the Active Protection System (APS) in 2003. The APS is a protection system for the ThinkPad's internal harddrive. A sensor inside the ThinkPad recognizes when the notebook is accelerated. A software applet then is triggered to park the harddisk. This way the risk of data loss in case of when the notebook is dropped is significantly reduced since the read/write head of the harddrive is parked and hence can't crash onto the platter when the notebook drops onto the floor.
  
The whole concept of the technology seems very advanced. For the first part, the hardware sensor is capable of not only recognizing acceleration of the notebook, but also (to a certain degree) of its whole orientation in space, relative to gravity's axis. Furthermore, having the actual control put into software, its functionality is extendable and it gives chance to implement features like the "ignore minor shocks" feature which is present in the Windows based control applet. (This feature prevents the harddrive from parking in case of minor regular shocks such as occur when in a train or car.)
+
The hardware sensor is capable of not only recognizing acceleration of the notebook, but also (to a certain degree) of its whole orientation in space, relative to gravity's axis. Furthermore, having the actual control put into software, its functionality is extendable and it gives chance to implement features like the "ignore minor shocks" feature which is present in the Windows based control applet. (This feature prevents the harddrive from parking in case of minor regular shocks such as occur when in a train or car.)
 +
 
 +
The measurements are physically performed by an [[Analog Devices ADXL320 accelerometer]] chip, managed by the [[Embedded Controller Chips|embedded controller]].
 
</div>
 
</div>
 
|}
 
|}
  
 +
* [ftp://ftp.software.ibm.com/pc/pccbbs/mobiles_pdf/aps2mst.pdf IBM Active Protection System Whitepaper]
 +
 +
==Hard-disk Support==
 +
 +
HD-APS requires a hard-disk with [http://www.hitachigst.com/hdd/research/storage/hdi/loadunload.html head unload ramp technology] and also support on the hard-disk firmware to unload heads without flushing the disk cache.  This is required, because as soon as the APS system detects a shock is imminent, the system has less than 500ms to prepare for the shock.
 +
 +
Unloading heads without flushing the cache is done using the [http://www.t13.org/Documents/UploadedDocuments/docs2003/e03120r5.pdf optional Unload Immediate feature of the IDLE IMMEDIATE ATA command].  It finishes whatever sector write is in-flight, and immediately moves the heads to the unload ramp.  Without this command, hard-disk APS cannot be trusted, as disks with big caches can take a lot of time to write it all to disk.
 +
 +
So far, only hard-disks with IBM APS firmware, as well as the consumer Fujitsu HV2060AH/MHV2100AH/MHV2120AH HDs have been found to implement all the necessary functions.  Head unload technology is reasonably common in modern laptop disks, but the APS firmware is very rare in regular consumer products.  Please note that newer Apple notebooks also support APS, so it is somewhat likely that their disks also support unload immediate or a similar feature.
 +
 +
(Update: February, 2009) Meanwhile, other HDD manufacturers may have added the necessary support to their new products. E.g., [http://www.hitachigst.com/tech/techlib.nsf/techdocs/3255FB0B917AEB69862574B400578C7F/$file/TS7K320_OEM_Specification.pdf Hitachi Travelstar 7K320 spec] does mention some 'Idle Immediate with Unload Option' command. The description reads pretty much like what's needed for APS, though I don't want to drop my almost new TP just to field-test it.
  
 
==Linux Support==
 
==Linux Support==
Linux support is in early development.
+
Linux support is in development.
 +
 
 +
This feature definitely depends on software and there is no hardware or BIOS-only way of making it work.
 +
IBM made contradictory statements about their willingness to release the specifications of the hardware sensor and its API to the linux community or some developers. Although a lot of developers and other interested people from the OpenSource community actively contacted IBM to get the specs, in fact they never got them.
 +
 
 +
However, after first efforts of [http://www.kernelthread.com/software/ams/ Amit Singh on a PowerBook] and [http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html Mark Smith on a ThinkPad], the [[HDAPS]] project was founded to produce a linux kernel driver for the acceleration sensor and a user space application to monitor it. Later, a kernel patch to enable harddisk parking followed.
 +
 
 +
See [[How to protect the harddisk through APS]] for instructions and [[Problem with APS harddisk parking]] for Troubleshooting.
 +
 
 +
Furthermore, a list of alternative applications like theft alarm and others can be found on the [[HDAPS]] driver page.
  
This feature definitely depends on software and there is no hardware or BIOS only way of making it work. A statement from IBM clearifies this:
+
==Tilt detection field tests==
"The APS system will require APS software to be installed on the  
+
Using Perl code for WinXP:
computer before it activates the harddrive parking . This means it will
+
<pre>
not work on systems preloaded with Linux."
+
use Win32API::File qw(:ALL);
 +
sub get_tilt {
 +
      my $file = createFile("//./ShockMgr", "r ke") or die "Can't get ShockMgr device";
 +
      DeviceIoControl($file, 0x733fc, [], 0, my($buf), 0x24, my($bytes), []);
 +
      my @data = unpack "x4s*", $buf;
 +
      return @data[1, 0];
 +
}
 +
</pre>
 +
my T42 gives values of roughly 490 when at rest in normal upright position with base parallel to the ground.  As I gently tilt the T42 through all possible x or y angles, the values range from about 335-645, meaning a resolution of about 155 units per Earth gravity. This seems to suggest that the operating range of the APS is actually about +-3 gs, although the ADXL320 is supposed to allow +-5 gs.
  
IBM made contradictory statements about their willingness to release the specifications of the hardware sensor and its API to the linux community or some developers. Although a lot of developers and other interested people from the OpenSource community actively contacted IBM to get the specs, in fact they never got them.
+
As the tilt angle is the arcsine of the normalized APS reading, the Thinkpad is most tilt sensitive when in a normal upright position with base parallel to the ground.  In this position, the tilt resolution is about 0.35 - 0.4 degrees.  At maximum tilt, the resolution is much worse, about 6.5 degrees.
 +
 
 +
Shouldn't matter much, but my tests are at an elevation of about 60 meters above sea level.
 +
 
 +
===More field tests===
 +
When placed on a reasonably flat and reasonably horizontal work surface my T43 provides readings of about x=503 and y=569. I wrote a command-line application in C# (using the .NET DllImport annotation to access the sensor.dll API) to log the sensor readings at some interval. With 150ms sampling I found the following extreme values: 335 to 654 for x, and 409 to 723 for y.
  
Meanwhile, some independent projects are making progress:
+
<pre>
* Quoted from NewScientist.com: The latest Apple PowerBook laptops can be controlled with a gentle shake. Programmer Amit Singh has written code that lets him use the sensor to control software on the computer. The code is published at [http://www.kernelthread.com/software/ams/ www.kernelthread.com/software/ams/].
+
x: 494.5  +/- 159.5
 +
y: 566.0  +/- 157.0
 +
</pre>
  
*There is a fairly detailed article about [http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html reverse engineering the APS accelerometer interface] by Mark Smith from IBM Research. Apparently they even have a prototype Linux driver working, but cannot release the full source yet.
+
Based on the maximum and minimum x and y readings I calculated the above "zero" and range values in order to convert the sensor readings to degrees and wrapped this up in a small graphical application for Windows. My data, source code, executables and a complete description can be found [http://www.stanford.edu/~bsuter/thinkpad-accelerometer/ here].
  
* The [http://hdaps.sourceforge.net/ HDAPS project] is dedicated to developing & testing a kernel module and a user space application. More info on this can also be optained from the [https://lists.sourceforge.net/lists/listinfo/hdaps-devel HDAPS mailinglist and its archive]. You can also find some of the coders working on this module in the #hdaps channel on irc.freenode.org.
+
== See also ==
 +
* [[HDAPS]] - IBM Active Protection System Linux Driver. Shows various applications of APS.
  
 
==Related Links==
 
==Related Links==
 +
*[http://www.stanford.edu/~bsuter/thinkpad-accelerometer/ Sensor Data, Calibration, command-line and GUI executables for Windows and C# .NET source code]  (link broken)
 +
*[http://www.ibm.com/developerworks/blogs/page/johnston?entry=python_and_thinkpad Python and ThinkPad, a Python script for Windows to access the sensor data] (comments are spam fooded)
 
*[http://www.pc.ibm.com/presentations/us/thinkvantage/56/index.html?shortcut=aps& IBMs ThinkVantage&trade; Technologies Flash presentation - Active Protection System]
 
*[http://www.pc.ibm.com/presentations/us/thinkvantage/56/index.html?shortcut=aps& IBMs ThinkVantage&trade; Technologies Flash presentation - Active Protection System]
 +
*[http://www.musatcha.com/software/LaptopTheftPrevention/ Motion-Sensitive anti-theft alarm for ThinkPads with APS]
 +
*[http://www-128.ibm.com/developerworks/linux/library/l-knockage.html?ca=dgr-lnxw01Knock-Knock IBM HDAPS/Linux HDAPS information page]
 
*[http://hdaps.sourceforge.net HDAPS project page]
 
*[http://hdaps.sourceforge.net HDAPS project page]
 
*[http://sourceforge.net/mailarchive/forum.php?forum=hdaps-devel HDAPS-devel list archive]
 
*[http://sourceforge.net/mailarchive/forum.php?forum=hdaps-devel HDAPS-devel list archive]
  
 
==Models featuring this Technology==
 
==Models featuring this Technology==
*ThinkPad {{R50}}, {{R50p}}, {{R51}}, {{R52}}
+
*ThinkPad {{Edge 14"}}, {{Edge 15"}}
*ThinkPad {{T41}}, {{T41p}}, {{T42}}, {{T42p}}, {{T43}}, {{T43p}}
+
*ThinkPad {{L412}}, {{L512}}
*ThinkPad {{X40}}, {{X41}}, {{X41T}}
+
*ThinkPad {{R50}}, {{R50p}}, {{R51}}, {{R52}}, {{R60}}, {{R61}}, {{R61i}}, {{R400}}, {{R500}}
 
+
*ThinkPad {{SL Series}}
== Table of latch data from the (experimental) hdaps driver ==
+
*ThinkPad {{T41}}, {{T41p}}, {{T42}}, {{T42p}}, {{T43}}, {{T43p}}, {{T60}}, {{T60p}}, {{T61}}, {{T61p}}, {{T400}}, {{T410}}, {{T410i}}, {{T410s}}, {{T410si}}, {{T500}}, {{T510}}, {{T510i}}
 
+
*ThinkPad {{W Series}}
{| cellspacing="0" cellpadding="5" border="1"
+
*ThinkPad {{X40}}, {{X41}}, {{X41_Tablet}}, {{X60}}, {{X60s}}, {{X60_Tablet}}, {{X61}}, {{X61s}}, {{X61 Tablet}}, {{X100e}}, {{X200}}, {{X200s}}, {{X200 Tablet}}, {{X201}}, {{X201i}}, {{X201s}}, {{X201 Tablet}}, {{X300}}, {{X301}}
|- style="text-align:left;"
+
*ThinkPad {{Z Series}}
!Thinkpad!!bios firmware!!latch!!flip!!Value at 1.75 radians (southeast)!!Value at 0.75 radians (northwest)!!boxers!!hdd-type
 
|- style="text-align:left;vertical-align:top;"
 
|
 
:{{R51}}
 
:{{R52}}
 
:{{T41}}
 
:{{T42}}
 
:{{T42}}
 
:{{T43}}
 
:{{T42}}
 
:{{T42p}}
 
:{{T42p}}
 
:{{T42p}}
 
||
 
:1VET64WW
 
||
 
:01
 
:01
 
:01
 
:01
 
:01
 
:01
 
:01
 
:03
 
:03
 
:03
 
||
 
:reversed
 
:reversed
 
:reversed
 
:reversed
 
:reversed
 
:reversed
 
:reversed
 
:OK
 
:OK
 
:OK
 
||
 
||
 
||
 
||
 
:IC25N040ATMR04_0-ATA-DISK-drive
 
:HTS541060G9AT00_SATA-DISK-drive
 
|}
 
 
 
== Table of working / non-working drive firmware for the (experimental) hdaps driver park command ==
 
 
 
{| cellspacing="1" cellpadding="1" border="1"
 
|- style="text-align:left;"
 
!Drive!!firmware!!park command output
 
|- style="text-align:left;vertical-align:top;"
 
| IC25N040ATCS04-0 || CA40A71A || not parked
 
| IC25N040ATMR04-0 || MO2OAD4A || not parked
 
| IC25N040ATMR04-0 || MO2OADEA || not parked
 
| HTS548040M9AT00 || MG20A5BA || not parked
 
| HTS548040M9AT00 || MG20A5HA || parked
 
| HTS548080M9AT00 || (TBA) || parked
 
| ? || ? || ?
 
|}
 
  
[[Category:Glossary]]
+
[[Category:Glossary]] [[Category:ThinkPad Technologies]]

Latest revision as of 16:02, 22 January 2021

IBM Active Protection System

The Active Protection System

With the new series of ThinkPads IBM introduced the Active Protection System (APS) in 2003. The APS is a protection system for the ThinkPad's internal harddrive. A sensor inside the ThinkPad recognizes when the notebook is accelerated. A software applet then is triggered to park the harddisk. This way the risk of data loss in case of when the notebook is dropped is significantly reduced since the read/write head of the harddrive is parked and hence can't crash onto the platter when the notebook drops onto the floor.

The hardware sensor is capable of not only recognizing acceleration of the notebook, but also (to a certain degree) of its whole orientation in space, relative to gravity's axis. Furthermore, having the actual control put into software, its functionality is extendable and it gives chance to implement features like the "ignore minor shocks" feature which is present in the Windows based control applet. (This feature prevents the harddrive from parking in case of minor regular shocks such as occur when in a train or car.)

The measurements are physically performed by an Analog Devices ADXL320 accelerometer chip, managed by the embedded controller.

Hard-disk Support

HD-APS requires a hard-disk with head unload ramp technology and also support on the hard-disk firmware to unload heads without flushing the disk cache. This is required, because as soon as the APS system detects a shock is imminent, the system has less than 500ms to prepare for the shock.

Unloading heads without flushing the cache is done using the optional Unload Immediate feature of the IDLE IMMEDIATE ATA command. It finishes whatever sector write is in-flight, and immediately moves the heads to the unload ramp. Without this command, hard-disk APS cannot be trusted, as disks with big caches can take a lot of time to write it all to disk.

So far, only hard-disks with IBM APS firmware, as well as the consumer Fujitsu HV2060AH/MHV2100AH/MHV2120AH HDs have been found to implement all the necessary functions. Head unload technology is reasonably common in modern laptop disks, but the APS firmware is very rare in regular consumer products. Please note that newer Apple notebooks also support APS, so it is somewhat likely that their disks also support unload immediate or a similar feature.

(Update: February, 2009) Meanwhile, other HDD manufacturers may have added the necessary support to their new products. E.g., Hitachi Travelstar 7K320 spec does mention some 'Idle Immediate with Unload Option' command. The description reads pretty much like what's needed for APS, though I don't want to drop my almost new TP just to field-test it.

Linux Support

Linux support is in development.

This feature definitely depends on software and there is no hardware or BIOS-only way of making it work. IBM made contradictory statements about their willingness to release the specifications of the hardware sensor and its API to the linux community or some developers. Although a lot of developers and other interested people from the OpenSource community actively contacted IBM to get the specs, in fact they never got them.

However, after first efforts of Amit Singh on a PowerBook and Mark Smith on a ThinkPad, the HDAPS project was founded to produce a linux kernel driver for the acceleration sensor and a user space application to monitor it. Later, a kernel patch to enable harddisk parking followed.

See How to protect the harddisk through APS for instructions and Problem with APS harddisk parking for Troubleshooting.

Furthermore, a list of alternative applications like theft alarm and others can be found on the HDAPS driver page.

Tilt detection field tests

Using Perl code for WinXP:

use Win32API::File qw(:ALL);
sub get_tilt {
      my $file = createFile("//./ShockMgr", "r ke") or die "Can't get ShockMgr device";
      DeviceIoControl($file, 0x733fc, [], 0, my($buf), 0x24, my($bytes), []);
      my @data = unpack "x4s*", $buf;
      return @data[1, 0];
}

my T42 gives values of roughly 490 when at rest in normal upright position with base parallel to the ground. As I gently tilt the T42 through all possible x or y angles, the values range from about 335-645, meaning a resolution of about 155 units per Earth gravity. This seems to suggest that the operating range of the APS is actually about +-3 gs, although the ADXL320 is supposed to allow +-5 gs.

As the tilt angle is the arcsine of the normalized APS reading, the Thinkpad is most tilt sensitive when in a normal upright position with base parallel to the ground. In this position, the tilt resolution is about 0.35 - 0.4 degrees. At maximum tilt, the resolution is much worse, about 6.5 degrees.

Shouldn't matter much, but my tests are at an elevation of about 60 meters above sea level.

More field tests

When placed on a reasonably flat and reasonably horizontal work surface my T43 provides readings of about x=503 and y=569. I wrote a command-line application in C# (using the .NET DllImport annotation to access the sensor.dll API) to log the sensor readings at some interval. With 150ms sampling I found the following extreme values: 335 to 654 for x, and 409 to 723 for y.

 x: 494.5   +/- 159.5
 y: 566.0   +/- 157.0

Based on the maximum and minimum x and y readings I calculated the above "zero" and range values in order to convert the sensor readings to degrees and wrapped this up in a small graphical application for Windows. My data, source code, executables and a complete description can be found here.

See also

  • HDAPS - IBM Active Protection System Linux Driver. Shows various applications of APS.

Related Links

Models featuring this Technology