Page 1 of 1

How to author and configure a virtual PCI-device using PDM?

Posted: 19. Dec 2011, 11:33
by tjroamer
Hi,
on Linux, we have a virtual PCI-Device and the corresponding driver for it. We obtained this device from our external partner, let's say Mydevice.so and corresponding source code. It has been recognized by VirtualBox and worked very well. It was authored and installed using PDM (Pluggable Device Manager) of VirtualBox.
Our task is to author another virtual PCI-Device with very small modification, such that we can see 2 PCI-devices in the "Device Manager" window. Since the driver has multiple-user and multiple-device capability, it can be used for both PCI-devices.
Our problems are:
1. we don't have enough information to understand how PDM works. (we tried to copy the original source code and make another Mydevice_another.so, but it can not be identified by the VirtualBox, we can only see our original device in "Device Manager")
2. what configuration steps are needed to install a PDM device? (we tried to delete Mydevice.so, but when we start VirtualBox, it says that "can't find "Mydevice.so"". There should be somewhere to store the additional device information. I thought all of the *.so files in the out/linux.x86/releases directory will be scaned automatically to know what devices this machine has, but it is not the case.)

Any helps or any comments are very welcome, thanks in advance.
/Kai

Re: How to author and configure a virtual PCI-device using P

Posted: 21. Dec 2011, 01:22
by tjroamer
I did the following to let my device have 2 instances and changed the configuration file:

VBoxManage setextradata MyVM VBoxInternal/PDM/Devices/Mydevice/Path Mydevice

VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/0/PCIDeviceNo 10
VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/0/PCIFunctionNo 0
VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/0/Trusted 1

VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/1/PCIDeviceNo 11
VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/1/PCIFunctionNo 0
VBoxManage setextradata MyVM VBoxInternal/Devices/Mydevice/1/Trusted 1

but when I started the WinXP, the VirtualBox did some very strange transactions to Mydevice instance 0 and then stopped:

an access to the host-memory address 0x00100000 is coming from VirtualBox and assigned to the my PCI-device, of course this address cannot be mapped to any bar and the VirtualBox is crashed.

If I only use one instance, the VirtualBox will do the right thing, the bar0 registers are read and write and my driver will work correctly. Can anybody tell me why I got such a problem?
thanks in advance.

/Kai

Re: How to author and configure a virtual PCI-device using P

Posted: 11. Jun 2015, 09:22
by Magikus
If anyone can help with PDM? How it's works? Any tutorials?