Super-brain hacker

Chapter 190 Transplant

Lin Hong returned to his room, excitedly inserted one of the floppy disks into the CD-ROM drive, and then entered the floppy disk from the command line.

There is a folder called "SourceCode" in it. Lin Hong entered this folder and displayed it with the DIR command, listing a long folder.

Lin Hong took a general look and found that all the source code stored in this floppy disk is placed in the corresponding folder in different categories. It is mainly divided into three parts: kernel, memory management and file system. The rest are some boot code and driver source code.

withdrew the floppy disk, and Lin Hong checked the other floppy disk.

The content of this software is the mirror system of MINIX, which can be directly started from this floppy disk for installation.

The current floppy disk is much larger than before. In addition, LINUS directly made the system into a compression image, so a floppy disk was installed.

Lin Hong originally wanted to install it immediately, but on his mind, he was not very familiar with this system. If the original system was deleted, he would not be able to do many things, such as surfing the Internet and program development.

So, he decided to install a dual system on the hard disk, so that he could select the system at startup, so that he could enter different systems as needed.

However, Lin Hong did not know much about the dual system installation for the time being, so he put this matter aside for the time being and went to the major forums to check the relevant information first.

After wandering around several forums, Lin Hong basically knew it. He already had a solid foundation and a vague concept in his heart, but he didn't want to waste time experimenting and exploration. Learning everyone's experience can save time and energy.

The start-up of the dual system is actually very simple.

Records two important and important areas on the first sector of the hard disk, namely, MBR (main startup record area) and partition table.

Both areas are important, but the one related to startup is MBR. In this area, a "boot-up management program" is installed. This program is the key to installing the dual system. As long as the "boot-up-up management program" of the new system is also written to the hard disk, when booting, you will see two such management programs. Select the corresponding menu, and you can enter Different systems.

This principle is like visiting two signs at the door of the supermarket, one pointing to the DOS system and the other pointing to the MINIX system.

After going downstairs for dinner, Lin Hong returned to his room again and officially began to install MINIX.

In order to successfully write MINIX's "start-up management program" to MBR, Lin Hong also thought about it. The first few times failed. Fortunately, he has backed up the original MBR before, otherwise the original system may not be able to start.

After several attempts, Lin Hong finally successfully installed MINIX on the hard disk.

He can't wait to restart the computer, then select the MINIX menu and press back.

A lot of detection information immediately appeared on the display, constantly scrolling up. All the hardware of the computer was detected, all of which were OK, and finally entered a character interface.

Since Lin Hong had read the "Operating System: Design and Implementation" before, he was very familiar with the system commands of Minix. He quickly got started and tested all the commands he remembered.

Then, Lin Hong found a detailed help manual in this operating system, which was written by LINUS, which detailed the changes he made to the system.

Among them, Lin Hong was surprised that LINU had successfully completed the writing of the terminal simulator.

That is to say, it is completely possible to connect with some servers with this.

Lin Hong immediately tried it. First, he filled in the network account number and password to log in to the network, and then entered the BBS server IP address of the SAM Association of the server. After connecting, he entered the login account and password of the server.

A familiar command-line interface appears on the simulation terminal.

Next, Lin Hong tried the functions listed by LINUS one by one. He found that the simplified system, which was originally only used for teaching, was already powerful, even more powerful than several versions of the system in the early stage of the Apple computer.

The most touching function of Lin Hong is that LINUS actually integrated a shell program called BASH in it.

The program actually ran when the system was just started, but Lin Hong did not notice it. Later, after reading the document, he found that the command line interface he saw was not the one that came with MINIX, but had been successfully replaced by LINUS.

Shell is a shell program, which is an important part different from the operating system kernel. It is usually expressed as a character command line interface. For example, the DOS interface is also a shell.

By accepting the command entered by the user, Shell can call and execute the corresponding application.

