How to open serial port in linux without changing any pin?

后端 未结 4 1044
南旧
南旧 2021-02-19 00:39

Posix requires changing RTS pin on port opening. I want a way to avoid it.

4条回答
  •  有刺的猬
    2021-02-19 01:35

    I have no idea why you'd want to do this, but this can be done pretty easily by modifying the linux kernel driver for your serial console so it doesn't toggle RTS. For example, for the 8250-series driver in drivers/tty/serial/8250/ you could change every write to the MCR register (UART_MCR) to ensure that bit 1 (mask is UART_MCR_RTS) is never set.

    Since it's abstracted away in userspace, you're out of luck if you want to do this without modifying the kernel driver.

提交回复
热议问题