summaryrefslogtreecommitdiff
path: root/kernel/src/boot/boot64.S
diff options
context:
space:
mode:
authorAleksa Vuckovic <aleksav013@gmail.com>2022-09-08 14:37:47 +0200
committerAleksa Vuckovic <aleksav013@gmail.com>2022-09-08 14:38:29 +0200
commit82e9f02aef1ea1a6588234ee58e3625e3561005f (patch)
tree80214489336fa2cc1c615bd63b133934832a5ba4 /kernel/src/boot/boot64.S
parent1effe3b9ac0bb1a819f6ae5ebb8438e60b77f9a2 (diff)
higher half in x86_64
kernel is now located at -2GB heap blocks are aligned on block size paging will allocate new page tables on heap
Diffstat (limited to 'kernel/src/boot/boot64.S')
-rw-r--r--kernel/src/boot/boot64.S25
1 files changed, 17 insertions, 8 deletions
diff --git a/kernel/src/boot/boot64.S b/kernel/src/boot/boot64.S
index cc79c36..e95f55b 100644
--- a/kernel/src/boot/boot64.S
+++ b/kernel/src/boot/boot64.S
@@ -1,16 +1,25 @@
-.section .text
.code64
+.set KERNEL_VMA, 0xffffffff80000000
+
+.section .boot64.text, "a"
+
.global begin_long_mode
begin_long_mode:
- // reload segment registers
- mov $0x10, %ax
- mov %ax, %ds
- mov %ax, %es
- mov %ax, %ss
- mov %ax, %fs
- mov %ax, %gs
+// xchgw %bx, %bx
+// mov $0x10, %ax
+// mov %ax, %ds
+// mov %ax, %es
+// mov %ax, %ss
+// mov %ax, %fs
+// mov %ax, %gs
+ add $KERNEL_VMA, %rsp
+ movabs $jump_main, %rax
+ jmp *%rax
+
+.section .text
+jump_main:
popq %rdi
popq %rsi
call kernel_main