SUMMARY: BSD compatibility ptys in Solaris 2.2

From: John DiMarco (jdd@db.toronto.edu)
Date: Tue Sep 21 1993 - 11:53:44 CDT


My original query was:
>Is it possible to increase the number of BSD compatibility ptys in Solaris 2.2
>from the default of 16, and if so, how?

The general response to this query was: set "npty" in /etc/system to be
the number of BSD compatibility ptys desired. One person also suggested
setting pt_cnt as well (pt_cnt is the number of standard (SVR4) ptys), but
this didn't appear to be necessary. Another suggested installing patch
100999-33, which I did. This appears only to be necessary if increasing
the number of ptys to more than 48.

However, this wasn't sufficient. "drvconfig" (eg. boot -r) doesn't mknod
any devices in /devices/pseudo for the new ptys. I had to make them by hand.
In addition, "devlinks" ignores these devices, and I had to make links to
them from dev. Finally, I had to edit /etc/iu.ap to automatically push
the appropriate streams compatibility modules onto the new devices. I replaced
the line reading
        "ptsl 0 15 ldterm ttcompat"
with
        "ptsl 0 <NUM> ldterm ttcompat"
where <NUM> was one less than the number of compatibility ptys I wanted.

This did the trick.

Thanks to

                dsnmkey@guinness.ericsson.se (Martin Kelly)
                wisner@well.sf.ca.us (Bill Wisner)
                adap@andrews.edu (Edsel Adap)

for their suggestions.

In the interest of not having to do this again by hand in the future, I've
written a little "makeptys" script that does most of the work. It's included
below.

John

--
John DiMarco                                              jdd@cdf.toronto.edu
Computing Disciplines Facility Systems Manager            jdd@cdf.utoronto.ca
University of Toronto                                     EA201B,(416)978-1928

----------------- #!/bin/sh # makeptys: make sets of BSD compatibility ptys for Solaris 2.x. Based on # BSD /dev/MAKEDEV. # # usage: makeptys ptyN [ptyN...] where N ranges from 1 to 15. # # Each argument specifies a bank of 16 ptys. For example, to configure # your system to support 64 BSD ptys, use: "makeptys pty1 pty2 pty3" # # makeptys mknod's the ptys in /devices/pseudo, then creates symlinks # in /dev to them. # # After running this program, edit /etc/iu.ap to make sure the # appropriate streams modules are autopushed on the ptys. (set the lastminor # column of the line beginning with ptsl to the number of ptys you want. # Also ensure that "npty" in /etc/system is set to the number of # compatibility ptys desired. # # September 20, 1993 # John DiMarco (jdd@cdf.toronto.edu) # University of Toronto, CDF # PATH=/usr/bin:/usr/ucb:/usr/etc:/etc:/bin:. umask 77

# mk name b/c major minor [mode] [group] mk() { mknod $1 $2 $3 $4 && chmod ${5-666} $1 && test -n "$6" && chgrp $6 $1 return 0 }

for i in $*; do case $i in pty0) offset=0 name=p;; pty1) offset=16 name=q;; pty2) offset=32 name=r;; pty3) offset=48 name=s;; pty4) offset=64 name=t;; pty5) offset=80 name=u;; pty6) offset=96 name=v;; pty7) offset=112 name=w;; pty8) offset=128 name=x;; pty9) offset=144 name=y;; pty10) offset=160 name=z;; pty11) offset=176 name=P;; pty12) offset=192 name=Q;; pty13) offset=208 name=R;; pty14) offset=224 name=S;; pty15) offset=240 name=T;; *) echo "bad unit for pty in: $i; use pty0 thru pty15" ; continue ;; esac

eval `echo $offset $name | awk ' { b=$1; n=$2 } END { for (i = 0; i < 16; i++) printf("mk /devices/pseudo/ptc:pty%s%x c 25 %d; \ mk /devices/pseudo/ptsl:tty%s%x c 26 %d; ", \ n, i, b+i, n, i, b+i); }'` eval `echo $offset $name | awk ' { b=$1; n=$2 } END { for (i = 0; i < 16; i++) printf("ln -s ../devices/pseudo/ptc:pty%s%x \ /dev/pty%s%x; ", n, i, n, i); }'` eval `echo $offset $name | awk ' { b=$1; n=$2 } END { for (i = 0; i < 16; i++) printf("ln -s ../devices/pseudo/ptsl:tty%s%x \ /dev/tty%s%x; ", n, i, n, i); }'` done



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:16 CDT