Article Title: how to set serial port multi-user card in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
OS: RedHat 6.1
Hardware: serial port multi-user card
Serial Port multi-user cards are generally available with jumpers (read the manual ).
I set the jumper for an eight-port multi-user card:
IRQ = 3
I/O = 0190,0198, 01a0, 01a8, 01b0, 01b8, 01c0, 01c8 (hexadecimal) eight I/O Ports
Chip types of multi-user cards: 16550A/* different chip types of multi-user cards may be different */
Process: The following operations are performed by the root user due to settings.
1. Because the interruption of the multi-use card is 3, delete ttyS1 (COM1) and ttyS3 (COM4 ). 1. # cd/dev
2. #./MAKEDEV-d ttyS1
3. #./MAKEDEV-d ttyS3
Ii. Generate a serial device. 1. # cd/dev
2. #./MAKEDEV ttyS11
3. #./MAKEDEV ttyS12
4. #./MAKEDEV ttyS13
5. #./MAKEDEV ttyS14
6. #./MAKEDEV ttyS15
7. #./MAKEDEV ttyS16
8. #./MAKEDEV ttyS17
9. #./MAKEDEV ttyS18
/* It is my preference to select such a serial device. You can select a serial device in the range of ttyS [0 .. 63 */
3. Set the serial port of the serial port device corresponding to the multi-user card 1. #/bin/setserial/dev/ttyS11 port 0x0190 irq 3 uart 16550A
/* Set/dev/ttyS11i to the first serial port corresponding to the multi-user card. The following is the example */
/* If you do not have the setserial tool, install it. RH6.1 by default */
2. #/bin/setserial/dev/ttyS12 port 0x0198 irq 3 uart 16550A
3. #/bin/setserial/dev/ttyS13 port 0x01a0 irq 3 uart 16550A
4. #/bin/setserial/dev/ttyS14 port 0x01a8 irq 3 uart 16550A
5. #/bin/setserial/dev/ttyS15 port 0x01b0 irq 3 uart 16550A
6. #/bin/setserial/dev/ttyS16 port 0x01b8 irq 3 uart 16550A
7. #/bin/setserial/dev/ttyS17 port 0x01c0 irq 3 uart 16550A
8. #/bin/setserial/dev/ttyS18 port 0x01c8 irq 3 uart 16550A
4. Compile the/etc/inittab File 1. Add the following lines to the/etc/inittab file:
11: 2345: respawn:/sbin/mingetty ttyS11
12: 2345: respawn:/sbin/mingetty ttyS12
13: 2345: respawn:/sbin/mingetty ttyS13
14: 2345: respawn:/sbin/mingetty ttyS14
15: 2345: respawn:/sbin/mingetty ttyS15
16: 2345: respawn:/sbin/mingetty ttyS16
17: 2345: respawn:/sbin/mingetty ttyS17
18: 2345: respawn:/sbin/mingetty ttyS18
/* The number starting with each line (such as 11) depends on your machine settings */
2. # init q/* Make the preceding added rows take effect */
Now, you have completed the configuration of multiple user cards in the serial port. Connect to the terminal and you will be able to see the long-awaited login status!
In addition, if you want to use the serial port card every time you open the host, you can compile the third step into a shell file and place it in/etc/rc. d/init. d, and then in/etc/rc. d/rc3.d create a soft connection. The procedure is as follows:
1. # cd/etc/rc. d/init. d
2. # vi ttyS // the file name is selected with you
Add the following lines in step 3:
/Bin/setserial/dev/ttyS11 port 0x0190 irq 3 uart 16550A
/Bin/setserial/dev/ttyS12 port 0x0198 irq 3 uart 16550A
/Bin/setserial/dev/ttyS13 port 0x01a0 irq 3 uart 16550A
/Bin/setserial/dev/ttyS14 port 0x01a8 irq 3 uart 16550A
/Bin/setserial/dev/ttyS15 port 0x01b0 irq 3 uart 16550A
/Bin/setserial/dev/ttyS16 port 0x01b8 irq 3 uart 16550A
/Bin/setserial/dev/ttyS17 port 0x01c0 irq 3 uart 16550A
/Bin/setserial/dev/ttyS18 port 0x01c8 irq 3 uart 16550A
Save disk and exit
3. # chmod + x ttyS/* Make ttyS executable */
4. # cd/etc/rc. d/rc3.d // This is the multi-user mode that enters the character state. If the multi-user mode is enabled on the host, select the path/etc/rc. d/rc5.d
5. # ln-s ../init. d/ttyS S99ttyS // You can select another connection file name
// The above is my practice. Of course many people add the above setserial content to/etc/rc. d/rc. local
.
If you want to know which serial port device you are using, you can edit/etc/rc. d/rc. local and add (\ l) in its line ):
1. # vi/etc/rc. d/rc. local
Find a row:
Echo "Kernel $ (uname-r) on $ a $ SMP $ (uname-m)">/etc/issue
Add (\ l) and the previous line is changed:
Echo "Kernel $ (uname-r) on $ a $ SMP $ (uname-m) (\ l)">/etc/issue, you can see the login status like this on the terminal:
......................
...... (TtyS11)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.