First post, by jakethompson1
- Rank
- Oldbie
After ROMs are copied to shadow RAM and the shadow RAM write protection is enabled, 486 chipsets block any writes to shadow RAM in both DRAM and external cache.
Q71264 shows that Windows 386-enhanced mode, in addition to possibly other software, actually relies on the fact that shadow RAM areas will not be clobbered by other software.
The 486 CPU does not offer a way to mark cache lines as "read only" as the CPU fills the internal cache. As the OPTi 82C895 datasheet says:
Cache shadow RAM area in L2/L1 caches (optional)...Although write protection of these areas will still be honored in the L2 (external) cache, the L1 cache does not have a write protection mechanism and the ROM code may be overwritten or modified if stored in the L1 cache.
As a consequence, 486 internal cache and shadow RAM areas could temporarily become out-of-sync, as write-through cycles would update the CPU's internal cache, but the writes to external cache (and shadow RAM) would be discarded by the chipset. This can be entirely avoided by forbidding internal caching of shadow RAM, but that would introduce a speed penalty.
Looking briefly at the 80486 data book, it appears you could use EADS# to force an invalidation during a write-through cycle, even if the supposed bus master that is updating RAM is the CPU itself. I don't know if any chipsets bothered to do that to protect from shadow RAM writes into internal cache. Also, for a write back enhanced CPU, during cache fill it appears there is a way to mark a line as "shared" (requiring write-through) during fill, to retain that protection.
The SiS 496 suggests that perhaps it does that EADS# trick, but does not support marking lines as shared during fill, so it doesn't work on write back enhanced CPUs:
System designer should be aware that for Intel P24D and P24T CPU operating in write back mode, shadow cacheable areas are not write protected in CPU's internal cache because once the data line being filled in CPU's level 1 cache, there will be no observable bus cycle outside the CPU while CPU write on these cache lines. The line by line write-back / write-through mode (WB/WT# pin) is not supported by the 85C496. Therefore programmers must make sure that software do not write on these locations unless they really meant to change it's contents. For Cyrix Cx486DX, Cx486DX2 these areas can still be write protected by setting the WT1 bit in CPU's CCR2 register.
In practice, was this just not an issue?