本文介绍了内置的内核驱动程序还需要设备树吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将内核驱动程序构建为module,则可以在运行时使用insmod或modprobe手动将其插入内核.但是以下有关设备树的陈述正确吗?

If I build a kernel driver as a module, it can be inserted into the kernel at run-time manually with insmod or modprobe, that i am clear. But are the following statements about device tree, correct?

  1. 如果我将内核驱动程序构建为module,它将在启动时自动插入内核,具体取决于它是否在设备树中列出
  2. 如果我将内核驱动程序构建为built-in,则无论设备树如何,它将在启动时自动插入内核中
  1. If I build a kernel driver as a module it will be auto inserted into the kernel at boot time, depending on whether it is listed in device tree or not
  2. If I build a kernel driver as a built-in, it will be auto inserted into kernel at boot time regardless of device tree

推荐答案

内置内核驱动程序仍需要设备树吗?是的.设备树的概念与驱动程序是内置还是编译为模块正交.设备树包含有关硬件的信息.平台总线将该信息传递给相关的驱动程序.

Built-in kernel driver still need device tree? Yes. Concept of device tree is orthogonal to whether drivers are built-in or compiled as modules. Device tree contains information about the hardware. Platform bus passes that info to relevant drivers.

这是一篇很好的简短文章,介绍了平台总线以及设备树之前的状态: https://www.codeproject.com/tips/1080177/linux-platform-device-driver .设备树排除了以硬件代码硬编码的硬件信息,从而使代码更具可移植性.

This is a good brief article about platform bus, and how things used to be before device tree: https://www.codeproject.com/tips/1080177/linux-platform-device-driver. Device tree factors out harware info otherwiese hard-coded in kernel code, making the code more portable.

这篇关于内置的内核驱动程序还需要设备树吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-28 09:33