[Computer Operating System MOOC Version] Chapter 1 Summary of Knowledge Points

Chapter 1 Contents of Knowledge Points:

Chapter 1: Introduction to operating systems

1.1 Operating system goals and functions

1.1.1 Operating system goals

1.1.2 The functions of the operating system (3, each function has many knowledge points)

  1. OS serves as the interface between the user and the computer hardware system. (Communication between itself and the OS is achieved through commands, system calls, etc.)

2. OS serves as the manager of computer system resource files, processors, memories, and I\0 devices (hard + soft = computer system resources)

3. OS implements the abstraction of computer resources (virtual machine)

1.1.3 The main driving force behind operating systems

1.2 Development process of operating system

1.2.1 Computing-level systems without operating systems configured

1. Manual operation mode (no operating system at this stage)

2. Offline input\output mode

1.2.2 Single-channel batch processing system (operating system begins to appear)

1.2.3 Multi-batch processing system

1.2.4 Time-sharing system (it doesn’t feel very important, just remember the timeliness)

1.2.5 Real-time system

1.2.6 Development of microcomputer operating systems (Single->Single->Duo->Duo)

1.3 Basic characteristics of the operating system

1.3.1 Concurrency

1.3.2 Sharing

1.3.3 Virtual

1.3.4 Asynchronous

1.4 Main functions of the operating system

1.4.1 Processor management function

1.4.2 Memory management function

1.4.3 Device management function

1.4.4 File management function

1.4.5 Interface between operating system and user

1.4.6 New features of modern operating systems

1.5 OS structural design

1.5.1 Traditional operating system structure

1.5.1.1 Structureless operating system

1.5.1.2 Modular structure OS

1.5.1.3 Layered Structure OS

1.5.2 Microkernel OS structure


Chapter 1: Introduction to operating systems

What is an operating system?

Operating System (OS) refers to controlling and managing the hardware and software resources of the entire computer system, and rationally organizing and scheduling computer work and resource allocation to provide users and other software with convenient interfaces and environments. It is The most basic system software in a computer system.

1.1 Operating system goals and functions

In general: For example, the user is the employer, the operating system is the worker (used to operate the machine), the computer is the machine (consisting of several components such as processor, memory, equipment, and files). The worker has skilled skills and can control and Coordinating the work of various components is the management of resources by the operating system; at the same time, workers must receive orders from the employer, which is the "interface"; with workers, the machine can play a greater role, so the worker becomes an "expansion" machine".

1.1.1 Operating system goals

1. Convenience 2. Effectiveness 3. Scalability 4. Openness

1.1.2 The functions of the operating system (3, each function has many knowledge points)

  1. OS serves as the interface between the user and the computer hardware system. (Communication between itself and the OS is achieved through commands, system calls, etc.)

The operating system also provides a user interface. The interfaces provided by the operating system are mainly divided into two categories:

One type is the command interface. Users use these operation commands to organize and control the execution of jobs;

The other type is program interfaces, which programmers can use to request operating system services.

(1) Command interface

There are two main ways to use the command interface for job control, namely online control and offline control . According to different job control methods, the command interface can be divided into online commands

interface and offline command interface . The online command interface, also known as the interactive command interface, is an interface suitable for time-sharing or real-time systems. It consists of a set of keyboard operation commands. User passes

Input operation commands at the console or terminal to make various service requirements to the system. Every time the user enters a command, control is transferred to the command interpreter of the operating system, which is then interpreted by the command.

The interpreter interprets and executes the input commands to complete the specified functions. Control then transfers back to the console or terminal, where the user can enter the next command. The online command interface can be

This way of understanding: the "employer" says something, the "worker" does something and gives feedback, which emphasizes interactivity. The offline command interface is also called the batch command interface and is suitable for batch processing systems.

It consists of a set of job control commands. Offline users cannot directly intervene in the running of the job, but should use the corresponding job control command to write a job operation manual in advance, along with the job

submitted to the system. When the system schedules the job, the command interpreter in the system interprets and executes the commands in the job description one by one, thereby indirectly controlling the operation of the job. offline life

The interface can be understood like this: the "employer" writes the things he wants the "worker" to do on a list, and the "worker" completes these things one by one according to the list commands. This is batch processing.

(2) Program interface

The program interface consists of a set of system calls (also called generalized instructions) . Users request the operating system to provide services by using these system calls in their programs, such as using various external devices.

Prepare, apply for allocation and reclaim memory and various other requirements. The most popular one at present is the graphical user interface (GUI), that is, the graphical interface . The GUI is ultimately implemented by calling the program interface, using

Users can easily use the operating system by clicking on the graphical interface with the mouse and keyboard or using shortcut keys. Strictly speaking, the graphical interface is not part of the operating system, but the graphical

The system call commands called by the interface are part of the operating system.

2. OS serves as the manager of computer system resources (hard + soft = computer system resources)文件、处理机、存储器、I\0设备
  • Processor management

  • memory management

  • File management

  • Device management

3. OS implements the abstraction of computer resources (virtual machine)

1.1.3 The main driving force behind operating systems

  1. Continuously improve computer resource utilization

  2. User friendly

  3. Continuous upgrading of devices

  4. The Continuous Development of Computer Architecture

  5. Continuously propose new application requirements


1.2 Development process of operating system

1.2.1 Computing-level systems without operating systems configured

1. Manual operation mode (no operating system at this stage)

The early method of operation was for programmers to load pre-punched paper tapes (or cards) into paper tape input machines (or card input machines), and then start them to input the programs and data on the paper tapes (or cards) into the computer. , and then start the computer to run. Only after the program has finished running and the calculation results have been taken away, will the next user be allowed to board the computer.

  • Disadvantages: 1. User exclusive system 2. CPU waiting for manual operation

2. Offline input\output mode

The programmer inputs the data on the paper tape into the disk through the peripheral machine, then transfers the data from the disk into the memory at high speed, and the output result is output to the corresponding output device through the peripheral machine.

This can solve the conflict between man and machine and the speed mismatch between CPU and I/O devices.

1.2.2 Single-channel batch processing system (operating system begins to appear)

Processing process of single-lane batch processing system

In order to achieve continuous processing of jobs, a batch of jobs needs to be input to the tape in an offline mode, and a supervisory program (Monitor) is equipped in the system. Under its control, the batch of jobs can be processed one after another. Continuous processing.

  • Purpose: Improve utilization and throughput

  • Features: 1. Single-trackness 2. Sequentiality 3. Automaticity

  • Disadvantages: Resources are not fully utilized

1.2.3 Multi-batch processing system

Basic concepts of multiprogramming

In a multiprogramming system, jobs submitted by users are first placed on external storage and placed in a queue, called the backup queue .

Then the job scheduler selects several jobs from the backup queue and transfers them into the memory according to a certain algorithm, so that they can share the CPU and various resources in the system .

Multiple programs are loaded into computer memory and become processes

  • Features: 1. Multi-channel 2. Disorder 3. Scheduling Parallel at macro level and serial at micro level

  • Advantages: 1. High resource utilization 2. Large resource throughput

  • Disadvantages: 1. Long average turnaround time 2. No interaction ability

Problems that need to be solved in multi-channel batch processing systems

  • Processor contention problem

  • Memory allocation and protection issues

  • I/o device allocation problem

  • Document organization and management issues

  • Job management issues

  • User-system interface issues

1.2.4 Time-sharing system (it doesn’t feel very important, just remember the timeliness)

Characteristics of time-sharing systems (the most important is timeliness)

1. Multiplexing. Allows multiple terminals to be connected to one host, and the system serves each user according to the time-sharing principle;

2. Independence. Each user occupies one terminal and operates independently without interfering with each other;

3. Timeliness. User requests can be responded to in a very short time;

4. Interactivity. Users can conduct extensive human-machine dialogue with the system through the terminal.

  • Disadvantages: Cannot effectively handle emergency tasks. The operating system is completely fair to each user/job, and cycles for each user/job.

    The job serves a time slice, without distinguishing the urgency of the task.

1.2.5 Real-time system

  • Characteristics of real-time systems (an extra layer of reliability)

  1. Multiplexing

  2. independence

  3. timeliness

  4. interactivity

  5. Reliability (real-time systems are higher than time-based systems)

  • Advantages: Ability to respond to some urgent tasks with priority, and some urgent tasks do not require time slice queuing.

1.2.6 Development of microcomputer operating systems (Single->Single->Duo->Duo)

According to word length:

Word length: the number of bits of a binary number that can be processed at the same time

  • 8 bit 16 bit 32 bit 64 bit

According to the operation mode:

1. Single-user single-task operating system: CP/M, MS-DOS

2. Single-user multi-tasking operating system   The meaning of a single-user multi-tasking operating system is that only one user is allowed to access the computer, but the user is allowed to divide the program into several tasks and execute them in parallel, thereby effectively improving the performance representativeness of the system: Early days WIN

3. Multi-user multi-tasking operating system

Allows multiple users to use the same machine through their respective terminals to share various resources in the host system, and each user program can be further divided into several tasks so that they can be executed concurrently, thereby further improving resource utilization. and system throughput. Most of the large, medium and small computers are equipped with multi-user and multi-tasking operating systems, while many 32-bit microcomputers are equipped with multi-user and multi-tasking operating systems, the most representative of which is UNIX OS.


1.3 Basic characteristics of the operating system

Concurrency, sharing, virtuality, asynchronous (friendliness and security are not basic features)

1.3.1 Concurrency

Parallelism and Concurrency

  • Parallelism: two or more events occurring at the same time

  • Concurrency: Two or more events occur within the same time interval Note: Macroscopic events occur simultaneously and microscopic events occur alternately

Concurrency is the main means to improve system resource utilization and increase system throughput. Single-processor concurrent execution and multi-processor concurrent/parallel execution

Introduce process

  • A process refers to a running activity of a program in a computer on a certain data set. Before threads are introduced, it is the basic unit of resource allocation and scheduling in the system.

Introducing processes to achieve concurrent execution

1.3.2 Sharing

image-20210803160930275

Definition: Resource sharing, also known as resource reuse, means that resources in the system can be used by multiple concurrently executing processes in memory.

Mutually exclusive sharing mode

  • Critical resources: resources that only one process is allowed to access within a period of time

For example: printer, system form

Simultaneous access method

There is another type of resource in the system that allows "simultaneous" access to them by multiple processes over a period of time. The so-called "simultaneity" here is in a macro sense in a single-processor environment, and in a micro sense, the access of these processes to the resource

Disks, shared code, shared libraries, etc.

Life examples:

  • Mutually exclusive sharing method: use QQ and WeChat videos. The camera can only be assigned to one of the processes at the same time.

  • Simultaneous sharing method: Use QQ to send file A, and use WeChat to send file B at the same time. From a macro perspective, both sides are reading and sending files at the same time, indicating that both processes are accessing hard disk resources and reading data from them. From a microscopic perspective, the two processes access the hard disk alternately.

1.3.3 Virtual

In OS, the function of turning a physical entity into several logical counterparts through certain technologies is called virtualization.

  • Time division multiplexing: virtual processor (multiprogramming) technology, virtual device technology

  • Space division multiplexing: multiple programs share memory and multiple files share disks to improve storage space utilization.

image-20210803161622408

1.3.4 Asynchronous

In a multiprogramming environment, the system allows multiple processes to execute concurrently. In a single-processor environment, since there is only one processor in the system, only one process is allowed to execute at a time, and the remaining processes can only wait.

It can be seen that due to limitations of resources and other factors, the execution of a process is usually not possible in one go, but runs in a "stop-and-go" manner.


1.4 Main functions of the operating system

1.4.1 Processor management function

  • Main functions: Create and cancel processes, coordinate the operation of processes, realize information exchange between processes, and allocate processors to processes according to certain algorithms.

  1. process control

  2. Process synchronization

  3. process communication

  4. Scheduling

1.4.2 Memory management function

  • The main task: to provide a good environment for the operation of multi-programs, improve memory utilization, facilitate users, and logically expand the memory.

  1. memory allocation

  2. memory protection

  3. address mapping

  4. Memory expansion

1.4.3 Device management function

  • Main tasks: Complete IO requests made by user processes, allocate required I/O devices to user processes, and complete specified IO operations; improve the utilization of CPU and IO devices, increase IO speed, and facilitate users to use I/O devices .

  1. Buffer management

  2. Equipment allocation

  3. Equipment handling

1.4.4 File management function

  • Main tasks: Manage user files and system files to facilitate user use and ensure file security.

  1. File storage space management

  2. Directory management

  3. File read/write management and protection

1.4.5 Interface between operating system and user

User interface (command interface)

(1)Online user interface

