VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 2040 of 2048, by Angel Of Nemesis

User metadata
Rank Newbie
Rank
Newbie

Hi, motherboard ASUS P5KPL-SE with Yamaha DS-XG and SB Live! 5.1. I’m trying to turn on the Sound Blaster and getting this error. If it matters, here’s the line: JemmEx X=CC00-CFFF X2MAX-8192 NOEMS NOVME NOINVLPG /MAXEXT=262144 (This is part of the FreeDOS modified config).

The attachment IMG.PNG is no longer available

Reply 2041 of 2048, by DoZator

User metadata
Rank Member
Rank
Member
DoZator wrote on Yesterday, 09:57:

It is obvious that "SETUPDS /s" works before returning to Windows and changes all the necessary registers in one pass. Perhaps this is the peculiarity. We’ll need to try doing this using "RU" instead of "SETUPDS". But I already anticipate that in this case, we might also need to apply the registers twice in a row. We’ll need to take a register dump after "SETUPDS /s", and then try applying it using RU to verify this.

It might be the same with other sound cards. I would check this first.

In general, I checked this myself, and when returning to Windows, this method (with double register restoration) doesn’t work in this case. It only helps to revive the sound card after Windows so that it is detected by SBEMU and works correctly with it in MS-DOS mode. However, to return to Windows, it turned out that you need exactly "setupds /s", and a simple manual rewriting of the registers doesn’t produce the expected effect (even twice or three times). "setupds /s" in this case works some kind of special magic.. (I find it hard to even imagine what exactly it does and how it can be ported to all other sound cards that don’t have a built-in DOS configuration tool).

Reply 2042 of 2048, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Angel Of Nemesis wrote on Yesterday, 17:44:

Hi, motherboard ASUS P5KPL-SE with Yamaha DS-XG and SB Live! 5.1. I’m trying to turn on the Sound Blaster and getting this error. If it matters, here’s the line: JemmEx X=CC00-CFFF X2MAX-8192 NOEMS NOVME NOINVLPG /MAXEXT=262144 (This is part of the FreeDOS modified config).

The attachment IMG.PNG is no longer available

