[Linux]Computer software and hardware architecture

[Linux]Computer software and hardware architecture

Von Neumann architecture

The composition of the von Neumann architecture

Most modern computers comply with the von Neumann architecture. The schematic diagram of the von Neumann architecture is as follows:

image-20230803114138672

The von Neumann architecture computer consists of five major components:

  1. input device

  2. output device

  3. memory (memory)

  4. operator

  5. controller

    Note: Most computers today integrate arithmetic units and controllers, which are called central processing units, or CPUs for short.

The functions of each component in the von Neumann architecture

The functions of each component in the von Neumann architecture are as follows:

  1. Input device: accepts data from the outside and passes it into the computer. Common input devices include: keyboard, microphone, camera, network card, and disk.
  2. Output device: accepts the computer's calculation results. Common output devices include: monitors, speakers, network cards, and disks.
  3. Memory: Preload data to improve the efficiency of the entire machine.
  4. Calculator: Complete various arithmetic operations and logical operations.
  5. Controller: Controls the entire computer to work in an orderly manner and automatically execute programs.

Understanding of storage (memory)

Before talking about the understanding of memory, we first need to know the following concepts:

  • Input devices and output devices are collectively called peripheral devices, or peripherals for short.
  • Peripherals are very slow compared to CPU components.

Because CPU and peripheral speeds vary greatly, computers cannot be designed as follows:

image-20230803122039339

Due to the large speed difference between the CPU and peripherals, the CPU quickly completes the calculation of the data and transfers the data to the output device. Then the CPU has to wait for the data from the input device to be transferred in. There will be many unnecessary gaps in the CPU, so It greatly reduces the efficiency of the CPU, which is like the barrel principle :

image-20230803121556142

Because the peripheral speed is too slow, the speed of the entire machine is reduced.

In order to improve the efficiency of the whole machine, the von Neumann architecture adds memory components. The memory is much faster than peripherals and has a certain capacity. Before the CPU operates, the memory will pre-load a large amount of data. Finally, when the CPU wants to perform calculations, it only needs to obtain data from the memory. Since the memory stores a large amount of data in advance, the CPU can continuously obtain data from the memory. There is no gap period, so the CPU cannot feel the difference in speed, thus improving the overall performance. machine efficiency.

Summarize:

  • At the data transmission level, the CPU only interacts with the memory.

  • At the data transmission level, peripherals only interact with the memory.

Based on the above understanding of the architecture, we can know that in order for a computer to execute a program, it must first load it from a peripheral such as a disk into the memory, and then the CPU obtains data from the memory to execute the program.

Understanding of data flow

The schematic diagram of data transmission between two computers is as follows:

image-20230803131142796

Data transmission process between two computers: The input device of device 1 receives data and requests and then transfers them to the memory. The CPU processes the data and requests in the memory, and then transfers the data and requests back to the memory. The memory transfers the data and requests to the output. In the device, the output device transmits data and requests to the input device of device 2. Device 2 and device 1 pass the data and requests through the input device to the memory, to the CPU, to the storage area, and finally to the data device for output.

Learn about operating systems

operating system concept

The operating system is a software that manages software and hardware resources .

management concept

In order to better understand the concept of management, let’s look at the following scenarios:

A programming competition is to be held in a school. There are three roles in the school: principal, counselor, and students.

image-20230803133656536

  • The principal decided that the programming competition will be held next month, requiring all students to participate, and the results of all students will be tallied.

  • After the counselor received the principal's decision, he convened a meeting with all students to inform the students about the school programming competition, prepare for the competition, and complete the subsequent score statistics.

  • After the students learned about the principal's decision, they began to prepare for the programming competition.

In the above scenario, what the principal does is to make decisions, what the counselor does is to implement the decision, that is, implement the decision, and what the students do is to participate in the execution of the decision.

image-20230803134622207

When a school holds a programming competition, the main job the principal has to do as a manager is to make decisions on tasks. Decide when the programming competition will be held, who will participate in the competition, and what work needs to be done related to the competition. So we can see that the core of management is to make decisions about the relevant parts of things.

the nature of management

It is also a school scene. There are three roles in the school: principal, counselor, and students.

image-20230803133656536

In schools, the principal has to manage the admission process of students when they are admitted, reward students with excellent grades, drop out of students with unqualified grades, etc. When managing each student, the principal does not need to communicate with every student. But the principal can manage every student well. The basis for the principal to manage each student is student information. For example, when enrolling, the student's information is recorded in the school, the student's performance information is viewed, and students with excellent performance are rewarded. Check the student's performance. Information is used to process the withdrawal of students with poor grades. The above student information can be called data, so the essence of management is the management of data . Among them, the principal is the manager, and the source of the data is the counselor who collects student information and then submits it to the principal. After the principal makes a decision, it is also the counselor who implements the decision.

The essence of management is "describe first, then organize"

Since the essence of management is data management, in order to better manage data, data needs to be modeled. For example, for a student, a structure can be created to describe the student. The structure contains various information about the student. Attributes. Since there are many students to manage, it is necessary to organize the structure describing the students for easy management, such as a linked list structure:

image-20230803142646876

The above method of describing students with structures and then organizing them with linked list structures is **"describe first, then organize"**.

After first describing and then organizing, when the principal wants to expel the student with the worst performance, he only needs to traverse the linked list to find the node of the student with the worst performance, and then delete the node, so that the student is no longer within the scope of school management, that is, Was fired.

Computer software and hardware architecture (part)

In the above school scene, the principal, counselor, and students correspond to the operating system, hardware driver, and hardware in the computer. These parts participate in the composition of the computer software and hardware architecture:

image-20230803145358849

  • Operating System – Hardware is described, organized, and then managed through this data modeling of the hardware.
  • Hardware driver (software) – conveys the operating system’s decisions to the hardware, allows the hardware to execute them, and obtains the hardware’s data information and requests and submits them to the operating system.
  • Hardware – Execute the decision issued by the operating system and submit the request to the hardware driver.

Operating system management strategies

The purpose of operating system management is to provide upper-level users with a safe, stable, efficient, and feature-rich execution environment.

Users may have various needs for computer hardware, such as amplifying the computer's audio volume. Problems may occur if users directly operate the hardware. Therefore, the operating system, as the manager of the hardware, will not allow users to directly access the hardware. Instead of hardware, it provides a variety of system interfaces. Users can achieve the desired functions by calling system interfaces. In this way, the operating system can consider the user's behavior to be controllable, thereby better providing good execution environment.

image-20230803155445513

The relationship between programming languages ​​and computer architecture

The use of programming languages ​​​​is at the upper level of the operating system in the computer architecture - the user layer. In order to reduce the cost for users to use system interfaces, programming languages ​​encapsulate the system interfaces into library functions for users to use:

image-20230803161308352

Computer software and hardware architecture (overall)

The computer software and hardware architecture is layered, including user layer, user operation interface layer, system call interface layer, operating system layer, hardware driver layer, and hardware layer:

image-20230803161202216
Any operation performed by the program needs to be continuously passed from the upper layer of the computer software and hardware architecture to the lower layer to complete.

Guess you like

Origin blog.csdn.net/csdn_myhome/article/details/132098715