HeadlinesBriefing favicon HeadlinesBriefing.com

Device Drivers Lab COSC562 - PCI and VirtIO Guide

Hacker News •
×

Device Drivers Lab COSC562 - Stephen Marz

This lab covers PCI and VirtIO device drivers. The main device bus is PCI, which uses the Enhanced Configuration Access Mechanism (ECAM) for configuration and access. PCI-X is an enhancement over original PCI using parallel architecture, while PCI Express (PCIe) uses a serial, point-to-point architecture.

The ECAM physical address comes from ACPI via the MCFG table, providing the starting and ending bus numbers. PCI addresses are structured with bus, device, function, and register components. Each device has 65,536 bytes of ECAM space, and each bus has 1,048,576 bytes.

The lab involves initializing devices through PCI to VirtIO handoff, then VirtIO to underlying devices. You will register all devices under the global kernel data device registry, using the alloc library for heap allocation. Key sections include PCI Address Structure, ECAM Structure, Capabilities, MSI-X Capability, and VirtIO Initialization.