[vbox-dev] creating a custom device dll and adding it via PDM

Alexander Eichner Alexander.Eichner at oracle.com
Sat Jan 19 00:08:27 GMT 2013


Hi Brad,

sorry for the late answer. For a start you can read up on PDM here:
https://www.virtualbox.org/browser/vbox/trunk/src/VBox/VMM/VMMR3/PDM.cpp

To see what your DLL has to provide look into https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/build/VBoxDD.cpp
Basically your DLL has to export a function called VBoxDevicesRegister to register new device emulations and VBoxDriversRegister
to register new drivers. To register new virtual USB devices it has to export VBoxUsbRegister.

To get the DLL loaded on VM startup you have to add special CFGM keys. For new device emulations you need something like
/PDM/Devices/<id>/Path <path/to/your/dll> where <id> is a unique identifier. Using the base name of the DLL is a good practice. 
Registering new drivers is similar, just replace Devices with Drivers. To get a better idea of what you need you can just
open a VBox.log file and search for /PDM/Devices or /PDM/Drivers there.

Regards,
Alexander Eichner

On 07.01.2013 01:53, Brad Keifenheim wrote:

> Hello,
> 
> I'm evaluating creating a PCI device to emulate some custom hardware for a virtual machine. 
> 
> My research has led me to PDM: 
> 
> PDM (Pluggable Device Manager), an abstract interface between the VMM and emulated devices which separates device implementations from VMM internals and makes it easy to add new emulated devices. Through PDM, third-party developers can add new virtual devices to VirtualBox without having to change VirtualBox itself.
> 
> Can someone point me to an example that shows how to setup a library that gets loaded at runtime and provides the required API? 
> 
> Also, is there a def or header file somewhere that outlines how to setup the dll?
> 
> Thank you in advance for the help.
> 
> Brad
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

ORACLE Deutschland B.V. & Co. KG   Alexander Eichner
Werkstrasse 24                     Engineer, VirtualBox
71384 Weinstadt, Germany           mailto:alexander.eichner at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20130119/7ce8c41b/attachment.html>


More information about the vbox-dev mailing list