macosdmadriverkit

IOBufferMemoryDescriptor::Create returns kIOReturnNotReady


I'm writing a user-space application in MacOS to work with DMA, in a similar fashion to Linux's dmabuf.

I created the memory descriptor with IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut,(int)pow(10,5),0,&command->buffer). However, the return code I got was kIOReturnNotReady.

I signed the binary with com.apple.developer.driverkit, disabled SIP, and did systemextensionsctl developer on.

I'm trying to use the API for DMA on MacOS, similar to Linux's dma-buf.


Solution

  • You can't use DriverKit APIs from outside a DriverKit extension. If you want to use these APIs, you need to use them in a dext.