documentation/drivers/README.md

24 lines
1.2 KiB
Markdown
Raw Normal View History

# 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](https://git.nerdcult.net/noxos/documentation/src/branch/master/drivers/API.md).
## 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](https://git.nerdcult.net/noxos/documentation/src/branch/master/drivers/handlers.md).