
Develop a PCI Driver Against QEMU's edu Device
Write a PCI driver for QEMU 9.2's educational edu device on Linux 6.12: ID check, liveness register, factorial engine and interrupt, with the register map.
Tag
71 posts

Write a PCI driver for QEMU 9.2's educational edu device on Linux 6.12: ID check, liveness register, factorial engine and interrupt, with the register map.

Map a PCI BAR on Linux 6.12 with pci_iomap, read and write device registers with ioread32 and iowrite32, check sizes first and avoid the posted-write trap.

Write a minimal Linux 6.12 PCI driver with a pci_device_id table, probe and remove, pci_enable_device, region claiming, bus mastering and the error unwinding.

How PCI Express links train, how configuration space and BARs describe a device, and how Linux 6.12 turns that into memory the driver can map and use.

Make a Linux 6.12 USB driver survive unplug during reads and writes with kref, an io_mutex, a disconnect flag, usb_poison_urb and anchored URB cancellation.

Turn a Linux 6.12 board with a USB device controller into a USB serial and Ethernet gadget using configfs and libcomposite, with the exact directory steps.

Queue several bulk URBs from a Linux 6.12 driver, limit how many are in flight, and handle completions in atomic context without leaking memory.

Send vendor and standard USB control requests from a Linux 6.12 driver with usb_control_msg and the safer usb_control_msg_recv and usb_control_msg_send helpers.

Send and receive bulk data from a Linux 6.12 USB driver with usb_bulk_msg: pipes, DMA-safe buffers, timeouts, short transfers and how to recover from a stall.

Build the smallest working Linux 6.12 USB driver: an id_table, probe and disconnect callbacks, per-interface state, and the module_usb_driver registration.

How a USB device is organized into configurations, interfaces and endpoints, and how Linux 6.12 shows that tree in sysfs and hands each interface to a driver.

A system call is the controlled jump from a user program into the kernel. See how write() becomes a syscall instruction, a number in rax and a return value.