Klaus,
 
Thanks for the info. I am aware of those, I'd appreciate if you can dig into 
more detains on Host kernel => VMM ==> disk emulation layer.
 
Disk emulation code is executed in a user process, how does the i/o traverse 
this path? In general, it is not easy for kernel to call a function inside 
another process.
 
What I meant to implement is a Windows disk driver for offline disk access, for 
example, one can mount a vdi file as disk C:\. Usually this kind of driver is 
implemented as kernel, but I want to move the core storage code to user space, 
so I need to find out if vbox uses some undocumented way of forwarding kernel 
calls to use space.


--- On Thu, 7/14/11, Klaus Espenlaub <[email protected]> wrote:


From: Klaus Espenlaub <[email protected]>
Subject: Re: [vbox-dev] how does i/o routed from host kernel to user space?
To: [email protected]
Date: Thursday, July 14, 2011, 10:12 AM


On 14.07.2011 17:45, Huihong Luo wrote:
> As I understand, when vm performs i/o, the i/o requests traps to the
> host kernel (assuming VT-x/AMD-V). This i/o must be sent to user mode
> VirtualBox.exe for processing. Throgh what mechanism the user mode
> callback functions are invoked? The user mode performs pooling? Address
> space switching? Interprocess communications? ...

The VM machinery is in src/VBox/VMM. If you want to look at it from the device 
emulation side, look at src/VBox/Devices (as this is about storage, the Storage 
subdir is probably most interesting).

> I really wanted to find this out. I am exploring doing a user mode
> virtual disk driver for vbox. so the same vbox code can be used to mount
> virtual disks, and vbox can have an integrated interface on Windows for
> virtual disk mounting.

I don't understand what you're exactly trying to achieve - the 
IDE/SATA/SCSI/SAS device emulations generally use DrvVD (which is 100% 
userland) for all image accesses (host floppy/DVD uses a different driver), so 
that already is a single implementation, which uses the VD support (see 
include/VBox/vd.h) for a uniform interface to all disk image formats. The VD 
framework is very flexible and powerful. It handles complete stacks of base and 
diff images and so on. Sample code how to use the VD framework directly is e.g. 
in the vbox-img tool.

Klaus

_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to