Flip Your Desktop Over To Boot Linux

[Andy France] built his computer into a Windows XP box. (Yes, this is from the past.) He needed to run windows most of the time, but it was nice to boot into Linux every now and then. That’s where the problem lay. If he was running Linux on his Windows XP case mod, he’d get made fun of. The only solution was to make a Linux sleeve for his computer. He would slide the sleeve over the case whenever he ran Linux, and hide his shame from wandering eyes. Once his plan was fully formed, he went an extra step and modified the computer so that if the sleeve was on, it would automatically boot Linux, and if it was off it would boot Windows.

The Linux sleeve could only slide on if the computer was flipped upside down. So he needed to detect when it was in this state. To do this he wired a switch into one of the com ports of his computer, and attached it to the top of the case mod. He modified the assembly code in the MBR to read the state of the switch. When the Linux sleeve is on (and therefore the computer is flipped over) it boots Linux. When the sleeve is off, Windows. Neat. It would be cool to put a small computer in a cube and have it boot different operating systems with this trick. Or maybe a computer that boots into guest mode in one orientation, and the full system in another.

[via HackerNews]

27 thoughts on “Flip Your Desktop Over To Boot Linux

  1. Ah yes. Boot shenanigans.

    I remember writing a floppy boot sector that would write a special signature byte in low memory somewhere and then load and execute the MBR from the hard disk. The code in the MBR would boot DOS from the hard disk and somewhere in config.sys it had a device driver called clear.sys which would clear the screen and check if the signature byte was there. If not it would give an error message and halt the machine (and there was no way out because during config.sys loading, DOS didn’t check for Ctrl-Break). That way the computers in the lab at my university would (appear to) only boot if they had a student disk inserted.

    1. But what about disks you hadn’t tinkered with? This presumably only tripped up when the dos system files had been copied onto a new disk (and maybe not even then, depending on how DOS makes new boot disks form old ones, and if it copies the MBR).

  2. I did this a long time ago in a computer with two bootable ISA harddrives. But I built a cable that plugged into the master/slave headers on both of the drives. Each had a different OS installed. The toggle switch on the front of the computer would control which drive was master and which was slave, which in turn controlled which one was booted from on power up. Worked great, as neither OS knew about the other one.

        1. I thought you may have been talking about the very first common drives and controllers. We just called them MFM and RLL back then.

          But yes (P)ATA DMA33 DMA66 and UDMA133 – the later being 133 MB/s. I just ordered a SSD and it’s 550MB/s so I don’t know what needed UDMA133 20 years ago.

  3. Cute, but this would get old quick. How many times have you tried to pull a PC a few inches forward on your desktop, to find that a cable somehow got stuck on something? Same would happen when you try to flip this, because the cables need to go a few inches further up when the PC is upside-down. Even with good cable management, you’d have to remember to alternately rotate clockwise/counterclockwise, else they’ll get twisted together. And to maintain the facade that is the whole reason behind this odd design, you need to keep the Linux sleeve handy. Usually empty, but taking up room in your limited “readily accessible” space all the same. Not practical. Might even be bad Feng Shui, if you’re into that.

    1. Agreed.
      “He modified the assembly code in the MBR to..” he did what now!?
      Hooking up a switch to a serial port is easy, I’ve done that myself and didn’t even need to code anything. But changing an MBR’s assembly code? That takes some knowledge and skills.
      Of course this was in the olden days, when programming got lowlevel pretty quick.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.