Operating System-Basic Overview【0】

It is mainly to record some knowledge points of the online operating system class of the school.

1. What is an operating system?

First of all, the operating system is an extremely complex software, and its extension and boundary are not very fixed, so it is difficult to have a complete, accurate, and accepted definition. But the operating system can be introduced from the function and characteristics, so as to have a deeper understanding of what kind of software the operating system is.

In terms of function, it can be divided into upper and lower. The upper is for users and applications. The operating system is a control software that can manage and provide services for applications (such as I/O services), Kill the application. For the internal management of the operating system, the operating system is a resource manager that manages various resources (CPU, memory, peripherals) and allocates resources.

Operating system is a control program

  • A system software
  • Control the program execution process to prevent errors and improper use of the machine
  • Execute user program and provide various services to user program
  • Convenient for users to use the computer system

The operating system is a resource manager

  • The middle layer between application and hardware
  • Manage various computer software and hardware resources
  • Provide efficient means to access computer software and hardware resources
  • Solve resource access conflicts and ensure fair use of resources

Second, the operating system architecture hierarchy

Insert picture description here

  • Above the hardware, control and manage the hardware.
  • Under the application, provide service support for the application.

For example, if you are a user, then you only care about the use of applications, not the implementation of system applications and operating systems. The operating system is sandwiched between the hardware and system applications, corresponding to the above, similar to a position as a manager/coordinator between software and hardware.

Insert picture description here
The above figure shows that the operating system is used to isolate software and hardware, providing common resources such as threads to the upper layer (software), and acting as a manager to the lower layer to manage operations on the hardware.

In general, the operating system itself is equivalent to a kind of software. Specifically, it can be classified as follows:

Insert picture description here
The composition of the operating system:

Insert picture description here

The interfaces of Linux, Windows, and Android belong to the shell (Shell), not the kernel (kernel). Kernel is our research focus, under the Shell.

The shell is the various interfaces and services provided by the operating system, and the windows command line is also a kind of shell, which is a command line shell.

The relationship between operating system and external (user):

Insert picture description here
Insert picture description here

Kernel-the internal components of the operating system, including:

  • CPU scheduler (such as process, thread management)
  • Physical memory management
  • Virtual memory management
  • File system management
  • Interrupt handling and (I/O) device driver

OS Kernel (operating system kernel) characteristics:

  • Concurrency
    There are multiple running programs in the computer system at the same time, which requires OS management and scheduling
  • Sharing
    Multiple applications can access resources "simultaneously"; mutually exclusive sharing means that at the micro level, the resources accessed by applications are different and mutually exclusive. Resources accessed by one application cannot be accessed by another application
  • Virtual
    Use multi-programming technology to make every user feel that there is a computer dedicated to him

  • The execution of asynchronous programs is not consistent to the end, but stop and go (for example, there is only one CPU but to perform multiple tasks). The speed of forward advancement is unpredictable, but as long as the operating environment is the same, the OS needs to guarantee the program and the result of the operation. To be the same

3. Why learn operating system?

Operating system is a comprehensive course-combining many different courses, learning it is an important improvement to your own ability.

  • programming language
  • data structure
  • algorithm
  • Computer Architecture

learning materials

  • Operating system concepts and principles, source code

learning skills

  • Design and implementation of operating system

There are many operating systems, such as: Is it necessary to learn Windows and Linux? Should undergraduates study?

Why learn operating system:

  • The operating system is still developing continuously, and there is a strong demand in various fields such as industrial control!
  • The operating system is cool, useful, and challenging.
  • Operating system knowledge is very low-level, and if you master it, you can learn by analogy with other similar things, and your ability will be improved.

Operating system: one of the cornerstones of computer science research

  • The basic components of a computer system
  • Driven by hardware development and application requirements
  • Continuous advancement of academics and industry
Frontier Information Main representative
industry Microsoft, Google, Facebook...
Apple: iphone.ipad... with OS as the core
academia ACM
IEEE
USENIX
Domestic: CCF
Top conference SOSP (every two years, 1967-...)
USENIX (every two years, 1994 -...)

Why is the operating system complicated?

  • The actual operating system code is huge. For example, Windows XP has 45 million lines. It is impossible to fully grasp the goal is to understand its core content.
  • Operating system management concurrency (CPU scheduling, etc.)
  • Operating system code manages the original hardware, time-dependent behavior, illegal behavior, and hardware failure all need to be considered
  • The operating system is a core software, the code must be efficient, low-consumption CPU, memory, disk
  • An operating system error means an error in the machine. The operating system must have higher stability than the user program
  • Operating system is the foundation of system security

From a higher perspective

1. The operating system needs to weigh:

  • Space (memory) and time (CPU)
  • Performance and predictability
  • Fairness and performance

2. In terms of hardware, the operating system needs:

  • Good hardware management
  • Reasonable resource allocation

For example: Hard disk speed is much different from CPU and memory, operating system needs to coordinate processing

4. How to learn the operating system?

It shouldn't be enough to memorize the concepts and principles, just finish the questions. You should try your best to practice, read the source code, and best be able to code.

I will forget
what I hear, I can remember what I see,
only what I have done I can understand

There is no practice, actual combat, and summary, and I have learned Baixue.

Five, operating system examples

For desktop, server, data center, etc., a variety of different purposes

UNIX family

Insert picture description here

Linux family

Insert picture description here
Linux and Unix are of the same category, and their APIs are compatible or similar (to the professor...I have basically zero knowledge of Unix. After checking, I can only confirm that Linux is an imitation of Unix. You can tell from his name, Linux Is Not UniX, that is, Linux, a vulgar recursive joke in the programmer world-so I am not sure if it is indeed compatible, but since it is an imitation, it is likely to be similar. .However, someone on Zhihu mentioned that it is compatible, as shown below).
Insert picture description here

Windows family

Insert picture description here
The evolution of operating systems

Insert picture description here

Six, operating system history

Insert picture description here
Insert picture description here

Seven, the structure of the operating system

1. Simple operating system: MS-DOs (1981~1994) single core without module

Insert picture description here

2. Hierarchical structure

Insert picture description here

The layered structure makes the portability of the operating system possible. The ucore system is a layered structure.

The defect of the hierarchical structure is that as the levels increase, the dependencies will become more and more complicated, resulting in more and more bloated and lower and lower efficiency. Therefore:

3. Micro-kernel structure: the design of micro-kernel, as far as possible to move the kernel function to user space

Insert picture description here
Insert picture description here

Most systems nowadays are a mixture of microkernels and layers.

4. Outer core structure

Insert picture description here

It is equivalent to only letting the kernel play a role of isolating hardware and software, and is responsible for allocating resources, but the specific handling of resources is determined by the program. The functions of the original operating system are implemented through operating system libraries. Somewhat similar to the structure of a virtual machine.

5. VMM (virtual machine manager) (solve excess hardware resources)

Insert picture description here
Insert picture description here

Insert picture description here

At this time, the manager is responsible for resource isolation, and the operating system is responsible for resource management.

Guess you like

Origin blog.csdn.net/qq_44721831/article/details/108690591