digger
Experienced Member
Hi.
As many of you know, John Miles released the source code to his Audio Interface Library (AIL) drivers some years ago. He also released the source code to the AIL/32 protected mode variant of those drivers, which are used in a number of protected mode DOS games, including SimCity 2000.
I figured it might be cool to use the AIL/32 driver model as a basis for writing drivers for more modern sound devices (AC'97, Intel HDA, etc).
However, the existing AIL/32 driver sources are written in assembly language. I managed to figure out how to write a dummy driver that successfully loads as a DLL (as the original AIL/32 did). But I have been unable to figure out how to write the same dummy driver in C. I just can't seem to get it to compile in a way that the entry points end up at the right location. The reason why I want to be able to write AIL/32 in C as well, is because I'm hoping that his would allow me to port over source code from Linux and BSD sound drivers to DOS.
I started out with Wohlstand's "port" of the AIL/32 driver code base that builds with GNU Make, Open Watcom and JWasm.
It was a bit challenging writing a separate driver, since the drivers for the various types of sound cards are compiled from a single assembly file, depending on which flags (defines) are provided on the command-line, as you can see in the Makefile. I started out with the PAS (Pro Audio Spectrum) driver as a basis and first stripped out all the code specific to other sound cards, and lastly the PAS-specific stuff, which got me a dummy or skeleton driver that gets loaded successfully by the stp32.exe example utility, which loads a specified digital audio AIL/32 driver and then plays back a specified .WAV file through it.
It successfully loads my skeleton driver in assembly language (that's basically the PAS driver source with all the device-specific stuff stripped out).
The mechanism for loading the AIL/32 DLL drivers is implemented in the `dllload.c` file.
Now the second step was to try writing and compiling the same dummy driver, but in C, but I can't get stp32.exe to load it.
Are there any people here who are savvy enough both in DOS assembly and C to help me figure out how to get it to work?
I guess I could take the assembly-based dummy file as a basis for a C driver as well, and then include C sources and call those from the assembly routines, but that seems kind of redundant. I'm sure there's a way to write and compile an AIL/32 driver in C directly, right?
I'm attaching the dummy driver code in assembly below:
As many of you know, John Miles released the source code to his Audio Interface Library (AIL) drivers some years ago. He also released the source code to the AIL/32 protected mode variant of those drivers, which are used in a number of protected mode DOS games, including SimCity 2000.
I figured it might be cool to use the AIL/32 driver model as a basis for writing drivers for more modern sound devices (AC'97, Intel HDA, etc).
However, the existing AIL/32 driver sources are written in assembly language. I managed to figure out how to write a dummy driver that successfully loads as a DLL (as the original AIL/32 did). But I have been unable to figure out how to write the same dummy driver in C. I just can't seem to get it to compile in a way that the entry points end up at the right location. The reason why I want to be able to write AIL/32 in C as well, is because I'm hoping that his would allow me to port over source code from Linux and BSD sound drivers to DOS.
I started out with Wohlstand's "port" of the AIL/32 driver code base that builds with GNU Make, Open Watcom and JWasm.
It was a bit challenging writing a separate driver, since the drivers for the various types of sound cards are compiled from a single assembly file, depending on which flags (defines) are provided on the command-line, as you can see in the Makefile. I started out with the PAS (Pro Audio Spectrum) driver as a basis and first stripped out all the code specific to other sound cards, and lastly the PAS-specific stuff, which got me a dummy or skeleton driver that gets loaded successfully by the stp32.exe example utility, which loads a specified digital audio AIL/32 driver and then plays back a specified .WAV file through it.
It successfully loads my skeleton driver in assembly language (that's basically the PAS driver source with all the device-specific stuff stripped out).
The mechanism for loading the AIL/32 DLL drivers is implemented in the `dllload.c` file.
Now the second step was to try writing and compiling the same dummy driver, but in C, but I can't get stp32.exe to load it.
Are there any people here who are savvy enough both in DOS assembly and C to help me figure out how to get it to work?
I guess I could take the assembly-based dummy file as a basis for a C driver as well, and then include C sources and call those from the assembly routines, but that seems kind of redundant. I'm sure there's a way to write and compile an AIL/32 driver in C directly, right?
I'm attaching the dummy driver code in assembly below: