Newsgroups: comp.os.msdos.djgpp From: elj AT sky1 DOT elj DOT org (Edwin Johnson) Subject: Interrupt handled RS232 Message-ID: User-Agent: slrn/0.9.7.0 (Linux) NNTP-Posting-Host: 32.100.53.8 Date: 1 Nov 2001 19:32:02 GMT X-Trace: 1 Nov 2001 19:32:02 GMT, 32.100.53.8 Organization: Global Network Services - Remote Access Mail & News Services Lines: 51 X-Complaints-To: abuse AT prserv DOT net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com My task is to set up an interrupt handled serial port to capture data streamed constantly from a serial device and using djgpp on a Pentium PC. I am using an assembly routine which I wrote years ago to set up the port with the ISR in assembly. This has worked for years in real mode, but I've had no luck using the methods described in docs for djgpp. So far I've tried: 1) protected mode handler with the wrapper written by Frederico Jeronimo, 2) real handler stuffed into low memory using dosememput as described in the docs, and 3) protected mode handler with the wrapper and info in the docs for djgpp. The setup is by writing directly to the uart port registers in an NASM assembly routine. This apparently is being set up correctly, as I am passing back the contents of two registers to the C routine and printing them, one being the register enabling receive interrupts, so the uart seems to be set up correctly. The scheme for the test is to pass back via external variables in the ISR a flag to the C program as well as the received byte. Since nothing seems to be received I decided to pass back the flag variable set to 1 at the beginning of the ISR to see if the interrupt was even going to the ISR code, and it doesn't appear to be doing that. None of these three methods crashes in any way and yes, I am unmasking the interrupt chip correctly to enable the interrupts. So there must be something I'm missing with this setup or with the djgpp setup. The setup sequence is to first set the new ISR vectors, set up the uart, and then unmask the interrupt chip bit for the correct interrupt. Again, I have written a full-blown assembly communication program with many bells and whistles and have been using the setup and receive routines from this with the streaming serial device for years in the real mode, but no luck with the djgpp instructions. Any suggestions or help or sources for such routines would be appreciated and would be glad to send code for anyone to look at. Offline might be preferable in order not to clog up this newsgroup. Thanks for any help. ...Edwin -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Edwin Johnson ....... elj AT shreve DOT net ~ ~ http://www.shreve.net/~elj ~ ~ ~ ~ "Once you have flown, you will walk the ~ ~ earth with your eyes turned skyward, ~ ~ for there you have been, there you long ~ ~ to return." -- da Vinci ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~