Hacker News new | past | comments | ask | show | jobs | submit login
Turn your PC upside down to boot into Linux (2003) (mini-itx.com)
176 points by PascLeRasc on Feb 2, 2016 | hide | past | favorite | 68 comments



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.


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).


> 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


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²


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.


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!


It would have to be followed by 1g, not 0g. Unless the laptop bounced in space.


The accelerometer on a laptop on a ballistic trajectory should still read 0, shouldn't it?


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.)


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.


> 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.


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.


Maybe supposed to be 9.8 m/s^2 ?


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 :>)


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)


Current Thinkpads don't necessarily have the accelerometer anymore, because they don't have spinning drives. ("hdaps" referred to "hard drive active protection system".)


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.


450 series are never sold with mechanical hdds ? Do they use it to report misuse ?


IIRC, even old(-ish) X200/X201 does not necessarily have accelerometer if it was factory configured with SSD.



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


I've been wanting to get access to the ThinkPad accelerometer in Linux but haven't yet found a way to do so.


I fooled around with it a while ago. Made my screen rotate based on accelerometer measurements: https://github.com/roevhat/tpRotate/


I don't think hdapsd works with newer ThinkPads, but I don't have a device to test it atm.


Shake laptop to boot Linux :)


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


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-...


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)


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.


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.


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.


Reversing the scanline lookup table is indeed how it was done.

Source: I disassembled it, a long time ago.


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


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.


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.


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.


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.


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.


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 :)


I did :)


Buy at gog.com :)


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.


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?


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.


I am talking about the "money hungry retailers" part in particular, and of course wondering why for example.


Shake it upside-down to reboot would be much more fun.


An oldie but a goodie : http://dilbert.com/strip/1995-04-03


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.


> 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.


Yeah I posted this on Sunday and it seems to just have taken off this morning - is that normal?


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!


Wow, thanks! I'm glad my posts are appreciated.


We're suckers for high-quality historical material that hasn't appeared here before. HN can never have enough of that.


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.


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...


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.


The points you are missing are 2003 and Celeron. Efficient and easy virtualization is relatively recent.


VMWare Workstation was already on its 4th major release by 2003.


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


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.


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


Indeed. It is quite amazing how history is being revised here. Software virtualization was extremely useful from day 1.


Dual-boot was entirely routine in the Linux world at this time. Especially as you could install it without disrupting your existing Windows installation.


Virtualization is still quite slow compared to running natively, especially for things like games.


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


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.



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).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: