commit 73d8de9d91b774ab3f8de4843fb3f53f8374eea5
Author: richardg867 <richardg867@gmail.com>
Date:   Tue Apr 14 00:58:59 2026 -0300

    Serial device overhaul (#7051)
    
    * Initial work on character device API
    
    * Some comment clarifications
    
    * More character device work, serial hookup, stdio backend
    
    * More character backend work, now compiles and runs on Linux
    
    * More work on hostser and stdio backends
    
    * More work on stdio backend, now supports piped stdin on Windows
    
    * Handle Windows comm errors on hostser backend
    
    * Getting some character device stuff out of the way
    
    * Character API overhaul to match existing LPT
    
    * Apply 86Box/86Box@1f23c8f
    
    * Small ifdef fix
    
    * Add loopback plug character device
    
    * Fix delayed serial control line updates to character devices
    
    * Some cleanups to stdio device
    
    * Character device branch side of the serial settings overhaul
    
    * Port the serial device config UI
    
    * Refactor character device names to remove `host` dependency
    
    * Improve character device names
    
    * Char status flag cleanups
    
    * Host serial code cleanups
    
    * Fix incorrect handling of RI trailing edge bit
    
    * Use macro to check for fd validity in a cross-platform manner
    
    * Named pipe / UNIX socket character device
    
    * Fix non-Windows build
    
    * Manager: Pass -D and fix serial console window spawning in started VMs
    
    * Set Windows debug console title to the VM name
    
    * Don't input NUL on Windows console events with no ASCII mapping
    
    * Properly fire MSR interrupts on character device status line updates
    
    * Don't look for Linux termios headers on Windows
    
    * Additional treatment for named pipe paths on Windows
    
    * Clean up serial passthrough port config code
    
    * Initial work on instantiating character devices
    
    * Fix character device names in settings
    
    * Finish hooking up the character devices
    
    * Unified internal names for character devices
    
    * Initial work on pty mode with terminal spawning
    
    * Further progress with pty terminal spawning
    
    * Auto/client/server mode selection for pipe backend
    
    * De-ssize_t the character device API
    
    * Remove old serial passthrough code
    
    * Fix Linux build
    
    * Fix spamming of named pipe config sections during migration
    
    * Fix Linux build
    
    * Automatic reconnection for serial and pipe
    
    * Error reporting for serial passthrough
    
    * Fix Linux serial passthrough
    
    * Fix warning
    
    * Configuration for stdio backend
    
    * Add actual port names to character device logging and errors
    
    * Harmonize stdio raw input enable code with serial
    
    * Fix vcon->pty migration
    
    * Add stream gobbler for terminal emulator mode
    
    * Remove stream gobbler and fix old shell-based approach
    
    * New script-based terminal launch method with macOS window title shenanigans
    
    * Custom command execution for stdio
    
    * Remove old serial terminal ifdef
    
    * Fix custom command mode
    
    * plat_run_command for SDL (code tested in isolation)
    
    * Add xdg-terminal-exec support for spawning terminal
    
    * Prioritize xdg-terminal-exec/x-terminal-emulator
    
    * Fix memory leak
    
    * Some more readability fixes
    
    * More LPT character device prep work
    
    * Small fix
    
    * Revert config to default custom command if blank
    
    * Use portable CLOEXEC method
    
    * Unix pipes
    
    * Update serial passthrough status even if no fd is present
    
    * Detect multiple consoles on Windows
    
    * Change file backend error messages
    
    * Fix stdio segfault on exit
    
    * Improve reconnection control
    
    * Fix build
    
    * Small improvement to named pipe config migration
    
    * Console window title on Windows
    
    * Disable character device logging
    
    * clang-format the new files
    
    * Improvements to pipe direction autodetection
    
    * More improvements to pipe direction autodetection
    
    * Move pipe path generation to device init
    
    * Rework Windows pipe initialization to mitigate hard reset race condition in auto mode
    
    * Use blocking I/O for Windows pipes
    
    * Mitigate Windows pipe race condition when hard resetting in auto mode
    
    * Make serial reconnect on status as well
    
    * Log API: Restore prefixing on log_out and make prefixing more efficient
    
    * Log API: Declare dummy macros on release builds
    
    * Improve some header descriptions
    
    * Improve serial port initialization
    
    * Improve serial port initialization, and make passthrough port configuration actually work
    
    * Keep serial port config cached
    
    * Open pty with O_NOCTTY as well
    
    * Disable serial passthrough logging
    
    * Fix pty terminal command typo
    
    * Small bounds check improvement
    
    * plat_get_cpu_string cleanups
    
    * Improve serial port enumeration
    
    * Finish removing the \\.\ prefix from Windows serial ports
    
    * Fix label warning

 src/86box.c                                 |  35 +-
 src/CMakeLists.txt                          |   2 +
 src/char/CMakeLists.txt                     |  42 ++
 src/char/char.c                             | 145 ++++++
 src/char/char_file.c                        | 261 ++++++++++
 src/char/char_loopback.c                    | 250 +++++++++
 src/char/char_pipe.c                        | 467 +++++++++++++++++
 src/char/char_serial.c                      | 774 ++++++++++++++++++++++++++++
 src/char/char_stdio.c                       | 518 +++++++++++++++++++
 src/config.c                                |  71 ++-
 src/device.c                                |  22 +-
 src/device/CMakeLists.txt                   |   1 -
 src/device/serial.c                         |  63 ++-
 src/device/serial_passthrough.c             | 376 --------------
 src/include/86box/86box.h                   |   3 +
 src/include/86box/char.h                    | 152 ++++++
 src/include/86box/device.h                  |   1 +
 src/include/86box/log.h                     |   3 +
 src/include/86box/plat.h                    |   1 +
 src/include/86box/plat_serial_passthrough.h |  38 --
 src/include/86box/serial.h                  |   5 +
 src/include/86box/serial_passthrough.h      |  67 ---
 src/qt/CMakeLists.txt                       |   2 -
 src/qt/qt_deviceconfig.cpp                  |  73 ++-
 src/qt/qt_platform.cpp                      | 237 +++++++--
 src/qt/qt_settingsports.cpp                 |  30 +-
 src/qt/qt_vmmanager_system.cpp              |   6 +
 src/qt/win_serial_passthrough.c             | 319 ------------
 src/unix/CMakeLists.txt                     |   1 -
 src/unix/unix.c                             |  65 ++-
 src/unix/unix_serial_passthrough.c          | 362 -------------
 src/utils/log.c                             |  70 +--
 32 files changed, 3110 insertions(+), 1352 deletions(-)
