12345678910111213141516171819202122 |
- static MY_FDT: &[u8] = include_bytes!("../test.dtb");
- fn main() {
- let fdt = fdt::Fdt::new(MY_FDT).unwrap();
- println!("This is a devicetree representation of a {}", fdt.root().model());
- println!("...which is compatible with at least: {}", fdt.root().compatible().first());
- println!(
- "...and has at least one memory location at: {:#X}\n",
- fdt.memory().regions().next().unwrap().starting_address as usize
- );
- let chosen = fdt.chosen();
- if let Some(bootargs) = chosen.bootargs() {
- println!("The bootargs are: {:?}", bootargs);
- }
- if let Some(stdout) = chosen.stdout() {
- println!("It would write to: {}", stdout.name);
- }
- }
|