UNIX has always had a high level of support for serial lines, but their purpose has changed dramatically. In the early 70s, the standard "terminal" was a
Teletype KSR35, a 10-character-per-second
Even in the early 80s, when 4.2BSD introduced network support, things didn't change much: the network support used different hardware. By this time, the Teletypes had
been replaced with glass ttys, in other words serial terminals with a monitor instead of a printer. The speeds had gone up from the 110
It wasn't until the last 10 years that the glass ttys were replaced by display boards
This change in use has invalidated a few basic concepts. Only a few years ago, the standard "high-speed" modem was a V
On the other hand, UUCP did use dialup access. As a result,
In this chapter, we’ll look at the way FreeBSD handles
Any serial connection has two ends, which may be
There are two different ways to transmit serial data, called synchronous and asynchronous communication. They grew up in different worlds:
Here’s picture of a typical byte encoding:
(рис 19.1) Asynchronous byte encoding
This figure shows an encoding for the letter j, in binary 01101011. We'll see a number of things about it:
1 if the character contains an odd number of bits, and to 0 otherwise, which ensures that the character, including the 1 with a 0 with a high level1 bit)? Space parity (always a 0 bit)? How much time from one bit to the next (what stty program (see man page stty(1)), but if you set them wrongly, you'll run into troubleBy contrast with
All modern modems use
Nowadays, all PCs come equipped with two
The first two devices, sio0 and sio1, normally use the default IRQs 4 and 3. By default, however, PC manufacturers put COM3: and COM4: also at IRQs 4 and 3. How can this work? It can't, if you also have COM1: and COM2: enabled at those IRQs. However, DOS tends to do only one thing at a time, so you can use different ports at different times on the same IRQ, as long as the interrupts aren’t enabled on more than one of the ports at a time. This restriction is unacceptable for UNIX, so we have to put them somewhere else. The only unused interrupt available to 8-bit boards is IRQ 5, originally intended for a second
There's a very good chance that IRQ 5 will already be occupied. What can you do? If one of the boards has a
We solve these questions, and more, by the use of additional lines. The most common standard is RS-232, so known as EIA-232, a standard for DCE to
| RS-232 name | Pin | Modem LED | Purpose |
|---|---|---|---|
| PG | 1 | Protective | |
| TxD | 2 | TD D1 | Transmitted data: data coming from the |
| RxD | 3 | RD D2 | Received data: data coming from the modem to the |
| RTS | 4 | Request to send. Indicates that the device has data to output. | |
| CTS | 5 | Clear to send. Indicates that the device can receive input. | |
| 6 | MR PW ON | Data set ready. Indicates that the modem is powered on and has passed self-test. On some modems, PW indicates that power is on, and MR indicates that it is operative. | |
| SG | 7 | ||
| 8 | CD M5 | Carrier detect. Indicates that the modem has connection with another modem. | |
| DTR | 20 | DTR S1 | Data terminal ready. Indicates that the terminal or computer is ready to talk to the modem. |
| RI | 22 | AA | Ring indicator. Raised by a modem to indicate that an incoming call is ringing. The AA indicator on a modem will usually flash when the incoming call is ringing. |
| AA | "Auto Answer. "Indicates that the modem will answer an incoming call. | ||
| HS | "High Speed. " Indicates that the modem is running at a higher speed than its minimum. Individual modems interpret this differently, but you can assume that something is wrong if your modem has this indicator and it’s off during transmission. | ||
| Indicates that | |||
| OH | "Off | ||
| PW | Indicates that modem power is on. May or may not imply |
The line DCD tells the
In addition to these signals, synchronous modems supply clocks on pins 17 and 19. For more details about RS-232, see RS-232 Made easy by Martin Seyer.
There are two ways to determine if the other end is prepared to accept data: hardware handshaking and software handshaking. Both are also referred to as flow control. In each case, the handshaking is symmetrical. We’ll look at it from the point of view of the
In
Software handshaking is also called X-on/X-off The DCE sends a character (X-off, which corresponds to Ctrl-S) when the buffer is full, and another (X-on, corresponding to Ctrl-Q) when there is space in the buffer again. You can also use this method on a terminal to
For hardware handshake to work, your modem must be configured correctly, and you must have the correct cables. If it isn't, the symptoms will be very slow response when transferring large quantities of data: at a higher level, TCP can recover from these
A modem is a device that transfers
Let’s consider the
You'll also note another value specified here: the connection between the modems is 2,400
Unfortunately, many people use the term baud where
(рис 19.2) Network modem connection
Two factors determine the
Currently, the most popular modem protocol is V90. V 90 pushes modem technology to the limit, and it only works when the other end of the link is a digital (ISDN) connection. You can't get a 56 kb/s connection with any kind of
In addition, you usually have a choice of
| Protocol | Speed ( |
|---|---|
| Bell 203 | 300 |
| V 21 | 300 |
| Bell 212 | 1200 |
| V 22 | 1200 |
| V | 2400 |
| V 32 | 9600 |
| V 32bis | 14400 |
| V 34 | 28800 |
| V 34bis | 33600 |
| V 90 | 56000 |
The standard PC serial hardware can run at speeds that are a fraction of 115,200
| Divisor | Speed ( |
|---|---|
| 1 | 115200 |
| 2 | 57600 |
| 3 | 38400 |
| 4 | 28800 |
| 5 | 23 040 |
| 6 | 19 200 |
You'll notice that it can’t run at 33600 or 56000
9600
This flexibility brings a problem with it: the modem can't know inadvance how fast the connection to the computer is. It needs a way to find out. The modem solves the question of local line speed by a trick: all commands start with AT or at (you're not allowed to mix cases, like aT or At). It can recognize these characters even if they arrive at the wrong speed, and thus it can establish the speed of the connection.
Nowadays, all modems are capable of dialing. That wasn’t always the case, and in some old documentation you may find references to an Auto-Call Unit or
Nearly every modern modem uses a
Modern modems store their state in a number of registers, called S registers. The register use varies somewhat from manufacturer to manufacturer, but most modems have a number in common. They each store a one-byte value, ranging between 0 and 255. Here's a list of the more important ones for a Rockwell V 34 chip set. The name of the chip set is not the same as the name of the modem. You'll note that one of the commands enables you to find out the chip set version, as we'll see in the example that follows.
| Register number | Purpose |
|---|---|
| so | Number of rings until |
| s2 | The escape character, which lets you return from + To return to +++, and wait a second, after which the modem should reply with OK |
| s6 | The time, in seconds, to wait before blind dialing. If you have set your modem to not wait for a |
| S7 | The number of seconds to wait after dialing before |
| S11 | The duration of |
The AT
| Command | Meaning |
|---|---|
| A/ | |
| ATA | Answer an incoming call manually This is an alternative to |
| ATDnumber | Dial number This command has a large number of options, but if your modem is set up correctly, you probably won’t need any of them |
| ATEnumber | Enable command echo if number is 1, disable it if number is 0. The setting of this parameter can be important for some |
| ATH0 | Disconnect the line |
| ATInumber | Display modem identification. The values of number vary from one modem to the next. See the examples below |
| ATLnumber | Set the speaker volume number ranges from 0 to 3. 0 means "speaker off," 3 is the loudest |
| ATMnumber | Determine when the speaker is on.0 means "always off,"1 means "speaker on until connect,"2 means "speaker always on,"3 means "speaker off during dialing and receiving " |
| ATO0 | Go back online from |
| ATP | Select |
| ATQnumber | If number is 0, 1, enable them. This value can be of importance for |
| ATSr=n | Set the value of S register r to n |
| ATSnumber? | Display the contents of an S register. See the example below |
| ATT | Set |
| ATVnumber | If number is 0, return result codes in numeric form. If it’s 1, return text. Don’t rely on either form to be consistent from one modem to the next |
| ATXnumber | Determine the form of the result codes. This depends a lot on the manufacturer, but it’s important for |
| ATZ | Reset modem configuration to default values |
| ATKnumber | Select 3 enables RTS/CTS |
| ATRnumber | If number is 0, CTS is only asserted if the 1, it behaves normally Make sure this value is set to 1 |
| ATTnumber | Perform modem-specific test number. This command is the origin of the statement: "UNIX is a trademark of ATT in the USA and other countries. ATT is a modem test command " |
| ATV | View the current configuration. See the example below |
| ATWnumber | Store the current configuration as profile number. Most |
| ATYnumber | Decide which profile (0 or 1) will be loaded when the modem is reset, and which will be written by the command ATW |
In this section, we'll look at what needs to be done to establish a dial-out connection. You don't normally do this yourself: some software will do it for you automatically it’s useful to know what goes on, though: it can be of immense help in solving connection problems.
There are two distinct things that you want to do with the modem: first, you send commands to the modem to set up the link. Once the link is established, you don’t want to talk to the modem anymore, you want to talk to the system at the other end of the link.
In the old days, the system used a separate
The terminal parameter clocal enables communication with a device that is not asserting DCD (such as a modem that hasn’t established a connection yet). When it starts, the software sets clocal. When it has finished talking to the modem and wants to wait for the connection to be established, it resets (turns off) clocal and waits for stty command:
stty -f /dev/cuaa2 -a
ppp disc; speed 57600 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=<undef>;
eol2=<undef>; erase=^?; intr=^C; kill=^U; lnext=^V;
min=1; quit=^\; reprint=^R; start=^Q; status=^T;
stop=^S; susp=^Z; time=0; werase=^W;
This example, taken when the modem is connected, shows clocal reset. As you can see, this is indicated by the text -clocal.
There’s problem here: what if this line is also enabled for dialup? As we shall see on page 338, there will be a getty process in the process of opening the line. It won't succeed until
The FreeBSD solution is to create separate devices for each case. For the second
For an example of what you might look at, let’s consider a manual dialup to an ISP. This assumes that you are using user PPP (see page 348) and that have an entry ISP in your /etc/ppp/ppp.conf. If you don't have an entry for an ISP, you can still test the modem, but in this case you won't be able to dial. In this case, simply omit the text ISP.
ppp ISP User Process PPP. Written by Toshiharu OHNO. Using interface: tun0 Interactive mode ppp ON freebie> term go into direct connect mode Enter to terminal mode. Type `~?' for help. at synchronize with the modem OK atv look at the modem profile ACTIVE PROFILE: B0 E1 L0 Ml N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K4 Q5 R1 S0 T5 X0 Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K4 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK
The term profile refers to a set of the complete configuration information for the modem. ATV command shows the current configuration (" active profile ") and the two stored profiles. The first line refects the parameters set with AT commands (for example, L0 means that the command ATL0, turn off the speaker, has been issued). The next two or three lines refect the values of the Sregisters. In addition, this modem can store up to four
If you look at this profile, you'll notice that the active profile includes the parameter K4 This means "use
atk3 set RTS/CTS flow control OK atw write the active profile OK atv and check ACTIVE PROFILE: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK
The active profile includes the parameter Y0, so the ATW command writes back to stored profile 0.
The ATV command doesn't show all the S registers. Some of them relate to the current state of the modem, and aren’t part of the configuration. For example, my modem includes an S register S86, the Call Failure Reason Code If a call fails, it could be interesting to look at it. To do so:
ats86? show contents of S86 012 Connection dropped by other end
With this background, we can now proceed to establish a connection:
atd1234567 just dial CONNECT 57600 ppp ON freebie> PPP ON freebie>
Traditionally, UNIX distinguishes between local serial terminals and terminals connected by modem by whether they assert the DCD signal. It starts a getty (for Get TTY) process for each line getty opens the line, but for modems the line state is set in such a way that the call to open does not complete until the DCE asserts clocal. If you look at the line state with the stty program, it will show -clocal if the flag is reset.
To set up a line for dialing in, add information about the line in the file /etc/ttys. The default file contains a number of lines like:
ttyd0. "/usr/libexec/getty std 9600". unknown off secure
This information has the following meaning:
/usr/libexec/getty std 9600 This is the invocation for getty: the getty program is /usr/libexec/getty, and it is invoked with the parameter std 9600 This is a label in the file /etc/gettytab, and describes a standard 9600 std 57600.unknown refers to the terminal type. This is the value to which getty sets the environment variable TERM. If you know that only people with VT100 terminals dial in, you might change this string to vt100, but you should do this with care. It can cause a real mess on the screen, and even make it impossible to work with it.off means "don't start the getty after all ". If you want to run a getty on this line, change this string to on.
secure means that only people you trust can access this line, so you can allow a root login on this line. That's fi ne for a
After changing /etc/ttys, send init (process 1) a HUP signal to tell it to re-read /etc/ttys:
# kill -1 1
UNIX has always had a high level of support for serial lines, but their purpose has changed dramatically. In the early 70s, the standard "terminal" was a
Teletype KSR35, a 10-character-per-second
Even in the early 80s, when 4.2BSD introduced network support, things didn't change much: the network support used different hardware. By this time, the Teletypes had
been replaced with glass ttys, in other words serial terminals with a monitor instead of a printer. The speeds had gone up from the 110
It wasn't until the last 10 years that the glass ttys were replaced by display boards
This change in use has invalidated a few basic concepts. Only a few years ago, the standard "high-speed" modem was a V
On the other hand, UUCP did use dialup access. As a result,
In this chapter, we’ll look at the way FreeBSD handles
Any serial connection has two ends, which may be
There are two different ways to transmit serial data, called synchronous and asynchronous communication. They grew up in different worlds:
Here’s picture of a typical byte encoding:
(рис 19.1) Asynchronous byte encoding
This figure shows an encoding for the letter j, in binary 01101011. We'll see a number of things about it:
1 if the character contains an odd number of bits, and to 0 otherwise, which ensures that the character, including the 1 with a 0 with a high level1 bit)? Space parity (always a 0 bit)? How much time from one bit to the next (what stty program (see man page stty(1)), but if you set them wrongly, you'll run into troubleBy contrast with
All modern modems use
Nowadays, all PCs come equipped with two
The first two devices, sio0 and sio1, normally use the default IRQs 4 and 3. By default, however, PC manufacturers put COM3: and COM4: also at IRQs 4 and 3. How can this work? It can't, if you also have COM1: and COM2: enabled at those IRQs. However, DOS tends to do only one thing at a time, so you can use different ports at different times on the same IRQ, as long as the interrupts aren’t enabled on more than one of the ports at a time. This restriction is unacceptable for UNIX, so we have to put them somewhere else. The only unused interrupt available to 8-bit boards is IRQ 5, originally intended for a second
There's a very good chance that IRQ 5 will already be occupied. What can you do? If one of the boards has a
We solve these questions, and more, by the use of additional lines. The most common standard is RS-232, so known as EIA-232, a standard for DCE to
| RS-232 name | Pin | Modem LED | Purpose |
|---|---|---|---|
| PG | 1 | Protective | |
| TxD | 2 | TD D1 | Transmitted data: data coming from the |
| RxD | 3 | RD D2 | Received data: data coming from the modem to the |
| RTS | 4 | Request to send. Indicates that the device has data to output. | |
| CTS | 5 | Clear to send. Indicates that the device can receive input. | |
| 6 | MR PW ON | Data set ready. Indicates that the modem is powered on and has passed self-test. On some modems, PW indicates that power is on, and MR indicates that it is operative. | |
| SG | 7 | ||
| 8 | CD M5 | Carrier detect. Indicates that the modem has connection with another modem. | |
| DTR | 20 | DTR S1 | Data terminal ready. Indicates that the terminal or computer is ready to talk to the modem. |
| RI | 22 | AA | Ring indicator. Raised by a modem to indicate that an incoming call is ringing. The AA indicator on a modem will usually flash when the incoming call is ringing. |
| AA | "Auto Answer. "Indicates that the modem will answer an incoming call. | ||
| HS | "High Speed. " Indicates that the modem is running at a higher speed than its minimum. Individual modems interpret this differently, but you can assume that something is wrong if your modem has this indicator and it’s off during transmission. | ||
| Indicates that | |||
| OH | "Off | ||
| PW | Indicates that modem power is on. May or may not imply |
The line DCD tells the
In addition to these signals, synchronous modems supply clocks on pins 17 and 19. For more details about RS-232, see RS-232 Made easy by Martin Seyer.
There are two ways to determine if the other end is prepared to accept data: hardware handshaking and software handshaking. Both are also referred to as flow control. In each case, the handshaking is symmetrical. We’ll look at it from the point of view of the
In
Software handshaking is also called X-on/X-off The DCE sends a character (X-off, which corresponds to Ctrl-S) when the buffer is full, and another (X-on, corresponding to Ctrl-Q) when there is space in the buffer again. You can also use this method on a terminal to
For hardware handshake to work, your modem must be configured correctly, and you must have the correct cables. If it isn't, the symptoms will be very slow response when transferring large quantities of data: at a higher level, TCP can recover from these
A modem is a device that transfers
Let’s consider the
You'll also note another value specified here: the connection between the modems is 2,400
Unfortunately, many people use the term baud where
(рис 19.2) Network modem connection
Two factors determine the
Currently, the most popular modem protocol is V90. V 90 pushes modem technology to the limit, and it only works when the other end of the link is a digital (ISDN) connection. You can't get a 56 kb/s connection with any kind of
In addition, you usually have a choice of
| Protocol | Speed ( |
|---|---|
| Bell 203 | 300 |
| V 21 | 300 |
| Bell 212 | 1200 |
| V 22 | 1200 |
| V | 2400 |
| V 32 | 9600 |
| V 32bis | 14400 |
| V 34 | 28800 |
| V 34bis | 33600 |
| V 90 | 56000 |
The standard PC serial hardware can run at speeds that are a fraction of 115,200
| Divisor | Speed ( |
|---|---|
| 1 | 115200 |
| 2 | 57600 |
| 3 | 38400 |
| 4 | 28800 |
| 5 | 23 040 |
| 6 | 19 200 |
You'll notice that it can’t run at 33600 or 56000
9600
This flexibility brings a problem with it: the modem can't know inadvance how fast the connection to the computer is. It needs a way to find out. The modem solves the question of local line speed by a trick: all commands start with AT or at (you're not allowed to mix cases, like aT or At). It can recognize these characters even if they arrive at the wrong speed, and thus it can establish the speed of the connection.
Nowadays, all modems are capable of dialing. That wasn’t always the case, and in some old documentation you may find references to an Auto-Call Unit or
Nearly every modern modem uses a
Modern modems store their state in a number of registers, called S registers. The register use varies somewhat from manufacturer to manufacturer, but most modems have a number in common. They each store a one-byte value, ranging between 0 and 255. Here's a list of the more important ones for a Rockwell V 34 chip set. The name of the chip set is not the same as the name of the modem. You'll note that one of the commands enables you to find out the chip set version, as we'll see in the example that follows.
| Register number | Purpose |
|---|---|
| so | Number of rings until |
| s2 | The escape character, which lets you return from + To return to +++, and wait a second, after which the modem should reply with OK |
| s6 | The time, in seconds, to wait before blind dialing. If you have set your modem to not wait for a |
| S7 | The number of seconds to wait after dialing before |
| S11 | The duration of |
The AT
| Command | Meaning |
|---|---|
| A/ | |
| ATA | Answer an incoming call manually This is an alternative to |
| ATDnumber | Dial number This command has a large number of options, but if your modem is set up correctly, you probably won’t need any of them |
| ATEnumber | Enable command echo if number is 1, disable it if number is 0. The setting of this parameter can be important for some |
| ATH0 | Disconnect the line |
| ATInumber | Display modem identification. The values of number vary from one modem to the next. See the examples below |
| ATLnumber | Set the speaker volume number ranges from 0 to 3. 0 means "speaker off," 3 is the loudest |
| ATMnumber | Determine when the speaker is on.0 means "always off,"1 means "speaker on until connect,"2 means "speaker always on,"3 means "speaker off during dialing and receiving " |
| ATO0 | Go back online from |
| ATP | Select |
| ATQnumber | If number is 0, 1, enable them. This value can be of importance for |
| ATSr=n | Set the value of S register r to n |
| ATSnumber? | Display the contents of an S register. See the example below |
| ATT | Set |
| ATVnumber | If number is 0, return result codes in numeric form. If it’s 1, return text. Don’t rely on either form to be consistent from one modem to the next |
| ATXnumber | Determine the form of the result codes. This depends a lot on the manufacturer, but it’s important for |
| ATZ | Reset modem configuration to default values |
| ATKnumber | Select 3 enables RTS/CTS |
| ATRnumber | If number is 0, CTS is only asserted if the 1, it behaves normally Make sure this value is set to 1 |
| ATTnumber | Perform modem-specific test number. This command is the origin of the statement: "UNIX is a trademark of ATT in the USA and other countries. ATT is a modem test command " |
| ATV | View the current configuration. See the example below |
| ATWnumber | Store the current configuration as profile number. Most |
| ATYnumber | Decide which profile (0 or 1) will be loaded when the modem is reset, and which will be written by the command ATW |
In this section, we'll look at what needs to be done to establish a dial-out connection. You don't normally do this yourself: some software will do it for you automatically it’s useful to know what goes on, though: it can be of immense help in solving connection problems.
There are two distinct things that you want to do with the modem: first, you send commands to the modem to set up the link. Once the link is established, you don’t want to talk to the modem anymore, you want to talk to the system at the other end of the link.
In the old days, the system used a separate
The terminal parameter clocal enables communication with a device that is not asserting DCD (such as a modem that hasn’t established a connection yet). When it starts, the software sets clocal. When it has finished talking to the modem and wants to wait for the connection to be established, it resets (turns off) clocal and waits for stty command:
stty -f /dev/cuaa2 -a
ppp disc; speed 57600 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=<undef>;
eol2=<undef>; erase=^?; intr=^C; kill=^U; lnext=^V;
min=1; quit=^\; reprint=^R; start=^Q; status=^T;
stop=^S; susp=^Z; time=0; werase=^W;
This example, taken when the modem is connected, shows clocal reset. As you can see, this is indicated by the text -clocal.
There’s problem here: what if this line is also enabled for dialup? As we shall see on page 338, there will be a getty process in the process of opening the line. It won't succeed until
The FreeBSD solution is to create separate devices for each case. For the second
For an example of what you might look at, let’s consider a manual dialup to an ISP. This assumes that you are using user PPP (see page 348) and that have an entry ISP in your /etc/ppp/ppp.conf. If you don't have an entry for an ISP, you can still test the modem, but in this case you won't be able to dial. In this case, simply omit the text ISP.
ppp ISP User Process PPP. Written by Toshiharu OHNO. Using interface: tun0 Interactive mode ppp ON freebie> term go into direct connect mode Enter to terminal mode. Type `~?' for help. at synchronize with the modem OK atv look at the modem profile ACTIVE PROFILE: B0 E1 L0 Ml N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K4 Q5 R1 S0 T5 X0 Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K4 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK
The term profile refers to a set of the complete configuration information for the modem. ATV command shows the current configuration (" active profile ") and the two stored profiles. The first line refects the parameters set with AT commands (for example, L0 means that the command ATL0, turn off the speaker, has been issued). The next two or three lines refect the values of the Sregisters. In addition, this modem can store up to four
If you look at this profile, you'll notice that the active profile includes the parameter K4 This means "use
atk3 set RTS/CTS flow control OK atw write the active profile OK atv and check ACTIVE PROFILE: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 C1 D2 G0 J0 K3 Q5 R1 S0 T5 X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK
The active profile includes the parameter Y0, so the ATW command writes back to stored profile 0.
The ATV command doesn't show all the S registers. Some of them relate to the current state of the modem, and aren’t part of the configuration. For example, my modem includes an S register S86, the Call Failure Reason Code If a call fails, it could be interesting to look at it. To do so:
ats86? show contents of S86 012 Connection dropped by other end
With this background, we can now proceed to establish a connection:
atd1234567 just dial CONNECT 57600 ppp ON freebie> PPP ON freebie>
Traditionally, UNIX distinguishes between local serial terminals and terminals connected by modem by whether they assert the DCD signal. It starts a getty (for Get TTY) process for each line getty opens the line, but for modems the line state is set in such a way that the call to open does not complete until the DCE asserts clocal. If you look at the line state with the stty program, it will show -clocal if the flag is reset.
To set up a line for dialing in, add information about the line in the file /etc/ttys. The default file contains a number of lines like:
ttyd0. "/usr/libexec/getty std 9600". unknown off secure
This information has the following meaning:
/usr/libexec/getty std 9600 This is the invocation for getty: the getty program is /usr/libexec/getty, and it is invoked with the parameter std 9600 This is a label in the file /etc/gettytab, and describes a standard 9600 std 57600.unknown refers to the terminal type. This is the value to which getty sets the environment variable TERM. If you know that only people with VT100 terminals dial in, you might change this string to vt100, but you should do this with care. It can cause a real mess on the screen, and even make it impossible to work with it.off means "don't start the getty after all ". If you want to run a getty on this line, change this string to on.
secure means that only people you trust can access this line, so you can allow a root login on this line. That's fi ne for a
After changing /etc/ttys, send init (process 1) a HUP signal to tell it to re-read /etc/ttys:
# kill -1 1
Для получения официальных документов о завершении программы дополнительного профессионального образования (удостоверения о повышении квалификации, дипломов о профессиональной переподготовке и MBA) необходимо предоставить:
Внимание! Вы можете не заказывать доставку бумажной версии официального документы, а скачать его в электронном виде и распечатать самостоятельно. Информация о выданном документе в течение 1 месяца загружается в Федеральную информационную систему «Федеральный реестр сведений о документах об образовании и (или) о квалификации, документах об обучении» - ФИС ФРДО.
Доступ на новый сайт осуществляется с использованием адреса электронной почты, который был указан вами при регистрации на "старом". Мы постарались перенести все ваши данные с прежнего ресурса, однако не исключена вероятность потери части информации.
При возникновении проблемы со входом, воспользуйтесь функцией сброса пароля
Если вы обнаружите несоответствия, пожалуйста, сообщите нам.