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

Windows 7 might work on FAT, but Windows 8 definitely won’t, as the main file archive is >4GB, which even FAT32 doesn't like.

+

+

For reference, I called the volume “WININST”, but I doubt that matters.

+

+

=== Step 3: Copy the entire disk content to disk ===

+

I started out from an ISO image (as obtained from digitalriver), and extracted it using 7-zip to the media.

+

After that I had a directory that looks like this:

+

+

E:\>dir

+

Datenträger in Laufwerk E: ist WININST

+

Volumeseriennummer: 86DF-6846

+

+

Verzeichnis von E:\

+

+

12.04.2011 11:38 122 autorun.inf

+

03.05.2012 18:54 <DIR> boot

+

12.04.2011 11:38 383.786 bootmgr

+

12.04.2011 11:38 669.568 bootmgr.efi

+

03.05.2012 18:54 <DIR> efi

+

12.04.2011 11:38 106.768 setup.exe

+

03.05.2012 18:56 <DIR> sources

+

03.05.2012 18:56 <DIR> support

+

03.05.2012 18:56 <DIR> upgrade

+

4 Datei(en), 1.160.244 Bytes

+

5 Verzeichnis(se), 4.976.803.840 Bytes frei

+

+

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

+

+

C:\Windows\System32>e:

+

+

E:\>cd boot

+

+

E:\boot>bootsect /nt60 e: /force /mbr

+

Target volumes will be updated with BOOTMGR compatible bootcode.

+

+

E: (\\?\Volume{39f55ea8-3ea1-11e1-afe7-005056c00008})

+

+

Forced dismount complete, open handles to this volume are now invalid.

+

+

Successfully updated NTFS filesystem bootcode.

+

+

\??\PhysicalDrive2

+

+

Successfully updated disk bootcode.

+

+

Bootcode was successfully updated on all targeted volumes.

+

+

=== Step 5: Prepare installer for USB debug device ===

+

In the same Console prompt (and same directory), run:

+

+

bcdedit /store bcd /dbgsettings usb targetname:TargetSystem

+

bcdedit /store bcd /set {default} debug yes

+

+

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

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: