Function
- Define data segment and text segment
- Re-manually initialize the GDT table, IDT table, TSS table structure
Initialize page table and page catalog data in a single page table
- In the page directory, in fact, the address is 0x1000, initialize the page directory, a page directory occupies the page table of the remaining data values using the zero fill, a page table size is divided into (2MB, 4MB, 8MB, etc., generally larger is prone to cause page particles too fragmented)
- In the text snippet, load the data into the register using LGDT, Lidt, and load CR3, etc.
- After initialization, the code that directs the CPU to the real kernel via a jump instruction is the address of a function.
Note: for head. S, we know that he is in the kernel of this executable file, and is at the front, so we need to put it in the link to the top of the kernel code
Core execution head program. S