Linux | Red Hat Certified | IT Technology | Operations Engineer
👇 Join our technical exchange QQ group with a note 【Official Account】 for faster approval

First, we need to understand that the most common computers (laptops) and the less common computers (servers) are essentially a combination of hardware: CPU, network card, graphics card, memory, disk, monitor, keyboard…
However, they are not just randomly placed together; the hardware needs to be effectively organized into a system to better perform its functions. We call this organizational structure the Von Neumann architecture!
1.1 Introduction to Von Neumann Architecture
a. Input Devices: Mouse, keyboard, camera, microphone, disk (file reading), network card (network receiving)…
b. Output Devices: Monitor, player hardware, disk (file writing), network card (network sending)…
The computer can only recognize binary language, so communication between humans and computers must rely on input and output devices. We will find that some devices are purely input or output, while others serve both functions.
Most operations such as running programs, reading files, and writing files occur in memory!
d. Arithmetic Logic Unit: Performs arithmetic and logical operations on our data.
e. Controller: Manages the flow of operations in our computer hardware.
The arithmetic logic unit and controller are collectively referred to as the Central Processing Unit (CPU).
The Von Neumann architecture consists of the above five components, but we must understand that each piece of hardware is an independent entity. To establish connections and work together, they must be connected by bus systems. We call this the bus, which is divided into the system bus and I/O bus.
System Bus: The lines between the storage area and the arithmetic logic unit and controller.
I/O Bus: The lines between the storage area and input/output devices.
1.2 Why Was Von Neumann Designed This Way?
We notice that input and output devices do not directly interact with the CPU; they only communicate with the memory. Thus, memory (RAM) plays a crucial role in linking the entire system! Next, we will analyze why this design is necessary!
1.2.1 Improving Work Efficiency
Below is the pyramid structure of computer memory:

The CPU operates at nanosecond speeds, while hard drives operate at millisecond speeds, leading to a significant speed disparity! Thus, memory (microsecond speed) serves as a mediator.
1.2.2 From Serial to Parallel

In fact, the CPU and hard drive can easily remind you of the barrel effect, where the capacity of a barrel depends on its shortest board. Similarly, the speed of a computer seems to depend on the hard drive. But if that were the case, what is the point of adding memory? Wouldn’t it slow everything down?
This line of thinking arises because you perceive the system as serial, assuming the CPU must wait for data to fully load into memory before it can work. In reality, while data loads from input devices into memory, the CPU may not be idle and could be processing other tasks! They operate in a parallel logic!
For example: A binary executable program is also a file stored on the disk. To run this program, it must first be read into memory. While external devices load data into memory, the CPU may be performing other calculations. When data is pre-loaded into memory, the CPU can start executing your code, meaning the processes of the CPU fetching data from memory and external devices loading data into memory can occur simultaneously! Thus, this is parallel rather than serial, greatly enhancing efficiency! This is the true value of memory!
1.2.3 Facilitating Computer Spread
Through the pyramid structure of computer memory, we see that the lower you go, the lower the cost, the larger the capacity, and the slower the speed. This is a trade-off process. If money were no object, could I use only registers? No memory or hard drives? Would I need to adhere to the Von Neumann architecture?
The answer is that it could be done! If you were particularly wealthy, you could indeed commission a computer that relies solely on registers, but it would be prohibitively expensive for the average person!
Whether we choose to use such a computer depends on ease of operation and performance, but also on cost! Therefore, why is memory necessary in the Von Neumann architecture? Because we need a CPU, but to control costs, we must have hard drives, necessitating a storage medium with moderate speed and capacity. This allows us to reduce costs without significantly sacrificing performance, making it accessible to the general public!
At this point, with the Von Neumann architecture, including open-source Linux and Git, we find that the cost is crucial for the rapid spread of technology. If the price is too high, it hinders dissemination. There may be many innovations in the market that could benefit the public, but if costs are too high, they may not be widely adopted and could be lost to history. For instance, in the movie “Dying to Survive,” the high price of legitimate cancer drugs forces the public to resort to illegal alternatives. The same principle applies!
1.3 Practical Applications
The most critical aspect of the Von Neumann architecture is memory! We can explain the following concepts well:
1. Why must a program be loaded into memory before it can run?
——> This is determined by the Von Neumann architecture. A program is essentially a binary file stored on the disk (external device), and it must be loaded into memory to run on the CPU!
2. In our previous progress bar example, if there is no line break, the data will be stored in the cache. So, where is the cache?
——> According to the Von Neumann architecture, we know that the cache actually resides in memory!
3. If I want to send an experiment report to my friend via QQ, how can I analyze the entire data flow using the Von Neumann architecture?

