Sharing two companion experimental projects that do the 32↔64 bit UEFI firmware handoff in both directions. Both verified booting Windows under QEMU.
**efi64boot** — a 32-bit IA32 `BOOTIA32.EFI` that hosts a 64-bit EDK2 OVMF64, switches the CPU to long mode, and hands off to OVMF64’s SEC entry. Boots `win10ltc.iso` under QEMU (TCG + KVM; core2duo and qemu64 CPUs). Useful on machines with 32-bit firmware but 64-bit-capable CPUs — instead of emulating the 64-bit world, it hosts the real 64-bit firmware.
**efi32boot** — the reverse: a 64-bit host that hands off to a 32-bit OVMF32. Same hosting machinery, mode switch flipped.
Both are AI-assisted experimental projects, not production-safe.
Shared mechanics:
- Embedded firmware copied below 4 GiB with base relocations applied.
- Firmware MEMFD region reserved at its build address so no PCD patching is needed.
- Bridge GDT + far jump for the mode switch; pre-handoff CPU hygiene (CR0 NW/CD, CR4.PSE, MTRR_DEF_TYPE) so the inner PlatformPei asserts pass.
- Boot app deletes itself from the ESP before handoff so BdsDxe can’t re-select it.
Tested chains:
efi64boot: 32 bit host → BOOTIA32.EFI (32-bit) → OVMF64 SEC (64-bit) → PEI → DXE → BdsDxe → DVD boot → Windows Setup 64 Bit
efi32boot: 64-bit host → BOOTX64.EFI (64-bit) → OVMF32 (32-bit) → 32-bit firmware takes over → PEI → DXE → BdsDxe → DVD boot → Windows Setup 32 Bit
GitHub:
Pull requests welcome; treat as works in progress.
Edit by Fernando:
Thread moved into the “BIOS Modules” Forum Category and title shortened
This 32-bit host to OVMF64 handoff approach is interesting compared with simply emulating the 64-bit firmware, since the point about reserving the firmware MEMFD region at its build address to avoid PCD patching seems like a real simplification. I am curious about the CPU hygiene steps before handoff, particularly the CR0 NW/CD and MTRR_DEF_TYPE handling; did you find those were strictly required for PlatformPei asserts, or just enough to avoid intermittent failures? Also, deleting the boot app from the ESP before handoff is a neat workaround for BdsDxe re-selection.