diff options
author | ache <ache@FreeBSD.org> | 1994-06-04 00:44:00 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-06-04 00:44:00 +0000 |
commit | 6557b616d1bbb92c3d1011db841d2f9cfac4211e (patch) | |
tree | 128aa437f3ff729c04abff456a8023d4459d6da9 | |
parent | 7a9508d2f074ec9f92704550f1732faad7e9158e (diff) | |
download | FreeBSD-src-6557b616d1bbb92c3d1011db841d2f9cfac4211e.zip FreeBSD-src-6557b616d1bbb92c3d1011db841d2f9cfac4211e.tar.gz |
Now rc.serial used for initial setup of serial lines
-rw-r--r-- | etc/rc | 8 | ||||
-rw-r--r-- | etc/rc.d/serial | 91 | ||||
-rw-r--r-- | etc/rc.serial | 91 |
3 files changed, 189 insertions, 1 deletions
@@ -1,5 +1,5 @@ #!/bin/sh -# $Id: rc,v 1.23 1994/05/23 11:22:10 ache Exp $ +# $Id: rc,v 1.24 1994/06/01 17:04:01 paul Exp $ # From: @(#)rc 5.27 (Berkeley) 6/5/91 # System startup script run by init on autoboot @@ -69,6 +69,12 @@ rm -f /fastboot # XXX (root now writeable) # the machine runs UTC CMOS clock). See adjkerntz(8) for details. adjkerntz -i +# configure serial devices +if [ -f /etc/rc.serial ] +then + sh /etc/rc.serial +fi + # set hostname, turn on network echo 'starting network' . /etc/netstart diff --git a/etc/rc.d/serial b/etc/rc.d/serial new file mode 100644 index 0000000..7f042e8 --- /dev/null +++ b/etc/rc.d/serial @@ -0,0 +1,91 @@ +# Change some defauls for serial devices. +# Standard defaults are: +# dtrwait 300 +# initial cflag from <sys/ttydefaults.h> = cread cs8 hupcl +# initial iflag, lflag and oflag all 0 +# speed 9600 +# special chars from <sys/ttydefaults.h> +# nothing locked +# except for serial consoles the initial iflag, lflag and oflag are from +# <sys/ttydefaults.h> and clocal is locked on. + +default() { + # Reset everything changed by the other functions to initial defaults. + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 300 + stty </dev/ttyid$i -clocal crtscts hupcl 9600 reprint ^R + stty </dev/ttyld$i -clocal -crtscts -hupcl 0 + stty </dev/cuai0$i -clocal crtscts hupcl 9600 reprint ^R + stty </dev/cual0$i -clocal -crtscts -hupcl 0 + done +} + +maybe() { + # Special settings. + for i in $* + do + # Don't use ^R; it breaks bash's ^R when typed ahead. + stty </dev/ttyid$i reprint undef + stty </dev/cuai0$i reprint undef + # Lock clocal off on dialin device for security. + stty </dev/ttyld$i clocal + # Lock the speeds to use old binaries that don't support them. + # Any legal speed works to lock the initial speed. + stty </dev/ttyld$i 300 + stty </dev/cual0$i 300 + done +} + +modem() { + # Modem that supports CTS and perhaps RTS handshaking. + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 100 # may depend on modem + # Lock crtscts on. + # Speed reasonable for V42bis. + stty </dev/ttyid$i crtscts 57600 + stty </dev/ttyld$i crtscts + stty </dev/cuai0$i crtscts 57600 + stty </dev/cual0$i crtscts + done +} + +mouse() { + # Mouse on either callin or callout port. + for i in $* + do + # Lock clocal on, hupcl off. + # Standard speed for Microsoft mouse. + stty </dev/ttyid$i clocal -hupcl 1200 + stty </dev/ttyld$i clocal hupcl + stty </dev/cuai0$i clocal -hupcl 1200 + stty </dev/cual0$i clocal hupcl + done +} + +terminal() { + # Terminal that supports CTS and perhaps RTS handshaking + # with the cable or terminal arranged so that DCD is on + # at least while the terminal is on. + # Also works for bidirectional communications to another pc + # provided at most one side runs getty. + # Same as modem() except we want a faster speed and no dtrwait. + modem $* + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 0 + stty </dev/ttyid$i 115200 + stty </dev/cuai0$i 115200 + done +} + +# Don't use anything from this file unless you have some buggy programs +# that require it. +# +# Edit the functions and the examples to suit your system. +# +# maybe 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v +# mouse 2 +# modem 1 +# terminal 0 diff --git a/etc/rc.serial b/etc/rc.serial new file mode 100644 index 0000000..7f042e8 --- /dev/null +++ b/etc/rc.serial @@ -0,0 +1,91 @@ +# Change some defauls for serial devices. +# Standard defaults are: +# dtrwait 300 +# initial cflag from <sys/ttydefaults.h> = cread cs8 hupcl +# initial iflag, lflag and oflag all 0 +# speed 9600 +# special chars from <sys/ttydefaults.h> +# nothing locked +# except for serial consoles the initial iflag, lflag and oflag are from +# <sys/ttydefaults.h> and clocal is locked on. + +default() { + # Reset everything changed by the other functions to initial defaults. + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 300 + stty </dev/ttyid$i -clocal crtscts hupcl 9600 reprint ^R + stty </dev/ttyld$i -clocal -crtscts -hupcl 0 + stty </dev/cuai0$i -clocal crtscts hupcl 9600 reprint ^R + stty </dev/cual0$i -clocal -crtscts -hupcl 0 + done +} + +maybe() { + # Special settings. + for i in $* + do + # Don't use ^R; it breaks bash's ^R when typed ahead. + stty </dev/ttyid$i reprint undef + stty </dev/cuai0$i reprint undef + # Lock clocal off on dialin device for security. + stty </dev/ttyld$i clocal + # Lock the speeds to use old binaries that don't support them. + # Any legal speed works to lock the initial speed. + stty </dev/ttyld$i 300 + stty </dev/cual0$i 300 + done +} + +modem() { + # Modem that supports CTS and perhaps RTS handshaking. + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 100 # may depend on modem + # Lock crtscts on. + # Speed reasonable for V42bis. + stty </dev/ttyid$i crtscts 57600 + stty </dev/ttyld$i crtscts + stty </dev/cuai0$i crtscts 57600 + stty </dev/cual0$i crtscts + done +} + +mouse() { + # Mouse on either callin or callout port. + for i in $* + do + # Lock clocal on, hupcl off. + # Standard speed for Microsoft mouse. + stty </dev/ttyid$i clocal -hupcl 1200 + stty </dev/ttyld$i clocal hupcl + stty </dev/cuai0$i clocal -hupcl 1200 + stty </dev/cual0$i clocal hupcl + done +} + +terminal() { + # Terminal that supports CTS and perhaps RTS handshaking + # with the cable or terminal arranged so that DCD is on + # at least while the terminal is on. + # Also works for bidirectional communications to another pc + # provided at most one side runs getty. + # Same as modem() except we want a faster speed and no dtrwait. + modem $* + for i in $* + do + comcontrol /dev/ttyd$i dtrwait 0 + stty </dev/ttyid$i 115200 + stty </dev/cuai0$i 115200 + done +} + +# Don't use anything from this file unless you have some buggy programs +# that require it. +# +# Edit the functions and the examples to suit your system. +# +# maybe 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v +# mouse 2 +# modem 1 +# terminal 0 |