This article is based on the source code Scenario Analysis of the Android system, by Luo shengyang.
I ,~ /Android/frameworks/base/cmd/servicemanager
----- Binder. h
----- Binder. c
----- Service_manager.c
~ /Android // kernel/goldfish/drivers/staging/android
----- Binder. c
----- Binder. h
Ii. Source Code Analysis
1.
In Android, each application is made up of activity and service that are likely to run in the same process or run in different processes. So, how does the activity or service in the same process communicate? This is the binder interprocess communication mechanism to be described in this article.We know that the Android system is based on the Linux kernel, while the Linux kernel inherits and is compatible with the rich Unix system interprocess communic
4 Binder Protocol
The basic format of the Binder protocol is (command + data). The ioctl (fd, cmd, arg) function is used for interaction. The command is carried by the cmd parameter, and the data is carried by the arg parameter, which varies with the cmd parameter. The following table lists all commands and their corresponding data:
Table 2 Binder communication c
In Android systems, each application is composed of multiple activity and service parts, and these activity and service are likely to be executed in the same processing, in addition, can also be performed in different processes.And then. How does activity or service communicate in the same process? This is the binder interprocess communication mechanism to be described in this article.We know that the Android system is based on the Linux kernel, while
resource, other processes also access the resource. Therefore, it is primarily used as a means of synchronization between processes and between different threads within the same process.6. signal : Not for information exchange, more suitable for process interrupt control, such as illegal memory access, kill a process, etc.;The kernel of Android is also based on the Linux kernel, why not directly adopt the Linux existing process IPC program, is not the Linux community so many outstanding people
Encounter Trojan-PSW.Win32.WOW, Trojan. psw. win32.onlinegames, Trojan. mnless. kks, etc. 2
EndurerOriginal
1It's okay that the version is not o20, so you don't have to worry about it ~ Download bat_do, freedll, fileinfo to the http://purpleendurer.ys168.com. I first uninstalled the producer of the Injection Process with freedll and exited with an error. Then I
Trojan. DL. win32.autorun. yuz, Trojan. win32.inject. gh, Trojan. win32.agent. zsq, etc.
EndurerOriginal2007-10-231Version
Pe_xscan 07-08-30 by Purple endurer2007-10-22 13:13:44Windows XP Service Pack 2 (5.1.2600)Administrator user group
C:/Windows/system32/winlogon.exe * 604 | MICROSOFT (r) Windows (r) Operating System | 5.1.2600.2180 | Windows NT logon applicat
BinderBinder as a mechanism for IPC in Android, is used everywhere in Android. Contains three layers (Java, c++/c, driver).The purpose of binder is to implement communication between multiple processes, with data passed between the basic data type, binder type, and this wrapper in parcel.In the C + + tier, use multiple classes to encapsulate:The main classes are:
RefBaseAbout reference counting
What is a binder?
Binder is a type of IPC. Do not know IPC? Google, the omnipotent Google.In Linux, we know that resources are allocated and managed by processes. Processes run in independent spaces, which are closed and independent from each other. Then the problem arises. In a complicated operating system, what should we do if tasks need to be completed collaboratively between processes? This must inv
Binder is used to complete interprocess communication (IPC), that is, multiple processes are "not" together, from the thread point of view,thebinder driver code runs in the kernel state, the client program calls binders are done through system calls. Binder is an architecture that provides a server-side interface,binder driver, and client interface three module
Forwarded from: http://blog.sina.com.cn/s/blog_4af327e10101irie.htmladvantages and disadvantages of D-busLinux does not have a good IPC mechanism. Windows, Mac OS, Android also has "binder" subsystem. Linux has sockets, FIFO, shared memory and other mechanisms, which are not very good for the application layer. Kdbus attempts to create a mechanism that is similar to other systems for Linux.D-bus is the closest approach to this standard on Linux. Pros:
We know that in Android, every application runs in a separate process, which also guarantees that when one of the programs has an exception, it does not affect the normal functioning of another application. In many cases, we work with the service of various systems, and it is clear that the program we write is definitely not the same process as the system service, but how do they communicate? Binder is one of the ways in which an inter-process communi
Encounter Trojan-Spy.Win32.Delf.uv, Trojan. psw. win32.xyonline, Trojan. psw. win32.zhengtu and so on 1
EndurerOriginal
1Version
Last night, a netizen said that his computer was infected with viruses. Kingsoft drug overlord kept prompting to find winform2.dll. After a period of time, the countdown shutdown dialog box will pop up, asking me to remotely assist him
Trojan. psw. win32.gameol, Trojan. win32.undef, Trojan. DL. win32.undef, etc. 1
Original endurerVersion 1st
Today, a friend's computer was very slow. Please help me with the repair.
Start the task manager and find a strange process named kcodn32.exe.
Pe_xscan is used to scan log analysis and the following suspicious items are found:
/=Pe_xscan 08-08-01 by Purple
RPC (IPC) in Android is implemented by the binder component. Although we use more aidl, we will not directly use binder, however, it can help you better understand aidl and the principles and mechanisms of Android.Binder Architecture
Similar to the architecture of other android components, the binder is also composed of Java-layer encapsulation, JNI, libbinder, a
This article is based on the source code Scenario Analysis of the Android system, by Luo shengyang.
I. Test code:
~ /Android/external/binder/server
---- FregServer. cpp
~ /Android/external/binder/common
---- IFregService. cpp
---- IFregService. h
~ /Android/external/binder/client
---- FregClient. cpp
Binder Library (l
prepare bullets before you leave .We know that the process, the virtual address is different, is not directly communication, this is a protection mechanism. Open Task Manager and look at the N-ary process, just imagine what happens if these processes communicate directly?And the user space can communicate with the kernel space through system calls, if there is a module in kernel space, can complete the data forwarding, then is not two processes can communicate? Such as:The above mentioned some u
This article is based on the source code Scenario Analysis of the Android system, by Luo shengyang
I. Test code:
~ /Android/external/binder/server
---- FregServer. cpp
~ /Android/external/binder/common
---- IFregService. cpp
---- IFregService. h
~ /Android/external/binder/client
---- FregClient. cpp
Binder Library (li
PrefaceIn the ServiceManager of Binder source analysis, we introduce the process of using binder to communicate, that is, after ServiceManager registers itself as "administrator", it is responsible for the add operation of other service, or other client's get operations. In this process, there are some interfaces we do not have in-depth analysis, such as:
1. Open Binde
4.3 struct binder_transaction_data: send and receive data packet structure
This structure is the standard format for Binder to receive/send data packets. Each member is defined as follows:
Table 5 structure of Binder send and receive data packets: binder_transaction_data
Member
Description
Union {Size_t handle;Void * ptr;} Target;
This Member specifies the destination of the sent da
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.