swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 1 | [section .text] |
2 | [bits 32] | ||||
3 | |||||
4 | ;;; TODO: remove useless frame pointer stuff | ||||
5 | |||||
6 | [global load_page_directory] | ||||
7 | load_page_directory: | ||||
8 | push ebp ; Save frame pointer | ||||
9 | mov ebp, esp | ||||
10 | mov eax, [esp + 8] ; Pointer to directory | ||||
11 | mov cr3, eax | ||||
12 | mov esp, ebp | ||||
13 | pop ebp | ||||
14 | ret | ||||
15 | |||||
16 | [global enable_paging] | ||||
17 | enable_paging: | ||||
18 | push ebp | ||||
19 | mov ebp, esp | ||||
20 | mov eax, cr0 | ||||
21 | or eax, 0x80000000 | ||||
22 | mov cr0, eax | ||||
23 | mov esp, ebp | ||||
24 | pop ebp | ||||
25 | ret |