Detailed introduction to head.s of Linux kernel analysis

The main functions of head.s: reload each data segment register, reset the interrupt descriptor table, reset the global descriptor table, set the paging processing mechanism (a page directory table and 4 page tables), push the main function on the stack, and execute the head After finishing, pop up main and go to main function.

Reload register

Set interrupt description table

Set up the global description table

 

Call main function

 

Set page directory and page table

Empty 5 pages of memory

Set values ​​for 4 items of the page directory

Assign a value to each item of the 4-page table: including the corresponding physical address and identification

Store the base address of the page directory in register cr3

End of head.s , run the main program

Guess you like

Origin blog.csdn.net/wyyy2088511/article/details/108347108