(2)Offline user interface

(3) Graphical user interface

Program interface (consisting of system calls)

The program interface is set up for user programs to access system resources during execution. It is the only way for user programs to obtain operating system services .

1.4.6 New features of modern operating systems

system security

  • Authentication technology

  • cryptography

  • access control technology

  • Anti-virus technology

Network features and services

  • Telecommunication

  • Resource management

  • Application interoperability

Support multimedia

  • Admission control function.

  • Real-time scheduling.

  • Storage of multimedia files


1.5 OS structural design

OS structure

Traditional architecture OS

Modern Architecture OS

Structureless OS

Modular structure OS

Hierarchical OS

1.5.1 Traditional operating system structure

1.5.1.1 Structureless operating system

In the early development of operating systems, designers only focused on realizing functions and achieving high efficiency, lacking consistent design ideas.

At this time, the OS is a collection of a large number of processes. Each process can call other processes arbitrarily, making the OS internally complex and chaotic. Therefore, this OS is unstructured.

1.5.1.2 Modular structure OS

Basic concepts of modular programming technology

This technology is a structured programming technology that emerged in the 1960s. This technology is based on the principles of "decomposition" and "modularization" to control the complexity of large software.

In order to make the OS have a clearer structure, the OS is carefully divided into several modules with certain independence and size according to their functions.

module independence

In the module-interface method, the key issues are the division of modules and the definition of interfaces between modules.

Notice:

  •   When dividing modules, do not divide the modules into too small or too large.
  •   When dividing modules, pay attention to the independence of the modules.

Two criteria for measuring module independence: cohesion and coupling

  • advantage:

    (1) Improve the correctness, understandability and maintainability of OS design.

    (2) Enhance the adaptability of OS.

    (3) Accelerate the OS development process.

  • Disadvantages: (1) During OS design, the interface regulations between modules are difficult to meet the actual needs for the interface after the module design is completed. (2) In the modular structure design, the design of each module goes hand in hand, and it is impossible to find a reliable decision sequence, resulting in the "disorderliness" of various decisions, which will make it difficult for programmers to make "decisions at every step in the design" “It’s all built on a solid foundation.

1.5.1.3 Layered Structure OS

Basic concepts of hierarchical structure

When building an OS using this method, an OS has been divided into several layers, and each layer is composed of several modules. There is only one-way dependency between the layers.

  • advantage:

(1) It is easy to ensure the correctness of the system.

(2) Easy expansion and maintenance.

  • Disadvantages: reduced efficiency

1.5.2 Microkernel OS structure

Microkernel: A stripped-down version of the kernel that provides the core functionality of an OS.

Microkernel OS features: a culmination of various technical advantages. Examples: Mach, Minix, Windows NT, Hongmeng OS

Currently, the kernel architecture can be divided into: microkernel and macrokernel.

  • macro kernel

The macro kernel generally implements all the main core components of the system in the kernel. It is conceivable that the correlation between the components of the kernel designed in this way is very large, which is often said to be very coupled, which is not conducive to modular design.

The advantage is also obvious, that is, it is fast. All communication between components is completed in kernel mode, there is no switching between processes, and there is no switching from user mode to kernel mode.

Typical representatives are the Linux operating system and UNIX system.

Basic concepts of microkernel OS

1. Always a small enough kernel

2. Based on client\server model

3. Apply the principle of “separation of mechanisms and strategies”

4. Use object-oriented technology

Microkernel basic functions

Nowadays, the principle of "separation of mechanism and strategy" is generally adopted, and the mechanism part and the parts closely related to the hardware are put into the microkernel.

1) Process (thread) management

2) Low-level memory management

3) Interruption and trap processing

Advantages of microkernel operating system

The microkernel OS structure is based on a modular and hierarchical structure and adopts the client/server model and object-oriented programming technology.

(1) Improved system scalability

(2) Enhanced system reliability

(3) Strong portability

(4) Provides support for distributed systems

(5)Integrated object-oriented technology

Problems with microkernel operating systems

Compared with earlier operating systems, the operating efficiency of microkernel operating systems has been reduced.

Reason: When completing a customer's service request to the OS, messages need to be used to achieve multiple interactions and multiple user/kernel mode and context switches.

Guess you like

Origin blog.csdn.net/weixin_62985813/article/details/133267600