From: Theodore Ts'o (tytso@ATHENA.MIT.EDU)
Date: 12/12/92


From: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
Subject: Re: Serial communications problems
Date: Sun, 13 Dec 1992 02:12:48 GMT


   From: rich@falcon.engr.utk.edu (Steve Rich)
   Date: 12 Dec 92 21:59:13 GMT

   I have a simple (and probably stupid) question: How do you designate that
   the com port has interrupts disabled? My com3 isn't attached to an
   interrupt. (I know where to designate the interrupt number in serial.c,
   but I don't know how to tell it not to use one at all.)
   Thanks.

Because of Linux serial driver works, a serial port must have an IRQ
associated with it, or it won't work. In DOS, you can get away with not
having an interrupt (at least for some applications) because you're
working in a signle-threaded environment. This allows you to monopolize
the CPU while you wait for characters to come into the serial port. In
multi-processing system such as Linux (and any Unix-like system), you
can't afford to tie up the CPU waiting for the serial port. Instead,
the process which is waiting for serial input allows some other process
to run, and when the serial port is ready, it sends an interrupt to the
CPU.

It would be possible to write a serial driver that did not use
interrupts --- by hooking something to the timer interrupt and having it
check 100 times a second to see if there's anything on the serial port;
but it would ruin your system performance, and it wouldn't really work
unless you had a 16550A UART, or if you aren't doing anything faster
than 600 bps. (And even if you had a 16550A, you wouldn't be able to do
anything faster than 9600.)

Because of these limitations, I haven't attempted to include such
functionality in the Linux serial driver; it is theoretically possible,
however.

                                                - Ted