当前位置:网站首页>Using SylixOS virtual serial port, serial port free implementation system
Using SylixOS virtual serial port, serial port free implementation system
2022-08-10 21:28:00 【ScilogyHunter】
In the blog "Open the second serial port command line of the virtual machine", I talked about how to make the virtual machineThe serial port is connected to the virtual serial port or physical serial port of the Windows system.In the simulator, not all platforms have a second serial port, only bsp support is required, and at most there can only be a second serial port but not a third or fourth serial port.For an actual physical board, the number of serial ports is naturally fixed.
So, can you add any virtual serial port to SylixOS like the virtual serial port on Windows?The answer is yes, the author has recently developed a set of SylixOS virtual device related programs, one of which is to create virtual character devices.The virtual serial port is a character device, so it is natural to create a virtual serial port. In fact, the virtual character device is designed according to the character device framework, and does not care about the specific device type, and the device name can be arbitrarily specified.
Start a virtual machine and view the device list as follows. It can be seen that the system currently has only one serial port, and it has been used as a system command line.
Next, install the VCD virtual character device kernel module
Create a virtual device "dev/tty1"
Start a serial port application, the function is to return the received content as it is.At the same time, use the network debugging assistant to connect the socket of the virtual serial port, and send data to it to see if there is a response.
View the current status of the virtual device
printen command is used to dynamically enable or disable the debugging printing of the corresponding virtual device for test analysis.
This example logic diagram
Another practical scenario is: Originally, the device and the host computer are connected through the serial port for debugging, but the actual device development and the host computer development are not in the same city, so the same logical connection can be achieved with the help of virtual serial port and intranet penetration.
To sum up briefly, the virtual serial port (or any virtual character device) is installed and run as a kernel module (either a physical machine or a virtual machine, no difference), and the vcd command is provided, which can be freely created and viewed through command operations.Delete the virtual device.One end of the virtual device provides a standard device file interface, which can be called indiscriminately by applications (compared to the real device);Software such as application programs, virtual serial ports, or network-to-serial ports.The application is very flexible and convenient.
From now on, you can add as many virtual serial port devices as you like, no matter whether you are using SylixOS as a virtual machine or a physical machine, for application calls.
边栏推荐
猜你喜欢
LeetCode-36-Binary search tree and doubly linked list
【PCBA solution】Electronic grip strength tester solution she'ji
使用SylixOS虚拟串口,实现系统串口自由
直播课堂系统09--腾讯云点播管理模块(一)
内置模板市场,DataEase开源数据可视化分析平台v1.13.0发布
【实用软件】【VSCode】使用技巧大全(持续更新)
突破次元壁垒,让身边的玩偶手办在屏幕上动起来!
LeetCode-36-二叉搜索树与双向链表
姜还是老的辣,看看老战哥的老底儿和严谨劲儿
LeetCode-402-移掉K位数字
随机推荐
优化是一种习惯●出发点是'站在靠近临界'的地方
Live Classroom System 08 Supplement - Tencent Cloud Object Storage and Course Classification Management
Floating window in Auto.js
直播课堂系统09--腾讯云点播管理模块(一)
SELECT:简单的查询操作语法&使用例——《mysql 从入门到内卷再到入土》
Labelme-5.0.1 version edit polygon crash
流程控制结构——《mysql 从入门到内卷再到入土》
B. Trouble Sort
RADIUS Authentication Server Deployment Costs That Administrators Must Know
Application of Spatial 3D Model Reconstruction Based on Pix4Dmapper - Spatial Analysis and Site Selection
如何提高代码的可读性 学习笔记
The use of TortoiseSVN little turtle
PostgreSQL 介绍
C. Even Picture
Getting started with kuberentes Auditing
论文解读(g-U-Nets)《Graph U-Nets》
玩转doxygen 之RT-THREAD
apr_thread使用内存之谜
TCL:事务的特点,语法,测试例——《mysql 从入门到内卷再到入土》
In 2021 China industrial Internet security competition (competition) in fujian province and the first industry of fujian province Internet innovation competition