delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/27/23:00:08

From: paochen_paul AT hotmail DOT com (Paul Simon)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Weird mouse interrupt...Help!
Date: 27 Nov 2002 19:46:39 -0800
Organization: http://groups.google.com/
Lines: 51
Message-ID: <4d62e692.0211271946.799e233b@posting.google.com>
References: <4d62e692 DOT 0211261918 DOT d6be735 AT posting DOT google DOT com> <hqs8uu04qrhp5363t9ref760hhbdstnn3i AT 4ax DOT com>
NNTP-Posting-Host: 61.222.76.236
X-Trace: posting.google.com 1038455199 23348 127.0.0.1 (28 Nov 2002 03:46:39 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 28 Nov 2002 03:46:39 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Andrew Cottrell <andnews AT ihug DOT com DOT oz DOT au> wrote in message news:<hqs8uu04qrhp5363t9ref760hhbdstnn3i AT 4ax DOT com>...
> >I have a GUI to handle mouse interrupt and H/W interrupt, I used "INT
> >33H" to handle mouse interrupt. It worked fine with COM port mouse
> >when H/W interrupt
> >has occurred, but hang with PS2 mouse. It's there an other way to
> >handle PS2 mouse interrupt or How can I avoid system hang?
> >
> >The GUI worked on pure DOS (Windows 98 [Version 4.10.2222])
> My only suggestion is to have a looks at how TV or Allegro work as
> they both work with PS/2 mouses.

Thanks for Andrew replied!

When I replaced the source code disable() and enable() by 
("sti") and ("cli") in my H/W interrupt handler, then system 
never been hung, they work fine both with PS/2 mouse and 
COM port mouse. So I think my problem has been solved!
but I don't know why?

my previous code here.

hardware_int_handler()
{
    disable();
    
    //your handler code here.

    outportb (0x20, 0x20); //EOI  for IRQ0-7
    outportb (0xA0, 0x20); //EOI  for IRQ8-15, both 8259 chips moust get EOI
    enable();
}

-----Here is the snippet code captured from comp.os.msdos.djgpp-----
#define INTERRUPT_ENTER(); asm("sti"); /* enable maskable interrupts*/
#define INTERRUPT_LEAVE(); asm("cli"); /* disable maskable interrupts*/\
                           outportb (0x20, 0x20); /* End of interrupt */
#define INTERRUPT_LEAVE_BOTH();	asm ("cli"); /* disable maskable interrupts */ \
                                outportb (0x20, 0x20); /* End ofinterrupt  */ \
                                outportb (0xA0, 0x20); /* End ofinterrupt  */
----------------------------------------------------------------------------

hardware_int_handler()
{
   INTERRUPT_ENTER();

   //your handler code here.
  
   INTERRUPT_LEAVE_BOTH();
}

After use this method, my program work fine on PURE DOS.

- Raw text -


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