#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

#590 in Operating systems

Download history 124/week @ 2024-07-24 116/week @ 2024-07-31 52/week @ 2024-08-07 85/week @ 2024-08-14 83/week @ 2024-08-21 99/week @ 2024-08-28 19/week @ 2024-09-04 171/week @ 2024-09-11 25/week @ 2024-09-18 64/week @ 2024-09-25 118/week @ 2024-10-02 42/week @ 2024-10-09 84/week @ 2024-10-16 164/week @ 2024-10-23 76/week @ 2024-10-30 66/week @ 2024-11-06

391 downloads per month
Used in libhermit-rs

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