Virtual Serial Port
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
Thanks,
Mikado.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEJYK3NWc9T2Wr2JcRAro+AKCMMf5So3sPJ+gXzSN+eYk0RXBxsQCg2V6I UK2pvLjQIECVc3e1//7d0WE=
=GroY
-----END PGP SIGNATURE-----
Quoted 4 lines
My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
You could write a device driver implementing virtual serial ports. Then you just add an ioctl that connects/disconnects virtual ports to real ports if desired.
I do not quite see what this would be good for, but I am sure it's good for learning or for fun. :)
Jan Engelhardt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 5 lines
You could write a device driver implementing virtual serial ports. Then you just add an ioctl that connects/disconnects virtual ports to real ports if desired.
I do not quite see what this would be good for, but I am sure it's good for learning or for fun. :)
Hi Jan Engelhardt,
My purpose is to provide serial interfaces for debugging. My real box acts as remote host connecting to VMWare box by a *virtual* serial cable so that I can set up a debugging environment.
There are several solutions for this problem but they could only run on Windows. Eg:
- - http://www.mks.zp.ua/vspdxp.php
- - http://www.virtual-serial-port.com/virtual-serial-port-kit.html
I'll buy an USB-to-Serial cable and a Serial-Serial cable to solve this problem but it's also interesting for me to write such device driver. I'll try it later.
Mikado
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEJfshNWc9T2Wr2JcRAhPwAJ9d/eifASrLPvJwOy6A4sSxgzMc0gCcChrG rSL3gqaTWernckeKhfc+wqY=
=wIb+
-----END PGP SIGNATURE-----
Quoted 3 lines · Mikado
My purpose is to provide serial interfaces for debugging. My real box acts as remote host connecting to VMWare box by a *virtual* serial cable so that I can set up a debugging environment.
Have you tried using software-based serial snoopers? See e.g.
http://freshmeat.net/snooper and
http://packages.debian.org/unstable/comm/snooper. Haven't tried any of these but they seem to do what you describe.
Regards,
--
Anderson Lizardo
Embedded Linux Lab - 10LE
Nokia Institute of Technology - INdT
Manaus - Brazil
Quoted 5 lines
My purpose is to provide serial interfaces for debugging. My real box acts as remote host connecting to VMWare box by a *virtual* serial cable so that I can set up a debugging environment.
[snip]
Quoted 2 lines
Mikado
I wonder if either ptyp/ttyp or pts/ interfaces would suit your purpose. They are
supposed to appear on one side to be virtual serial ports.
Quoted 10 lines
Quoted 5 lines
You could write a device driver implementing virtual serial ports. Then you just add an ioctl that connects/disconnects virtual ports to real ports if desired.
I do not quite see what this would be good for, but I am sure it's good for learning or for fun. :)My purpose is to provide serial interfaces for debugging. My real box acts as remote host connecting to VMWare box by a *virtual* serial cable so that I can set up a debugging environment.
Ah! You don't want to have the X11 overhead of VMware. Quite an idea. If I get it right, your setup looks like:
guest writes to /dev/ttyS0
vmware connects its virtual S0 to the host's ttyFakeS0 minicom on the host to ttyFakeS0
or even
vmware S0 to host's ttyS0
other remote machine do minicom to ttyS0
The reason for FakeS0 is that vmware does not know about ptys, unfortunately.
Jan Engelhardt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 9 lines
guest writes to
/dev/ttyS0
vmware connects its virtual S0 to the host's ttyFakeS0 minicom on the host to ttyFakeS0
or even
vmware S0 to host's ttyS0
other remote machine do minicom to ttyS0The reason for FakeS0 is that vmware does not know about ptys, unfortunately.
Yes, VMWare doesn't support serial port using host's ttys any more. My idea is:
[host - application] <- read/write -> [virtual serial port /dev/ttyFakeS0] <- read/write over virtual null-modem serial cable -> [host - real serial port /dev/ttyS0] <- read/write -> [VMWare - application]
But today I've just bought an USB-to-Serial converter and made for myself a null-modem serial cable. I use this null-modem cable to connect /dev/ttyS0 (native serial port) to /dev/tts/USB0 (USB-based serial port). My VMWare now can use one of those devices and the host use another one. Now above figure can be re-drawn like this:
[host - application] <- read/write -> [/dev/tts/USB0] <- read/write over physical null-modem cable -> [/dev/ttyS0] <- read/write -> [VMWare - application]
Anyway, later I'll try to write a device drivers act as virtual serial ports and virtual null-modem cables.
Best regards,
Mikado.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEJsrfNWc9T2Wr2JcRAl05AJ9Ee8zqagf0yjDk71mFAxwSskFltQCg0aM8 mELZ8uxHPaSYzLiZLM7Cxy4=
=zI/+
-----END PGP SIGNATURE-----
Quoted 14 lines · Mikado
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 8 lines
guest writes to
/dev/ttyS0
vmware connects its virtual S0 to the host's ttyFakeS0 minicom on the host to ttyFakeS0
or even
vmware S0 to host's ttyS0
other remote machine do minicom to ttyS0The reason for FakeS0 is that vmware does not know about ptys, unfortunately.
Quoted 6 lines
Yes, VMWare doesn't support serial port using host's ttys any more. My idea is:
[host - application] <- read/write -> [virtual serial port
/dev/ttyFakeS0] <- read/write over virtual null-modem serial cable -> [host - real serial port/dev/ttyS0] <- read/write -> [VMWare - application]
Although it is quite irrelevant to LKML (you may want to visit www.vmware.com/community/index.jspa and ask there...), you can connect guest's serial port also to Unix socket - and in such situation you need virtual serial port driver only if 'host - application' does not know how to use /dev/tty* (for unix socket <-> /dev/ptyp* app look at http://platan.vc.cvut.cz/ftp/pub/vmware/serpipe.tar.gz).
Petr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 7 lines · Petr Vandrovec
Although it is quite irrelevant to LKML (you may want to visit www.vmware.com/community/index.jspa and ask there...), you can connect guest's serial port also to Unix socket - and in such situation you need virtual serial port driver only if 'host - application' does not know how to use
/dev/tty*(for unix socket <->/dev/ptyp*app look at
http://platan.vc.cvut.cz/ftp/pub/vmware/serpipe.tar.gz).
Petr
Thank Petr. It also works well. That program acts as a data proxy between unix socket and /dev/ptyp*. Yesterday I wrote a similar program that read/write vmware's server unix sock then forward/backward data to/from /dev/ptyp0 but it didn't work. Maybe my program has problem. Thanks again.
Mikado
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEJ1wsNWc9T2Wr2JcRArmmAJ483BmLFrY+aIR71u/BQH+XCs8tIQCfZGs1 uTwfbeYTsFg0Iq9/FL/82I4=
=dgch
-----END PGP SIGNATURE-----
Quoted 4 lines · Mikado
My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
Will a pty suffice?
Signature · 1 line
Glynn Clements <[email protected]>
Quoted 7 lines · Mikado
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
I have a doubt... I am not sure if you can have a full working solution to make all programs run using the virtual serial ports. Because, there *might* be some programs which actually use the 'in' and 'out' instructions of the processor directly from a user space program. (After calling iopl/ioperm etc to elevate their I/O privileges to directly use the IO ports) I dont think even a kernel change can help in that case...
Is my understanding correct or am I missing something?
Quoted 17 lines
Thanks,
Mikado.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQFEJYK3NWc9T2Wr2JcRAro+AKCMMf5So3sPJ+gXzSN+eYk0RXBxsQCg2V6I UK2pvLjQIECVc3e1//7d0WE=
=GroY
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 13 lines · Holy Aavu
Quoted 4 lines
My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
I have a doubt... I am not sure if you can have a full working solution to make all programs run using the virtual serial ports. Because, there *might* be some programs which actually use the 'in' and 'out' instructions of the processor directly from a user space program. (After calling iopl/ioperm etc to elevate their I/O privileges to directly use the IO ports) I dont think even a kernel change can help in that case...
Quoted 1 line
Is my understanding correct or am I missing something?
1. Any such programs will only work with "PC-style" serial ports (8250 and compatible UARTs); they won't work with other serial hardware (e.g. multi-port serial cards). Also, such programs would require root privilege. Consequently, most programs which use serial ports limit themselves to using the /dev/tty* devices and their associated ioctl() calls.
2. You could change the iopl() system call so that it doesn't affect the IOPL bits in the EFLAGS register. Instead, you would handle the resulting exceptions, trapping attempts to access the UARTs and redirecting them to the "virtual UART" driver. The ioperm() system call would need similar modifications.
Signature · 1 line
Glynn Clements <[email protected]>
Quoted 25 lines · Glynn Clements
Quoted 13 lines · Holy Aavu
Quoted 4 lines
My machine has only one serial port. Now I want to add more *software* (virtual) serial ports. I also want to make a virtual serial cable between a real serial port and a virtual one OR between virtual ports. Is there any way to solve that problem in our universe?
I have a doubt... I am not sure if you can have a full working solution to make all programs run using the virtual serial ports. Because, there *might* be some programs which actually use the 'in' and 'out' instructions of the processor directly from a user space program. (After calling iopl/ioperm etc to elevate their I/O privileges to directly use the IO ports) I dont think even a kernel change can help in that case...
Quoted 1 line
Is my understanding correct or am I missing something?
1. Any such programs will only work with "PC-style" serial ports (8250 and compatible UARTs); they won't work with other serial hardware (e.g. multi-port serial cards). Also, such programs would require root privilege. Consequently, most programs which use serial ports limit themselves to using the
/dev/tty*devices and their associatedioctl()calls.
Quoted 6 lines
2. You could change the
iopl()system call so that it doesn't affect the IOPL bits in the EFLAGS register. Instead, you would handle the resulting exceptions, trapping attempts to access the UARTs and redirecting them to the "virtual UART" driver. Theioperm()system call would need similar modifications.
Thanks Glynn, that explains a lot!
Quoted 3 lines
--
Glynn Clements <[email protected]>