Offtopic: mechanical calculators (cardboard and wood!)

A few days ago I happened to stumble with this fun article of a mechanical 4-bit calculator made in cardboard. Even if it’s quite unreliable, is interesting to see the methodical approach and all the creativity to make this work with only cardboard and marbles.

In the comments of the article there is a Youtube video of a calculator that implements 6-bit addition made in wood. It is very reliable, and it takes a completely different approach.

Converting a physical machine to VM

After many years in software development, I’ve switched machines many times. But I always tried to keep the old ones stored, just in case. Today I’ve finally decided to convert this old machines to a VM, and store only a hard disk and not the whole hardware.

First of all, I started the conversion using VMware vCenter Converter: I installed it to the physical machine (booting it was a small adventure by itself…), and made an image of the disk.

Then, I moved the image to my current system, and started VirtualBox. You can use VMware disk images in VirtualBox. The problem you can find is making Windows to boot. The machine I was converting was an old Windows XP, and switching from real hardware to virtual one poses a problem for this OS: the disk drivers used to boot the system up are “hardwired” at installation time, making this switch somewhat tricky.

So, I tried using the following parameters for the VM with no luck:

  • chipset: PIIX3
  • IO APIC disabled
  • PAE/NX enabled
  • IDE controller PIIX4 (original disk was ATAPI)

On first boot and next several attempts I got a STOP 0x0000007B. After some search, I found the solution was a registry tweak (Mergeide.reg) to be done before moving the system (i.e. before creating the disk image), plus unpacking some drivers to system32\drivers.

So, my solution instead of recreating the disk image was to attach the disk image to another working Windows XP VM, unpack the drivers and do the registry tweaks with this particular changes:

  • Load the system registry hive from the (still) non-functioning disk image by following this procedure. Where it reads “Highlight the HKEY_LOCAL_MACHINE-window and select the root of the tree” this means to select the HKEY_LOCAL_MACHINE key. I used the name “_system” (underscore preceding system).
  • You must tweak the mergeide.reg to point to “HKEY_LOCAL_MACHINE\_system” instead of “HKEY_LOCAL_MACHINE\system” and to “ControlSet00x” instead of “CurrentControlSet”. As I was not sure of which ControlSet was the active one (ControlSet001 or ControlSet003) I repeated the steps for both.
    WARNING: if you apply the changes to system instead of _system you can damage your working VM.
    Second WARNING: if you apply the changes to “CurrentControlSet” the system will not boot, with a STOP 0x67: CONFIG_INITIALIZATION_FAILED. To correct this, load the system hive again and remove the whole “CurrentControlSet” key, and then apply the registry patch again for “ControlSet00x”

That’s it! The system should boot now. After that, you will have to install Guest Additions, configure drivers, etc.

Switching to Firefox again

The other day I stumbled upon the article Windows Timer Resolution: Megawatts Wasted and to make long story short, I ran powercfg -energy duration 5 on my system and found that Chrome, Spotify and Naver’s Line client for Windows were making my system to increase timer resolution to 1 ms, wasting energy and making my laptop run warmer than expected.

So I’ll be switching back to Firefox after quite a while using Chrome as my main browser, at least for regular browsing. Let’s hope Google fixes this soon.

Also, I’ve switched to Windows Store App version of Line client (my system runs Windows 8.1), and I’m considering what to do with Spotify.

UPDATE: maybe I’ve switched browsers too fast: now I’m seeing Firefox also increasing timer resolution to 1 ms! Possible causes:

  • Plugins (Flash, maybe?)
  • Google Mail
  • donno…

I’ll keep you posted.