-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 95 EMM386.EXE V86 monitor does not allow RDTSC instruction #30
Comments
I can confirm that if I manually enter the RDTSC opcode in DOS DEBUG and try to single-step it, that the system hangs in the same way. |
Because of this issue, the CPU library now has a flag to indicate not to use the RDTSC instruction. For now, that flag is set if the build is 16-bit and virtual 8086 mode is active. |
I will update that code to not set the flag if it can recognize whether or not the v86 monitor permits RDTSC. Perhaps FreeDOS has a better implementation. Perhaps MS-DOS 6.22 and earlier don't have this issue, or perhaps Microsoft fixed this in Windows 98 DOS mode. I'll need to test this. |
This was observed on an old Pentium 133MHz test system with Windows 95 DOS mode on a CF card. |
TODO: Which MSR controls whether user-space can access RDTSC, by the way? I understand there's another one for whether or not user-space can use CPUID. |
The P133 does not support rdtsc in v86 mode: http://www.os2museum.com/wp/undocumented-rdtsc/ |
Here's a disappointing revelation.
Apparently Windows 95's EMM386.EXE doesn't like it when 16-bit DOS applications try to use RDTSC. It seems to hang the system (or perhaps it's in an infinite Invalid Opcode exception loop). 32-bit DOS programs (under DOS4GW/DOS32) are not affected.
I would like to know if this has been a consistent problem across MS-DOS through Windows 98 SE, or if it's just the particular version of Windows 95 I'm testing right now (4.0.1111 Windows 95 SP1).
Until then, I'm going to have to have RDTSC-related code disable itself unless known versions of MS-DOS and EMM386.EXE are running :(
The text was updated successfully, but these errors were encountered: