Sound Blaster 16 emulation for DOS 6.22
Reversing this WYSE machine BIOS I have learned that this CS5536 chipset together with the VSA software can emulate a Sound Blaster 16. By default the BIOS exposes the audio AC97 device directly to the OS on the PCI bus. But there are settings to be made for the BIOS to hide this AC97 and emulate a Sound Blaster 16.
This will be great, because all the DOS games and software are compatible to SB16 by default, and there are already made drivers for SB16 for the MS-DOS. This way it might be possible to have real sound on the DOS.
At some time there was an XpressAUDIO ROM, provided by the AMD, that had made this emulation possible. XpressAudio is actually a VSM (Virtual Support Module) that was not included in this VSA ROM of this WYSE BIOS.
For short, the VSA ROM is loaded by the BIOS at system power up. The VSA is searching for all included VSMs and is copying them to separate segments in higher memory (CPU is in real mode and this memory is hidden from the OS). Then is setting some MSRs (Model Specific Registers) inside of the CS5536 to trigger an interrupt for any access to the virtualized devices resources.
In the SB16 case, for any access to IO base 220h, CS5536 will trigger an interrupt. CPU registers will be saved and the ISR (XpressAUDIO) will do the emulation by routing any data sent to IO 220 to the AC97 on the PCI bus.
All of this VSMs are not system dependent. VSA is doing all the hardware abstraction for them, so it will be possible to port this XpressAudio from one BIOS to another. Only dependency for the VSMs is the VSA version.
The actual BIOS was made for this XpressAudio, because is trying to set the virtual registers of the XpressAudio and it fails. This is how the WYSE engineers did it. The BIOS and the VSA was provided fully functional by the AMD company and the WYSE just stripped lots of functions from it.
In this file from the VSA 2 source code I have found this definitions of the XpressAudio virtual registers. (Source code of the VSA 2 (incomplete), is actually a library for building the VSA ROM).
The VRC_AUDIO is a VSA (Virtual System Architecture) XpressAudio class.
The SB_16_IO_BASE is a virtual register.
In this "XpressROM Firmware_funcspec" at page 129 and 103 is described the procedure to set this registers.
Our WYSE BIOS was stripped out from this XpressAudio and some NVRAM tokens that meant to be used to set the XpressAudio virtual registers, but the BIOS functions that need to set this registers have remained. This functions are setting nothing now without the XpressAudio VSM.
I have found the Function that does just that in the BIOS Boot Block. The function is searching first for NVRAM tokens to see what values should be set in this registers.
BIOS Boot Block function to set up the virtual audio device |
Normally this NVRAM tokens are made for the BIOS GUI to change them by changing a setting in the BIOS user interface (this BIOS GUI was stripped too), saving the settings and after the system will restart all the functions in the BIOS will load the values saved in this NVRAM tokens. This is how a legacy BIOS is applying the settings that you made in the BIOS graphic interface.
Some NVRAM tokens are documented in here.
The "Audio_VRC_3D46" offset in the picture above is the start of a Virtual Registers list:
Audio VRC list |
- SB_16_IO_BASE
- PM_STATE
- CPU_USAGE
NVRAM_to_Virtual_Reg_sub_3E14 function |
BIOS GUI from other system with Geode and CS5536 |
Comments
Post a Comment