Sunday, August 1, 2010

Booting XP with the new motherboard

You may remember how I recently got a new motherboard.. and then I changed the CPU. I thought I'd get my motherboard to boot Windows XP.

When I upgraded to Windows 7 from Windows XP I installed Windows 7 on a brand-new solid state drive (remember when I got one of those?). This left me with the original installation of Windows XP on the existing hard drive. This is a sweet arrangement as it meant I could boot up with Windows XP if I discovered of applications that can't run in Windows 7. It's also useful to have your old Windows XP around if you want to look up some setting or bookmark or something that won't transfer over to Windows 7.

When I changed the motherboard I could no longer boot into Windows XP. I'm not entirely sure why that happened. My suspicion, at the time, was the drive numbers changed around. Windows XP keeps track of which drive number it's booted from in the boot.ini file. I went into the boot any file and tried changing the numbers to my best guess as to what what they should be but for some reason it wasn't working. I'm still not sure why it didn't work, actually. I think it may have had something to do with me screwing up the file format a little. I thought the '#' symbol was used to denote comments when in reality it's the ';'. Oh dear.. a little too much Linux shell scripting.

In any case, it wasn't working so I tried to use the utility EasyBCD to re-create the Windows XP boot option. This failed as well. I'm not sure why this failed either. I'm not sure what EasyBCD was trying to do but my booting arrangement is a bit unusual in that my old Windows XP drive contains the boot loader which then boots Windows 7 on my new solid-state drive. I think EasyBCD was a bit confused by this. When I would launch Easy BCD, it couldn't find the BCD file, for instance. I think it was setting everything up thinking the boot loader was being run from the solid-state drive. In any case, it I was left pretty much where I started except that now I kept getting messages about NTDETECT failing.

I noticed that EasyBCD had messed with files that Windows XP uses to boot. I tried to repair the Windows XP installation by running a few commands off the Windows XP repair CD. Many of the Windows XP commands were throwing errors and clearly had no idea what Windows 7 and easy BCD had done to the installation.

(The BIOS bone's connected to the MBR record. The MBR's connected to the PBR. The PBR points the BCD file.. but not on my system 'cause it's b0rked. yeah!)

I tried rebooting and was surprised to find I couldn't even boot Windows 7 now. After much swearing I used the Windows 7 repair CD to try and repair the installation. The Windows 7 installation CD had no idea what I'd done. I had no idea what I'd done. Things were going from bad to worse. I knew that the Windows 7 repair CD (or at very least the Windows 7 installation itself) would have the tools I needed to repair the Windows 7 installation. Theoretically, all I would need to do is generate a new BCD file that would point to the already installed Windows 7 installation. The thing was, I didn't know what the damn commands were that did that.

I tried to use EasyBCD but that didn't work as it needed the full Windows 7 to run; the repair CD didn't cut it. I couldn't even run the command line versions of EasyBCD. After a further sampling of four letter expletives, I started up the old Dell netbook and poked around the Internet looking for a solution. It turns out that, in the Windows\System32 directory, you can find two commands that will allow you to manipulate the BCD file. "bcdboot.exe" allows you to build a new BCD file and "bcdedit.exe" allows you to edit said file to add additional boot options. Sweet.

To make a long story short I used bcdboot.exe to make a new BCD file on the solid-state drive. I then switched the solid-state drive to my primary boot drive in the BIOS. With that I could boot into Window 7. yay! I then added the Windows XP installation as an option with EasyBCD. I now had a choice between the two operating systems when I booted. This all went so well that I also took a stab at repairing the BCD file on the Windows XP installation just in case my solid-state drive (containing the all important BCD file and Windows 7 installation) died. If the solid-state drive died I could boot directly to Windows XP on my other hard drive. I haven't actually tested it yet. I think it might boot Windows 7 but I don't hold out much hope that it's going to actually boot Windows XP. To do that I would need to use that BCD file to boot into Windows 7 and then used it two commands to add a second entry for Windows XP. This is precisely what I couldn't figure out how to do the first time. Oh well, maybe I'll try it again.. A bit later...

Now that Windows XP is booting all I need to do is install the drivers and get ACHI working again. Weeeeeeeeeeeeeeeeeeeeee......


No comments: