Learning about PCI-e: Driver and DMA

The author discusses implementing a trivial PCI-e device with read and write capabilities by manually peeking/poking with a hardcoded address, then programmatically obtaining the address via the PCI subsystem. The process involves creating a pci_driver struct with supported devices and a probe function, updating the driver’s state to hold a reference to the device’s memory region, and creating a character device for userspace interaction. The author encounters challenges with write functions and improves performance using DMA for data transfers. Implementation of MSIs for interrupt notifications and creating a fake GPU display using QEMU’s console output are also covered. Next steps include exploring multiple DMA engines and zero-copy DMA.

https://blog.davidv.dev/posts/pcie-driver-dma/

To top