The documentation in this section is designed to help driver developers create new drivers using Fuchsia's driver framework version 2 (DFv2).
How-to
- Write a minimal DFv2 driver: Learn how to create a minimal DFv2 driver from scratch.
- Driver examples: Explore sample drivers intended to demonstrate various Fuchsia driver concepts.
Tutorials
- Create a composite node: Learn how to create a composite node using composite node specifications.
- Bind rules tutorial: Learn how to write bind rules for DFv2 drivers to discover and match devices.
- Bind library code generation tutorial: Learn how to use bind libraries to auto-generate code for DFv2 drivers.
- FIDL tutorial: Learn how to define FIDL protocols, export them from a driver, and use them in another driver.
- Metadata tutorial: Learn how to pass metadata from one driver to another using the metadata library in DFv2.
Debugging
- Troubleshoot common issues in DFv2 driver development: Learn how to debug and fix common errors in DFv2 driver development.
- Driver utilities: Learn how to use driver utilities for communicating with devices for diagnostics.
Testing
- DriverTestRealm: Learn how to use the
DriverTestRealm
framework for running driver integration tests. - Threading tips in tests: Understand best practices for handling threading in driver tests to avoid crashes.
Best practices
- VMO registration pattern: Understand approaches for transferring bulk data between applications and drivers.
- Driver stack performance: Understand performance-related best practices for authoring new device driver APIs.
Guidelines
- Driver runtime API guidelines: Follow these guidelines when defining C APIs in the driver runtime.
- Driver rubric: Follow these rules when creating a new DFv2 driver in the Fuchsia source repository.
Concepts
- DMA (Direct Memory Access): Understand DMA and its importance in DFv2 driver development.
- For more information on DFv2-specific concepts, see Drivers under the Fundamentals section.
Additional information
See the following tutorials under the SDK section:
- Codelab: Build a driver: Learn how to create a DFv2 driver from scratch in the Fuchsia SDK environment.
- Write bind rules for a driver: Learn how to write bind rules for DFv2 drivers in the Fuchsia SDK environment.
- Driver unit testing quick start: Learn how to write unit tests for DFv2 drivers in the Fuchsia SDK environment.
- View driver information: Learn how to use the
ffx driver
command to retrieve information about drivers.