mtbro wrote:
How can I detect if setting given speed is OK for remote side?
Will the remote side respond in a particular way when it receives data at the correct speed? If not, you have no way to detect whether the remote side understands the data you're sending.
mtbro wrote:
Will reading LSR just after setting speed give me any information about that?
Only if the remote side is trying to send data; LSR will usually indicate errors when the speed doesn't match.
mtbro wrote:
Actually even int $0x14 AH=00h returns line status after attempted initialization. Can I assume 0xff as error during initialization ?
It's pretty unlikely that the line status register would be 0xFF immediately after initialization, but you can be a lot more certain by also checking the modem status register (which is also returned). If both status registers are 0xFF, there's probably no UART.
mtbro wrote:
Is there a good common practice how long to wait? Can there be actually a situation when the buffer is always full ?
If you're using one of the rare UARTs that actually supports hardware flow control in hardware and you've enabled that hardware flow control, the buffer could remain full forever if the remote device never requests more data. Otherwise, the only way the buffer could stay full is if the UART breaks.