Kernel: Cleanup bootloader headers

Also add custom load addresses for x86_64 target. This allows qemu to
load the kernel with -kernel argument. Without these addresses qemu
would refuse to load as it only supports 32 bit ELFs, but as our kernel
starts in 32 bit mode anyway, we can just load it!
This commit is contained in:
2026-04-13 16:43:30 +03:00
parent c849293f3d
commit d471bbf856
4 changed files with 22 additions and 17 deletions

View File

@@ -11,13 +11,14 @@
.code32
# multiboot2 header
// video mode info, page align modules
.set multiboot_flags, (1 << 2) | (1 << 0)
.section .multiboot, "aw"
.align 8
multiboot_start:
.long 0x1BADB002
.long (1 << 2) # page align modules
.long -(0x1BADB002 + (1 << 2))
.long multiboot_flags
.long -(0x1BADB002 + multiboot_flags)
.long 0
.long 0
@@ -30,7 +31,8 @@ multiboot_start:
.long FB_HEIGHT
.long FB_BPP
multiboot_end:
.align 8
.section .multiboot2, "aw"
multiboot2_start:
.long 0xE85250D6
.long 0
@@ -66,7 +68,6 @@ multiboot2_start:
multiboot2_end:
.section .bananboot, "aw"
.align 8
bananboot_start:
.long 0xBABAB007
.long -(0xBABAB007 + FB_WIDTH + FB_HEIGHT + FB_BPP)