How to support mouse integration?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Jarno
Posts: 1
Joined: Wed Feb 22, 2012 4:05 pm

How to support mouse integration?

Post by Jarno »

Hello everybody,

I've looked everywhere on the large vista's of the internet and found... nothing :(
I want to learn how to support mouse integration in VM's i.e. when your OS is being ran as the guest OS.

If anyone has a clue, please share your knowledge and/or point me at the right direction.

Thanx :)
-
Simplicity is the ultimate sophistication - Leonardo da Vinci
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: How to support mouse integration?

Post by Ready4Dis »

I'm not sure exactly what you mean by mouse integration... do you mean how do you take control of the mouse from the VM? I know bochs uses the f12 key to enable/disable they mouse (aka, switch from host to guest). You still need to do everything in the OS to enable mouse support though just like if you were using real hardware. Might have to make some configuration changes depending on exactly how you want it to work though (ps/2, usb?)
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How to support mouse integration?

Post by iansjack »

If you mean that you want to support the mouse in your OS then you do it in a VM exactly the same as you would on real hardware.
User avatar
hometue
Member
Member
Posts: 100
Joined: Thu Dec 19, 2013 1:40 am
Location: Asia, Singapore

Re: How to support mouse integration?

Post by hometue »

Or perhaps you are referring to a feature similar to Virtualbox mouse integration? For that I am guessing you need to somehow install the guest additions into your operating system.
CookieOS. Want a cookie? Its only black and white for now though, probably as bad as my baking skills.
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

Re: How to support mouse integration?

Post by Octocontrabass »

VirtualBox provides a PCI device that allows the host and guest to communicate with one another. You transfer data between the guest and the host by placing a data structure somewhere in RAM, and writing the address of the data structure to a specific I/O port. The host informs the guest when more data is ready with an interrupt.

I don't know of any documentation for it, but the source code is available for both the host and guest side.
hidnplayr
Posts: 23
Joined: Sat Aug 09, 2008 5:07 pm

Re: How to support mouse integration?

Post by hidnplayr »

Another possibility is to support USB HID devices in tablet mode, and put your VM in this mode.
This works great for me on KolibriOS in Virtualbox.
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: How to support mouse integration?

Post by mallard »

Since I'm also interested in (eventually) having VM mouse integration in my OS, I did a bit of searching.

This mailing list post is probably the best place to start; it's a reply from a VirtualBox developer to one of the Syllable OS developers detailing how the guest additions work (there's nothing Syllable-specific there).

Basically, there's a PCI device (VMMDev, PCI device ID 80EE:CAFE) that provides a whole bunch of services; everything from time synchronisation to folder sharing goes through it. Since VirtualBox is open source, you can read through the existing additions and the VirtualBox-side code to get an idea how it all works. It is however fairly complex on a typical OS; there are multiple layers that each request goes through making it hard to understand.

The only independently-developed (and by far the simplest) "guest additions" I've found those included in MINIX v3. Their code only supports time synchronisation, but does show the basics of how to communicate with the PCI device. It shouldn't be too difficult to use this code as a guide to write a driver that supports mouse integration.
Image
Post Reply