This section answers common questions about serial communications with FreeBSD. PPP and SLIP are covered in the Networking section.
15.1. | How do I tell if FreeBSD found my serial ports? |
As the FreeBSD kernel boots, it will probe for the serial ports in your system for which the kernel was configured. You can either watch your system closely for the messages it prints or run the command % dmesg | grep sio after your system is up and running. Here is some example output from the above command: sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A This shows two serial ports. The first is on irq 4, is
using port address The | |
15.2. | How do I tell if FreeBSD found my modem cards? |
Refer to the answer to the previous question. | |
15.3. | How do I access the serial ports on FreeBSD? |
The third serial port, You use
| |
15.4. | How do I enable support for a multiport serial card? |
Again, the section on kernel configuration provides
information about configuring your kernel. For a multiport
serial card, place an sio(4) line for each serial
port on the card in the kernel configuration file. But
place the irq and vector specifiers on only one of the
entries. All of the ports on the card should share one
irq. For consistency, use the last serial port to specify
the irq. Also, specify the
The following example is for an AST 4-port serial card on irq 7: options "COM_MULTIPORT"
device sio4 at isa? port 0x2a0 tty flags 0x781
device sio5 at isa? port 0x2a8 tty flags 0x781
device sio6 at isa? port 0x2b0 tty flags 0x781
device sio7 at isa? port 0x2b8 tty flags 0x781 irq 7 vector siointr The flags indicate that the master port has minor number 7
( | |
15.5. | Can FreeBSD handle multiport serial cards sharing irqs? |
Not yet. You will have to use a different irq for each card. | |
15.6. | Can I set the default serial parameters for a port? |
The
# stty -a -f /dev/ttyd1 When you change the settings to this device, the settings are in effect until the device is closed. When it is reopened, it goes back to the default set. To make changes to the default set, you can open and adjust the settings of the “initial state” device. For example, to turn on CLOCAL mode, 8 bits, and XON/XOFF flow control by default for ttyd5, do: # stty -f /dev/ttyid5 clocal cs8 ixon ixoff A good place to do this is in
You can also prevent certain settings from being
changed by an application by making adjustments to the
“lock state” device. For example, to lock
the speed of # stty -f /dev/ttyld5 57600 Now, an application that opens
Naturally, you should make the initial state and lock
state devices writable only by
| |
15.7. | How can I enable dialup logins on my modem? |
So you want to become an Internet service provider, eh?
First, you will need one or more modems that can auto-answer.
Your modem will need to assert carrier-detect when it detects a
carrier and not assert it all the time. It will need to hang up
the phone and reset itself when the data terminal ready
(DTR) line goes from on to off. It should
probably use For many Hayes command-set--compatible modems, this command will make these settings and store them in nonvolatile memory: AT &C1 &D3 &K3 &Q6 S0=1 &W See the section on sending AT commands below for information on how to make these settings without resorting to an MS-DOS® terminal program. Next, make an entry in ttyd1 "/usr/libexec/getty std.57600" dialup on insecure This line indicates that the second serial port
( It is common practice to use After making modifications to
# kill -HUP 1 This forces the init(8) process to reread
% ps -ax | grep '[t]tyd1' You should see something like: 747 ?? I 0:00.04 /usr/libexec/getty std.57600 ttyd1 | |
15.8. | How can I connect a dumb terminal to my FreeBSD box? |
If you are using another computer as a terminal into your FreeBSD system, get a null-modem cable to go between the two serial ports. If you are using an actual terminal, see its accompanying instructions. Then, modify ttyd4 "/usr/libexec/getty std.38400" wyse50 on secure This example shows that the port on
| |
15.9. | Why can I not run |
On your system, the programs tip(1) and
cu(1) are probably executable only by
Alternatively, you can let everyone on your system run tip(1) and cu(1) by typing: # chmod 4511 /usr/bin/cu
# chmod 4511 /usr/bin/tip | |
15.10. | My stock Hayes modem is not supported---what can I do? |
Actually, the manual page for tip(1) is out of
date. There is a generic Hayes dialer already built in.
Just use The Hayes driver is not smart enough to recognize some of
the advanced features of newer modems---messages like
Also, the dial timeout for tip(1) is 60
seconds. Your modem should use something less, or else tip
will think there is a communication problem. Try
Actually, as shipped tip(1) does not yet
support it fully. The solution is to edit the file
Edit the line | |
15.11. | How am I expected to enter these AT commands? |
Make what is called a “direct” entry in
your cuaa0:dv=/dev/cuaa0:br#19200:pa=none Use the highest bps rate your modem supports in the br
capability. Then, type If there is no # cd /dev
# sh MAKEDEV cuaa0 Or use cu as # cu -l with | |
15.12. | Why does the |
The pn=\@ | |
15.13. | How can I dial a phone number on the command line? |
Put what is called a “generic” entry in
your tip115200|Dial any phone number at 115200 bps:\
:dv=/dev/cuaa0:br#115200:at=hayes:pa=none:du:
tip57600|Dial any phone number at 57600 bps:\
:dv=/dev/cuaa0:br#57600:at=hayes:pa=none:du: Then you can do something like cu115200|Use cu to dial any number at 115200bps:\
:dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du: and type | |
15.14. | Do I have to type in the bps rate every time I do that? |
Put in an entry for | |
15.15. | How can I more easily access a number of hosts through a terminal server? |
Rather than waiting until you are connected and typing
pain|pain.deep13.com|Forrester's machine:\
:cm=CONNECT pain\n:tc=deep13:
muffin|muffin.deep13.com|Frank's machine:\
:cm=CONNECT muffin\n:tc=deep13:
deep13:Gizmonics Institute terminal server:\
:dv=/dev/cuaa2:br#38400:at=hayes:du:pa=none:pn=5551234: will let you type | |
15.16. | Can tip try more than one line for each site? |
This is often a problem where a university has several modem lines and several thousand students trying to use them... Make an entry for your university in
big-university:\
:pn=\@:tc=dialout
dialout:\
:dv=/dev/cuaa3:br#9600:at=courier:du:pa=none: Then, list the phone numbers for the university in
big-university 5551111
big-university 5551112
big-university 5551113
big-university 5551114 tip(1) will try each one in the listed order, then give up. If you want to keep retrying, run tip(1) in a while loop. | |
15.17. | Why do I have to hit CTRL+P twice to send CTRL+P once? |
CTRL+P
is the default “force” character, used to
tell tip(1) that the next character is literal data.
You can set the force character to any other character
with the Type You can have the force character be whatever you want
by specifying the following in your
force= single-char | |
15.18. | Why is everything I type suddenly in UPPER CASE? |
You must have pressed CTRL+A,
tip(1) “raise character”, specially
designed for people with broken Caps Lock
keys. Use Here is a sample .tiprc file perfect for Emacs users who need to type CTRL+2 and CTRL+A a lot: force=^^
raisechar=^^ The ^^ is SHIFT+CTRL+6. | |
15.19. | How can I do file transfers with
|
If you are talking to another UNIX® system, you can
send and receive files with ~p <local-file> [<remote-file>]
~t <remote-file> [<local-file>] There is no error checking, so you probably should use another protocol, like zmodem. | |
15.20. | How can I run zmodem with tip? |
First, install one of the zmodem programs from the ports collection (such as one of the two from the comms category, lrzsz or rzsz. To receive files, start the sending program on the
remote end. Then, press enter and type To send files, start the receiving program on the
remote end. Then, press enter and type |
Αυτό το κείμενο, και άλλα κείμενα, μπορεί να βρεθεί στο ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
Για ερωτήσεις σχετικά με το FreeBSD, διαβάστε την
τεκμηρίωση πριν να επικοινωνήσετε με την
<questions@FreeBSD.org>.
Για ερωτήσεις σχετικά με αυτή την τεκμηρίωση, στείλτε e-mail στην
<doc@FreeBSD.org>.