Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 95 20:44 CST
From:      uhclem@nemesis.lonestar.org (Frank Durda IV)
To:        freebsd-hackers@freefall.cdrom.com
Cc:        uhclem@nemesis.lonestar.org
Subject:   Re: Multiport serial cards
Message-ID:  <m0rpoUu-0004vtC@nemesis.lonestar.org>

next in thread | raw e-mail | index | archive | help
[0]>I'm interested in a board that will let me receive continuous data at
[0]>28.8 on four ports without any problems.  At roughly 300 us per
[0]>character that will mean we have to service each port every 4.8 ms with
[0]>a 16550, or roughly 1.2 ms per port.  (Of course lots of times when
[0]>you're in the interrupt you'll be able to to serve more than one port)

[1]This is a small load for sio.  The overhead using an AST/4 on a DX2/66
[1]should be about 6% for input-only and 4% for output-only plus whatever
[1]you protocol handler adds.

[1]A 1-char "FIFO" as found on 8250's should be adequate provided you have
[1]no bus-hogging devices.  sio can handle continuous data in both directions
[1]at once at 115.2 on 2 ports (but not 3) on a 486DX/33 with 8250's.  The
[1]system load for this is about 60% (too high for continuous use).  A
[1]486DX2/66 with 16550's can probably handle about 6 times as many ports.

It should be worse than that.  1/2880 cps = 347usec/character
and if you have four ports on a board that means a characters is available
on that board every 86usec worst case (the best case is 347usec). 
And divide the times by two if the data is moving in both directions
(43usec worst - 173.5usec best).

If you are using 8250s and must service an interrupt every 86usec, it
just isn't going to work.  The ISA bus timing (I/O cycle is two 8.3MHz
clocks long plus wait states and chip access-recovery timing) even
becomes a limiting factor.  How long does it take for the kernel to even
poll the 8259 and figure out which interrupt it is?  The kernel might also
want to save some state and a few other things before jumping to a driver.
I promise that you aren't going to keep up with constant serial interrupts
every 86usec (or less) in an ISA system.  Not without some intelligent
controller help and/or memory-mapped devices and probably a very
tight assembly-language interrupt service routine.

The 8250's simply won't be reliable unless you ban all disk or tape
I/O, and some brands of video boards that have to turn interrupts
off for a msec or so here and there.

With 16550's and letting each one get up to 10 characters in it
before the driver gets around to servicing them, the driver can only
be 3.47msec late before getting behind. And if you have four
16550s and you service them seprately, your interrupts are now
arriving every 867usec.

But if you start talking 115,200bps or 230,400bps, things get
really bad.  For 11,520cps, the single character response time must be
86.8usec.  For 23,040cps, is falls to 43.4usec.   Ouch.


Frank Durda IV <uhclem@nemesis.lonestar.org>|"Where do you want to go today?
or  uhclem%nemesis@trsvax.ast.com (Internet)| Wherever Microsoft tells you
...letni!rwsys!nemesis!uhclem               | to." - (TM) MADSoft 1994
...decvax!trsvax.fw.ast.com!nemesis!uhclem  |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0rpoUu-0004vtC>