D-bus Introduction

Source: Internet
Author: User

1. Introduction

D-bus is an advanced interprocess communication mechanism, which is provided by the Freedesktop.org project and is issued using the GPL license. The main purpose of D-bus is to provide communication to the process in the Linux desktop environment while delivering the Linux desktop environment and Linux kernel events as messages to the process. The main probability of D-bus is the bus, the registered process can receive or deliver messages via the bus, and the process can register to wait for kernel event response, such as waiting for the change of the network state or the computer issuing the shutdown instruction. Currently, D-bus has been adopted by most Linux distributions, and developers can use D-bus to implement a variety of complex interprocess communication tasks.

D-bus allows programs to be registered on them to provide services to other programs. It also provides the functionality of the client program to query what services are available. Programs can also be registered to wait for kernel events such as hot-swappable hardware.
D-bus is implemented in a daemon manner. Users can run several D-bus entities, each of which is called a channel. Usually there is a privileged channel called system channel, and each user has a private entity. The user needs a private entity because the system channel will have access restrictions.
The main function of System channel is to pass the HAL's information to processes interested in this information. And the function of private entities is to provide unlimited communication between programs.


2. Composition

D-bus is a message bus system that covers all the requirements of interprocess communication and has some special uses. D-bus is a three-tier architecture for interprocess communication systems, including:
Interface layer: Interface layer is provided by function library Libdbus, the process can use D-bus ability through this library.
Bus layer: The bus layer is actually provided by the D-bus bus daemon. It runs at the start of a Linux system and is responsible for message routing and delivery between processes, including messaging for the Linux kernel and the Linux desktop environment.
Packaging layer: A series of wrapper libraries that are based on a specific application framework.
D-bus has its own protocol, which is based on binary data design, and has nothing to do with data structure and coding methods. The protocol does not need to serialize the data to ensure the efficiency of the information transmission. Both Libdbus and D-bus bus daemons do not require too much overhead.
Bus is a d-bus communication mechanism, there are usually many buses in a system, these buses are managed by D-bus Bus daemon. The most important bus is the system bus, which is loaded into memory when the Linux kernel boots. Only the Linux kernel, the Linux desktop environment, and higher-privileged programs can write messages to the bus to secure the system and prevent malicious processes from impersonating Linux to send messages.
The conversation bus (session buses) is created by a normal process and can exist at the same time. The session bus belongs to a process private and is used to pass messages between processes.


Section excerpt from http://www.cnblogs.com/wzh206/archive/2010/05/13/1734901.html and Wikipedia

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.