Serial Port debugging is often used in system kernel development. Using VMware's virtual machine is even more powerful for system kernel debugging. So how to build a serial port debugging environment? Because recent work involves this aspect, it is a bit rewarding to use powerful Google search and a bit of exploration, and I will share it with you.
Virtual Machine has three serial port debugging technologies, which can be found on the serial port configuration interface:
1. Use physical serial port refers to the serial port of the physical machine. This method is used when the serial port box is used to connect to another computer.
2. Use output file: output the serial port data to a file on the host. This method is simple and convenient when you only need to view the output result.
3. Use named pipe to output the serial port to the named pipeline. The named pipeline can be readable and writable, and can interact with each other and perform some debugging work, instead of simply looking at the results.
Because the first two methods are relatively simple and easy to use, the third method is named pipe debugging. Named Pipes are a method of inter-process communication (IPC) in Linux. Two processes can exchange data through read/write pipelines. This is the use of this technology, by binding the serial port to a famous Pipeline, the reading and writing of the famous Pipeline to exchange serial data. There are also two ways: 1. Between the host machine and the virtual machine, 2. On the same host machine, the two virtual machines are bound to a famous pipe on the same host machine. The key to the problem is how to bind the serial port of the virtual machine to a famous pipe of the host machine, while the first method requires finding a way for the host to read and write famous pipelines for interaction, after a while, Google finally found the tool that was successfully tested on Linux and Windows respectively.
In Windows, the famous pipe path //. /pipe/namedpipe. Of course, you can specify other hosts such as // 192.168.1.10/pipe/namedpipe. in Linux,/tmp/mypipe is enough. After creating a famous Pipeline, you can interact with the pipeline. Currently, neither windows nor Linux does seem to have a tool that can directly read and write famous pipelines. The two tools I have found are to bind famous pipelines to sockets, indirectly read and write pipelines through the read/write socket.
Next I will briefly introduce how to configure in Windows and Linux:
Linux host:
Host ~ Virtual Machine
1. Configure VM
A. Add hardware-> serial port
B. Using Named Pipe
C./tmp/isocket
D. This end is Server & far end is application
E. Check yield CPU on Poll
F. Start Virtual Machine
2. socat/tmp/isocket tcp4-listen: 9001 &
/Tmp/socket: VMWare call it 'named piped', actually it is Unix daemon socket, so you shouldn't use pipe:/tmp/socket
3. Telnet 127.0.0.1 9001
Trouble Shoot: Sometimes the Connection closed by foreign host is incorrect, or when telnet is enabled, socat can exit. It is likely that you do not have a power on VM, and the famous Pipeline has not been created yet, you can use socat to create a file named isocket, but it is only a common file. For details, see socat help.
Start virtual machine first, than run the socat, and telnet
(Note you must have permission to all resource,/tmp/socket, Vm and so on)
Vritual machine ~ Virtual Machine
1. Configure VM
A. Add hardware --> serial port
B. Using Named Pipe, configure/tmp/isocket
C. This end is Server & far end is Virtual Machine
D. Check yield CPU on Poll
E. Start VM
2. Another VM
A. Add hardware --> serial port
B. Using Named Pipe, configure/tmp/isocket
C. This end is client & far end is Virtual Machine
D. Check yield CPU on Poll
E. Start VMS
Windows Host:
Host ~ Virtual Machine
1. Configure VM
A. Add hardware --> serial port
B. Using Named Pipe
C. //./pipe/vmwaredebug
D. This end is client & far end is application
E. Check yield CPU on Poll
2. Using 3rd-party tool to communicate with Named Pipe
A. Down the tool
B. Install Service
CMD> vmwaregateway.exe/R
C. Start Service
C:/> Net start vmwaregateway
D. Telnet 127.0.0.1 567.
3. Start Virtual Machine
If you are using the vmwaregateway.exe tool, the pipe name here must be vmwaredebug, unless you download its source code and modify it yourself.
Vritual machine ~ Virtual Machine
1. Configure VM
A. Add hardware --> serial port
B. Using Named Pipe, //./pipe/vmwaredebug
C. This end is Server & far end is Virtual Machine
D. Check yield CPU on Poll
E. Start VM
2. Another VM
A. Add hardware --> serial port
B. Using Named Pipe, //./pipe/vmwaredebug
C. This end is client & far end is Virtual Machine
D. Check yield CPU on Poll
E. Start VMS
The above methods can basically work on Linux (Ubuntu 8.04/9.10), Windows (XP, 2003), VMWare player3.0, and VMware Server 2.0, although the user experience is good for windows. The VM is easy to implement, that is, you have to open two virtual machines at the same time. On Windows, the client VM is Linux and is connected to the serial port using gtkterm, it is a little troublesome to run the interface to the client VM.
Although writing articles is similar to that, it may be messy to write a summary of your own technologies. If this is not the case, please correct me or leave a message to discuss it.