summaryrefslogtreecommitdiff
path: root/service/arch/x86_64/start.S
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2024-04-06 15:37:04 +0000
committerAda Christine <adachristine18@gmail.com>2024-04-06 15:37:04 +0000
commit912a4c7169e171a40b52d88c0ac82445855b979b (patch)
tree91ffb02a8f2ef7c6503f04c3c59d6e482df782ea /service/arch/x86_64/start.S
parent7fd8c908b9dafa85957bb6e6ce3f51d4dfa7c4dc (diff)
more abstract build
Diffstat (limited to 'service/arch/x86_64/start.S')
-rw-r--r--service/arch/x86_64/start.S30
1 files changed, 30 insertions, 0 deletions
diff --git a/service/arch/x86_64/start.S b/service/arch/x86_64/start.S
new file mode 100644
index 0000000..a9d5ada
--- /dev/null
+++ b/service/arch/x86_64/start.S
@@ -0,0 +1,30 @@
+.section .text.start
+
+.extern kc_image_base;
+.extern _DYNAMIC;
+.extern kc_dynamic_init;
+.extern kjarna_entry
+
+.hidden _start
+.global _start
+.type _start, @function
+_start:
+ push %rbp
+ push %rdi
+ push %rsi
+ mov %rsp, %rbp
+ and $-0x10, %rsp
+ lea kc_image_base(%rip), %rdi
+ lea _DYNAMIC(%rip), %rsi
+ call kc_dynamic_init
+ mov %rbp, %rsp
+ pop %rsi
+ pop %rdi
+ mov %rsp, %rbp
+ and $-0x10, %rsp
+ call kjarna_entry
+ mov %rbp, %rsp
+ pop %rbp
+ ret
+.size _start, . - _start
+