Thursday, September 16, 2010

FreeBSD Serial (35): serial port and modem

LAN to FreeBSD and Internet (or other wide area network) connection, you need to use the wide area network interface. For the average user, using ordinary telephone lines for dial-up way, it is more common practice. This requires first to use the computer's serial port to connect to the modem (modem), the further through the modem to connect to the Internet.

Serial port and modem

So if using a computer dial-up connection to the remote, you must configure the computer's serial port and a good modem.

Personal computers generally have two serial ports, DOS, called COM1, COM2, FreeBSD Unix habit of using the array starting from 0, corresponding to the serial port hardware sio0, sio1. Start the system will automatically detect the hardware, test results appear on the screen, you can log in to use dmesg to see the startup information to determine whether the hardware actually being detected. If the serial port is detected, you can use to connect to the appropriate serial port on the external modem to connect.

If you use the built-in modem card, the card will include a serial device, according to the card's settings, the serial device can sio2 or sio3, we must ensure that the kernel support for the third, fourth serial devices sio2 and sio3. But with the DOS is different, modem cards can not be used with existing serial port IRQ sharing hardware resources. Since DOS is a single task operating system, can not use both serial ports, IRQ sharing is possible, therefore COM1 and COM3 share IRQ 4, COM2 and COM4 share IRQ 3. But for multi-user operating system, FreeBSD is concerned, there will be multiple processes simultaneously access devices, each device must occupy a separate IRQ, it is necessary modem cards in the kernel will set another free IRQ value.

To change the jumpers on the card or run the Setup program in DOS, change the card settings to make the hardware settings are consistent with the kernel configuration. PNP modem card is usually the correct set of hardware resources can also be reset by UserConfig.

When the FreeBSD kernel detects serial device, the device will be able to file through the corresponding access the serial port of the. Corresponding to the first serial device sio0 documents / dev/ttyd0 and / dev/cuaa0, corresponding to the second serial port sio2 device file / dev / tty d1 and / dev/cuaa1, and so on.

FreeBSD provides two serial ports on a device file, in fact, they correspond to the same hardware, only slightly different properties. cuaa0 mainly used to allocate, ttyd0 mainly used to dial and direct connection. Setting these two devices as the reason for a computer and modem to communicate data between two categories, one for the computer to the modem through the serial port to send control commands, used for the AT commands Hayes, the data is sent to the modem, but another computer via modem to send data to the telephone line transmission data, which only you can let the modem to modem. For the application in terms of, to a very simple to distinguish between the two data, the initial state can use two different devices file.

When an external dial-house, the telephone connection has been set up, and data transmission is between the computer and telephone network, modem to modem only, this time on the use of ttyd0. When the outward dialing, modem not establish a connection, the computer should send the command to the modem, control the implementation of dial-up modem, etc, then use the device file on cuaa0. Once the connection is established, the system will reset the device file's properties, making cuaa0 data is also sent to the phone line.

So ttyd0 and cuaa0 two device files, but different initial conditions, and are not essential differences. In fact most of the dial-up software will reset the device file of the state, which device to use dial-up process can be completed properly. However, the practice is still customary to use cuaa0 used to allocate, ttyd0 as a dial, so to avoid some of the software can not correctly reset the device file of the state of the problem.

Recommended links:

quicktime rmvb

Photo 6 of a tough, for the first magic

"COTTAGE XP" national dream

Convert m2ts to mkv

Articles about Games Simulation

MMOG / LE assessment of the road Troika

J2ME Learning Reviewing the Old Posts

Matroska format

Ghost 20 little-known practical parameters

E-cology In The Pan Micro Series 14

Talent war broke out, the direct selling INDUSTRY executives 300 000 -50 million annual salary

XBOX360 rmvb

Recommend Anti-Virus Tools

No comments:

Post a Comment