gpt4 book ai didi

linux-kernel - 为什么引导加载程序和内核源代码中都需要设备树结构 (DTS) 文件?

转载 作者:行者123 更新时间:2023-12-04 11:15:58 27 4
gpt4 key购买 nike

Bootloaders like U-Boot that do not implement the Open Firmware API, are expected to pass to the kernel a binary form of the flattened device tree - LinuxFDTBlob



为什么 DTS 文件也存在于内核中?那不是多余的吗?

例如,U-boot 源代码有以下文件:
arch/arm/dts/tegra124-jetson-tk1.dts

这个文件也可以在 Linux 源代码下找到:
arch/arm/boot/dts/tegra124-jetson-tk1.dts

虽然内核版本是U-boot版本的4倍,但我想知道这种冗余背后的原因。我相信维护者和开发者都更难维护和使用

最佳答案

以下是来自 Artlessnoise 评论的答案:

u-boot 源使用 u-boot DTB,而 Linux 在内核引导时使用 Linux DTB。 u-boot 版本是精简版,因为启动所需的外围设备不多。你总是使用 Linux 的内核版本,即 u-boot 将这个版本传递给 Linux(以及加载 bzImage 或 vmlinux)。

许多 u-boot 驱动程序几乎与 Linux 相同。显然,您可以对所有 u-boot 驱动程序进行相同的论证;大多数是 Linux 驱动程序的副本,其中中断被轮询例程替换。使用相同的开放固件接口(interface)使它们能够更紧密地匹配。

关于linux-kernel - 为什么引导加载程序和内核源代码中都需要设备树结构 (DTS) 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30711327/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com