Mail Archives: djgpp/1999/05/20/17:30:30
From: | Mark Phillips <umphill5 AT cs DOT umanitoba DOT ca>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | newbie interrupt programmer
|
Date: | Thu, 20 May 1999 16:07:52 -0500
|
Organization: | The University of Manitoba
|
Lines: | 37
|
Message-ID: | <Pine.GSO.3.96.990520155027.16539A-100000@gold.cs.umanitoba.ca>
|
NNTP-Posting-Host: | gold.cs.umanitoba.ca
|
Mime-Version: | 1.0
|
X-Trace: | canopus.cc.umanitoba.ca 927234481 19071 130.179.24.1 (20 May 1999 21:08:01 GMT)
|
X-Complaints-To: | Postmaster AT cc DOT umanitoba DOT ca
|
NNTP-Posting-Date: | 20 May 1999 21:08:01 GMT
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
i've never done anything with interrupts before, let alone worrying about
protected mode and all that other garbage, so forgive me if i completely
fail to know what i'm talking about. i'm trying to write a program that
will play a buffer of data to the soundblaster, and then quit when it's
done. it works fine, except that it doesn't quit when it's done. here's
the loop it gets stuck in:
while ( !donePlaying ) {}
donePlaying is a global bool. my interrupt function looks like this:
static void interrupt_handler()
{
inportb(interptAcknowlg8); // sb acknowledge
donePlaying = true;
outportb(0x20,0x20); // acknowledge interrupt
outportb(0xA0,0x20);
}
i would have expected that when the buffer is played, donePlaying gets
assigned false, and the program would quit. i set up the interrupt like
this:
newInterrupt.selector = _my_cs();
newInterrupt.offset32 = (int)interrupt_handler;
__dpmi_set_protected_mode_interrupt_vector(endOfIRQVector, &newInterrupt);
so if someone could solve my problem for me or wants me to give them more
code that would be cool.
and endOfIRQVector is set to 15 (which is what it should be for IRQ 7,
right?). i saw one example where the guy multiplied it by 4 for some
reason so i tried that and it didn't work either. thanks a lot.
mark phillips.
- Raw text -