python learning - the history of the operating system

 read table of contents

  Manual Operation - Punched Cards      

  Batch - tape storage and batch systems

  multiprogramming system

  time-sharing system

  real-time system

  general operating system

  Further development of the operating system

  The role of the operating system

Manual Operation - Punched Cards

      The first computer was born in 1946—in the mid-1950s, computer work was still done manually. At this time there was no concept of an operating system.

         

  The programmer loads the punched paper tape (or card) corresponding to the program and data into the input machine, then starts the input machine to enter the program and data into the computer memory, and then starts the program through the console switch to run against the data; after the calculation, the printer Output the result of the calculation; after the user removes the result and removes the tape (or card), the next user is allowed to log on.

Two features of manual operation:
  (1) The user exclusively owns the whole machine. The phenomenon of waiting because the resource has been occupied by other users will not occur, but the utilization rate of the resource is low.
  (2) The CPU waits for manual operation. The CPU is underutilized.
 
      In the late 1950s, there was a contradiction between human and machine : a sharp contradiction was formed between the slow speed of manual operation and the high speed of the computer, and the manual operation method had seriously damaged the utilization rate of system resources (reduced the utilization rate of resources to 100%). a few, or even lower), cannot be tolerated. The only solution is to get rid of human manual operation and realize automatic transition of operations. This is where batch processing .

Batch processing - tape storage

Batch system: A system software  loaded on a computer , under its control, the computer can automatically and batch process the jobs of one or more users (the jobs include programs, data, and commands).

online batch system

  First came the online batch system, where the input/output of a job was handled by the CPU.
      

 

  A storage device, a tape, is added between the host and the input machine. Under the automatic control of the supervisory program running on the host, the computer can automatically complete: read the user jobs on the input machine into the tape in batches, and sequentially read the tapes on the tape. User jobs are read into host memory and executed and output the results to the output machine. After the previous batch of jobs is completed, the supervisor enters another batch of jobs from the input machine, saves it on tape, and repeats the above steps.
The supervisory program continuously processes each job, thus realizing the automatic transfer from job to job, reducing the time for job establishment and manual operation, effectively overcoming the contradiction between man and machine, and improving the utilization rate of the computer.
However, while jobs are being input and results output, the host's high-speed CPU is still idle, waiting for the slow I/O devices to complete the work: the host is in a "busy-waiting" state.

Offline Batch System

  In order to overcome and alleviate the contradiction between high-speed host and slow peripherals and improve CPU utilization, an off , that is, the input/output is controlled from the host.
      

     

 

  Satellite: One that is not directly connected to the host and is dedicated to dealing with input/output devices.
  Its function is:
  (1) Read the user job from the input machine and put it on the input tape.
  (2) Read the execution result from the output tape and transmit it to the output machine.
  In this way, the host does not directly deal with the slow input/output device, but has a relationship with the relatively fast tape drive, which effectively alleviates the contradiction between the host and the device. The host computer and the satellite computer can work in parallel, and the two have a clear division of labor, which can give full play to the high-speed computing capability of the host computer.
      Offline batch processing system: It was widely used in the 1960s, which greatly alleviated the contradiction between man-machine and the host and peripherals.
  Disadvantage: Only one job is stored in the host memory at a time. Whenever an input/output (I/O) request is issued during its operation, the high-speed CPU is in a state of waiting for the low-speed I/O to complete, causing the CPU to be idle.
In order to improve the utilization rate of the CPU, a multi-programming system was introduced.

multiprogramming system

