[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Serial port -- OPPOSITE BUG == COMPLETE SOLUTION?

From: Darryl Dixon
Subject: Re: [Qemu-devel] Serial port -- OPPOSITE BUG == COMPLETE SOLUTION?
Date: Wed, 18 Aug 2004 02:00:11 +1200

Hi All,

    Please see the attached patch.  It is diff'ed against a clean qemu-snapshot-2004-08-16_23.  What does it give me, you ask?  Well:
* Optional guest COM2 (with '-com2-serial /some/file' on the command line)
* Ability to send either the existing builtin COM1 ('-serial') or the optional COM2 to any arbitrary file, pipe, pty, or whatever that supports open() style file access semantics (although do note that it doesn't actually behave well with normal files at this point ;)

So basically if you use '-com2-serial /dev/ttyS0' on the qemu command line, any data that you send to COM2 inside the guest will automagically appear on /dev/ttyS0 on the host, and vice-versa.  One caveat; as noted earlier in this thread, there appears to be a bug in the current qemu code that uses serial_ioport_read() that is causing data sent from the guest to not get transmitted out to the host.  Data sent from the host works OK, but the reverse appears to be broken at the moment (at least in my snapshot).  Once the bug is fixed in the guts of the serial emulation this patch should work 100% with no further modification.

This is really quite a trivial, non-intrusive patch, so any recent snapshot should work, but not qemu-0.6.0 as there seems to have been some significant improvements in the serial code since then (thanks guys! :).


On Tue, 2004-08-17 at 12:23, Nile Geisinger wrote:
Hi Darryl.

How funny! We not only appear to be working on the same problem, we also 
appear to each have solved the half of the problem the other person is 
struggling with. 

At the moment, I can successfully send data without any difficulty from the 
GUEST to the HOST, but am only able to read it from host to guest 
intermittently. I've been tearing my hair out trying to figure this out. From
your emails, it appears that you can successfully send from HOST to
GUEST without any troubles, but cannot get any data from the
guest to the host.

It's late here, but I'll put together a patch first thing tommorow
and send it to you. If you do the same with your work, I suspect we'll
put together a complete solution in short order.



On Tuesday 17 August 2004 6:26 am, Darryl Dixon wrote:
> Hi All,
>     I've been working on the latest snapshot's serial code and it
> appears that there is some sort of bug that is preventing data sent by a
> guest from making out to the host.  For example, if one connects the
> builtin serial port (com1 or /dev/ttyS0) to stdio with '-serial stdio'
> then if you connect something like minicom or hyperterm to the
> appropriate port in the guest, you can see anything you type into the
> console (STDIN) of the host appearing correctly in the guest.  However,
> if you send some data down the line from inside the guest, nothing
> 'comes out' at the host end (on STDOUT, in this example).  I have also
> connected the host end of the pipe to a psuedo-terminal slave and the
> same behaviour is present; anything cat-ed (or whatever) to the pty on
> the Host appears on the serial port of the guest, but the reverse is not
> true...
>     I have verified that the data sent from the guest is indeed being
> read and it appears inside the serial_ioport_read() function
> successfully, but tracing it onwards from there appears to take me deep
> into the guts of qemu's machine emulation model and I'm not really
> enough of an uber-hacker to follow it from there without spending
> serious amounts of time...
>     Can anyone shed some light on this apparent bug, or perhaps point me
> in the right direction to trace it further than serial_ioport_read() and
> its entry into the ioport_table ?
> Cheers,
> D
> On Mon, 2004-08-16 at 12:13, Darryl Dixon wrote:
> > Hi,
> >
> >     Whereabouts would I start looking to find the 'glue' code that
> > connects the emulation of the guest's serial port with the 'real'
> > world?  I've looked briefly at serial.c but it only seemed to deal
> > with the guts of the emulation, rather that directing its output...
> > (maybe I'm just being thick and missing the obvious?)  Any pointers
> > and help to send me in the right direction appreciated.
> >
> > Cheers,
> > --
> > Darryl Dixon <address@hidden>
> >
> > ______________________________________________________________________
> >
> > _______________________________________________
> > Qemu-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/qemu-devel
Darryl Dixon <address@hidden>

Attachment: com2_serial.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]