DTB
Device tree blob utilities
This no_std
crate contains types for reading and writing DTBs. Here is a
code showing how to read a DTB-file:
let mut buf = Vec new;
let mut file = open.unwrap;
file.read_to_end.unwrap;
let reader = read.unwrap;
for entry in reader.reserved_mem_entries
let root = reader.struct_items;
let =
root.path_struct_items.next.unwrap;
println!;
let =
root.path_struct_items.next.unwrap;
println!;
let mut buf = ;
let = node_iter.path_struct_items.next.unwrap;
println!;
let =
node_iter.path_struct_items.next.unwrap;
println!;
To read DTB directly from a memory address use Reader::read_from_address()
.
To run a test sample execute:
Fuzzing instructions
The reader (and methods of read items) can be fuzzed with
cargo-fuzz
/libfuzzer
which can be installed as cargo install cargo-fuzz
. Note that the coverage is not yet complete but provides a
straightforward harness. The baseline corpus is the directory of tests is
src/test_dtb
. Note that this command will require a nightly compiler.
cargo fuzz run reader src/test_dtb