Introduction to Linux kernel Cultivation

Source: Internet
Author: User

Recommended blog posts:Linux Kernel "problem Gate"-learning issues and experience highlights

Recommended download:Methodology of essence edition of "Cultivation of Linux kernel"

 

So far, just to the 18 th anniversary of the advent of Linux, the growth of 18 years, such as a dream, a lot of wind and rain, a lot of emotion.

I recall the old saying: Today is definitely determined by a series of accidents. One month in the past, I was caught in Linux by chance and still could not find a way to get out of it. It was this time or even later that I accidentally joined together, thus, I want to write these words here. Then, when you pick up this book by accident and accidentally see this passage, will you ask yourself: what kind of necessity will this happen?

If you still decide to continue this trip, first meet two people, specifically one person and one penguin. This person is actually Linus Torvalds. We also call it Linus or Linus. It is the genius from Finland who spent money on Christmas and birthday in January 2, 1991, by accident, a major financial decision was made to buy a computer with a price of 3500 US dollars in three years, starting with Linux.

Penguins are the symbols of Linux. Many people may not know Linus, but may know this penguin. This is a strange phenomenon, just as many people know Microsoft but do not know Bill Gates. In any case, Linus shaped the penguin and gave it a cool look, just as it swallowed a beer. In addition, this penguin is quite special. Other penguins are black-mouthed and black-legged, but it is yellow-mouthed and yellow-legged, which makes it look like a cross-breed between duck and Penguin, maybe it's the result of a night's stay with a local penguin on a tour of the South Pole.

Next, before you continue, I want to ask you a question: Are I forcing myself to learn the kernel? I hope that you will not answer the question, but I hope that there will always be some distance from reality, because many times, I have found that people around me are forced to like the kernel because they think it is very advanced. How painful it is to force yourself to like a person. Perhaps, the most pleasant answer to this question is "to tell the truth, my enthusiasm for learning has never been low ." As Linus hoped in his autobiography just for fun.

Organization of the book

This book divides Linux kernel learning into four levels: comprehensive understanding, basic skills, Interest Orientation, selection of important in-depth research, integration into the community, participation in development, and persistence, and persistence. To sum up, it is to "fully understand the basics, focus on interest-oriented deep research, contribute to community integration, and stick to it again ." (If you are a fan of truth-building novels, you can compare them to refining, Building Foundation, jiandan, and yuanying .)

The first-level practice includes the first three chapters. It aims to give you a comprehensive understanding of Linux and the kernel, and master the analysis methods of the Linux kernel source code.

Chapter 2 describes the growth history of Linux over the past 18 years.

Chapter 2 introduces the Kernel configuration and compilation process. Just like learning any large software source code, it is the first step to learn how to compile and configure the kernel.

Chapter 2 describes the basics of kernel learning, the kernel architecture, directory structure, and code features, and the tools used to browse kernel code. Finally, kconfig and makefile are two important roles in kernel source code analysis. The USB subsystem is used as an example to demonstrate how to use these two roles for code analysis.

The second level of cultivation covers 4th ~ Chapter 11 introduces the working principle of most parts of the kernel. According to the development rules of understanding, after having a global understanding and understanding of the kernel in the first level of practice, we should look for a sub-system or module based on interest, in-depth Study and Analysis of Its code. If you do not understand it, you can understand it through the community, email list, or directly sending an email to maintainer for consultation. Do not pass the analysis, many kernel mechanisms such as synchronization and interruption will also be well understood. As the saying goes, is the truth.

Therefore, the chapter at the second level only explains the key concepts and working principles to help you understand this part of the code, not in detail.

Chapter 2 discusses system initialization. Everything is difficult at the beginning. system initialization is a very complicated process. However, for kernel source code learning, starting with this part should be a good choice. In particular, the discussion about subsystem initialization should be what you need to know when you choose any kernel subsystem to start analysis.

Chapter 2 discusses system calling. It is a bridge between applications and the kernel. learning and understanding it is a great transition to the kernel.

Chapter 2 discusses the Interrupt Processing Mechanism of the kernel, including the general IRQ layer that is not involved in almost any kernel book.

Chapter 2 discusses kernel abstraction of processes and how processes are created and destroyed. If we regard the operating systems running on computers and various software as a series of organic life forms, rather than a set of dead commands, this is a world of processes, what is different from our human world is that the individual in the process world is a fresh process, not a person. The human world has ethics and laws to restrict management, and the process world also has its own management mechanism. This is what chapter 7th will display-process management.

Chapter 2 discusses process scheduling, focusing on the O (1) scheduler that plays an important role in kernel history and the latest CFS scheduling.

Chapter 2 discusses memory management. memory is the home of processes. Here we discuss how the kernel allocates a home for each process and tries its best to achieve "Home Ownership ", and to ensure the security of each home.

Chapter 2 discusses file systems, mainly Virtual File Systems (VFS). It creates an abstraction layer on top of various specific file systems, shielding the differences between different file systems.

Chapter 2 discusses device drivers. For driver development, the understanding of device models is fundamental, and the use of spec, datasheet, and kernel source code is critical.
Through the second-level practice, you should have a deep understanding of at least one or two parts, and be familiar with the general techniques used in kernel code, then you should begin to enter the third level, and strive to integrate into the kernel development community. At this time, you will no longer be the role of diving in the community, but will express your own opinions on a certain issue. You can already try to participate in kernel development. Even if you have modified only one incorrect word in the kernel and translated a document you need, you have made your own contribution, will be recognized by everyone.
In this book, the third layer only includes two chapters. This is because the kernel cultivation will become more dependent on itself, and any reference books will not replace your own reflection and summarization.

Chapter 2 describes the basic information required to participate in kernel development.

Chapter 2 discusses the kernel debugging technology. Like chapter 13th, you can simply regard the content as some tips in kernel cultivation.

As for the fourth level, there are only two words-persistence. How far we can go on the cultivation path of the kernel depends on how long we can stick to it. Perhaps it is more appropriate to use a formula: mentality + Interest + Passion + time + x = y.

 

The revolution has not yet succeeded. I still need to work hard. -- Share with you.

......

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.