multiprogramming technology

      The so-called multiprogramming technology refers to allowing multiple programs to enter the memory and run at the same time. That is to put multiple programs into memory at the same time, and allow them to run alternately in the CPU, and they share various hardware and software resources in the system. When a program is suspended due to an I/O request, the CPU immediately turns to run another program.

      When program A is calculating, I/O is idle, and when program A is performing I/O operations, the CPU is idle (the same is true for program B); only after A's work can be completed, B can enter the memory to start work, the two are serial, all Total time required to complete = T1+T2.

      
      Store the two programs A and B in the memory at the same time. Under the control of the system, they can be interspersed with each other and run alternately on the CPU: when the A program gives up the CPU due to requesting I/O operations, the B program can occupy the The CPU is running, so that the CPU is no longer idle, and the I/O devices that are performing AI/O operations are also not idle. Obviously, both the CPU and the I/O devices are in a "busy" state, which greatly improves the utilization of resources, and thus also The efficiency of the system is improved, and the time required for all A and B to complete is <<T1+T2.
      Multiprogramming technology not only makes full use of the CPU, but also improves the utilization of I/O devices and memory, thereby improving the resource utilization and system throughput of the entire system (the number of processing jobs (programs) per unit time) , which ultimately improves the efficiency of the entire system.
  Features of multiprogramming runtime in a single processor system:
  (1) Multi-channel: several independent programs are stored in the computer memory at the same time;
  (2) Macroscopically parallel: several programs that enter the system at the same time are in the running process, that is, they have started their respective operations, but have not finished running;
  (3) Microscopic serialization: In fact, each program uses the CPU in turn and runs alternately.
The emergence of the multiprogramming system marks the stage of the operating system becoming more and more mature, and functions such as job scheduling management, processor management, memory management, external device management, and file system management have appeared successively.
Since multiple programs are running in the computer at the same time, the concept of space isolation has begun. Only the isolation of memory space can make data more secure and stable.
In addition to spatial isolation, multi-channel technology also reflects the characteristics of time and space multiplexing for the first time. When encountering IO operations, the program is switched, which improves the utilization rate of the CPU and the work efficiency of the computer.

Multi-channel batch system

  In the mid-1960s, in the aforementioned batch processing system, a multi-channel batch processing system (referred to as: batch processing system) was formed after the introduction of multi-channel programming technology.
  It has two features:
  (1) Multi-channel: The system can accommodate multiple jobs at the same time. These jobs are placed in the external memory to form a backup queue. The system selects one or more jobs from the backup job queue each time according to a certain scheduling principle and enters the memory for running. Realization, thus forming an automatic transfer, continuous workflow in the system.
  (2) Batch: During the operation of the system, users are not allowed to interact with their jobs, that is, once a job enters the system, users cannot directly interfere with the operation of its jobs.
  The goal of the batch system is to improve the utilization of system resources and system throughput, as well as the automation of the job process.
  An important shortcoming of batch processing system: it does not provide human-computer interaction ability, which brings inconvenience to users in using computers.
  Although the user monopolizes the resources of the whole machine and directly controls the running of the program, he can know the running status of the program at any time. However, this way of working causes extremely low resource efficiency due to monopolizing the entire machine.
  A new pursuit goal: to ensure the efficiency of the computer, and to facilitate the use of the computer by the user. The development of computer technology and software technology in the mid-1960s made this pursuit possible.

time-sharing system

      Due to the continuous improvement of CPU speed and the use of time-sharing technology, a computer can be connected to multiple user terminals at the same time, and each user can use the computer online on his own terminal, as if he owns the machine.
      
  Time-sharing technology: divide the running time of the processor into very short time slices, and assign the processor to each online job in turn according to the time slice.
  If a job cannot complete its computation within the time slice allocated to it, the job is temporarily interrupted, the processor is given over to another job, and its operation is resumed when it waits for the next round. Because of the speed of the computer, jobs run in rapid rotation, giving each user the impression that he has a single computer. Each user can issue various operation control commands to the system through his own terminal, and complete the operation of the job under the condition of sufficient human-computer interaction.
