From: default <@res.raytheon.com> Newsgroups: comp.os.msdos.djgpp Subject: Re: More Q's about IRQs Date: Thu, 10 Sep 1998 10:34:14 -0400 Organization: Raytheon Electronic Systems Lines: 139 Message-ID: <35F7E365.A765E58A@res.raytheon.com> References: NNTP-Posting-Host: neomar1.res.ray.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------D43330DE39474D884A44BA85" To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk --------------D43330DE39474D884A44BA85 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > On Wed, 9 Sep 1998 default AT DOT MISSING-HOST-NAME. wrote: > > > Of course the wrappers don't issue EOI! How can they? For starters, the > wrapper doesn't know which IRQ are you hooking, and the EOI code differs > depending on whether you use IRQ0-IRQ7 or IRQ8-IRQ15. Also, the > programmer could decide not to EOI the PIC from the handler, but from > some other point in the program, and the wrapper has no buisness > second-guessing that. Hey, relax. I issue a general EOI to clear all ints. I just wasn't sure how automatic the _go32 routines were. > Interrupt-driven transmitting is tricky. Please post the code that > initializes the UART, the key to this mystery might be there. The big problem is not the Initialization, everything works fine in real mode, the problem is converting the code to PM. The only initialization concern is whether or not loopback mode is enabled (which it isn't) anyway, because Tx and Rx are tied together, which means data out goes straight to the data in buffer on the same chip, so that the parameters(whatever they may be) are the same. The interrupt only seems to be responding when I physically read the port from the main program with an iniob(COM_BASE). It is also evident that more than one interrupt is being generated for every port read I perform. It just seems like there is some subtle point that I'm missing in declaring the PM interrupt. Maybe my main loop is performing a mode switch somewhere? Would that do it? Anyways, I'll post it again. Thanks for trying to help. int i = 0x00; while(kbhit() == 0) { if(bufrdptr != bufwrtptr) { /* i.e. if data has been written to buffer since last read*/ gotoxy(5,5); cprintf("com_buffer:%s\n\r", com_buffer[bufrdptr]); bufrdptr = (bufrdptr < 0x400) ? (bufrdptr + 1) : 0; } gotoxy(10,10); cprintf("Read: % 3d Write: % 3d", bufrdptr, bufwrtptr); delay(100); gotoxy(10,11); cprintf("Writing % 2d to port\n\r",i); outportb(BASE, i); gotoxy(10,12); /*************************************************************/ /* here is the magic mystery: */ cprintf("Reading Port % 2d \n\r", inportb(BASE)); /* note BASE = 0x3F8*/ /*************************************************************/ i += (i < 0xFFF) ? 1 : 0; } <\MAIN()_CODE_FRAGMENT> --------------D43330DE39474D884A44BA85 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit  

Eli Zaretskii wrote:

On Wed, 9 Sep 1998 default AT DOT MISSING-HOST-NAME. wrote:
 

Of course the wrappers don't issue EOI!  How can they?  For starters, the
wrapper doesn't know which IRQ are you hooking, and the EOI code differs
depending on whether you use IRQ0-IRQ7 or IRQ8-IRQ15.  Also, the
programmer could decide not to EOI the PIC from the handler, but from
some other point in the program, and the wrapper has no buisness
second-guessing that.

Hey, relax. I issue a general EOI to clear all ints. I just wasn't sure how automatic the _go32 routines were.
Interrupt-driven transmitting is tricky.  Please post the code that
initializes the UART, the key to this mystery might be there.
 The big problem is not the Initialization, everything works fine in real mode, the problem is converting the code to PM. The only initialization concern is whether or not loopback mode is enabled (which it isn't) anyway, because Tx and Rx are tied together, which means data out goes straight to the data in buffer on the same chip, so that the parameters(whatever they may be) are the same. The interrupt only seems to be responding when I physically read the port from the main program with an iniob(COM_BASE). It is also evident that more than one interrupt is being generated for every port read I perform. It just seems like there is some subtle point that I'm missing in declaring the PM interrupt. Maybe my main loop is performing a mode switch somewhere? Would that do it? Anyways, I'll post it again. Thanks for trying to help.

<MAIN()_CODE_FRAGMENT>
 int i = 0x00;
 while(kbhit() == 0) {
  if(bufrdptr != bufwrtptr) {    /* i.e. if data has been written to
buffer since last read*/
   gotoxy(5,5);
   cprintf("com_buffer:%s\n\r", com_buffer[bufrdptr]);
   bufrdptr = (bufrdptr < 0x400) ? (bufrdptr + 1) : 0;
  }
  gotoxy(10,10);
  cprintf("Read: % 3d  Write: % 3d", bufrdptr, bufwrtptr);
  delay(100);
  gotoxy(10,11);
  cprintf("Writing % 2d to port\n\r",i);
  outportb(BASE, i);
  gotoxy(10,12);
/*************************************************************/
/* here is the magic mystery: */
 cprintf("Reading Port % 2d \n\r", inportb(BASE));   /* note BASE =
0x3F8*/

/*************************************************************/
i += (i < 0xFFF) ? 1 : 0;
  }

<\MAIN()_CODE_FRAGMENT>
 
 
 
  --------------D43330DE39474D884A44BA85--