Chapter 381 The next task
Although Wu Dong and others are making slow progress at present, they have at least set up the framework in the early stage. The next task is to implement the instruction set, which is basically a manual work. As long as they understand the principle, they will implement these instructions one by one according to the technical manual, which is very complicated, the same For an instruction, if the operands are different, the corresponding machine code is also different.
So far, Wu Dong and others have only implemented a few main instructions.
Lin Hong looked at the code they wrote for a while, and pointed out several functions that could be implemented more flexibly on the spot, which suddenly made several pieces of code that they thought were very difficult simple and reduced a lot of code.
This makes both Wu Dong and Tang Huaxin admire very much.
The way Wu Dong and others use is completely the most primitive, step by step, which is the most common thinking for beginners. Although the efficiency is relatively low, it is simple and effective, and the thinking is clear.
The way used by Lin Hong is highly optimized. For example, for Wu Dong to realize the conditional judgment mechanism, it may take at least three or four sentences to judge separately, while Lin Hong can do it with one sentence. And this simple sentence, Wu Dong and others seem to have to think about it for a long time to figure out the mechanism.
Generally speaking, there is no problem with their code function, but when some functions are implemented, the efficiency is a little low, because this is a software simulation. Even if it runs finally, the speed will be affected.
"That's well written!" Lin Hong encouraged, "At this point, I believe you have enough understanding of the structure of the CPU and the underlying principles of the computer."
Wu Dongshen thought so: "Yes, in order to write this code, I will learn the content that I began to learn in the second half of next year in advance. I have read the book on the principles of computer composition several times."
Wu Dong is still a freshman. According to the curriculum arranged by the school, he is still in the most basic stage of cultural knowledge popularization. At least some of these contents will be involved in his sophomore or even junior year.
"This project is really good."
At this time, Tang Huaxin also interrupted: "I learned the Principles of Computer Composition and the Principles of Microcomputer by myself before, and I have read the textbook several times, but I have been able to understand it all the time, and I can't understand many of the details. After coming into contact with this project, there was a sense of sudden enlightenment.
This project is simply an effective practice of the school's theoretical courses. The school's curriculum is too theoretical. For most people, it is basically completely returned to the teacher after the exam. And people who are really interested are not much better, because they don't know why and what's the use of learning these things at all. They can't be applied at ordinary times.
Many members of the group had an epiphany after being exposed to this project. They found that what they had learned before turned out to be like this.
Lin Hong helped them sort out the code of this project, optimized the structure of the whole framework, and then wrote down the next content to be written - the steps of the compiler.
In addition, he also made a list of books to write this thing, so that when they write code, they can read these books to learn and reduce the detours they take.
Lin Hong said, "As long as the compiler is implemented, you can run a specific program in your own virtual machine. In this way, the written virtual machine is really useful.
"What's the effect?" Wu Dong was a little curious, "What's the effect of this thing after it is written?"
He has always regarded this project as a pure learning project and has never thought about what to do with it after he realizes these functions.
"Virtual machines are still widely used." Lin Hong explained, "If the technology is powerful enough, you can naturally run the operating system directly on it like the virtual machines written by Microsoft and IBM INTE themselves."
"Run your own operating system?" Wu Dong couldn't help but be a little shocked when he heard the words, "How long does this have to be made up?"
"Of course, it's unrealistic to rely on your own strength alone. Didn't you form a group? There should be a lot of people who want to learn this knowledge in school. If they can be well organized, they may still make a difference. Just like INUX, it uses the power of open source to gather excellent programmers and hackers from all over the world to contribute code to it.
"This..." Wu Dong had no confidence in this.
Tang Huaxin, who was next to him, nodded slightly.
"You're right. In fact, this project can also be promoted like other universities to create a learning project while continuing to improve its functions."
Seeing that Wu Dong had no confidence, Lin Hong smiled and said, "In fact, it doesn't have to become such a complex system. My suggestion is to realize the main functions first, and then toss something on it. In addition to the virtual machine, which can be used to install the operating system, although Wu Dong's current progress is relatively slow, they have at least set up the framework in the early stage. The next work is to implement the instruction set, which is basically a manual work. As long as you understand the principle, it is to follow the technical manual and put these instructions. It is implemented one by one, which is very complicated. If the operation of the same instruction is different, the corresponding machine code is also different.
So far, Wu Dong and others have only implemented a few main instructions.
Lin Hong looked at the code they wrote for a while, and pointed out several functions that could be implemented more flexibly on the spot, which suddenly made several pieces of code that they thought were very difficult simple and reduced a lot of code.
This makes both Wu Dong and Tang Huaxin admire very much.
The way Wu Dong and others use is completely the most primitive, step by step, which is the most common thinking for beginners. Although the efficiency is relatively low, it is simple and effective, and the thinking is clear.
However, the way used by Lin Hong is highly optimized. For example, for Wu Dong to realize the conditional judgment mechanism, it may require at least four statements to judge separately, while Lin Hong can do it with one statement. And this simple sentence, Wu Dong and others seem to have to think about it for a long time to figure out the mechanism.
In general, there is still no problem with their code function, but when some functions are implemented, the efficiency is a little low, because this is a software simulation. Even if it runs finally, the speed will be affected.
"That's well written!" Lin Hong encouraged, "At this point, I believe you have enough understanding of the structure of the CPU and the underlying principles of the computer."
Wu Dongshen thought so: "Yes, in order to write this code, I will learn the content that I began to learn in the second half of next year in advance. I have read the book on the principles of computer composition several times."
Wu Dong is still a freshman. According to the curriculum arranged by the school, he is still in the most basic stage of cultural knowledge popularization. At least some of these contents will be involved in his sophomore or even junior year.
"This project is really good."
At this time, Tang Huaxin also interrupted: "I learned the Principles of Computer Composition and the Principles of Microcomputer by myself before, and I have read the textbook several times, but I have been able to understand it all the time, and I can't understand many of the details. After coming into contact with this project, there was a sense of sudden enlightenment.
This project is simply an effective practice of the school's theoretical courses. The school's curriculum is too theoretical. For most people, it is basically completely returned to the teacher after the exam. And people who are really interested are not much better, because they don't know why and what's the use of learning these things at all. They can't be applied at ordinary times.
Many members of the group had an epiphany after being exposed to this project. They found that what they had learned before turned out to be like this.
Lin Hong helped them sort out the code of this project, optimized the structure of the whole framework, and then wrote down the next content to be written - the steps of the compiler.
Moreover, he also made a list of books to refer to when writing this thing, so that when they write code, they can read these books for learning and reduce the detours they take.
Lin Hong said, "As long as the compiler is implemented, you can run a specific program in your own virtual machine. In this way, the written virtual machine is really useful.
"What's the effect?" Wu Dong was a little curious, "What's the effect of this thing after it is written?"
He has always regarded this project as a pure learning project and has never thought about what to do with it after he realizes these functions.
"Virtual machines are still widely used." Lin Hong explained, "If the technology is powerful enough, you can naturally run the operating system directly on it like the virtual machines written by Microsoft and IBM INTE themselves."
"Run your own operating system?" Wu Dong couldn't help but be a little shocked when he heard the words, "How long does this have to be made up?"
"Of course, it's unrealistic to rely on your own strength alone. Didn't you form a group? There should be a lot of people who want to learn this knowledge in school. If they can be well organized, they may still make a difference. Just like INUX, it uses the power of open source to gather excellent programmers and hackers from all over the world to contribute code to it.
"This..." Wu Dong has no confidence in this.
Tang Huaxin, who was next to him, nodded slightly.
"You're right. In fact, this project can also be promoted like other universities to create a learning project while continuing to improve its functions."
Seeing that Wu Dong had no confidence, Lin Hong smiled and said, "In fact, it doesn't have to become such a complex system. My suggestion is to realize the main functions first, and then toss something on it. Virtual machines, in addition to the functions of installing the operating system and debugging the CPU, the most important thing is the running environment of a program. Because it is a virtual program running inside, it actually does not affect the external computer system. This can complete many functions, such as researching virus and anti-virus technology, running programs across platforms, etc.
Of course, this is something to do in the future. At present, their main task is to implement all the instruction set first, and then implement the compiler to implement the program code in it.
Lin Hong encouraged them and said that he would help solve some difficult problems that they could not solve at any time.
The emergence of the virtual machine project team gave Lin Hong some inspiration.
He was thinking about how to tap high IQ students from all over the country. Perhaps this kind of project team method is a feasible solution.
Lin Hong took a general look at the code they wrote, and the code styles in it were different. Obviously, many people participated in writing it.
However, the code style of several people looks good, and Lin Hong can also roughly infer the level of the other party from the implementation of these codes.
If more such technical projects can be implemented on campus, some students with high IQ can gather.
This is because most students with high IQ like to study science, and when they go to college, they will soon find that computer thinking is very in line with their rational way of thinking, and they are usually attracted by this technology.
On the way back, Lin Hong conceived such a plan in his mind and started to proceed when the time was ripe.
When I returned to the courtyard, I went out all summer all day and Pan Pan also came back.
"Brother Hong, you're finally back." As soon as Pan saw Lin Hong, he immediately said, "Zhongguancun is really amazing. There are so many heavyweight companies gathered in a small street! It seems that the best IT companies in China are here at present.
Lin Hong: "Zhongguancun is known as China's Silicon Valley, and it is not just bragging."
"I carefully investigated the hardware price here with Summer. It's really cheap, and the sales price is even close to our purchase price."
"It's not surprising." Lin Hong has known this for a long time, "In fact, it can also be regarded as wholesale here, but most of them are still widely available, and the south is the center of computer accessories. However, the companies here are uneven, and the price they quoted you may not be true.
Then, Pan Pan told Lin Hong in detail about his experience and feelings.
In Zhongguancun, basically everyone is an expert in computer hardware. Everyone knows the performance of these accessories very well, and even the students who have just interned in the store are very good.
His deepest feeling is here.
They went to the talent market to have a look. There are also many people who know technology and can program. Compared with Lingnan Province, the talents here are really easy to find.
"You're right."
Lin Hong nodded: "After all, this is the capital of China, and most of the best talents are gathered here. If you set up a high-tech company, it is indeed easier to recruit people here. I also planned to open a branch here before, for this reason.
"Brother Hong, will this branch still be done or not?" Pan Pan asked.
Lin Hong thought for a moment, and then said, "We have to wait for a result. Didn't we bring a prototype? I plan to visit my elder tomorrow. If it goes well, it must be necessary to open a branch here. Otherwise, let's watch it again.
Lin Hong was quite confident about this matter before, but after chatting with Feng Yuanzheng today, he felt that this matter really seemed to be less reliable.
Anyway, whether this can be done or not, LIbX will definitely continue to develop. If the army doesn't like it, let's use it. The real-time operating system is also widely used in the field of industrial control, and it will not be useless.
In the evening, Lin Hong's laboratory.
Although there are many rooms in the quadrangle courtyard, Lin Hong chose his bedroom in the laboratory for convenience. Anyway, he can't sleep at night and needs to work hard for the superbrain system in his brain.
The equipment that Lin Hong made before is all here, and the volume is too large to take away, so when he is not here, he has devoted his energy to LIbX during this period.
The LINX kernel version he wrote in his notebook is actually more forward than the one in the R&D department of Tricolor Fire Technology, and there are two copies, one for machine operation, and the other is specially prepared for the superbrain.
After coming here, he began to reconstruct the construction of superbrain "hardware".
The structure of the super-brain CPU has been completed, and what we need to do now is to establish an acceptance and decoding structure for incoming information in the "sky eye".