Virtual serial port emulator linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Virtual serial port driver for Linux

License

anszom/vtty

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Virtual Serial Port driver for Linux

This kernel module allows userspace programs to create virtual serial ports under /dev/ttyV#.

This is somewhat similar to the regular pseudo-tty interface, but vtty also emulates characteristics such as baud rate & modem line state. This allows users to create a fully-functional serial port driver completely in userspace.

  • forward a serial port over the network. There are several Linux implementations of a RFC2217 server. VTTY allows you to write a RFC2217 client exposing a native-looking serial port to other software.
  • quickly prototype a driver for an USB-to-serial converter using VTTY & libusb
  • split one physical serial port in two, allowing two apps to access it without conflict (for example gdb & minicom, or esptool & minicom)

The module creates a /dev/vtmx «master» device, which is used to create the virtual serial ports in a manner similar to the pseudo-tty master device /dev/ptmx. Opening the /dev/vtmx device causes a /dev/ttyV# device to be allocated. The index of the virtual port can be obtained by issuing a VTMX_GET_VTTY_NUM (equal to TIOCGPTN) ioctl on the vtmx file descriptor.

Читайте также:  Get file creation date linux

Any writes on the vtmx file descriptor will appear as incoming data on the virtual TTY, subject to the regular in-kernel processing (line disciplines, echoing, and so on). Reading from vtmx will return data in a «packetized» format, inspired by the obscure pseudo-tty «packet» mode. On each successful read() call, the first byte returned will indicate the type of packet returned.

Currently supported packet formats:

  • TAG_UART_RX (0), followed by the «serial port» data coming in from the virtual TTY (processed by the kernel as usual)
  • TAG_SET_TERMIOS (1), followed by a ‘struct termios2’ structure representing the serial port configuration requested on the virtual TTY (TCSETS/TCSETS2)
  • TAG_SET_MODEM (2), followed by a 32-bit integer representing the modem line state requested on the virtual TTY (TIOCMSET/TIOCMBIC/TIOCMBIS)
  • TAG_BREAK_CTL (3), followed by a 32-bit integer representing the requested «break» state. A «break» state is a special condition on the serial port, during which the «low» signal state is sent for a period longer than the byte duration. A positive number indicates the duration of the requested break state (in milliseconds). Negative numbers indicate a request to set the break state indefinitely. Zero terminates the break state.

The master side can also use the VTMX_SET_MODEM_LINES ioctl (equal to TIOCMSET) to manipulate the modem line state of the virtual serial port. Only the «input» lines (such as CTS) can be changed this way. If the master process needs to change the «output» lines (such as RTS), it needs to open the ttyV# device and issue the regular tty ioctls there.

The test/ directory contains testing/example apps demonstrating the use of the interface.

Most of the functionality of VTTY is inspired by and follows the PTY interfaces. Most notable differences include:

  • The «master» side of the pseudo-tty is a tty. I’m not really sure why and what would be the reason to (for example) configure the line discipline on the master side. After all, it’s only used to read & write some bytes. In VTTY, the master side is a simple character device.
  • PTY does not inform the master of the «termios» settings on the slave
  • PTY does not support setting modem lines on the slave
  • VTTY reads on the master side return the data prefixed with a «tag» byte. This is similar to the (rarely used) «packet» mode of the pseudo-ttys.
  • PTY supports locking/unlocking access to the pseudo-tty using TIOCSPTLCK. This is not supported in VTTY
Читайте также:  Csgo server linux ubuntu

Any kinds of flow control were not tested. I assume that XON/XOFF will not work.

The module is mostly stable, but I wouldn’t recommend running it on any «important» systems. I wouldn’t be surprised if there were some subtle locking bugs remaining (the linux tty layer is. complex).

Also see FIXME/TODO markers in the source code.

Some tty ioctls are not supported (notably TIOCMIWAIT & TIOCGICOUNT).

tty0tty emulates pairs of serial ports, connected in a null-modem fashion. The modem status lines are properly emulated, but the «termios» settings are not.

About

Virtual serial port driver for Linux

Источник

Linux null-modem emulator

tty0tty is a kernel-module virtual serial port driver for Linux.

The Linux null-modem emulator (tty0tty) is a kernel-module virtual serial port driver for Linux. This create virtual tty ports pairs and use any pair to connect one tty serial port based application to another.
There are a version using pseudo-terminal (UNIX 98 style).

Project Activity

Categories

License

Follow Linux null-modem emulator

Open LMS is Open Source at its core. Migrating to Open LMS is simple and easy.

As the largest commercial provider of hosting and support services for the open-source Moodle™ learning platform, we help organizations and institutions deliver great learning experiences without complexities

User Ratings

User Reviews

Additional Project Details

Operating Systems

Programming Language

Registered

