Chapter 398: Installing the Superbrain System
When eating dinner, Feng Wan saw that Lin Hong always stayed at home and didn't take half a step, and finally couldn't help but chatter:
"Xiaohong, how can you stay at home all day like this? Get out and walk around a lot. Isn't Sun Wu, the www.biquge.info of the pen "Fun" Pavilion, also at home? Go play with him, don't huddle at home, it's not good. ”
Lin Changming also nodded and said, "Your mother is right, young people should go out for a walk more." ”
"I see." Lin Hong nodded, "It's just that I'm writing a piece of software in the past few days, but I'm almost finished, and I'll go out to play after I'm done." ”
"You should take a good rest during the Chinese New Year." When Feng Wan heard this, she couldn't help but feel a little distressed, "Things will always be done, you should still rest when you are on vacation, don't keep thinking about the company's affairs." ”
"Uh...... I see! By the way, Mom, who is the girl you introduced to Senior Brother? Do I know each other? Lin Hong hurriedly changed the topic.
"It's a school teacher's daughter, you shouldn't know it."
"What?"
"Be a police inspector in a provincial capital."
"Detective?" Lin Hong smiled, "Isn't that a little chili?" Can the two of them have a play? ”
"It's just a clerical job, the other party has a good temper, and the person is also beautiful. If you weren't young, I would have wanted to match the two of you! ”
"Uh......" Lin Hong was a little out of the black line, he was a little puzzled, "She has such good conditions, she still has to rely on a blind date to find a partner?" ”
Although blind date is an important tradition that has been handed down since ancient times to rescue single men and women, young people nowadays should pursue more freedom in love, right? Influenced by many film and television works, in Lin Hong's view, blind date seems to be equivalent to a feudal and backward way of finding a partner, if someone relies on this to solve personal problems, it means that their own conditions are not very good, or where there are certain defects.
Of course, this is not absolute, for example, his eldest brother is the type, because he is too busy with work, and his career occupies most of his time.
If you are a girl, as long as you are not so ugly that it affects the city's appearance, there should be many suitors, not to mention that the other party also has a public office.
"You don't understand this, now it's still the most reliable way to find a partner on a blind date. As for why she hasn't found a partner until now, I don't know. I've seen that girl, and I've asked someone to inquire about it, and she's a good girl. As for whether it is suitable or not, it depends on how Zhang Cheng and her get along. ”
Lin Hong didn't know much about these things, and he didn't have any interest in understanding them, so he just asked about it casually.
After dinner, he returned to his room and began to devote himself to the writing of the superbrain system.
At this time, the production of the hard disk has been completed, this structure, it can be said that it is the largest part in the Sky Eye, this is a spherical structure, the diameter is also nearly 2 mm long, it took nearly ten hours to successfully generate.
In this regard, the production efficiency of switch proteins is still relatively low.
If the body is allowed to generate autonomously, such a small thing, let alone ten hours, can grow a huge sarcoma in an hour.
Of course, the structure of this hard drive is still very different from that of sarcoma, and it is not just a simple biological tissue.
Lin Hong first spent some time to make the interface between the hard disk and other components.
In order to save time, in terms of connecting interfaces and protocols, if he can directly imitate the standards of the computer, he will directly imitate them, implement the functions first, and then optimize them later.
When everything was ready, he officially started the installation of BLINX, transferring the binary code program that had been compiled in the computer to Tianyan. The transmission method used, naturally, is the Vortex wireless protocol.
Lin Hong has already regarded this protocol as the standard transmission protocol of the superbrain system, and this protocol is not intended to be made public for the time being.
Perhaps, scientists will also work out this technology at some point in the future, and by that time, perhaps Lin Hong has already used another protocol to replace it.
Vortex wireless transmission protocol is not only fast, but also stable, and it is not easy to lose data. The protocol used by Lin Hong now is only a dual-beam vortex, and if necessary in the future, the number of beams can be increased to become a multi-beam vortex.
The final compiled BLINX code is very small in size, and it is directly transmitted to the hard disk of Sky Eye in less than a second.
In general-purpose computers, there is usually a BIOS system on top of the hardware layer, which is an input and output system that directly deals with the hardware, and the manufacturer directly burns the firmware ROM on the BIOS chip of the motherboard when it leaves the factory.
However, the superbrain system written by Lin Hong does not need this step.
His superbrain system is a real-time operating system, similar to a microcontroller, and its components usually do not have universality, so there is no standard input and output interface.
Of course, it doesn't mean that it is not necessary, it depends on the situation, if Lin Hong wants to isolate such a layer, it is not impossible to deal directly with the "hardware", and it can also increase security.
However, for the time being, he did not consider this situation.
Now Blinx is directly operating with the "Sky Eye", anyway, this system is only used by him for the time being, and he naturally will not carry out "malicious" operations on these hardware.
After Lin Hong transferred the data to the "Sky Eye", he began the activation process of the superbrain system.
Similar to the computer, when it starts, the superbrain system will also self-test the specified hardware structure, but at the beginning, Lin Hong only specified a few specific hardware structures, first the CPU, then the display (retina screen), storage structure (hard disk and memory).
As long as there are no problems with these parts, let Blinx continue to execute the code and finally launch successfully. If something unexpected happens, the system hangs and a message is given.
This process is necessary because if something goes wrong with the hardware, there is no point in continuing to execute it, because a lot of the code will be invalid. For example, if there is a problem with the hard disk, even if the system is running, it will not be able to save data, the file system will not work, and the functionality will be greatly limited.
Of course, a monitor is not necessary for a computer, and many servers simply do not have a monitor, and the system can run the same.
Whether the self-test hardware should be hung or not depends on the specific situation.
After a short self-test, Blinx successfully passed and the boot process began.
The process was very fast, basically a flash, and then Lin Hong "saw" that a rectangular screen with a black background appeared out of thin air in front of him, the size of which was about the same as a 17-inch monitor, and it was fixed in front of it, as if there was really a display like this in front.
Then, green characters start to appear on the display:
>hello
>blinx
>hello
>blinx
……
Constantly displayed like this, and so on, the green characters keep swiping upwards.
Seeing this scene, Lin Hong had a smile on his face.
This picture really means that Blinx is officially running successfully in Tianyan.
What was shown before was only the result of his manual operation on the retina screen, as if he had drawn a pattern on the screen with his hand.
Now, it is indeed the content displayed in the system, and this content can be easily modified at any time.
Also, the two terms are displayed alternately, which means that the multi-process function in the Blinx system is running, that is, the system is simple, but at least it has the ability to multitask.
The instance of a program that is loaded into memory for execution is called a "process", and a process is controlled by the core of the operating system from establishment to termination.
There is a process queue inside the operating system, and the order of execution is arranged according to different algorithms according to the state and requirements of the process. Each process is allocated a short period of CPU time, and the CPU is immediately switched to other processes at the end of this period.
A system like this, which constantly switches executions between various processes (i.e., context switching), is called a multitasking operating system.
When the DOS system runs in local real mode, it is single-task, that is, only one process can be run at the same time. In order to run another program, you must first exit the current program.
In general, multitasking is an important feature of modern operating systems, and it was this feature that was first implemented when Linux was first written. And what Lin Hong is doing now is just repeating this process.
After proving that there was no problem with this step, Lin Hong began to mount the file system module and memory management module.
Since this is the structure of the microkernel, to mount these modules, the system does not even need to restart, just hang them directly.
After mounting the file system, Lin Hong tested a simple file read and write operation, created the file, renamed it, wrote data to it, and displayed it. Of course, Lin Hong did not use system call commands for these operations, but carried out them completely manually as before
Once this step was done, he began to refine his shell, which is the shell of the character terminal.
He now seems to be back in the days when he wrote Linux with Linus, when he ported an open source bash to Linux, and now, he has also started writing more complex system calls with a lot of reference to the Bash shell.
The shell is a very important thing in the operating system, just like the mother bed in the machine tool, with it, you can establish a production environment in it, which greatly accelerates the progress of future system writing. Once the shell is completed, it is as if it has jumped directly from 0 to 100, making a qualitative leap. He implements commands such as ls, move, and copy in it, and it becomes as simple as doing arithmetic problems like 1+1.