1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
.text
.global loadPageDirectory
loadPageDirectory:
push %ebp
movl %esp, %ebp
movl 8(%esp), %eax
subl $0xC0000000, %eax
movl %eax, %cr3
mov %ebp, %esp
pop %ebp
ret
.global enablePaging
enablePaging:
push %ebp
mov %esp, %ebp
mov %cr0, %eax
or $0x80000000, %eax
mov %eax, %cr0
mov %ebp, %esp
pop %ebp
ret
.global flushPaging
flushPaging:
push %ebp
mov %esp, %ebp
movl %cr3, %ecx
movl %ecx, %cr3
mov %ebp, %esp
pop %ebp
ret
|