As we know, Android system is developed based on Linux kernel. When the runtime library layer analyzes its source code, we often encounter knowledge such as pipes, sockets and virtual file systems (VFS). In addition, the Android system has added some special drivers to the Linux kernel, such as the Logger driver of the login system, the Binder driver of inter-process communication, and the anonymous Ashmem driver to assist memory management. When analyzing these unique drivers of Android, we will also encounter data structures related to process and memory management in the Linux kernel. Therefore, it is necessary for us to master some basic knowledge of Linux kernel. Here are four classic Linux kernel books.
1.Linux kernel development.
The author of this book is Robert Love, and the latest edition is the third edition. This book outlines the design and implementation of Linux kernel, and clearly describes the design objectives and implementation ideas of each subsystem of Linux kernel conceptually, which is very suitable for beginners to read. From the point of view of software engineering, this book is equivalent to a brief design document of Linux kernel.
2. Understand the Linux kernel.
The authors of this book are Daniel P. Bovet and Marco Cesati, and the latest edition is the third edition. This book provides more details about the realization of Linux kernel, and describes in detail the important data structures, algorithms and programming skills used in kernel development, which is very suitable for middle and advanced readers. From the point of view of software engineering, this book is equivalent to a detailed design document of Linux kernel.
3.Linux device driver.
The authors of this book are Jonathan Colbert, Alessandro Roubini and Greg Croia-Hartman. The latest edition is the third edition. This book pays more attention to practical operation. The realization principle and method of Linux kernel driver are explained in detail, and readers can actually write their own Linux drivers according to it. After reading this book, it is very helpful for us to analyze the special driver of Android later.
Scenario analysis of 4.4. Linux kernel source code
The author of this book is Mao and Hu, a classic Linux kernel book written by China people themselves. The biggest feature of this book is to analyze the source code of Linux kernel in detail from the usage scene, which helps readers straighten out the boring source code.
After mastering the basic knowledge of Linux kernel, it is not appropriate to analyze the source code of Android system immediately, because it has no purpose. We need to analyze the source code of Android system with problems or goals. The best way to mine problems or goals is to write your own applications on the Android platform. By writing applications, we can know what functions the Android platform provides, and then we will want to know how these functions are realized, so that we can analyze the source code of the Android system with problems or goals. Here are two books about Android application development tutorials:
1. Professional Android 2 application development.
2. Google Android SDK development examples daquan.
Both books use a lot of examples to illustrate how to use Android SDK to develop Android applications. Readers can practice according to the actual situation and master the usage of the four components of Android application (activity, service, broadcast receiver and content provider), because the whole architecture and implementation of Android system is to provide these four components for developers to realize various applications. In the process of learning, if you encounter other problems, you can also refer to the official documents.