ia64/xen-unstable

changeset 10639:5f5d400eb60a

[DOC] Add descriptions on mouse handling and how to use the USB
support that is now in the HVM device model.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 03 08:55:08 2006 +0100 (2006-07-03)
parents 9fd92e7e91a5
children ef80b6e4e03a
files docs/src/user.tex
line diff
     1.1 --- a/docs/src/user.tex	Mon Jul 03 08:52:27 2006 +0100
     1.2 +++ b/docs/src/user.tex	Mon Jul 03 08:55:08 2006 +0100
     1.3 @@ -2203,6 +2203,33 @@ ne2000 &        Enable ne2000, default =
     1.4  
     1.5  serial &        Enable redirection of VMX serial output to pty device\\
     1.6  
     1.7 +\end{tabular}
     1.8 +
     1.9 +\begin{tabular}{lp{10cm}}
    1.10 +
    1.11 +usb &           Enable USB support without defining a specific USB device.
    1.12 +This option defaults to 0 (disabled) unless the option usbdevice is
    1.13 +specified in which case this option then defaults to 1 (enabled).\\
    1.14 +
    1.15 +usbdevice &     Enable USB support and also enable support for the given
    1.16 +device.  Devices that can be specified are {\small {\tt mouse}} (a PS/2 style
    1.17 +mouse), {\small {\tt tablet}} (an absolute pointing device) and
    1.18 +{\small {\tt host:id1:id2}} (a physical USB device on the host machine whose
    1.19 +ids are {\small {\tt id1}} and {\small {\tt id2}}).  The advantage
    1.20 +of {\small {\tt tablet}} is that Windows guests will automatically recognize
    1.21 +and support this device so specifying the config line
    1.22 +
    1.23 +{\small
    1.24 +\begin{verbatim}
    1.25 +    usbdevice='tablet'
    1.26 +\end{verbatim}
    1.27 +}
    1.28 +
    1.29 +will create a mouse that works transparently with Windows guests under VNC.
    1.30 +Linux doesn't recognize the USB tablet yet so Linux guests under VNC will
    1.31 +still need the Summagraphics emulation.
    1.32 +Details about mouse emulation are provided in section \textbf{A.4.3}.\\
    1.33 +
    1.34  localtime &     Set the real time clock to local time [default=0, that is, set to UTC].\\
    1.35  
    1.36  enable-audio &  Enable audio support. This is under development.\\
    1.37 @@ -2317,29 +2344,458 @@ Simply follow the usual method of creati
    1.38  
    1.39  In the default configuration, VNC is on and SDL is off. Therefore VNC windows will open when VMX guests are created. If you want to use SDL to create VMX guests, set {\small {\tt sdl=1}} in your VMX configuration file. You can also turn off VNC by setting {\small {\tt vnc=0}}.
    1.40   
    1.41 -\subsection{Use mouse in VNC window}
    1.42 -The default PS/2 mouse will not work properly in VMX by a VNC window. Summagraphics mouse emulation does work in this environment. A Summagraphics mouse can be enabled by reconfiguring 2 services:
    1.43 -
    1.44 -{\small {\tt 1. General Purpose Mouse (GPM). The GPM daemon is configured in different ways in different Linux distributions. On a Redhat distribution, this is accomplished by changing the file `/etc/sysconfig/mouse' to have the following:\\
    1.45 -MOUSETYPE="summa"\\
    1.46 -XMOUSETYPE="SUMMA"\\
    1.47 -DEVICE=/dev/ttyS0\\
    1.48 -\\
    1.49 -2. X11. For all Linux distributions, change the Mouse0 stanza in `/etc/X11/xorg.conf' to:\\
    1.50 -Section "InputDevice"\\
    1.51 -Identifier "Mouse0"\\
    1.52 -Driver "summa"\\
    1.53 -Option "Device" "/dev/ttyS0"\\
    1.54 -Option "InputFashion" "Tablet"\\
    1.55 -Option "Mode" "Absolute"\\
    1.56 -Option "Name" "EasyPen"\\
    1.57 -Option "Compatible" "True"\\
    1.58 -Option "Protocol" "Auto"\\
    1.59 -Option "SendCoreEvents" "on"\\
    1.60 -Option "Vendor" "GENIUS"\\
    1.61 -EndSection}}
    1.62 -
    1.63 -If the Summagraphics mouse isn't the default mouse, you can manually kill 'gpm' and restart it with the command "gpm -m /dev/ttyS0 -t summa". Note that Summagraphics mouse makes no sense in an SDL window and is therefore not available in this environment.
    1.64 +\subsection{Mouse issues, especially under VNC}
    1.65 +Mouse handling when using VNC is a little problematic.
    1.66 +The problem is that the VNC viewer provides a virtual pointer which is
    1.67 +located at an absolute location in the VNC window and only absolute
    1.68 +coordinates are provided.
    1.69 +The VMX device model converts these absolute mouse coordinates
    1.70 +into the relative motion deltas that are expected by the PS/2
    1.71 +mouse driver running in the guest.
    1.72 +Unfortunately,
    1.73 +it is impossible to keep these generated mouse deltas
    1.74 +accurate enough for the guest cursor to exactly match
    1.75 +the VNC pointer.
    1.76 +This can lead to situations where the guest's cursor
    1.77 +is in the center of the screen and there's no way to
    1.78 +move that cursor to the left
    1.79 +(it can happen that the VNC pointer is at the left
    1.80 +edge of the screen and,
    1.81 +therefore,
    1.82 +there are no longer any left mouse deltas that
    1.83 +can be provided by the device model emulation code.)
    1.84 +
    1.85 +To deal with these mouse issues there are 4 different
    1.86 +mouse emulations available from the VMX device model:
    1.87 +
    1.88 +\begin{description}
    1.89 +\item[PS/2 mouse over the PS/2 port.]
    1.90 +This is the default mouse
    1.91 +that works perfectly well under SDL.
    1.92 +Under VNC the guest cursor will get
    1.93 +out of sync with the VNC pointer.
    1.94 +When this happens you can re-synchronize
    1.95 +the guest cursor to the VNC pointer by
    1.96 +holding down the
    1.97 +\textbf{left-ctl}
    1.98 +and
    1.99 +\textbf{left-alt}
   1.100 +keys together.
   1.101 +While these keys are down VNC pointer motions
   1.102 +will not be reported to the guest so
   1.103 +that the VNC pointer can be moved
   1.104 +to a place where it is possible
   1.105 +to move the guest cursor again.
   1.106 +
   1.107 +\item[Summagraphics mouse over the serial port.]
   1.108 +The device model also provides emulation
   1.109 +for a Summagraphics tablet,
   1.110 +an absolute pointer device.
   1.111 +This emulation is provided over the second
   1.112 +serial port,
   1.113 +\textbf{/dev/ttyS1}
   1.114 +for Linux guests and
   1.115 +\textbf{COM2}
   1.116 +for Windows guests.
   1.117 +Unfortunately,
   1.118 +neither Linux nor Windows provides
   1.119 +default support for the Summagraphics
   1.120 +tablet so the guest will have to be
   1.121 +manually configured for this mouse.
   1.122 +
   1.123 +\textbf{Linux configuration.}
   1.124 +
   1.125 +First,
   1.126 +configure the GPM service to use the Summagraphics tablet.
   1.127 +This can vary between distributions but,
   1.128 +typically,
   1.129 +all that needs to be done is modify the file
   1.130 +\path{/etc/sysconfig/mouse} to contain the lines:
   1.131 +
   1.132 +{\small
   1.133 +\begin{verbatim}
   1.134 +    MOUSETYPE="summa"
   1.135 +    XMOUSETYPE="SUMMA"
   1.136 +    DEVICE=/dev/ttyS1
   1.137 +\end{verbatim}
   1.138 +}
   1.139 +
   1.140 +and then restart the GPM daemon.
   1.141 +
   1.142 +Next,
   1.143 +modify the X11 config
   1.144 +\path{/etc/X11/xorg.conf}
   1.145 +to support the Summgraphics tablet by replacing
   1.146 +the input device stanza with the following:
   1.147 +
   1.148 +{\small
   1.149 +\begin{verbatim}
   1.150 +    Section "InputDevice"
   1.151 +        Identifier "Mouse0"
   1.152 +        Driver "summa"
   1.153 +        Option "Device" "/dev/ttyS1"
   1.154 +        Option "InputFashion" "Tablet"
   1.155 +        Option "Mode" "Absolute"
   1.156 +        Option "Name" "EasyPen"
   1.157 +        Option "Compatible" "True"
   1.158 +        Option "Protocol" "Auto"
   1.159 +        Option "SendCoreEvents" "on"
   1.160 +        Option "Vendor" "GENIUS"
   1.161 +    EndSection
   1.162 +\end{verbatim}
   1.163 +}
   1.164 +
   1.165 +Restart X and the X cursor should now properly
   1.166 +track the VNC pointer.
   1.167 +
   1.168 +
   1.169 +\textbf{Windows configuration.}
   1.170 +
   1.171 +Get the file
   1.172 +\path{http://www.cad-plan.de/files/download/tw2k.exe}
   1.173 +and execute that file on the guest,
   1.174 +answering the questions as follows:
   1.175 +
   1.176 +\begin{enumerate}
   1.177 +\item When the program asks for \textbf{model},
   1.178 +scroll down and selese \textbf{SummaSketch (MM Compatible)}.
   1.179 +
   1.180 +\item When the program asks for \textbf{COM Port} specify \textbf{com2}.
   1.181 +
   1.182 +\item When the programs asks for a \textbf{Cursor Type} specify
   1.183 +\textbf{4 button cursor/puck}.
   1.184 +
   1.185 +\item The guest system will then reboot and,
   1.186 +when it comes back up,
   1.187 +the guest cursor will now properly track
   1.188 +the VNC pointer.
   1.189 +\end{enumerate}
   1.190 +
   1.191 +\item[PS/2 mouse over USB port.]
   1.192 +This is just the same PS/2 emulation except it is
   1.193 +provided over a USB port.
   1.194 +This emulation is enabled by the configuration flag:
   1.195 +{\small
   1.196 +\begin{verbatim}
   1.197 +    usbdevice='mouse'
   1.198 +\end{verbatim}
   1.199 +}
   1.200 +
   1.201 +\item[USB tablet over USB port.]
   1.202 +The USB tablet is an absolute pointing device
   1.203 +that has the advantage that it is automatically
   1.204 +supported under Windows guests,
   1.205 +although Linux guests still require some
   1.206 +manual configuration.
   1.207 +This mouse emulation is enabled by the
   1.208 +configuration flag:
   1.209 +{\small
   1.210 +\begin{verbatim}
   1.211 +    usbdevice='tablet'
   1.212 +\end{verbatim}
   1.213 +}
   1.214 +
   1.215 +\textbf{Linux configuration.}
   1.216 +
   1.217 +Unfortunately,
   1.218 +there is no GPM support for the
   1.219 +USB tablet at this point in time.
   1.220 +If you intend to use a GPM pointing
   1.221 +device under VNC you should
   1.222 +configure the guest for Summagraphics
   1.223 +emulation.
   1.224 +
   1.225 +Support for X11 is available by following
   1.226 +the instructions at\\
   1.227 +\verb+http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html+\\
   1.228 +with one minor change.
   1.229 +The
   1.230 +\path{xorg.conf}
   1.231 +given in those instructions
   1.232 +uses the wrong values for the X \& Y minimums and maximums,
   1.233 +use the following config stanza instead:
   1.234 +
   1.235 +{\small
   1.236 +\begin{verbatim}
   1.237 +    Section "InputDevice"
   1.238 +        Identifier      "Tablet"
   1.239 +        Driver          "evtouch"
   1.240 +        Option          "Device" "/dev/input/event2"
   1.241 +        Option          "DeviceName" "touchscreen"
   1.242 +        Option          "MinX" "0"
   1.243 +        Option          "MinY" "0"
   1.244 +        Option          "MaxX" "32256"
   1.245 +        Option          "MaxY" "32256"
   1.246 +        Option          "ReportingMode" "Raw"
   1.247 +        Option          "Emulate3Buttons"
   1.248 +        Option          "Emulate3Timeout" "50"
   1.249 +        Option          "SendCoreEvents" "On"
   1.250 +    EndSection
   1.251 +\end{verbatim}
   1.252 +}
   1.253 +
   1.254 +\textbf{Windows configuration.}
   1.255 +
   1.256 +Just enabling the USB tablet in the
   1.257 +guest's configuration file is sufficient,
   1.258 +Windows will automatically recognize and
   1.259 +configure device drivers for this
   1.260 +pointing device.
   1.261 +
   1.262 +\end{description}
   1.263 +
   1.264 +\subsection{USB Support}
   1.265 +There is support for an emulated USB mouse,
   1.266 +an emulated USB tablet
   1.267 +and physical low speed USB devices
   1.268 +(support for high speed USB 2.0 devices is
   1.269 +still under development).
   1.270 +
   1.271 +\begin{description}
   1.272 +\item[USB PS/2 style mouse.]
   1.273 +Details on the USB mouse emulation are
   1.274 +given in sections
   1.275 +\textbf{A.2}
   1.276 +and
   1.277 +\textbf{A.4.3}.
   1.278 +Enabling USB PS/2 style mouse emulation
   1.279 +is just a matter of adding the line
   1.280 +
   1.281 +{\small
   1.282 +\begin{verbatim}
   1.283 +    usbdevice='mouse'
   1.284 +\end{verbatim}
   1.285 +}
   1.286 +
   1.287 +to the configuration file.
   1.288 +\item[USB tablet.]
   1.289 +Details on the USB tablet emulation are
   1.290 +given in sections
   1.291 +\textbf{A.2}
   1.292 +and
   1.293 +\textbf{A.4.3}.
   1.294 +Enabling USB tablet emulation
   1.295 +is just a matter of adding the line
   1.296 +
   1.297 +{\small
   1.298 +\begin{verbatim}
   1.299 +    usbdevice='tablet'
   1.300 +\end{verbatim}
   1.301 +}
   1.302 +
   1.303 +to the configuration file.
   1.304 +\item[USB physical devices.]
   1.305 +Access to a physical (low speed) USB device
   1.306 +is enabled by adding a line of the form
   1.307 +
   1.308 +{\small
   1.309 +\begin{verbatim}
   1.310 +    usbdevice='host:vid:pid'
   1.311 +\end{verbatim}
   1.312 +}
   1.313 +
   1.314 +into the the configuration file.\footnote{
   1.315 +There is an alternate
   1.316 +way of specifying a USB device that
   1.317 +uses the syntax
   1.318 +\textbf{host:bus.addr}
   1.319 +but this syntax suffers from
   1.320 +a major problem that makes
   1.321 +it effectively useless.
   1.322 +The problem is that the
   1.323 +\textbf{addr}
   1.324 +portion of this address
   1.325 +changes every time the USB device
   1.326 +is plugged into the system.
   1.327 +For this reason this addressing
   1.328 +scheme is not recommended and
   1.329 +will not be documented further.
   1.330 +}
   1.331 +\textbf{vid}
   1.332 +and
   1.333 +\textbf{pid}
   1.334 +are a
   1.335 +product id and
   1.336 +vendor id
   1.337 +that uniquely identify
   1.338 +the USB device.
   1.339 +These ids can be identified
   1.340 +in two ways:
   1.341 +
   1.342 +\begin{enumerate}
   1.343 +\item Through the control window.
   1.344 +As described in section
   1.345 +\textbf{A.4.6}
   1.346 +the control window
   1.347 +is activated by pressing
   1.348 +\textbf{ctl-alt-2}
   1.349 +in the guest VGA window.
   1.350 +As long as USB support is
   1.351 +enabled in the guest by including
   1.352 +the config file line
   1.353 +{\small
   1.354 +\begin{verbatim}
   1.355 +    usb=1
   1.356 +\end{verbatim}
   1.357 +}
   1.358 +then executing the command
   1.359 +{\small
   1.360 +\begin{verbatim}
   1.361 +    info usbhost
   1.362 +\end{verbatim}
   1.363 +}
   1.364 +in the control window
   1.365 +will display a list of all
   1.366 +usb devices and their ids.
   1.367 +For example,
   1.368 +this output:
   1.369 +{\small
   1.370 +\begin{verbatim}
   1.371 +    Device 1.3, speed 1.5 Mb/s
   1.372 +      Class 00: USB device 04b3:310b
   1.373 +\end{verbatim}
   1.374 +}
   1.375 +was created from a USB mouse with
   1.376 +vendor id
   1.377 +\textbf{04b3}
   1.378 +and product id
   1.379 +\textbf{310b}.
   1.380 +This device could be made available
   1.381 +to the VMX guest by including the
   1.382 +config file entry
   1.383 +{\small
   1.384 +\begin{verbatim}
   1.385 +    usbdevice='host:04be:310b'
   1.386 +\end{verbatim}
   1.387 +}
   1.388 +
   1.389 +It is also possible to
   1.390 +enable access to a USB
   1.391 +device dynamically through
   1.392 +the control window.
   1.393 +The control window command
   1.394 +{\small
   1.395 +\begin{verbatim}
   1.396 +    usb_add host:vid:pid
   1.397 +\end{verbatim}
   1.398 +}
   1.399 +will also allow access to a
   1.400 +USB device with vendor id
   1.401 +\textbf{vid}
   1.402 +and product id
   1.403 +\textbf{pid}.
   1.404 +\item Through the
   1.405 +\path{/proc} file system.
   1.406 +The contents of the pseudo file
   1.407 +\path{/proc/bus/usb/devices}
   1.408 +can also be used to identify
   1.409 +vendor and product ids.
   1.410 +Looking at this file,
   1.411 +the line starting with
   1.412 +\textbf{P:}
   1.413 +has a field
   1.414 +\textbf{Vendor}
   1.415 +giving the vendor id and
   1.416 +another field
   1.417 +\textbf{ProdID}
   1.418 +giving the product id.
   1.419 +The contents of
   1.420 +\path{/proc/bus/usb/devices}
   1.421 +for the example mouse is as
   1.422 +follows:
   1.423 +{\small
   1.424 +\begin{verbatim}
   1.425 +T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=1.5 MxCh= 0
   1.426 +D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
   1.427 +P:  Vendor=04b3 ProdID=310b Rev= 1.60
   1.428 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
   1.429 +I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=(none)
   1.430 +E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=10ms
   1.431 +\end{verbatim}
   1.432 +}
   1.433 +Note that the
   1.434 +\textbf{P:}
   1.435 +line correctly identifies the
   1.436 +vendor id and product id
   1.437 +for this mouse as
   1.438 +\textbf{04b3:310b}.
   1.439 +\end{enumerate}
   1.440 +There is one other issue to
   1.441 +be aware of when accessing a
   1.442 +physical USB device from the guest.
   1.443 +The Dom0 kernel must not have
   1.444 +a device driver loaded for
   1.445 +the device that the guest wishes
   1.446 +to access.
   1.447 +This means that the Dom0
   1.448 +kernel must not have that
   1.449 +device driver compiled into
   1.450 +the kernel or,
   1.451 +if using modules,
   1.452 +that driver module must
   1.453 +not be loaded.
   1.454 +Note that this is the device
   1.455 +specific USB driver that must
   1.456 +not be loaded,
   1.457 +either the
   1.458 +\textbf{UHCI}
   1.459 +or
   1.460 +\textbf{OHCI}
   1.461 +USB controller driver must
   1.462 +still be loaded.
   1.463 +
   1.464 +Going back to the USB mouse
   1.465 +as an example,
   1.466 +if \textbf{lsmod}
   1.467 +gives the output:
   1.468 +
   1.469 +{\small
   1.470 +\begin{verbatim}
   1.471 +Module                  Size  Used by
   1.472 +usbmouse                4128  0 
   1.473 +usbhid                 28996  0
   1.474 +uhci_hcd               35409  0
   1.475 +\end{verbatim}
   1.476 +}
   1.477 +
   1.478 +then the USB mouse is being
   1.479 +used by the Dom0 kernel and is
   1.480 +not available to the guest.
   1.481 +Executing the command
   1.482 +\textbf{rmmod usbhid}\footnote{
   1.483 +Turns out the
   1.484 +\textbf{usbhid}
   1.485 +driver is the significant
   1.486 +one for the USB mouse,
   1.487 +the presence or absence of
   1.488 +the module
   1.489 +\textbf{usbmouse}
   1.490 +has no effect on whether or
   1.491 +not the guest can see a USB mouse.}
   1.492 +will remove the USB mouse
   1.493 +driver from the Dom0 kernel
   1.494 +and the mouse will now be
   1.495 +accessible by the VMX guest.
   1.496 +
   1.497 +Be aware the the Linux USB
   1.498 +hotplug system will reload
   1.499 +the drivers if a USB device
   1.500 +is removed and plugged back
   1.501 +in.
   1.502 +This means that just unloading
   1.503 +the driver module might not
   1.504 +be sufficient if the USB device
   1.505 +is removed and added back.
   1.506 +A more reliable technique is
   1.507 +to first
   1.508 +\textbf{rmmod}
   1.509 +the driver and then rename the
   1.510 +driver file in the
   1.511 +\path{/lib/modules}
   1.512 +directory,
   1.513 +just to make sure it doesn't get
   1.514 +reloaded.
   1.515 +\end{description}
   1.516  
   1.517  \subsection{Destroy VMX guests}
   1.518  VMX guests can be destroyed in the same way as can paravirtualized guests. We recommend that you type the command