#dtb #fdt #devices

hermit-dtb

Crate to parse Flattened Device Trees (FDT) / Device Tree Blobs (DTB) in a no_std environment

2 releases

0.1.1 Apr 26, 2023
0.1.0 Apr 26, 2023

#325 in Operating systems

Download history 378/week @ 2024-12-16 248/week @ 2024-12-23 536/week @ 2024-12-30 135/week @ 2025-01-06 291/week @ 2025-01-13 119/week @ 2025-01-20 84/week @ 2025-01-27 238/week @ 2025-02-03 138/week @ 2025-02-10 365/week @ 2025-02-17 224/week @ 2025-02-24 186/week @ 2025-03-03 110/week @ 2025-03-10 184/week @ 2025-03-17 241/week @ 2025-03-24 217/week @ 2025-03-31

756 downloads per month
Used in 2 crates

MIT/Apache

24KB
301 lines

hermit-dtb

Crate to parse Flattened Device Trees (FDT)/Device Tree Blobs (DTB) in a no_std environment. Performs no dynamic memory allocations and can therefore be universally used for operating system development. Originally written for the AArch64 port of HermitCore-rs, hence the name.

Features

  • Enumerating subnodes of a given path.
  • Enumerating properties of a given path.
  • Getting the data of a specific property.
  • Finding incomplete paths (e.g. looking for /uart@ reliably yields /uart@fe001000 if that is the only UART device).
  • Written in mostly safe Rust. unsafe is only used when accessing the in-memory DTB in the first place (unavoidable) and for performance reasons (e.g. str::from_utf8_unchecked).
  • parse_dtb example tool to demonstrate the features.

ToDo

  • Implement an iterator for the memory reservation block.
  • Implement a method to fetch the boot_cpuid_phys value.

References

Contact

The hermit-dtb crate has been written by Colin Finck (colin.finck@rwth-aachen.de).

No runtime deps