A computer system with the above characteristics is called a time-sharing system, which allows multiple users to use the computer online at the same time.
  Features:
  (1) Multiplexing. Several users use a computer at the same time. From a micro perspective, each user uses the computer in turn; from a macro perspective, each user works in parallel.
  (2) Interactivity. The user can further make a new request to the system according to the response result of the system to the request. This working mode, which enables the user to conduct man-machine dialogue with the system, is obviously different from the batch system. Therefore, the time-sharing system is also called an interactive system.
  (3) Independence. Users can operate independently of each other without interfering with each other. The system guarantees the integrity of each user program operation, and will not confuse or destroy each other.
  (4) Timeliness. The system can respond to user input in a timely manner. One of the main indicators of the time-sharing system performance is the response time, which refers to the time it takes from the terminal to issue a command to the system to respond.
   The main goal of the time-sharing system : the timeliness of the user's response, that is, the user will not wait too long for each command to be processed.
The time-sharing system can accommodate dozens or even hundreds of users at the same time. Due to the limited memory space, the storage method of swapping (also known as swapping) is often used. The job that has not been "turned" will be put into the disk, and once it is "turned", it will be transferred to the memory; and after the time slice is used up, the job will be saved back to the disk (commonly known as "roll in", "roll out" method ) to make the same storage area serve multiple users in turn.
Multi-user time-sharing systems are the most commonly used type of operating system in today's computer operating systems.
       Note: The time-sliced ​​work of the time-sharing system runs out of time slices before encountering IO operations and is cut away. This switching work does not actually improve the efficiency of the CPU, but reduces the efficiency of the computer. . But we sacrificed a little efficiency, but achieved the effect of multiple programs executing together, so that you can chat while listening to music on the computer.

real-time system

    Although the multi-channel batch processing system and the time-sharing system can obtain satisfactory resource utilization and system response time, they cannot meet the needs of the two application fields of real-time control and real-time information processing. Thus, a real-time system is created, that is, a system that can respond to random external events in a timely manner and complete the processing of the events within a strict time frame.
A real-time system is often used as a control device in a specific application.
    Real-time systems can be divided into two categories:
    (1) Real-time control system. When used for automatic control of aircraft flight, missile launch, etc., it is required that the computer can process the data measured by the measurement system as soon as possible, control the aircraft or missile in time, or provide relevant information to decision makers through the display terminal. When used for industrial production process control such as steel rolling and petrochemical, it is also required that the computer can process the data sent by various sensors in time, and then control the corresponding actuator.
    (2) Real-time information processing system. When used for booking air tickets, inquiring about flights, routes, fares, etc., or when used in banking systems and information retrieval systems, computers are required to be able to timely and correctly answer service requests from terminal equipment. This category has slightly weaker requirements for response timeliness than the first category.
   Main features of RTOS :
  (1) Timely response. Every process of receiving, analysing and sending information must be completed within a strict time limit.
  (2) High reliability. Redundant measures should be taken, the front-end and back-end work of the dual-machine system, including necessary security measures, etc.
  Comparison of time-sharing and real-time systems

general operating system

  There are three basic types of operating systems: multi-channel batch systems, time-sharing systems, and real-time systems.
   General-purpose operating system: An operating system with multiple types of operating characteristics. It can have the functions of multi-channel batch processing, time-sharing, real-time processing, or two or more of them at the same time.
  For example: real-time processing + batch processing = real-time batch processing system. First, ensure that real-time tasks are prioritized, and batch operations are performed in space. Real-time tasks are often called foreground jobs, and batch jobs are called background jobs.
  Another example: time-sharing processing + batch processing = time-sharing batch processing system. That is, jobs with low time requirements are processed in the "background" (batch processing), and jobs requiring frequent interaction are processed in the "foreground" (time-sharing), and the processor runs the "foreground" jobs first.
  Since the mid-1960s, some large-scale general-purpose operating systems have been developed internationally. These systems attempt to be fully functional and adaptable to a wide variety of applications and environments with varying modes of operation. However, these systems are too complex and large, not only pay a huge price, but also encounter great difficulties in solving their reliability, maintainability and understandability.
  In contrast, the UNIX operating system is an exception. This is a general multi-user time-sharing interactive operating system. It first builds a lean core, and its functions are comparable to many large operating systems, and beyond the core layer, it can support huge software systems. It was quickly applied and promoted, and continued to improve, and has a significant impact on modern operating systems.
  So far, the basic concept, function, basic structure and composition of the operating system have been formed and gradually improved.

