Windows 7 USB

This is documentation on how to setup Windows 7 on USB, so it can be used with a USB debug device and WinDbg to track down Windows errors that are otherwise hard to debug (eg. black screen, Stop codes, ACPI issues).

Step 4: Install boot sector

For this, you need to run a Windows Console prompt as Administrator. It’s not enough to run as the admin user, but you need to go through the “run as administrator” + UAC motions.

On Windows 7, the fastest way is to open the start menu, type “cmd” in the search field, wait for cmd to appear (with that black window + C:\ icon), right click it, and select “run as administrator”. On Windows 8, there's an Admin Command Line in the Win+X menu.

Move to the drive with the install data (E:\ in my case), enter boot\, and run bootsect like this:

Step 5: Prepare installer for USB debug device

If you have access to the legacy serial port, you can use that to run a kernel debugger session without usb debug device (and its setup, which can be complicated in the presence of Rate Matching Hubs).

In such a setup, instead of the first command use

bcdedit /store bcd /dbgsettings serial debugport:1 baudrate:115200

Step 6: Install

Start your coreboot + seabios system, and make it boot from your USB device.
If everything is well, dance and jump with joy! If not, you have a chance to improve coreboot!

Step 7: Boot Windows

Once installation is done, boot the new system. That’s another source of trouble, since this is a slightly different Windows than the one driving the installer.
And there was no chance to setup debug mode for it yet! (TBD)

Setup Debugging Environment

Configuring WinDbg

First, install WinDbg. You can find in the Debugging Utilities for Windows. Set up the symbol file path, so it can resolve the addresses it gets from the target: