当前位置:网站首页>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-498-对角线遍历

apr_thread使用内存之谜

Future与CompletableFuture

【Windows】你不能访问此共享文件夹,因为你组织的安全策略阻止未经身份验证的来宾访问,这些策略可帮助保护你的电脑

C. Even Picture

Redis 性能影响 - 异步机制和响应延迟

石油化工行业商业供应链管理系统:标准化供应商管理,优化企业供应链采购流程

TCL:事务的特点,语法,测试例——《mysql 从入门到内卷再到入土》

【nvm】【node多版本管理工具】使用说明和踩坑(exit status 1)

Rider调试ASP.NET Core时报thread not gc-safe的解决方法
随机推荐
Application of Spatial 3D Model Reconstruction Based on Pix4Dmapper - Spatial Analysis and Site Selection
函数:函数删除操作语法&使用例——《mysql 从入门到内卷再到入土》
Kubernetes 笔记 / 入门 / 生产环境 / 用部署工具安装 Kubernetes / 用 kubeadm 启动集群 / 用 kubeadm 创建集群
基于Pix4Dmapper的空间三维模型重建应用——空间分析选址
GAN CFOP
优化是一种习惯●出发点是'站在靠近临界'的地方
【PCBA solution】Electronic grip strength tester solution she'ji
单选点击可取消功能
日期选择器组件(限制年份 设定仅展示的月份)
内置模板市场,DataEase开源数据可视化分析平台v1.13.0发布
PostgreSQL — 安装及常用命令
工程师应该怎么学习
LeetCode-498-对角线遍历
力扣221题,最大正方形
F. Binary String Reconstruction
【网络通信四】ping工具源码cmake工程编译以及运行说明
直播课堂系统08-腾讯云对象存储和课程分类管理
MATLAB神经网络拟合工具箱Neural Net Fitting使用方法
labelme-5.0.1版本编辑多边形闪退
Redis 性能影响 - 异步机制和响应延迟