0. No Operating System Computer System
Disadvantages: low utilization of computer resources, that is, conflicts between CPU waiting for manual operations and high-speed CPU and low-speed I/O.
1. Batch System)
1) Primary single-channel Batch Processing System
Objectives:In order to solve the problem that manual operations (without an operating system) seriously reduce the utilization of computer resources, that is, to solve the problems such as CPU waiting for manual operations and conflicts between high-speed CPU and low-speed I/O.
Offline input/output Technology: This technology utilizes onePeripheral Machine, Disconnects from the hostFirstInput data from low-speed input devices (such as tape machines) to input devices (such as tapes) with high-speed and high-capacity.
Batch Processing Technology:It uses the characteristics of large tape capacity to first sort a batch of jobs in orderOfflineInput to tape. Under the control of the supervisorCard MachineRead the operation information of the control job, read the job to the memory one by one from the tape, call the Assembly/editing program to translate the source program into the target code, connect the Assembly and execute the program, and print the result. After the task is executed, the system automatically processes the task one by one until the task is completed. This is an early single-channel batch processing system that solves the automatic conversion of the task, this reduces job creation and manual operation time.
Basic control card, modernJob control language and command interpreterPioneer
2) modern multi-channel Batch Processing System
Objectives:To further improve resource utilizationChannelAndInterruptedWhen the technology supports parallel operations, multi-channel programming technology is introduced, and a multi-channel batch processing system is introduced.
Multi-channel Programming Technology:
It stores several independent programs in the computer memory at the same time. These programs are in the running process, and they have started their respective operations, but none of them have been completed. Multi-ProgramParallel Execution at a macro levelAt the micro level, multiple programs are serialized on a certain part (such as CPU and I/O), that is, multiple programs use parts in turn and execute them alternately.
Shows the running status of a two-way batch processing system with one CPU and two I/O devices (disks and tapes:
Note:
- Several programs (program a, program B, and supervisor program) are stored in the computer memory at the same time.(Scheduling and allocation))
- All system components (such as CPU, IOA, and Iob) support parallel work,Different parts can run different programs at a specific time..
- Multi-Program (program A, B, and supervisor program) on a certain part (such as CPU, IOA, IOB) isSerialWork.
- Among multiple programs, the supervisory Program (operating system) is the control center. To use a certain part (CPU, IOA, IOB), the program mustSupervision ProcedureScheduling and allocation.
(1 ),It can be seen that the CPU and I/o a (Disk), I/o B (TAPE) devices can work in parallel, and a certain part of the system, such as the CPU, both programs a, B and the operating system (Supervisory program) areSerial, that is, alternate operation.The program switches between the CPU and the I/O device,CPU running which program is controlled by the supervisor program and scheduled according to certain algorithmsFor I/O device schedulingNon-preemption ModeThat is, once the I/O device is assigned to a process, it must be allocated after the process I/O is completed.Two methods can be used for CPU scheduling: one is the same as the above-mentioned non-preemption method, and the other is the preemption method.For example, if you use a preemptible CPU scheduling method, when a program with a higher priority needs to use a CPU, You need to pause the program with a lower priority on the CPU, so that the program with a higher priority can run before running the original program.
(2 ),FigureAt the beginning, program a and program B are all in the memory.First, run program. When program a requests disk inputCPU runs the supervisor program to start the disk,I/O after successful startup
A (Disk) for program a disk input.
At this time, the CPU is idle,CPU run supervisor program to Schedule Program BThen, the CPU runs program B. At the same time, I/O A (Disk) enters the program disk.
After program B runs for a period of time and requests for input, the CPU runs the supervisor program to start the tape. After the startup is successful, I/o B (TAPE) inputs the program B tape.
In this case, I/o a (Disk) inputs the program a disk, I/o B (TAPE) inputs the program B tape, and the CPU is empty. When the CPU is null, the input of disk A of the I/O A (Disk) Termination program causes interruption.Switch to the interrupt handler A of the CPU running supervisor, and then dispatch program a and run program.
When program a is running, I/o B (TAPE) ends program B tape input, resulting in interruptions. The CPU stops running program a on the CPU.Interrupt handler for running supervisor B interruptAfter processing, scheduler A or scheduler B according to a certain algorithm. Here scheduler B runs program B.
2. Time-Sharing System)
1) Principle of time-sharing system
Objectives:The formation and development of time-based systems are users' needs. Users want to directly control the running of programs and perform human-machine interaction in a timely manner, so that they can easily modify program errors.Users want a computer to share data with multiple usersTo solve the contradiction that computers were expensive and missing at that time (in 1960s), so that users can easily access the computer.
Implementation principle:A time-sharing system refersA host is connected to multiple terminals with monitors and keyboardsIt also allows many users to use computers to share resources in hosts through terminals. The so-called time-sharing means that multiple users share the same computer, that isSystem resources (especially CPU time) are divided in timeWhich divides the entire working time into time slices, and each time slice is allocated to one user. In this way, the CPU working time is provided to multiple users, and each user uses one slice in turn.Time slice.
2) implementation of a time-sharing system
- Single-channel time-sharing system
InSingle ChannelTime-sharing systemOnly one program is resident in the memory.And other programs are stored in the external store. Every time a program runs a time slice in the memory, it is transferred to external memory (calledCall up). Select a program from the external store to load the memory (calledImport) And run a time slice, accordingThis method enables all jobs to run one time slice in turn within the specified time.In this way, all users can interact with their own jobs. During the running of multiple jobs in turn, each job may be frequently called in and out multiple times,High overhead, so the system performance is poor.
- Multi-channel time-sharing system based on multi-channel Programming
Because the modern computer system uses large memory capacity and memory and disk swap technology to expand the memory, the modern time-sharing system introduces multi-channel programming technology.Stores multiple jobs in the memory in a queue.In turn, get a time slice to run.
BecauseSwitchThe job is in the memory, so do not spend a lot of time for debugging and calling. Therefore, the multi-channel time-sharing system has good system performance.The job scheduling algorithm is not limited to the simple rotation of time slices and order unchanged.For example, the UNIX operating system usesPreemptive Dynamic Priority Scheduling AlgorithmIt also enables time-sharing computers for various jobs,The time slice size and rotation order are changing..
Both the batch processing system and the time-sharing system are multi-channel program systems, which are used to process user jobs.The system does not have jobs to complete, but it only manages the scheduling system resources.To provide services to users. Such systems can be said to be"General System".
3) features of the time-sharing system
- Multiplexing:Multiple online terminals can be connected to a single host at the same time. The system serves each user according to the time-sharing principle. At the macro level, multiple users work at the same time to share system resources, while at the micro level, each user job runs a time slice in turn. Multi-channel, that is, synchronization, improves resource utilization and promotes more extensive computer applications.
- Independence:Each user occupies a terminal and operates independently of each other without interfering with each other. Therefore, the user will feel like he exclusive host.
- Interactivity:Users can perform extensive man-machine interaction with the system through terminals. Users can request the system to provide various services, such as file editing, data processing, and resource sharing.
- Timeliness:User requests can receive responses within a short period of time. The interval is determined by the acceptable waiting time, usually 1-2 seconds.
4) important indicators of the time-sharing system-Response Time
Response time is an important indicator of the time-sharing system. It is the time interval between the user's terminal command and the system's response. The system response time is determined based on the user's acceptable waiting time.Assume that the number of users in the time-sharing system is n and the running time slice of each user is Q, then the system response time is t = n × Q.The time slice Q assigned by each user is composed of two parts, which are used for switching time s and for real processing time t (processing ).
- T = n × Q
- Q = S (SWAP) + T (handle)
- In a time-sharing system, Q is a complex and key task.If the time slice is too large, the number of users decreases when the response time remains unchanged, or the response time is too long, when the time slice is over an hour, within a time sliceSwitch overheadAs a result, it takes more time for a process to finish running. the turnaround time of a process in the system is greatly increased.The best time slice value should not only allow the time-sharing users to get a good response time, but also make the overhead of switching within a time slice relatively small to ignore.
- UNIX is a typical time-sharing system. UNIX is a multi-user, multi-task operating system.
3. Real-Time Systems)
Objectives:In order to improve the system response time, the system responds to random external events in a timely manner and processes them.
1) Real-Time System classification
- Real-time Control System: These real-time control systems are mainly used for automatic control of the production process, automatic acquisition of experimental data, control of weapons, including automatic control of artillery, automatic aircraft driving, and missile guidance systems.
- Real-Time Information Processing System: These systems are mainly used for real-time information processing, such as aircraft ticket booking systems and intelligence retrieval systems.
2) Real-Time System features
- Fast Response Time: A Real-Time System is an operating system designed to improve the system response time, especially a real-time control system. It responds to external events very quickly. The response time of the real-time system is determined by the latency that the control object can accept. External events are often notified to the system by means of interruptions,The system has strong interrupt processing capabilities.Real-Time System Design"Event-driven"Method.
- Limited interaction capabilities:The batch processing system and time-sharing system are "general systems ",Real-time systems are generally dedicated systems.It is designed for specialized applications. The system itself contains a dedicated application that controls a real-time process and processes real-time information. A real-time system (such as a real-time information processing system) can provide human-computer interaction, but users can only access certain special service programs in the system, A time-sharing system cannot provide end users with various services.
- High reliability:A batch processing system and a time-based system require high system reliability. In contrast, a real-time system requires high system reliability. Therefore, real-time systems useDual-machine system, multi-level Fault ToleranceMeasures to ensure system and data security.
Next: system type (Part 2)