Chapter One Operating System Overview

Operating system overview

1. The concept and function of the operating system

Insert picture description here

1. The concept of operating system

(1) The manager of system resources
(2) Provide easy-to-use services to the upper layer
(3) The software closest to the hardware

2. Functions of the operating system

(1) The manager of system resources:
Before executing a program, the program needs to be placed in memory before it can be processed by the CPU
Insert picture description here

(2) Provide simple and easy-to-use services to the upper layer:
packaging ideas: the operating system encapsulates the hardware into easy-to-use services, so that users do not need to care about the underlying hardware principles, and only need to issue instructions to the operating system to use the computer
Insert picture description here

Program interface: The program interface can be used for system calls in the program. Ordinary users cannot directly use the program interface,
but can only use the program code indirectly, such as:
Insert picture description here
(3) The software closest to the hardware: the
operating system extends the hardware machine : Organize the CPU, memory, hard disk and other hardware reasonably so that various hardware can cooperate with each other to achieve more complex functions

  1. Knowledge review:
    Insert picture description here

Second, the characteristics of the operating system

1. The operating system has four characteristics

Insert picture description here

2. Concurrency

Refers to multiple events occurring in the same time interval. These events occur simultaneously at the macro level and alternately occur at the micro level.
Note:
(1) Different from parallel, parallel refers to multiple events occurring at the same time
( 2) Single-core CPU can only execute one program at the same time, and each program can only be executed concurrently.
(3) Multi-core CPU can execute multiple programs at the same time, and multiple programs can be executed in parallel

3. Sharing

Means that the resources in the system can be used by multiple concurrently executing processes in memory.
Two resource sharing methods:
Insert picture description here

Example:
Mutually exclusive sharing method: the camera can only be assigned to one of WeChat or QQ process in the
same time period. Simultaneous sharing method: WeChat and QQ send files to friends, and the two processes access hard disk resources at the same time (alternatively microscopically)

4. Virtual

Refers to turning a physical entity into several logical counterparts.
Insert picture description here
Virtual memory technology: users only have 4G running memory, but they can run multiple software with a total memory greater than 4G.
Virtual processor technology: single-core CPU can run multiple at the same time Procedure (alternate microscopically)

5. Asynchronous

Refers to the implementation of the process is not consistent to the end, but stop and go, and move forward at an unknown speed

  1. Knowledge review:
    Insert picture description here

note:

  1. Concurrency and sharing mutually exist conditions
  2. Concurrency and sharing are the two most basic features of an operating system. Without these two, there is no virtual and asynchronous

3. The development and classification of operating systems

1. Knowledge overview

Insert picture description here

2. Manual operation stage

Insert picture description here

Main disadvantages: Contradiction between man-machine speed and extremely low resource utilization

3. Single-channel batch processing system

Introduce offline input/output technology (complete with peripheral machine + tape), and the supervisory program is responsible for the input and output of the job
Insert picture description here

Main advantages: alleviate a certain degree of human-machine speed contradiction, and improve resource utilization.
Main disadvantages: there can only be one program running in the memory, and the next program can only run after the end of the program. The CPU has a lot of time While waiting for I/O to complete, resource utilization is still low

4. Multi-pass batch processing system

The operating system was officially born to support the concurrent execution of multiple programs.
Main advantages: concurrent execution of multiple programs, sharing computer resources, and greatly improved resource utilization.
Main disadvantages: no human-computer interaction function (users cannot control program execution in the middle, (Can only wait for computer processing to complete)

5. Time-sharing operating system

The computer serves each user/job in turn in units of time slices, and the user can interact with the computer through the terminal.
Main advantages: solves the problem of human-computer interaction, allows multiple users to use the same computer, and each user is independent of each other.
Main disadvantages: Some urgent tasks cannot be processed first, and the operating system is completely fair to each user/job

6. Real-time operating system

Main advantage: It can respond to some urgent tasks first, and some urgent tasks do not need time slice queuing
Insert picture description here

7. Several other operating systems

Network operating system
Distributed operating system
Personal computer system

  1. Knowledge review:
    Insert picture description here

4. Operating mechanism and architecture of the operating system

  1. Instructions: Refers to the most basic commands that the processor (CPU) can recognize and execute
    Insert picture description here

  2. Two instructions:
    Insert picture description here

  3. Two processor states:
    Insert picture description here

  4. Two procedures:
    Insert picture description here

  5. Kernel: The
    kernel is the underlying software on the computer and is the most basic and core part of the operating system.
    The program that implements the kernel functions is the kernel program
    Insert picture description here

  6. Operating system kernel diagram:
    Insert picture description here

  7. Knowledge review:
    Insert picture description here

Five, interruption and exception

  1. The function of the interrupt: It will make the CPU change from the user mode to the core mode immediately, so that the operating system can regain control of the CPU

  2. Interrupts are the only way for the operating system kernel to regain CPU usage rights

  3. If there is no interrupt mechanism, once the application program runs on the CPU, the CPU will always run the program, there is no concurrency at all

  4. Core mode → User mode: execute a privileged instruction, that is, modify the PSW flag to be user mode, which means that the operating system gives up the
    right to use the CPU

  5. User mode → core mode: triggered by an interrupt. After the interrupt occurs, the currently running process is suspended, and the OS kernel handles the interrupt

  6. Classification of interruptions:
    Insert picture description here

  7. Knowledge review:
    Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_49343190/article/details/108561113
Recommended