Now even Linux do not understand, so if I had to learn an operating system like!

Original Statement

This article first appeared in the public micro-channel number [programmers] oblique Huang

Author: Huang oblique

Reprint please indicate the source and author at the beginning of the article.

This article Mind Mapping

Here Insert Picture Description

Brief introduction

Learning program, the operating system is the foundation of knowledge you need to master, then the operating system in the end what is it?

That goes without saying what, what operating system is not Windows, Linux, Mac, IOS, Android, IOS such we use it every day?

That is true, but the operating system as computer science is a basic discipline, certainly not so down to earth, right, on the concept of total tall to the point, what you frighten it.

According to the introduction Baidu Encyclopedia, the operating system is to manage computer hardware and software resources of a computer program, but also the core and the cornerstone of the computer system. The operating system need to be addressed as priorities memory management and configuration, the system determines supply and demand of resources, the control input device and an output device, the basic operation of the network and management of the transaction file system. Operating system also provides a user interface to let users interact with the system.

This presentation tall enough on it, then in the end what operating system it is, in simple terms, the operating system is the management of computer hardware and software resources of a piece of software, the computer's hard disk, keyboard, mouse, monitors and other equipment, have made it to manage, you open the game, open the browser or watching movies, but also to be executed by the operating system.

Without an operating system, the computer will lose its soul, just a bunch of hardware only.

Why learn operating system

After understanding the basic concepts of the operating system, then we look at why we have to learn the operating system?

First, of course, because the interview is to test it.

Secondly, no matter what programming language you learn, and can not avoid dealing with the operating system, such as you learn Java, use multi-threading technology, in fact, the operating system is responsible for the management of processes and threads, so the threads in Java and often OS thread or process-one correspondence.

In addition, you will learn to memory allocation, such as c ++ where you can allocate a section of memory directly, at this time is actually calling the API provided by the operating system memory allocation.

Operating system not only manages the process and thread scheduling, memory allocation and management, as well as processing and IO device, but also responsible for managing the file system and network.

Most importantly, the operating system is responsible for loading code into memory from the hard disk, and then tell cpu memory to read the code, which is the basis of all computer is running.

如果不懂操作系统,你在未来学习编程语言的高级特效,涉及到线程进程调度,内存分配,或者是学习Linux相关的知识时,都会一头雾水,所以,只有学会了操作系统,我么才能够更好地学习其他语言和技术。

如何学习操作系统

第一次接触

第一次接触操作系统同样是在我研究生的时候,当时自学计算机网络已经受到了惊吓(被大部头教科书劝退),于是学习操作系统时也更加的小心翼翼,当时我找了一本体量稍微小一点的《操作系统》教科书来学习。

用了大概一周左右的时间,我把这本书翻了一遍,隐隐约约还记得一些概念,进程和线程,进程调度算法、内存管理的分页和分段,页面置换算法,但其实当时压根没有理解这些东西,再过了一周之后也就忘得差不多了。

由于我当时找的多是Java方面的实习,很多公司对于操作系统的考察并不多,偶尔就问问线程和进程的区别,

于是对于操作系统的学习我当时并没有多大的重视,毕竟还有一堆Java的书要啃呢,先都啃到位再说。

入门学习阶段

就这样,我一直保留着只看过一本教科书的操作系统水平,全情投入到复习Java的伟业中了,然而当我学到Java并发编程和JVM的时候,总感觉有哪里不对劲:Java中的线程和操作系统的线程是什么关系,JVM的内存管理和操作系统的内存管理又是什么关系。

我抱着这个疑问学完了Java并发原理和JVM,当然也是一知半解的那种。事后证明,在没有操作系统基础的情况下,越往上层学,摔得越惨,勿用浮沙筑高台,说的便是这个道理,底子打好了,才能往上爬,否则都是浮云。

我在百度实习的那段时间里,再次意识到了操作系统这门课程的重要性,于是我找来了某乎强烈推荐的《深入理解计算机系统》这本史诗级大部头,这本书其实并不是一本纯粹的操作系统书籍,而是结合了计算机组成原理和操作系统两方面的内容,基本上把计算机内部工作的那些原理都给讲清楚了。

第一次看这本书的时候,我坚持了不到三天就放弃了,于是第二次看这本书,我在公司花了快一个月的时间才总算看得差不多。

在以前,我连什么是x64什么x86都搞不清楚,看完这本书之后,我好歹对CPU、内存、硬盘的工作方式,以及处理器的工作方式等内容有了一些理解,不得不说,这个时候我才算是对操作系统入了门。

强化学习阶段

光看书还不足以应对大厂的面试,大公司对操作系统的考察是很严格的,比如百度、腾讯和头条,对于操作系统的要求还是比较高的。

除了进程和线程区别这种最简单的面试题之外,还会有一些比较复杂的问题,比如”进程调度算法有哪些,讲一下FIFO和LRU算法“、”内存中的分页和分段有什么区别,分页里的页面置换算法有哪些,LRU是怎么实现的“、”产生死锁的必要条件,解决死锁的办法“、”线程间通信和进程间通信的方法都有哪些,具体怎么使用“

此类问题,也算是比较常见的操作系统面试题,但是要回答清楚的话还是需要一定功力的。

当时我应对这类问题,基本上就是通过刷面经和背答案,对于很多原理性的东西理解得并不深刻,但是也没有找到什么解决办法。

冲刺阶段

既然自己学了半天效果都不佳,那不如直接向大佬学习吧,于是我辗转各大博客,技术社区,技术公众号,看了很多关于操作系统的文章,发现确实有很多讲的不错的内容,看起来比自己死记硬背要靠谱的多了。

最早看的优质内容是《码农翻身》作者刘欣老师的文章,真的是相见恨晚,他有十几篇文章是专门讲解操作系统的,从CPU开始,讲到内存、硬盘、线程、进程,每篇文章都是用故事化的文字介绍这些计算机里最硬核的观念,可以说是四两拨千斤了。

看完这个系列的操作系统文章之后,我对于操作系统中的一些疑惑基本上也都消除了,再回去看一看那些面试题,觉得也没那么复杂了。

当然了,对于面试题我们还是要认真准备的,该翻的面经要翻,该搞懂的面试题一个也不能放过,有了之前的基础之后,再去搞懂这些面试题就简单很多了,至此,我对于操作系统的学习也算是告一段落。

推荐资源

书籍

《深入理解计算机系统》
《操作系统导论》

总结

关于操作系统的学习,我们就讲到这里了,如果还有什么疑问也可以到我公众号里找我探讨。

Yes, I would like to ask you in books and articles mentioned in the video where to find? I have given you ready

More resources can receive free, in my public No. [programmers] Huang oblique reply "operating system" to receive the corresponding resources.

image

Guess you like

Origin www.cnblogs.com/xll1025/p/12364377.html