Serial Port Setting in Linux
Summary:
In order to use more than one serial port in Linux needs some
setting, this article shows the contents.
Setps:
The firest step is enable it in the BIOS setting.
Usually
com1,/dev/ttyS0,uses the io address 0x3f8,irq 4,
com2,/dev/ttyS1,uses the io address 0x2f8,irq 3,
com3,/dev/ttyS2,uses the io address 0x3e8,irq 4,
com4,/dev/ttyS3,uses the io address 0x2e8,irq 3,
for this setting, com3 and com4 does not work croectly,
so we should change the irq of com3 and com4.
Since Bios has its choice, we can only use BIOS's other setting.
here,com3 uses irq 9, com4 uses irq 10.
Be sure that there is no confilct irq in the setting,change other
setting ,take PCI irq A for example, change it from irq 9 to irq 7.
And then , save the setting and restart.
ok, now use 'setserial' command to see what are the setting for coms:
[~@861]#setserial /dev/ttyS2
what we see is that com3 still uses irq 4.
begin testing com3, it does not work croectly, costing time.
ok,now use 'setserial' command to reset com3.
[~@861]#setserial /dev/ttyS2 uart 16550a port 0x3e8 irq 9
use 'setserial' command to see result:
[~@861]#setserial /dev/ttyS2
what we see is that com3 uses irq 2.
begin testing com3, it works croectly now, very good.
check what irq it use:
[~@861]#cat /proc/interrupts
ok, it uses irq 9, not irq 2.
is it a bug with 'setserial' command? maybe.
. 。o O