VOGONS


First post, by JH64

User metadata
Rank Newbie
Rank
Newbie

Virtualization of Microsoft Windows 9x systems is a bit problematic due to 2 major bugs: TLB invalidation bug and CPU speed limit bug.

My program contains a set of patches to fix these bugs, and can be booted from a floppy on a virtual machine. It either applies the patch to the installed system, or it patches the installation files in order to create (relatively) bug-free installation media.

More info and source code: https://github.com/JHRobotics/patcher9x

Update 2022-07-08:
CPU speed limit bug included: https://github.com/JHRobotics/patcher9x/releases/tag/v0.7.45
(Windows 95, Windows 98 FE + in theory SE too)

Update 2022-06-21:
Small bugfix update: https://github.com/JHRobotics/patcher9x/releases/tag/v0.6.27

If you already applied may patch, you don't need install update - I updated is only patcher program, the patched code is same.

Update 2022-06-13:
A few days ago, I released new version: https://github.com/JHRobotics/patcher9x/releases/tag/v0.6.23 (or in attachment)
Main improvements is that Windows Me is supported too and now is confirmed that it works with it.

There is list which CPU and Virtualization software works (and who tested it). I appreciate all responses, they were very helpful!

AMD
Ryzen 5 2500U (QEMU/KVM/WHPX, kjliew)
Ryzen 5 3500U (VirtualBox, JH64)
Ryzen 9 3900 (VMware, Stretch)
Ryzen 5 3600 (VMware, 1541)
Ryzen 9 3950X (VirtualBox, janih)
Ryzen 7 4700U (VirtualBox, JH64)
Ryzen 9 5950X (VMware, computerfan9000)

Intel
Core i5-1135G7 (VirtualBox, JH64)
Core i7-1165G7 (QEMU/KVM/WHPX, kjliew)

--- original post ---

Hello,

I've created a patch for Windows 98 to run on the newest CPU (AMD Zen 2+, 10 nm Intel, ...). So, you can now run this system in virtual machine without restrictions. Bootable floppy with patch is attached or here: https://github.com/JHRobotics/patcher9x/relea … 0.6.14-boot.ima

Problematic code is described here: https://blog.stuffedcow.net/2015/08/win9x-tlb … validation-bug/, so I only injected 2 instructions to flush page table. Larger problem was that code is in file VMM.VXD which is part of WMM32.VXD which is compressed archive of more drivers generated specifically for your HW configuration by installer. Therefore, the patch program is a bit complex. Full code is here: https://github.com/JHRobotics/patcher9x

I've got limited numbers HW configurations for testing (most are laptops with AMD Ryzen 3xxxU and 5xxxU series or Intel i3 and i5 11th generation) and most testing I've done on VirtualBox (with enabled nested paging*), but theoretically all virtualization software (VMware, Qemu + KVM, Hyper-V) should work. I will be happy for info, which configuration (Virtualization software + HW) it works or not works.

Happy retrocomputing 😀

*In VirtualBox you can still disable nested paging, but it has side effects: it’s slower (Windows installation is painfully slower), some DOS programs are broken in this mode (for example DOS scandisk) and Windows 9x are very unstable.

Attachments

Last edited by JH64 on 2022-07-08, 21:17. Edited 3 times in total.

Reply 1 of 35, by Stretch

User metadata
Rank Member
Rank
Member

Thanks for this patch. I patched the win98 folder from ISO with patcher9x and installed Windows 98SE in VMware Workstation 16.2.3 on the AMD Ryzen 9 3900.

Windows 98SE runs much faster after the VMware Tools are installed. Stability so far is fine. I have just installed the hotfixes from Security9_enu_15.iso

Attachments

  • vmware workstation win98se ryzen.png
    Filename
    vmware workstation win98se ryzen.png
    File size
    3.78 KiB
    Views
    5108 views
    File comment
    Device manager showing AMD Ryzen. I removed the OEM ID line in the screenshot.
    File license
    Public domain

Win 11 - Intel Core i7-8809G - 8 GB - Radeon RX Vega M GH - Sound Blaster X4
WinXP - ASRock 775i65G R3.0 - Celeron 2.2 GHz - 2 GB - GeForce FX5700 - XtremeSound DDL
Win98SE - Via Apollo Pro Mobo - Pentium II 233 - 256 MB - Voodoo 3 1000 - ESS Solo-1 1938

Reply 3 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

Thanks for all responses – I’m happy to hear that it works and that here are users who still running Windows 9X virtual machines 😀

I recently tried to port patch to Windows Me – but there is little problem: I can’t catch any situation, where this code is executed – so if you discover some situation (caused by application or more likely by driver) where WinMe will show strange errors in system DLLs, please write it to me. (In VMM/FlushMappedCacheBlock on WinMe is much less space to inject some code, so patch will need longer jump/call to somewhere where space is, and I’ll need to test it.)

It is also possible, that Windows Me has too many bugs, that this one did not fit install CD and WinMe isn't affected by this 😁

