Home > Article > Operation and Maintenance > Is the Android system also based on Linux?
Android system is based on Linux system; Android is the name of the open source mobile operating system based on Linux platform announced by Google on November 5, 2007. The platform consists of operating system, middleware, user interface and application software. composition.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Is the Android system also based on the Linux system?
Introduction to the Android operating system
Android is based on the operating system announced by Google on November 5, 2007 The name of the open source mobile operating system of the Linux platform. The platform consists of operating system, middleware, user interface and application software. It adopts the software stack (Software Stack, also known as software stack) architecture and is mainly divided into three parts. The bottom layer is based on the Linux kernel, developed in C language, and only provides basic functions; the middle layer includes the function library Library and the virtual machine Virtual Machine, developed in C. The top layer is various application software, including call programs, text message programs, etc. The application software is developed by each company itself, using Java as part of the program.
The original meaning of Android refers to "robot". Initially, Android mainly supported mobile phones. Later, after development and improvement, it gradually expanded to tablet computers and other fields. It was the first truly open system built for mobile terminals. and complete mobile software.
System architecture:
Android’s system architecture, like its operating system, adopts a layered architecture. Android is divided into four layers, from high level to low level, namely application layer, application framework layer, system runtime layer and Linux kernel layer.
1. Application
Android is released together with a series of core application packages, which include clients, SMS short message programs, calendars, maps, browsers, and contact management Programs etc. All applications are written using JAVA language.
2. Application Framework
Developers also have full access to the API framework used by core applications. The application's architectural design simplifies component reuse; any application can publish its function blocks and any other application can use the published function blocks (but must comply with the framework's security). Likewise, the application reuse mechanism also allows users to easily replace program components.
3. System runtime library
Android contains some C/C libraries, which can be used by different components in the Android system. They provide services to developers through the Android application framework.
4. Linux kernel layer
The Android kernel is a modified kernel version based on the Linux kernel. It provides device drivers to support the Android platform.
System structure:
1. System kernel
Android runs on the Linux kernel, but it is not GNU/Linux. Because most of the functions supported in general GNU/Linux are not supported by Android, including Cairo, X11, Alsa, FFmpeg, GTK, Pango and Glibc, etc., have been removed. Android replaced Glibc with Bionic, Cairo with Skia, FFmpeg with opencore, and so on. In order to achieve commercial application, Android must remove the parts restricted by the GNU GPL license. For example, Android moves the driver to Userspace, completely separating the Linux driver from the Linux kernel. Bionic/Libc/Kernel/ are not standard Kernel header files. Android's Kernel header is generated from the Linux Kernel header using tools to preserve constants, data structures and macros.
2. Hardware Abstraction Layer
Android's HAL (Hardware Abstraction Layer) can provide hardware driver modules in a closed source form. The purpose of HAL is to separate the Android framework from the Linux kernel so that Android does not rely too much on the Linux kernel to achieve the concept of Kernel independence. It also allows the development of the Android framework to develop without considering driver implementation.
3. Intermediary software
The communication bridge between the operating system and the application program. The application is divided into two layers: function layer (Library) and virtual machine (Virtual Machine). Bionic is Android's improved version of libc. Android also includes Webkit, the so-called Webkit is the engine behind Apple's Safari browser. Surface flinger displays 2D or 3D content on the screen. Android uses the tool chain (Toolchain) for Google's own BionicLibc.
Android uses OpenCORE as the basic multimedia framework. Open CORE can be divided into 7 major blocks: PVPlayer, PVAuthor, Codec, PacketVideo Multimedia Framework (PVMF), Operating System Compatibility Library (OSCL), Common, and OpenMAX.
Android uses skia as the core graphics engine, paired with OpenGL/ES. The functions of skia and LinuxCairo are equivalent, but compared with Linux Cairo, the functions of skia are only rudimentary. In 2005, Skia was acquired by Google. In early 2007, the Skia GL source code was made public. Skia is also the graphics engine of Google Chrome.
Android's multimedia database uses the SQLite database system. Databases are divided into public databases and private databases. Users can obtain the shared database through the ContentResolver class (Column).
Android's middle layer is mostly implemented in Java and uses a special Dalvik Virtual Machine. The Dalvik virtual machine is a "Register Based" Java virtual machine. All variables are stored in the temporary register, and the instructions of the virtual machine are relatively reduced.
The Dalvik virtual machine can have multiple instances (Instance). Each Android application uses an own Dalvik virtual machine to run, so that the system can be optimized when running the program. The Dalvik virtual machine does not run Java bytecode (Bytecode), but runs a file called .dex format.
4. Security Permission Mechanism
Android itself is an operating system with separated permissions. In this type of operating system, each application runs with a unique system identity (Linux user ID and group ID). Each part of the system also uses its own independent identification method. This is how Linux isolates applications from applications and applications from systems.
Application components:
The four major components of Android development are:
1. Activity: Used to express functions.
2. Service: Runs services in the background and does not provide interface rendering.
3. Broadcast Receiver (BroadcastReceiver): used to receive broadcasts.
4. Content Provider: Supports storing and reading data in multiple applications, equivalent to a database.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of Is the Android system also based on Linux?. For more information, please follow other related articles on the PHP Chinese website!