1. Concepts, objectives, and functions of the Operating System
Operating System Concept: In simple terms, an operating system is a set of control and management of computer hardware and software resources, reasonable scheduling of various types of resources, and a set of programs that are convenient for users.
The operating system has always focused on two main objectives from its generation to its development. First, it is convenient for users to use computer systems. Second, various resources in the computer should be scheduled to ensure the high performance of the computer system. Therefore, the operating system must achieve the following four objectives:
(1) Convenience: After operating system is configured, You can provide an environment that is easy to run and develop programs.
(2) Effectiveness: improves system resource utilization and system throughput.
Convenience and effectiveness are two of the most important goals when designing an operating system.
(3) Scalability: it is used to adapt to the development needs of computer hardware and computer networks, specifically whether new modules can be easily added.
(4) Openness: The system complies with world standards and norms, especially the national standards for the interconnection of open systems.
The role of the operating system depends on the user and computer resources.
(1) OS provides interfaces between users and computer hardware. From the user's point of view, because the OS provides such software interfaces, it can more conveniently, quickly, securely and reliably manipulate computer hardware and run programs.
(2) The OS manages computer resources. As the manager of four types of computer system resources, processor, memory, I/O device, and information (Information and Program), the OS provides processor management and storage management, i/O device management and file management.
(3) OS provides extended machines. After the OS is logically covered, a multi-layer expansion machine or multi-layer virtual machine is enhanced.
2. Operating System Development Process and Classification
(1) computer systems without Operating Systems
Manual operation is performed first, followed by offline input and output using tape or disk. The offline input/output mode reduces the CPU idle time and increases the I/O speed compared with the manual operation mode.
(2) single-channel Batch Processing System
A single channel means that only one program is running in the memory, and a batch of jobs on the tape can be processed one by one under the control of the system monitor, batch processing.
The single-channel batch processing system is formed in resolving the contradiction between man and machine and the mismatch between the CPU and I/O device speed, slightly improving the utilization of system resources. Automatic, ordered, and single-track.
(3) Multi-Channel Batch Processing System
Jobs in multiple batch processing systems are stored in a "backup queue". The job scheduler selects several jobs from the queue for memory transfer, in this way, when a job occupies the memory space and is busy with I/O, you can choose other jobs in the memory to run.
The multi-channel batch processing system improves the CPU utilization, memory utilization and I/O device utilization, and system throughput. It features multiple channels, disorder, and scheduling.
(4) time-sharing system
A time-sharing system means that multiple terminals with monitors and keyboards are connected to a host, and multiple users are allowed to use the computer through their own terminals in an interactive manner, share resources in the host.
The time-sharing system allows a host to serve multiple users and respond to user requests in a timely manner. It is flexible, independent, timely, and interactive.
(5) Real-Time System
The real-time system requires the system to respond to external event requests in a timely manner and finish processing within the specified time. Real-time tasks can be divided into hard real-time tasks (must be completed within the deadline) and soft real-time tasks (not strictly completed before the deadline ).
The preceding single-channel system, multi-channel system, time-sharing system, and real-time system can be regarded as a classification of the operating system by the use environment. In addition, the number of users can also be divided into: single user single task operating system, such as CP/M, PC-DOS; single user multi-task operating system, such as OS/2 and windows; multi-user and multi-task operating systems, such as UNIX and VMS.
3. Basic Features of the Operating System
1. Concurrency: Two or more programs are executed at the same time interval (note that they are not at the same time ).
Generally, programs cannot be executed concurrently. To enable concurrent execution of multiple programs, the system must create processes for each program separately. Simply put, a process runs independently in the system and serves as the basic unit for resource allocation. It is composed of programs, data, and stacks. It can compete for the right to use CPU for concurrent execution, is an activity entity that can run independently.
Because a process has its own resources, scheduling costs are high. To this end, threads are introduced. Generally, a process can contain several threads, which can use the resources of the process as the basic unit for independent running and independent scheduling.
Parallelism: Two or more events occur at the same time.
2. Sharing: multiple processes concurrently executed in the memory can use resources in the system together.
There are two methods: 1. Mutual Exclusion and sharing. Only after process a has accessed and released the resource can another process access the resource. The resource that allows only one process to access within a period of time is called a critical resource or an exclusive resource. 2. Simultaneous access, such as disk devices.
3. Virtual Technology: converts a physical entity into several logical counterparts.
4. asynchronization (uncertainty): In a multi-program environment, each process is executed at an unpredictable speed, but as long as the runtime environment remains unchanged, the job will have the same results after multiple runs, this is The Asynchronization of processes.
4. Main features of the Operating System
1. processor management
That is, CPU management, including (1) process control, (2) process synchronization, (3) Process Communication, and (4) CPU scheduling.
2. Memory Management
As long as the task is to provide a good running environment for multi-program operation, it is convenient for users to use the memory, improve the memory utilization and logically expand the memory. The content includes (1) memory allocation, (2) memory protection, (3) Address ing, and (4) memory expansion.
3. device management
The main task is to complete the I/O requests put forward by the user process, allocate the user process to the required I/O devices, and improve the utilization of CPU and I/O devices; improves I/O speed and facilitates the use of I/O devices. The content includes (1) buffer management, (2) device allocation, and (3) device processing.
4. File Management
The main task of file management is to manage user files and system files for ease of use and ensure file security. To this end, file management should include (1) file storage space management, (2) Directory management, (3) file read/write management, and (4) file Sharing and protection.
5. provide user interfaces
Interfaces include user interfaces and program interfaces.
I. Operating System Introduction