News for hackers. Stuff that matters.
Re:Turn your PC upside down to boot into Linux (2003) by lorenzhs on Tuesday February 02, 2016 @08:59AM (#11019411)
High-end laptops like ThinkPads often have an accelerometer, I'm not quite sure how hard it would be to access it from GRUB2 but it would definitely be a neat trick to boot a hidden partition or something. Or maybe display a fake error message and refuse to boot if it's not sideways as a crude method of protection.
Re:Turn your PC upside down to boot into Linux (2003) by jsingleton on Tuesday February 02, 2016 @10:53AM (#11020175)
Many laptops have these sensors, often as part of a hard drive protection system. If it detects 9.8g suddenly going to 0g then it parks the read head as it's probably just been dropped. I'm not sure if they're still present in this era of SSDs. Maybe if they weren't part of the disk itself.

They were used by the Quake-Catcher Network project from Stanford. Although from the OS.

  ...seismic network by utilizing sensors in and attached to internet-connected computers.
https://github.com/carlgt1/qcn

Edit: Yes, I meant ms⁻² not g. Been a while since I've done any physics. 9.8g is probably more like what it would sense when hitting the floor, which is a bit too late to do anything useful. At least I didn't claim it to be 6.54×10⁻¹⁰ Nm²kg⁻² (bonus points if you get this).

Re:Turn your PC upside down to boot into Linux (2003) by delazeur on Tuesday February 02, 2016 @11:29AM (#11020411)
> If it detects 9.8g suddenly going to 0g then it parks the read head as it's probably just been dropped.

9.8g? Is your office inside a centrifuge? :-P

Re:Turn your PC upside down to boot into Linux (2003) by yoha on Tuesday February 02, 2016 @11:49AM (#11020551)
To clarify what delazeur meant:

g already means "9.8 m/s²"

Thus, normal gravity is 1g and free fall is 0g. 9.8g would mean 9.8 times the gravity at Earth surface, that is "96 m/s²". You would feel almost ten times as heavy. For reference:

Jupiter "surface" gravity is 25.9 m/s²

Sun "surface" gravity is 274 m/s²

Re:Turn your PC upside down to boot into Linux (2003) by yompers888 on Wednesday February 03, 2016 @01:14AM (#11025003)
Assuming force being applied along the axis of the spine, and that it continues, you would experience tunnel vision, lightheadedness, loss of consciousness, and eventual death. People can't really handle more than 5g on that axis without a special g suit.

Lesson: Don't try to take it standing up.

Re:Turn your PC upside down to boot into Linux (2003) by knodi123 on Tuesday February 02, 2016 @12:53PM (#11021040)
9.8g is actually a perfectly reasonable deceleration value at time of impact. So if it detects 9.8g followed by 0g, it's likely that it has bounced!
Re:Turn your PC upside down to boot into Linux (2003) by semi-extrinsic on Tuesday February 02, 2016 @01:27PM (#11021308)
It would have to be followed by 1g, not 0g. Unless the laptop bounced in space.
Re:Turn your PC upside down to boot into Linux (2003) by nitrogen on Tuesday February 02, 2016 @01:37PM (#11021372)
The accelerometer on a laptop on a ballistic trajectory should still read 0, shouldn't it?
Re:Turn your PC upside down to boot into Linux (2003) by semi-extrinsic on Tuesday February 02, 2016 @03:34PM (#11022290)
Ah, sorry. Yes, it will, because a typical accelerometer measures not the acceleration, but the deviation in acceleration from freefall. So it will show an acceleration of 1g when standing on a table, and 0g in freefall.

Which is obviously wrong if you think of it as measuring the acceleration of the laptop. The physical acceleration of the laptop is obviously zero when it is at rest on a table. (Acceleration is the change in speed, and the laptop has zero change in speed.)

Re:Turn your PC upside down to boot into Linux (2003) by theoh on Wednesday February 03, 2016 @02:16AM (#11025196)
Can you build a consistent accelerometer that does what you want?

If you think about the accelerometer as a little micromechanical arm which is being deflected relative to the laptop by the force of gravity, it makes a lot more sense. When they're falling together the deflection is 0.

Re:Turn your PC upside down to boot into Linux (2003) by semi-extrinsic on Wednesday February 03, 2016 @02:26PM (#11028961)
> Can you build a consistent accelerometer that does what you want?

I gave it some thought, and no, I don't think you can build a self-contained one. But if you allow external communications it becomes very doable (see: GPS system). Also, if you allow another input that tells the device it's orientation wrt. the gravitational field, say a magnetic field sensor, it becomes easy.

Re:Turn your PC upside down to boot into Linux (2003) by theoh on Wednesday February 03, 2016 @06:02PM (#11030608)
If your accelerometer measures what Wikipedia calls "coordinate acceleration" it's something observer relative so I expect (waves hands) "problems" will arise with measuring in relation to your chosen reference frame at relativistic speeds.
Re:Turn your PC upside down to boot into Linux (2003) by dikaiosune on Tuesday February 02, 2016 @11:45AM (#11020519)
Maybe supposed to be 9.8 m/s^2 ?
Re:Turn your PC upside down to boot into Linux (2003) by lorenzhs on Tuesday February 02, 2016 @03:20PM (#11022196)
I looked it up prior to my post, and at least the T450 has an accelerometer that's separate from the disk. agumonkey pointed out that noone has reversed the Windows driver yet, though, so no Linux support (and certainly no GRUB2 support :>)
Re:Turn your PC upside down to boot into Linux (2003) by agumonkey on Tuesday February 02, 2016 @09:20AM (#11019522)
Oh I remember someone managing to tap into that ! gosh ... I hope I can find it again.

ps: #ibmthinkpad refreshed my memory.

> old thinkpads (<= T60/61 or something): hdaps.ko from the kernel

> newer thinkpads (up to X201/T400/T410?) hdaps.ko from tp-smapi

> new thinkpads: no wai (simply because no linux driver as of now, nobody reversed the windows driver yet)

Re:Turn your PC upside down to boot into Linux (2003) by JoshTriplett on Tuesday February 02, 2016 @10:32AM (#11020025)
Current Thinkpads don't necessarily have the accelerometer anymore, because they don't have spinning drives. ("hdaps" referred to "hard drive active protection system".)
Re:Turn your PC upside down to boot into Linux (2003) by lorenzhs on Tuesday February 02, 2016 @03:24PM (#11022224)
The T450's Hardware Maintenance Manual reads

    The system board has an accelerometer, which can be broken when
    several thousands of G-forces are applied.
    Note: Dropping a system board from a height of as little as 6 inches
    so that it falls flat onto a hard bench can subject the accelerometer
    to as much as 6000 G's of shock.
so it seems like at least some current ThinkPads still come with an accelerometer, and it's not in the disk.
Re:Turn your PC upside down to boot into Linux (2003) by agumonkey on Tuesday February 02, 2016 @04:19PM (#11022708)
450 series are never sold with mechanical hdds ? Do they use it to report misuse ?
Re:Turn your PC upside down to boot into Linux (2003) by dfox on Tuesday February 02, 2016 @10:45AM (#11020116)
IIRC, even old(-ish) X200/X201 does not necessarily have accelerometer if it was factory configured with SSD.
Re:Turn your PC upside down to boot into Linux (2003) by eli on Tuesday February 02, 2016 @09:38AM (#11019611)
Re:Turn your PC upside down to boot into Linux (2003) by bcg1 on Tuesday February 02, 2016 @12:18PM (#11020776)
Could even consider implementing this inside a coreboot payload to load a "hidden" OS that on the BIOS flash chip.

https://www.coreboot.org/Linux

Re:Turn your PC upside down to boot into Linux (2003) by dheera on Tuesday February 02, 2016 @11:30AM (#11020422)
I've been wanting to get access to the ThinkPad accelerometer in Linux but haven't yet found a way to do so.
Re:Turn your PC upside down to boot into Linux (2003) by joakimbp on Tuesday February 02, 2016 @11:52AM (#11020574)
I fooled around with it a while ago. Made my screen rotate based on accelerometer measurements: https://github.com/roevhat/tpRotate/
Re:Turn your PC upside down to boot into Linux (2003) by lorenzhs on Thursday February 04, 2016 @04:44AM (#11032906)
I don't think hdapsd works with newer ThinkPads, but I don't have a device to test it atm.
Re:Turn your PC upside down to boot into Linux (2003) by sschueller on Tuesday February 02, 2016 @10:58AM (#11020196)
Shake laptop to boot Linux :)