1, What & Why

What is an operating system?

The operating system is mainly responsible for the following three jobs:

  • Management of computer hardware and software resourcesComputer program
  • Manage configuration memory, determine resource supply and demand order, control input and output devices, etc
  • Provide an interface for users to interact with the system

There are many types of operating systems, and they are not limited to computers. From mobile phones to supercomputers, operating systems can be simple or complex. On different devices, the operating system can present the user with a variety of manipulations (touch screen, mouse). Common operating systems are: Linux, Windows, MacOS, Android, iOS and so on

Why is there an operating system?

  • Manpower can not operate computer hardware directly
  • The variety of devices is complex and requires a unified interface
  • The simplicity of the operating system enables more people to use computers

2. Basic functions of the operating system

1. The operating system uniformly manages the computer resources; 2. The operating system realizes the abstraction of computer resources;

The user does not need to program to the interface hardware; For example, IO device management software provides users with the function of read-write interface; The file management software provides the function of operating the file interface;

3. The operating system provides an interface between the user and the computer;

For example, graphical window form, command form, system call form


3. Relevant concepts of the operating system

1, concurrency 2, virtuality 3, virtuality 4, asynchronous

concurrency

Parallel: Two or more events can occur at the same time, such as a multicore processor processing two different programs at the same time; Concurrency: Two or more events can occur at the same time interval

Real-life examples of parallelism and concurrency:

Examples of parallelism and concurrency in a computer:

participatory

Sharing means that resources in the operating system can be used by multiple concurrent programs. This common use is called resource sharing

Shared – mutually exclusive sharing

When A resource is occupied by program A, other programs can only wait if they want to use it. Only when program A is used up can other programs use the resource. For example, if the printer is used by program A, program B can only use it when it wants to print until program A is finished.

Shared – Simultaneous access

A resource is accessed concurrently by more than one program over a period of time. This “simultaneity” is macroscopical in that the resource can be accessed simultaneously.

For example, program A and program B both want to write to disk, but since the disk has only one cantilever, program A cannot write to program B while program A is writing. But because writing data is faster, if we observe it over a period of time, we can assume that it is accessed simultaneously.

Virtual sex

  • Virtuality takes the form of turning a physical entity into several logical entities
  • Physical entities are real; logical entities are virtual
  • The virtual technology mainly includesTime division multiplexing technologyandSpace division multiplexing technology

Virtuality – time division multiplexing technology

  • Resources are reused in time and used concurrently by different programs
  • Multi – program time – sharing use of computer hardware resources to improve the efficiency of resources

For example, in the timeline, a single core CPU alternate execution, alternate use of CPU resources, this is a kind of time multiplexing.

Time division multiplexing technology is divided into virtual processor technology and virtual device technology

Virtual processor technology: with the help of multi-programming technology for each program to create a process, multiple processes time division reuse processor.

Virtual device technology: the physical device is virtual as multiple logical devices, each program occupies a logical device, multiple programs through the logic device concurrent access.

Virtuality – Space division multiplexing technology

Space division multiplexing technology is used to realize virtual disk and virtual memory. Can improve the utilization of resources, improve the efficiency of programming.

Virtual disk technology: a physical disk virtual into a number of logical disks, such as hard disk virtual C disk, D disk.

Virtual memory: Logically expands the storage capacity of a program so that the program can use more than its actual memory. Can greatly improve the efficiency of programming.

asynchrony

Asynchronous makes it possible for multiple processes to execute concurrently in a multi-program environment. Processes may need to wait or abandon while using resources; Processes are not carried out in one go, but in stop-and-go forms;

If a process needs a resource at a certain point in its execution, then if the resource is tied up, the process may need to stop or wait until the resource is released and then retrieve the resource to continue execution.