[Chapter 1 | Operating System Overview] "Operating System MOOC Edition" Answers + Review

Table of contents

| Chapter Concepts

| Algorithms in this chapter

Image rendering of single-pass batches and multi-pass batches

Calculation and Analysis of Utilization Rate 

| Short answer questions after class


| Chapter Concepts

1. The role of OS As an interface between users and computer hardware systems | Manager of computer system resources | Abstraction of computer resources. The goal of OS is:Convenience, Effectiveness, Scalability, Openness

2. Virtual machine A device that covers I/O software is called an expansion machine or a virtual machine

3. The concept of OS is a collection of multi-layer software laid on computer hardware. OS is a set of programs that can effectively organize and manage computer hardware and software resources, reasonably schedule various jobs, and facilitate users to use

4. Motivation to promote OS development Improve computer system resource utilization | Convenience to users | Constant updating of devices | Continuous development of computer architecture | Constantly put forward new application requirements

5. The development history of OS

  • [Manual operation in 1945]

  • [Offline I/O in the 1950s]

    Operation: Solve the contradiction between man-machine and speed mismatch between CPU and I/O. The input and output of programs and data are all completed without the host computer.

    Online I/O: I/O performed under the direct control of the host.

    Advantages of offline I/O: reduced CPU idle time, improved IO speed

  • [Single-channel batch processing system in the mid-1950s]

    Operation: Input a batch of jobs to the tape in the form of offline IO, and add a supervisory program to the system. Under the control of the program, the jobs are completed one by one, and only one job is always saved in the memory.

    Advantages: Improve system resource utilization and system throughput.

    Disadvantages: still fail to make full use of system resources, resulting in waste of computer memory

  • [Multi-channel batch processing system in the mid-1960s]

    Operation: The jobs are put into the external memory first and arranged in a queue (backup queue). The job scheduler selects several jobs from the queue and transfers them into the queue according to a certain algorithm, so that they share the CPU and various resources in the system.

    Advantages: high resource utilization, large system throughput, long average turnaround time, no interactive capabilities

    Problems to be solved: processor requisition, memory allocation and protection, IO device allocation, file organization and management, job management, user-system interface

  • 【Time-sharing system】

    Development reason: to meet the user's requirements for human-computer interaction

    Operation: In order to realize human-computer interaction, we must abandon the operation mode of the original batch processing system, and adopt: ①The job directly enters the memory, because the job cannot be run on the disk; ②Use rotation to ensure that each job has a chance to run, Therefore, the concept of time slices is introduced

    Features: multipath (multiple terminals connected to the same host), independence (each terminal does not interfere with each other), timeliness (response time is 1-3s), interactivity

  • 【Real-time system】

    Definition: The OS can respond to external event requests in a timely manner, complete the event processing within the specified time, and control all real-time tasks to run in a coordinated manner

    Types of real-time OS: industrial control OS, information query OS, multimedia OS, embedded OS

    Types of real-time tasks: periodic/aperiodic real-time tasks, hard real-time tasks (Hard real time, HRT), soft real-time task SRT (the above four task types are accompanied by deadlines)

    Features: multi-channel (periodic collection of multi-channel on-site information, control of multiple actuators), independence (each terminal does not interfere with each other), timeliness (response time is milliseconds), interactivity, and reliability sex

    The two basic characteristics of a real-time system are: timeliness and reliability

6. Basic features of the operating system

  • Concurrency (parallel is happening at the same time, concurrency is happening at the same time interval):

    Concept: Macroscopically, multiple programs run at the same time, but microscopically, only one program runs at a time. What we call concurrency generally refers to the concurrency of processes

  • shared:

    Concept: The sharing of OS refers to the multiplexing of resources: for the common use of multiple concurrently executing processes in the memory (that is, the time is limited and the location is limited)

    Type: Mutually exclusive sharing (B can only access after A visits), "simultaneous" sharing (used together at the macro level and alternately at the micro level)

    Concurrency and sharing are the two most basic features of a multitasking OS, and they are conditions for the existence of each other. Resource sharing is conditioned on the concurrent execution of processes; at the same time, if resource sharing cannot be coordinated, the speed of concurrency will be affected

  • Virtual: the function of turning a physical entity into several logical counterparts through a certain technology. Realized by time division multiplexing and space division multiplexing technology

  • Asynchronous: The job that enters the memory first may be completed later, and the one that enters later may be completed first: that is, the advancement speed of the process is unpredictable, which is asynchronous

7. The main functions of the operating system

  • Processor Management Functions

    Essence: In traditional multiprogramming systems, the allocation and operation of processors is based on the process as the basic unit, so the management of processors can be attributed to the management of processes.

    Functions: process control, synchronization, communication, scheduling

  • memory management function

    Functions: memory allocation and recovery (static and dynamic allocation), memory protection (①each user program only runs in its own memory, ②users are not allowed to access OS programs and data), address mapping, memory expansion (virtual storage technology: request call function, replacement function)

  • Device management function

    Functions: buffer management, device allocation, device processing

  • file management function

    Functions: file storage space management, directory management, file read and write management and protection

  • Interface management function

    Function: OS provides the user with "the interface between the user and the OS", which is divided into user interface (online user interface, offline user interface, graphical user interface), program interface

8. The structure of the operating system

  • simple structure

  • Modular structure:

    Advantages: Improve the correctness, understandability, maintainability and adaptability of OS design, and accelerate the OS development process

    Disadvantages: The interface regulations are difficult to meet the actual requirements of the module for the interface after the division; the decision of B must be based on the decision of A, there is no reliable decision order, and it is easy to cause the disorder of the decision

  • Hierarchical structure:

    Advantages: Can guarantee correctness, easy maintenance, scalability

    Disadvantage: low system efficiency

  • Microkernel structure:

    Concept: sufficiently small kernel, client/server-based model, adopting the principle of separation of strategy and mechanism, adopting object-oriented technology;

    Functions: process (thread) management, low-level memory management, interrupt and trap handling (in the microkernel OS, only a small part of the mechanism is put into the kernel, and most of them are placed outside the microkernel of various servers)

    Advantages: Improve system scalability, reliability, and portability, provide support for distributed systems, and incorporate object-oriented technology. The operating system can adapt to the needs of different applications only by adjusting the policy

    Existing problems: Because of the message transmission between the client and the server, compared with the early OS, the operating efficiency of the microkernel OS is reduced (the kernel is large, the efficiency is high, but the space is also large, and vice versa, the efficiency is low, but the space is small)

  • Outer core structure:

    Concept: The kernel does not provide traditional OS processes, virtual memory and other abstract things, but focuses on the isolation (protection) and reuse of physical resources, that is, a very small kernel is responsible for protecting system resources, while the management of hardware resources is entrusted to application. Provide the functions originally belonging to the OS kernel to users in the form of libraries

9. System calls

  • Concept: Enable applications to briefly call related processes in the OS through system calls, and then obtain corresponding services

  • System calls are implemented through the interrupt mechanism

  • Different from general procedure calls:

    ①Running in different system states: the calling program of the system call runs in the user mode, and the called program runs in the kernel mode

    ②Because the calling and running system states are different (one is user mode and the other is kernel mode), it is not allowed to transfer directly from the calling process to the called process. It needs to be converted from the user mode to the kernel mode through the soft interrupt mechanism. After analysis by the kernel Only then can it turn to the corresponding system call processing subroutine

    ③Return to the question: Each call needs to determine the priority

    ④ Nested calls: System calls have certain restrictions on the depth of nested calls, but general procedure calls do not.

  • Types of system calls:

    ① Process control system call

    ②File manipulation system calls

    ③Process communication system call


| Algorithms in this chapter

Image rendering of single-pass batches and multi-pass batches

 Single batch: only one IO and calculation can be executed

Multi-channel batch: IO and calculation can be executed concurrently

 


Calculation and Analysis of Utilization Rate 

Utilization rate = utilization time / total time


| Short answer questions after class

 

 

================================The END=====================================

Guess you like

Origin blog.csdn.net/m0_57265007/article/details/125319874