Reply 4 of 35, by janih

User metadata
Rank Newbie
Rank
Newbie

Thanks for the patch. It seems to work well. Earlier I was not able to install Win98 on Virtualbox. I also tried this new Windows 9x Virtualbox display driver: http://www.os2museum.com/wp/windows-9x-video-minidriver-hd/

Attachments

Reply 5 of 35, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
JH64 wrote on 2022-06-01, 22:38:

I've created a patch for Windows 98 to run on the newest CPU (AMD Zen 2+, 10 nm Intel, ...).

I am bit curious about "10nm Intel", which I am guessing means Alder Lake only. I was not aware that it was broken there too. Is there online any complaining about it ?

Also, for those who own an AMD Zen 2 o 3 .... are there any other problems left when virtualizing Windows 9x ? I may need to buy one in a couple years...

Reply 6 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

Update: the patch is now working for Windows Me too, see updated 1st post

@janih: thanks for the tip - any new driver for Win 9x for virtual GPU is welcome!

@javispedro1: there is also Tiger Lake (10nm too) where is "this problem" present - I haven't any 12th gen Intel to test, but I assume if there was this improvement in 11th generation, there will be also in 12th generation. There is also speed improvement - if you have special instruction to update TLB, you don't need checking generic write to test if there was change; and with some "small" compatibility issues - people don't care about much newer system then Windows 98/Me... I didn't see any online complaining with Windows 98 + 12th gen. Intel, but personally I didn't see any for 11th gen. too before I saw this bug on my own laptop! There is also "CPU speed bug" in 95/98 FE (first edition), but 98 SE/Me looks OK to me* - but if anyone find some, report it please 😀

*OK, there are another like 48 bit LBA - if you attach larger virtual drive, memory limitation (both RAM and GPU) etc., but if you correctly sets VM they probably won't bother you.

Reply 7 of 35, by 1541

User metadata
Rank Member
Rank
Member

Great Work!

Add a working Ryzen 5 3600 in VMware to the list (using the boot floppy method on a German Win98 SE).

Note: the command line options mention "WMM32.WXD", "WMM.VXD" & "WMM32.VXD" - is that a typo or do these files exist during installation?

💾 Windows 9x resources (drivers, tools, NUSB,...) 💾

Reply 8 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

Hello 1541, thanks to report your CPU - I added it to CPU list.

To your note: Its typo, only exists VMM32.VXD and VMM.VXD files (sorry for it). I already fix it in source on GIT and in next release it'll be corrected in program on readme/help (hope soon).

Reply 10 of 35, by BolenB

User metadata
Rank Newbie
Rank
Newbie
JH64 wrote on 2022-06-01, 22:38:

I've created a patch for Windows 98 to run on the newest CPU (AMD Zen 2+, 10 nm Intel, ...).

Hello. Will support for updates Q242161 (VMM.VXD 4.10.1999 for win98) and Q288430 (VMM.VXD 4.10.2226 for win98se) be included?

Reply 11 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

Hello computerfan9000, glad to see the desktop AMD ZEN 3 CPUs works too!

Hello BolenB, thank you for pointing out Windows 98 updates which updating vmm.vxd. But difference in patched function (FlushMappedCacheBlock) is only 2 extra instructions. So, I'll add support to next release (maybe at weekend or next week).

Reply 14 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

