编程知识 cdmana.com

Huawei's internal nanny fairy notes are open source! On the operating system programmer must know the knowledge points comb!

The mysteries of the operating system

I remember a poem I used to read when I was a child :

I've been counting since I was a kid .

Count to sensible 、 Count to maturity ,

It's not clear yet .

Why are there so many stars in the sky ?

Like memories and fantasies ,

Always carrying a stubborn mystery ....

For many college students majoring in computer science and related fields , Operating systems are like stars in the sky , There is a stubborn mystery hidden , Never learn clearly . however , Is the operating system really hard to learn ?

No, it isn't . I don't know because I don't see the mystery behind it . This mystery is not known to all . Even people who study operating systems don't necessarily realize it , Not to mention computer beginners .

So what's the mystery ?

There are countless stars in the sky because what we are trying to do is count the stars . If we change the angle , Don't count the stars , It's designers looking for stars , Let him tell us the number of stars , Don't you know ?

This is the secret of learning operating systems . To understand the operating system , We need to find the designer of the operating system , Let them tell us all the secrets of the operating system . Of course , Looking for designers here is not really looking for them , Because it's impossible to find all the designers . The designer here refers to an abstraction , A philosophy of life shared by all designers , Because designers will unconsciously construct their own thinking or life pursuit in the operating system when designing the operating system , To give the operating system the mind , And the operating system runs under the command of this mind .

Introduction to operating system notes outline

 

 

 

 

It's too much , Omit the part Σ( ° △ °|||)︴

The notes are divided into 8 piece , They are basic principles 、 Principle of process 、 Thread principle 、 Principle of memory 、 Principles of documents 、I/O Principles 、 Multi core principle and operating system design

Now let's reveal the secret , Count the stars in the operating system .

Chapter one 、 Basic principles

It's true , The road is invisible

The most important core idea of this article is the role of operating system in the process of computer operation : Magicians and managers . The magician turns ugliness into beauty , Will not be changed to have , Turn less into more ; Managers manage all computer resources to achieve fairness and efficiency “ Double material " state . Understanding these two roles of the operating system will be very helpful to the process 、 Threads 、 Virtual memory 、 Mastering file system and I / O system .

  • The first 1 Chapter introduction to operating system
  • The first 2 Chapter operating system history
  • The first 3 Chapter 2 basic concepts of operating system

How the program works

 

The role of the manager

 

Interview questions

  1. What is an operating system ? Please describe your understanding of the operating system in one sentence .
  2. What do you think of the relationship between operating systems and user programs ? State your ideas .
  3. Briefly list the categories covered by the operating system and the core content of each category .
  4. The operating system has to manage different components , Please discuss the similarities and differences between these management .
  5. What is the purpose of equipment management ?
  6. Some people say that device management software ( Device driver ) Because it's often provided by third parties , So it shouldn't be part of the operating system . What do you think of this ? How do you think you should judge - Whether a software belongs to the operating system ?
  7. Please list the operating system intervention in the process of program execution .
  8. Operating system is an artificial subject , What is the basis ?
  9. What are the characteristics of artificial science ? How does it help us learn operating systems ?
  10. OS You need a compiler to compile , The compiler needs to run OS To support , So who appeared first and who came after ?

The evolution of the operating system

 

The future development trend of operating system

 

Basic knowledge of computer hardware

 

 

Operating system architecture

 

Second articles 、 Principle of process

In a trance , It's like ; In a trance , There's something in it

This article includes chapter 4~6 Content of Chapter . The first 4 The content of the chapter includes the logical inevitability of the process 、 The efficiency of multiprogramming 、 The creation and demise of processes 、 The state of the process and its transitions 、 Process and address space 、 Defects in process management and process model . The first 5 The contents of the chapter include the goal of scheduling 、 First come, first served 、 Time slice rotation 、 Short task first 、 Priority scheduling 、 Mixed scheduling 、 Real time scheduling algorithm , And the priority inversion and thread uncertainty are discussed . The first 6 The chapter includes why to communicate 、 The Conduit 、 Registered pipeline 、 Socket 、 The signal 、 Semaphore 、 Shared memory 、 Message queuing, etc .

 

  • The first 4 Chapter process
  • The first 5 Chapter process scheduling
  • The first 6 Chapter process communication

