1. The content of this article comes from courseware and student notes of famous universities (on campus, I often see someone buying notes at high prices)
2. The instructor does not provide references, so he can only express his gratitude to the author. If your work is referenced, you can reply to the document to supplement the reference.
3. I will not answer questions not related to the article, and the article content is also difficult. I am also difficult to answer your questions. If you find a bug, you can use the reply method to help me fix it.
4. Computer Operating System
Suitable for computer operating systems and postgraduate entrance exams
For more information about the navigation bar of this course, see the navigation bar at the bottom of the page.
Computer Operating System
§ 1. 1 Operating System Concept
§ 1. 2 Operating System history
§ 1. 3 basic types of Operating Systems
§ 1. 4 operating system functions
§ 1. 5 computer hardware Overview
§ 1. 6 Algorithm Description
§ 1. 7 views on Operating Systems
From personal computers to giant computer systems, one or more operating systems have been configured without exception. What is the operating system, the position of the operating system in the computer system, and what features it has will be briefly described in this chapter. To clarify these problems, it is necessary to briefly review the formation and development process of the operating system. In order to facilitate future study, we will introduce the types and features of the operating system, and study several ideas about the operating system. Finally, several common operating systems are introduced.
§ 1. 1 Operating System Concept
1.1.1 what is an operating system
Any computer system consists of two parts: computer hardware and computer software.
Computer hardware is usually composed of components such as the central processor and controller, memory, input device and output device.
Computer software includes system software and application software. System software, such as operating systems, multi-language processing programs (Compilation and compilation programs), connecting Assembly programs, system utilities, and various tool software; applications are developed for a variety of purposes.
Computers without any software support are called bare metal computers. They only constitute the material basis of computer systems, and the computer systems actually present in front of users are computers transformed by several layers of software. Figure 1.1 shows this situation.
The relationship between computer hardware, software, and applications is hierarchical. Bare metal is at the innermost layer. It is an operating system, and the bare metal is transformed into a more powerful and easy-to-use machine by the resource management functions provided by the operating system and various service functions convenient to users, it is usually called a virtual machine or extended machine, and various utilities and applications run on top of the operating system. They use the operating system as the supporting environment and provide users with various services required to complete their jobs.
Therefore, the purpose of introducing the operating system is as follows:
From the perspective of System Administrators: the introduction of operating systems aims to Reasonably organize computer workflows, manage and allocate computer system hardware and software resources, so that they can be shared efficiently among multiple users. Therefore, the operating system is the manager of computer resources.
(2) from the user's point of view: the introduction of the operating system is intended for users to use computing
The host provides a good interface so that you do not need to know much about the hardware.
And system software details, you can easily and flexibly use the computer.
(3) from the perspective of development: the introduction of operating systems aims to provide a support platform for function expansion of computer systems, it makes it easier to add new services and functions without affecting the original services and functions.
In conclusion, the operating system can be defined:
An operating system is a system software in a computer system. It is a collection of such program modules-they manage and control hardware and software resources in the computer system and Reasonably organize computer workflows, in order to effectively use these resources to provide users with a powerful, easy to use, and scalable work environment, thus playing an interface role between the computer and its users.
§ 1. 2 Operating System history
To better understand the basic concepts, functions, and features of the operating system, first review the historical process of operating system formation and development.
The operating system is generated because of objective needs. It is gradually developed and improved along with the development of computer technology and its applications. From weak to strong, it has continuously improved its position in computer systems. So far, it has become the core of computer systems, and no operating system is configured.
Since operating systems have always been isolated from the computer composition and architecture on which operating systems run, we examine the generations of computers to see what their operating systems look like and what functions and features they have.
People usually divide the computer development process into four stages according to the evolution of the device technology.
1946-the end of 1950s: the first generation, the era of electronic tubes (no operating system ).
Late 1950s-mid 1960s: Second Generation, transistor era (batch processing system ).
Mid-1960s-mid-1970s: the third generation, the era of Integrated Circuits (multi-channel programs
Design ).
1970s to date: Fourth Generation, large-scale and ultra-large-scale integrated power
Road era (time-sharing system ).
Modern computers are evolving towards the giant, micro, parallel, distributed, networked, and intelligent aspects.
To adapt to the above computer development process, the operating system has gone through the following development processes: manual operation stage (no operating system) batch Processing, execution system, multi-channel Program System, time-sharing system, real-time system, general operating system, network operating system, distributed operating system, etc.
1.2.1 manual operation stage
In the first generation of computers, the main components of computers were electronic tubes, which were slow in computing, no operating system, or even no software. The user uses machine language to compile the program directly, and exclusively occupies all computer resources when the computer is on. The computer is completely Manual: first install the program tape (or card) on the input machine, then start the input machine to send the program and data to the computer, and then start the program running through the console switch. After the computation is completed, the printer outputs the computation result and the user removes and removes the tape (or card ).
In the late 1950s S, the computer's operation speed was greatly improved, and there was a conflict between the slow speed of manual operation and the high speed of the computer. The only solution is to get rid of manual operations and achieve automatic job transition. In this way, batch processing occurs.
1.2.2 early batch processing (batch processing)
In the early stages of computer development, since there is no software for management, all operation management and specific operations are undertaken by the user. A job consists of many job steps. Any incorrect operation in any step may cause the job to start from the beginning. At that time, computers were extremely expensive, computers (CPU) time was very precious, and it was very urgent to increase the CPU utilization as much as possible.
There are two ways to solve this problem: first, a dedicated computer operator is provided, and programmers no longer directly operate the machine, reducing machine errors. Another important measure is batch processing. The operator classifies jobs submitted by users and organizes jobs in batches into a sequence of jobs. Each batch of jobs will be automatically processed by a dedicated monitoring program.
Early batch processing can be divided into two methods. (Online batch processing and offline batch processing)
Online Batch Processing
The slow input/output (I/O) device is directly connected to the host.
The job execution process is as follows:
(1) The user submits jobs: job programs and data, which are written in the job control language.
Statement of operation;
(2) the assignment is made into a punched tape or card;
(3) The operator may selectively combine several jobs into a batch by inputting the device (TAPE
Input machines or hosts) store them into tape;
(4) The supervisor reads a job (if the system resources can meet the job requirements );
(5) Transfer the assembler or compiler from the tape to translate the User Job source program
Into the target code;
(6) connect the assembly program to assemble the compiled target code and required subroutines
An executable program;
(7) start execution;
(8) after the execution is completed, the aftercare processing program outputs the computing results;
(9) read another job and Repeat steps (5)-(9;
(10) after a batch of jobs are completed, return to (3) to process the next batch of jobs.
This online batch processing method solves the problem of automatic job transfer, thus reducing job creation and manual operation time. However, when the input and execution results of a job are output, the host CPU is still in the stopped wait state, so that the slow input/output device and the fast host are still working in serial mode, CPU time is still a waste of time.
2. Offline Batch Processing
The input and output are completed by a dedicated device. A notable feature of this approach is the addition of a satellite machine dedicated to dealing with input and output devices, which is not directly connected to the host. 1.2 (see the next page ).
The functions of satellite machines are as follows:
(1) input the task to the input tape through the input device;
(2) output the task execution result to the output device.
In this way, the host does not directly deal with slow input/output devices, but is related to a relatively fast tape drive. The host and satellite can work in parallel, with a clear division of labor between the two to give full play to the high-speed computing capability of the host. Therefore, offline batch processing greatly improves the system processing capability compared with online batch processing.
Batch Processing occurs from the end of 1950s to the beginning of 1960s. Its appearance promotes the development of software. It is also important to monitor programs, which manage the operation of jobs-responsible for loading and running various system processing programs, such as assembler, compiler, connection assembly program, library (such as input and output Standard Program), automatic job transition, and program design technologies such as program coverage.
Batch Processing still has some disadvantages: tape needs to be manually disassembled, which is both troublesome and error-prone. Another more important problem is system protection.
Let's recall the problem-solving process under supervision program management, as shown in Figure 1.3 (see the next page ).
During batch processing, there is a call relationship between the supervision program, system program, and user program. If a problem occurs at any stage, the whole system will pause; user Programs may also disrupt supervisory programs and system programs. In this case, only operator intervention can be performed to recover. In the early 1960s S, hardware was developed in two ways (namely, communication and interrupt technology), leading to the entry of the operating system into the execution system phase.
A channel is a special processing component. It can control one or more input and output devices and transmit information between the input and output devices and the primary storage devices. Once started, it runs independently of the CPU. This allows the CPU and channel to operate in parallel, and the CPU and multiple input/output devices can also operate in parallel.
Interruption means that when the host receives an external signal (for example, the input/output device completes the signal), it immediately stops the original work and forwards it to the processing end, the host returns to the original breakpoint to continue working.
With the help of channel, interrupt technology and input/output, batch processing can be completed under host control. At this time, the functions of the original supervisor program have been extended. It is not only responsible for automatic scheduling of job operations, but also provides the input and output control functions. This developed supervised program resident memory is called the execution system.
The system implements online input/output operations. Unlike earlier batch processing systems, the input/output operations are performed through a channel controlled by the host. The host and channel, host, and input/output devices can all be operated in parallel. The input and output operations of a user program are performed by the system without manual intervention. The system checks the legitimacy of the command to avoid the impact of invalid input and output commands on the system, this improves system security.
In this case, apart from input/output interruptions, other interruptions, such as Arithmetic overflow and illegal operation code interruptions, can overcome error shutdown, while clock interruption can solve the endless loop in user programs.
The system performs parallel operations on hosts, channels, and input/output devices, improving system efficiency and facilitating the use of input/output devices. However, the computer system processes jobs in a single order, that is, user jobs are still processed in a single order. There may be two situations: for computing-based jobs, the input and output volume is small, and the peripheral devices are idle. However, for input and output-based jobs, the host is idle. In general, the efficiency of computer resources is still low. Therefore, the operating system has entered the multi-channel program stage: multi-channel programs can be properly combined and run alternately to make full use of resources and improve efficiency.
The system performs parallel operations on hosts, channels, and input/output devices, improving system efficiency and facilitating the use of input/output devices. However, the computer system processes jobs in a single order, that is, user jobs are still processed in a single order. There may be two situations: for computing-based jobs, the input and output volume is small, and the peripheral devices are idle. However, for input and output-based jobs, the host is idle. In general, the efficiency of computer resources is still low. Therefore, the operating system has entered the multi-channel program stage: multi-channel programs can be properly combined and run alternately to make full use of resources and improve efficiency.
Multi-channel programming technology is adopted in the batch processing system to form a multi-channel batch processing system. Many jobs to be processed are stored in external memory, forming a job queue and waiting for running. When a job needs to be transferred in, a batch of jobs stored by the Job Scheduling program in the operating system are called into the memory according to its resource requirements and certain scheduling principles, let them run alternately. After a job is completed, call one or more jobs. In this way, there are always several programs in the memory, and the system resources are fully utilized.
In multi-channel program systems, we need to solve such technical problems:
Programs running in parallel must share the hardware and software resources of the computer system.
Competition, but must be synchronized with each other. Therefore, the synchronization and mutex mechanisms are designed for the operating system.
Important issues.
With the increase of multiple programs, there is a problem of insufficient memory, which improves the memory usage efficiency.
Rate also becomes the key. As a result, such as coverage technology, swap technology and virtual storage technology emerged.
And other memory management technologies.
Because multiple programs exist in the memory, in order to ensure the system program storage zone and user program storage
The storage zone is safe and reliable, and the requirements for memory protection are put forward.
1.2.4 time-sharing Operating System
In the batch processing mode, the user uses the computer for offline operations. The calculation result can be obtained only when the batch processing is completed. Proceed to the next step based on the results. It has the advantage of high computer efficiency. However, users are reluctant to work online in the manual operation phase. They exclusively occupy the computer and directly control the program running. However, exclusive computer mode will result in low resource efficiency. It not only ensures computer efficiency, but also makes it easy for users to use. In the middle of 1960s, the development of computer and software technologies made this pursuit possible. As the CPU speed is constantly improved and time-sharing technology is adopted, a computer can connect multiple user terminals at the same time, and each user can use the computer online on his terminal, as if he had exclusive machine.
The so-called time-sharing technology is to divide the processing machine running time into short time slices, and distribute the processing machines to various online jobs in turn by time slice. If a job cannot complete its computing in the time slice assigned to it, the job is temporarily interrupted, and the processor is used by another job, waiting for the next round to continue running. Because of the fast speed of the computer and the fast rotation of jobs, it seems that he excludes a computer. Each user can use his terminal to send various operation control commands to the system to run the job.
Multi-user time-sharing operating systems are the most common operating systems in today's computer operating systems.
1.2.5 real-time operating system
In the middle of 1960s, computers entered the third generation. The performance and reliability of computers were greatly improved, and the cost was greatly reduced. As a result, computers were widely used. The computer is used for industrial process control and military real-time control to form various real-time processing systems. The real-time operating system for real-time processing is characterized by responding within the allowed time range. It requires computers to process external information quickly and respond quickly within the time range allowed by the controlled object, the response time must be in seconds, milliseconds, or even microseconds or smaller. In recent years, real-time operating systems have become more and more widely used. The emergence of new devices, especially non-PCs and PDAs (Personal Digital Assistants), has strengthened this trend.
1.2.6 general operating system
The continuous improvement of multi-channel batch processing systems and time-based systems, the emergence of real-time systems and their application become increasingly widespread, resulting in increasingly improved operating systems. On this basis, a general operating system emerged. It supports multiple batch processing, time-sharing, real-time processing, or more than two features. For example, a real-time batch processing system is formed by combining real-time processing with batch processing. In such a system, it first ensures that the task is processed first, and the plug-in is empty for Batch Job processing. A real-time task is usually called a foreground job, and a batch job is called a background job. Combining batch processing and time-based processing can form a time-based batch processing system. When there is no time-sharing user, batch jobs can be processed. Similarly, time-sharing users and batch jobs can be processed in the frontend and backend mode.
Beginning in the middle of 1960s, the international community began to develop large-scale general-purpose operating systems. These systems have encountered great difficulties in solving their reliability, maintainability, comprehensibility, and openness. In contrast, the UNIX operating system is an exception. This is a common multi-user time-sharing operating system. It is first built on a lean core, and its functionality is comparable to that of many large operating systems, supporting a large number of software systems beyond the core layer. Currently, workstation-level operating systems such as Sun's Solaris and IBM's AIX are all UNIX-based operating systems.
Windows operating systems are also based on UNIX systems. Linux has evolved from UNIX.
So far, the basic concepts, functions, basic structure and Group Chengdu of the operating system have been formed and gradually improved.
1.2.7 further development of the Operating System
In 1980s, on the one hand, the era of personal computers was ushered in, and at the same time, the development of computer networks, distributed processing, giant computers and intelligence. The operating system has been further developed:
· Operating Systems on personal computers, such as DoS systems.
· Embedded operating system.
· Network operating system.
· Distributed operating system.
· Intelligent operating system.
In the late 1990s s, due to the sharp increase in personal computer hardware functions and user requirements for security and network functions, the personal computer operating system also switched from DOS to Windows and Linux.