documentation/drivers
antifallobst b455532316 docs (drivers): documented driver structure and API 2023-06-01 21:24:13 +02:00
..
API.md docs (drivers): documented driver structure and API 2023-06-01 21:24:13 +02:00
README.md docs (drivers): documented driver structure and API 2023-06-01 21:24:13 +02:00
handlers.md docs (drivers): documented driver structure and API 2023-06-01 21:24:13 +02:00

README.md

Drivers

This is the documentation for the driver interface, not for the 'drivers' repo.

Drivers are ELF executables which are dynamically linked into the kernel at runtime. A Driver can assign itself to PCI and USB devices or a Filesystem. PCI and USB device bindings are identified by their vendor and device ID. A Filesystem binding is identified by its MBR type and GPT type GUID.

Driver structure

Initialization

A driver needs to have a function void _init() that will be called by the kernel when loading the driver. This function should handle the following things:

  • Load one or more configurations (see API docs for more details)
  • Register handlers (see API docs for more details)
  • Everything else the driver needs to initialize to be fully ready to be used (devices, etc.)

API

Drivers communicate with the kernel using a runtime API. The documentation can be found here.

Handlers

Drivers can register handler functions, that are called by the kernel when handling an action for an assigned device or filesystem. The documentation can be found here.