Each piece of hardware has its corresponding functions and can run the Von Neumann architecture effectively, but this is not enough. Someone must control when to execute which function.
For example: Suppose you are the king of a nation, and within your country, there are experts in economics, warfare, negotiation, and art… When you want to listen to music, you call the artist; during peaceful times, you focus on cultivating economists; when external threats arise, you call upon negotiators; if you want to go to war, you summon the military experts… Thus, this entire logic requires someone to manage it, and the same applies to computers.
So, your computer may be running QQ, QQ Music, and CCTalk simultaneously. When should one run over the other? Why not run QQ Music first when opening QQ? Hence, we need a brain-like role to manage them — the Operating System (OS).
The OS is software that manages hardware and software resources, just as a person can manage both people and machines!
2.1 The Significance of OS (Why)

2.1.1 Providing Users with a Good (Stable, Efficient, Secure) Operating Environment
No matter how our upper layers are structured, the final behavior is reflected in the hardware. Software must control hardware, which requires drivers that can establish connections with the hardware. For example, when you first connect a mouse, you have physically connected it to your computer, but you may need to wait a few seconds before it can be used because the driver has not yet been loaded.
The OS helps manage hardware and software resources, but this is merely a means to an end; its purpose is to provide users with a good (Stable, Efficient, Secure) operating environment. However, we must understand that ordinary users are not adept at interacting with the OS, so they primarily use software developed by programmers. Thus, professional programmers must first interact with the OS to create software that meets the needs of ordinary users!
Next, we will explore how programmers interact with the OS.
2.1.2 OS Does Not Trust Users
The OS contains various data, but it does not trust users!
First, we need to understand that not trusting someone and allowing them to use something are not contradictory. For example, a bank allows any user to enter, but it does not trust all users because there may be bad actors among them. Therefore, to protect itself, the bank needs to be somewhat closed, but it cannot be entirely closed because that would prevent it from serving the public. Thus, it opens small windows for ordinary users to apply for withdrawals or loans!
Similarly, the OS considers its data too important. It worries about malicious attacks and careless modifications, which could harm it, whether intentionally or unintentionally. For example, a disk may have 500GB, but someone could alter it to 300GB; your network may be functioning well but could be modified to be disconnected… Thus, like a bank, the OS needs to be somewhat closed while leaving small windows open (in computing, these are called interfaces) — thus, OS designers write internal function methods in C language and open them to the outside world, which we call system calls!
Because these interfaces are provided by the designers, there are methods internally to detect whether your actions are illegal, allowing only legitimate actions to access its data.
——> Therefore, in the future, if we want to interact with the OS, we can only do so through system calls!
——> However, using system calls can be quite challenging, so programmers need to design higher-level software or interfaces based on system calls for ordinary users to use.
2.1.3 Differences Between OS and Programming Languages
The essence of programming languages is: header files + library files + compiler = executable program.
1. Thus, languages actually exist above the system call interfaces! However, there are differences between languages; for instance, Java, Python, and virtual machines are all written in C or C++. Therefore, even though C/C++ is often considered a low-level language, it is still built on top of system calls. This helps us understand the boundaries clearly.
2. Any language accessing hardware must go through the OS, which is why we find that while languages may change, the OS remains constant. If the lower levels change, the entire upper logic would collapse; even the most advanced software must adhere to this system. When we say that computer development is rapid, we refer to the upper layers; the lower layers do not change much.
2.2 OS Management Methods (How)
To better understand management, let’s use a real-life example:
Question 1: In a school, the principal is the recognized manager, and students are the recognized managed. However, most of us have never met the principal, yet they can still manage us effectively. Why is that?
Thus, we can derive a viewpoint: Managers and managed do not need to meet!
Question 2: How does a manager manage without seeing the managed?
For example, if a school needs to select students for a math competition, it only needs to know who the top students are. If the school wants to award scholarships to the top 10 students, it simply ranks the grades and selects the top 10. As a boss, if I know one employee has secured many projects and generated significant profits for the company, ranking first in performance, I can decide to promote and raise their pay without ever seeing them. Thus, we find that a manager only needs to know management information to make management decisions. Therefore, the essence of management is to manage people through data management!
Question 3: How does the manager obtain the data?
If it’s a school, one might think of a counselor (acting as an executor). In management, there is also an executor between the manager and the managed. In addition to decision-making, someone must execute! For instance, if the principal wants to know which students qualify for a programming competition, they can call the counselor, who is closer to the students and may know the relevant information. This reasoning is valid, but in larger organizations, like a university, one counselor may oversee hundreds of students, and a principal may manage thousands or tens of thousands… They cannot handle all that data alone! Thus, relying on people to gather data is limited. Instead, we can think from another angle: we want to know basic information. Students may have unique characteristics, but they share common attributes. For example, Zhang San and Li Si have attributes like college, major, phone, age, hometown, height, weight, grades, and interests. If we manage this information, we can solve the problem. You might first think of using an Excel spreadsheet, which is common, but if the number of students is large and you want to find the top 5 math students, scanning through data could be tedious. As programmers, we have a better solution: using structures to manage them.

