Author |
Message |
Eduardo Aldaz Carrol #1 / 7
|
 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 |
|
 |
Mark A. Odel #2 / 7
|
 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 |
|
 |
Lawrence Kir #3 / 7
|
 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 |
|
 |
Gabriel Sech #4 / 7
|
 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 |
|
 |
Eduardo Aldaz Carrol #5 / 7
|
 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 |
|
 |
Joona I Palast #6 / 7
|
 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 |
|
 |
Norm Dresne #7 / 7
|
 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 |
|
|