The Linux compilation problem that I mentioned was fixed in git already by kjliew, so thanks for that 😁
I gave this a quick spin in a Win98 guest (on a Linux host), and was able to run test04.exe and wglgears.exe successfully.
So, for Win98 guest on Linux host:
- First, install some build tools and other packages that are needed:
sudo apt install git gcc g++ build-essential pkg-config m4 make cmake autoconf automake libtool ninja-build
sudo apt install libepoxy-dev libgbm-dev libglib2.0-dev libsdl2-dev libpixman-1-dev libgtk-3-dev
sudo apt install gcc-mingw-w64-i686
- Install OpenGlide: https://github.com/voyageur/openglide (clone the repo and run ./configure && make && sudo make install)
- Install qemu-3dfx: https://github.com/kjliew/qemu-3dfx (just follow the instuctions given in README, you may need to give the sign_commit script run permission if you see Permission denied errors)
- You'll have to install pexports separately, since it's not included with the mingw packages. I think I got the source (pexports-0.47-mingw32-src.tar.xz) here: https://qa.debian.org/watch/sf.php/mingw
- Compile the guest wrappers (the directories wrapper/src and wrapqgl/src). The makefiles need some customizing to get them to jive: Comment out the line with a MINGW32 environment check, and the mingw versions of gcc and dlltool should be used instead of plain gcc or dlltool (the line with CC=gcc should be changed to something like CC=/usr/bin/i686-w64-mingw32-gcc-9.3-win32 instead).
- You may see an error message about i686-pc-msdosdjgpp-gcc, this is the DXE stuff so not needed here. In case you still want to try it out, DJGPP can be built with these scripts: https://github.com/andrewwutw/build-djgpp
- Copy the resulting files glide.dll, glide2x.dll, glide3x.dll and opengl32.dll into guest's Windows SYSTEM directory.
- Do the same with the kernel drivers (fxmemmap.vxd and fxptl.sys, see the first post. fxmemmap.vxd comes from the Glide 2.43 SDK and fxptl.sys can be found in package voodoo2-win2k-10200.exe, for example). Run instdrv.
- Launch qemu with -display sdl and go run test04.exe or whatever. Also, for Win98, use maximum of 512MB memory.
- The guest vm should be configured with ACPI. The easiest way to do this is to use the extra switches for Win98 install: SETUP /NM /PJ
- kvm should be disabled until the guest has been configured. If you experience instability with Win98 guest, try disabling kvm (YMMV, might depend on hw)
- See this post for some guest configuration tricks that are needed: Re: QEMU 3Dfx Glide Pass-Through (WHPX/KVM works!!!)
- If you experience page faults (pointing to KERNEL32.DLL, for example), check the kernel drivers. It may be necessary to run instdrv.
- Use bearwindows (VBEBM) drivers in the guest. This trick needs to be applied: Re: QEMU 3Dfx Glide Pass-Through (WHPX/KVM works!!!)
- If you use KVM with VBEBM drivers, this fixes the problem with shutdown: Re: QEMU 3Dfx Glide Pass-Through (WHPX/KVM works!!!)
Hopefully that's all...Please note that the process is a bit different for newer Windows, kjliew has described it previously in this thread.
I had some confusion about the usage of opengl32.dll, because it is possible to get the Windows native implementation for wglgears.exe. Just check the qemu console and see that you get some messages about wrapper activation.