whpx, on booting win98, qemu crashes with Failed to emulate PortIO access with EmulatorReturnStatus: 2
Host environment
- Operating system: Windows 10 22H2
- OS/kernel version: 19045.2491 (up-to-date as of 20240416)
- Architecture: x86-64
- QEMU flavor: qemu-system-x86_64.exe
- QEMU version:
QEMU emulator version 8.2.91 (v9.0.0-rc1-12050-gb494cb57ce)
- QEMU command line:
qemu-system-x86_64 -machine type=pc,accel=whpx,kernel-irqchip=off -cpu core2duo -smp "sockets=1,cores=1,threads=1" -m 512 -nodefaults -bios bios-256k.bin -rtc base=localtime -display sdl,gl=on -device VGA,vgamem_mb=128 -audiodev dsound,id=snd1 -device adlib,audiodev=snd1 -audiodev dsound,id=snd2 -device ac97,audiodev=snd2 -boot c -drive index=0,if=ide,media=disk,format=vhdx,file="F:\Win98m40_sys.vhdx" -drive index=1,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_01.vhdx" -drive index=3,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_02.vhdx"
Emulated/Virtualized environment
- Operating system: Win98SE
- OS/kernel version: 4.10.2222
- Architecture: x86_64
Description of problem
Q) What is the correct command line arguments to boot win98se with accel whpx
The above given command line crashes partway through the win98se boot process before the desktop shows up
Windows Hypervisor Platform accelerator is operational
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: warning: GLib-GIO: Failed to open application manifest `C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AppxManifest.xml' for package #34 (`Microsoft.MicrosoftEdge_44.19041.1266.0_neutral__8wekyb3d8bbwe'): error code 0x2
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: WHPX: Failed to emulate PortIO access with EmulatorReturnStatus: 2
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: WHPX: Failed to exec a virtual processor
Steps to reproduce
- Finish a complete win98 install using
-machine type=pc,accel=tcg -cpu qemu64
qemu-system-x86_64 -machine type=pc,accel=tcg -cpu qemu64 -smp "sockets=1,cores=1,threads=1" -m 512 -nodefaults -bios bios-256k.bin -rtc base=localtime -display sdl,gl=on -device VGA,vgamem_mb=128 -audiodev dsound,id=snd1 -device adlib,audiodev=snd1 -audiodev dsound,id=snd2 -device ac97,audiodev=snd2 -boot c -drive index=0,if=ide,media=disk,format=vhdx,file="F:\Win98m40_sys.vhdx" -drive index=1,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_01.vhdx" -drive index=3,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_02.vhdx"
With all guestos-win98-drivers installed the win98 seems to work satisfactorily.
Using vga driver from https://github.com/JHRobotics/vmdisp9x/releases - now change processor to
-cpu core2duo
, it boots . This does not seem to matter, bug exists even with qemu64 - now change accel to
-machine type=pc,accel=whpx
, qemu crashes partway into boot before bringing up desktop.
with or withoutkernel-irqchip=off
does not matter
with or without cpu arguments,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time
also does not matter - Setting back to
-machine type=pc,accel=tcg -cpu core2duo
restores bootable win98se.
Additional information
- target/i386/whpx/whpx-all.c#L920
- The part of the OS bootsequence, which includes the Win98/DOS boot menu, scandisk, etc. works fine. Its possible to boot to DOS mode and run DOS commands. The crash happens when into the win.com Win98SE boot sequence just before it can bring up the GUI desktop.
- qemu crashes even if in the win98/DOS bootmenu, selection is made to boot into
safe-mode
, which is supposed to boot a vanilla 16-color VGA desktop loading minimal drivers. As before, crash happens before GUI desktop is loaded. - 20220623 Learn.Microsoft WHvEmulatorTryIoEmulation and WHvEmulatorTryMmioEmulation
https://learn.microsoft.com/en-us/virtualization/api/hypervisor-instruction-emulator/funcs/whvemulatortryemulation - 20220426 Learn.Microsoft WHV_EMULATOR_STATUS
https://learn.microsoft.com/en-us/virtualization/api/hypervisor-instruction-emulator/funcs/whvemulatorstatus
Edited by GK