Huawei's technical officer has made another surprise, the complete documentation notes of the Hongmeng operating system are now going viral

Operating System (Operating System, referred to as OS) is a computer program that manages and controls computer hardware and software resources, the interface between the user and the computer, and also the interface between computer hardware and other software.

It can manage the hardware, software and data resources of the computer system, control program operation, improve the man-machine interface, provide support for other application software, and maximize all the resources of the computer system. In addition, it also provides various forms of user interface, so that users have a good working environment, and provide necessary services and corresponding interfaces for the development of other software.

This is exactly the mystery of learning operating systems. To understand the operating system, we must find the designers of the operating system and let them tell us all the secrets of the operating system.

Of course, the search for designers here is not really looking for them, because it is impossible to find all the designers. The designer here refers to an abstraction, a philosophy of life shared by all designers, because when designing an operating system, designers will unconsciously construct their own thinking or life pursuits in the operating system, thereby giving operations The system is based on the mind, and the operating system runs under the command of this mind.

Introduction to operating system notes outline

The notes are divided into 8 chapters, namely basic principles, process principles, thread principles, memory principles, file principles, I/O principles, multi-core principles, and operating system design

Let us now reveal the secrets together and count the mysteries in the operating system.

The first chapter, basic principles

The falsehood is true, the avenue is invisible

The most important core idea of ​​this article is the role of the operating system in the process of computer operation: magician and manager. The magician turns ugliness into beauty, turns nothing into existence, and turns less into more; while managers manage all computer resources to achieve a "double material" state of fairness and efficiency. The understanding of these two roles of the operating system will be very helpful to the mastery of processes, threads, virtual memory, file systems and input and output systems.

  • Chapter 1 Introduction to Operating Systems
  • Chapter 2 Operating System History
  • Chapter 3 Basic Concepts of Operating System

How the program works

 

Manager role

Interview questions

  1. What is an operating system? Please describe your understanding of the operating system in one sentence.
  2. What is your opinion on the relationship between operating systems and user programs? Explain your thoughts.
  3. Briefly list the areas covered by the operating system and the core content of each area.
  4. The operating system needs to manage different components. Please discuss the similarities and differences between these managements.
  5. What is the purpose of equipment management?
  6. Some people say that device management software (device drivers) should not be part of the operating system because it is often provided by third parties. What is your opinion on this? How do you think it should be judged-is a piece of software an operating system?
  7. Please list the intervention of the operating system during program execution.
  8. What is the basis for saying that the operating system is a man-made subject?
  9. What are the characteristics of man-made subjects? How does it help us to learn operating systems?
  10. The OS needs a compiler to compile, and the operation of the compiler needs the support of the OS. Then who appears first and who appears later?

The evolution of operating systems

The future development trend of operating systems

Basic knowledge of computer hardware

Operating system structure

Because the content of the document is too large, this article only lists the above few operating system knowledge points, which are not shown here. If you want to get the full version of [Operating System] PDF, please forward this article and follow the author, private message editor [666] to get it! !

Chapter Two, Process Principle

In a daze, there is something in it; in a daze, there is something in it

This chapter includes the content of Chapters 4~6. Chapter 4 describes the logical inevitability of the emergence of processes, the efficiency of multiprogramming, the creation and extinction of processes, the state and conversion of processes, processes and address spaces, process management and process model defects. The contents of Chapter 5 include scheduling goals, first-come-first-served, time slice rotation, short task priority, priority scheduling, hybrid scheduling, real-time scheduling and other algorithms, and discuss priority inversion and thread uncertainty. Chapter 6 covers why communication, pipes, named pipes, sockets, signals, semaphores, shared memory, message queues, etc. are needed.

 

  • Chapter 4 Process
  • Chapter 5 Process Scheduling
  • Chapter 6 Process Communication

Introduction to Process

Benefits of multiprogramming

Process management

Process embrace: shared memory

The third, thread principle

This article discusses the process-level concurrency mechanism-the process model. This chapter includes the contents of Chapters 7-10. The content of Chapter 7 includes process clone technology process, process management, process user mode, kernel mode and mixed mode realization, modern operating system process realization model, the relationship between multiple processes, and the main considerations of the process model. Chapter 8 covers why synchronization, the purpose of synchronization, the evolution of lock primitives, sleep and wake primitives, semaphores, monitoring, message passing, and fences. Chapter 9 explains the occurrence, development, prevention, and avoidance of deadlock, and discusses the relationship between deadlock, livelock, and starvation. Chapter 10 describes how to use interrupt enable and disable, test and setup to implement lock primitives.

  • Chapter 7 Threads
  • Chapter 8 Thread Synchronization
  • Chapter 9 Philosophical Principles of Deadlock Response
  • Chapter 10 Lock Implementation

 

Process clone technique-thread

Kernel mode thread implementation

 

User mode thread implementation

Enter kernel mode from user mode

No hair control: dynamic avoidance of death

Chapter Four, Memory Principle

This chapter includes the contents of Chapters 11-14.

Chapter 11 describes the memory management environment, virtual memory, the location of the operating system in the memory, the location of the program in the memory (fixed load address, fixed partition, variable partition), and basic memory management mechanisms (address translation, base address limit) , Exchange), free space management, etc.

Chapter 12 explains the problem of base address limit, paging management, page table, page translation process, advantages and disadvantages of paging management system, multi-level page table, address translation speed, locked pages, memory jitter and page size design.

Chapter 13 explains in detail the ins and outs of the page replacement algorithm, the purpose to be achieved, and various specific page replacement algorithms.

Chapter 14 includes the limitations of the page management system, the segment management system, the advantages and disadvantages of the segment, the segment number and the number of addressing bits, and discusses the role of negation in the development of the memory management model.

The concept of virtual memory

First-in-first-out algorithm

Use matrix to implement LRU algorithm

Segment management system

Chapter 5, Principles of Documents

If there is a lack of great success, it will not be used; if a great profit is high, it will be used endlessly

The content of this article includes the content of Chapter 15~18.

The 15th chapter tells about the content including the disk structure, disk access speed, disk operating system interface, disk access process and disk scheduling.

Chapter 16 describes why a file system is needed, what is a file system, the purpose of the file system, basic knowledge of files, file storage structure, file types, file access, file attributes, file operations, folders, relative and absolute paths, sharing Links, memory-mapped files, etc.

Chapter 17 includes file system distribution, file realization, folder realization, shared file realization, disk space management, etc.

The content of Chapter 18 includes file security performance (file access control, access control list, capability table), file reliability performance (persistence, consistency, log, transaction, shadow, consistency check) and file system efficiency performance ( Read in advance, reduce the moving distance of the magnetic arm, log structure file system (LFS).

  • Chapter 15 Touch Disk Operation
  • Chapter 16 File System.
  • Chapter 17 File System Implementation
  • Chapter 18 File System Performance

 

The structure of the disk

File system

File content organization

File realization

Enforcement of access control

File system persistence

Because the content of the document is too large, this article only lists the above few operating system knowledge points, which are not shown here. If you want to get the full version of [Operating System] PDF, please forward this article and follow the author, private message editor [666] to get it! !

Chapter 6, I/O Principles

The good, the teacher of the bad; the bad, the resource of the good

Therefore, if a computer is really useful, it must have input and output. Since the operating system is the controller of the computer, of course it also needs to control the input and output. This article explains the input and output mechanisms of the computer to communicate with the outside world. There is only one chapter in this article (Chapter 19). The discussion includes the importance and purpose of input and output, input and output hardware, physical I/O modes (proprietary channel I/O, memory mapped IO, composite I/O , DMA), input and output software, software I/O mode (programmable I/O, interrupt-driven I/O, DMA), I/O software layering, device drivers, etc.

 

Device controller

Physical I/O mode

Logical I/O mode

Chapter Seven, Multi-core Principle

Good words do not believe, faith words are not beautiful

This article explains the emerging multi-core technology. Focus on the impact of the multi-core environment on the operating system. The whole article includes two chapters, Chapter 20 and Chapter 21. The content of Chapter 20 includes multi-core processor structure (hyper-threading structure, multi-core structure, multi-core hyper-threading structure), multi-core memory structure (UMA, NUMA, COMA, NORMA), the startup process of symmetric multi-core processor computer, and the Inter-communication, SMP cache consistency, etc. Chapter 21 includes multi-core process synchronization, software synchronization primitives in multi-core environments, spin locks and their implementation, queue spin locks, process scheduling in multi-core environments, energy management in multi-core environments, and multi-core system performance.

  • Chapter 20 Multi-core Architecture and Memory
  • Chapter 21 Process Synchronization and Scheduling in a Multi-core Environment

 

Multiprocessor structure

Multi-core structure

SMP cache consistency

Chapter Eight, Operating System Design

If you hear a lot of poor, don’t keep it in the middle

This article explains the ten philosophical principles of operating system design from the perspective of a high-level building. Obviously, there are many operating system design principles, and only ten very important ones are selected in this article. Chapter 22 discusses and compares these ten principles from the two levels of operating system and human society, so that readers can understand more clearly that operating system is the reflection of human society in computers, and understand the operation of human society. The operation of the system. After reading this article, readers can discover other design principles and principles of mining operating systems.

The first philosophical principle of operating system design: hierarchical architecture

Philosophical principle: simplicity is beauty-seeking simplicity and eternity

Processes and threads

Interprocess communication

Scheduling

RAM

No memory abstraction

The concept of address space

Because the content of the document is too large, this article only lists the above-mentioned operating system knowledge points, which will not be shown here. To get the full version of [Operating System] PDF, please forward this article and follow the author, scan the QR code below to get it without routine ! !

When people don't work hard

God will take away your talent bit by bit

Your so-called confusion right now

It was just watching myself sinking soberly.

Guess you like

Origin blog.csdn.net/yunzhaji3762/article/details/109087873