[vbox-dev] PCI config read/write

Robert Zeljko robertzeljko at yahoo.com
Wed May 9 17:39:53 GMT 2007


I was wondering if there is an interface which can be used to register callback
read/write functions for the PCI config space.
I'm adding a network device to the Virtual Box and need to trap all read/writes
to the PCI config space.
I've solved my problem by "hacking" VBox PCIDevice structure and exposing
PCIDEVICEINT structure which is embedded within. This way, after calling
PDMDevHlpPCIRegister, I change pfnConfigRead and pfnConfigWrite to point to my
own handlers. I also had to store original pfnConfigWrite pointer and call it
later from my write handler to keep everything in sync.
Again, I don't know if there is a way to do this without a hack, however, this
feature is very important one for anyone who wishes to add a new device to the
Virtual Box.

Thanks!

-- robert




More information about the vbox-dev mailing list