Chapter 219: Important Things
readx;
Although both the lawyer and their parents think that because of the lack of precedent and the fact that they are students starting a business, even if they are punished, it will not be too serious, but the hearts of SAM members are still clouded. Pen | fun | pavilion www. biquge。 info《》Friendly hand-hitting
After all, this is the first time they have encountered such a situation, and they have not thought about such aspects at all before.
They found that in order to really do a good job, in addition to burying their heads in solving technical things, they will also encounter some other unexpected situations. These trivial matters were handled by Matthew alone, and among these people, Matthew is the one with the strongest external ability.
But now, the appearance of this incident has made them really feel the impact outside the campus. If these things were just An An studying in school, they would never have been touched. SAM has become a medium for them to get involved in society, which has had a great impact on the hearts of Lin Hong, Arthur and Matthew, so that when they start their own businesses in the future, they will consider in advance what they are doing, whether they violate local laws, and what things need to be prepared in advance?
Lin Hong returned to his room, put this matter behind him, and continued to refine the system call function of the bash shell.
Since the basic framework of bash has been completed, the speed of system calls has been increased by more than 10 times compared to before, and the foundation is laid, and the buildings on it can be built faster.
So, before 12 o'clock at midnight, he completed a total of more than 20 system calls, that is, all the functions that were originally ported to Minix were completed.
He boarded CQCQ and saw that Linus happened to be online, so he sent him a message and passed the source code directly to the other party.
Linus: Man, you're so efficient, man, I've ported bash, and I'm going to be much faster in the future!
Stone: Is the next step to be a porting of GCC? In this way, we no longer need to switch to the minix environment to compile the system, and compile directly under the Linux platform.
Linus: I was going to do this for the past two days, but now I have a new idea.
Stone: Tell me about it.
Linus: I think we should implement a different filesystem instead of using the minix file system directly.
Prior to this, in order to reduce the difficulty of writing code, Linus borrowed a lot of code from Minix, the most complete of which is the implementation of the file system.
Linus: The minix file system is designed specifically for the microkernel, and it was originally designed with only teaching in mind, in order to better understand that it can't really be used on large operating systems, and has a fatal flaw in performance, which I think you should have noticed as well.
Lin Hong agreed.
The efficiency of the minix system in terms of file processing is indeed a bit slow, and it was not felt at the beginning, but when he compiled the system, it was extremely obvious, and the efficiency of searching and reading files became extremely slow when there were many files. In this regard, it is not as good as the DOS system.
The file system of Minix is designed to imitate the file system of Unix, and its data structure is roughly the same as that of the Unix file system as a whole, and can also be roughly divided into boot blocks, superblocks, cylinders, nodes, etc.
However, the author Andrew's system itself is used for teaching purposes, so when it was designed, it was designed to make it easier for students to understand, and some of the complex implementations were omitted, only the skeleton was retained, and after appropriate modifications, it could be used normally, and it did not go through a lot of performance tests in terms of file storage.
When there are fewer Chinese parts on the disk, you can't feel the difference at all.
However, when Linus wrote the Linux operating system, although there was not a lot of code, only about 12,000 lines, but the 12,000 lines of code were not only in one file, but distributed in dozens of files and ten directories.
When compiling the system, the compiler will look up the source code one by one according to the compilation index file makefile, link them together, and then compile them uniformly.
It stands to reason that with only such a few files, the process should be very fast, but it turns out that it takes at least 40 minutes to compile the v0.00 version of Linux.
When Lin Hong had been pkzip such a small software, it took about ten minutes.
This is so inefficient that it can take only one-fifth or even one-tenth of the time under UNIX or DOS.
Linus then began to find out what was wrong and why it was compiling so slowly.
Eventually, he found out that this was the design of the minix file system, and he felt the need to change it, he didn't want to port such a file system to Linux, it would be as disgusting as eating a fly during a good meal.
As a tech nerd, Linux would never allow this to happen in Linux.
Lin Hong also feels that this issue is indeed very important, the file system is the cornerstone of the operating system, if the foundation is not laid, it will directly affect the height of the superstructure.
Linus: I've been thinking about this for a while now, and I'm going to start working on it. But before I do that, I'll settle for something more important.
Stone: What's more important?
Linus: It's something that every man has to go through, you know, haha!
Stone: I don't understand.
linus:…… I almost forgot that you seem to be a lot younger than me. I'm going to pursue a girl I like, you see?
When Lin Hong saw Linus's words, he was immediately a little embarrassed. He really didn't react just now, and he can't be blamed for it, just now they were still discussing technical issues, and suddenly they jumped to the topic of pursuing girls, as a Chinese tech nerd who is only fourteen years old in the century, it is strange to think of this problem.
Stone: I see. I wish you success and a beautiful woman as soon as possible.
Linus: Haha, thanks!
Linus: By the way, I forgot to tell you before, it's best to follow the Posix standard when you port Bash, so that our system can get greater compatibility, and there will be no obstacles for those Unix users to move to our Linux in the future.
Stone: POSIX standard?
Linus: This is the general term for a set of interrelated standards that the IEEE organization defines APIs for software to run on various UNIX operating systems, originally originating as a project in 1985......
Then, Linus began to give Lin Hong a detailed introduction to the relevant content of this standard.
In fact, Linus didn't know anything about this standard before, but I heard the teachers at the school talk about it, because this standard is a standard under Unix, which uniformly stipulates the implementation details of all system commands.
So, at the beginning, he posted a request for help in the minix email discussion group, seeking a standard download address for Posix, but this post did not get a few people's attention and response, and he did not find any information about Posix.
So, he had to settle for the next best thing, find a Unix user manual for the sun server, and call these system commands one by one according to the above commands.
However, the UNIX manual does not detail the internals of what these commands will implement, only the results.
For example, the ls command, the manual only describes the result of this command, and what parameters can be added to the implementation, such as "ls-all" to display all files in the current directory, including hidden files.
For example, it is necessary to find the boot area of the current directory, then analyze the file nodes in it, read the name, size, and creation date of each file from these nodes, and then display it on the display screen.
To implement the functionality of these system calls, one must have a good understanding of the underlying fundamentals, and of course this does not stump Linus, otherwise what else would he talk about writing his own operating system?
He implemented a total of about 20 system calls according to the information mentioned in the UNIX manual and "Operating Systems: Design and Implementation", which is exactly what Lin Hong implemented in Linux.
Linus: A friend sent me a few thick volumes of Posix manuals a while ago, but now that you've started porting Bash, you can move on with the rest of the work.
Stone: Where can I find the manual for POSIX?
Linus: I don't know that. However, if you are in the United States, it should not be difficult, go to the book store or library, and you should be able to find it. The publisher of my POSIX manuals is......
Then, Linus provided Lin Hong with all the information about the publishing house and address, and asked him to find it according to the information if he really couldn't find it, and mail order it directly from the publishing house.
Linus: Also, a friend of mine happens to have an Apple-based server, and last time I asked him to try out the CQCQ software, he was willing to host the server for free, what do you think?
What Linus said was that last time Lin Hong mentioned that he wanted to host the server side of CQCQ to another place, Linus paid attention to it.
Stone: Yes. I'll pass you the server-side installation files.
With the increase in access users, the performance of SAM's official server can't keep up, and with the recent appearance of Texas Instruments, Lin Hong finally agreed to transfer the server side.
Originally, Lin Hong also planned to release CQCQ so that more people could use it and continue to improve it, but after talking to Kevin once last time, his plan was put on hold.
He decided to redesign the structure of CQCQ to increase its security before releasing it.
The current version,For the time being, it's used to communicate with a few people internally.,After the server side is removed,Lin Hong decided to recommend this software SAM other members to use.。
After chatting with Linus, Lin Hong began to officially redesign the CQCQ software.
Novel Knight