Every time a student enrolls, we can create a new student type, and every time a student graduates, we can delete a student type. However, there isn’t just one student! Thus, we need to manage them, and managing data means utilizing data structures! We can add a next pointer in each student structure, allowing us to link all student information into a list. Hence, we transform student management into linked list management!
What are the advantages of linked list management over Excel? —> Managing a linked list is essentially about adding, deleting, modifying, and querying, so we can write many needed interfaces based on the characteristics of the linked list. For example, if I want to find the top 10 students in math, I just need to write a relevant interface, and we can achieve this by calling the interface instead of checking each entry in Excel!
1. Managers and managed do not need to meet.
2. Managers only need to obtain management information to make management decisions; thus, the essence of management is to manage people through data management.
3. Managers can obtain data through executors and can also describe some information of the managed using structures, organizing them with data structures, and implementing related algorithms to retrieve data.
In computer architecture, our OS acts as the manager, our hardware and software resources are the managed, and our drivers serve as the executors.
2.2.2 Understanding Description Before Organization
After understanding management, we see that managers describe the structure of the managed, organize them using data structures, and implement relevant algorithms for management. This leads to the concept of describing before organizing.
Think about how we used to write a contact book. How should it be structured?

First, our contact book needs to include people, so we must describe them first, including attributes like name, phone number, and age… Then we manage these individuals using the contact book, implementing interfaces such as deleting contacts, adding contacts, and finding contacts. Thus, we conclude that in the future, regardless of the software we develop, we will think according to the principle of describing before organizing!
Also, consider the correct sequence of learning C++. We first learn classes and objects (description), followed by memory and STL (organization). Thus, the order of learning languages follows the description before organization principle!
Additionally, in the OS, we learn that managing any object ultimately translates to performing CRUD operations on some data structure!
2.2.3 Understanding Library Files vs System Calls
Let’s use an example: If there are two principals, A and B, and Principal A has a student exceptionally good at math while Principal B does not, Principal B will want to borrow this student for a competition. However, Principal B cannot directly approach the student since they belong to Principal A; they must first obtain Principal A’s consent.
Similarly, when we use printf to display “hello” on the screen, we are not directly interacting with the hardware through this library function; we must go through system call interfaces to inform the OS!
Thus, we understand that library functions must access the OS via system calls, establishing a hierarchical relationship where library functions are secondary development based on system calls.

For course inquiries, add: HCIE666CCIE
↑ Or scan the QR code above ↑
If you have any technical points or content you want to see
You can leave a message below to let us know!