Serial Networking Devices  «Prev  Next»

Lesson 2 Serial devices
ObjectiveDescribe serial devices supported by Red Hat Linux.

Linux Serial Devices which are supported by Red Hat

Red Hat Enterprise Linux (RHEL) 9.2 provides extensive support for a variety of serial devices. These devices communicate via serial ports, which send data one bit at a time over a communication channel or computer bus. Below is an overview of the types of serial devices supported by RHEL 9.2.
  1. Serial Ports (RS-232, RS-422, RS-485): These are standard for serial binary data interconnection between devices. They are commonly used in industrial machines, scientific instruments, and network equipment. RHEL 9.2 supports these types of serial ports and provides tools for configuring them.
  2. Universal Serial Bus (USB) Devices: USB is a modern serial communication method used to connect peripherals such as keyboards, mice, printers, and storage devices. RHEL 9.2 supports a wide range of USB devices, including USB 2.0, USB 3.x, and USB 4. USB support in RHEL includes the handling of USB serial adapters, which are often used when more serial ports are needed than the motherboard natively provides.
  3. Modems: Modems, whether internal (ISA/PCI) or external (RS-232/USB), are also supported in RHEL 9.2. This includes traditional dial-up modems as well as more modern cellular modems. For cellular modems, additional software such as ModemManager might be required to manage connections.
  4. Serial Console: A serial console is a type of physical interface through which a device can be controlled. In server environments, a serial console is often used for direct system access during boot or in case of network failure. RHEL 9.2 supports serial console operation, which can be configured through the boot loader (GRUB) and the system service getty.
  5. Bluetooth Serial Devices: RHEL 9.2 also supports Bluetooth serial devices through the rfcomm protocol. This can be used for setting up dial-up networking (DUN), serial port profile (SPP) devices, or other services that traditionally use a serial port.
  6. Serial Over LAN (SOL): RHEL 9.2 provides support for SOL, which is a mechanism that enables the input and output of the serial port of a managed system to be redirected over IP. It's usually a feature of out-of-band management solutions like Intel's Active Management Technology (AMT).
It's important to note that while RHEL 9.2 provides the drivers and tools to use these devices, additional configuration might be required depending on the specific device and its intended use. This configuration might involve setting the appropriate baud rate and parity bits for serial port communication or installing vendor-specific drivers for certain USB or Bluetooth devices. The configuration of these devices should be performed by a system administrator with a good understanding of Linux and the specific hardware being used.

Linux Serial Devices

Red Hat Linux supports common serial devices, such as:
  1. Modems
  2. Mice
  3. Serial terminals

Serial devices attach to a computer through an external interface, either a 9-pin or 25-pin RS-232 connector, known as a serial port. Alternatively, an internal device might be assigned a logical serial port, through the computer's BIOS.
RS-232 connectors
RS-232 connectors

External and internal devices, although of the same type and similar functionality, might not have the same characteristics. For example, external and internal modems both connect two computers over a phone line. External modems are completely separate devices that operate without the support of the computer's CPU. Internal modems usually cannot function as standalone devices and require the operating system to assist them. Linux supports all external modems, but only a handful of internal modems.
  1. BIOS: Basic Input and Output System. The BIOS is responsible for providing a standard interface to the computer hardware. An operating system writes to a particular BIOS specification, rather than worrying about the details for all supported hardware.
  2. The getty daemon: Actual hardwired terminals are almost never seen anymore. The idea of a connected terminal (or serial device such as a mouse) remains, however.

The getty daemon[1] and its variants support serial communications under Linux. Commonly used protocols over serial lines include PPP and SLIP. The getty daemon allows users to log in to a Linux station using a serial device, which is allocated a terminal (tty). getty assigns each user a different tty session to communicate between themselves and the machine. The next lesson explains how to administer serial ports.

Are RS-232 connectors still in use?

RS-232 connectors are not explicitly deprecated in Red Hat Linux 9.2 (or other Linux distributions), but their use has significantly declined due to advancements in connectivity standards. Linux, including Red Hat, continues to support RS-232 (serial) devices, as many legacy systems still rely on them. However, newer technologies are increasingly replacing RS-232 for most use cases.
Why RS-232 Usage is Declining:
  1. Low Speed: RS-232 has slower data transfer rates compared to modern alternatives.
  2. Limited Distance: RS-232 is effective only for short distances (typically less than 50 feet).
  3. Compatibility: Fewer devices come with built-in RS-232 ports, as USB and other standards dominate.
  4. Port Scarcity: Many modern motherboards no longer include RS-232 ports.

Replacement Technologies:
In environments where RS-232 is becoming impractical, the following connectivity devices are commonly used:
  1. USB-to-Serial Adapters
    • These adapters bridge USB and RS-232, allowing legacy devices to connect to systems via USB.
    • Common chipsets used: FTDI, Prolific.
  2. Ethernet or Serial-over-IP (SoIP)
    • RS-232 signals can be converted to IP packets for communication over Ethernet.
    • Common devices: Serial Device Servers (e.g., from brands like Digi or Moxa).
  3. Bluetooth or Wireless Serial Adapters
    • Useful for applications requiring wireless serial communication.
    • Protocol examples: Bluetooth SPP (Serial Port Profile).
  4. USB (Universal Serial Bus)
    • USB has largely replaced RS-232 for peripheral connectivity in most applications.
    • Linux fully supports USB devices, often without requiring additional drivers.
  5. UART-over-GPIO (For Embedded Systems)
    • In embedded environments (e.g., with Raspberry Pi or other SBCs), UART pins on GPIO headers can provide RS-232-like functionality.

