summaryrefslogtreecommitdiff
path: root/kernel/src/boot/boot64.S
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/boot/boot64.S')
-rw-r--r--kernel/src/boot/boot64.S19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/src/boot/boot64.S b/kernel/src/boot/boot64.S
new file mode 100644
index 0000000..be87412
--- /dev/null
+++ b/kernel/src/boot/boot64.S
@@ -0,0 +1,19 @@
+.global begin_long_mode
+
+.section .text
+.code64
+
+begin_long_mode:
+ // reload segment registers
+ mov $0x10, %eax
+ mov %eax, %ss
+ mov %eax, %ds
+ mov %eax, %es
+ mov %eax, %fs
+ mov %eax, %gs
+
+ popq %rdi
+ popq %rsi
+
+ call kernel_main
+ hlt