Barak Fargoun
2008-Mar-26 11:09 UTC
[Xen-devel] Displaying battery state inside Windows guests
Hi all, I would like to make Windows guest which runs on laptop machine, to display the battery state (as if Windows is running on the physical machine itself). (BTW, VMWare has added this functionality inside the latest version of VMWare) I have thought about the following ways in order to perform it. If someone is familiar with these stuff, and can help me in doing so or comment about it, I would appreciate it a lot. These are the ways I thought about: 1. Writing a pv battery mini-class driver in Windows, which will receive the battery state from dom-0, and will report it to Windows 2. Adding a section in the dsdt of the hvm guest, which will return the battery state using some IO ports, then I will try to catch these IO ports accesses using qemu, and will return the proper values. This method will enable Windows to use it''s own generic control method battery (CmBatt.sys). Can anyone help/comment? Barak _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2008-Mar-27 16:17 UTC
Re: [Xen-devel] Displaying battery state inside Windows guests
Hi there,> I would like to make Windows guest which runs on laptop machine, to > display the battery state (as if Windows is running on the physical > machine itself). > > (BTW, VMWare has added this functionality inside the latest version of > VMWare)Cute. Although Xen isn''t used on laptops that much I can see this type of feature being particularly useful when running a VM fullscreen - otherwise it might mask your battery meter, which could be bad :-)> 1. Writing a pv battery mini-class driver in Windows, which will > receive the battery state from dom-0, and will report it to Windows > > 2. Adding a section in the dsdt of the hvm guest, which will > return the battery state using some IO ports, then I will try to catch > these IO ports accesses using qemu, and will return the proper values. > This method will enable Windows to use it''s own generic control method > battery (CmBatt.sys). > > > > Can anyone help/comment?I guess I''d note that if you can emulate the behaviour of real hardware then you can easily apply this to other non-Windows HVM guests. It might be possible to push the emulation support upstream to Qemu then too. On the other hand, using a PV-on-HVM driver would make it easier to support this in PV guests too. (the other route here would be to enable PV guests to use some basic emulated hardware to achieve the same effect with the above solution) Not sure which is simpler! Emulating ought to involve less grubbing about writing Windows drivers but if you''re familiar with that then it mightn''t sound as scary as it does to me :-) If you go the route of writing a PV driver, you could perhaps base it on the existing GPLed PV drivers for Windows (that way you get the Xenbus driver, etc for free). Hope this helps a little, Mark -- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel