Fixing The CPU Speed Limit in Windows 95, 98 and their Betas

Tutorials for Operating Systems, Applications etc can be posted here.
rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Fixing The CPU Speed Limit in Windows 95, 98 and their Betas

Post by rloew »

The CPU Speed Limit Problem in Windows 95, 98 and their Betas is due to a number of faulty CPU speed checks that were not designed for fast Processors.
A step in the calculations, I have found, causes a Divide by Zero Error. If this occurs in the Drivers that are started during Bootup, you get a "Windows Protection Error" and the Computer stops.
Other problems can occur if one of the Drivers is executed later.

There are up to 6 Files that need to be Patched to correct the two speed check algorithms that I have identified.

The following 5 Files have Algorithm #1:

NTKERN.VXD
IOS.VXD
ESDI_506.PDR
SCSIPORT.PDR
CS3KIT.EXE (In two places)

NDIS.VXD has Algorithm #2.

To Patch the Files with Algorithm #1 perform the following steps:

1. Search for the Binary Sequence: 2B D2 B9 99 00 00 00 F7 F1. If not found the File does not need fixing or has already been Patched.
2. This location will be referred to as X for the later steps.
3. At X-2 there should be F7 F1.
4. At X-16 there should be either 40 42 0F 00 or 80 84 1E 00.
5. At either X-40 or X-42 there should be the same sequence as at X-16.
6. If everything is correct continue, otherwise the File has a different Algorithm or is already Patched.
7. Replace the Sequence at X-40 or X-42 (from Step #5) with 80 96 98 00.
8. Replace the Sequence at X-16 with 4F FF 00 00
9. Replace the Sequence at X with 90 90 90 90 90 90 90 90 90.
10. For CS3KIT.EXE, Repeat Steps 1 thru 9 using the Second Instance of the Sequence shown in Step 1.

To Patch the NDIS.VXD File with Algorithm #2 perform the following steps:

1. Search for the Binary Sequence: B9 00 00 10 00. If not found the File does not need fixing or has already been Patched.
2. This location will be referred to as X for the later steps.
3. At X+16 there should be B9 E8 03 00 00.
4. If everything is correct continue, otherwise look for a later instance of the Sequence in Step 1 and repeat. If no more, the File does not need Fixing.
5. Change the Byte at X+3 from 10 to A0.
6. Change the two Bytes at X+17 from E8 03 to 64 00.

NTKERN.VXD and ESDI_506.PDR appear to have been fixed with the 1400 Version.
IOS.VXD and SCSIPORT.PDR appear to have been fixed with the 1411 Version.
CS3KIT.EXE appears to only have had the problem in the 1387 Version.
NDIS.VXD has the problem in all Versions of Windows 95 and 98, only being fixed in the 98SE Betas.

If anyone finds Files that cannot be Patched using these methods, or other Versions that need Patching, please Post.

LoneCrusader
User avatar
Donator
Posts: 257
Joined: Thu Apr 05, 2012 6:39 am

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by LoneCrusader »

I knew there had to be a solution for these errors. Now there's no more need to go through setting up ancient hardware or special VM workarounds to run these early builds. :)

Many thanks!

marcoguy
User avatar
Donator
Posts: 178
Joined: Sat Jun 16, 2012 1:28 am
Location: PATH=C:\DOS

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by marcoguy »

I applied all the patches you specified on Windows 95 OSR2.5, and i still get the following error:

While initializing device IOS:
Windows Protection Error. You need to restart your computer.
Preservation
How could you know where you want to go today if you don't even know where you've been?

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

marcoguy wrote:I applied all the patches you specified on Windows 95 OSR2.5, and i still get the following error:

While initializing device IOS:
Windows Protection Error. You need to restart your computer.
First verify that the Patched file is still present in your WINDOWS\SYSTEM\VMM32 folder. It may have been overwritten.
If OK, compare the original and the Patched File using FC /B and post the result.

marcoguy
User avatar
Donator
Posts: 178
Joined: Sat Jun 16, 2012 1:28 am
Location: PATH=C:\DOS

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by marcoguy »

None of the files had been overwritten, however I was able to fix the error by applying LoneCrusader's FIX95CPU patch in addition to this one. Now I can boot Windows 95 in Virtualbox on my 3.4 GHz PC :)
Preservation
How could you know where you want to go today if you don't even know where you've been?

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

marcoguy wrote:None of the files had been overwritten, however I was able to fix the error by applying LoneCrusader's FIX95CPU patch in addition to this one. Now I can boot Windows 95 in Virtualbox on my 3.4 GHz PC :)
FIX95CPU contains this fix among others so it obviously would work.
Although my instructions work with Windows 95, they were intended to support Windows 98 Betas that do not have the option of FIX95CPU.
Without the comparison I asked for, I cannot tell if the Patch was done correctly.

LoneCrusader
User avatar
Donator
Posts: 257
Joined: Thu Apr 05, 2012 6:39 am

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by LoneCrusader »

I just tested these patches with Memphis Build 4.10.1387 on my 3.4GHz Pentium 4 Extreme Edition system. Everything works as expected. :)

