game trailblazer
Chapter 4 Software Analysis
Chapter 4 Software Analysis
Of course, the most convenient way to study a computer is to start with random software and materials. Zhang Lexing first set his goal on random software.I took out the random software from the floppy disk case one by one and looked at them carefully. At this time, the floppy disk was still a large 5-inch disk. According to the label on the floppy disk, this pile of floppy disks included two AppleDOS disks and a VisiCalc spreadsheet software. , A disk that looks like a word processing software, what he didn't expect was that there were several game disks, I really don't know how this computer was bought back.
According to the habit, Zhang Lexing tried the game disk first. After all, it is only 80 years now, and the game screen is very simple. He is used to the gorgeous game screen of later generations. At first glance, the game composed of simple green grids on the Apple-II I'm not used to the picture, but fortunately, there is actually a game "HEADON" that seems to be somewhat familiar. Although the picture is very simple, it feels like eating Pacman when playing.
After briefly studying the game disk, Zhang Lexing took out AppleDOS to study.This system is quite old, relying on the random manual, Zhang Lexing figured out that the command to list the directory is not DIR, but CATALOG, and the AppleDOS operating system is relatively simple, and there are not many functions that can be realized, even the directory does not support, file The management function is basically equivalent to no, and it can only be regarded as an interface for disk operation in essence.Zhang Lexing remembered that it seemed that it would be a few years before a more powerful ProDOS appeared. At that time, there was a real disk operating system on the Apple II.
The simple AppleDOS and unfamiliar command lines finally made Zhang Lexing unbearable. He remembered the operating system he had designed. Relying on the experience and lessons of his predecessors and the enthusiastic support of many netizens, this operating system has been optimized many times. It can be said to be the most powerful in function and performance on the Apple II.Although such a long time has passed, Zhang Lexing's memory of the source code of the operating system is still fresh after 36 optimizations. Since he has time now and the AppleDOS at hand is not easy to use, Zhang Lexing decided to write it out immediately.
The complete source code is relatively long, and the final optimized core code has about 1500 lines. Zhang Lexing thought about it carefully, and the familiar code quickly emerged from his mind. He took a breath and began to enter the code from memory.After more than two hours, the input of the code was completed. Zhang Lexing checked it carefully and corrected a few typos. He felt that there should be no problem, so he immediately saved the disk, and then modified the boot area of the floppy disk so that the floppy disk can be started. Booted the new system smoothly.
After restarting the computer, Zhang Lexing took advantage of the time when the system started to rub his sore arms and moved his stiff wrists.The physical activity was turned on, and the new system started after reading the disk, and soon a "LOGIN:" prompt appeared on the screen. After Zhang Lexing entered the default user name and password, a brand new command line appeared.
This new operating system is designed based on some common disk operating systems in later generations. It can support disks, support hierarchical directories, provide file management functions, have memory scheduling functions, and can also achieve multitasking (for example, when running word processing software) Need some data, you can call out other software needed through the resident management program, and switch back to the word processing software after finding out).However, the function of the system is not complete now. For the time being, only the code of the kernel part has been completed, and some auxiliary programs need to be added, and some small bugs were found during the trial run. It seems that there may be a gap between the simulator and the real machine. Further debugging and optimization is required.However, Zhang Lexing has already thought up the name of this operating system, and plans to use the name Kylin that the troublemakers gave.
The Kylin system, which condensed everyone's painstaking efforts, traveled through time and space, and appeared in this era when the Apple II was still in full swing. Zhang Lexing's life also began to undergo subtle changes.
In the following days, the daily itinerary is very tight. Zhang Lexing spends his time in the computer room every day. The morning time is used to optimize and debug the operating system and add some auxiliary programs to the operating system. The afternoon time is used to teach Uncle Zhao how to use Apple II and translation "BASIC User Guide".A week later, Zhang Lexing's operating system Kylin was basically completed. Uncle Zhao also learned the basic operation of the Apple II, and could use the ROM-BASIC on the Apple II to write some simple programs. Of course, when writing code, he often needs to read Zhang Lexing's writing Manually copy the simplified version of the BASIC manual.
"Le Xing, it's not bad. I've produced a manual in just a week. Uncle Zhao can use this new machine thanks to you." Uncle Zhao thanked me while flipping through the BASIC manual.
Zhang Lexing waved his hand to Uncle Zhao, and said modestly: "It's nothing, I actually wrote it after reading the random information, which is actually quite detailed, I just picked up important places and translated it."
"I think you are pretty good. At least you are more capable than the two college students in the factory. They can't understand anything." Uncle Zhao said with a smile: "I think you like computers. Are you interested in coming to help me?" Uncle Zhao is busy."
"Uncle Zhao, can this work? How old am I, can the factory let me in?" Zhang Lexing was very happy in his heart, but deliberately expressed some doubts on his lips.
"It's okay, you are a family member in the factory, and the factory manager is my former comrade-in-arms. Uncle Zhao will help you to talk about it. It must be no problem, and it will be on Uncle Zhao." Uncle Zhao patted his chest, and he took the matter off. .
"Uncle Zhao, this matter is really troublesome for you." Zhang Lexing thanked.
……
After two days, Zhang Lexing felt that the portability of the program written in assembly was not very good, and the program written in BASIC was too slow. He couldn't help but began to miss the C language he was good at. Unfortunately, it was not available on the Apple II. Zhang Lexing was very familiar with standard C, so he decided to solve this problem by himself, so Zhang Lexing had a new development task - adding a C language compiler to the operating system.Because the C language has good portability, a lot of code written by Zhang Lexing can be easily used on a new computer, and the amount of modification is generally not too large. After all, IBM-PC will be released next year. It was not introduced until around 85. You must know that this is a platform for the next few decades, and it is not comparable to Apple machines.
When it was almost noon, Zhang Lexing, who was immersed in the world of C language, was still working hard to pile up the codes. Suddenly, Uncle Zhao rushed into the computer room with a face full of excitement, took Zhang Lexing's hand and walked out, and said cheerfully as he walked : "Le Xing, let's go, Uncle Zhao will take you to lunch."
When he arrived at the canteen of the factory, Uncle Zhao, who was in a good mood, ordered two more dishes than usual. The oily braised pork stewed with dried beans made people greedy, and Zhang Lexing's appetite was much better than usual.After finishing the meal, Uncle Zhao took Zhang Lexing to a dining table next to the wall, put the rice and vegetable bowls, and Uncle Zhao began to chat while eating.
"In the past two days, I went to the factory leader. I took out the BASIC manual you wrote, and I was stunned at that time. In addition, I said some things about your situation during this period of time. Mushroom After two days, this matter was finally done. Lexing, from now on you will be considered as an employee of the factory, with a monthly salary of [-] yuan. In addition, considering your situation, the factory will provide a monthly subsidy of [-] yuan. From now on, you will I went to work at the same place as Uncle Zhao, and I will take you to go through the formalities in the afternoon." Uncle Zhao explained.
Hearing this, Zhang Lexing was very happy. His most pressing problem was finally solved. Of course, he did not forget to thank Uncle Zhao for his hard work in the past few days.
After lunch, Uncle Zhao took Zhang Lexing to the factory to go through the formalities, and transferred them down in the afternoon, the personnel department, the archives room, the financial room..., almost all the offices were transferred, and the formalities were basically completed, only waiting for the factory to report Once approved by the Human Resources Bureau, you can go to work officially.From now on, Zhang Lexing can finally go to the computer room to use the computer openly, and he no longer has to worry about others gossiping.
The next day, Zhang Lexing officially started the design of the C language compiler. The C language compiler is mainly composed of six parts, lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and object code generation. The last two steps most affect the code running efficiency. If it can target a certain CPU Optimizing the design will greatly improve the running effect of the final code.After a few days, the C compiler was officially completed.In order to check the compiler, Zhang Lexing wrote some test programs, all of which were successfully compiled and passed. It seems that the compiler is already working normally.In order to further test the performance of the compiler, Zhang Lexing wrote a C language version based on the "Digging for Gold" in his memory. After compiling, he found that the operation was quite normal. Compared with the one written in assembly language, there was no difference in the running speed. Great, it seems that the performance of this compiler is good. The only drawback is that the performance of the Apple II processor is very average. As a result, the compilation speed of the program is relatively slow, but fortunately it does not affect the final running effect.
Uncle Zhao, who was obsessed with the BASIC world on paper, looked up by chance and found that Zhang Lexing was playing "Digging for Gold" (in fact, Zhang Lexing was just comparing the operating efficiency of programs written in different languages), and immediately ran over to watch.
"Lexing, what is this? It looks very interesting." Uncle Zhao asked curiously.
"Well, this is a game, I just wrote it." Zhang Lexing, who was thinking about the problem, replied casually.
"Come on, make a copy for Uncle Zhao." A floppy disk was stretched out in front of Zhang Lexing.
Zhang Lexing came back to his senses, smiled wryly, and used the disk test tool he wrote to copy the game disk to Uncle Zhao. Uncle Zhao happily took the floppy disk and received it in his floppy disk box. He probably planned to do it in the afternoon to play.
Seeing that the C compiler worked well, Zhang Lexing began to further optimize the operating system.First, some adjustments were made to the memory management to reduce the memory usage of the operating system; secondly, a simple disk compression function was added to increase the capacity of the floppy disk from 160K to 220K in disguise, so that a floppy disk can hold more things.
After the completion of the operating system and C compiler, Zhang Lexing took advantage of Sunday to rest for a day, and started a new goal to aim at the VisiCalc spreadsheet software in the random software.
(End of this chapter)
Of course, the most convenient way to study a computer is to start with random software and materials. Zhang Lexing first set his goal on random software.I took out the random software from the floppy disk case one by one and looked at them carefully. At this time, the floppy disk was still a large 5-inch disk. According to the label on the floppy disk, this pile of floppy disks included two AppleDOS disks and a VisiCalc spreadsheet software. , A disk that looks like a word processing software, what he didn't expect was that there were several game disks, I really don't know how this computer was bought back.
According to the habit, Zhang Lexing tried the game disk first. After all, it is only 80 years now, and the game screen is very simple. He is used to the gorgeous game screen of later generations. At first glance, the game composed of simple green grids on the Apple-II I'm not used to the picture, but fortunately, there is actually a game "HEADON" that seems to be somewhat familiar. Although the picture is very simple, it feels like eating Pacman when playing.
After briefly studying the game disk, Zhang Lexing took out AppleDOS to study.This system is quite old, relying on the random manual, Zhang Lexing figured out that the command to list the directory is not DIR, but CATALOG, and the AppleDOS operating system is relatively simple, and there are not many functions that can be realized, even the directory does not support, file The management function is basically equivalent to no, and it can only be regarded as an interface for disk operation in essence.Zhang Lexing remembered that it seemed that it would be a few years before a more powerful ProDOS appeared. At that time, there was a real disk operating system on the Apple II.
The simple AppleDOS and unfamiliar command lines finally made Zhang Lexing unbearable. He remembered the operating system he had designed. Relying on the experience and lessons of his predecessors and the enthusiastic support of many netizens, this operating system has been optimized many times. It can be said to be the most powerful in function and performance on the Apple II.Although such a long time has passed, Zhang Lexing's memory of the source code of the operating system is still fresh after 36 optimizations. Since he has time now and the AppleDOS at hand is not easy to use, Zhang Lexing decided to write it out immediately.
The complete source code is relatively long, and the final optimized core code has about 1500 lines. Zhang Lexing thought about it carefully, and the familiar code quickly emerged from his mind. He took a breath and began to enter the code from memory.After more than two hours, the input of the code was completed. Zhang Lexing checked it carefully and corrected a few typos. He felt that there should be no problem, so he immediately saved the disk, and then modified the boot area of the floppy disk so that the floppy disk can be started. Booted the new system smoothly.
After restarting the computer, Zhang Lexing took advantage of the time when the system started to rub his sore arms and moved his stiff wrists.The physical activity was turned on, and the new system started after reading the disk, and soon a "LOGIN:" prompt appeared on the screen. After Zhang Lexing entered the default user name and password, a brand new command line appeared.
This new operating system is designed based on some common disk operating systems in later generations. It can support disks, support hierarchical directories, provide file management functions, have memory scheduling functions, and can also achieve multitasking (for example, when running word processing software) Need some data, you can call out other software needed through the resident management program, and switch back to the word processing software after finding out).However, the function of the system is not complete now. For the time being, only the code of the kernel part has been completed, and some auxiliary programs need to be added, and some small bugs were found during the trial run. It seems that there may be a gap between the simulator and the real machine. Further debugging and optimization is required.However, Zhang Lexing has already thought up the name of this operating system, and plans to use the name Kylin that the troublemakers gave.
The Kylin system, which condensed everyone's painstaking efforts, traveled through time and space, and appeared in this era when the Apple II was still in full swing. Zhang Lexing's life also began to undergo subtle changes.
In the following days, the daily itinerary is very tight. Zhang Lexing spends his time in the computer room every day. The morning time is used to optimize and debug the operating system and add some auxiliary programs to the operating system. The afternoon time is used to teach Uncle Zhao how to use Apple II and translation "BASIC User Guide".A week later, Zhang Lexing's operating system Kylin was basically completed. Uncle Zhao also learned the basic operation of the Apple II, and could use the ROM-BASIC on the Apple II to write some simple programs. Of course, when writing code, he often needs to read Zhang Lexing's writing Manually copy the simplified version of the BASIC manual.
"Le Xing, it's not bad. I've produced a manual in just a week. Uncle Zhao can use this new machine thanks to you." Uncle Zhao thanked me while flipping through the BASIC manual.
Zhang Lexing waved his hand to Uncle Zhao, and said modestly: "It's nothing, I actually wrote it after reading the random information, which is actually quite detailed, I just picked up important places and translated it."
"I think you are pretty good. At least you are more capable than the two college students in the factory. They can't understand anything." Uncle Zhao said with a smile: "I think you like computers. Are you interested in coming to help me?" Uncle Zhao is busy."
"Uncle Zhao, can this work? How old am I, can the factory let me in?" Zhang Lexing was very happy in his heart, but deliberately expressed some doubts on his lips.
"It's okay, you are a family member in the factory, and the factory manager is my former comrade-in-arms. Uncle Zhao will help you to talk about it. It must be no problem, and it will be on Uncle Zhao." Uncle Zhao patted his chest, and he took the matter off. .
"Uncle Zhao, this matter is really troublesome for you." Zhang Lexing thanked.
……
After two days, Zhang Lexing felt that the portability of the program written in assembly was not very good, and the program written in BASIC was too slow. He couldn't help but began to miss the C language he was good at. Unfortunately, it was not available on the Apple II. Zhang Lexing was very familiar with standard C, so he decided to solve this problem by himself, so Zhang Lexing had a new development task - adding a C language compiler to the operating system.Because the C language has good portability, a lot of code written by Zhang Lexing can be easily used on a new computer, and the amount of modification is generally not too large. After all, IBM-PC will be released next year. It was not introduced until around 85. You must know that this is a platform for the next few decades, and it is not comparable to Apple machines.
When it was almost noon, Zhang Lexing, who was immersed in the world of C language, was still working hard to pile up the codes. Suddenly, Uncle Zhao rushed into the computer room with a face full of excitement, took Zhang Lexing's hand and walked out, and said cheerfully as he walked : "Le Xing, let's go, Uncle Zhao will take you to lunch."
When he arrived at the canteen of the factory, Uncle Zhao, who was in a good mood, ordered two more dishes than usual. The oily braised pork stewed with dried beans made people greedy, and Zhang Lexing's appetite was much better than usual.After finishing the meal, Uncle Zhao took Zhang Lexing to a dining table next to the wall, put the rice and vegetable bowls, and Uncle Zhao began to chat while eating.
"In the past two days, I went to the factory leader. I took out the BASIC manual you wrote, and I was stunned at that time. In addition, I said some things about your situation during this period of time. Mushroom After two days, this matter was finally done. Lexing, from now on you will be considered as an employee of the factory, with a monthly salary of [-] yuan. In addition, considering your situation, the factory will provide a monthly subsidy of [-] yuan. From now on, you will I went to work at the same place as Uncle Zhao, and I will take you to go through the formalities in the afternoon." Uncle Zhao explained.
Hearing this, Zhang Lexing was very happy. His most pressing problem was finally solved. Of course, he did not forget to thank Uncle Zhao for his hard work in the past few days.
After lunch, Uncle Zhao took Zhang Lexing to the factory to go through the formalities, and transferred them down in the afternoon, the personnel department, the archives room, the financial room..., almost all the offices were transferred, and the formalities were basically completed, only waiting for the factory to report Once approved by the Human Resources Bureau, you can go to work officially.From now on, Zhang Lexing can finally go to the computer room to use the computer openly, and he no longer has to worry about others gossiping.
The next day, Zhang Lexing officially started the design of the C language compiler. The C language compiler is mainly composed of six parts, lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and object code generation. The last two steps most affect the code running efficiency. If it can target a certain CPU Optimizing the design will greatly improve the running effect of the final code.After a few days, the C compiler was officially completed.In order to check the compiler, Zhang Lexing wrote some test programs, all of which were successfully compiled and passed. It seems that the compiler is already working normally.In order to further test the performance of the compiler, Zhang Lexing wrote a C language version based on the "Digging for Gold" in his memory. After compiling, he found that the operation was quite normal. Compared with the one written in assembly language, there was no difference in the running speed. Great, it seems that the performance of this compiler is good. The only drawback is that the performance of the Apple II processor is very average. As a result, the compilation speed of the program is relatively slow, but fortunately it does not affect the final running effect.
Uncle Zhao, who was obsessed with the BASIC world on paper, looked up by chance and found that Zhang Lexing was playing "Digging for Gold" (in fact, Zhang Lexing was just comparing the operating efficiency of programs written in different languages), and immediately ran over to watch.
"Lexing, what is this? It looks very interesting." Uncle Zhao asked curiously.
"Well, this is a game, I just wrote it." Zhang Lexing, who was thinking about the problem, replied casually.
"Come on, make a copy for Uncle Zhao." A floppy disk was stretched out in front of Zhang Lexing.
Zhang Lexing came back to his senses, smiled wryly, and used the disk test tool he wrote to copy the game disk to Uncle Zhao. Uncle Zhao happily took the floppy disk and received it in his floppy disk box. He probably planned to do it in the afternoon to play.
Seeing that the C compiler worked well, Zhang Lexing began to further optimize the operating system.First, some adjustments were made to the memory management to reduce the memory usage of the operating system; secondly, a simple disk compression function was added to increase the capacity of the floppy disk from 160K to 220K in disguise, so that a floppy disk can hold more things.
After the completion of the operating system and C compiler, Zhang Lexing took advantage of Sunday to rest for a day, and started a new goal to aim at the VisiCalc spreadsheet software in the random software.
(End of this chapter)
You'll Also Like
-
Killing will permanently increase real damage, how do you deal with it?
Chapter 443 4 hours ago -
Freeman in the Pirate World
Chapter 248 4 hours ago -
Fantasy: At the beginning, I let the empress become a mother!
Chapter 401 4 hours ago -
The Emperor's Dominance
Chapter 2220 19 hours ago -
Simultaneous traversal: All Abyss difficulty
Chapter 181 19 hours ago -
I'm almost reaching the maximum level of evil god, and you're advising me to change my job
Chapter 179 19 hours ago -
Hunter: I became stronger even after I died
Chapter 121 20 hours ago -
After I became a villain master, my beautiful apprentice fell in love with me
Chapter 117 20 hours ago -
Simulate a thousand times, I have a method to speed through the escape game
Chapter 518 20 hours ago -
Return to Singapore 1995
Chapter 562 20 hours ago