Skeleton / Example PCI Device Driver
alexander.boettcher at genode-labs.com
Tue Dec 11 20:10:25 CET 2018
On 08.12.18 23:05, John J. Karcher wrote:
> In my slow quest to port/write the VirtualBox Guest Additions, the first
> step is a driver for the virtual PCI device that handles communication
> with the VirtualBox host.
> Is there a skeleton device driver for PCI devices? My first goal is
> just the boilerplate init code, attaching to the IRQ and I/O memory, and
> logging the interrupts as they come in.
> If there isn't a skeleton driver, could anyone recommend the simplest
> example that I could use as a starting point?
I would suggest look into  and , which is a very very basic test
to iterate over all available PCI devices and dumping some PCI
information ( or better look into the Genode Foundations Book). The
test may serve as a starting point.
Which devices are actually available/visible to a driver depend on the
configuration of the platform driver, which acts as an PCI guard. Please
look into  for configuration details.
When you have found/chosen your specific PCI device, you can invoke
several methods on a Platform::Device_client  object as used in the
test, which give you access to various PCI resources in form of
capabilities, like IRQ, IO-PORT or IO-MEM resources.
Please consult the Genode Foundations book for a basic introduction and
documentation - e.g. 3.4.7. Access to device resources, 4.1.1 device
drivers, 8.18. Utilities for user-level device drivers && 2.5.5
Responding to external events (for the IRQ handling)
https://www.genode-labs.com - https://www.genode.org
Genode Labs GmbH - Amtsgericht Dresden - HRB 28424 - Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users