Tim Waugh wrote:

> On Thu, Apr 13, 2000 at 09:55:46PM +0100, Bryan Meredith wrote:
>
> > But, if we emulate a port, where does the port send the data that passes
> > into it and where does the port get the data to pass back? Are we now
>
> How about /dev/parport0?  Or, if it looks like printer protocol, /dev/lp0,
> if you want just unidirection data.  Or pipe it to lpr if you want to
> pretend you have a PostScript printer when you don't.
>
> For parallel ports, I believe that the port is the thing to emulate.  For
> IDE disks, say, perhaps the disk is a better thing to emulate.  They are
> different problems -- IDE disks are all supported by the host if the IDE
> controller is supported.  It's not the same for parallel port devices, and
> one of the useful things about a virtual machine is that you can use a
> guest OS that has drivers your host OS doesn't.
>

Agreed

I was just about to write about 'what do we do when there is strange handshaking
going on' when I thought that I'd better go see the kernel source (as
suggested).
I didn't realise that there was so much control available through IOCTL in the
lp device!
I am already using the pipe to lpr to emulate both a postscript printer and a
plain text printer. I was pondering how to bring about the raw mode passthrough
with the associated handshaking. There doesn't appear to be a similar interface
available for the parport device (ready to be slapped and pointed in right
direction).

I am still concerned about timing issues though as the guest will write to a
port // context switch // user emulation passes port info into parport device //
context switch // port info written to device and so on all the way back again.
Hmmmmm. This is one that will stand a bit of real life testing methinks. Unless
of course we grab the ports themselves and the irq away from the driver and
allow the emulation to play with the real thing. Hmmmmm again...


>
> Incidentally, this is how VMware does it (or will when they get round to it),
> and I wrote some of the code they ship, after some suggestions from them.
> Check out vmppuser, and notice how similar it is to the ppdev code in 2.3...
>

I haven't got the source for 2.3 yet - I'm waiting for it to become 2.4 ;-)

Bryan

Reply via email to