Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Self-taught programming Methodology: how to learn operating system

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Original statement

The author: Huang Xiaoxie

Please be sure to indicate the source and the author at the beginning of the article.

The mind map of this article

Brief introduction

To learn programming, the operating system is the basic knowledge you must master, so what is the operating system?

Needless to say, isn't the operating system Windows, Linux, Mac, IOS, Android, IOS that we use every day?

This is true, but the operating system, as a basic discipline in computer science, must not be so approachable. Generally speaking, it is a bit of a high-end concept to deter you.

According to Baidu encyclopedia, the operating system is not only the computer program that manages computer hardware and software resources, but also the core and cornerstone of the computer system. The operating system needs to deal with basic tasks such as managing and configuring memory, determining the priority of supply and demand of system resources, controlling input and output devices, operating networks and managing file systems. The operating system also provides an interface that allows users to interact with the system.

This introduction is high-end enough, so what exactly is the operating system? to put it simply, the operating system is a kind of software for managing computer hardware and software resources. The hard disk, mouse, keyboard, monitor and other devices in the computer have to be managed by it. When you open a game, open a browser, or watch a movie, you have to execute it through the operating system.

Without the operating system, the computer loses its soul and is just a pile of hardware.

Why learn the operating system?

After understanding the basic concepts of the operating system, let's take a look at why we should learn about the operating system.

First of all, of course, it is because the interview is about to take an exam.

Second, no matter what programming language you learn, you can't avoid dealing with the operating system. For example, you learn Java and use multithreading technology. In fact, the operating system is responsible for managing processes and threads, so threads in Java often correspond to threads or processes of the operating system one by one.

In addition, you will learn about memory allocation. For example, a section of memory can be allocated directly in C++. At this time, the API provided by the operating system is actually called for memory allocation.

The operating system is responsible for managing not only the scheduling of processes and threads, the allocation and management of memory, and the processing of devices and IO, but also the management of file systems and networks.

Most importantly, the operating system is responsible for loading the code from the hard disk into memory, and then telling cpu to read the memory code, which is the basis on which all computers run.

If you do not understand the operating system, you will be confused when learning the advanced special effects of the programming language in the future, involving thread process scheduling, memory allocation, or learning knowledge related to Linux, so, only by learning the operating system, will we be able to better learn other languages and technologies.

How to learn the first contact with the operating system

The first time I came into contact with the operating system was also when I was a graduate student. At that time, the self-study computer network was already frightened (discouraged by a large textbook), so I was more careful when learning the operating system. At that time, I found a slightly smaller "operating system" textbook to learn.

In about a week or so, I flipped through the book and vaguely remembered some concepts, processes and threads, process scheduling algorithms, paging and segmentation of memory management, and page replacement algorithms. but in fact, I didn't understand these things at all at that time, and I almost forgot about them a week later.

Since I was mostly looking for internships in Java, many companies didn't do much research on the operating system, and occasionally asked about the difference between threads and processes.

So I didn't pay much attention to the study of the operating system at that time. After all, there are still a lot of Java books to be gnawed at.

Entry learning stage

In this way, I have always retained the operating system level that I have only read a textbook, and devoted myself to reviewing the great cause of Java. However, when I learned about Java concurrent programming and JVM, I always felt that something was wrong: what is the relationship between threads in Java and threads in the operating system, and what is the relationship between JVM memory management and operating system memory management.

With this question in mind, I finished learning the Java concurrency principle and JVM, which is, of course, the one with little knowledge. It was proved afterwards that in the absence of the foundation of the operating system, the higher the level of learning, the worse the fall, and do not use floating sand to build a high platform. this is what we are talking about. only when the foundation is laid can we climb up, otherwise it will all be floating clouds.

During my internship at Baidu, I once again realized the importance of the operating system course, so I found an epic tome called "in-depth understanding of computer Systems," which is highly recommended. In fact, this book is not a pure operating system book, but a combination of computer composition principles and operating system content, basically explain the principles of the internal work of the computer.

The first time I read this book, I gave up after less than three days, so the second time I read this book, it took me nearly a month in the company to get the same result.

In the past, I didn't even know what x64 or x86 was. After reading this book, I at least got some understanding of CPU, memory, how the hard disk works, and how the processor works. I have to say, that's when I got into the operating system.

Reinforcement learning stage

Reading alone is not enough to cope with interviews from big companies, which are very strict in their inspection of the operating system, such as Baidu, Tencent and Toutiao.

In addition to the simplest interview questions, such as the distinction between processes and threads, there will also be some more complex questions, such as "what are the process scheduling algorithms, talk about the FIFO and LRU algorithms", "what is the difference between paging and segmentation in memory, what are the page replacement algorithms in paging, how is LRU implemented" and "the necessary conditions for deadlocks?" Solutions to deadlocks "," what are the methods of inter-thread communication and inter-process communication, and how to use them? "

This kind of question can be regarded as a common operating system interview question, but it still takes some skill to answer it clearly.

At that time, I dealt with this kind of problem, basically through brushing the face and memorizing the answer. I didn't have a deep understanding of many fundamental things, but I didn't find any solution.

Sprint stage

Since I have been studying for a long time and the effect is not good, I might as well learn directly from the boss, so I have read a lot of articles about the operating system on various blogs, technology communities, and technology official accounts, and found that there is indeed a lot of good content, which seems to be much more reliable than cramming.

The first high-quality content to see is the article by teacher Liu Xin, the author of "programmer turn over". He has more than a dozen articles devoted to explaining the operating system, starting with CPU, talking about memory, hard disk, threads, and processes. Each article introduces the concept of the hardest core in these computers with storytelling words, which can be said to be worth a thousand pounds.

After reading this series of operating system articles, some of my doubts about the operating system are basically eliminated, and when I go back to take a look at those interview questions, I feel that it is not so complicated.

Of course, we still have to prepare carefully for the interview questions, we have to turn over the interview questions, and we can't let go of any of the interview questions we should understand. With the previous foundation, it will be much easier to understand these interview questions. At this point, my study of the operating system is over.

Recommended resource books

"in-depth understanding of computer systems"

Introduction to operating system

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report