summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot.nasm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot.nasm')
-rw-r--r--arch/x86/boot.nasm16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/boot.nasm b/arch/x86/boot.nasm
new file mode 100644
index 0000000..11175af
--- /dev/null
+++ b/arch/x86/boot.nasm
@@ -0,0 +1,16 @@
+section .text
+extern main, _estack, _init
+global _start:function
+_start:
+ ; Stack setup
+ mov eax, _estack
+ ; Align stack to odd address
+ and eax, 0xFFFFFFFE
+ mov esp, eax
+
+ call _init
+ call main
+ cli
+.hang: hlt
+ jmp .hang
+; .end: