<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1435385835730_3149"><span id="yui_3_16_0_1_1435385835730_3148">I think that most likely the OP wants to develop a virtual PCI device, so the guest and the host can communicate with each other, like some kind of pipe system. The guest and the host can read/write to each other through shared memory.</span></div><div dir="ltr" id="yui_3_16_0_1_1435385835730_3150"><span><br></span></div><div dir="ltr" id="yui_3_16_0_1_1435385835730_3152"><span id="yui_3_16_0_1_1435385835730_3151">If this is indeed the case, one can study vbox's builtin guest/host implementation, basically vbox itself uses a virtual PCI device (Devices/VMMDev/VMMDev.cpp), and then inside Linux guest, there is corresponding VBoxGuest.ko kernel module, which is a PCI driver to interact with the virtual device emulated by vbox. This is how vbox's guest additions work.</span></div><div dir="ltr" id="yui_3_16_0_1_1435385835730_3152"><span><br></span></div><div dir="ltr" id="yui_3_16_0_1_1435385835730_3152"><span id="yui_3_16_0_1_1435385835730_3352">I have implemented a simple virtual PCI device, like QEMU's pipe. What I can tell you, this is not an easy job, and you have to understand all the concepts, plus a detailed study of vbox source code. </span></div><br>  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1435385835730_2829"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1435385835730_2828"> <div dir="ltr" id="yui_3_16_0_1_1435385835730_2827"> <hr size="1" id="yui_3_16_0_1_1435385835730_3156">  <font size="2" face="Arial" id="yui_3_16_0_1_1435385835730_2826"> <b><span style="font-weight:bold;">From:</span></b> Klaus Espenlaub <klaus.espenlaub@oracle.com><br> <b><span style="font-weight: bold;">To:</span></b> vbox-dev@virtualbox.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, June 26, 2015 6:22 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vbox-dev] How add device or driver (PDM) to VirtualBox<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1435385835730_2830"><br>Marcin,<br clear="none"><br clear="none">On 25.06.2015 10:57, Marcin K wrote:<br clear="none">> Hi,<br clear="none">><br clear="none">> I ask about this before but don't get any answer...<br clear="none"><br clear="none">yes, sorry about that, but right now everyone in the dev team is booked <br clear="none">out with super urgent things which have to be finished before 5.0 is <br clear="none">released. There's simply not enough time right now for bigger explanations.<br clear="none"><br clear="none">><br clear="none">> How add new device/driver to Virtualbox?<br clear="none">> Is there a someone who understand how PDM works?<br clear="none">><br clear="none">> I compile VBoxSampleDevice.cpp and add it to VirtualBox but<br clear="none">> system(ubunutu 14) don't show any new device.<br clear="none">> To add dll to Virtualbox I use:<br clear="none">> VBoxManage setextradata global VBoxInternal/PDM/Devices/[[1]]/Path<br clear="none">> g:\VirtualBox\out\win.amd64\release\obj\testingDevice\VBoxSampleDevice.dll<br clear="none"><br clear="none">VBoxSampleDevice.cpp is a totally empty piece of code. It compiles, it <br clear="none">loads, but doesn't expose ANY functionality to the VM.<br clear="none"><br clear="none">> Also I try to add device using copy of Virtio device. I copy code<br clear="none">> of DevVirtioNet.cpp modify it (change some names), build dll and add to<br clear="none">> VirtualBox:<br clear="none">> VBoxManage setextradata global VBoxInternal/PDM/Devices/[[3]]/Path<br clear="none">> g:\VirtualBox\out\win.amd64\release\obj\testingDevice\testingDevice.dll<br clear="none">><br clear="none">> But still nothing change in guest system.<br clear="none">><br clear="none">> In DevVirtioNet.cpp I found a lot of code which set a lot of parameters<br clear="none">> connected with PCI. I try understand this code but this take, a lot of time.<br clear="none">><br clear="none">> I also found that I have to set which driver will be use in system also<br clear="none">> in configuration of virtual machine.<br clear="none">> I try to set net ethernet cart type but in VBoxManage I found code which<br clear="none">> allow using only build in drivers so I can't set "My" modified Virtio<br clear="none">> driver.<br clear="none">><br clear="none">> There is really no instruction or documentation how it's works?<br clear="none"><br clear="none">There are lots of examples, in the form of the various device <br clear="none">implementations :)<br clear="none"><br clear="none">Klaus<div class="qtdSeparateBR"><br><br></div><div class="yqt3410915742" id="yqtfd20522"><br clear="none"><br clear="none">> I will be really gratefull for any help or instruction how add new<br clear="none">> device to VirtualBox.<br clear="none">><br clear="none">><br clear="none">> Best regards,<br clear="none">> Marcin<br clear="none"><br clear="none">_______________________________________________<br clear="none">vbox-dev mailing list<br clear="none"><a shape="rect" ymailto="mailto:vbox-dev@virtualbox.org" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br clear="none"><a shape="rect" href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br clear="none"></div><br><br></div> </div> </div>  </div></body></html>