In addition, Shell is also a programming language, which can interactively interpret and execute user-input commands, or automatically interpret and execute a pre-set series of commands. As a programming language, it defines various variables and parameters, and provides many control structures that are only available in high-order languages, including loops and branches.

With this Shell, it can be said that the function of this system modified by LINUS is completely comparable to that of the DOS system. More importantly, the source code of this operating system is public. Lin Hong can view all the implementation details, while the DOS operating system is a black box. Sub, I don't know the underlying operation mechanism at all, and there can only be some limited encapsulated API interfaces and interrupts.

Lin Hong immediately fell in love with this system. LINUS was really powerful and transformed a castrated version of the operating system to such an extent!

Since there is no network program like TELNET in this system, and there is no EMAIL email client that can be used to send and receive emails, Lin Hong temporarily withdrew from MINIX and re-selected the MS-DOS system.

He first received the email and found that LINU had sent himself an email a few days ago, asking if he had received the package he had mailed.

Lin Hong immediately replied that he had just received it today and couldn't wait to install it on the computer. He was very impressed by the power of the functions inside. He will also modify the system together in the future, hoping to keep in touch and share information.

Finally, Lin Hong also mentioned that he had written a chat software based on the IRC protocol, and he would transplant the chat software to the MINIX system as soon as possible, so that they could contact online in time.

After the email was sent out, less than two minutes, before Lin Hong exited the mail system, he was prompted for a new email to arrive.

Lin Hong was slightly stunned when he saw the title of the email. Unexpectedly, LINUS happened to be online today.

"Hi, my friend, I'm glad to finally receive your reply! According to the time, the package should have arrived at you a few days earlier. It seems that it has been delayed for a few days somewhere.

I'm very interested in the chat software you mentioned, and I'm looking forward to porting it to this system. You know, the software in this system is still a little less and too monotonous. Because I am busy fixing some bugs at the bottom, I don't have time to pay attention to these contents for the time being.

By the way, during this period, I have added several functions to this system. I think you will use one of the software. Please check the email attachment.

Your friend LINUS."

Lin Hong immediately downloaded the two attachments in this email.

One of the attachment packages is very large, while the other is a text document.

Lin Hong opened the text document and read it.

"GCC?"

He saw this document, mainly an installation instruction for GCC.

"It turned out to be a programming language compiler!"

Seeing the content here, Lin Hong's eyes suddenly lit up.

He is worried about this problem, because when he was familiar with the MINIX operating system, he did not see any software that could be used for programming, so that he could not carry out programming development in it.

Because the operating system platform is different, the software developed on another platform cannot run normally in another operating system unless it is a special customized simulation.

The full name of

GCC is "GNU/C Language Compiler", which is a set of free software released under the GPL license. It can be seen in many Unix-like operating systems and is very powerful.

LINUS has modified it so that it can be successfully ported to the MINIX operating system, so that software can be successfully developed directly under this operating system without switching to another platform.

The successful porting of the

GCC compiler, like the BASH program, is of great significance.

Lin Hong was also very excited about this. He immediately followed the instructions in the document and successfully integrated the GCC compiler into the original MINIX system.

He did not stop, but restarted and switched to the DOS platform again, copied the CQCQ source code he wrote before into the floppy disk, then restarted into the MINIX system, and read the source code from the floppy disk. He wants to immediately port CQCQ to this platform!

Under DOS, in order to facilitate the use of Phyllic, he added a layer of graphical interface to the original, making it more convenient to operate.

However, under MINIX, mouse and other operations are not supported for the time being, and the graphical interface has been completely abandoned, leaving only the internal core code. Since the source code of CQCQ itself is written in C language, Lin Hong's transplant process is very smooth. After redesigning the interface, he used GCC to successfully compile the programs under this platform.

Lin Hong entered his account number and password and logged in. As a result, he found that there were some minor errors caused by carelessness. He corrected them and then recompiled them.

After starting again, everything is finally normal. Entering the account number and password, Lin Hong went online smoothly.