当前位置:网站首页>1. What does the operating system do?

1. What does the operating system do?

2020-11-09 00:28:00 Hakou

In the last article, we told a brief history of computers , In the development of computer, the operating system gradually appeared . But what the operating system is for doesn't tell us , So this article will talk about The role of operating systems in the whole computer world .

Let's first look at the definition of an operating system .

That's what Wikipedia says :

An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.( The operating system is the management of computer hardware and software resources , And system software that can provide a variety of common services for applications .)

Baidu Encyclopedia is so introduced :

operating system (Operating System, abbreviation OS) It is a computer program that manages computer hardware and software resources . The operating system needs to deal with memory management and configuration 、 Determine the priority of supply and demand of system resources 、 Control input device and output device 、 Basic affairs such as operation network and management file system . The operating system also provides an interface for users to interact with the system .

As can be seen from the above description : First , The operating system is a piece of software , It's like any other application , It's software in nature . secondly , Operating system, which can manage computer hardware resources , such as CPU、 Memory 、 Hard disk 、 mouse 、 Monitors and so on . and , The operating system, which also manages the software on the computer , It can control the life and death of other software on the computer , Kill whoever you want , If you want to give more resources to any software, you can give more resources to that software .

therefore , The operating system, which acts as an intermediary coordinator between hardware and application software , As shown in the figure below .

What are the specific tasks of the operating system ?

1. Process management . A process can be understood as a task , For example, playing music is a process . The state of each process can be divided into newly build 、 be ready 、 function 、 Blocking 、 End These five states , Of course, in the actual operating system, the process is more than these States , After all, the reality is always more complicated . Process management is to manage the process in these five states : The loader creates a new process , Allocate resources to the newly created process and enter the ready state , When the process gets CPU Then it can be run , At this point it's in the running state , If you run half of it CPU It's preempted by other processes , It's going to get stuck , Wait for other processes to put CPU Give it back , When it gets it again CPU After entering the running state and executing the task , It goes into a termination state , The operating system will allocate the memory previously allocated to it 、 File and other resources recycling , And kill it .

2. Process synchronization . If the operating system runs only one process from beginning to end , There must be no process synchronization problem . What is process synchronization ? It's when multiple processes grab resources , How to arrange these processes to acquire resources . For example , We must all have been to the playground , You'll also find that there's a lot of people lining up for every hot project . If you think of people as processes , Popular games are seen as resources , When a lot of people want to play a hot item without queuing up , This project will be a mess , Even the whole project can't work properly . How to manage everyone to use the game project is called process synchronization , In reality, people usually synchronize processes by queuing , It's the same thing in the operating system .

3. memory management . When a program runs, it becomes a process , And processes need memory to run . Let's use people as an example , After birth , He needs food 、 clothes 、 house 、 Transportation, etc , These things can be seen as memory resources . When people die , These things will be recycled , It's the same as the operating system reclaiming process resources .

4. Storage management . Storage management is not just about disk or file management , It also includes how the process works with peripherals IO.

5. Equipment management . A computer contains a lot of peripherals , Like the monitor 、 disk 、 mouse 、 Keyboard light , When these devices are going to be connected to the computer , How the computer receives information from these devices , And how to manage these devices , These belong to the content of equipment management .

These are the main tasks of the operating system , All it does is dirty work , It's also the manual work before the advent of operating systems . The purpose of creating an operating system is In order to transfer the dirty work to the machine , Lighten the burden on mankind , Increase work efficiency .

ps. Welcome to the official account " Hackle ".

版权声明
本文为[Hakou]所创,转载请带上原文链接,感谢