Skip to contentSkip to conversation

Absolute Mouse in VNC and debug ports patch

Qemu-devel Gerhard Wiesinger 2 participants 4 messages Apr 2, 2010 – Apr 5, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

This is my first contribution to QEMU: I've written a virtual piece of hardware (e.g. ports) that the mouse pointer can be used as an absolute pointing device even with non USB devices, e.g. with DOS and doesn't need any high memory usage USB driver. This is necessary for e.g. VNC remote access, this was my primary motivation.

To use it you need a mouse driver (e.g. cutemouse, http://cutemouse.sourceforge.net/) and an QEMU mouse TSR.
Further the mouse TSR emulates also a HP-HIL 45911 tablet digitizer. This device has been chosen because an Interrupt interface exists at INT 6Fh and therefore it is relativly easy to emulate (all other devices I've evaluated use the serial port and are therefore much more complex to emulate) and I think it was also common at DOS times. Original hardware can be found at:
http://www.hpl.hp.com/personal/Tom_Malzbender/papers/tablet_highres.pdf
http://oopweb.com/Assembly/Documents/InterList/Volume/INTERRUP.Q

Defined INT 6Fh functions:
1.) ah=08h, bp=2Ah (driver ID), V_SINPUT
http://www.ctyme.com/intr/rb-7715.htm
2.) ah=06h, bp=2Ah (driver ID), V_SINPUT
http://www.ctyme.com/intr/rb-7709.htm
3.) ah=02h, al=04h, bp=BAh (driver ID), C_LTABLET
http://www.ctyme.com/intr/rb-7646.htm
4.) ah=06h, bp=BAh (driver ID), C_LTABLET
http://www.ctyme.com/intr/rb-7707.htm

TSR and qemu patch can be found at, attached too:
http://www.wiesinger.com/opensource/qemu/qemu-0.12.3-absolutemouse-V6.patch
http://www.wiesinger.com/opensource/qemu/qemumous.com

Usage:
1.) Apply patch to QEMU 0.12.3
2.) Load cutemouse 1.91alpha
3.) Load qemumous.com
4.) Enjoy it :-)

ASM source code of the TSR will be released too in few days, needs some cleanup/review.

Further I've written a simple logging debug ports functionality to debug the driver. It enables also simple "delta" debugging, where only state changes are logged. Example can be seen in the QEMUMOUS.ASM source code (will be released in few days).

Added switches:
-absolute-mouse Proprietary pointer device that uses absolute coordinates (like a touchscreen)
with VNC for e.g. DOS. This means qemu is able to report the mouse position without having to grab the mouse. Needs a DOS TSR to emulate the mouse. DOS TSR also emulates a HP-HIL 45911 Tablet using INT 6Fh.
Also overrides the PS/2 mouse emulation when activated.
-debugports Enables debug ports which can be used by drivers or DOS TSR programs.
Look at the code of the absolute-mouse DOS TSR for examples.

Status is: mouse event queing implemented, tested and works for me.
Open issues: TSR might be a full mouse driver (e.g. integrate in cutemouse) instead of patching just few INT33h functions.

Any feedback is welcome. Maybe after review you can integrate the patch in the GIT repository.

Thanx.

Ciao,
Gerhard

--
http://www.wiesinger.com/

#1 lore raw
Quoted 5 lines

This is my first contribution to QEMU: I've written a virtual piece of hardware (e.g. ports) that the mouse pointer can be used as an absolute pointing device even with non USB devices, e.g. with DOS and doesn't need any high memory usage USB driver. This is necessary for e.g. VNC remote access, this was my primary motivation.

Why not just use the existing vmmouse?

Quoted 6 lines

To use it you need a mouse driver (e.g. cutemouse,
http://cutemouse.sourceforge.net/) and an QEMU mouse TSR. Further the mouse TSR emulates also a HP-HIL 45911 tablet digitizer. This device has been chosen because an Interrupt interface exists at INT 6Fh and therefore it is relativly easy to emulate (all other devices I've evaluated
use the serial port and are therefore much more complex to emulate)

However emulating an actual tablet connected to the serial port means you don't need any custom guest software.

Quoted 2 lines

Further I've written a simple logging debug ports functionality to debug the driver

This looks a lot like the existing isa-debugcon.

Paul

#2 lore raw
Quoted 8 lines · Paul Brook
Quoted 5 lines

This is my first contribution to QEMU: I've written a virtual piece of hardware (e.g. ports) that the mouse pointer can be used as an absolute pointing device even with non USB devices, e.g. with DOS and doesn't need any high memory usage USB driver. This is necessary for e.g. VNC remote access, this was my primary motivation.

Why not just use the existing vmmouse?

First I didn't know that QEMU has already implemented vmmouse. I'm very new to QEMU. After looking at the code vmmouse requires 386 instructions in the DOS driver to access the 32 bit port access (eax, ebx, etc.) which might be problematic in real mode. and even on 286 (don't know whether this is relevant or not). Further protocol is a little bit more complex to implement in Assembler in the DOS TSR and therefore performance would be lower (DOS polls the mouse, no standard event or interrupt based system specified).

Quoted 9 lines
Quoted 6 lines

To use it you need a mouse driver (e.g. cutemouse,
http://cutemouse.sourceforge.net/) and an QEMU mouse TSR. Further the mouse TSR emulates also a HP-HIL 45911 tablet digitizer. This device has been chosen because an Interrupt interface exists at INT 6Fh and therefore it is relativly easy to emulate (all other devices I've evaluated
use the serial port and are therefore much more complex to emulate)

However emulating an actual tablet connected to the serial port means you don't need any custom guest software.

But I thing it is only relevant for very old software like DOS. Every modern OS has USB on board and therefore the USB tablet emulation is IHMO sufficient and works well. The guest software could also be implemented as option rom (~2k), then no TSR would be necessary. As the typical use case is for DOS I don't see any relevant problems here because resident TSR size is very small (~2k) and common practice in DOS. BTW: is it possible to load more than one option ROM at a time, e.g. SCSI and another?

Quoted 6 lines
Quoted 3 lines

Further I've written a simple logging debug ports functionality to debug the driver

This looks a lot like the existing isa-debugcon.

Is this in the development tree only? I had only a look at the stable release and didn't find anything.

Ciao,
Gerhard

--
http://www.wiesinger.com/

#3 lore raw
In reply to Paul Brook
Quoted 15 lines · Paul Brook
Quoted 5 lines

This is my first contribution to QEMU: I've written a virtual piece of hardware (e.g. ports) that the mouse pointer can be used as an absolute pointing device even with non USB devices, e.g. with DOS and doesn't need any high memory usage USB driver. This is necessary for e.g. VNC remote access, this was my primary motivation.

Why not just use the existing vmmouse?

Quoted 6 lines

To use it you need a mouse driver (e.g. cutemouse,
http://cutemouse.sourceforge.net/) and an QEMU mouse TSR. Further the mouse TSR emulates also a HP-HIL 45911 tablet digitizer. This device has been chosen because an Interrupt interface exists at INT 6Fh and therefore it is relativly easy to emulate (all other devices I've evaluated
use the serial port and are therefore much more complex to emulate)

Quoted 3 lines

However emulating an actual tablet connected to the serial port means you don't need any custom guest software.

Hello Paul,

There is another reason: I'm using interrupts, therefore the Guest OS must not poll (except DOS, where the Mouse interface is a polling one).

Ciao,
Gerhard

--
http://www.wiesinger.com/