Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


hs                        Device Driver                        hs




Device driver for polled serial ports


The COHERENT hs driver adds support for up to eight serial lines,
/dev/hs00 through /dev/hs07.

Serial lines controlled via the hs driver can be opened in one of
two ways, as follows:

/dev/hs??
     --  Polled, local mode (no modem control).

/dev/hs??r
     --  Polled, remote mode (modem control).

Any port used with the hs  device driver will be polled, i.e. in-
terrupt operation is not  used.  Please refer to the  com Lexicon
article   for  explanations  of   ``local''  vs   ``remote''  and
``polled'' vs ``interrupt-driven''.

To use the hs driver,  first configure it to match your equipment
(see  below), then  load the driver  using the  following command
while running as root (the superuser):


        /etc/drvld -r /drv/hs


To unload the driver without rebooting Coherent, first use the ps
command  with the  -d option  to get  the PID  number for  the hs
driver process, then unload  the driver process by using the kill
command.  Note  that the hs driver process  will not unload until
all opened ports have been closed.  For example (user input shown
in bold):


        $ ps -d
        TTY       PID
        -------     0  <idle>
        -------    38  <hs>
        ...
        $ kill kill 38


The present  version of  COHERENT limits ``polled''  operation to
one device driver at a time.  Therefore, if any of the com family
of devices  is used  in polled mode,  hs devices cannot  be used.
Conversely,  /dev/com1pl   through  /dev/com4pl  and  /dev/com1pr
through /dev/com4pr  cannot be used  if the hs driver  is in use.
Both drivers can be present  at the same time, but polled devices
may not be  open under both drivers at the  same time.  Note that
enabling a port via /etc/enable keeps it open continuously.




COHERENT Lexicon                                           Page 1



hs                        Device Driver                        hs



***** Port Configuration *****

The default configuration for the hs driver is for four ports, at
hexadecimal addresses 0x3F8,  0x2F8, 0x3E8, and 0x2E8, at a speed
of 9600 baud.  The  driver is configured by setting the following
parameters.

1.   the number of ports

2.   the I/O address for each port

3.   the default speed of each port

All steps in the configuration should be done as root (the super-
user).  Patch  the number of  ports into driver  variable HSNUM_.
For example, if you wish to support three ports, enter:


        /conf/patch /drv/hs HSNUM_=3


Address and speed information are stored sequentially starting at
variable HS_PORTS_.  The speed  for each port is indicated by the
corresponding value found  in <sgtty.h>, from 1, corresponding to
50 baud,  to 16, corresponding to 9600 baud.   If the three ports
in the example above are at hexadecimal adresses of 0x2A0, 0x2B0,
and  0x2C0, with  speeds of  2400, 2400,  and 9600  baud, respec-
tively, then the following three patches should be performed:


        /conf/patch /drv/hs HS_PORTS_=0x2A0 HS_PORTS_+2=12
        /conf/patch /drv/hs HS_PORTS_+4=0x2B0 HS_PORTS_+6=12
        /conf/patch /drv/hs HS_PORTS_+8=0x2C0 HS_PORTS_+10=16


Finally, nodes must be created for each port using the mknod com-
mand.  The major device number is 7;  the minor number will range
from 0  through 7 for ports  /dev/hs00 through /dev/hs07, respec-
tively, with  128 added to the device minor  number if modem con-
trol is desired.  The  following commands will make nodes in /dev
for local and remote versions of the three ports in the example:


        /etc/mknod -f /dev/hs00  c  7  0
        /etc/mknod -f /dev/hs01  c  7  1
        /etc/mknod -f /dev/hs02  c  7  2
        /etc/mknod -f /dev/hs00r c  7  128
        /etc/mknod -f /dev/hs01r c  7  129
        /etc/mknod -f /dev/hs02r c  7  130


***** See Also ***** com, device drivers, drvld





COHERENT Lexicon                                           Page 2



hs                        Device Driver                        hs



***** Diagnostics *****

An attempt to open a non-existent device will generate error mes-
sages.  This can occur if hardware is absent or not turned on.





















































COHERENT Lexicon                                           Page 3


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026