aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/boot/entry64.s
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-07-22 21:23:23 +0000
committerFelix Morgner <felix.morgner@ost.ch>2025-07-22 21:23:23 +0000
commitc8cb4346064c69ab8431aa0d3c287e2fad60ce80 (patch)
treee3677c3728a6a78e7560b732726505695849ebf2 /arch/x86_64/src/boot/entry64.s
parentce8683e63fc9ef59e1800927afb1753507a42ef6 (diff)
downloadteachos-c8cb4346064c69ab8431aa0d3c287e2fad60ce80.tar.xz
teachos-c8cb4346064c69ab8431aa0d3c287e2fad60ce80.zip
x86_64: split bootstrap code along mode lines
Diffstat (limited to 'arch/x86_64/src/boot/entry64.s')
-rw-r--r--arch/x86_64/src/boot/entry64.s21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86_64/src/boot/entry64.s b/arch/x86_64/src/boot/entry64.s
new file mode 100644
index 0000000..f575c50
--- /dev/null
+++ b/arch/x86_64/src/boot/entry64.s
@@ -0,0 +1,21 @@
+.section .boot_text, "ax", @progbits
+.code64
+
+.global _entry64
+_entry64:
+ mov $global_descriptor_table_data, %rax
+ mov %rax, %ss
+ mov %rax, %ds
+ mov %rax, %es
+ mov %rax, %fs
+ mov %rax, %gs
+
+ xor %rax, %rax
+
+ call _init
+
+ call main
+
+1:
+ hlt
+ jmp 1b