Home  >  Article  >  Operation and Maintenance  >  Is there any difference between android and linux?

Is there any difference between android and linux?

青灯夜游
青灯夜游Original
2021-11-23 10:18:2013414browse

There are differences between android and linux: 1. Android applications are developed using JAVA and can run on the Android system through the JAVA virtual machine; while Linux applications are developed using "C/C" and can be run in machine code The form runs on the kernel system. 2. There are differences in the underlying driver software between the two.

Is there any difference between android and linux?

#The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.

As the current mainstream operating systems, Android and Linux are widely used in both consumer products and industrial control fields. It is said that the Android system was born out of the Linux system, so is Android a type of Linux? Now let’s talk about the similarities and differences between Android and Linux systems.
Is there any difference between android and linux?

1. What the two have in common

Android is a system based on the Linux kernel. The core system services of Android and Linux systems all rely on the Linux kernel, such as security, kernel management, process management, network stack, driver model, etc. The Linux kernel also serves as an abstraction layer between the hardware and software. It hides specific hardware details and provides unified services for upper-layer application development

Is there any difference between android and linux?

2. Differences in system frameworks

Linux system and Android are two different operating systems on the surface, but Android is essentially a Linux system, but Google has tailored and customized it.

In addition, compared to the Linux system, android runs a Java virtual machine (JVM) called Dalvik (renamed ART after version 4.4) on its Linux kernel, so android applications developed using JAVA It can run on Android system through JAVA virtual machine. Linux applications are developed using C/C and can run on the kernel system in the form of machine code. The system framework differences between the two are as shown in the figure.

Is there any difference between android and linux?

Is there any difference between android and linux?

##3. Differences between Linux and android underlying driver software

In addition to the common core drivers provided by the Linux kernel, Android also adds its own proprietary kernel drivers, such as display drivers, Bluetooth drivers, camera drivers, memory card drivers, Binder IPC drivers, etc.

In addition, in order to protect the intellectual property rights of hardware manufacturers, the Android system adds a HAL layer, which can extract the specific implementation part of the driver and send it to HAL for implementation, thus avoiding the risk of open source hardware drivers, so android The driver is divided into two parts, one part is written into the kernel and the other part is written into the HAL layer.

In addition to developing the underlying driver, Android also needs to encapsulate the driver into a JNI layer interface according to JNI rules so that applications (JAVA programs) can call the kernel driver through JNI. Take the display driver Framebuffer as an example, as shown in the figure.

Is there any difference between android and linux?

Display driver model of Linux system

Is there any difference between android and linux?##Display driver model of Android system

(1) Linux system

: The Framebuffer driver only needs to be compiled into the Linux kernel, and corresponding read, write, ioctl and other interfaces are set aside, so that it can be called by the host computer application. (2) Android system
: The Framebuffer driver first compiles the driver for simple hardware register read and write operations into the kernel, and then writes the driver for the specific hardware implementation into the HAL layer, and based on The JNI specification is encapsulated into a JNI interface, which can be called by the host computer application program.

4. The difference between Linux and android application layer software

However, Android applications are written in Java language and cannot directly call the system interface implemented in C language. In the Linux system, C language can be used to call the system interface to communicate with the kernel, so the Android system has a concept called JNI, which is used to realize information interaction between Java and C/C programs.

(1) How Android applications access the Android kernel driver:

##APP—>JNI—>Android kernel driver
  • APP—>Hardware Access Service—>Android Kernel Driver
  • (2) Linux application accesses linux driver Program method

APP—> Linux kernel driver
  • APP—>C library—>Linux kernel driver Program
  • Related recommendations: "
  • Linux Video Tutorial
"

The above is the detailed content of Is there any difference between android and linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn