indicogniBuild a VMM

Lab

DTB explorer

Used in chapter 10.

Open a device tree blob, click a node to see its bytes, and watch #address-cells decide how every reg is read.

Runs in browser
DTB explorer: the PL011 node in the chapter's blob Bytes 0x310 to 0x35f of the --dtb-out file. At 0x310, 00000001 is FDT_BEGIN_NODE, followed by the name pl011@9000000, a NUL and padding. At 0x324, 00000003 is FDT_PROP with length 0x18 and name offset 0, the compatible property, whose value is arm,pl011 NUL arm,primecell NUL. At 0x348, a second FDT_PROP with length 0x10 and name offset 0x65 is reg: four cells 00000000 09000000 00000000 00001000. The root says #address-cells 2 and #size-cells 2, so reg is one range: address 0x0900_0000, size 0x1000. pl011@9000000 in the blob (from xxd -s 784 -l 80 v.dtb) 0310: 00000001 706c3031 31403930 30303030 FDT_BEGIN_NODE "pl011@9000000" 0320: 30000000 00000003 00000018 00000000 FDT_PROP len 0x18 nameoff 0 0330: 61726d2c 706c3031 31006172 6d2c7072 "arm,pl011\0arm,pr 0340: 696d6563 656c6c00 00000003 00000010 imecell\0" FDT_PROP len 0x10 0350: 00000065 00000000 09000000 00000000 nameoff 0x65 = "reg", cells... reg = <0x00 0x9000000 0x00 0x1000> (16 bytes) parent (root): #address-cells = 2, #size-cells = 2 so one range = 4 cells = 16 bytes address 0x0900_0000, size 0x1000 (4 KiB) With #address-cells = 1, a range is 12 bytes and 16 does not divide: dtc warns.

All labs