linux特权级, linux通信机制, Dalvik, android binder

Android Binder
Android Interprocess Communication
Thorsten Schreiber
First Advisor: Juraj Somorovsky
Second Advisor: Daniel Buβmeyer

 

 

在看《Android Binder》文档时,读到:

1. 特权级英文叫ring,并且是需要硬件支持的。Intel的硬件实现了4个特权级,linux只用0和3。

2. linux通信机制:信号,管道,套接字,消息队列,信号量,共享内存。

3. Native的含义是可以跑在具体机器平台上得程序,不同于跑在虚拟机上的Java。

4. Dalvik Vitual Machine:不同于JVM。JVM关注平台无关性,DVM关注Arm的适配、性能、功耗等。两者设计理念不同。

 

 

1. 特权级

More abstractly, the concept of security boundaries of an operating system introduces the term ring.

Note, that this must be a hardware supported feature of the platform. A certain group of rights is assigned to a ring.

Intel hardware supports four rings, but only two rings are used by Linux.

 

2. linux通信机制

Signals

  Oldest IPC method. A process can send signals to processes with the same uid and gid or in the same process group.

Pipes

  Pipes are unidirectional bytestreams that connect the standard output from one process with the standard input of another process.

Sockets

  A socket is an endpoint of bidirectional communication. Two processescan communicate with bytestreams by opening the same socket.

Message queues

  Processes can write a message to a message queue that is read-able for other Processes.

Semaphores

  A semaphore is a shared variable that can be read and written by many processes.

Shared Memory

  A location in system memory mapped into virtual address spaces of two processes, that each process can fully access.

 

3. Native Code

Programs compiled for a specific platform are called native.

Because Java is executed in a virtual machine with its own byte-code, no native code can be executed directly.

Due to the need to access low-level os mechanism like kernel calls, Java has to overcome this obstacle.

This is done by the Java native interface (JNI) , which allows Java to execute compiled code from libraries written in other languages, e.g. C++.

 

4. Dalvik

The Sun JVM is stack based, because a stack machine can be run on every hardware. Hardware and platform independence were major design principles of Java.

The DVM is register based for performance reasons and well adapted to ARM hardware. This is a different design principle, taking the advantage of hardware independence for high performance and less power consumption, which is essential for mobile purposes with limited battery capability.

The possibility to use the Java native interface weakens the security guarantying property of Java to implicit checking the bounds of variables and to encapsulate system calls and
the force to use JVM defined interfaces to the system.

The use of native libraries can allow bypassing the type and border checking of the virtual machine and opens the door to stack-overflow attacks.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值