Linux is very popular recently. Some people want to learn Linux kernel. What is it?

Linux kernel is an operating system (OS) kernel, which is essentially defined as UNIX like. It is used for different operating systems, mainly in the form of different Linux distributions. The Linux kernel is the first truly complete and outstanding example of free and open source software. Linux kernel is the first truly complete and outstanding example of free and open source software, which has been widely adopted and contributed by thousands of developers.

Linux kernel was founded in 1991 by Linus Torvalds, a student at the University of Helsinki in Finland. As programmers adjust the source code of other free software projects to extend the functions of the kernel, it has made rapid progress. Torvalds first uses 80386 assembly language task switcher and terminal driver, and then publishes it to comp.os.minixUsenet Group. It was quickly adapted by the MINIX community to provide insights and code for the project.

Linux kernel is becoming more and more popular because GNU Hurd, the kernel of GNU, is not available and complete, while Berkeley software infrastructure (BSD) operating system is still plagued by legal problems. With the help of the developer community, Linux 0.01 was released on September 17, 1991.

Linux kernel learning route

Many students don’t have much contact with Linux and know nothing about the development of Linux platform. And now the trend is more and more show that as an excellent software developer, or computer IT industry practitioners, master Linux is a very important resource and means of livelihood. Next, I will talk about the learning methods of Linux and some things that should be paid attention to in my study, combining with my personal development experience of several years, Linux, UNIX like system, and open source software culture.

As I said just now, many students may not even know what Linux is before, and even know nothing about UNIX. So let’s start from the most basic point. We don’t talk much about the history of Linux and UNIX. Let’s go straight to the introductory study.

It’s very easy to get started with Linux. The question is whether you are patient, whether you love to toss, and whether you don’t exclude heavy maintenance such as re installation. You can’t learn Linux well without tossing. Brother bird said that if you want to really understand the partitioning mechanism of Linux, you should be quite proficient in using LVM. You can’t accumulate without more than 20 times of Linux installation experience, so you must not be afraid of tossing.

Since we all used windows before, I try my best to take care of these “rookies”. My recommendation is that if you’re first exposed to Linux, try it in a virtual machine. I recommend VirtualBox for virtual machines. I don’t advocate using VM because VM is closed source and charged. I don’t want to promote piracy. Of course, if you have enough money, you can try VM, but I have to say that even VM is not necessarily good. Paid software is not necessarily good. First of all, VirtualBox is very small. The installation package under Windows platform is about 80mb, while VM is often 600MB. Although it is powerful, it consumes a lot of resources. Besides, VirtualBox can fully meet your needs. So, it’s up to you to choose. How to use the virtual machine, is your business, this I don’t teach you, because it’s very simple, not Google or Baidu can, good English can directly see the official document.

Now let’s talk about the Linux distribution. As you can see, the Linux distribution is not Linux. Linux only refers to the kernel of the operating system. As a Cuban, don’t let me explain. I don’t have time. My recommended distribution is as follows:

Ubuntu is suitable for rookies who pursue stable official support, have weak requirements for system stability, like the latest applications, and relatively don’t like tossing developers.

Debian, a much more difficult distribution than Ubuntu, is characterized by a stable and easy-to-use package management system. Its disadvantage is that it lacks enterprise support and is driven by community development.

Arch, the first choice for fashion developers, has the advantages of fast package update and seamless upgrade. One time installation can basically work all the time. There is no version concept like Ubuntu. The professional point is called rolling upgrade. Keeping your system up-to-date is a must. The disadvantages are obvious and unstable. At the same time, the installation and configuration is more troublesome than Debian.

Gentoo, which is more difficult than arch, tests the comprehensive level of users. It is the first choice for experts and hackers to display their own technical means and configure their own system on demand.

Slackware is similar to Gentoo.

CentOS, a replica version of RedHat maintained by the community, is completely recompiled and generated using RedHat’s source code, and its compatibility with RedHat is the best in theory. If you focus on Linux servers, such as network management, web hosting, then CentOS is your choice.

LFS, the ultimate hacker show off tool, completely from the source code installation, compiler system. Before installation, you only get one document. What you have to do is to build your Linux according to your instructions, step by step, command by command, and software package by package. It’s completely under your control, and what you want is what you want. If you make LFS, it proves that your Linux skills are quite good. If you can learn and use LFS documents flexibly, and then transplant Linux from source code to embedded system, I dare say that you can mix well in Chinese enterprises.

You have to choose a system that suits you, install it in the virtual machine, and start using it. If you want to learn Linux quickly, I have a suggestion that you should forget the graphical interface. Instead of thinking about whether the graphical interface can provide answers to your questions, you should go all over the world and ask how to use the command line to solve your problems. In this process, you’d better master the commands of Linux well, at least you need to know the commonly used commands, and establish your own knowledge base, which is your accumulated knowledge.

