[Ostep] 01 operating system intro

operating system

What is the operating system

The operating system is the software running on the hardware, sandwiched between the hardware and the upper-level applications. Coordinates and manages resources for hardware, while providing abstraction for applications.

To do this, the operating system mainly uses a common technology, which we call virtualization (virtualization). In other words, the operating system converts physical resources (such as processors, memory, or disks) into virtual forms that are more versatile, powerful, and easier to use. Therefore, we sometimes refer to the operating system as a virtual machine (virtual machine).

A long time ago, the operating system had another name-"Master Control Program". Without this "Master Control Program", the software (machine instructions) can also run, but the "Master Control Program" makes the software run more efficiently and conveniently.

In the earliest days, the operating system only provided some APIs, or a set of functions. For example, programmers do not need to manually write I/O programs to the hard disk, but can directly call specific functions provided by the operating system.

Later, the operating system went beyond what a simple library could provide—he protected the hardware. The concept of system call was born. The corresponding system call not only does the I/O program to the hard disk, but also controls the application program not to perform more atomic operations at will (not completely access the system hardware), because Such behavior may harm the system.

Later, the UNIX system appeared, and the operating system began to run multiple programs at the same time. At this time, the concept of concurrency was introduced, and the operating system began to protect memory between the two processes.

Finally, it is the world of Windows, mac OS and Linux.

Virtualization, concurrency and persistence

Virtualization, or abstraction, for example, a process is the most basic abstraction. The machine instruction sequence itself has no life cycle. I can choose to start execution at any time and anywhere. What the operating system has to do is decide when and where to start. carried out. So the process is abstracted, and the abstraction of the process is provided for the upper layer by constantly switching between different memory spaces.

Concurrency is a problem. This problem is so common that it is still being discussed a lot in higher-level abstractions and in the modern development process.

It comes from the system's scheduling logic and atomic operations. Since we cannot predict when the operating system will switch the currently executing application, we must resolve the conflict of access to common resources between multiple threads (processes are discussed in the operating system). The problem (in the high-level abstraction, we are focusing on the thread concurrency problem, while in the implementation of the operating system, we are discussing the process concurrency problem).

Persistence is very simple and can be simply understood as storage. Its manifestation is the file system of the operating system. For example, storing a file on the hard disk involves I/O operations on the hard disk. But he is far from that simple.

Guess you like

Origin blog.csdn.net/qq_16181837/article/details/112295513