Conclusion: While RS-232 is not inherently deprecated, its usage has been superseded in most scenarios by USB, Ethernet, and other modern interfaces. For connecting legacy RS-232 devices to Red Hat Linux 9.2, a USB-to-serial adapter is typically the most straightforward solution.

getty variants

mgetty, a variant of getty, supports
  1. modem dial-in,
  2. FAX, and
  3. PPP.
  4. mingetty, another a getty variant, is used for virtual consoles, or multiple login sessions at the workstation console.

  • getty monitors serial lines getty monitors serial lines, waiting for a connection. It then configures the serial link, sends the contents of /etc/issue, and asks the person connecting for their login name. getty then starts login and login asks the person for their password. If the user does nothing, getty or login hang up and getty goes back to waiting. The getty command has been re-implemented numerous times.
    There is a wide selection of getty clones, each with slight differences in behavior and syntax. We will describe the traditional getty, and then some popular alternatives. One of the jobs of a getty is to set the TERM environment variable to indicate the make and model of the terminal which is connecting.
  • Related mgetty commands
    1. mgetty: Contains the mgetty version of getty for allowing logins to Linux over serial lines.
    2. mgetty - sendfax: Contains the sendfax program for sending faxes in conjunction with the mgetty program.
    3. mgetty - viewfax: Contains the viewfax utilities for displaying faxes in X that were received by mgetty.
    4. mgetty - voice: Contains vgetty utilities for supporting voice communications with mgetty.

    The six getty lines start up virtual consoles to allow logins. These processes are always running in any of the multiuser run levels. When someone connected to a virtual console logs out, that getty process dies, and the respawn action instructs init to start a new getty process.
    gettydefs: Contains line definitions used by terminal devices (including modems, dumb terminals, and remote logins over terminal devices).
    pstree [-a] [-c] [-H pid] [-n] [-p] [-G] [basepid | baseuser]
    

    Called with no arguments, pstree shows all processes, with init as the root. Specifying basepid or baseuser begins the display from the PID specified by the PID basepid or the user name baseuser, respectively. -a includes the command line for each process. -c expands identically named child processes (such as the mingetty instance spawned for each terminal). -H pid highlights the PID pid and its ancestor (parent) processes. If pid does not exist, pstree exits with an error. -n sorts the output by PID (the default is by ancestry). -p causes each process’s PID to display and implies -c. -G, finally, draws the tree using the VT100 drawing characters rather than the default ASCII characters |, +, -, and `. top displays real time CPU and memory usage and current system uptime information. Although it is an interactive command, top is a vital tool in every system administrator’s toolbox, so its command line interface (not its interactive use) is covered here.

getty still used in older Linux distributions

getty is still used in Red Hat Enterprise Linux (RHEL) 9.2, but its usage is more specialized and less common than in older Linux distributions. The functionality of `getty` has largely been integrated into the systemd system manager through the `systemd-getty` service or [email protected].
Context for `getty` in Modern Systems:
  • In modern Linux distributions, including RHEL 9.2, systemd provides a more advanced mechanism for managing system services, including terminal sessions on virtual consoles and serial ports.
  • The getty program is still available and can be invoked for serial terminal access, typically for embedded systems, virtual machines, or other environments where a serial connection is required.
Use Cases for `getty` in RHEL 9.2:
  • Serial Console Login
    • Useful for remote management or headless servers where access is via a serial interface.
    • Configured using the [email protected] provided by systemd.
  • Custom Terminal Sessions
    • Can be configured manually for specific use cases where serial or virtual terminal access is necessary.
  • Legacy Systems
    • For compatibility or specific applications requiring traditional getty behavior.

How to Check or Configure `getty` in RHEL 9.2:
Check Existing Services:
To verify if `getty` is active:
systemctl status [email protected]
systemctl status [email protected]
Enable Serial Login with `getty`:
If you need to enable serial console access, you can configure it as follows:
  1. Start and Enable the Serial Getty Service
        sudo systemctl enable [email protected]
        sudo systemctl start [email protected]
        
  2. Configure the Kernel to Use Serial Console

    Add the following to the kernel boot parameters (e.g., in GRUB):

        console=ttyS0,115200n8
        

Conclusion: While `getty` itself remains available, its usage is less visible due to the adoption of `systemd` and modern service management practices. For managing serial lines or virtual terminals in RHEL 9.2, `systemd-getty` or `serial-getty` is typically used. If you are working with legacy hardware or require manual configuration, `getty` can still be deployed as needed.

[1] Daemon: A daemon is a program that waits for a request from another program. The daemon then performs the desired action, such as creating an http session, or opening and maintaining a communications socket. Some common daemons include httpd, telnetd, and ftpd.

SEMrush Software 2 SEMrush Banner 2