The last 30 days of self-made OS learning has come to an end, because there are other more important things that need to be focused on. Books have been multitasking since 15 days, but they have to stop for a while.
The following summarizes some problems encountered in the study.
1: Learn about GDT and IDT, and how to understand the length and attributes of segments in the first 14 days.
2: one of these problems is that qemu can be started normally, but after writing to a USB flash drive, it will be restarted continuously during the boot from the USB flash drive, I can guess it was caused by some exceptions that caused the computer to restart. However, due to the limited level, I still don't know why. Then I put down this book for 30 days and checked out the access attribute of GDT, the cause of the problem is as follows:
The paging position of the segment is not opened. As a result, the base address of the segment can only access 1 MB of space. The code written by the blogger is somewhat different from that written by the Japanese author, code commands written in C language exceed 2 MB. The code of the Japanese author controls the code segment length in the GDT and IDT initialization functions.
3: In the code of the past 10 days, the most difficult to understand is the layer refresh Part. Although the code is written in a reference book, there are still a lot of questions that I don't quite understand, of course, I only know how to use it. It seems that the Foundation is weak.
4: The 512-byte code previously written was written in Intel's assembly language. During the second study, it was all rewritten using the GNU AT&T syntax. Through the study of USB flash drive startup, we found some of the features of the U disk's CHS. Of course, this is helpful to change it to boot from the U disk when learning the Linux kernel later.
5: after learning the contents of the book for 14th days, I found many bugs in the code I wrote earlier. Of course, these bugs are fixed later. Fixing bugs without interruption also provides some convenience for later learning. Because the previous learning process did not pay too much attention to the readability of the Code, of course, I wrote a lot of comments for myself to understand it. In the past 13 days, code functions were organized in modules to better store global variables and the code structure was clearer.
6: I learned about github and its powerful functions in code management, so I also put the Code directly on github and learned a little about github basics and code synchronization, modification is also much easier.
7: When porting ucgui, you also have a better understanding of the use of static link libraries, because you need to write makefile to compile ucgui, I have a better understanding of the preparation of makefile files. Of course, the learning is still not systematic enough. I should look for this makefile book later and read it again by the system.
8: I have some questions about the display of different resolutions. Isn't it possible to set it in 32-Bit mode in C language? In different modes, different VRAM addresses are also different. Therefore, 32-bit systems can only use about 2.6 GB of memory, and some of the High-address memory is allocated to the memory. The Japanese author wrote a bit about the high-resolution part of the 14th-day pass. It is not scientific to directly give the VRAM address 0xe0000000, which leads the blogger to think his code is faulty, I read it several times and found no problem. So I directly read the book and found that the VRAM address was read through interruption, and then saved the read VRAM address for later use in C language functions.
Github address: https://github.com/cherishsir/ubuntu230os
QQ Group: 159336168
Next, let's take a picture of the boot from the USB flash drive to achieve the 14th-day high-resolution display and Simple keyboard input. As for the study over 15 days and later, wait for the summer vacation to study at home.