I created new release 0.7.45 (https://github.com/JHRobotics/patcher9x/releases/tag/v0.7.45, or download in 1st post) where I included CPU speed bug fix. Original patch was by Rudolph R. Loew (https://www.betaarchive.com/forum/viewtopic.php?t=29224) and I do some improvements: I increased the number of cycles by 8 times (80 times more than the original code and in the case of NDIS.VXD, 100 times more than the original code). And I also included a simple "divide by zero" protection.

Why more cycles in test loop? I created small test (you can run it by 'patcher9x -cputest' or 'patch9x -cputest' from DOS). And here are results on old Ryzen 5 1400:

### stats:
LOOP V1: 0.311 ms (LOOP = 1000000)
LOOP V2: 0.328 ms (LOOP = 1048576)
LOOP V3: 3.053 ms (LOOP = 10000000)
LOOP V4: 3.197 ms (LOOP = 10485760)
LOOP V5: 24.494 ms (LOOP = 80000000)
### conclusion:
Status: patch is recomended, but FIX95CPU works with your CPU too
Precision: benchmark ran from OS, results are not completely accurate
CPU: AMD Ryzen 5 1400 Quad-Core Processor

LOOP V3: is length of loop after FIX95CPU patch and if this value be under 1 ms the driver will fail on "System protection error" - on division by zero. In my version is simple protection, but timing information after that is completely useless (driver probably won't work correctly). This problem is in 98 SE in NDIS.VXD where is short test (~1 M LOOPs = LOOP V2 test) and if time=0 it sets time=1 (ms) so for faster CPU probably this driver won't work. There are also NDIS.VXD updates but I still didn't look to them. I think in near future (maybe in current high-end CPU models now, but I haven't any yet) this will be problem. So I increased cycles in test and fix 98 SE's driver too.

There is also one disadvantage - on slow CPU will system boot longer (8 - 10 times) so this patch isn't usable on every HW configuration. My slowest 386-compatible PC (some Duron ~1340 MHz) has these results:

### stats:
LOOP V1: 2.358 ms (LOOP = 1000000)
LOOP V2: 2.472 ms (LOOP = 1048576)
LOOP V3: 23.538 ms (LOOP = 10000000)
LOOP V4: 24.689 ms (LOOP = 10485760)
LOOP V5: 188.293 ms (LOOP = 80000000)
### conclusion:
Status: patch is recomended, but FIX95CPU works with your CPU too
Precision: benchmark ran from DOS, results are precize
CPU: AMD Duron(tm)

So, this warning isn't for most after 2000's CPU relative but could by problem for some half virtualized - half emulated configurations.

I hope I haven't created any new bugs with this patch 😀 It's out of my possibility test all Windows 95 and Windows 98 beta/FE versions, but everything I have tested it works (including "Memphis" 4.10.1351). If you have something from 9x family that not working on modern CPUs in VM, please, tell me 😀

@1541: thx for link!

@moya: thx for report your CPU (it's the first reported 12gen Intel - I'm glad that works!)

@BolenB: support for Q242161 and Q288430 is included in this release (0.7.45)

PS: Intel CPUs have bit slower LOOP instruction (from 2nd gen to 11th gen about 1 000 000 LOOP ~ 1 ms), so this is this timing is probably more CPU AMD related.

Reply 16 of 35, by Kahenraz

User metadata
Rank l33t
Rank
l33t

I'm having a problem with running Cygwin 1.5.25's setup where it keeps locking up when "Parsing ini file". This doesn't happen on actual hardware on a fast Core 2 Duo, but it does when I try to run it in a VMware virtual machine on my Ryzen 1800X. I tried this patch, but there was no improvement.

I don't know what the problem is, but it's reproducible. I found that if I kept resetting the system and re-running setup, it would VERY RARELY get past this problem and allow me to continue. It feels like some kind of timing issue, but may also be related to my Ryzen CPU; I can't know for sure. But I can confirm that I have never had this problem in either Windows 98 or ME on actual hardware with a fast CPU. One time I was able to push it past the problem, I got a weird dialog about a missing DLL, but the file name was corrupted.

Do you know if this is related?

cygwin-setup.png
Filename
cygwin-setup.png
File size
4.2 KiB
Views
3672 views
File license
CC-BY-4.0
cygwin-setup2.png
Filename
cygwin-setup2.png
File size
17.46 KiB
Views
3679 views
File license
CC-BY-4.0

Reply 17 of 35, by Kahenraz

User metadata
Rank l33t
Rank
l33t

I encountered this blue screen after installing this patch on one of my retro desktops. It mentions VMM, so I wanted to mention it, in case it's related. It occurred at random but then would trigger whenever I tried to interact with things on the desktop, like running a program or opening a shortcut. I had to reboot to make things sane again.

20220723_173644_resize_76.jpg
Filename
20220723_173644_resize_76.jpg
File size
239.31 KiB
Views
3647 views
File license
CC-BY-4.0

Reply 18 of 35, by JH64

User metadata
Rank Newbie
Rank
Newbie

Hello Kahenraz,

About Cygwin: It’s look more like problem with file system/disk driver/DMA (esdi_506.pdr?), but why only on Ryzen? (VirtualBox + Intel is without this problem) – I have access to Ryzen 1600, so I’ll try to simulate it.

About BSOD: I have never tested on bare metal hardware, so it’s probably bug in patch, I’m sorry for it 🙁. Patcher creates file backup (C:\WINDOWS\SYSTEM\VMM32.BAK -> VMM32.VXD or C:\WINDOWS\SYSTEM\VMM32\VMM.BAK -> VMM.VXD) so if you copy/rename back you’ll recover system without reinstall.
I have an idea where the bug is, so tomorrow I’ll try install win98 on some old PC, then apply patch and I will try to find a solution. Originally TLB bug fix doesn’t make sense on an old computer but with combination with CPU speed patch it is use-case too.

Could you please post your CPU name in your retro computer? In case that is not bug in my code I’ll probably need some CPU blacklist to prevent install VMM patch on them.

Reply 19 of 35, by Kahenraz

User metadata
Rank l33t
Rank
l33t

It's a Core 2 Duo e6700. I've been troubleshooting out of memory issues and wanted to see if this patch would make a difference.

I'm having trouble troubleshooting this elsewhere since all of my modern computers are Ryzen, and I'm having problems virtualizing there.

I have more questions about my problem, but I need more data. And I do a lot of the heavy lifting with Cygwin, which is why I'm trying to get that installed in a VM.