Introduction to process

 

The benefits of multiprogramming

 

Process management

 

Process embraces : Shared memory

 

Third articles 、 Thread principle

This article is about the process level concurrency mechanism —— The process model is discussed . This article includes chapter 7~10 Content of Chapter . The first 7 The content of the chapter includes the process, the process, the process of the avatar 、 Process management 、 The user state of the process 、 Kernel state and mixed state implementation 、 Process implementation model of modern operating system 、 The relationship between multiple processes 、 The main consideration of process model is . The first 8 The chapter includes why to synchronize 、 The purpose of synchronization 、 The evolution of lock primitives 、 Sleep and wake up primitives 、 Semaphore 、 Tube side 、 Messaging and fences . The first 9 Chapter on the creation of deadlock 、 Development 、 Prevent and avoid explanation , And discuss deadlocks 、 The relationship between livelocks and hunger . The first 10 Chapter describes how to use interrupts to enable and disable 、 Test and setup to implement lock primitives .

  • The first 7 Chapter thread
  • The first 8 Chapter thread synchronization
  • The first 9 The philosophy principle of deadlock response
  • The first 10 Implementation of chapter lock

 

The process of separation —— Threads

 

Kernel state thread implementation

 

User mode thread implementation

 

From user mode to kernel mode

 

No hair system : Dynamic avoidance of boredom

 

Fourth articles 、 Principle of memory

This article includes chapter 11~14 Content of Chapter .

The first 11 Chapter describes the environment of memory management 、 Virtual memory 、 The location of the operating system in memory 、 The location of the program in memory ( Fixed loading address 、 Fixed partition 、 Variable partition )、 Basic memory management mechanism ( Address translation 、 Base limit 、 In exchange for )、 Idle space management, etc .

The first 12 The content of the chapter includes the problem of base limit 、 Paging management 、 A page table 、 Page translation process 、 The advantages and disadvantages of paging management system 、 Multi level page table 、 Address translation speed 、 Lock the page 、 Memory jitter and page size design .

The first 13 Chapter on the history of page replacement algorithm 、 What we want to achieve 、 Various specific page replacement algorithms are explained in detail .

The first 14 The chapter covers the limitations of the page management system 、 Segment management system 、 The advantages and disadvantages of segmentation 、 Segment number and addressing bits , The function of negation of negation in the development of memory management mode is discussed .

The concept of virtual memory

 

Fifo algorithm

 

Use matrix to implement LRU Algorithm

 

Segment management system

 

Chapter five 、 Principles of documents

If there is a lack of success , It's very useful ; Great profits are like rushing , Its use is endless

The content of this article includes chapter 15~ 18 Content of Chapter .

The first 15 Chapter The content of this article includes the disk structure 、 Disk access speed 、 Disk operating system interface 、 Disk access process and disk scheduling .

The first 16 Chapter describes why you need a file system 、 What is a file system 、 The purpose of the file system 、 Basic knowledge of documents 、 File storage structure 、 file type 、 File access 、 File attribute 、 File operations 、 Folder 、 Relative and absolute paths 、 Sharing and linking 、 Memory mapped files, etc .

The first 17 Chapter This includes file system distribution 、 File implementation 、 The implementation of the folder 、 The implementation of shared files 、 Disk space management, etc .

The first 18 Chapter includes file security features ( File access control 、 Access control table 、 Ability chart )、 File reliability performance ( persistence 、 Uniformity 、 journal 、 transaction 、 Follow the shadow 、 Consistency check ) And file system efficiency performance ( Read ahead of time 、 Reduce the distance the magnetic arm moves 、 Log structured file systems LFS).

  • The first 15 Chapter bumping operation
  • The first 16 Chapter file system .
  • The first 17 Chapter file system implementation
  • The first 18 Chapter file system performance

 

