EEEPC, FreeDOS, SBEMU
A few times ago, I took on the task of revitalizing my old Eee PCréhabiliter mon vieil eeepc This rehabilitation passed through the installation of FreeDOS to get:
- a decent boot time
- access to the entire repository of software available under DOS (including games ;))
Everything went as planned: it’s really much faster than the base system (Linux is performant, but multitasking, network stack and all the advantages of the system come with a boot time cost) but I was missing a crucial feature (especially for games): sound card support.
Well, a developer named “crazii” has solved my problem by creating SBEMU, an emulation layer that uses the processor’s material interception capabilities to catch sound card calls. And it works quite well, demo!!!
(If you’re nostalgic for the trackers or demos of the Future Crew group, from which this music is derived, I recommend the following album: Tracked on BandCamp)
Installation
Download the release first from the SBEMU GitHub and decompress it into a directory on your DOS disk.
FDCONFIG.SYS
The first part of the installation takes place in the equivalent file CONFIG.SYS for FreeDOS to load into memory the extended memory manager JEMMEX in a version compatible with the SBEMU plugin (remember to remove other extended memory managers):
DEVICE=c:\sbemu\jemmex.exe
FDAUTO.BAT
The rest takes place in the equivalent of AUTOEXEC.BAT for FreeDOS:
c:\sbemu\jload c:\sbemu\qpiemu.dll
c:\sbemu\hdpmi32i -r -x
c:\sbemu\sbemu
And if everything goes well, a little reboot and your SoundBlaster emulation should be functional. Note that:
- it doesn’t work with all programs, especially when using a home-made DOS extender
- the FM OPL synthesis emulation requires software emulation (coming from DOSBox) which consumes a bit of CPU.
All the details and ongoing discussions can be found on the Vogons.org forum.
Enjoy!!!
Bonus: Background story
For the record, before this software was unveiled, I tried to get the sound card working by patching a DOS music program: xmp-cli. A great opportunity to revisit my old passions: x86 assembly and system programming.
First Step: Identify the Hardware.
Many websites provide specifications for the netbook: the sound is handled by a Intel HDA (High Definition Audio) compatible card.
Second Step: Intel High Definition Audio Specifications.
Intel High Definition Audio is an audio technology developed by Intel to improve sound performance in computers. The HD Audio technology enables efficient management of digital and analog audio signals, as well as better integration with modern operating systems. It was launched by Intel in 2004 as a successor to the PC AC'97 audio standard. Once this was identified, it was necessary to tackle the specs: https://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/high-definition-audio-specification.pdf
The challenges and the end of the project
I won’t go into details, it would be too long, just a small list:
- The card must be mapped to a memory address under 4GB, otherwise it’s impossible to access it from DOS. Phew, that’s good.
- To communicate with the card, you need to access its memory region through its physical address. To obtain this address, you must lock XMS memory.
- Since the program is in protected mode, you need to use DPMI (…) to make real-mode calls to XMS functions.
- These same functions do not call via interrupts but rather via direct memory calls (and you need DPMI again to escape from protected mode).
I had followed the track, coded the card detection, its initialization, and was trying to launch the module reading that ended up failing for now. Now it’s no longer useful to pull out the thread, but I had a great time diving back into the depths of system programming under DOS. 👍
References
- Intel HDA Specifications: https://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/high-definition-audio-specification.pdf
- DPMI Documentation: http://www.techhelpmanual.com/571-dpmi_services.html
- XMS Documentation: http://www.edm2.com/index.php/EXtended_Memory_Specification_v3.0
- xmp-cli: https://github.com/libxmp/xmp-cli