用于可视化 Linux 内核使用的设备树文件 (dtb) 的工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14000736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tool to visualize the device tree file (dtb) used by the Linux kernel?
提问by Punit Soni
I am looking for a tool which can graphically represent the hardware device tree used in linux kernel. I am trying to understand linux kernel for particular arm chipset. It would be a really useful tool to have.
我正在寻找一种可以以图形方式表示 linux 内核中使用的硬件设备树的工具。我正在尝试了解特定 arm 芯片组的 linux 内核。这将是一个非常有用的工具。
采纳答案by TheCodeArtist
You can try the Component inspectortool.
您可以尝试使用组件检查器工具。
It is part of QorIQ Configuration Suitewhich is a plugin for Eclipse.
它是QorIQ Configuration Suite 的一部分, 后者是 Eclipse 的插件。
Download here. (Requires registration. Free to download.)
在这里下载。(需要注册。免费下载。)
Personally as i am on the cmd-line most of the time, and quite addicted to vi
, i find its built-in code folding capabilities are somewhat sufficient as long as the dts
is properly indented.
就我个人而言,因为我大部分时间都在 cmd 线上,并且非常沉迷于vi
,我发现只要dts
正确缩进,它的内置代码折叠功能就足够了。
Setup hot-keys commands to fold/expand blocks of code in vi
by adding the following lines to .vimrc
:
vi
通过将以下行添加到中,设置热键命令以折叠/展开代码块.vimrc
:
nnoremap <silent> <F5> zfa}<CR>
nnoremap <silent> <F6> zo<CR>
With the above setup, to fold a block/node, simply move the cursor onto any of its lines(except the title) and hit F5. To expand a folded block/node, move to the line with the folded title and hit F6.
通过上述设置,要折叠块/节点,只需将光标移动到其任何一行(标题除外)并点击F5。要展开折叠块/节点,请移动到带有折叠标题的行并点击F6。
Here is what a partially folded dts looks like in vi
.
这是部分折叠的 dts 在vi
.
回答by user8908459
As many of you have figured out after reading this question, it appears that the Component Inspector Tool is no longer available.
正如你们许多人在阅读这个问题后发现的那样,组件检查器工具似乎不再可用。
Visual Studio Code(free) provides an extension through the marketplace called DeviceTreewhich helps in navigating device tree files. It does not appear to be as good as the Component Inspector Tool but it does perform basic functions like highlighting and collapsing.
Visual Studio Code(免费)通过名为DeviceTree的市场提供了一个扩展,它有助于浏览设备树文件。它似乎不如 Component Inspector Tool 好,但它确实执行了高亮和折叠等基本功能。
回答by Vamsi
On linux we can directly open dtb file by using fdtdump
在linux上我们可以使用fdtdump直接打开dtb文件
fdtdump dtb_file.dtb > /tmp/test.txt