concept:
What is a program? What is a process?
A program is a bunch of files
A process is a running process/program, a process is an abstract concept that originated from the operating system
What is an operating system?
An operating system is a control program that is located between computer hardware and application software and is used to coordinate, manage, and control the resources of computer hardware and software.
The two major functions of the operating system:
1. Encapsulate complex hardware operations into interfaces and provide them for application use
2. Manage and schedule processes, and make the competition between processes and hardware orderly
Multi-channel technology: (multiplexing + hardware-supported process memory isolation)
The background of multi-channel generation is to achieve the effect of concurrent execution of multiple processes in the case of a single CPU
The implementation of the multi-to-the-point technology is to solve the orderly scheduling problem of multiple programs competing or sharing the same CPU. The solution is multiplexing.
Multiplexing:
Spatial multiplexing (multiple programs reuse memory space)
Divide the memory into several parts and put each part into a program, so that there are multiple programs in the memory at the same time
The memory between programs must be divided, and this division needs to be implemented at the hardware level and controlled by the operating system.
One program can access the memory of another program if the memory is not partitioned with each other:
First of all, the security is lost, the program can access the memory of the operating system, and can get the permissions of the operating system
The second loss is stability. When a program crashes, it may reclaim the memory of other programs.
Time multiplexing (multiple programs multiplexing CPU time)
While one program is waiting for I/O, another program can use the cpu
The embodiment of time multiplexing:
The CPU needs to be switched when encountering IO operations (to improve operating efficiency).
A process that occupies the CPU for too long has to be switched (reduces efficiency and ensures the effect of concurrency)
The memory space between processes and processes is isolated from each other: it must be isolated at the hardware level
Time-sharing operating system: multiple online terminals++++ multi-channel technology