Further development of the operating system

  In the 1980s, the rapid development of large-scale integrated circuit technology and the emergence and development of microprocessors set off a wave of great development and popularization of computers. On the one hand, it ushered in the era of personal computers, and at the same time, it develops in the direction of computer networks, distributed processing, supercomputers and intelligence. As a result, the operating system has been further developed, such as: personal computer operating system, network operating system, distributed operating system and so on.

personal computer operating system

  The operating system on a personal computer is an online interactive single-user operating system, which provides online interactive functions similar to those provided by general-purpose time-sharing systems.
  Since it is personal, some functions are much simpler. However, due to the widespread application of personal computers, the requirement for a file system that provides a more convenient and friendly user interface and rich functions will become more and more urgent.

network operating system

  Computer network: a system that interconnects geographically dispersed computer systems with autonomous functions through communication facilities to realize information exchange, resource sharing, interoperability and cooperative processing.
  Network operating system: On the original respective computer operating systems, network management modules are added according to various protocol standards of the network architecture, including: communication, resource sharing, system security and various network application services.

distributed operating system

  On the surface, distributed systems are not much different from computer network systems. The distributed operating system also interconnects geographically dispersed data processing systems or computer systems with autonomous functions through a communication network to realize information exchange and resource sharing, and cooperate to complete tasks. - The hardware connection is the same.
  But there are some notable differences:
  (1) A distributed system requires a unified operating system to achieve the unity of system operation.
  (2) The distributed operating system manages all the resources in the distributed system. It is responsible for the resource allocation and scheduling, task division, information transmission and control coordination of the whole system, and provides a unified interface for users.
  (3) The user realizes the required operation and uses the system resources through this interface. As for which computer the operation is to be executed on, or which computer's resources are used, it is done by the operating system, and the user does not need to know. It is called: the transparency of the system.
  (4) Distributed systems emphasize distributed computing and processing, so there are higher requirements for multi-machine cooperation and system reconstruction, robustness and fault tolerance. It is hoped that the system has: shorter response time, high throughput and high reliability.

The role of the operating system

  Modern computer systems are mainly composed of one or more processors, main memory, hard disks, keyboards, mice, monitors, printers, network interfaces and other input and output devices.

  Generally speaking, a modern computer system is a complex system.

  One: If every application programmer must master all the details of the system, it will be impossible to write code (severely affects the development efficiency of programmers: it may take 10,000 years to master all these details....)

  Second: It is a very challenging job to manage these components and optimize their use, so computing installs a layer of software (system software) called an operating system. Its task is to provide a better, simpler and clearer computer model for user programs and to manage all the devices just mentioned.

  Summarize:

  Programmers cannot understand all the details of hardware operations. It is very tedious work to manage these hardware and optimize their use. This tedious work is done by the operating system. With him, programmers can benefit from these tedious work. Freed, you only need to consider the writing of your own application software. The application software directly uses the functions provided by the operating system to indirectly use the hardware.

  In short, an operating system is a control program that coordinates, manages and controls computer hardware and software resources. The location of the operating system is shown in the figure

  In detail, the operating system should be divided into two parts:

  

copy code
#1: Hide the ugly hardware call interface and provide application programmers with a better, simpler and clearer model (system call interface) for calling hardware resources. After application programmers have these interfaces, they no longer need to consider the details of operating the hardware and can concentrate on developing their own applications.
For example: the operating system provides the abstract concept of a file. The operation of the file is the operation of the disk. With the file, we no longer need to consider the read and write control of the disk (such as controlling the disk rotation, moving the head to read and write data, etc.),

#2: Make the application's competing requests for hardware resources in an orderly manner
For example, many application software actually share a set of computer hardware. For example, there may be three application programs that need to apply for a printer to output content at the same time. Then program a competes for printer resources and prints, and then program b competes for printer resources, or it may It is c, which leads to disorder. The printer may print the content of a section of a and then print c... One of the functions of the operating system is to make this disorder orderly.
copy code

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326491342&siteId=291194637