Re: Interrupt-driven serial comm for Linux ?



mpv <nospam@xxxxxxxxxxx> wrote:

"Wolfgang Draxinger" <wdraxinger@xxxxxxxxxxxxxxxx> schreef in bericht
news:kmd5h5-jdd.ln1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Linux does the proper handling of the UART and buffering for you,
once /dev/ttyS... is opened.

No need for extra libraries.

I don't think so. Why do you think these callback functions / event handlers
/ asynchronous transfer (whatever you want to call it) exist ? Just look at
http://cssl.sourceforge.net and you'll see they are sometimes needed, even
with Linux.

libcssl exists for a different reason. It's main purpose is to
make it easy to read asynchronously when data are available on
the serial port. That may be of interest for a certain type of
application and is feasible since you can request to get a
signal when data are available (but a signal isn't an inter-
rupt). I guess it's only needed when you receive huge amounts
of data at high speed on the one hand and, on the other hand,
can't guarantee to read from the serial port device file often
enough. Of course, there is an upper limit on the amount of
buffering the kernel does (in the order of a few kBytes) and
if that gets exceeded then bytes get lost. Under these rather
special circumstances having the data transfered asynchronous-
ly from the kernels buffer into a user buffer is important.

But that's a detail that hasn't have to do much with dealing
with the underlzing serial port itself. That is all done with-
in the driver for the serial port and you simply don't have
to care. See e.g.

http://www.linux.it/~rubini/docs/serial/serial.html

on how a serial port driver is supposed to work under Linux
(and probably very similar in principle under all kinds of
UNIX). All that's done there is done to make the device file
look like a normal file as much as possible and thus to keep
the application writer from having to spend too much thought
on the underlying details.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • RE: Serial console issues.
    ... Since Linux is seeing this port as a 16750, ... this to only have a 16-byte buffer. ... 16750 with its mammoth buffer size is killing this serial port. ... setserial with the kernel image (also I'd rather not do as I only have ...
    (Linux-Kernel)
  • Re: Serial console issues.
    ... Since Linux is seeing this port as a 16750, ... seeing missing characters in the transmission. ... this to only have a 16-byte buffer. ... If my assumptions are correct and Linux is detecting this serial port ...
    (Linux-Kernel)
  • Re: Linux "print server"
    ... porting Ghostscrip to a C64 is ... so a Linux server seemed possible. ... "> I already have TCP/IP communication using ppp between the C64 and the ... "> DTP app I use can send data to a serial port, ...
    (comp.os.linux.misc)
  • Re: Why to up/not grade to/from W98 (was: new Pulsonix version 3 PCB software released)
    ... whos primary function was to read ... and reading BOT/EOT markers and the raw MFM. ... On serial better is to use a micro (cheap 2 $ PIC has serial port). ... Linux, why sell yourself out to Bill Gates? ...
    (comp.arch.embedded)
  • Re: Flow Control on Serial Device
    ... Are you using the exact same cable for the Linux system that you ... indeed a straight through cable? ... Then CTS and RTS are ... properly configure your serial port, ...
    (comp.os.linux.networking)