I can't disable interrupts with disable() ? 
Author Message
 I can't disable interrupts with disable() ?

Hi,

I've written a little program in MS DOS with Borland C++ 3.0 in an old
pentium 133. The program simply waits for an IRQ11 in the ISA bus and
counts the number of times IRQ11 arrives.

I wanted to test the disable() function, to mask all interrupts, but no
matter where i put it the interrupt IRQ11 keeps being serviced.

I have heard some ideas from colleagues concerning issues of interrupt
and real-mode or protected-mode operation, could this have anything to
do?

Is there something I should have set in the compiler options?

Any ideas why this is not working?

Many thanks for your help

Eduardo

--
___________________________________________________________

  Eduardo Aldaz Carroll,               tel: +41 22 7679153
  CERN, PS Division                    fax: +41 22 7678510
  CH-1211 Geneva 23, Switzerland.      
___________________________________________________________



Sat, 26 Jun 2004 23:40:18 GMT  
 I can't disable interrupts with disable() ?


Quote:
> Hi,

> I've written a little program in MS DOS with Borland C++ 3.0 in an old
> pentium 133. The program simply waits for an IRQ11 in the ISA bus and
> counts the number of times IRQ11 arrives.

This is off-topic in comp.lang.c.

--
- Mark A. Odell
- Embedded Firmware Design, Inc.
- http://www.embeddedfw.com



Sun, 27 Jun 2004 00:22:35 GMT  
 I can't disable interrupts with disable() ?


Quote:
>Hi,

>I've written a little program in MS DOS with Borland C++ 3.0 in an old
>pentium 133. The program simply waits for an IRQ11 in the ISA bus and
>counts the number of times IRQ11 arrives.

>I wanted to test the disable() function, to mask all interrupts, but no
>matter where i put it the interrupt IRQ11 keeps being serviced.

Your question is well beyond the scope of standard C i.e. what we discuss
in comp.lang.c. Platform related issues should be discussed in
platform related newsgroups. Here comp.os.msdos.programmer or perhaps
one of the borland newsgroups would be appropriate.

--
-----------------------------------------


-----------------------------------------



Sun, 27 Jun 2004 07:02:14 GMT  
 I can't disable interrupts with disable() ?

Quote:
> Hi,

> I've written a little program in MS DOS with Borland C++ 3.0 in an old
> pentium 133. The program simply waits for an IRQ11 in the ISA bus and
> counts the number of times IRQ11 arrives.

> I wanted to test the disable() function, to mask all interrupts, but no
> matter where i put it the interrupt IRQ11 keeps being serviced.

> I have heard some ideas from colleagues concerning issues of interrupt
> and real-mode or protected-mode operation, could this have anything to
> do?

DOS 3.0 should make real mode programs by default.  Try the following
code

__asm{
cli

Quote:
}

to disable interrupts (this drops to assembly and gives the assembly
instruction to stop interrupts.  THis is not portable.)

__asm{
sti

Quote:
}

will re-enable them.

Gabe



Sun, 27 Jun 2004 16:56:10 GMT  
 I can't disable interrupts with disable() ?
Hi Gabriel, thanks for your tip,

Yes that seems the right thing to do, but unfortunately I had already
tried:
asm cli
asm {cli}
_asm cli
_asm {cli}

and they don't work either, the only thing that seems to work is to
access the PIC8259 directly with
outport(0x21,0xFF);
This blocks the interrupts OK.
But i'd really like to know why I have no success using cli (or
disable() )... it's a bit puzzling...

Eduardo

Quote:


> > Hi,

> > I've written a little program in MS DOS with Borland C++ 3.0 in an old
> > pentium 133. The program simply waits for an IRQ11 in the ISA bus and
> > counts the number of times IRQ11 arrives.

> > I wanted to test the disable() function, to mask all interrupts, but no
> > matter where i put it the interrupt IRQ11 keeps being serviced.

> > I have heard some ideas from colleagues concerning issues of interrupt
> > and real-mode or protected-mode operation, could this have anything to
> > do?

> DOS 3.0 should make real mode programs by default.  Try the following
> code

> __asm{
> cli
> }

> to disable interrupts (this drops to assembly and gives the assembly
> instruction to stop interrupts.  THis is not portable.)

> __asm{
> sti
> }

> will re-enable them.

> Gabe

--
___________________________________________________________

  Eduardo Aldaz Carroll,               tel: +41 22 7679153
  CERN, PS Division                    fax: +41 22 7678510
  CH-1211 Geneva 23, Switzerland.      
___________________________________________________________



Sun, 27 Jun 2004 18:37:31 GMT  
 I can't disable interrupts with disable() ?

on comp.lang.c:

Quote:
> Hi Gabriel, thanks for your tip,
> Yes that seems the right thing to do, but unfortunately I had already
> tried:
> asm cli
> asm {cli}
> _asm cli
> _asm {cli}
> and they don't work either, the only thing that seems to work is to
> access the PIC8259 directly with
> outport(0x21,0xFF);
> This blocks the interrupts OK.
> But i'd really like to know why I have no success using cli (or
> disable() )... it's a bit puzzling...

Since this doesn't have the tiniest bit to do with C, could you please
stop cross-posting to comp.lang.c?

--

| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/
"Shh! The maestro is decomposing!"
   - Gary Larson



Sun, 27 Jun 2004 18:48:31 GMT  
 I can't disable interrupts with disable() ?


Quote:
> and they don't work either, the only thing that seems to work is to
> access the PIC8259 directly with
> outport(0x21,0xFF);
> This blocks the interrupts OK.
> But i'd really like to know why I have no success using cli (or
> disable() )... it's a bit puzzling...

> Eduardo

Exactly what kind of computer do you have?  What version of DOS?  Are you
using EMM386?  Any DOS-extenders?

    Norm



Mon, 28 Jun 2004 07:22:01 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. disabling hardware interrupts in NT

2. DISABLING INTERRUPTS IN BORLAND C?

3. How to disable the mouse interrupt?

4. non-buffered i/o and disabling interrupts

5. disabling interrupts under OS-9

6. Disabling interrupts from driver level

7. Disabling hardware interrupts

8. ?How to disable a menu without disabling the parent window

9. How to disable IE5.5 menu bar disabled in Windows CE

10. Disabling 'ON_BN_CLICKED' (newbie)

11. CFormView-disabling the 'X' close window

12. Disabling the 'Close' button...revisited

 

 
Powered by phpBB® Forum Software