mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
DTS modules (device modules) often have a single source file with an empty `struct Module`. The module's yaml file now allows a `dts-only` boolean to be set, so the source file becomes optional. `devicetree.yaml` is renamed everywhere to `module.yaml`
1.1 KiB
1.1 KiB
Architecture: Device/Driver/Module System (kernel layer, C API)
The kernel uses a Linux-inspired device model:
- Module (
struct Module): loadable unit that registers drivers, hardware and symbols. Lifecycle:module_construct→module_add→module_start. Each device board and platform is a module. - Driver (
struct Driver): binds to devices viacompatiblestrings (like devicetree). Hasstart_device/stop_devicecallbacks and anapipointer for type-specific operations. - Device (
struct Device): represents hardware. Lifecycle:device_construct→device_add→device_start. Has a parent-child tree, driver binding, and locking. - DeviceType (
struct DeviceType): enables discovering devices by category (e.g.DISPLAY_TYPE,TOUCH_TYPE,UART_CONTROLLER_TYPE).
Devices are defined via devicetree .dts files in each Devices/<id>/ folder. A custom devicetree compiler (Buildscripts/DevicetreeCompiler/compile.py) generates C code from these files. Each device folder also has a module.yaml specifying dependencies and the .dts file.