In the next stage, you need to learn C + + / C + + development of Linux platform, as well as bash script programming. If you are deeply interested in Java, there is Java. Similarly, I suggest you abandon the graphical interface IDE and start with vim. Why VIM instead of Emacs? I have no intention of provoking editor wars, but I think VIM is suitable for beginners and developers who are slow witted. Emacs has too many keys and it’s too complicated. I’m afraid of it. Then GCC, make, eclipse (Java, C + + or). Although C + + is listed in eclipse, I don’t recommend using ide to develop C + +, because it’s not a Linux culture, and it’s easy for you to ignore some problems you should pay attention to. IDE makes you lazy like a pig. If you are very interested in program debugging and testing, GDB also has to learn well. If it is not GDB, it is also a required course. This is the first step of development. Note that I haven’t mentioned the content of Linux system API, and don’t care about it at this stage. What you have to do is accumulate experience, development experience in Linux platform. I recommend the following book: C language programming, Tan Haoqiang can also. C language, white paper is certainly better. C + + recommends C + + primerplus. If I don’t like Java, I don’t recommend it. In terms of tools, we recommend the official Manual of vim, GCC Chinese documents, GDB Chinese documents, GNU open source software development guide (e-Book), assembly language programming (let you have a preliminary understanding of library, link, embedded assembly, compiler optimization options, without depth).

If you can’t pass this stage, you don’t have to go on. This is the bottom line and the most basic foundation. Otherwise, you should leave and don’t hawk Linux development. The programs made by unprofessional Linux developers are contrary to Linux culture or UNIX culture. Programs can’t go far, and can’t be like Bash and vim. So if you can’t do it well, just leave.

Next, enter the Linux system programming, the only choice, APUE, UNIX Environment advanced programming, read over and over again, read 10 times are too few, if you can in the university this book rotten, the content has been practiced, there are works, your oral expression ability is strong enough, you can persuade all the examiners in the face-to-face test. (it may be a bit exaggerated, but APUE is absolutely biblical reading material, from which even windows programmers can draw nutrients. Google founder’s desk book and zalburke’s bedside book.)

After reading this book, you will have a good understanding of Linux programming. What are the differences between Linux and windows? What are their advantages and disadvantages? My summary is as follows: it’s hard to develop windows platform. Microsoft’s system API is always expanding. If you want to use the latest, most efficient functions and the most suitable functions for the current popular system, you must always learn. If you memorize Linux API, you can’t memorize 100. And it will last for a long time. Why not? Because it should be compatible with UNIX and conform to POSIX standard. So the development of Linux platform is mostly focused on the underlying or server programming. This is its advantage. Of course, graphics are the weakness of Linux, but I’m from a developer’s point of view. I don’t care because I can adapt to the command line. If I have a better graphical interface, I’ll take it as a gift. What’s more, you don’t know what windows has done, and you will always be led by the nose by Microsoft. If Microsoft says win8 doesn’t support QQ, Tencent can’t cry to death. As long as you don’t like Linux, you can change it completely. In addition, although windows is used by many people, it is used in a single occasion and focuses on the desktop. Linux has developed in all aspects, especially in cloud computing, server software, embedded fields, and enterprise applications. It has a broad prospect and first-class compatibility. Because it supports POSIX, it can run seamlessly on UNIX system. Whether it is Apple’s MAC or IBM’s AS400 series, it is fully supported. In addition, Linux development environment support is absolutely first-class, whether it is C / C + +, Java, bash, python, PHP, JavaScript,…… Even c#supports it. Microsoft is not very friendly except for the Visual Studio Suite, is it?

If you have a lot of feelings after watching APUE, hope to verify some of your ideas or experience, recommend unix programming art, the world’s top hackers will share their views with you.

Now it’s time for diversion. In general, I divided into four directions: network, graphics, embedded, device driver.

If you choose the network, and then subdivide, I am not familiar with the others, just say the server software writing and high-performance concurrent programming. Relatively speaking, this is the highest technology content in network programming, and also the bottom. It takes a lot of experience, reading a lot of books and doing a lot of projects.

My opinion is to read in the following order:

Deep reading of APUE – especially process, thread, IPC, socket

Multi core programming – pthread must be thorough, you are NB

Unix network programming – Volume 1, Volume 2

TCP / IP network details – Volume I should read the above two books again and again

5. Detailed explanation of TCP / IP Network – I think it’s almost the same when I see Volume 2. Of course, Volume 3 is better. I’ll try my best to see it

6. Lighttpd source code – this server is also very famous

7. Nginx source code – compared with Apache, nginx source code is less, if you can see a general, very NB. Look at the source code is mainly to learn inside the socket programming and concurrency control, think all excited. If you have these skills, you can try to send your resume to blizzard, write the server background for them, and think about the world’s Warcraft running on your server software.

Linux kernel TCP / IP protocol stack

If you still like driver design, you can take a look at the lower layer protocols, such as link layer, what to write, router, network card, network device driver and embedded system software should not be a problem.

