From 4d21315f667c03eaf44a580c3435f73853b53dbf Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Mon, 5 Oct 2026 08:56:38 -0700 Subject: Init --- src/boot.asm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/boot.asm (limited to 'src/boot.asm') diff --git a/src/boot.asm b/src/boot.asm new file mode 100644 index 0000000..cbf57d6 --- /dev/null +++ b/src/boot.asm @@ -0,0 +1,31 @@ +;> The Multiboot header must be contained completely within the first 8192 bytes of the OS +;> image, and must be longword (32-bit) aligned. +MULTIBOOT_ALIGN_TO_PAGE: equ 1 << 0 +MULTIBOOT_MEMORY_DESCRIBE: equ 1 << 2 +MULTIBOOT_MAGIC: equ 0x1BADB002 +MULTIBOOT_FLAGS: equ (MULTIBOOT_ALIGN_TO_PAGE | MULTIBOOT_MEMORY_DESCRIBE) +MULTIBOOT_CHECKSUM: equ -(MULTIBOOT_MAGIC + MULTIBOOT_FLAGS) +section .multiboot_header +align 4 + dd MULTIBOOT_MAGIC + dd MULTIBOOT_FLAGS + dd MULTIBOOT_CHECKSUM + +STACK_SIZE: equ (1 << 14) +section .bss +align 16 +stack_bottom: + resb STACK_SIZE +stack_top: + +section .text +global _start:function (_start.end - _start) +_start: + mov esp, stack_top + extern cmain + call cmain + cli + +jmp $ + +.end: -- cgit v1.3