summaryrefslogtreecommitdiff
path: root/boot.asm
diff options
context:
space:
mode:
Diffstat (limited to 'boot.asm')
-rw-r--r--boot.asm41
1 files changed, 41 insertions, 0 deletions
diff --git a/boot.asm b/boot.asm
new file mode 100644
index 0000000..66009e8
--- /dev/null
+++ b/boot.asm
@@ -0,0 +1,41 @@
+bits 32
+
+section .text
+ align 4
+ dd 0x1BADB002
+ dd 0x00
+ dd - (0x1BADB002 + 0x00)
+
+global start
+extern kmain
+
+start:
+ cli
+ mov esp, stack_top
+ call marker_begin
+ call kmain
+ call marker_done
+.hltloop:
+ hlt
+jmp .hltloop
+
+marker_begin:
+ mov word [VIDEO_RAM + CONSOLE_SIZE - 2], \
+ 0x4F << 8 | 'B' ; END OF MAIN MARKER
+ ret
+
+marker_done:
+ mov word [VIDEO_RAM + CONSOLE_SIZE - 2], \
+ 0x4F << 8 | 'H' ; END OF MAIN MARKER
+ ret
+
+section .data
+
+%include 'constants.asm'
+
+section .bss
+align 4
+stack_bottom:
+ resb 8192
+stack_top:
+EOK: