[vbox-dev] Source code for shared folders in Windows guests?
Knut St. Osmundsen
bird at sun.com
Mon Jan 4 15:53:46 PST 2010
On Jan 2, 2010, at 10:02 PM, Alfred Krohmer wrote:
> Sorry, forgot to add the CC.
> How do I send an interrupt to the guest? I think this might get quiet difficult from kernel mode on the host. Furthermore, for receiving the answer from the guest I would need to set up a HGCM host service and redirect the answer to the host kernel again...
That's right, most (all) the IFS requests you get in kernel context would have to be pushed down to the VM process (VirtualBox/VBoxHeadless/whatever-frontend-you-are-using) and from there via HGCM to the guest. The first part would be very much like FUSE (http://en.wikipedia.org/wiki/Filesystem_in_Userspace) and I'm sure this has already been done by man IFSes on Windows as well.
I'm not an expert on the HGCM bits, but as far as I know it's mostly guest driven, meaning that the guest sends a request to the host and (eventually) gets an answer back. The answers are usually signaled via an interrupt which VBoxGuest.c get and unblocks the thread that made the original request. When we've needed to make events to travel the other way, i.e. from the host to the guest, we've usually made the quest send an asynchronous event to the host and let it sit around until the host event occurs and send details as output data (see clipboard and the change notification of the guest properties).
PS. We did briefly discuss reversed shared folders some years back and the HGCM designer said that it was most certainly doable using HGCM, though we never got into details or writing code as far as I know.
More information about the vbox-dev