Here's a screenshot of the installed system running CPU-Z. Too bad there aren't any Windows 95 graphics drivers for this system or I would have installed them and put more on screen for the shot.

Image


EDIT:

Added a screenshot of Memphis Build 4.10.1351 running on a 2.4GHz AMD Athlon 64 X2 system.

Image

Battler
User avatar
Donator
Posts: 2116
Joined: Sat Aug 19, 2006 8:13 am
Location: Slovenia, Central Europe.
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by Battler »

Well, I hereby testify that rloew's patch does work, and in Nashville 999 even, and here's a screenshot of Nashville 999 running in Virtual PC 2007 to confirm that (the host OS is Windows 7 Ultimate 64-bit Edition, using the Windows Classic theme to save every as many GPU resources as possible for other uses):
Image

I can also upload the relevant patched Nashville 999 files (about 5 or so of them) if needed.

In any case, thank you very much, rloew, for telling us how to patch the files. This way, we can finally run run those old and interesting Builds without having to resort to using files from other Builds.
Main developer of the 86Box emulator.
Join the 86Box Discord server, a nice community for true enthusiasts and 86Box supports!

The anime channel is on the Ring of Lightning Discord server.

Check out our SoftHistory Forum for quality discussion about older software.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

Battler wrote:In any case, thank you very much, rloew, for telling us how to patch the files. This way, we can finally run run those old and interesting Builds without having to resort to using files from other Builds.
It's also true that using files from other Builds largely invalidates the kernel, especially considering that the NTKERN problem required the replacement of NTKERN.VXD, which apart from the other Windows 95 OSR 2 updates is the only significant change in the kernel of the earlier builds for which reliable information is available.

Furthermore, when you consider that it was pretty much the only change in Memphis Build 1132, replacing it would render the entire build useless, requiring either a slower clocked emulator or an older PC to actually test it with any of its newly introduced features.

Wheatley
User avatar
Donator
Posts: 1839
Joined: Thu Oct 25, 2012 8:19 pm
Location: shell32.dll

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by Wheatley »

Some of us want to use the build, not keep everything 100 % original.
Windows Defender for great justice! Bugs are an international trading company. I need to defeat the anti-debugging and obfuscation methods. It wasn't for Intel's absurd ability to load in ie6. Why even waste time with people in an envelope?

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

Wheatley wrote:Some of us want to use the build, not keep everything 100 % original.
Still, this is quite useful for those who don't have an older machine to test it on.

James
User avatar
Posts: 2030
Joined: Thu Oct 11, 2007 9:13 pm

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by James »

WinPC wrote:
Battler wrote:In any case, thank you very much, rloew, for telling us how to patch the files. This way, we can finally run run those old and interesting Builds without having to resort to using files from other Builds.
It's also true that using files from other Builds largely invalidates the kernel, especially considering that the NTKERN problem required the replacement of NTKERN.VXD, which apart from the other Windows 95 OSR 2 updates is the only significant change in the kernel of the earlier builds for which reliable information is available.

Furthermore, when you consider that it was pretty much the only change in Memphis Build 1132, replacing it would render the entire build useless, requiring either a slower clocked emulator or an older PC to actually test it with any of its newly introduced features.
You're a broken record, for the love of god. I told you stop saying it over and over and over again, because everyone gets it. You hold to the firm belief that if you change anything, it isn't the same build. Thank you.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

