OpenBSD Journal

Active Protection System support

Contributed by mk/reverse on from the finally-laptop-tossing-can-be-in-the-olympics dept.

Jonathan Gray committed support for the Active Protection System accelerometer found in recent IBM laptops. He adds that there is a list of models that have it and an IBM whitepaper about it. If you want to see it in action, there is a video demonstrating a laptop suspending the harddrive while falling to the floor.

NOTE: Currently the driver does not attempt to suspend the laptop drive so don't start tossing around your laptop and complain that it broke.

This driver adds some sensors to the hw.sensors sysctl(3) hierarchy. Some of these can be used with sensorsd(8) to do actions e.g. when the lid is opened or closed or when the keyboard is being used.

If you read Japanese, here are some design notes and an interview with the designers.

This work is based on information coming from a reverse engineering of the Windows driver by Mark Smith and Anurag Sharma. For Mac OS X, a tool for reading values off the Apple equivalent called Sudden Motion Sensor exists.

(Comments are closed)

    1. By Michael Knudsen ( on

      It's just not cool to lose in a game because the busdriver doesn't notice the red light until the very last second.

    2. By jsg ( on

      aps0 at isa0 port 0x1600/31
      wsmouse1 at aps0 mux 0

      draw your own conclusions :)

      1. By djm ( on

        pity the z. doesn't have one, it would be easier than the stylus...

        1. By jsg ( on

          The really neat thing with the z would be dynamically rotating the display to always be the right way up.

          1. By Anonymous Coward ( on

            Mine only does portrait mode for installation and landscape for normal use.

            It doesn't seem to notice if I switch between them.

      2. By Anonymous Coward ( on

        Come now, we all know that we'd go for the etch-a-sketch mode on our laptops... shake vertically while holding your laptop vertically, and voila, the screen is cleared... :)

  2. By ViPER ( on

    Even if it is going to work.
    It's nothing more then a nice feature for the lad that worked his ass of for his private pocket paid laptop he uses on the job. A company (graphics design) where i'm doing the network administration right now has about 50 people with notebooks ranging from alienware show-off laptops to powerbooks etc. They render there workhorse `dead` if a key broke of the keyboard. (Damn Fly!) `rma hassle hassle, just get me a new one please` ..... I'm working about 4,5 years straight on my Dell Latitude X200...... No, i'm not `that` gentle with it, i'm just that lost without it ;/

    1. By rogern ( on

      Hello, I got an old Panasonic Toughbook CF-71 off of ebay for $200.00 + shipping. I probably overpaid for it as I had to buy a new battery. But it as fun to put OpenBSD 3.7 on it and it works great! Typing this reply on it. Tried OpenBSD on old IBM 600E but received AC97 errors but it would boot up and run. I like OpenBSD! rogern

      1. By jmcneill ( on

        The audio chip in the Thinkpad 600E doesn't have an AC97 codec. Not sure how it works with OpenBSD, but on NetBSD it either attaches as wss@pnpbios or wss@acpi. You might need to port the attach glue to make it work properly.


        1. By seigemann ( on

          The sound chip in the TP600E actually works just fine. It gives sysbeeps and anyyhing you play with mpg123.. I haven't had any luck using other programs for playing music though.

  3. By Anonymous Coward ( on

    To have support for this kind of features in OpenBSD is great, thanks Jonathan!
    I'm still left wondering, why why has the driver to be involved in this? 'Emergency' head retract/park is the kind of feature that I would expect the drive itself to handle, independently of the OS, at least by default.
    Seagate laptop drives for example can be heard parking if the power supply starts to dwindle; no driver involved (fortunately).
    Back to the IBM/Hitachi drives: I usually turn my laptop on while grabbing it, ie _before_ heading towards the couch or whatever my workplace is going to be. What if I drop it then, while the OS is still in its early boot stage? Kaboom, sorry IBM, your protection didn't help here.

    1. By Brad ( brad at comstyle dot com on

      If you're going to post something you could at least make some sense. The last post made no sense at all. What does a lower power situation have anything in common to do with a laptop being DROPPED?! The Seagate drive does no better than any other drive in this situation. You drop the laptop and if the heads are not parked you have a very good chance of having physical damage, game over.

      1. By Anonymous Coward ( on

        I think the poster was trying to communicate that he feels the feature *should* be a feature of the hardware, and not rely on drivers or interaction with the OS.

        1. By Paladdin ( on

          And that really makes sense, as one could update his/her HDD without having to buy -and pay :/- another notebook.

    2. By Anonymous Coward ( on

      Yes, it would be better to have HDD's that do this automatically without requiring OS intervention and a driver. However I believe that since we don't have HDD's that do this we should take advantage of the protection mechanisms we do have. I look forward to this protection being added to OpenBSD where the hardware supports it.

    3. By Nick Holland ( on

      Imagine: you drop your laptop, the drive *may* get dammaged. Two cases:
      1: the drive was going to get dammaged, in which case, you probably would wish the thing had auto-parked.
      2: The drive was going to survive that event...but having the hard drive suddenly go off line and the OS not expecting it, causes the OS to panic/bluescreen/whatever, resulting in possible corruption of the file system.
      2a: The file system easily recovers: you cuss and swear, and you don't remember the drop, but you remember the crash and you think, "this computer is junk!".
      2b: The file system (or valued files in it) is corrupted, in which case you are pretty close to where you were in case 1...

      However...if you put hooks in the OS to deal with it semi-elegantly, you can get around all those problems, including the all-important image issue...and it will work with any brand disk, not just Brand X which happens to have a built-in drop sensor.

      Practically? I've lost a few laptop disks, none of them were due to dropping the laptop. And yes, I've dropped a few laptops. In addition to being a clutz, I used to have a good demo I used to do where I would drop the laptop made by my (long-ago) employer several inches to the table...and invite the customer to do that with the competition's...then point out that it was my personal laptop, not a store demo I just did that with (same machine made a meter+ drop to a tile floor accidently...had to snap a few things back together, but worked fine). I think I stood on my laptop a few times, too. Don't know how many HDs are dammaged by dropping, but I suspect a lot more screens bite the dust that way than disks. In fact, I'd suspect one of the last parts to survive many laptop drops is the disk itself... i.e., I think it is 90% publicity stunt.

      But having a sensor and drivers for it is cool. :)


  4. By Dunceor ( on

    Hehe one of my friends just hacked a little driver for this on What The Hack also based on the information the guy that wrote the Linux driver for it. Pretty useless thing but cool :)

  5. By Matthieu Herrb ( on

    Here is a simple Tk application that will display the pitch and roll of your Thinkpad in X. Hitting 'z' will set the zero of the display.


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]