Re: S3 Virge VGA planar modes
Posted: Sat May 29, 2021 1:16 pm
Well, it seems that Bios uses fragments to realize larger screens, which was possibly expected. I just wonder how that works with the legacy VESA driver and operating systems on top. While Win98 will probably just run in real mode and use the fragmented memory setup, I wonder what that means for VESA drivers of later systems that run in protected mode. from my naive understanding, it would mean that the native VESA driver would then simply fail.
Maybe that is good enough - to have a failsafe fallback for installation, and run in enhanced mode all the way once the Os switches to the protected mode. Who would miss the legacy VGA modes anyhow...
Concerning the interrupt wierdos, I am possibly one step further. While the documentation states that one can access the chip registers either through the I/O ports, or in memory-mapped mode, this does not seem to be generally true. The CRTC/GRT etc ports are always available as I/O ports. Howerver, if my current finding is correct, INPUTSTATUS0 is different. If the chip operates in enhanced mode, it is only available as memory mapped register, and the I/O port returns zero. However, beware if you attempt to read the memory mapped register from non-enhanced VGA modes like planar - then the chip hangs. I suspect that it does a PCI disconnect.
Thus, unlike documented, the availability of MMIO or I/O ports is mode-dependent.
The MMIO register for IRQ also works differently than documented. First, any attempt to read it as 32-bit port clears the lower 16 bits. If only the 16 LSBs are read, the register does return non-zero results, but also differently than documented. You first have to clear the interrupt by writing a 1 bit (that is documented), but you need to write again a zero to make the register ready to indicate an interrupt detection in the next round, otherwise the bit sticks to 1, making it impossible to register any interrupt reliably.
All I can say that the documation of this chip is quite sloppy.
Maybe that is good enough - to have a failsafe fallback for installation, and run in enhanced mode all the way once the Os switches to the protected mode. Who would miss the legacy VGA modes anyhow...
Concerning the interrupt wierdos, I am possibly one step further. While the documentation states that one can access the chip registers either through the I/O ports, or in memory-mapped mode, this does not seem to be generally true. The CRTC/GRT etc ports are always available as I/O ports. Howerver, if my current finding is correct, INPUTSTATUS0 is different. If the chip operates in enhanced mode, it is only available as memory mapped register, and the I/O port returns zero. However, beware if you attempt to read the memory mapped register from non-enhanced VGA modes like planar - then the chip hangs. I suspect that it does a PCI disconnect.
Thus, unlike documented, the availability of MMIO or I/O ports is mode-dependent.
The MMIO register for IRQ also works differently than documented. First, any attempt to read it as 32-bit port clears the lower 16 bits. If only the 16 LSBs are read, the register does return non-zero results, but also differently than documented. You first have to clear the interrupt by writing a 1 bit (that is documented), but you need to write again a zero to make the register ready to indicate an interrupt detection in the next round, otherwise the bit sticks to 1, making it impossible to register any interrupt reliably.
All I can say that the documation of this chip is quite sloppy.