Making the Card Compute a Factorial by Polling
This is the first time you ask the hardware to do work rather than just identify itself: you write a number into the card's compute register, watch a status bit until the card says it has finished, then read the answer back out of the same place. Wiring that to the device file from the earlier stage means a person at a shell can send a number in and get the factorial out, with the arithmetic done by the emulated card. After it you understand the basic shape of every device transaction — hand over a request, wait for a done signal, collect the result.
Questions this Concept answers
- Why does the driver re-read the status register in a loop instead of waiting a fixed interval judged long enough?
GitHub - Zain-Naqvi-tech/linux-pci-dma-driver: Linux kernel PCI driver for QEMU's EDU device. MMIO
This is an engineering log for a Linux PCI driver written against QEMU's EDU teaching card, and its second phase is the first time the driver asks the hardware to do real work. The driver exposes the…