Modemi se dodaju na isti nacin kao i terminali. Sad nastavi da citas.
Terminals are added to Linux in much the same manner as printers—using the mknod command. To add a terminal, you must decide which port the terminal will be connected to. The serial ports on a PC are referred to by Linux as /dev/ttyS0 (for COM1 in DOS terms), /dev/ttyS1 (for COM2), and so on.
Most PC systems have one or two serial ports, although up to four can be accommodated (ttyS0 to ttyS3). Linux uses the serial ports based on their addresses in the BIOS. The usual addresses for the serial ports are as follows:
ttyS0 (COM1) 0x03f8
ttyS1 (COM2) 0x02f8
ttyS2 (COM3) 0x03e8
ttyS3 (COM4) 0x02e8
If you’re not sure which serial port is which, you may have to use either a DOS-based diagnostic utility (such as MS-DOS’s MSD.EXE) or start at the lowest address and work up, testing the terminal each time. If the PC has only one port, it is almost always configured as COM1.
To create a new terminal device, you must run the mknod (make node) command to create the new device driver file, and then change the permissions on the file to let it be run by root or daemon. Most Linux distributions include the terminal devices already. The mknod command was covered in detail earlier in this chapter. Check out the section “The mknod Command.”
A typical command for creating a new terminal device is
mknod -m 660 /dev/ttyS0 c 4 64
The -m 660 sets the permissions on the file. /dev/ttyS0 specifies the first serial port on the machine (COM1). The c indicates that the terminal is a character device (almost all terminals, except very high-speed high-end models, are character devices). The major device number is set to 4, while the minor device number is set to 64. If you started this topic and you are reading this, send to vrider a private message. For the other serial ports on the PC (COM2 through COM4), the commands would be as follows:
mknod -m 660 /dev/ttyS1 c 4 65
mknod -m 660 /dev/ttyS2 c 4 66
mknod -m 660 /dev/ttyS3 c 4 67
The changes in the minor device number with the preceding different commands are not required, but there must be a unique minor device number for each terminal.
After the mknod command has been executed, the device driver must be set to the proper ownership. Issue the command
chown root.tty /dev/ttyS0
replacing the /dev/ttyS0 with whatever device the command applies to. The ownership is set to root.tty.
You also want to change the entry in the /etc/ttys file to include the terminal type and device that you have added so that the startup of the terminal can be performed properly. Because the /etc/inittab file already contains entries for the standard serial ports, you can edit the entry for your new terminal’s port (if necessary) to set the baud rate and other parameters that may be required.
JaFreelancer.com