jakethompson1 wrote on Yesterday, 23:55:
you would think spurious cache hits during the flushing/timing process would cause garbage data to be loaded in as code.
Or perhaps, the F000 segment is non-cacheable during this process--that's probably it.
Exactly that. This also ensures that the tag doesn't get modified to point into BIOS space, which would (slightly) distort the timing measurements.
jakethompson1 wrote on Yesterday, 23:55:
I was thinking how much of the cache test could be reproduced from a DOS program to see where it goes wrong. Further examination of what triggers the "DO NOT ENABLE CACHE!" message could clear up whether the tag RAM is indeed working now as we suspect, and then it's the data RAMs (unlikely as we tested them all) or some trace going to them.
A DOS program like that is entirely possible. While working on my Biostar 1MB cache module, I developed a "cache monitor utility" for the UMC 8881 north bridge. It relocates itself in the 28K of text mode video RAM that's not used for text page 0, and then is free to manipulate cache and RAM contents as it desires without causing a system crash. This obviously means it runs with interrupts disabled the whole time, you better do not have SMI-based power management enabled, and the tool needs to have its own low-level keyboard and video interface (you can't run INT10 if you can't rely on working RAM/cache).
The intended use case of that utility is to disable L2 cache in the CMOS setup (which can be skipped if the L2 cache works bad enough that the BIOS itself disables the cache), so you boot into DOS with L2 disabled, load that tool, which copies itself to video RAM, and only then enables the cache as required.
If I remember correctly, the "CACHE MEMORY BAD" test is a very simple "load a single line into L2, write somehting into it (which should hit and update L2) and then test whether you can read back the data from L2". This test is performed with L1 disabled, so there is no need to worry about getting good data from L1 which would mask cache errors. The first time I encountered this "CACHE MEMORY BAD" message was in the '90s, when I reinstalled Windows 95 on a 486 computer of a friend-of-a-friend, which took an unexpectedly long time. After the installation finished, I went to CMOS setup to check for obviously bad setting like disabled cache, and sure enough, I found both internal and external cache being disabled. Then I enabled both caches and got that message. Feeling quite confident that this message is only about L2, I just disabled L2 and kept L1 enabled, which obviously improved performance quite a bit. I then took a peek into the computer to check why it said "cache memory bad", and I just found empty sockets.