A preliminary understanding of the Linux part of the Android platform
Source: Internet
Author: User
A preliminary understanding of the Linux part of the Android platform-general Linux technology-Linux programming and kernel information. The following is a detailed description. Source: www.it168.com
Android is based on the Linux kernel. For friends who like to study the underlying layer, it is natural that they will not miss the opportunity to understand something on the Linux layer. Of course, the final goal is to figure out how Linux is combined with the upper-layer lib and virtual machine, but this will happen after Google has completely open-source Android. Many details about Linux running can be seen through the adb shell.
First, use the emulator console to start the simulator and enter the shell interface. After a try, it is found that although many commands are not available, such as find, basic operations such as ls are still possible. Then echo $ PATH observes specific available applications and finds that all available applications are concentrated in/sbin,/system/sbin,/system/bin.
Not to mention, the adbd should be a daemon for communicating with your external adb. This can also be inferred from the process view. As for the recovery, it should be a repair program, but the specific usage cannot be determined at present. In addition, the programs in this directory should be called by the system itself based on real-time conditions and will not be called by the user in person.
Go to the/system directory and find that there is no sbin directory and bin directory. There are many applications, except for the commonly used Linux Command Line programs provided by toolbox, is Google's own Android development program. In general, the toolbox provided by Android is still relatively simple. If you don't like this kind of operation, it doesn't matter. It works with adb push, we can install busybox on the Android platform.
Similarly, there are various threads, the programs called by the system, and the user's own program processes, such as lk. test and com. google. android. lunarlander is running in the project, com. google. android. maps, com. google. android. phone is the program you see when the Android simulator is running. Interestingly, from the perspective of/system/bin/usbd in the process, it seems that all client debugging is via USB. Of course it is not pull now. Now you are just using a simulator. Well, will the USB debugger be expensive when the supporting hardware comes out in the future? Hey.
Finally, let's take a look at the file system and mount it:
There is nothing new. Compared with the desktop, there is no virtual memory file system, and the root file system is the/tools/lib/images/ramdisk In the SDK installation directory of the simulator. img loaded. The system uses the yaffs2 file system. Both system and data are 64 MB large, and nearly half of them are used. The specific system image is the tools/lib/image/system. img In the SDK installation directory.
From the above analysis, this Linux is still quite normal. Another interesting topic is that the current installation of software, or the Package method, has been condemned by many people in the developer group, google currently does not have a standard Install program for Android programs, nor does it have a repository description. Some small programs can be roughly installed by analyzing the Android file changes, but if there are any large projects in the future, it is better to set a standard installation method rule. You cannot rely on Eclipse to help us, huh, huh.
The following steps can be used to analyze the current installation mode.
Before installing the software:
1. emulator-wipe-data
2. adb push busybox ./
3. adb shell./busybox tar-cf/tmp/data.tar/data
4. adb pull/tmp/data.tar.
5. mkdir original
6. cd original
7. tar-xf ../data.tar
The specific difference is that two related files are added under/data/app and data/data, and the files are stored in/data/system/packages. the installed program information is added to xml. It seems that the menu also shows whether the new installer is obtained from this file and how to display relevant information, such as the name or something.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service