From e5890fd8f723a948fffb28cc73990c6749f36260 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Wed, 7 Oct 2026 09:17:15 -0700 Subject: VBE attempt 1 --- src/boot.asm | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/boot.asm') diff --git a/src/boot.asm b/src/boot.asm index cbf57d6..c88f08c 100644 --- a/src/boot.asm +++ b/src/boot.asm @@ -1,20 +1,37 @@ ;> 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_MEMORY_DESCRIBE: equ 1 << 1 +MULTIBOOT_VIDEO_MODE: equ 1 << 2 MULTIBOOT_MAGIC: equ 0x1BADB002 -MULTIBOOT_FLAGS: equ (MULTIBOOT_ALIGN_TO_PAGE | MULTIBOOT_MEMORY_DESCRIBE) +MULTIBOOT_FLAGS: equ (MULTIBOOT_ALIGN_TO_PAGE | MULTIBOOT_MEMORY_DESCRIBE | MULTIBOOT_VIDEO_MODE) MULTIBOOT_CHECKSUM: equ -(MULTIBOOT_MAGIC + MULTIBOOT_FLAGS) -section .multiboot_header +MULTIBOOT_VIDEO_TYPE: equ 0 +MULTIBOOT_GODS_WIDTH: equ 640 +MULTIBOOT_GODS_HEIGHT: equ 480 +MULTIBOOT_VIDEO_BPP: equ 16 + +; We don't set flags[16] because we assemble to ELF32 so header_addr, etc is useless to us +; (at least at the moment). +UNUSED_BYTES_COUNT: equ 5*4 +section .multiboot_header: +; I guess multiboot 2 requires a length field and we might migrate to that in the future. +multiboot_header_start: align 4 dd MULTIBOOT_MAGIC dd MULTIBOOT_FLAGS dd MULTIBOOT_CHECKSUM + times UNUSED_BYTES_COUNT db 0 + dd MULTIBOOT_VIDEO_TYPE + dd MULTIBOOT_GODS_WIDTH + dd MULTIBOOT_GODS_HEIGHT + dd MULTIBOOT_VIDEO_BPP +multiboot_header_end: STACK_SIZE: equ (1 << 14) section .bss align 16 -stack_bottom: +stack_bottom: ; ("haha bottom" somewhere in there??) resb STACK_SIZE stack_top: -- cgit v1.3