James wrote:
WinPC wrote:
Battler wrote:In any case, thank you very much, rloew, for telling us how to patch the files. This way, we can finally run run those old and interesting Builds without having to resort to using files from other Builds.
It's also true that using files from other Builds largely invalidates the kernel, especially considering that the NTKERN problem required the replacement of NTKERN.VXD, which apart from the other Windows 95 OSR 2 updates is the only significant change in the kernel of the earlier builds for which reliable information is available.

Furthermore, when you consider that it was pretty much the only change in Memphis Build 1132, replacing it would render the entire build useless, requiring either a slower clocked emulator or an older PC to actually test it with any of its newly introduced features.
You're a broken record, for the love of god. I told you stop saying it over and over and over again, because everyone gets it. You hold to the firm belief that if you change anything, it isn't the same build. Thank you.
Well, in the case of Build 1132, if the build contains only one real difference (that is actually verifiable, that is), and the particular difference was with NTKERN.VXD, well, wouldn't replacing NTKERN.VXD defeat the purpose of even having this build in the first place?

With this person's patch, however, we don't have to use any files from other builds, so this is no longer an issue.

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

What is the point of arguing?
Everybody can now get what they want.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

rloew wrote:What is the point of arguing?
Everybody can now get what they want.
My intention was never to argue (let alone to break the rules of the site), so I'm really sorry if it came off that way.

All I was saying, though, was that this patch that you created now allows everyone here to use the earlier builds without using files from other builds. And for that, you did an excellent job. :)

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

WinPC wrote:
rloew wrote:What is the point of arguing?
Everybody can now get what they want.
My intention was never to argue (let alone to break the rules of the site), so I'm really sorry if it came off that way.

All I was saying, though, was that this patch that you created now allows everyone here to use the earlier builds without using files from other builds. And for that, you did an excellent job. :)
Although I have seen you get into arguments in other Threads, you weren't the target of this comment.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

I'm not really sure what you're talking about, but still, I'm just glad that we now have a way of running this builds without using files from other builds.

Also, in my opinion, it is really cases like this where we need an official area of the site for posting these guides, provided that they are the most accurate that we have to actually fixing the problem itself (such as in this particular case). It would really save people a lot of trouble, especially new members.

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

I haven't been concerned about Builds or Betas until recently, but as a Software Developer, I have been very reluctant to add anything to my System other than official fixes and the occasional Hotfix.
Doing more can result in Programs I write behaving differently on my Computer than my Customers. As far as mixing builds is concerned, it depends upon the ultimate goal of the person setting it up.
If purity is your objective, then you don't do it. If your objective is a particular level of functionality than it doesn't matter. Either way works. In order to isolate a very recalcitrant bug, I recently took a 1132 Build and transformed it into a 1351 Build piece by piece. In this case purity went out the window.

As far as an official area is concerned, it is too easy to excessively fragment the Forum architecture, unless a well defined criteria is created for defining such areas and setting the rules for allowed content. It would definitely have to be moderated to prevent clutter.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

rloew wrote:I haven't been concerned about Builds or Betas until recently, but as a Software Developer, I have been very reluctant to add anything to my System other than official fixes and the occasional Hotfix.
Doing more can result in Programs I write behaving differently on my Computer than my Customers. As far as mixing builds is concerned, it depends upon the ultimate goal of the person setting it up.
If purity is your objective, then you don't do it. If your objective is a particular level of functionality than it doesn't matter. Either way works. In order to isolate a very recalcitrant bug, I recently took a 1132 Build and transformed it into a 1351 Build piece by piece. In this case purity went out the window.

As far as an official area is concerned, it is too easy to excessively fragment the Forum architecture, unless a well defined criteria is created for defining such areas and setting the rules for allowed content. It would definitely have to be moderated to prevent clutter.
Well, personally, I think that the objective is to provide a workaround that keeps as much of the original build intact as possible. As in, no unnecessary file replacements or anything like that.

In this case, what you are doing is simply to modify existing versions of the files, so that they don't need to be replaced with versions from other builds. Of course, it would be better if we didn't have this problem at all, but your workaround still allows the use of the same files from the original builds (as in, no files replaced with copies from other builds), so it is simply a must for those who simply can't run the builds otherwise.

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