Of course, the general network company, even Baidu level should not hesitate to hire you. I just need time and experience to read these books, so I can do it before 35 years old! Job hopping to give you the future!

Graphic direction, I think graphic direction is also very promising, the following aspects.

The industry and game development of OpenGL are relatively mature abroad.

Film and television animation special effects, such as Pixar, are also more mature in foreign countries.

GPU computing technology, can be applied to the browser Web rendering, GPU computing resources, due to open source reasons, there are a lot of documentation procedures can refer to. If you can enter the development of foxes, or Google to do browser development, it should be very good.

Embedded direction: embedded direction does not say, Linux is very important.

Master multiple architectures, not only x86, arm, SCM and so on must also understand. I don’t understand the hardware. I foresee that you will die on the way. I also want to take the embedded direction, but I think that as far as the embedded method is taught in the school, I can’t even compete with the students who study electronics. If you go to embedded application development, you can only wish you good luck. Don’t run into companies like Nokia and HP, otherwise you will be miserable.

Driver design: software development cycle is very long, different hardware, very fast. With so many new hardware coming out every month, it’s your job to make them work on Linux. Due to the good compatibility of Linux, if it is not too low-level driver, the basic C language can be done, and the system architecture has little impact. Because of the system support, you may make some changes to use PC hardware on arm. Therefore, the development of hardware driver is not like embedded, which requires high hardware knowledge. There are many directions that can be engaged in, such as home appliances, especially factories like Sony, Hitachi, Seagate and Foxconn, which are very scarce.

LDD — the basic reading material of Linux driver design and kernel programming

Deep understanding of Linux kernel – Advanced

Linux source code – endless

Of course, you also need to read books on the Internet.

Suggestions on learning Linux kernel

Learning Linux kernel is not like learning a language. You can master C or Java in one month or three months. Learning Linux kernel is a step-by-step process. It is very important to master the correct learning route of Linux kernel. This article will share some suggestions on learning Linux kernel.

1. Understand the basic concept of operating system. If not, you can learn “operating system: design and implementation” AndrewS.Tanenbaum The one I wrote. Take MINIX as an example to explain the concept of operating system. It’s highly recommended.

2. With the basic concept of operating system, we can understand the mechanism of Linux. Recommended “Linux kernel design and implementation” written by Robert love. This book conceptually explains what Linux has and how it works. This book should be read through carefully and repeatedly.

3. With the understanding of Linux kernel, we need to study the source code of Linux kernel. The classic is “deep understanding of Linux kernel” DanielP.Bovet I wrote it. When learning this book, you should learn from the kernel code. This book is very hard to learn, so much code to study. But if you understand this book, Congratulations, you are already familiar with the Linux kernel.

4. If you want to develop device drivers, you can learn from “Linux device driver” O’Reilly press. This is a good introduction to driver. There is also a “proficient in linux driver development” is also a good teaching material, you can refer to see. Learning driver, inevitably to learn some hardware protocols and information, research which to find the corresponding hardware documents, to understand the working principle of hardware. I will not elaborate on these.

5. Network part, learn some Linux network part, learn “in depth understanding of Linux network technology insider.”. This book makes the network part of Linux very clear and thorough. But usually do not do this work research, also do not have to study so deep, after all, there are fewer related positions.

6. Now the work related to Linux mainly focuses on some embedded development fields, such as arm and MIPs. We should learn the following information about the architecture and understand the design and working mode of CPU. Arm looks at the corresponding chip manual, which is very detailed. MIPS just looks at seempipsrun. There are one or two editions. There are some differences between the two editions. I recommend reading both.

7. Add some experience. Don’t think Linux is huge and complex, so it’s hard to learn. You can learn anything if you study hard. It depends on your perseverance and perseverance. In addition, don’t take detours, don’t read the books about linux0.11 on the market, learn what you want to learn directly. Just like learning C language to see what Tan Haoqiang, detours, effort does not spend less, but also seriously affect the learning effect.

As for the Linux kernel learning route, let’s say a few more words about application programming. Sometimes we often need to:

1. To learn Linux application programming, it is recommended to read advanced programming in UNIX environment and do all the examples in it. You will have a systematic understanding of the whole Linux programming.

2. For Linux, there is a book called “Linux system programming”. After learning the last book, I will understand it soon. Mainly for Linux to understand some specific content, said quite a full, very practical.

3. Linux network programming, the system to learn about “unix network programming.”. Volume 1, socket networking API “, basically network application related programs are no problem.

These contents, divided into several years, step-by-step learning plan, will become a Linux master. Personally, I suggest taking part in the training of Huaqing farsightedness, the learning efficiency will be much higher. Purposeful participation in the training, shortening the cycle and rapid prototyping are the needs of the times.

The above is the Linux kernel learning route, about learning Linux kernel suggestions, I hope to help my friends.

Leave a Reply

Your email address will not be published. Required fields are marked *