* Virtual Serial Port
@ 2006-03-25 17:49 Mikado
2006-03-25 18:47 ` Jan Engelhardt
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Mikado @ 2006-03-25 17:49 UTC (permalink / raw)
To: linux-c-programming; +Cc: linux-kernel
-----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-----
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Virtual Serial Port
2006-03-25 17:49 Virtual Serial Port Mikado
@ 2006-03-25 18:47 ` Jan Engelhardt
2006-03-26 2:23 ` Mikado
2006-03-26 16:07 ` Glynn Clements
2006-03-27 11:25 ` Holy Aavu
2 siblings, 1 reply; 12+ messages in thread
From: Jan Engelhardt @ 2006-03-25 18:47 UTC (permalink / raw)
To: Mikado; +Cc: linux-c-programming, linux-kernel
>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
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-25 18:47 ` Jan Engelhardt
@ 2006-03-26 2:23 ` Mikado
2006-03-26 3:27 ` Anderson Lizardo
2006-03-26 9:31 ` Jan Engelhardt
0 siblings, 2 replies; 12+ messages in thread
From: Mikado @ 2006-03-26 2:23 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: linux-c-programming, linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> 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-----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-26 2:23 ` Mikado
@ 2006-03-26 3:27 ` Anderson Lizardo
2006-03-26 9:31 ` Jan Engelhardt
1 sibling, 0 replies; 12+ messages in thread
From: Anderson Lizardo @ 2006-03-26 3:27 UTC (permalink / raw)
To: mikado4vn; +Cc: Jan Engelhardt, linux-c-programming, linux-kernel
On 3/25/06, Mikado <mikado4vn@gmail.com> wrote:
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-26 2:23 ` Mikado
2006-03-26 3:27 ` Anderson Lizardo
@ 2006-03-26 9:31 ` Jan Engelhardt
2006-03-26 17:09 ` Mikado
1 sibling, 1 reply; 12+ messages in thread
From: Jan Engelhardt @ 2006-03-26 9:31 UTC (permalink / raw)
To: Mikado; +Cc: linux-c-programming, linux-kernel
>> 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
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-26 9:31 ` Jan Engelhardt
@ 2006-03-26 17:09 ` Mikado
2006-03-26 18:52 ` Petr Vandrovec
0 siblings, 1 reply; 12+ messages in thread
From: Mikado @ 2006-03-26 17:09 UTC (permalink / raw)
To: Jan Engelhardt, Glynn Clements; +Cc: linux-kernel, linux-c-programming
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> 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.
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-----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-26 17:09 ` Mikado
@ 2006-03-26 18:52 ` Petr Vandrovec
2006-03-27 3:29 ` Mikado
0 siblings, 1 reply; 12+ messages in thread
From: Petr Vandrovec @ 2006-03-26 18:52 UTC (permalink / raw)
To: mikado4vn
Cc: Jan Engelhardt, Glynn Clements, linux-kernel, linux-c-programming
Mikado wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>> 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.
>
>
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-26 18:52 ` Petr Vandrovec
@ 2006-03-27 3:29 ` Mikado
0 siblings, 0 replies; 12+ messages in thread
From: Mikado @ 2006-03-27 3:29 UTC (permalink / raw)
To: Petr Vandrovec
Cc: Jan Engelhardt, Glynn Clements, linux-kernel, linux-c-programming
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Petr Vandrovec wrote:
> 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-----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-25 17:49 Virtual Serial Port Mikado
2006-03-25 18:47 ` Jan Engelhardt
@ 2006-03-26 16:07 ` Glynn Clements
2006-03-27 11:25 ` Holy Aavu
2 siblings, 0 replies; 12+ messages in thread
From: Glynn Clements @ 2006-03-26 16:07 UTC (permalink / raw)
To: mikado4vn; +Cc: linux-c-programming
Mikado wrote:
> 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?
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-25 17:49 Virtual Serial Port Mikado
2006-03-25 18:47 ` Jan Engelhardt
2006-03-26 16:07 ` Glynn Clements
@ 2006-03-27 11:25 ` Holy Aavu
2006-03-27 17:29 ` Glynn Clements
2 siblings, 1 reply; 12+ messages in thread
From: Holy Aavu @ 2006-03-27 11:25 UTC (permalink / raw)
To: mikado4vn; +Cc: linux-c-programming, linux-kernel
On 3/25/06, Mikado <mikado4vn@gmail.com> wrote:
> -----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?
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?
>
> 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-----
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-27 11:25 ` Holy Aavu
@ 2006-03-27 17:29 ` Glynn Clements
2006-03-28 5:53 ` Holy Aavu
0 siblings, 1 reply; 12+ messages in thread
From: Glynn Clements @ 2006-03-27 17:29 UTC (permalink / raw)
To: Holy Aavu; +Cc: mikado4vn, linux-c-programming
Holy Aavu wrote:
> > 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...
>
> 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.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Virtual Serial Port
2006-03-27 17:29 ` Glynn Clements
@ 2006-03-28 5:53 ` Holy Aavu
0 siblings, 0 replies; 12+ messages in thread
From: Holy Aavu @ 2006-03-28 5:53 UTC (permalink / raw)
To: Glynn Clements; +Cc: mikado4vn, linux-c-programming
On 3/27/06, Glynn Clements <glynn@gclements.plus.com> wrote:
>
> Holy Aavu wrote:
>
> > > 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...
> >
> > 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.
>
Thanks Glynn, that explains a lot!
> --
> Glynn Clements <glynn@gclements.plus.com>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-03-28 5:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-25 17:49 Virtual Serial Port Mikado
2006-03-25 18:47 ` Jan Engelhardt
2006-03-26 2:23 ` Mikado
2006-03-26 3:27 ` Anderson Lizardo
2006-03-26 9:31 ` Jan Engelhardt
2006-03-26 17:09 ` Mikado
2006-03-26 18:52 ` Petr Vandrovec
2006-03-27 3:29 ` Mikado
2006-03-26 16:07 ` Glynn Clements
2006-03-27 11:25 ` Holy Aavu
2006-03-27 17:29 ` Glynn Clements
2006-03-28 5:53 ` Holy Aavu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).