From 06d05938cc828901703112b99740c2e90a392b88 Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Tue, 8 Aug 2023 18:38:07 +0700 Subject: First commit --- kernel/boot.s | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 kernel/boot.s (limited to 'kernel/boot.s') diff --git a/kernel/boot.s b/kernel/boot.s new file mode 100644 index 0000000..2fd1c55 --- /dev/null +++ b/kernel/boot.s @@ -0,0 +1,28 @@ +MBALIGN equ 1 << 0 +MEMINFO equ 1 << 1 +MBFLAGS equ MBALIGN | MEMINFO +MAGIC equ 0x1BADB002 +CHECKSUM equ -(MAGIC + MBFLAGS) + +section .multiboot +align 4 + dd MAGIC + dd MBFLAGS + dd CHECKSUM + +section .bss +align 16 +stack_bottom: +resb 16384 +stack_top: + +section .text +global _start:function (_start.end - _start) +_start: + mov esp, stack_top + extern main + call main + cli +.hang: hlt + jmp .hang +.end: -- cgit v1.2.3