找回密码
 立即注册
AndroidtheBinder驱动 | android开发 2022-11-09 50 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
Android专用驱动构成了Android运行时的柱石。从技术上来讲,Android专用驱动也是整个Android系统的亮点,特别是Binder驱动。Binder是一种进程间通信机制(IPC),它与传统的IPC机制比照,最大的属性是高效,因为通信数据在两个进程之间只需要履行一次复制即可。Binder在Android系统里边使用得十分广泛以及频频。在涉及到比较大的通信数据时,Binder一般还结合别的一个驱动Ashmem来使用。Ashmem是一个共享内存驱动,它与传统的共享内存比较,最大的属性是它是通过文件描绘符来描绘的,而且可以动态地进行分块管理。动态分块管理的目的是可以将部分不再使用了的内存交回给系统,十分合适内存较小的移动设备使用。别的一个专用驱动Logger是一个日志驱动,它与传统的日志系统比照,属性是日志是记录在内核空间而非文件中,这样就可以提升日志的读写速度。这个PPT讲Logger、Binder和Ashmem三个Android专用驱动的实现原理。因为这三个驱动在Android源代码里边用得十分广泛和频频,因此理解它们的实现原理,就可以掌握Android的精华。这对今后阅览Android系统的其它代码,也是十分有帮助的。

(Android dedicated drivers form the pillar of Android runtime. Technically, the Android dedicated driver is also the highlight of the entire Android system, especially the Binder driver. Binder is an interprocess communication mechanism (IPC). Compared with the traditional IPC mechanism, the biggest attribute of Binder is efficiency, because communication data only needs to be replicated once between two processes. Binder is widely used in Android system. When it comes to large communication data, Binder is generally used in combination with another driver Ashmem. Ashmem is a shared memory driver. Compared with traditional shared memory, the biggest attribute of Ashmem is that it is described through a file descriptor and can be dynamically partitioned. The purpose of dynamic block management is to return some memory that is no longer used to the system, which is very suitable for mobile devices with small memory. The other special driver, Logger, is a log driver. Compared with the traditional log system, the attribute of Logger is that logs are recorded in the kernel space rather than in files, which can improve the log reading and writing speed. This PPT talks about the implementation principles of Logger, Binder and Ashmem, three Android specific drivers. Because these three drivers are widely and frequently used in Android source code, we can grasp the essence of Android by understanding their implementation principles. This is also very helpful for reading other codes of Android system in the future.)

[下载]10393044079.rar




上一篇:Android系统架构概述
下一篇:交互式人机对战五子棋