Adding a Modem

Team-Fly    

Solaris™ Operating Environment Boot Camp
By David Rhodes, Dominic Butler
Table of Contents
Chapter 14.  Connecting Serial Devices


Now we're ready to add a modem to the system. This will use the same port monitor that we used for port "A" (ttymon), only it will be configured slightly different to suit our modem.

To configure this we'll follow similar steps to the earlier configuration for port "A," although we don't need to update the _sactab file as we already have a valid ttymon configured and running. We simply need to add a secondary service and let the existing ttymon manage both of them. This time we'll use a different set of values for the port, because it will be configured for a modem rather than a terminal. The ones we'll use are shown in Table 14.7.

Table 14.7. Modem Configuration Details

Setting

Value

Port Connection

B

Speed

38400

Data Format

8, n, 1 (8 data, no parity, 1 stop)

Mode

Bidirectional

Looking at this table, we can see that the data format is different. We mentioned earlier that many people like to use 8 data bits, no parity, and 1 stop bit for their modem lines, and often create an entry in /etc/ttydefs specifically for this. To accomplish this, we'll add the following entry, named "DIAL_8," to /etc/ttydefs:

 hydrogen# grep DIAL_8 /etc/ttydefs DIAL_8:19200 parenb cs8 opost onlcr:19200 sane parenb cs8 crtscts hupcl::DIAL_8 hydrogen# 

We can see that in addition to the flags set previously, this sets the following values:

  • -parenb Disable parity

  • cs8 Set the character size to 8 bits

  • crtscts Enable hardware flow control

Now we can configure the SAF to support the service. We've already added the port monitor (ttymon) when we configured the terminal earlier, so all we need to do here is add another service to it. Again, we'll run the command first and then break it down into its components:

 hydrogen# pmadm -a -p zsmon -s ttyb -i root fu \ -v 'ttyadm-V` -y "Bi-directional modem" \ -m "`ttyadm -b l DIAL_8 -m ldterm,ttcompat \ -d /dev/term/b s /usr/bin/login` -S n" hydrogen# 

This shows that the pmadm generic parameters are very similar to the previous settings, and that most of the changes are within the ttyadm parameters. We'll look at these in a moment, but first let's check the _pmtab file again to see what changes have been made:

[View full width]

hydrogen# cat /etc/saf/zsmon/_pmtab # VERSION=1 ttya:u:root:reserved:reserved:reserved:/dev/term/a:::/usr/bin/login::contty5H::login\: :: graphics/ccc.gifvt100:y:#Terminal ttyb:u:root:reserved:reserved:reserved:/dev/term/b:b::/usr/bin/login::DIAL_8:ldterm, graphics/ccc.gifttcompat:login\: :::: -S n#Bi-directional modem hydrogen#

Table 14.8 shows what the different parameters refer to.

Table 14.8. Modem Ttyadm Parameters

Option

Meaning

-b

Configure a bidirectional port

-l DIAL_8

Use the 8-bit line setting (see above)

-m ldterm,ttcompat

Use the STREAMS modules ldterm and ttcompat

-d /dev/term/b

Device used for the (incoming) line

-s /usr/bin/login

Name of the service that runs on connection

-S n

Disable software carrier

Hopefully, pmadm is aware of the changes that we've made, so let's make sure it knows the service is available:

[View full width]

hydrogen# pmadm l s ttyb PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC> zsmon ttymon ttyb u root /dev/term/b b - /usr/bin/login DIAL_8 ldterm, graphics/ccc.gifttcompat login: - - n #Bi-directional modem hydrogen#

Again, the port appears to be configured correctly, so let's move on and test that the modem works.

Test the Modem

At this point the hardware has been configured correctly and we have the correct cable in place, so we should be able to confirm the modem is at least connected (although not necessarily configured) correctly by connecting onto it. We need to use the outgoing cua port for this:

 hydrogen# tip 9600 /dev/cua/b connected at OK ati4 U.S. Robotics 56K FAX EXT Settings... <lines removed for clarity> OK ~. hydrogen# 

Good. We've managed to talk to the modem, which is a good start!

Configure /Etc/remote

Now we'll create an entry for the modem in /etc/remote. This is an ASCII file that contains information about all the remote systems we need to connect to, including phone numbers and all the connection details. By default, an entry named "hardwire" is also included; it is normally only used to connect to the modem. We need to make sure it contains the correct settings, which means it will look similar to the following entry:

 hydrogen# cat /etc/remote <lines removed for clarity> hardwire:\         :dv=/dev/cua/b:br#9600: <lines removed for clarity> hydrogen# 

Now we'll be able to tip directly to the modem using the newly created "hardwire" entry:

 hydrogen# tip hardwire connected at OK ~. hydrogen# 

Test Incoming Connections

All that remains for this service is for us to test the incoming connection to make sure that the modem answers the call (set the modem to "auto answer"). Then we need to make sure that ttymon detects our presence. Once it had done this, it will enable the port and ensure that the correct settings are applied to it. After that, we'll receive a login prompt.


    Team-Fly    
    Top
     



    Solaris Operating Environment Boot Camp
    Solaris Operating Environment Boot Camp
    ISBN: 0130342874
    EAN: 2147483647
    Year: 2002
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net