Must-Read Books for Beginners in Embedded Arm Linux
Recently, a student who just started learning Arm Linux asked me for advice on good books for beginners. Embedded Linux is a vast system that involves hardware and computer science, bridging electronics and computing. Many students from electronics-related majors are unfamiliar with computer principles and operating systems, while those from computer-related majors are often confused about hardware and circuits, making the entry into this field quite challenging.
I told this student that first, you need to have an interest, as interest is the driving force to overcome all difficulties. You should also make good use of the internet and resources around you, trying, searching, and discussing more.
I graduated from an electronics-related major (Automation) and spent my senior year playing with the 51 microcontroller and Cortex-M3 in the lab. However, by chance, I interviewed at an Android company. Before the interview, I saw that the job requirements only mentioned familiarity with Arm architecture, and since Cortex-M3 is also Arm, I went for the interview and surprisingly received an offer. During the signing of the tripartite agreement, the HR mentioned, “You need to start learning Linux after you join, as it is the key technology for your work here.” I nodded and said, “Okay, okay…”
After leaving, I was confused—Linux! WTF! If I had seen Linux written in the job requirements, I wouldn’t have dared to interview!
Back in the lab, my teacher was very happy to hear that I signed with this company! He said, “You need to learn how to work in a Linux system; otherwise, you won’t even get in the door.”
So the teacher found me a desktop computer, installed Ubuntu, and then dug out a S3C2410 development board from the back of the lab warehouse—yes, I didn’t make a mistake, it was 2410. Since we are from the automation department, most of the teachers’ projects are related to control in various factories and workshops, and they mostly use PLCs, microcontrollers, and MCUs for control, running Linux was non-existent! The teacher said, “If you control it improperly, it could lead to disaster, and you could go to jail.” Therefore, no one in the department played with Linux, and this development board was given away by a company several years ago for promotion. I was already quite trendy for being able to play with Ubuntu.
Thus, for the next few months, I began my entry-level learning of Arm Linux on this S3C2410 board: constantly repeating experiments, continuously searching online…
Eventually, I graduated and smoothly entered the workforce. After starting my job, I was quite successful, tinkering with Android and Linux on various chips, enjoying every moment.
Thanks to my unique experiences during my entry period, I have always paid attention to relevant books in the industry. Whenever I see a prominent figure publishing a good book, I can’t help but buy it. If I find a corresponding PDF version online, I will definitely find a way to download it.
So, just in time, I sorted out a list of books that I have read, hoping to help everyone:
I have categorized these books according to the knowledge structure required for the Arm Linux system:
-
Linux System Environment
-
Git Version Control
-
C Language and Assembly
-
Arm Architecture
-
Linux Application Programming
-
Basic Principles of Linux Kernel
-
Linux Kernel Development and Practice
-
Theory and Basics of Operating Systems
The first three categories are fundamental and must be mastered regardless of the development direction. The latter five categories complement each other; theoretical foundations equate to internal skills, while development practices equate to techniques that need to be combined and verified with each other. Good techniques are easy to grasp and look beautiful, allowing you to quickly make a name for yourself in the industry, but to go further, fly higher, and join the ranks of true experts, you cannot do without profound internal skills.
1. Linux System Environment
Familiarity with the Linux system environment is the prerequisite for everything—the most powerful development tools in the Linux system environment are the command line and Shell scripts.
Why? Because the compilation and configuration of a vast majority (almost all) open-source projects are achieved through the command line; in projects involving massive source code, command line tools like find and grep provide powerful and efficient search capabilities, helping quickly locate and understand the source code; through Shell scripts, you can automate a lot of repetitive tasks, saving time and life. I once submitted two patches to U-Boot and the Linux Kernel mainline, involving modifications to similar code across dozens of files. If I had to modify them step by step manually, it might take several days, but I spent half a day writing a script using the sed
command to handle it, and it was done in one go.
I have heard many students still in the entry stage say: “The future trend is desktop and graphical interfaces, so I don’t need the command line.” This view is incorrect; at least in the foreseeable future, there is no trend of the command line being replaced. At least I still often see students asking, “I typed this command according to the tutorial, why did it report an error?” When I ask them, “Do you understand what this command means? Can you understand the error message it reported?” They say they don’t know. So you need to be familiar with the command line; at the very least, you should know what each command you type means and be able to understand its error messages. You should also be able to use the help
command to look up the usage of related tools.
So, for this part, I recommend four books (materials):
-
“The Linux Command Line and Shell Scripting Bible” (Third Edition)
This book is written by a foreign author and translated by a Chinese person. It is a very detailed book that thoroughly explains the usage of various common commands in the Linux system and some general principles of using the Linux system. You can read it roughly first and then use it as a reference book to consult whenever needed.
-
“Shell Programming Complete”
I downloaded this book online, and most of my Shell scripting skills and command line techniques come from this book; it is a reference book I often consult.
-
“Shellbook”
Also known as “Shell Programming Examples,” this open-source book was written by Wu Zhangjin of Taixiao Technology (also the former BSP director of Meizu). Although it is only over 100 pages, it is very popular online.
-
“Shell Command Line Operations”
This 14-page PDF lists some common command line usage examples for quick reference.
2. Git Version Control
I placed Git version control in the second position to highlight its importance. In today’s team-oriented and rapid iteration development model, poor version management makes it difficult to work efficiently and cleanly. I now use Git + Markdown + Github for document version management, allowing me to iterate and modify whenever I find errors.
It is said that the first generation of programmers in China—Qiu Bojun and Wang Jiangmin—would take the software disks storing their programs home before leaving work at night, fearing unexpected events might cause them to lose their programs. Now, relying on Git as a version management tool, it seems no one has such worries anymore.
There are many version management tools, but I recommend Git because it is widely used. Android projects use Git for version management, and well-known open-source projects like the Linux kernel and U-Boot also use Git for version management. Moreover, code hosting websites like Github, Gitlab, and Gitee are based on Git, showing that Git has formed an ecological existence in version management. So you should embrace it without hesitation.
By the way, Git was originally created by Linus Torvalds (the one who wrote the Linux kernel) in just a week.
I recommend two books:
-
“Getting Started with GitHub”
GitHub is a code hosting website based on Git technology, where you can choose to host your code publicly or privately. The public option allows everyone to browse and download your code, while the private repository is only visible to you.
This book mainly explains how to use GitHub and also lists common Git basic operations. I have separated out the basic Git operations section, which is that document “Git Basic Functions.” After reading this document, you can basically handle daily version management.
-
“Pro Git” (Second Edition)
This is also an open-source book that details the basic principles of Git. If you want to gain a deeper understanding of Git to solve more complex issues in large projects with multiple branches and repositories, you can read this book.
3. C Language and Assembly
The importance of C language in embedded development goes without saying. From U-Boot to the Linux kernel, various foundational components are mostly written in C, so to be a good embedded hacker, you must know C.
Unlike C, which is a cross-platform language, assembly language is strongly related to CPU architecture. Different architectures have different assembly languages; for example, the assembly for 32-bit Armv7 is different from that for 64-bit Armv8, making it relatively difficult to master.
For beginners, it’s okay not to know assembly at first, as it won’t significantly affect your work since most scenarios won’t require it.
However, as your skills improve, mastering assembly will allow you to delve deeper into the system and understand the internal mechanisms of program execution.
The initial boot code in U-Boot and Linux Kernel is primarily written in assembly, and control related to Cache and MMU can only be achieved through assembly.
Sometimes, when a piece of C code runs abnormally or inefficiently, or your Linux system crashes, disassembling the corresponding code and analyzing it from the assembly level can help identify the problem more easily. A significant part of my work often involves discovering or analyzing various difficult issues reported by front-line departments or customers through assembly.
Of course, you don’t need to understand every line of assembly; just being able to roughly understand commonly used instructions will suffice. When you encounter specific problems, you can refer to the corresponding assembly manuals, and then it becomes a matter of practice.
Here, I recommend three C language books and three brief PDFs on Arm64 assembly instructions:
-
“C and Pointers”
This book is written by a foreign author and is suitable for those looking to improve their skills after gaining some C language foundation.
-
“Deep Analysis of C Language”
This book is only over 130 pages long, authored by a Chinese expert, and has already been published in its second edition. If you have the opportunity, consider buying the official version to support the author, as understanding this book should help you in interviews.
-
“High-Quality C++ Programming Guide”
This book by Dr. Lin Rui is great for cultivating your coding standards; it is also a material that my teacher asked me to print and study in the university lab.
-
Additionally, the three PDFs are about the Arm64 instruction set, all quite brief, with the longest being only 135 pages, making them suitable as Arm assembly manuals. I did not include Arm32 instruction set-related materials, as there are better book recommendations for that.
4. Arm Architecture
If you want to master Arm embedded systems, especially if you want to understand the entire system, you need to learn about Arm architecture to a certain extent. If you delve deeply, familiarity with Arm architecture is essential, as many optimizations are closely related to the architecture.
The current Arm processors are broadly divided into three categories: the Cortex-M series for MCUs, the Cortex-A series for application processors: Armv7-A and Armv8-A. Armv7-A is 32-bit CPU, including Cortex-A7/A9/A15/A17, such as the common i.MX6ULL chip, which belongs to Arm Cortex-A7. Armv8-A includes 32-bit CPUs, including Cortex-A35/A53/A57/A72/A73; the mainstream mobile CPUs currently on the market are mostly Armv8-A.
For this section, I recommend two books, and the rest are official documents released by Arm:
-
“ARM Embedded Systems Development – Software Design and Optimization”
I recall that the author of this book is an engineer from Arm. The Chinese version was translated by a teacher from Beihang University. This book introduces classic architectures before Arm11 in great detail, covering Arm assembly instructions, MPU, MMU, Cache, interrupts, and other key module management and applications. It even dedicates two chapters to the design of Bootloader and embedded operating systems.
Although this book was written a long time ago and does not cover Cortex-A series processors, it is still highly recommended because for 32-bit Arm, their architecture and assembly instructions have a significant degree of continuity. Understanding this book will eliminate barriers to understanding Arm architecture.
-
“Complete Handbook of ARM Processor Application Technology”
This book is published by Huqing Yuanjian and mainly introduces ARM processors and ARM assembly programming, which is quite helpful for learning ARM instructions.
-
Arm Official Documentation
Arm official documentation mainly falls into three categories: programming guides (pg), technical reference manuals (trm), and architecture reference manuals (ARM). These three types of documents are arranged in increasing difficulty: pg -> trm -> ARM, with the earlier ones being easier to understand and the latter ones being closer to the chip’s internals and harder to comprehend. Therefore, it is recommended to read them in order.
-
Programming Guides:
-
“The Definitive Guide to ARM Cortex M3 & M4”
-
“Arm Cortex-A Programming Guide”
-
“Armv8-A Programming Guide”
These mainly describe the application principles of various modules on Arm processors and are closely related to software development. The content is only a few hundred pages long, making them the most practical and easiest documents to get started with.
-
Technical Reference Manuals (trm)
trm stands for Technical Reference Manual, which is a separate document for specific CPUs, such as the technical reference manuals for Cortex-A7/A9/A53/A72. The content mainly includes introductions to important modules on the CPU, like Cache, Timer, system control, performance monitoring, and Debug modules. They can range from over 300 pages to just over 100 pages. When you get a specific development board chip, you can read it accordingly.
-
Architecture Reference Manuals (arm)
The arm here refers to the Architecture Reference Manual, which Arm officially calls the Arm arm. This document details the internal details of specific architectures, such as the “Armv7-AR Architecture Manual,” which is a detailed description of the architecture for 32-bit Arm Cortex-A/R series processors, and the “Armv8-A Architecture Manual,” which is a detailed description of the architecture for 64-bit Arm Cortex-A series processors. This document is mainly suitable for SOC design engineers and software engineers involved in low-level chip development. The Armv7-AR architecture document has over 2000 pages, while the Armv8-A architecture document has nearly 9000 pages, making it a monumental work. After understanding the general structure, I usually treat it as a reference book and look up relevant module knowledge as needed.
5. Linux Application Programming
Approaching the Linux world from the perspective of application programming is a great way. Compared to kernel development, application programming is much easier to grasp and doesn’t even require a development board, nor do you have to worry about crashing the entire system by writing incorrect programs. Moreover, through the various mechanisms of application programs, we can perceive the operating principles of the Linux Kernel behind the scenes, as the Kernel serves applications, and every product relies on applications to implement interfaces with end-users. Once the application program is well written, developing the Linux kernel will be much easier to understand why it is implemented this way.
For application programming, I recommend five books:
“Linux Environment Programming: From Applications to Kernel”
“GNU Linux Programming Guide”
“Linux Programming”
“Linux System Programming”
“Advanced Programming in the UNIX Environment”
Except for the first book written by a Chinese author, the remaining four are written by foreigners and are relatively thick, so just choose one that you like and practice it seriously.
6. Basic Principles of Linux Kernel
Many students learning embedded Linux development get stuck at the beginning when they see a driver and find it incomprehensible, with various strange APIs that they do not understand why they need to be written that way. At this point, you need to understand some basic principles of the Linux kernel.
Such books generally do not start by analyzing how to write a specific driver; they focus on describing the basic framework of the Linux kernel, basic data structures, basic driver models, CPU scheduling, memory management, and other mechanisms.
I recommend five books:
-
“Linux Kernel Design and Implementation”
-
“Linux Device Drivers”
-
“In-depth Linux Kernel Architecture”
-
“In-depth Linux Device Driver Kernel Mechanisms”
-
“Mastering Linux Kernel Development”
Of course, you shouldn’t expect to read them thoroughly right away. You might only grasp the general idea on your first read, and it may be quite boring. That’s okay; if you get sleepy, go to sleep, or find a simple driver to write, and after a few days, when you encounter questions, return to read them again. This way, you will eventually understand.
I started looking at the first two books from my senior year; at first, I found them confusing, but later, after working and combining it with writing some drivers, I could finally read them without dozing off. Occasionally, I still take them out to flip through.
I know some students will say that “Linux Device Drivers” is too old; it is targeted at the 2.6 kernel and lacks device trees. However, in technology, there is also a difference between the way and the technique. This book discusses the basic principles of drivers, and although the Linux kernel has continued to evolve, with version 5.4 almost released, the fundamental internal logic remains unchanged. The structure and principles at the lowest level of drivers have not changed. The philosophy of Linux Kernel development is like this: you cannot just come in and completely overhaul previous designs; you must make continuous improvements based on existing foundations. For a system with a large user base, forward compatibility is more important than anything else. As for device trees (dts), those are just technical details that can be mastered quickly once you find the rules.
“In-depth Linux Kernel Architecture” is a book written by a German author, and I haven’t read it, but I know it is very famous and delves deeply, and it is on my reading list.
“In-depth Linux Device Driver Kernel Mechanisms” is written by a Chinese author, based on Linux 2.6.39, and discusses the basic principles and components of Linux device drivers. It is worth reading for those engaged in driver development, and books written by Chinese authors often resonate more closely with our thinking.
“Mastering Linux Kernel Development” is a newer book based on Linux 4.9, so it is only available in English.
7. Linux Kernel Development and Practice
The sixth part of the books I recommended is more theoretical, while this part is more practical, focusing on how to set up the development environment, compile the kernel, construct the file system, and write drivers. Therefore, I suggest that the sixth and seventh parts should be read together.
Again, five books:
-
“Detailed Explanation of Linux Device Driver Development”
This book is written by the famous teacher Song Baohua, and I included two versions: the second edition based on Linux 2.6 and the third edition based on Linux 4.x. I bought both; I read the second edition more often. Both books are excellent and emphasize the combination of theory and practice.
-
“Mastering Linux Device Driver Development”
This book is written by a foreign author, and Teacher Song Baohua participated in the translation of the Chinese version. This book is also based on Linux 2.6 and covers the writing of drivers for important modules in the Linux kernel, such as character devices, block devices, network cards, serial ports, framebuffer, alsa, and usb.
-
“Basic Tutorial on Embedded Linux”
This book is written by a foreign author and translated by Huqing Yuanjian. It covers a wide range of topics related to embedded systems, such as U-Boot, Linux Kernel, file systems, toolchains, and GDB. It is quite valuable for understanding how the entire embedded system is constructed.
-
“Building Embedded Linux Systems”
This book is also written by a foreign author and has already reached its second edition, but I couldn’t find it. This book is quite similar to “Basic Tutorial on Embedded Linux,” and the two can be compared.
8. Theory and Basics of Operating Systems
The Linux Kernel is a comprehensive project, a concrete implementation of numerous scientific theories. Having a basic understanding of these foundational theories will help us learn better. Of course, not understanding this knowledge in a short time won’t affect your ability to debug a driver or bring up a board, but if you want to delve deeper into certain issues, you still need to supplement this knowledge. Especially for students from electronics-related majors, they may not even understand basic computer principles, processes, threads, virtual memory, and Cache concepts, so the following two books can help you well.
-
“Computer Systems: A Programmer’s Perspective”
This book is very famous, authored by a professor at Carnegie Mellon University. It was a book my boss gifted me when I first started working; I didn’t think much of it at first, but as I encountered more questions at work, I flipped through it many times. Recently, I took it out again to look up a Cache-related issue.
-
“Operating Systems: Three Easy Pieces”
This book is recommended by Teacher Song Baohua. It covers some very challenging concepts in operating systems, such as scheduling and memory management, but it explains these principles in a simple and understandable way. After reading this book, I finally gained a clearer understanding of scheduling and memory management in operating systems, and I felt ready to read related kernel code implementations.
In Conclusion
This list of books is very long, with 53 entries!
It is almost impossible to read them all!
In fact, you don’t need to read them in detail!
If from this introductory article you can distinguish which books to read in depth and which to use as reference books when needed, they will be helpful to you.
I would also be very happy about that.
Additionally, writing is not easy; most of the books mentioned here have been published. If possible, buy one to support the author, which is a form of respect for knowledge.
I buy many books every year; some I haven’t had time to read, but just having them on my desk makes me happy.
If you want to get a quick preview and are eager to read these masterpieces, you can scan the QR code to follow the public account: HackforFun, and then send the keyword linux
to get the download link.
Leave a Comment
Your email address will not be published. Required fields are marked *