From owner-freebsd-questions Tue Dec 9 03:24:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA24385 for questions-outgoing; Tue, 9 Dec 1997 03:24:23 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from Tandem.com (suntan.tandem.com [192.216.221.8]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA24379 for ; Tue, 9 Dec 1997 03:24:19 -0800 (PST) (envelope-from grog@lemis.com) Received: from papillon.lemis.com ([168.87.69.104]) by Tandem.com (8.8.8/2.0.1) with ESMTP id DAA14456; Tue, 9 Dec 1997 03:24:15 -0800 (PST) Received: (grog@localhost) by papillon.lemis.com (8.8.8/8.6.12) id SAA03739; Tue, 9 Dec 1997 18:12:44 +0800 (CST) Message-ID: <19971209181241.01704@lemis.com> Date: Tue, 9 Dec 1997 18:12:41 +0800 From: Greg Lehey To: mlduke@concentric.net Cc: questions@FreeBSD.ORG Subject: Re: Serial Terminal References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: ; from mlduke@concentric.net on Mon, Dec 08, 1997 at 10:00:50PM -0900 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, Dec 08, 1997 at 10:00:50PM -0900, mlduke@concentric.net wrote: > I would like to attach a serial terminal to my FreeBSD2.2.2-RELEASE > box. Can anyone help? :-) It's pretty straightforward. Plug it in to a serial port, and set the line in /etc/ttys accordingly. For example, if you were plugging in to the second serial port (/dev/ttyd1), look for a line like this in /etc/ttys: ttyd1 "/usr/libexec/getty std.9600" unknown off secure Change it to: ttyd1 "/usr/libexec/getty std.9600" unknown on secure Then enter: # kill -1 1 This will tell init to re-read the /etc/ttys. After that, you should see a process like this: # ps aux | grep getty root 145 0.0 0.0 180 0 v1 Is+ Mon09AM 0:00.07 /usr/libexec/getty std.9600 ttyd1 At the same time, you should get a prompt on the terminal. If you don't, press Enter a couple of times. One problem you might have is the bit rate of the terminal. The example assumes 9600 bps, no parity, 8 bit bytes (I think). You can check that with stty: # stty -f /dev/ttyd1 -a speed 9600 baud; 0 rows; 0 columns; lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo -extproc iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk -brkint -inpck -ignpar -parmrk oflags: -opost -onlcr -oxtabs cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; cs8 says 8 bit characters; -parenb means that parity isn't enabled. The only other thing you need to know is what kind of terminal you have. You'll have to set the TERM environment variable accordingly; if your terminal isn't in the list in /etc/termcap, you should at least know what kind of terminal it's emulating. The terminal will work OK without the TERM variable, but if you don't have it set correctly, things like vi either won't work at all, or will produce complete nonsense on the screen. Greg