Purity is definitely your style. I tend to support it in my Software Development platforms also.
But it is not everyones style. They may not need purity. So it is not a must. Hybrid Systems are perfectly reasonable for many purposes. The example I gave is just one.
Also if you modify an existing File enough, it becomes indistinguishable from another Build.
And to complicate things further, different Builds may have the same exact code even if they have been recompiled and seem different.

WinPC

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by WinPC »

rloew wrote:Purity is definitely your style. I tend to support it in my Software Development platforms also.
But it is not everyones style. They may not need purity. So it is not a must. Hybrid Systems are perfectly reasonable for many purposes. The example I gave is just one.
Also if you modify an existing File enough, it becomes indistinguishable from another Build.
And to complicate things further, different Builds may have the same exact code even if they have been recompiled and seem different.
My "style" (as you call it) is to keep as much purity as possible when getting the build to work. If something absolutely must be changed for it to run, then obviously, it can't be kept completely "pure", but it at least, the best attempt would be to create a workaround that makes as little changes as possible, and that keeps as much of the original build intact as possible.

Obviously, a hybrid build is perfectly fine with me, if that is what people are interested in. But for actually testing in the context of operating system evolution (a.k.a. "beta testing"), the workaround to use is the one that makes the least changes, especially when the culprit files are simply modified rather than being replaced, since they still come from the particular build. Especially when preservation is an issue, since the best workarounds are the ones that otherwise preserve the original files entirely, apart from a few slight changes.

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

WinPC wrote:
rloew wrote:Purity is definitely your style. I tend to support it in my Software Development platforms also.
But it is not everyones style. They may not need purity. So it is not a must. Hybrid Systems are perfectly reasonable for many purposes. The example I gave is just one.
Also if you modify an existing File enough, it becomes indistinguishable from another Build.
And to complicate things further, different Builds may have the same exact code even if they have been recompiled and seem different.
My "style" (as you call it) is to keep as much purity as possible when getting the build to work. If something absolutely must be changed for it to run, then obviously, it can't be kept completely "pure", but it at least, the best attempt would be to create a workaround that makes as little changes as possible, and that keeps as much of the original build intact as possible.

Obviously, a hybrid build is perfectly fine with me, if that is what people are interested in. But for actually testing in the context of operating system evolution (a.k.a. "beta testing"), the workaround to use is the one that makes the least changes, especially when the culprit files are simply modified rather than being replaced, since they still come from the particular build. Especially when preservation is an issue, since the best workarounds are the ones that otherwise preserve the original files entirely, apart from a few slight changes.
I think we all know this already. What you referred to as "Beta Testing" is a purpose for which maximum Purity would be a good thing.

You have argued in the past over the use of older hardware to avoid mixing versions.
The decision whether to use old hardware versus reducing Purity is affected by other considerations including financial for the user.
You cannot demand that people do it your way, you will only get ignored, or worse.
Hopefully, my Patches will make this particular issue moot, but my advice still stands.

Wheatley
User avatar
Donator
Posts: 1839
Joined: Thu Oct 25, 2012 8:19 pm
Location: shell32.dll

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by Wheatley »

Also, thanks for the patch :)
Windows Defender for great justice! Bugs are an international trading company. I need to defeat the anti-debugging and obfuscation methods. It wasn't for Intel's absurd ability to load in ie6. Why even waste time with people in an envelope?

rloew
Posts: 82
Joined: Fri Aug 02, 2013 9:32 am
Location: Elmont, NY USA
Contact:

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by rloew »

It may be of some interest that the unpatched NDIS speed limit, which is commonly reported to be 2.1Ghz, is dependent upon the type of Processor.
I never saw this issue on my 3.1GHz AMD Computer. I decided to test the problem code to find the actual limit.
The 2.1GHz limit appears to apply to Intel Processors but not AMD ones. On my Athlon 64 X2 Processor I calculated the limit to be 3.2GHz. I was able to confirm it by overclocking 5% to 3.255GHz.

Wheatley
User avatar
Donator
Posts: 1839
Joined: Thu Oct 25, 2012 8:19 pm
Location: shell32.dll

Re: Fixing The CPU Speed Limit in Windows 95, 98 and their B

Post by Wheatley »

Hm. Rather interesting.
Windows Defender for great justice! Bugs are an international trading company. I need to defeat the anti-debugging and obfuscation methods. It wasn't for Intel's absurd ability to load in ie6. Why even waste time with people in an envelope?

Post Reply