fdt_check_header(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fdt_check_header β€” sanity check a device tree header

Okay bestie, welcome to the Kernel API Manual page for fdt_check_header(9) β€” yes that's a section 9 manpage, yes we're doing kernel dev now, and yes you're gonna slay it. πŸ¦‹


✨ NAME ✨

fdt_check_header β€” the vibe check for a device tree header. Like, it literally sanity checks it. πŸ’…


🌸 SYNOPSIS 🌸

int fdt_check_header (const void *fdt );

πŸŽ€ ARGUMENTS πŸŽ€

  • fdt β€” a pointer to some data that might be a flattened device tree. Emphasis on might, bestie. We don't know yet. That's the whole point of this function. πŸ™ˆ

⭐ DESCRIPTION ⭐

So here's the tea: fdt_check_header looks at the buffer you handed it and checks that it contains what appears to be a flattened device tree β€” and that the header inside holds valid information (to the extent that anyone can even tell that from the header alone). πŸ”₯

The way it's giving "first impressions only" β€” it's not doing a full deep dive, it's just checking the header. That's the extent. That's what can be determined from the header alone. No cap. πŸ‘‘


πŸ’– RETURN πŸ’–

  • 0 β€” slay! The buffer appears to contain a valid device tree. βœ…
  • -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_TRUNCATED β€” the standard meanings, as above. πŸ’€

🧚 SEE ALSO 🧚

Oh you thought that was it? Bestie, the family tree is huge. Gather round. 🌈

Kernel file ./scripts/dtc/libfdt/libfdt.h, plus:

I told you it was a lot. πŸ’€βœ¨


Lowkey reminder bestie: this only checks the header, not the whole tree. If you want the full deep scan, that's a different function (fdt_check_full(9), it's literally right there in the list πŸ‘€).

That's the whole page, mwah πŸ’‹ β€” brought to you by ./scripts/dtc/libfdt, dated October 2026. Go forth and validate those headers, icon. πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from