Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Is there any difference between android and linux?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "is there any difference between android and linux"? the content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "is there any difference between android and linux?"

There are differences between android and linux: 1. Android applications are developed using JAVA and can be run on Android systems through a JAVA virtual machine, while Linux applications are developed using "C _ CPG +" and can run on kernel systems in the form of machine code. 2. There is a difference in the underlying driver software between the two.

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 is born out of the Linux system, so is Android a kind of Linux? Now let's talk about the similarities and differences between Android and Linux systems.

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 depend on the Linux kernel, such as security, kernel management, process management, network stack, driver model and so on. The Linux kernel also acts as an abstraction layer between the hardware and software of the two. It hides the specific hardware details and provides unified services for upper application development.

two。 Differences in system framework

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 with Linux systems, android runs a Java virtual machine (JVM) called Dalvik (changed to ART after version 4.4) on its Linux kernel, so android applications developed with JAVA can run on Android systems through JAVA virtual machines. The application of Linux is developed by Champact + and can be run on the kernel system in the form of machine code. the difference between the two system frameworks is shown in the figure.

3. The difference of underlying driver software between Linux and android

In addition to the common core drivers of the Linux kernel, Android also adds its own proprietary kernel drivers, such as display driver, Bluetooth driver, camera driver, memory card driver, Binder IPC driver and so on.

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 to HAL for implementation, so as to avoid the risk of open source of hardware driver, so the driver of android is divided into two parts, one is written into the kernel and the other is written into the HAL layer.

Android not only needs to realize the development of the underlying driver, but also needs to package the driver into the JNI layer interface according to the JNI rules, so that the application program (JAVA program) can call the kernel driver through JNI. Take the display driver Framebuffer as an example, as shown in the figure.

Display-driven Model of Linux system

Display-driven Model of Android system

(1) Linux system: the Framebuffer driver only needs to be compiled into the Linux kernel and set aside the corresponding interfaces such as read, write, ioctl, etc., then it can be called by the application program of the host computer.

(2) Android system: the Framebuffer driver first compiles the driver of simple hardware register read and write operation into the kernel, then writes the specific hardware driver into the HAL layer, and encapsulates it as a JNI interface according to the JNI specification, before it can be called by the upper computer application program.

4. The difference between Linux and android application layer software.

But the Android application program is written in java language and can not directly call the system interface implemented in C language, and the Linux system can use C language to call the system interface to communicate with the kernel, so there is a concept called JNI in the Android system, which is used to realize the information exchange between java and C _ java + programs.

(1) how the Android application accesses the Android kernel driver:

APP- > JNI- > Android kernel driver

APP- > hardware access Service-> Android Kernel driver

(2) how Linux applications access linux drivers

APP- > Linux kernel driver

APP- > C Library-> Linux Kernel driver

The above is all the content of this article entitled "is there any difference between android and linux?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report