aboutsummaryrefslogtreecommitdiff
path: root/src/boot/boot.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/boot.s')
-rw-r--r--src/boot/boot.s15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/boot/boot.s b/src/boot/boot.s
index dbb4052..51bef8f 100644
--- a/src/boot/boot.s
+++ b/src/boot/boot.s
@@ -30,6 +30,10 @@ idtr:
dw 0
dd 0
+global page_ptr
+page_ptr:
+ dd 0
+
global _start:function (_start.end - _start)
_start:
mov esp, stack_top
@@ -37,7 +41,7 @@ _start:
extern get_gdtr
call get_gdtr
cli
- lgdt [gdtr]
+ lgdt [gdtr]
mov eax, cr0
or al, 1
mov cr0, eax
@@ -50,6 +54,15 @@ _start:
sti
xchg bx, bx
+ extern genDirs
+ extern page_dir
+ call genDirs
+ mov eax, page_dir
+ mov cr3, eax
+ mov eax, cr0
+ or eax, 0x80000001
+ mov cr0, eax
+
[bits 32]
extern kernel_main
call kernel_main