Based on the screen message, it crashes on the QEMM qpi installation for OPL port 388-38B, when perform a linear memory copy (ds base=0, limit=0xFFFFFFFF) there is a page fault (#PF , 0Eh)
and the error 06 for page fault indicates writing to a non-present page.

It seem that you don't use "DOS=UMB" so SBEMU allocated UMB from Jemm via XMS. but There's bug because of my recently changes. But that code is disabled in the newest commit.
it still need fix if it's enabled in the future, please wait for the fix.

For now you can use DOS=UMB to temporarily fix it.

EDIT: you can try the latest rc4 release.
the new release also removed all dos memory usage like the vdpmi build, except that it still hooks IVT entry 2Dh.

Last edited by crazii on 2026-11-25, 04:38. Edited 1 time in total.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 2043 of 2048, by Plombo

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2026-11-23, 09:54:
Plombo wrote on 2026-11-19, 20:02:
  • The SB16 driver installer (sbbasic.exe from here) detects "sbemu /T6" as a Sound Blaster 16 (good), but crashes with a VDPMI error during installation. The installer does work with SBEMU+QEMM+HDPMI, so this is a VDPMI issue.
  • Going back to VDPMI and running Windows after this, it's unable to load the SB16 driver, so I still don't get any sound. Windows says to make sure the file exists, but I'm guessing it's actually the driver failing somehow?

I tested the sbbasic driver it installs fine for me. the diagnose.exe reports some error probably because sb16 emulation is not complete. the mixer utility works fine.
why you need the Sb16 driver? sbemu works without it. is it that you try to make it work in windows?

Yes, it's for the Windows 3.1 driver. The SB16 DOS driver isn't needed, as you say. It's odd that the installer worked for you with VDPMI, but not for me.

I do think the installer issue is less important than the Windows 3.1 drivers not being able to detect the card. In addition to the issue I described with the SB16 driver, the SB 1.0 and SB 1.5 drivers that are included with Windows 3.11 also can't detect the card. They bring up a dialog saying "the port setting does not match those on the card", even when the correct port and IRQ (220/7) are selected in the dialog. I also tried switching SBEMU from /T6 to /T1, and the same thing still happens. So there seems to be some wider issue with SBEMU and the SB detection methods used by Windows 3.1 drivers.

Reply 2044 of 2048, by RayeR

User metadata
Rank Oldbie
Rank
Oldbie

I load the realmode NIC driver in autoexec usually only for boot menu path launching Windows98 in autoexec:

REM Load realmode NDIS2 driver RTGND.DOS for RTL8111E
C:\WINDOWS\net start

If I use JEMM or previous VDPMI + XHDD.SYS then network driver loads fine. It hanged only with the latest VDS disabled version (I only changed VIntFlag=0 in config for himemex+ramdsk64).

some AI explanation that seems to match our observation (fallback to PIO):

How the BIOS Uses VDS for INT 13h Disk DMA
To execute a bus-mastering DMA disk read or write inside an INT 13h handler (or an Option ROM like a SCSI/SATA controller BIOS), the BIOS follows a strict sequence:
1. Check for VDS. Before starting a disk transfer, the INT 13h handler checks bit 5 of byte 0040:007Bh in the BDA.
• If clear: The CPU is in pure Real Mode. The BIOS calculates the physical address directly (Segment * 16 + Offset) and programs the disk controller's DMA engine.
• If set: A VDS provider is active, and the BIOS must translate the buffer address via INT 4Bh.
2. Lock the Buffer (INT 4Bh, AX = 8103h or 8105h).
• Scatter/Gather (AX = 8105h). Modern bus-master IDE/SATA and SCSI controllers use Physical Region Descriptor (PRD) tables. The BIOS fills an EDDS with the caller's ES:BX buffer address and calls INT 4Bh (AX = 8105h). VDS locks the pages and returns an array of physical addresses and byte lengths, which the BIOS writes directly into the controller's PRD table.
• Contiguous / Bounce Buffer (AX = 8103h). If the controller requires a single contiguous block, the BIOS uses a standard DDS and calls INT 4Bh (AX = 8103h) with flags allowing VDS to automatically allocate and copy to/from an internal DMA buffer if the target memory isn't physically contiguous.
3. Execute the Hardware DMA Transfer.
The BIOS programs the disk controller's bus-master registers with the physical addresses returned by VDS and triggers the read or write command.
4. Unlock the Buffer (INT 4Bh, AX = 8104h or 8106h).
Once the disk controller signals completion via IRQ, the BIOS calls the corresponding VDS unlock function (8104h for DDS, 8106h for EDDS). If a bounce buffer was used during a disk read, VDS copies the data from the physical buffer back into the caller's virtual buffer before releasing the lock. www.os2museum.com
5. Fallback to PIO.
If VDS returns an error (for example, insufficient DMA buffer space or an unsupported memory region), a well-behaved BIOS INT 13h routine falls back to Programmed I/O (PIO) using REP INSW/REP OUTSW, which uses virtual CPU addresses and requires no physical address translation.
(Note: Because implementing full VDS scatter/gather logic inside a cramped motherboard BIOS ROM was complex, many early PCI IDE BIOSes skipped VDS and used PIO for INT 13h, leaving bus-master DMA to protected-mode OS drivers. SCSI Option ROMs and later BIOSes with full UDMA support implemented this exact flow.)

Gigabyte GA-P67-DS3-B3, Core i7-2600K @4,5GHz, 8GB DDR3, 128GB SSD, GTX970(GF7900GT), SB Audigy + YMF724F + DreamBlaster combo + LPC2ISA

Reply 2045 of 2048, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Plombo wrote on Today, 02:15:
crazii wrote on 2026-11-23, 09:54:
Plombo wrote on 2026-11-19, 20:02:
  • The SB16 driver installer (sbbasic.exe from here) detects "sbemu /T6" as a Sound Blaster 16 (good), but crashes with a VDPMI error during installation. The installer does work with SBEMU+QEMM+HDPMI, so this is a VDPMI issue.
  • Going back to VDPMI and running Windows after this, it's unable to load the SB16 driver, so I still don't get any sound. Windows says to make sure the file exists, but I'm guessing it's actually the driver failing somehow?

I tested the sbbasic driver it installs fine for me. the diagnose.exe reports some error probably because sb16 emulation is not complete. the mixer utility works fine.
why you need the Sb16 driver? sbemu works without it. is it that you try to make it work in windows?

Yes, it's for the Windows 3.1 driver. The SB16 DOS driver isn't needed, as you say. It's odd that the installer worked for you with VDPMI, but not for me.

I do think the installer issue is less important than the Windows 3.1 drivers not being able to detect the card. In addition to the issue I described with the SB16 driver, the SB 1.0 and SB 1.5 drivers that are included with Windows 3.11 also can't detect the card. They bring up a dialog saying "the port setting does not match those on the card", even when the correct port and IRQ (220/7) are selected in the dialog. I also tried switching SBEMU from /T6 to /T1, and the same thing still happens. So there seems to be some wider issue with SBEMU and the SB detection methods used by Windows 3.1 drivers.

I don't think it will work in windows, either in 3.x std mode or 386enhanced mode.
the std mode uses vcpi that out of the control of v86monitor or dpmi. the enhanced mode even get rid of the original emm/v86 monitor.

a driver is needed and I plan to write it after the full alsa is present.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 2046 of 2048, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
RayeR wrote on Today, 02:39:
I load the realmode NIC driver in autoexec usually only for boot menu path launching Windows98 in autoexec: […]
Show full quote

I load the realmode NIC driver in autoexec usually only for boot menu path launching Windows98 in autoexec:

REM Load realmode NDIS2 driver RTGND.DOS for RTL8111E
C:\WINDOWS\net start

If I use JEMM or previous VDPMI + XHDD.SYS then network driver loads fine. It hanged only with the latest VDS disabled version (I only changed VIntFlag=0 in config for himemex+ramdsk64).

some AI explanation that seems to match our observation (fallback to PIO):

How the BIOS Uses VDS for INT 13h Disk DMA
To execute a bus-mastering DMA disk read or write inside an INT 13h handler (or an Option ROM like a SCSI/SATA controller BIOS), the BIOS follows a strict sequence:
1. Check for VDS. Before starting a disk transfer, the INT 13h handler checks bit 5 of byte 0040:007Bh in the BDA.
• If clear: The CPU is in pure Real Mode. The BIOS calculates the physical address directly (Segment * 16 + Offset) and programs the disk controller's DMA engine.
• If set: A VDS provider is active, and the BIOS must translate the buffer address via INT 4Bh.
2. Lock the Buffer (INT 4Bh, AX = 8103h or 8105h).
• Scatter/Gather (AX = 8105h). Modern bus-master IDE/SATA and SCSI controllers use Physical Region Descriptor (PRD) tables. The BIOS fills an EDDS with the caller's ES:BX buffer address and calls INT 4Bh (AX = 8105h). VDS locks the pages and returns an array of physical addresses and byte lengths, which the BIOS writes directly into the controller's PRD table.
• Contiguous / Bounce Buffer (AX = 8103h). If the controller requires a single contiguous block, the BIOS uses a standard DDS and calls INT 4Bh (AX = 8103h) with flags allowing VDS to automatically allocate and copy to/from an internal DMA buffer if the target memory isn't physically contiguous.
3. Execute the Hardware DMA Transfer.
The BIOS programs the disk controller's bus-master registers with the physical addresses returned by VDS and triggers the read or write command.
4. Unlock the Buffer (INT 4Bh, AX = 8104h or 8106h).
Once the disk controller signals completion via IRQ, the BIOS calls the corresponding VDS unlock function (8104h for DDS, 8106h for EDDS). If a bounce buffer was used during a disk read, VDS copies the data from the physical buffer back into the caller's virtual buffer before releasing the lock. www.os2museum.com
5. Fallback to PIO.
If VDS returns an error (for example, insufficient DMA buffer space or an unsupported memory region), a well-behaved BIOS INT 13h routine falls back to Programmed I/O (PIO) using REP INSW/REP OUTSW, which uses virtual CPU addresses and requires no physical address translation.
(Note: Because implementing full VDS scatter/gather logic inside a cramped motherboard BIOS ROM was complex, many early PCI IDE BIOSes skipped VDS and used PIO for INT 13h, leaving bus-master DMA to protected-mode OS drivers. SCSI Option ROMs and later BIOSes with full UDMA support implemented this exact flow.)

So is it OK for you to disable VDS provided the NIC driver problem is gone?
I think it is the easiest path. and with less effort to hack.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 2047 of 2048, by Plombo

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on Today, 04:46:

I don't think it will work in windows, either in 3.x std mode or 386enhanced mode.
the std mode uses vcpi that out of the control of v86monitor or dpmi. the enhanced mode even get rid of the original emm/v86 monitor.

a driver is needed and I plan to write it after the full alsa is present.

Ah, that would do it! I hadn't realized that 386 Enhanced Mode disables the original EMM/v86 monitor. I will look forward to your driver, then 😀

Does ALSA refer to the Advanced Linux Sound Architecture? Is the idea to have broad compatibility with any Linux sound driver? If so, that sounds quite ambitious.

Reply 2048 of 2048, by Angel Of Nemesis

User metadata
Rank Newbie
Rank
Newbie

EDIT: you can try the latest rc4 release.
the new release also removed all dos memory usage like the vdpmi build, except that it still hooks IVT entry 2Dh.

Thank you very much, everything is working now!

The attachment IMG.png is no longer available