[vbox-dev] DMA transaction

Ray Yang rayyang at ybwork.com
Thu Sep 4 06:16:07 GMT 2014


I didn't think DMA is slow :)

I initially followed DevE1000.cpp to build my PCI device. But when it came
to the data transfer part, the complexity of E1K code really made me
headache then thought DMA could be an option for me.

Anyway, I re-read E1K code and found PDMDevHlpPhysRead is used for reading
the content from the guest memory. Hope this is the right clue I should
follow.

Also, I use the following code to register both IO port and MMIO but vbox
only shows one of the resources (anyone is registered later) in the guest
OS although PDMDevHlpPCIIORegionRegister always returns success. Since
other vbox built-in devices have both resources shown in the guest OS, I
would think this is something wrong with my own code. Is there any clue
about this?

	rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 8, PCI_ADDRESS_SPACE_IO,
pciMyIOPortRegionMap);
	rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, MY_MAP_IOSPACE_LENGTH,
PCI_ADDRESS_SPACE_MEM, pciMyIOPortRegionMap);


Thanks.

-Ray

> Ray,
>
> On 03.09.2014 08:40, Ray Yang wrote:
>> Hi,
>>
>> I am trying to implement a pci device to support data transfer between
>> host/guest via DMA but now am a bit lost on how to start a DMA
>> transaction.
>>
>> Basically, I follow the sample of FDC in VBox source code tree to call
>> PDMDevHlpDMARegister(..., callback_host, ...) to register a callback on
>> the host.
>
> A PCI device using the extremely legacy, super low speed ISA DMA
> controller? Sounds extremely unlikely. PCI devices don't need the help
> of any ISA rubbish, they simply trigger the "memory accesses"
> themselves. Good examples are the AHCI controller implementation or the
> various network cards. They get only some basic information about the
> memory area to use, and from this memory area they get the transfer
> descriptors etc etc.
>
>> Then on the guest Windows side, I call
>> WdfDmaTransactionInitialize to initialize the DMA transaction and call
>> WdfDmaTransactionExecute to start the execution. However, the
>> callback_host routine is never called by VBox. I set the breakpoints on
>> FDC's dma routine but it is never triggered either.
>
> What you confirmed this way is that there are no floppy controller DMA
> transfers happening, not that the callbacks are unused.
>
>> So, is there anything else I need to do?
>
> You need to do something completely different :)
>
> Klaus
>>
>> Thanks.
>>
>> -Ray
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev
>






More information about the vbox-dev mailing list