2013年4月30日 星期二

How do I check and configure serial ports under Linux?



How do I check and configure serial ports under Linux for various purposes such as modem, connecting null modems or connect a dumb terminal?

Linux offers various tools. Linux uses ttySx for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on.

Task: Display Detected System's Serial Support

Simple run dmesg command
$ dmesg | grep tty
Output:
[   37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A

setserial command

setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on. Just type the following command:
$ setserial -g /dev/ttyS[0123]
Output:
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x1020, IRQ: 18
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
setserial with -g option help to find out what physical serial ports your Linux box has.

Linux serial console programs

Once serial ports identified you can configure Linux box using various utilities:
  1. minicom- The best friendly serial communication program for controlling modems and connecting to dump devices
  2. wvidial or other GUI dial up networking program - a PPP dialer with built-in intelligence.
  3. getty / agetty - agetty opens a tty port, prompts for a login name and invokes the /bin/login command.
  4. grub / lilo configuration - To configure serial port as the system console

沒有留言:

如何在Windows的事件檢視器event viewer,查詢開機關機的紀錄

Windows 如何 事件檢視器 查詢開機關機紀錄 Step1: 打開windows的 「 事件檢視器 」,開啟「 建立自訂檢視… 」視窗,在「事件記錄檔」選項,將「Windows 紀錄」內勾選「系統」選項。 Step2: 內含/排除事件識別碼: 」排除事件識別碼打「6005,6...