Embedding FreeBSD
Device description
Definition: a flexible/generic mechanism for describing a single device (aka package).
- A device description has some type (could be class with sub-classes), used to match drivers to devices (akin to PCI).
- Contains a device's resources (I/O, interrupt, etc)
- Contains attributes
- Can contain "hints" to the OS for purposes of wiring devices down to drivers and unit numbers.
Device tree
Definition: a collection of device descriptions organized in a hierarchical structure.
- Can be partial; sub-trees that can be mapped/rooted at runtime.
Implementation
- Textual representation. At first, the kernel will parse and translate to make it easier to 1) compile-in, 2) load as module, and 3) manually enter while booting.
- Bus driver that takes a device tree, parses it and creates the appropriate newbus hierarchy, followed by the standard probe and attach.