内核上的Dbus到用户空间 [英] Dbus on Kernel to user space

查看:38
本文介绍了内核上的Dbus到用户空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对当前(2.6.35)内核上的dbus有疑问.dbus是内核和用户空间之间的一种通信方式吗?我可以自己弄清楚.例如,如果您使用USB驱动程序(插入USB闪存笔之类的东西)并监视dbus(dbus-monitor)的活动,则答案可能是肯定的.但是在源代码(usb-skeleton.c和小工具驱动程序中,没有dbus的迹象).在内核树中找不到Dbus.h.非常感谢你.抱歉,如果我输入错了,但是我对设备驱动程序和dbus有点陌生!

I have a question regardind dbus on the current(2.6.35) kernel. Is dbus a way of communication between kernel and user space? I can figure it out by myself. For exemple if you make use of the usb driver(inserting something like a usb flash pen) and monitoring the activity of the dbus(dbus-monitor) the answer might be yes. But in the source code(usb-skeleton.c and the driver for gadgets there's no sign of dbus). Dbus.h is not to be found in the kernel tree. Thank you very much. Sorry if i've got this wrong but i am kind of a noob on device drivers and dbus!

推荐答案

D-Bus用于用户空间应用程序相互通信.

D-Bus is for user space applications to communicate with one another.

如果要与设备驱动程序进行通信,则要使用IOCTL,netlink或创建一个新的syscall.过去,我已经创建了netlink代码来与特殊的网卡对话,并且这样做相对容易.使用ioctl也很容易,但是您受到可以/应该通过多少信息的限制.

If you want to communicate with a device driver you want to use either IOCTLs, netlink or create a new syscall. I've created netlink code in the past to speak to a special networking card, and it was relatively easy to do. Using the ioctl is also quite easy but you are limited by how much information you can/should pass via it.

如果您想知道dbus与所插入的USB设备之间的关系,我想是这样的:

If you are curious how dbus relates to a USB device being inserted, I think it is something like this:

这篇关于内核上的Dbus到用户空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