swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 1 | [section .text] |
2 | [bits 32] | ||||
3 | |||||
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 4 | [global load_page_directory] |
5 | load_page_directory: | ||||
swissChili | e0a79bb | 2021-02-22 19:54:48 -0800 | [diff] [blame] | 6 | mov ecx, [esp + 4] ; Pointer to directory |
7 | mov cr3, ecx | ||||
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 8 | ret |
9 | |||||
10 | [global enable_paging] | ||||
11 | enable_paging: | ||||
swissChili | e0a79bb | 2021-02-22 19:54:48 -0800 | [diff] [blame] | 12 | mov ecx, cr0 |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 13 | or eax, 0x80000000 |
swissChili | e0a79bb | 2021-02-22 19:54:48 -0800 | [diff] [blame] | 14 | mov cr0, ecx |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 15 | ret |