[comp.os.coherent] Searching: serial device driver for multiport-cards

joachim@jrix.radig.de (Joachim Riedel) (05/04/91)

Hi,

I tried the devices /dev/hs00 - hs03 with a cheap taiwan multi port 
serial card in polled mode. But polled mode is not satisfying.
So I'm looking for an already existing device driver that is able
to use interrupts (only poll the 4 UARTS if an interupt occured).
If not I have to do the writing on my own.
The existing device drivers are too slow so I also want to rewrite
the /dev/com...  so that they are able to use the 16550 with its 
larger FIFO. I noticed that 9600 Baud on a 10 Mhz 286 is too fast,
but works on my 386/33 Micronics. But what to do if you want to use
a Traily with 19200 Baud ?

Thanks for hints

Joachim
 
+---------------------------------------+-------+-------------------+-------+
|    Joachim Riedel                     | @   @ |    Don't worry,   | @   @ |
|    Geschwister-Scholl-Strasse 48      |  \_/  |    keep smiling   |  \_/  |
|    D-6050 Offenbach am Main           +-------+-------------------+-------+
|    Tel. +49 69 85 62 25               |       joachim@jrix.radig.de       |  
+---------------------------------------+-----------------------------------+

root@mailgsm.mendelson.com (Geoffrey S. Mendelson) (05/04/91)

joachim@jrix.radig.de (Joachim Riedel) asks:
>
>I tried the devices /dev/hs00 - hs03 with a cheap taiwan multi port 
>serial card in polled mode. But polled mode is not satisfying.
>So I'm looking for an already existing device driver that is able
>to use interrupts (only poll the 4 UARTS if an interupt occured).
>If not I have to do the writing on my own.
>The existing device drivers are too slow so I also want to rewrite
>the /dev/com...  so that they are able to use the 16550 with its 
>larger FIFO. I noticed that 9600 Baud on a 10 Mhz 286 is too fast,
>but works on my 386/33 Micronics. But what to do if you want to use
>a Traily with 19200 Baud ?
>

I have no trouble running an HP laserjet (IIP) at 19.2k using an interupt
driven port.

The options as I see it:

Run 2 ports interupt driven and 2 ports polled.
Use the polled ports for 2400 baud or less. 
Try to have the polled ports active as little as possible. I use one for
a 2400 baud outgoing modem. I use the other for a 2400 baud link (always polled)
to my unix system. It's slow, but I usually don't care. I am using an 8MHZ 
system.

If you are running a stock pc/at clone interupts 2 and 5 are free. 2 is used
by a mouse (sort of useless on coherent) and 5 is used by one of the lpt
ports (I think it is 2 or 3) but it is not lpt1 (that uses irq 7).
Many serial cards will let you configure the interupt to IRQ 2 and 5.
Patch the com3 and com4 device drivers for those irq's.

Setting all the intertupts to the same number and then configuring the driver
to poll all the ports will probably fail. A "real" mutliport card has some
hardware to queue the interupts so that you can share them. 

If you did not catch them just right, characters would be lost. Since "dumb"
multiport cards are relatively cheap (about $160 in the us). It hardly seems
worth putting a lot of effort in to a driver that may not work. 

On the other hand, if you could package a 4 port card and driver for $50-75 (us)
you could probably sell several thousand. I think that the UARTs would be the 
cheap ones because last I checked the 16550's were far to expensive to put 4 on
a card at that price.

I think that the driver kit is worth the $40. Even if you only use it for an
education. Unfortunately, I have seen no drivers come out of it yet. I am 
hoping to see some soon. :-)  

In my time, I have written lots of supervisor  code, and several device
drivers. All of it was in assembly language. Most was on IBM mainframes, but
some of it was for minicomputers. I can't see writing a driver in C. I could
write a C device driver in a day, but it would probably take a month to
debug. If I were writing in assembler it would probably take one week to
code and another week to debug.    

I doubt that I will be writing an device drivers though. I don't know i80x86
assembler and what I do know I don't like. 

But I digress. 

P.s. If anyone is modifing the QIC-36 tape device driver to QIC-02, please 
     let me know. I need it.
------
Copyright (C) 1991, Geoffrey S. Mendelson.              All Rights Reserved.
Except for usenet followups, may not be reproduced without permsission. 
----------------------------------------------------------------------------
|                   |  Computer Software Consulting    |                   |
----------------------------------------------------------------------------
Geoffrey S. Mendelson           I've written and debugged almost eight thousand 
geoffrey@mendelson.com          LINES of C code under Coherent in the last two
mwcbbs!mailgsm!geoffrey         months.  :-)                     
(215) 242-8712                  And my wife still speaks to me!

joachim@jrix.radig.de (Joachim Riedel) (05/09/91)

root@mailgsm.mendelson.com (Geoffrey S. Mendelson) writes:

>>larger FIFO. I noticed that 9600 Baud on a 10 Mhz 286 is too fast,
>>but works on my 386/33 Micronics. But what to do if you want to use
>>a Traily with 19200 Baud ?
>>

>I have no trouble running an HP laserjet (IIP) at 19.2k using an interupt
>driven port.
Sure, 19200 Baud works, but I am thinking about the real CPS in the transfer.
With direct connection from my Laptop (10 Mhz 286) to a PC 386 with Telix,
I received files with rz. At 9600 Baud the rate was about 570 Bytes/s
with about 227 (!) errors during a transmission of 270 k. 4800 Baud works 
without errors (receiving !!!!, sending with sz is much better: 700 cps).
I want to say that Coherent is not able to get the 1400 cps that a
Traily in UUCPg-mode (S111=30) wants to send to the PC.

On my 386/33 Micronics Coherent is able to receive with rz and 9600 Baud about
850 cps without problems. But on my Interactive with 386/25 Micronics I got
about 950 cps receive rate same rz. Therefore I am thinking
about adding 16550 support to the standard serial driver to get 19200 Baud
at a reasonable cps-rate ( > 1200 cps). With it's  15 Bytes FIFO Coherent has
more time to get the received stuff before loosing characters.
I also don't want to buy a expansive intelligent board.
I will try to figure out how FAS 2.08 did it (Geoff, interest ? Also works
on ESIX !) and compare it with the existing Coherent driver.

>I think that the driver kit is worth the $40. Even if you only use it for an
>education. Unfortunately, I have seen no drivers come out of it yet. I am 
>hoping to see some soon. :-)  
I still have it but you need time to understand how a driver works (and also
the routines) before you start writing a device driver. Too many ugly things
can happen if there are errors in your code.
(The device driver kit is worth it's price. The manual is good and full of
information.)


>Geoffrey S. Mendelson          I've written and debugged almost eight thousand 
geoffrey@mendelson.com          LINES of C code under Coherent in the last two
>mwcbbs!mailgsm!geoffrey         months.  :-)                     
>(215) 242-8712                  And my wife still speaks to me!
----------------------------->   ^ let me know this trick, I need it

+---------------------------------------+-------+-------------------+-------+
|    Joachim Riedel                     | @   @ |    Don't worry,   | @   @ |
|    Geschwister-Scholl-Strasse 48      |  \_/  |    keep smiling   |  \_/  |
|    D-6050 Offenbach am Main           +-------+-------------------+-------+
|    Tel. +49 69 85 62 25               |       joachim@jrix.radig.de       |  
+---------------------------------------+-----------------------------------+