summaryrefslogtreecommitdiff
path: root/src/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootloader')
-rw-r--r--src/bootloader/bootloader.asm1
-rw-r--r--src/bootloader/enter_kernel.asm13
2 files changed, 7 insertions, 7 deletions
diff --git a/src/bootloader/bootloader.asm b/src/bootloader/bootloader.asm
index 8e5fbeb..fcb39a7 100644
--- a/src/bootloader/bootloader.asm
+++ b/src/bootloader/bootloader.asm
@@ -1,7 +1,6 @@
[bits 16]
[extern _kernel_sector_size]
[extern _bootloader_stage1_size]
-[extern _kernel_s1_loc]
jmp stage0
times 3-($-$$) db 0x90
diff --git a/src/bootloader/enter_kernel.asm b/src/bootloader/enter_kernel.asm
index ef2cd71..bdf0a71 100644
--- a/src/bootloader/enter_kernel.asm
+++ b/src/bootloader/enter_kernel.asm
@@ -1,4 +1,4 @@
-[extern main]
+[extern kernel_init]
[extern _kernel_stack_loc]
[extern _kernel_page_size]
enter_longmode:
@@ -68,13 +68,14 @@ mov cr4, eax
;If it's not and we enable it, it will cause pagefaults on read
mov eax, 0x80000001
cpuid
-and edx, 1 << 20
-shr edx, 9
+mov ebx, edx
+and ebx, 1 << 20
+shr ebx, 9
mov ecx, 0xc0000080
rdmsr
-or eax, 1 << 8 | 1 << 11
-or eax, edx
+or eax, 1 << 8
+or eax, ebx
wrmsr
mov eax, cr0
@@ -90,7 +91,7 @@ enter_kernel:
bits 64
mov rbp, 0
mov rsp, _kernel_stack_loc
-mov rax, QWORD main
+mov rax, QWORD kernel_init
;push QWORD 0
jmp rax
jmp $