Serial to Ethernet Connector is a stable software product developed by Electronic Team Inc. and has been available commercially for over a decade. The application lets you create multiple virtual COM ports on a machine with no physical serial interfaces. This virtual serial port redirector.

Thinfinity® Workspace 7 is a comprehensive, secure platform that offers a zero-trust approach, enabling secure and contextual access to corporate virtual desktops, virtual applications, internal web apps, SaaS, and files, whether they are on Windows, Linux, or mainframes. It supports various.

The SuperPuTTY window manager for putty sessions. SuperPuTTY is a Windows-based application that manages putty ssh terminals. Additionally, it has a simple scripting language for basic tasks. It additionally supports RDP sessions. SuperPuTTY is used primarily as a window manager and.

Источник

Virtual Serial Port Driver for Linux (VSPDL)

VSPDL is distributed as a gzipped TAR archive and RPM package. System requirements and the installation procedure can be found here.

VSPDL

This release was tested in CentOS 6.3, Mandriva 2011, OpenSuse 12.1, OpenSuse 12.2, Debian 6.0.6, Ubuntu 12.04, and Mageia 4.5.

Note: you don’t need x86_64 for now, it is binary-compatible.

System-specific notes

# first: set up kernel headers for building modules yum install kernel-devel # second: install VSPDL RPM yum install ./vspd-.rpm # Linux kernel development headers are installed into # /usr/src/kernels/ # preapre path for VSPDL cd /usr/src/; ln -s ./kernels/ ./linux-`uname -r`
# STEP 1.0: install default kernel and reboot yast -i kernel-default reboot # STEP 1.1: set up kernel sources for external modules yast -i kernel-source yast -i kernel-syms # STEP 1.2: prepare linux source tree cd /usr/src/ cp -f ./linux-obj/`uname -i`/default/.config ./linux/ cp -f ./linux-obj/`uname -i`/default/Module.symvers ./linux/ ln -s ./linux ./linux-`uname -r` ----------------- comment # for my OpenSuse 12.1: $ uname -a Linux linux-wh6q 3.1.10-1.16-default #1 SMP Wed Jun 27 05:21:40 UTC 2012 (d016078) i686 i686 i386 GNU/Linux $ ls -l total 20 lrwxrwxrwx 1 root root 17 Jan 11 05:27 linux -> linux-3.1.10-1.16 drwxr-xr-x 24 root root 4096 Jan 11 07:40 linux-3.1.10-1.16 lrwxrwxrwx 1 root root 19 Jan 11 05:33 linux-3.1.10-1.16-default -> ./linux drwxr-xr-x 3 root root 4096 Jan 11 05:31 linux-3.1.10-1.16-obj drwxr-xr-x 3 root root 4096 Jan 11 05:31 linux-obj drwxr-xr-x 8 root root 4096 Jan 10 09:30 packages ----------------- comment / # STEP 1.3: finilize cd /usr/src/linux/ make oldconfig && make modules_prepare # STEP 2.0 install VSPDL RPM (or tar if you wish) yast -i ./vspd-.rpm # STEP 3.0 install VSPDL cd /usr/local/vspd--dist ./install.sh /usr/local/vspd # STEP 4.0 (optional) depmod
# STEP 1.0 apt-get install linux-headers-`uname -r` apt-get install gcc apt-get install make # STEP 2.0 unpack and install vspd-.tar.gz # STEP 3.0 (for 64bit only) # for 64bit system you may need to install lib32stdc++6: apt-get install lib32stdc++
# STEP 1.0 (optional, usually it's already installed in Debian) apt-get install linux-headers-`uname -r` apt-get install gcc apt-get install make # STEP 2.0 unpack and install vspd-.tar.gz # STEP 3.0 (for 64bit only) # for 64bit system you may need to install lib32stdc++6: apt-get install lib32stdc++
# Mandriva 2011 placed it's development-ready kernel source into /usr/src/devel/linux-`uname -r` # prepare system urpmi kernel-(yourkernelname)-devel cd /usr/src/devel/`uname -r`/ make oldconfig && make modules_prepare # So you need to set up a symbolic link before running install.sh: ln -s /usr/src/devel/`uname -r` /usr/src/linux-`uname -r`
# prepare system urpmi kernel-(yourkernelname)-devel cd /usr/src/devel/`uname -r`/ make oldconfig && make modules_prepare # you need to set up a symbolic link before running install.sh: ln -s /usr/src/devel/`uname -r` /usr/src/linux-`uname -r`
# need to install CURRENT kernel headers first: pacman -S linux-headers # choose the version that is the same to your current kernel. # for example, Manjaro 20.2 is running on kernel-5.9.xxx, so choose linux59-headers # need gcc and make too. pacman -S gcc pacman -S make # create the standard path to kernel headers ln -s /lib/modules/`uname -r`/build/ /usr/src/linux-headers-`uname -r | tr A-Z a-z`

Источник

Оцените статью
Adblock
detector