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 :)
Re:Turn your PC upside down to boot into Linux (2003) by ksherlock on Tuesday February 02, 2016 @12:08PM (#11020701)
Cute trick. Reminds me of the Karateka easter egg -- if you inserted the floppy disk upside down[1], the graphics displayed upside down.

1. 95% of HN is now confused

Re:Turn your PC upside down to boot into Linux (2003) by dordoka on Tuesday February 02, 2016 @12:26PM (#11020838)
For those interesed, I was among the not-confused-but-curious (I'm old enough to even have inserted cassette tapes on a computer) and found out this [0] explanation :) Nice story, thanks ksherlock.

[0]: http://www.geek.com/games/karateka-apple-ii-floppy-disk-had-...

Re:Turn your PC upside down to boot into Linux (2003) by speeder on Tuesday February 02, 2016 @01:37PM (#11021379)
Unfortunately it is not explained HOW they did it.

It is somewhere on Mechner site and diaries, but I can't find it again.

Basically, one day while coding, he found out that one single bit caused a bug in rendering that flipped the whole game upside down, it was completely unintentional.

But he thought it would be hilarious to make the easter egg (indeed, it was).

Later he used the same technique on Prince of Persia game (there is an area of the game where you drink a potion that flips that bit, flipping the whole game upset down, this had to be emulated for non-Apple systems, probably caused some pain to people porting the game :P)

Re:Turn your PC upside down to boot into Linux (2003) by wang_li on Tuesday February 02, 2016 @03:42PM (#11022358)
The Apple II floppy drives were single sided. It would be trivial to put different code on the other side of the floppy disk itself.

A single bit error that would simply flip everything upside down seems quite improbable given the Apple II hardware. I wouldn't be surprised if a bug inspired the easter egg, but I'd be shocked if there was a single bit difference between the front and back of the floppy.

Re:Turn your PC upside down to boot into Linux (2003) by speeder on Tuesday February 02, 2016 @05:11PM (#11023088)
I think it was related to something about how a pointer to the video data worked in the game engine (not a property of Apple II itself).

Maybe it was the positive/negative bit that was flipped, and made the pointer read backwards and underflow, but end rendering anyway due to some hardware quirk.

Re:Turn your PC upside down to boot into Linux (2003) by wang_li on Tuesday February 02, 2016 @05:51PM (#11023352)
I don't believe that the 6502 had such a thing as a positive/negative bit that would have this kind of effect.

On that hardware, if I was going to do this, I'd just reverse the order of the entries in the scanline lookup table. On the Apple II the address of the first pixel of each scanline did not follow immediately after the address of the last pixel of the prior scanline. So every program that did any graphics work used a lookup table to get the address of a particular scanline.

As long as you were consistent in your use of this table, that would be the only necessary change to flip the game upside down.

Re:Turn your PC upside down to boot into Linux (2003) by apricot on Tuesday February 02, 2016 @09:34PM (#11024382)
Reversing the scanline lookup table is indeed how it was done.

Source: I disassembled it, a long time ago.

Re:Turn your PC upside down to boot into Linux (2003) by SFjulie1 on Tuesday February 02, 2016 @09:54AM (#11019715)
http://www.linux.sh/loadlin.html

in 2003 you still could install linux on a FAT32 system and boot from windows, you could even share your swap space with the file windows was using for the same purpose.

So an autoexec.bat with a menu and loadlin called in the process. It was not even a big penalty.

We were real hackers like this : http://www.tsgk.net/cowboyz/tdc.html

Re:Turn your PC upside down to boot into Linux (2003) by rdl on Tuesday February 02, 2016 @10:11AM (#11019841)
Software delivered in large physical boxes; not so much nostalgia but horror at 1) how wasteful the process was 2) how skewed it made things -- not being able to easily patch and thus deathmarch or even late shipping, and then the horrors of shipping crap and then hoping the patch would fix it, because you had to ship on a specific date.

And just how hard to make/expensive/etc. boxes, manuals, etc. were, and how annoying it was to manage inventory.

Re:Turn your PC upside down to boot into Linux (2003) by gh02t on Tuesday February 02, 2016 @10:22AM (#11019942)
I can remember when PC game boxes shrunk down from the huge size to the smaller format. And now they are "shrinking" into nothingness with digital distribution.
Re:Turn your PC upside down to boot into Linux (2003) by ge0rg on Tuesday February 02, 2016 @11:29AM (#11020412)
Yes, and the games you "buy" also shrink into nothingness if the distributor goes bankrupt or you are accused to violate somebody's ToS. I wish back for the physical distribution of game media and offline validation of serial numbers, if only to be able to play my old games in 20 years.
Re:Turn your PC upside down to boot into Linux (2003) by derefr on Tuesday February 02, 2016 @08:46PM (#11024207)
I have a feeling that people like 4am (http://ascii.textfiles.com/archives/4630) will still exist 20 years from now, taking DRMed games from today and figuring out how to convince them they're running on today's hardware and talking to today's servers, when it's really all stuffed into a twee little emulator running on your VR nosering.
Re:Turn your PC upside down to boot into Linux (2003) by gh02t on Tuesday February 02, 2016 @03:58PM (#11022520)
True, though half the time nowadays all the physical copy does is link to a download. The last game I can remember buying a physical copy of was Civ V and basically the only thing in the box was a link to download it on Steam. With the onerous always-on DRM that seems so prevalent in many games today I'm not optimistic that I'll be able to play many of the more recent games I "own" in 20 years anyway.
Re:Turn your PC upside down to boot into Linux (2003) by jhasse on Tuesday February 02, 2016 @04:18PM (#11022704)
There are recent games which go against this trend. For example the last one I bought without DRM was Divinity: Original Sin Enhanced Edition. Support them :)
Re:Turn your PC upside down to boot into Linux (2003) by gh02t on Tuesday February 02, 2016 @05:19PM (#11023137)
I did :)
Re:Turn your PC upside down to boot into Linux (2003) by jhasse on Tuesday February 02, 2016 @03:01PM (#11022050)
Buy at gog.com :)
Re:Turn your PC upside down to boot into Linux (2003) by JadeNB on Tuesday February 02, 2016 @03:23PM (#11022220)
I remember the interval where there was nothing to put in the boxes, but no-one wanted to be the first to break and shrink them, so they were still huge but the contents were just a CD and a lot of cardboard stiffener.
Re:Turn your PC upside down to boot into Linux (2003) by yuhong on Tuesday February 02, 2016 @02:16PM (#11021707)
From https://groups.google.com/d/msg/comp.sys.mac.announce/vTmp-b... :

"Our previous policy of distributing system software via user groups and electronic bulletin boards reached only a small percentage of our customer base while often discouraging traditional software resellers from stocking and promoting new releases of system software."

I wonder why?

Re:Turn your PC upside down to boot into Linux (2003) by toomanybeersies on Tuesday February 02, 2016 @03:55PM (#11022486)
That was 1992. Internet connections were a lot less common and more expensive back then, and I'd imagine that money hungry retailers weren't too keen on the idea of people being able to get stuff for free.
Re:Turn your PC upside down to boot into Linux (2003) by yuhong on Tuesday February 02, 2016 @05:36PM (#11023256)
I am talking about the "money hungry retailers" part in particular, and of course wondering why for example.
Re:Turn your PC upside down to boot into Linux (2003) by noonespecial on Tuesday February 02, 2016 @01:11PM (#11021172)
Shake it upside-down to reboot would be much more fun.
Re:Turn your PC upside down to boot into Linux (2003) by ChuckMcM on Tuesday February 02, 2016 @01:17PM (#11021222)
An oldie but a goodie : http://dilbert.com/strip/1995-04-03
Re:Turn your PC upside down to boot into Linux (2003) by noonespecial on Tuesday February 02, 2016 @01:31PM (#11021343)
Thanks. That's the one I was thinking of but for some reason I was remembering it as having been a "User Friendly" so my google-fu failed me.
Re:Turn your PC upside down to boot into Linux (2003) by golergka on Tuesday February 02, 2016 @09:15AM (#11019500)
> Greetings Hackaday visitors and Time Travellers from the early 2000s!

This is the best reaction I have ever seen to a sudden surge of traffic to an old page.

Re:Turn your PC upside down to boot into Linux (2003) by PascLeRasc on Tuesday February 02, 2016 @11:35AM (#11020455)
Yeah I posted this on Sunday and it seems to just have taken off this morning - is that normal?
Re:Turn your PC upside down to boot into Linux (2003) by dang on Tuesday February 02, 2016 @02:39PM (#11021875)
dikaiosune has it right. We put it in the second-chance pool, described at https://news.ycombinator.com/item?id=10705926 and earlier posts linked from there. It's the latest in a long series of experiments to try to give good stories a second crack at the front page.

Edit: Wow, you've been posting some great articles: https://news.ycombinator.com/submitted?id=PascLeRasc. We've put https://news.ycombinator.com/item?id=11007792 in the second-chance pool and we'll send you a repost invite for https://news.ycombinator.com/item?id=10932621. (After a few days have gone by, we do the latter instead of re-upping the post.) Hope you'll keep up the great submissions!

Re:Turn your PC upside down to boot into Linux (2003) by PascLeRasc on Tuesday February 02, 2016 @03:00PM (#11022041)
Wow, thanks! I'm glad my posts are appreciated.
Re:Turn your PC upside down to boot into Linux (2003) by dang on Tuesday February 02, 2016 @04:10PM (#11022634)
We're suckers for high-quality historical material that hasn't appeared here before. HN can never have enough of that.
Re:Turn your PC upside down to boot into Linux (2003) by dikaiosune on Tuesday February 02, 2016 @11:46AM (#11020527)
Sometimes the mods take things they think were unfairly missed and put them on the bottom of the front page to see if that generates interest.
Re:Turn your PC upside down to boot into Linux (2003) by jsingleton on Tuesday February 02, 2016 @12:19PM (#11020794)
Hackaday got the story from here and linked to this which may have generated interest.

http://hackaday.com/2016/02/01/flip-your-desktop-over-to-boo...

Re:Turn your PC upside down to boot into Linux (2003) by larrydag on Tuesday February 02, 2016 @09:01AM (#11019425)
Perhaps I'm missing the point. If one is going to boot up between OS's that often wouldn't virtualization work best? Other than that it is a neat hack.
Re:Turn your PC upside down to boot into Linux (2003) by KC8ZKF on Tuesday February 02, 2016 @09:09AM (#11019473)
The points you are missing are 2003 and Celeron. Efficient and easy virtualization is relatively recent.
Re:Turn your PC upside down to boot into Linux (2003) by thrownaway2424 on Tuesday February 02, 2016 @10:43AM (#11020098)
VMWare Workstation was already on its 4th major release by 2003.
Re:Turn your PC upside down to boot into Linux (2003) by mattdotc on Tuesday February 02, 2016 @01:58PM (#11021556)
Which wasn't really free if I remember correctly. You had to buy or crack it. Also, I don't think the performance really compared on consumer desktop hardware. As annoying as dual-booting was, it was the way all of my hobbyist friends and I preferred back then.

edit: grammar

Re:Turn your PC upside down to boot into Linux (2003) by dsp1234 on Tuesday February 02, 2016 @03:16PM (#11022163)
Hardware virtualization for intel/amd processors did not come until 2006. So you could run VMWare and get decent performance with paravirtualized drivers, but running a completely different OS would have required software virtualization, and it was not fast by any means. Booting to the other operating system was a much better experience since the OS would then have full use of the resources without software virtualization being in the way.
Re:Turn your PC upside down to boot into Linux (2003) by wang_li on Tuesday February 02, 2016 @03:51PM (#11022448)
Software only virtualization was faster than the first generation of hardware supported virtualization.

See page 7. of this document: http://www.vmware.com/pdf/asplos235_adams.pdf

Re:Turn your PC upside down to boot into Linux (2003) by thrownaway2424 on Tuesday February 02, 2016 @04:33PM (#11022841)
Indeed. It is quite amazing how history is being revised here. Software virtualization was extremely useful from day 1.
Re:Turn your PC upside down to boot into Linux (2003) by pjc50 on Tuesday February 02, 2016 @10:55AM (#11020181)
Dual-boot was entirely routine in the Linux world at this time. Especially as you could install it without disrupting your existing Windows installation.
Re:Turn your PC upside down to boot into Linux (2003) by nitrogen on Tuesday February 02, 2016 @01:42PM (#11021420)
Virtualization is still quite slow compared to running natively, especially for things like games.
Re:Turn your PC upside down to boot into Linux (2003) by jimlei on Tuesday February 02, 2016 @03:38PM (#11022321)
Well, "quite slow" is of course subjective. But compared to 10+ years ago standards it's barely noticeable today. It seems to be mostly an issue with GPU virtualization. So if you plan your hardware and set it up right (pci passthrough) you can get very good performance, even in a VM. To see it (over)done, check out Linus Tech Tips

2 Gaming Rigs, 1 Tower - Virtualized Gaming Build Log https://www.youtube.com/watch?v=LuJYMCbIbPk

7 Gamers 1 CPU is back! But does it ACTUALLY work!? https://www.youtube.com/watch?v=opX-AsJ5Uy8

Re:Turn your PC upside down to boot into Linux (2003) by nitrogen on Wednesday February 03, 2016 @01:49AM (#11025106)
If I understood the video correctly that was a dual-socket Xeon system, though, and there was considerable stuttering visible from time to time even if average framerates were decent.
Re:Turn your PC upside down to boot into Linux (2003) by jimlei on Wednesday February 03, 2016 @03:36AM (#11025418)
Re:Turn your PC upside down to boot into Linux (2003) by nitrogen on Wednesday February 03, 2016 @12:50PM (#11028033)
I read the Reddit post; that looks easier to set up than I thought. I might give it a try some day. But I don't mind rebooting to switch OS anyway (10s boot times plus fast legacy BIOS).