I worked on the Linux kernel for three months, and the interview salary doubled, so I realized the importance of TA!

Table of contents

1. The importance of learning the operating system (Linux kernel)

Two, the components of the Linux kernel

Three, Linux kernel source code organization structure

Fourth, the knowledge points that need to be learned in the Linux kernel

5. How to start your Linux kernel learning path

-----------------------------------------------------------------------------------------------

1. The importance of learning the operating system (Linux kernel)

Why should I learn the Linux kernel? I believe that many people may not be able to answer this question. Just from a technical level, the research on the kernel will deepen our understanding of technology, and more understanding of source code is the optimization of thinking and thinking methods. However, there are not many actual usage scenarios for it in the general coding process. In a very hanging sentence, if you don't understand the kernel, you can become an excellent coder, but you cannot become an excellent programmer.

So back to the question of why you want to learn.

At present, the situation of computer teaching in domestic universities is not optimistic. Outdated textbooks or insufficient practicality have become common problems, and most of them are theoretical indoctrination without in-depth analysis of the principles and mechanisms of computers. We do not really understand the operating system. working principle. However, the computer skills and knowledge used in the current enterprise Internet companies are far more professional, cutting-edge, and more commercial than the knowledge given to students by schools, so sometimes you will feel that it is difficult for newly graduated programmers to adapt to work. rhythm and content.

The study of the operating system (Linux kernel) will help us deeply understand the principles of computers, and provide learning methods and ideas for subsequent study and work.

Two, the components of the Linux kernel

The Linux kernel is mainly composed of process management, memory management, device drivers, file system, network protocol stack plus a system call .

On a purely technical level, the kernel is an intermediate layer between hardware and software. Its role is to pass the application's request to the hardware, and act as the underlying driver to address various devices and components in the system.

From an application point of view, the kernel can be thought of as an enhanced computer that abstracts the computer to a high level. For example, when the kernel addresses a hard disk, it must determine which path to use to copy data from disk to memory, where the data is located, which command to send to disk via which path, and so on. Applications, on the other hand, need only issue commands to transfer data. How the actual work is done is irrelevant to the application, since the kernel abstracts away the relevant details. The application has no connection to the hardware itself, only to the kernel, which is the lowest level in the hierarchy that the application knows about, so the kernel is an enhanced computer.

Three, Linux kernel source code organization structure

 

Fourth, the knowledge points that need to be learned in the Linux kernel

Learning about the Linux kernel can be learned based on the components and blocks of the kernel.

memory management

l Memory principle

l Virtual memory

l memory system call

File system

l Virtual file system VFS

l Disk file system

l User space system

process management

l Process basis

l Process scheduling

network protocol stack

l Network infrastructure

l Network protocol stack

l System API calls

device driver

l Equipment subsystem

l Linux device model

l Character device driver

l Network card device driver

l block device driver

l Bluetooth subsystem

I feel like I understand these basics.

 

5. How to start your Linux kernel learning path

Let me talk about why I want to learn the Linux kernel first.

The first one is that I prefer open source things, which is now an old fritter, but whenever there is a problem that I don’t understand, I solve it by looking at the source code, and I will be very grateful for my choice. The impact of open source on programmers is enormous.

The second is that I feel that my knowledge of operating systems is too lacking. Although I came from a major, the university does not pay much attention to professional subjects and only knows C language, so the basic things must be supplemented. So I choose to start with a specific system, there are many materials and books, and the source code is also open, which is the only choice for learning. Now that Linux is getting more and more popular, and it is booming in the fields of servers and embedded systems, it also makes me firmly believe that learning Linux well is definitely beneficial to my career without any harm.

The third is that I like it, I want to understand its principles, and I am willing to spend time on research. interest is the best teacher.

1. E-book recommendation:

l "Linux Kernel Complete Notes V3.0 Bookmark Edition"

l "Linux Command Line Encyclopedia - Shotts (william E.shotts)"

l "Linux Command Quick Reference Manual"

l "This is how Linux should be learned"

l "Linux Performance Optimization Master"

l "Linux Environment Programming: From Application to Kernel"

l "Linux cluster and automated operation and maintenance Yu Hongchun"

l "Linux Driver Development Example (Second Edition)"

l "Linux Advanced Programming (3rd Edition)"

l "Building Highly Available Linux Servers (4th Edition)"

l "In-depth understanding of the Linux kernel"

2.  Project learning

 

3. Common interview questions

1. What symbol is used to represent the absolute path? What is used to represent the current directory and the upper directory? What is used to represent the main directory? What command is used to switch directories?

2. How to view the current process? How to execute exit? How to view the current path?

3. How to clear the screen? How to exit the current command? How to execute sleep? How to check the current user id? What command is used to check the specified help?

4. What function does the Ls command perform? What parameters can be used, and what are the differences?

5. Create soft links (shortcuts) and hard links.

6. What command is used to create a directory? What command is used to create a file? What command is used to copy a file?

7. Which command can I use to view the disk space quota of my file system?

8. What commands can be used to view the contents of the file?

9. Randomly write file commands? How to output a string with spaces to the screen, such as "hello world"?

10. Which file is in which folder is the terminal? Which command is in which folder is the black hole file?

11. Which command is used to move files? Which command is used to rename?

12. Which command is used to copy the file? If it needs to be copied together with the folder? If it needs to have a prompt function?

13. Which command is used to delete files? If you need to delete the directory and the files under the directory together? What command is used to delete the empty folder?

14. What kinds of wildcards can be used in commands under Linux? What do they mean?

15. What command is used to count the content of a file? (line number, number of words, number of bytes)

16. What is the use of the Grep command? How to ignore case? How to find lines that do not contain this string?

17. What are the states of processes in Linux? What symbols are used to represent the information displayed by ps?

18. How to make a command run in the background?

19. How to use ps to display all the processes? How to use ps to view the information of the specified process?

20. Which command is used to view background tasks?

21. What command is used to transfer the background task to the foreground? What command is used to execute the stopped background task in the background?

22. What command is used to terminate the process? What parameters?

23. How to check all the signals supported by the system?

24. What command is used to search for files? What is the format?

25. What command is used to check who is currently using the host? What command is used to find the terminal information where you are?

26. What command do you use to view the list of used commands?

27. What command do you use to view the disk space used? What about free space?

28. What command is used to check whether the network is connected?

29. What command is used to view the ip address and interface information?

30. What command is used to view various environment variables?

31. What command is used to specify the command prompt?

32. Where to find the executable file of the search command? How to set and add it?

33. What command is used to find and execute the command?

34. How to alias the command?

35. The definition of du and df, and the difference?

36. Detailed explanation of awk?

37. What should you do when you need to bind a macro or key to a command?

38. If a linux novice wants to know the list of all commands supported by the current system, what should he do?

39. If your assistant wanted to print out the current directory stack, what would you advise him to do?

40. Your system currently has many running tasks. Is there any way to remove all running processes without restarting the machine?

41. What is the function of the hash command in the bash shell?

42. Which bash built-in command can perform mathematical operations?

43. How to view the content of a large file page by page?

44. Which user does the data dictionary belong to?

45. How to view the summary and usage of a linux command? Suppose you happen to see a command you have never seen before in the /bin directory, how can you know its function and usage?

 

Guess you like

Origin blog.csdn.net/qq_28581269/article/details/119683883