summaryrefslogtreecommitdiffstats
path: root/apps/init/arch/x86_64/start.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/init/arch/x86_64/start.c')
-rw-r--r--apps/init/arch/x86_64/start.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/init/arch/x86_64/start.c b/apps/init/arch/x86_64/start.c
new file mode 100644
index 0000000..8329523
--- /dev/null
+++ b/apps/init/arch/x86_64/start.c
@@ -0,0 +1,11 @@
+extern void main(void*);
+
+__attribute__((section(".text.start")))
+__attribute__((naked))
+void
+_start(void)
+{
+ __asm__ volatile("\
+ popq %%rdi; \
+ jmp main"::);
+}