github.com/icexin/eggos@v0.4.2-0.20220216025428-78b167e4f349/kernel/mm/mm.s (about) 1 #include "textflag.h" 2 3 // pageEnable enables translation from virtual address (linear address) to 4 // physical address, based on the page directory set in the CR3 register. 5 TEXT ·pageEnable(SB), NOSPLIT, $0-0 6 // enable PAE 7 MOVQ CR4, AX 8 BTSQ $5, AX 9 MOVQ AX, CR4 10 11 // enable page 12 MOVQ CR0, AX 13 BTSQ $31, AX 14 MOVQ AX, CR0 15 RET 16 17 // lcr3(topPage uint64) sets the CR3 register. 18 TEXT ·lcr3(SB), NOSPLIT, $0-8 19 // setup page dir 20 MOVQ topPage+0(FP), AX 21 MOVQ AX, CR3 22 RET 23