Skip to content

stty: support arbitrary baudrate (at least on linux) as GNU coreutils 9.8 #8719

@galkinvv

Description

@galkinvv

Feature request: implement the arbitrary serial baudrate settable with the stty tool like done in just-released GNU coreutils 9.8.

Glibc 2.42 + GNU coreutils 9.8 implemented setting arbitrary serial baudrate with the stty tool via
bminor/glibc@5cf101a and coreutils/coreutils@357fda9

This effectively means that commands like stty -F /dev/ttyS0 28800 and stty -F /dev/ttyXXXX 250000 now works (asusimng underlying hardware controller support those speeds).
It would be good to have this feature in rust uutils-coreutils too for compatibility and for practical reasons listed below.

This was a long-waited feature for relatively modern (compared to other tty features)) ) industrial applications. Usage examples:

  • Some non-standard devices operating on speeds like 250000
  • Some industrial handware vendors produce x86-64 PCs having extended 16650A-like hardware serial controllers (based on IT87xxx: Super I/O with UARTs or similar) that perform some non-stanadrd speed translation: with a "High-speed mode" setting in MoBo BIOS enabled, the 115200 limit of the "registers API" between kernel and 16650A is overcomed by treating the programmatically set speed 28800 as physical speed 28800*8=230400. So to get 230400 physical speed, the 28800 speed is set programmatically (all software and kernel sees it as 28800). That's strange design, but it is already produced in hardware for many years. And configuring 28800 speed just via stty without need coding python/C would be very helpful step to make this all a bit less mysterious.

This seems to be a bit related to glibc's baudrate API incomatibilities in #8474

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions