delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/30/17:35:48

Message-ID: <3894ABFC.C8B3F695@bigfoot.com>
From: JP Morris <doug-15 AT bigfoot DOT com>
Organization: Aircraft Liberation Front
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: IRQ 5, CWSDPMI and PMODETSR
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000130102330 DOT 17273X AT is> <3894742F DOT FE29826E AT bigfoot DOT com> <389494D8 DOT F2B7E5E1 AT is DOT elta DOT co DOT il>
Lines: 85
Date: Sun, 30 Jan 2000 21:24:12 +0000
NNTP-Posting-Host: 212.56.119.112
X-Complaints-To: abuse AT plus DOT net DOT uk
X-Trace: wards 949267493 212.56.119.112 (Sun, 30 Jan 2000 21:24:53 GMT)
NNTP-Posting-Date: Sun, 30 Jan 2000 21:24:53 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> > The reason I asked was to see if anyone knew of any differences
> > in the design of CWSDPMI regarding the way IRQs are dealt with
> > compared to other DOS extenders such as DOS4GW and PMODE, which
> > was designed to replace DOS4GW.
> 
> This question has a trivial (and useless) answer: of course CWSDPMI handles
> IRQs differently.  Every DPMI server and every DOS extender treats hardware
> interrupts in its own special way.

Ah, but in certain circumstances DOS4GW and it's ilk will only operate
if they
receive IRQs revectored to something strange like 0x80 onwards.

I have a feeling that is what is happening, my next test will be to see
if
this is the case.

> I still think that if you tell a bit more about the offending application(s)
> and perhaps show some code from them (assuming you did write some code of
> your own), someone could come up with useful, rather than useless, answers.

Basically, everything that tries to use the soundblaster.
For DJGPP the main sound libraries appear to be:

Allegro
Midas
Seal
Other misc (Quake, SBDJ)

Allegro, Midas, SBDJ and Quake have source code available, Seal does
not.

First, Allegro.
At first I assumed it was an Allegro problem so I went through
each block of the sound driver code and inserted printf statements
except for the IRQ handler, which I made count the number of times
it was called.

This was always 0, except when another sound card was installed, or
PMODETSR is used instead of CWSDPMI.
This shows that the IRQs are not reaching the handler, except when
PMODETSR is used.

Interestingly Quake works, because it uses it's own sound code.
Examining the source code for that, I found that it doesn't use IRQs
-at all- and instead monitors the progress of the DMA transfer using
an update routine in the main game loop.

SBDJ and Seal behave the same way as Allegro, unless PMODETSR is used
as the DPMI server, in which case the playback is scrambled (but I'm
treating this as a separate issue).

Midas is interesting because it 'nearly' works.  If the SB 2.0 driver
is used, it does work, but not if the SB Pro driver is used.
I'm guessing that the SB 2.0 driver does something strange like
Quake, but I haven't looked because the driver is assembler code.


As many know, DRDOS (7.00 - 7.02) shipped with a version of EMM386
that caused strange things to happen if it's VCPI services were used.
Basically it could either run DOS4GW programs such as DOOM, or any other
DPMI programs, such as DJGPP programs.
This could be changed by issuing the command EMM386 PIC=ON and EMM386
PIC=OFF
at the DOS prompt.

What actually happened was that DOS4GW would only handle IRQs correctly
if
the VCPI server redirected all the IRQs to the interrupt 0x80 range, and
then
told DOS4GW that they were still at 0 onwards.  If it was told the truth
it
crashed, but if lied to it worked.  EMM386 PIC=ON meant 'lie'.

I'm wondering if the soundblaster IRQ has been revectored by the Aureal
driver program.

-- 
JP Morris - aka DOUG the Eagle (Dragon) -=UDIC=-  DOUG-15 AT bigfoot DOT com
Fun things to do with the Ultima games            (http://ithe.cjb.net)
Developing a U6/U7 clone                          (http://fly.to/ire)
d+++ e+ N+ T++ Om U1234!56!7'!8!KA u++ uC+++ uF+++ uG---- uLB----
uA--- nC+ nR---- nH+++ nP++ nI nPT nS nT wM- wC- y a(YEAR - 1976)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019