Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dbus on Kernel to user space

Tags:

linux

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!

like image 665
mannox Avatar asked Feb 03 '26 14:02

mannox


1 Answers

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

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.

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

Kernel -> udev -> udisks (formally DeviceKit) -> dbus -> any dbus application interested in disk events.

like image 109
bramp Avatar answered Feb 05 '26 08:02

bramp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!