about summary refs log tree commit diff
path: root/src/bootloader/boot.s
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-06-22 17:06:46 +0200
committerYour Name <you@example.com>2020-06-22 17:06:46 +0200
commit6bacc4f30752e49733d6efb219d58eb4745a49a9 (patch)
treeb1459f86e5b5b0c2ad2fe81e1b96ad588de463d7 /src/bootloader/boot.s
downloadpOS-6bacc4f30752e49733d6efb219d58eb4745a49a9.tar.gz
pOS-6bacc4f30752e49733d6efb219d58eb4745a49a9.tar.bz2
pOS-6bacc4f30752e49733d6efb219d58eb4745a49a9.zip
Git commit clean
Diffstat (limited to 'src/bootloader/boot.s')
-rw-r--r--src/bootloader/boot.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bootloader/boot.s b/src/bootloader/boot.s
new file mode 100644
index 0000000..0bb10d5
--- /dev/null
+++ b/src/bootloader/boot.s
@@ -0,0 +1,33 @@
+; Multiboot header
+MBALIGN  equ  1 << 0
+MEMINFO  equ  1 << 1
+FLAGS    equ  MBALIGN | MEMINFO
+MAGIC    equ  0x1BADB002
+CHECKSUM equ -(MAGIC + FLAGS)
+ 
+section .multiboot
+align 4
+	dd MAGIC
+	dd FLAGS
+	dd CHECKSUM
+ 
+; Setup stack
+section .bss
+align 16
+stack_bottom:
+resb 16384 ; 16 KiB
+stack_top:
+ 
+section .text
+global _start:function (_start.end - _start)
+_start:
+	; Initialize stack
+	mov esp, stack_top
+ 
+	extern kmain
+	call kmain
+ 
+	cli
+.inf:	hlt
+	jmp .inf
+.end: