[Operating system] Operating system overview summary-summary of basic knowledge points

halo~I’m bay_Tong Tong Xiaobai. The
content of this article is a summary and sharing of what he has learned by Tong Xiaobai. The knowledge points will be edited and updated from time to time. For the latest updates, please refer to the update log. Welcome to leave a message, Pointing

【Update log】

Recently updated:

  • There is no edit record for the time being, we will continue to improve and optimize in the future
Computer unified examination 408 syllabus requirements

2021 Computer Unified Exam 408 Exam Syllabus Data Structure Subject Investigation Objectives

  • Grasp the basic concepts, basic principles and basic functions of the operating system, and understand the overall operating process of the operating system
  • Master the strategies, algorithms, mechanisms and interrelationships of operating system processes, memory, files and I/O management
  • Be able to use the operating system principles, methods and techniques learned to analyze and solve problems, and be able to describe related algorithms in C language

2021 Computer Unified Examination 408 Operating System Examination Syllabus Changes
Insert picture description here

2021 Computer Unified Exam 408 Exam Syllabus Requirements for the Overview of Operating System
Insert picture description here

Basic concepts of operating system

The definition, goals, and roles of operating systems

Definition: A set of programs that control and manage computer hardware and software resources, reasonably schedule various jobs, and facilitate users to use the computer.

  • It is the first layer of system software that expands the hardware (bare metal) functions
  • Manage computer hardware and software resources
  • Provide an interface for the user to interact with the system
  • The most basic and important system software of a computer system

Goals: Convenience and effectiveness are the two most important goals of an operating system

  • Convenience: convenient for users to use the computer
  • Effectiveness: Improve computer system resource utilization and system throughput
  • Scalability: to adapt to the update requirements of computer hardware, architecture and application development
  • Openness: follow the world standard specifications to be compatible with each other, easily achieve interconnection, and achieve portability and interoperability between different applications

effect:

  • It is the interface between the user and the computer hardware system
    Insert picture description here

     常见访问计算机系统的方式概述
     	系统调用方式(程序接口)
     		访问系统资源必须通过由操作系统提供的系统调用函数才可以访问系统资源
     	命令方式(命令接口)
     		通过操作系统提供的命令接口输入有关系统命令来获取服务,支持和控制用户程序的运行
     	图形、窗口方式
     		通过窗口或图标实现操作系统资源的访问,并取得相应的服务
    
  • It is the manager of computer system resources. Orderly management of software and hardware resources, so that all kinds of resources can be fully and effectively used. In
    summary, these resources can be divided into four types of operating systems to provide users with usable resources, namely processors, memory, I/O devices, files ( Data and procedures)

  • Realize the abstraction of computer resources
    Insert picture description here

The basic characteristics of the operating system (concurrent, shared, virtual, asynchronous)

The basic characteristics of the operating system: concurrency, sharing, virtual, asynchronous. Concurrency and sharing are the two most basic features of operating systems


Concurrent

The concurrency of the operating system: refers to the existence of multiple running programs in the computer system at the same time, and the ability to process and schedule the simultaneous execution of multiple programs

The distinction between concurrency and parallelism:

  • Concurrency: Two or more events occur in the same time interval, that is, multitasking. Realized through time sharing
    Insert picture description here
  • Parallel: Two or more events occur at the same time, that is, multiple processing. Relevant hardware support is required, such as a multi-pipeline or multi-processor hardware environment [PS: A CPU can use a multi-core architecture to achieve parallel execution]
    Insert picture description here

The introduction of process: the execution process of a section of program, which is the basic unit that can run independently and be used as resource allocation in the system. It is composed of a set of machine instructions, data, stack, etc.

No process
Insert picture description here
introduced. The introduction of a process
Insert picture description here
can greatly improve the utilization of system resources and increase the throughput of the system


shared

Sharing in the operating system environment: it is called resource sharing or resource reuse, which means that the resources in the system can be used by multiple concurrently executing processes in the memory

According to different resource attributes, the process of resource reuse is also different. There are two main ways to realize resource sharing.

  • Mutually exclusive sharing method: Only one process is allowed to use it for a period of time. Only after the current job is finished and released, can other jobs be allowed to use it. This method is mutually exclusive sharing. Such resources are called critical resources or exclusive resources.
  • Simultaneous access: multiple jobs can be accessed at the same time on a macro level within a period of time, and the resource can be accessed alternately on a micro level, that is, "time sharing"

The relationship between concurrency and sharing: the two conditions exist for each other

  • Resource sharing is conditional on program concurrency
  • If the system cannot implement effective management of resource sharing, it will inevitably affect the concurrent execution of the program, or even fail to execute concurrently at all.

virtual

Virtualization of the operating system: the function of turning a physical entity into a number of logical counterparts through a certain technology is called virtual

Virtual technology classification:

  • Time division multiplexing technology: By using the idle time of the processor to run other programs, the utilization rate of the processor is improved (that is, the concurrent execution of multiple programs). eg: Virtual processor technology, virtual device technology
  • Space division multiplexing technology: each time only a part of the user program is transferred to the memory to run, and the part is swapped out after the run is completed, and then another part is swapped in to run in the memory. eg: virtual memory technology

PS:
Insert picture description here

  • If the time-sharing multiplexing method is adopted, the average speed of each virtual device must be equal to or lower than 1/N of the speed of the physical device
  • If the space division multiplexing method is used, the average space occupied by each virtual device must be equal to or lower than 1/N of the space owned by the physical device

asynchronous

  • When can each process in the memory be processed and run, when is it suspended due to a certain resource request, how fast the process advances, how much time does each program take to complete, and so on, Are unpredictable, this is the asynchronous nature of the process
  • As long as the operating system is equipped with a complete process synchronization mechanism and the operating environment is the same, the job will get exactly the same result even after multiple runs

The main functions and services of the operating system

Responsible for the management of software and hardware resources in the system, and rationally organize the computer's work flow; provide users with a good working environment and friendly interface (that is, provide users with an interface to access the system, and users can obtain system services through the interface)

Mainly includes processing and management, memory management, device management, file management, and user interface, etc.


Processor management

Processor management is the core function of the operating system, which coordinates the management of processes
Insert picture description here


Memory management

Provides a good environment for the operation of multi-programs, improves the utilization of memory, is convenient for users to use, and can logically expand the memory

Mainly include: memory allocation, memory protection, address mapping, memory expansion, etc.


Equipment management

main mission

  • Respond to the I/O request made by the user process, allocate the required I/O device for the user process, and complete the I/O operation of the instruction
  • Improve the utilization rate of CPU and I/O equipment, increase the I/O speed, and make it convenient for users to use various equipment

Mainly include: buffer management, equipment allocation, equipment processing and virtual equipment, etc.


File management

The information in the computer is in the form of files. The part of the operating system responsible for file management is called the file system. It mainly hangs user files and system files to facilitate users' use and ensure the security of files.

Mainly include: file storage space management, directory management, file operation management, file protection


Interface with users

In order to facilitate the use and programming of computer systems by users, the operating system provides users with a user interface through which users can request specific services from the operating system

Mainly include user interface (command interface), program interface and graphical interface

[Graphic interface can be regarded as a user interface in terms of operation mode, but the essence is a function realized through system calls, so it is generally divided separately]

The user interface (command interface): The system provides a set of commands for the user to directly or indirectly operating
Insert picture description here
program interface: also known as system calls, a program-level interface, the user program to obtain operating system services only way

The user program requests the operating system service through the access control instruction, and the operating system analyzes the parameters in the access control instruction and calls the corresponding subroutine to serve the user

Distinguish between work, process, and program

Insert picture description here
For detailed related knowledge content, please refer to the professional basic column article "Relationship of Procedures, Processes, and Operations"

Operating system development classification

Computer system without operating system

Manual operating system: input the program and data into the computer at the same time as it is started, and then start the computer to run. After the program is run and the calculation result is taken away, the next user is allowed to enter the computer

Disadvantages:

  • User monopolizes the whole computer: only one user can monopolize the computer and all its resources at the same time
  • CPU waits for manual operation: the next operation must wait for the completion of the previous operation during the execution process, and resources such as CPU and memory are idle at this time

Offline input and output mode: the input and output of programs and data are completed under the control of the peripheral machine, without host intervention (ie offline I/O).
Insert picture description here
Advantages:

  • Improve the CPU utilization rate, reduce the idle time of the CPU, and ease the contradiction between man and machine
    . The input and output of the program are completed by the peripheral machine, which does not occupy the host time, thereby effectively improving the CPU utilization rate.
  • Improve the I/O speed, alleviate the contradiction between the CPU and the I/O device speed. The
    data is loaded from the original low-speed device to the high-speed disk under the control of the peripheral machine. When the CPU needs data during operation, it can be from the high-speed disk. Transfer data into memory on tape or disk, greatly improving I/O speed

Batch processing system

Single-pass batch processing system: To complete the processing of batch jobs when there is only one program running in the memory, the programmer needs to plan the execution sequence of the program in advance, and it will be automatically completed after startup, without human intervention.

Main features:

  • Automation: A batch of jobs on the tape can be run automatically without manual intervention
  • Sequentiality: Each job on the tape is sequentially entered into the memory, and the job that is loaded into the memory first is completed first
  • Single pass: only one program runs in the memory

Disadvantages: the resources in the system are not fully utilized, and the CPU utilization rate is low


Multi-pass batch processing system: allows multiple programs to enter the memory at the same time, and allows multiple programs to share the respective software/hardware resources in the system to alternately use the CPU. When a program is suspended due to an I/O request, the CPU immediately switches to running other programs

Prerequisite: The system has interrupt function

Features:

  • Multi-channel: Simultaneously store multiple independent programs in the computer memory
  • Macroscopically parallel: multiple programs that enter the system at the same time are all running in the same time interval
  • Microscopically serial: multiple programs in the memory take turns occupying the CPU and execute alternately

Main advantages (development momentum):

  • High resource utilization: make full use of various resources (keep CPU busy; improve memory utilization; increase I/O equipment utilization...)
  • High system throughput: CPU and other resources are kept busy; jobs are transferred to memory in batches, and only when the job is completed or can’t go on, the system is switched, and the system overhead is small (but more expensive than a single-channel system)
    [System throughput Amount: the total amount of work completed by the system in a unit time]

Main disadvantages:

  • Long average turnaround time: All jobs must be queued up in order, with a long turnaround time
    [job turnaround time: the time it takes for the job to enter the system until it completes and exits the system]
  • No interactive ability: Once the user submits the job to the system, until the job is completed, the user no longer participates in the operation of the job, which is extremely inconvenient to modify and debug the program

Mainly solved problems: processor contention problems, memory allocation and protection problems, I/O device allocation problems, file organization and management problems, job management problems, user and system interface problems, etc.

Time-sharing operating system

Insert picture description here

Real-time operating system

Insert picture description here

Network operating system and distributed operating system

Network operating system: Combine all computers in the computer network to realize data transmission

The main feature: the sharing of various resources in the network and the communication between computers

Extension: Distributed computer system.
Insert picture description here
Distributed operating system: The operating system that manages the distributed computer system is called the distributed operating system.

Main features: distribution, parallelism

The difference between a distributed operating system and a network operating system: several computers in a distributed operating system cooperate with each other to complete the same task

Operating system classification summary and other operating systems

The operating system classification can generally be summarized as follows
Insert picture description here
: Other operating systems:
Insert picture description here

Operating environment of the operating system

Core state and user state

The CPU in a computer system usually runs two different types of programs:

  • Operating system kernel program: a management program that executes a series of privileged instructions
    (privileged instructions: instructions used by the operating system kernel, user programs cannot be executed. Eg: I/O instructions, setting interrupt mask instructions, clearing memory instructions, storage Protection instructions, set clock instructions, etc.)
  • User-programmed (referred to as user program or application program): is an application program that executes user instructions

In order to avoid the operating system and its key data (such as PCB process control block, etc.) from being intentionally or unintentionally damaged by the user program, the processor execution state is usually divided into two types: core state and user state

Core state: also known as management state and system state, which is the state of the machine when the operating system management program is executed

Has high privileges, can execute all instructions including privileged instructions (also called generalized instructions), and can access all registers and storage areas

In the operating system, the kernel of the operating system includes some modules that are closely related to the hardware (such as clock management, terminal processing, device drivers, etc.) and programs that run more frequently (such as process management, memory management, device management, etc.). At the core

Core state instructions actually include system call instructions and some operation instructions for clocks, interrupts and primitives

User mode: also known as target mode, which is the state of the machine when the user program is executed

Has lower privileges, can only execute specified instructions, and can only access specified registers and storage areas

PS:

  • The two types of programs and their respective storage spaces are strictly divided. During execution, user-mode programs cannot directly call core-mode programs. They must execute instructions to access the core-mode (access control instructions, also called trap instructions or trap instructions). Cause an interrupt, and then transfer from the interrupt system to the corresponding program in the operating system
  • The user mode turns to the core mode, not only the state needs to be switched, but the used stack may also need to be switched from the user stack to the system stack
  • Access control command can only be used in user mode, it is not a privileged command

The way of changing from user mode to kernel mode when the system is running

System call: The system call can be considered as initiated by the user process, and it is the only way for the user program to obtain the operating system services

All resource-related operations must make service requests to the operating system through system calls, and the operating system kernel program is responsible for completing certain privileged instructions.

The system call initiates the complete conversion process from user mode to kernel mode:

  • User program passes system call parameters
  • Execute access control instructions (that is, trap instructions or trap instructions), so that the state of the CPU changes from user mode to core mode
  • After that, the operating system kernel program will deal with the system call request and execute the corresponding service program.
  • After the processing is completed, the operating system kernel program returns the right to use the CPU to the user program, that is, the CPU state returns from the core state to the user state

Interrupt: Usually refers to an external interrupt, that is, an interrupt that occurs in an event that has nothing to do with the program running on the current processor other than the instruction executed by the CPU. It is passive.
Insert picture description here
Complement: The execution process of the external interrupt
Insert picture description here

Exception: usually refers to internal interrupts, which refer to events that originate from within the CPU executing instructions and are passive. eg: Events caused by illegal operation codes of the program, address out of bounds, arithmetic overflow, virtual memory missing pages, special trapping instructions, etc.

Detailed knowledge of the contents of interrupt exception visible Principles of Computer Organization column article "input-output (I / O) system Summary - Basic knowledge points summary"

Operating system architecture

Insert picture description here
This part of the software architecture is similar, detailed knowledge of the content visible professional basis column article "Software architectural foundation"

Continuously updating...
I am Tong Xiaobai, a computer noob

Guess you like

Origin blog.csdn.net/bay_Tong/article/details/113714370