Get the latest tech news

Learning about PCI-e: Driver and DMA


Creating a simple driver for a simple PCI-e device (in QEMU)

The probe function (which is only called if the device/vendor IDs match), needs to return 0 if it takes ownership of the device. Bus mastering is a feature which allows devices to directly manipulate system memory without involving the CPU. We now have a 'framebuffer' that can receive write(2) from userspace, and will forward the data as-is to a PCI-e device using DMA; we can cheat a little bit to pretend we have a working GPU, by hooking the card's buffer to QEMU's console output:

Get the Android app

Or read this on Hacker News

Read more on:

Photo of driver

driver

Photo of DMA

DMA

Related news:

News photo

Raspberry Pi "PiSP" Driver Landing Upstream For Raspberry Pi 5 Camera System

News photo

Linux 6.11 Adds ChromeOS EC LED Driver For The Framework Laptops

News photo

Opera says the EU Commission's DMA regulation grip should extend to Microsoft Edge’s 'privileged' position on Windows devices to foster fair competition