【问题标题】:What does a linux device need to be seen by Hal?Hal需要看到什么linux设备?
【发布时间】:2011-02-27 06:31:30
【问题描述】:

我正在尝试了解 Linux 内核上的设备驱动程序,为此我创建了三个模块:

  • 一种总线类型
  • 设备驱动程序
  • 现在什么都不做,只是注册的假设备

一切正常,我可以加载总线、驱动程序和创建设备的模块。一切都出现在 sysfs 上,包括设备和设备驱动程序之间的链接,表明它们已绑定。

当驱动程序和设备被加载时,我可以看到使用udevadm monitor 也会引发一些事件:

KERNEL[1275564332.144997] add      /module/bustest_driver (module)
KERNEL[1275564332.145289] add      /bus/bustest/drivers/bustest_example (drivers)
UDEV  [1275564332.157428] add      /module/bustest_driver (module)
UDEV  [1275564332.157483] add      /bus/bustest/drivers/bustest_example (drivers)
KERNEL[1275564337.656650] add      /module/bustest_device (module)
KERNEL[1275564337.656817] add      /devices/bustest_device (bustest)
UDEV  [1275564337.658294] add      /module/bustest_device (module)
UDEV  [1275564337.664707] add      /devices/bustest_device (bustest)

但在所有事情之后,设备并没有出现在 hal 上。 hal 还需要什么设备才能看到?

【问题讨论】:

    标签: linux-kernel kernel linux-device-driver hal hotplugging


    【解决方案1】:

    设备似乎一切正常,问题是 Hal 需要为每个子系统提供一个处理程序(处理程序列表可以在 hald/linux/device.c 中找到),显然,hal 不支持 bustest,为这种情况发明的子系统。

    如果总线使用名称“pseudo”而不是“bustest”注册,hal 使用为假设备定义的一组处理程序来初始化数据库条目,注册它并发送DeviceAdded 事件。

    【讨论】:

      猜你喜欢
      • 2015-11-19
      • 1970-01-01
      • 2017-02-06
      • 2018-09-18
      • 2021-11-03
      • 1970-01-01
      • 1970-01-01
      • 2012-08-09
      • 2016-02-28
      相关资源
      最近更新 更多