【发布时间】: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