uart vs sio differences ?

Mike Tancsa mike at
Mon Dec 8 22:39:30 UTC 2008

At 04:02 PM 12/8/2008, Marcel Moolenaar wrote:

>On Dec 8, 2008, at 12:49 PM, Mike Tancsa wrote:
>>At 02:18 PM 12/8/2008, Marcel Moolenaar wrote:
>>>I see, so the FreeBSD box with uart(4) is missing data,
>>>not the Windows machine, right?
>>        Correct.  The FreeBSD box never gets the full data, nor do we
>>see it on the "protocol analyzer".  Our analyzer is just a special
>>serial cable that copies the data from both sides to the monitor
>>program (a dos app) on another machine.
>Interesting. If it never shows up on the analyzer, then
>doesn't that indicate that it was never sent?
>Put differently: doesn't that indicate that the transmitter
>stops sending, and not that the receiver stops receiving?

What it appears to be is that as long as data is coming in, even at 
1200bps, the ioctl FIONREAD returns zero and an actual read does not 
return any data until there is either a pause in the data coming in 
or possibly when we do a xmit/write at which point the accumulated 
data is available for us to read.

We dont know if this is due to the hardware fifo or something in the 
driver itself.

>>>Do you know if you get the first 30 bytes or the last 30
>>>bytes or some mix?
>>Just checked, and we get the first 31 bytes each time.
>Could you check if any of RTS/CTS, DTR/DSR or DCD toggles
>after about 30 characters?

I am not sure if the DOS software we use reliably sees that.  We have 
a fancier windows app that might be more accurate.


>If the analyzer also just gets the 30 characters, then maybe
>the receiver signaled the transmitter to stop (think of the
>16950 as having HW flow-control enabled and doing it on its
>own, without knowledge of the kernel).
>>  Is it possible the larger fifo buffer of the 16950 is holding onto
>>the data too long ? The sio sees it as a plain old 16550, but the
>>uart driver sees it as the 16950 that it is.
>The 16950 has a 128-byte FIFO, so even if it holds on to
>data too long, I would expect to receive at least 128
>bytes of data...

>Marcel Moolenaar
>xcllnt at

More information about the freebsd-current mailing list