This sample project contains a “Hello, World” driver component that showcases the bare scaffolding necessary to register and load a driver component in Fuchsia.
To build the driver component, run the following command:
tools/bazel build --config=fuchsia_x64 //src/example_driver:pkg
Use the following commands to load the driver component on a target device:
Load the example_driver
component:
tools/bazel run --config=fuchsia_x64 //src/example_driver:pkg.component
Open the device log viewer:
tools/ffx log --filter example_driver
You should see the driver component say hello:
[driver_manager.cm][I]: [node.cc:608] Binding fuchsia-pkg://bazel.pkg.component/example_driver#meta/example_driver.cm to acpi-FWCF-passthrough [example-driver,driver][I]: [src/example_driver/example_driver.cc:30] Hello from example-driver [example-driver,driver][I]: [src/example_driver/example_driver.cc:31] Hello from sys/platform/platform-passthrough/acpi/acpi-_SB_/acpi-PCI0/acpi-FWCF/acpi-FWCF-passthrough
Use the following command to run the unit tests on a target device:
tools/bazel test --config=fuchsia_x64 //src/example_driver:test_pkg