The structure of the disk

 

file system

 

Document content organization

 

File implementation

 

The implementation of access control

 

File system persistence

 

Chapter 6 、I/O Principles

Good people , A teacher of bad people ; Bad people , The gift of a good man

therefore , If you want a computer to be really useful , You have to have inputs and outputs . Since the operating system is the master of the computer , Of course, we also need to control the input and output . This article explains the input and output mechanism of computer communication with the outside world . There is only one chapter in this article ( The first 19 Chapter ), The discussion includes the importance and purpose of input and output 、 I / O hardware 、 Physics I/O Pattern ( Exclusive access I/O、 Memory mapped IO、 Reunite with I/O、DMA)、 I / O Software 、 Software I/O Pattern ( A programmable I/O、 Interrupt driven I/O、DMA)、I/O Software layering 、 Device drivers, etc .

 

Device controller

 

Physics I/O Pattern

 

Logic I/O Pattern

 

Chapter 7 、 Principle of multi-core

Kind words do not believe , Words are not beautiful

This article explains the emerging multi-core technology . Focus on the impact of multi-core environment on the operating system . The whole article includes chapter 20 Zhang He 21 Two chapters . The first 20 The contents of the chapter include multi-core processor architecture ( Hyper threading structure 、 Multinuclear structure 、 Multi core hyper threading structure )、 Multi core memory structure (UMA、NUMA、COMA、NORMA)、 The startup process of a symmetric multicore processor computer 、 Communication between multiprocessors 、SMP Cache consistency, etc . The first 21 The content of chapter includes multi-core process synchronization 、 Software synchronization primitives in multi-core environment 、 Spin lock and its realization 、 Queue spin lock 、 Process scheduling in multi-core environment 、 Energy management and multi-core system performance in multi-core environment .

  • The first 20 Chapter multi core structure and memory
  • The first 21 Chapter 1: process synchronization and scheduling in multi-core environment

 

Multiprocessor architecture

 

Multinuclear structure

 

SMP Cache consistency

 

Chapter eight 、 Operating system design

I've heard a lot about it , It's not like keeping in the middle

This article from a strategic point of view on the operating system design of the ten philosophical principles . obviously , There are many design principles for operating systems , This article selects only ten of the most important principles . The first 22 This chapter will discuss and compare these ten principles from two aspects of operating system and human society , In order to make readers more clearly understand that the operating system is the reflection of human society in the computer , Understand the operation of human society, understand the operation of the operating system . After reading this article , Readers can discover other design principles and principles of mining operating system .

Operating system design of the first 1 A philosophical principle : Hierarchy

 

Philosophical principles : Beauty for simplicity —— For simplicity , To eternity

 

See the end of the article for the full version

These two copies. 【 Operating system notes 】 The documents are as follows 400+、300+ page , Need a full version of friends , You can praise this article and pay attention to the editor , See the picture below , obtain !!

 

Second OS note

 

A lot of content , A little Σ( ° △ °|||)︴.......................................................

 

Processes and threads

 

Interprocess communication

 

Dispatch

 

Memory

 

No memory abstraction

 

The concept of address space

 

file system

 

Free space block

 

 

File system management and optimization

Physical dump and logical dump

 

File system consistency

 

I/O

 

I/O equipment

 

I/O hierarchy

 

disc

 

Common interview questions in large factories

 

Omit ..............................................................................................

About the operating system , You have to know the noun

 

( Because there's so much content , Not one by one Σ( ° △ °|||)︴)

These two copies. 【 Operating system notes 】 The documents are as follows 400+、300+ page , Need a full version of friends , You can praise this article and pay attention to the editor , See the picture below , obtain !!

版权声明
本文为[Tianqi architecture technology sharing]所创,转载请带上原文链接,感谢

Scroll to Top