Computer operating system overview OS

Computer system overview

OS is the most basic system software for computer systems. It manages software and hardware resources, controls program resources, improves man-machine interface, rationally organizes computer workflows, and provides a good operating environment for users to use computers .

Operating system: In
other words: an
operating system is a collection of system programs that facilitate users, manage and control computer software and hardware resources.
From a user perspective : OS manages various resources of the computer system, expands the functions of the hardware, and controls the execution of programs.
From the perspective of human-computer interaction : OS is the interface between the user and the machine, providing a good human-machine interface, which is convenient for users to use the computer.
From the system perspective : OS is a large-scale software system with complex functions and a huge system, using hierarchical and modular The structure of the program.
Operating system composition:

  1. Process scheduling subsystem
  2. Process communication subsystem
  3. Memory management subsystem
  4. Equipment Management Subsystem
  5. File management subsystem
  6. Network communication subsystem
  7. Job control subsystem

Looking at the operating system from the control method

  1. Multi-channel batch processing operating system, using offline control mode
  2. Time-sharing operating system with interactive control mode
  3. Real-time operating system

Look at the operating system from the application field

  1. Server operating system,
  2. Parallel operating system
  3. Network operating system,
  4. Distributed operating system
  5. Personal computer operating system,
  6. Mobile phone operating system
  7. Embedded machine operating system,
  8. Sensor operating system

Operating system from the perspective of resource management

In fact, it is mainly to understand the resource problems of the computer system,
understand the management of software and hardware resources,
understand the details of the underlying use of shielded resources,
understand the sharing and allocation
of resources, and the resources of the operating system

Hardware resources:
processor main memory peripherals, etc.
Information resources:
data programs

Manage the software and hardware resources of the computer system

Processor resources: Which program occupies the processor to run
Memory resources: How programs and data are distributed in the memory
Device management: How to allocate and use devices together
Information resource management: How to access file information
Semaphore resources: How to manage communication between processes

When programming, you must also shield the low-level details of resource usage:
Driver: The lowest level, part of the
responsibility ofdirectly controlling and monitoring various hardware resourcesis to hide the specific details of the underlying hardware, and provide an abstract, communication to other parts
Ifthe interface of Xianghas an object-oriented thinking, this can be understood as abstract thinking, can be understood as encapsulation, I will hide the specific details of the implementation, what you want, what I give you, and I provide a general interface, or Say that I provide a general abstract interface, and the specific details are implemented and controlled by you.

For example: To print a paragraph of text or a file, you do not need to know the details of the file information stored on the hard disk, nor the specific printer type and control details.

Many times, when designing a program, the problem to be considered is the problem of resource sharing and allocation , which is also an urgent problem to be solved.

Resource sharing and distribution method:

Resource sharing method:

  1. Exclusive use
  2. Concurrent usage

Resource allocation strategy:

  1. Static allocation strategy
  2. Dynamic allocation strategy
  3. Resource preemption strategy

Operating system from the perspective of controlling program execution

Simultaneous calculation of multiple programs

The contradiction between CPU speed and io speed does not match.
Only by allowing multiple programs to enter the memory at the same time to compete for the CPU to run, can the CPU and peripheral devices be fully paralleled, thereby improving the efficiency of the computer system

Macro analysis of simultaneous calculation of multiple programs

It takes 1 hour to run a single channel of an exclusive computer and takes about 18 minutes of CPU time. The CPU utilization rate is 30%.
According to the multi-program design method, the CPU utilization rate can reach about 50%. Because it provides 36 minutes of CPU time, about Run for 72 minutes. Taking into account the scheduling overhead of os, the actual time may be longer, which is based on the conflict between the CPU occupation of the two programs. Because the entire program is running, it is not always using cpu resources. If the entire process is occupying cpu resources, in this case, even if multiple programming ideas are adopted, it is not absolutely possible to solve the problem of mismatch. , And improve performance, but for some conflicts on cpu occupation, multi-programs may preempt resources, whoever grabs them to execute, but some time periods do not involve cpu preemption, so there is a thread It can be executed. If you use a single channel, in fact, other unused cpu resources are a waste of resources, and there are also great disadvantages to the performance of the processing program. Because in many cases, when the CPU resource is not used, other programs can be used to make use of this resource. However, for a single-channel program, the time may be prolonged because the CPU time preemption is involved. As a result, within 1 hour, the program was not processed, but overall, the average time must be greatly improved. What was completed in 120 minutes may now be completed in 80 minutes.

Multi-program design and advantages

Multi-program design: refers to allowing multiple programs to enter the computer's main memory at the same time for calculation

Advantages of multi-program design :

  1. Cpu and external equipment fully parallel
  2. Fully parallel between external devices
  3. Give full play to the efficiency of cpu
  4. Increase the amount of calculation questions per unit time

The realization
of the multi-program system establishes a management entity for the program that enters the memory for execution: process

The OS should be able to manage and control the execution of the process. The
OS coordinates and manages the use of various resources between processes
1. The management and scheduling of the processor
2. The management and scheduling of the main storage
3. The management and scheduling of other resources

The main points of the realization of the multi-program system :

  1. How to use resources: call service routines provided by the operating system (how to fall into the operating system)
  2. How to reuse CPU: scheduler (let other programs run when cpu is idle)
  3. How to use CPU and IO devices fully parallel: device controller and channel (dedicated io processor)
  4. If you let the running program give up cpu: interrupt (interrupt the running program, introduce os processing)

Operating system from the perspective of operational control

Computer system operation mode:

  • Os stipulates a reasonable operation process of the computer
  • Os operation interface-system interface
  • The function-level interface provided by Os to users is a collection of all services provided for users to solve common problems of operating computers and computing

Two types of job-level interfaces of Os:

  • Offline operation control method

User: Write job instructions, determine job processing control steps, and submit
them together with program data. Operator: Input job through the console.
OS: Automatically control job execution through job control programs.
Eg:
Batch os job control mode, UNIX bat file of shell program DOS

  • Online job control mode

Computer: Turn on the terminal keyboard/display, etc.
User: Log in to the system
OS: Provide a command interpreter
User: Online access commands, directly control the execution of job steps
Eg: Interactive control mode of time-sharing os

Command interpreter:
Receive and execute a processing command for the job proposed by the user. When a new batch job is started, or a new interactive user logs in to the system, the system automatically executes the command interpreter and is responsible for reading control Card or command line, make corresponding interpretation, and execute it.
Conversation language: programmable command interpreter.
Graphical command control mode.
Multi-channel command control mode.

No matter which control method is used to carry out, in fact, the command interpreter processing process is actually the same as the
command interpreter processing process:
Insert picture description here

Guess you like

Origin blog.csdn.net/crossroads10/article/details/108565737