Mail Archives: djgpp/1999/05/23/08:51:02
There is one other problem I didn't have too much trouble spotting.
(you really *are* new to this, aren't you...)
You can't just create a function and set it up as an interrupt
handler. This is because normal functions
a) don't save register values and
b) don't return using 'iret'
You need to create a wrapper function, using:
_go32_dpmi_allocate_iret_wrapper()
Also, how are you locking the code/data? If you must code the handler
in C (instead of assembly, which is preferable), the only really
guarenteed way of locking functions is to lock *all* code.
I stress that you should obtain a copy of FAQ and read carefully and
completely the related sections.
Davin.
On Fri, 21 May 1999 12:26:04 -0500, Mark Phillips
<umphill5 AT cs DOT umanitoba DOT ca> wrote:
>
>hmm, well i guess my interrupt wasn't getting called.
>i realised my irq settings were wrong and i changed
>those. now, the sound will play, and when it's done,
>i get a SIGSEGV GPF. i assume the interrupt function
>is getting called now and something in it is doing
>bad things. here is the function again:
>
>static void interrupt_handler()
>{
> inportb(interptAcknowlg8); // sb acknowledge
> donePlaying = true;
> outportb(0x20,0x20); // acknowledge interrupt
> outportb(0xA0,0x20);
>}
>
>it looks ok to me. i'm pretty sure i locked
>down all of the relevant code/variables. i just
>locked interptAcknowlg8, donePlaying, and then
>the function code itself. do i have to lock
>inportb and outportb and anything they call
>too? i looked at the faq, and the only thing i
>could find that might be helpful was "do all
>the other chores described in the DPMI spec"
>which i don't think i did, but when i looked at
>the spec i couldn't really see where it said
>what i was supposed to do. the message when it
>crashes is this:
>
[snip]
__________________________________________________________
*** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/
- Raw text -