diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-10-07 09:17:15 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-10-07 21:51:59 -0700 |
| commit | e5890fd8f723a948fffb28cc73990c6749f36260 (patch) | |
| tree | 69e3ec61677a2cbed37057ef1043d0ec3577f829 /src/boot.asm | |
| parent | 4d21315f667c03eaf44a580c3435f73853b53dbf (diff) | |
| download | macaroni-e5890fd8f723a948fffb28cc73990c6749f36260.tar.gz macaroni-e5890fd8f723a948fffb28cc73990c6749f36260.zip | |
VBE attempt 1
Diffstat (limited to 'src/boot.asm')
| -rw-r--r-- | src/boot.asm | 25 |
1 files changed, 21 insertions, 4 deletions
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: |
