From f626edd0f04fbd960f34b0e9d3b9cd3bc090e7d7 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Fri, 29 Nov 2024 13:15:05 +0100 Subject: [PATCH] wip: use multiboot2 --- src/boot.s | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/boot.s b/src/boot.s index 3eeb36c..24b0979 100644 --- a/src/boot.s +++ b/src/boot.s @@ -1,16 +1,27 @@ # Declare constants for the multiboot header. .set ALIGN, 1<<0 # align loaded modules on page boundaries .set MEMINFO, 1<<1 # provide memory map -.set FLAGS, ALIGN | MEMINFO # this is the Multiboot 'flag' field -.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header -.set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot +.set MAGIC, 0xE85250D6 # 'magic number' lets bootloader find the header +.set ARCHITECTURE, 0 # Declare a multiboot header that marks the program as a kernel. .section .multiboot.data, "aw" -.align 4 -.long MAGIC -.long FLAGS -.long CHECKSUM +header_start: + # HEADER + .long MAGIC + .long ARCHITECTURE + .long header_end - header_start + .long 0x100000000 - (MAGIC + (header_end - header_start)) + + #TAGS: + + + # END TAG + .align 8 + .int 0 # type + .int 0 # flag + .long 8 # size +header_end: # Allocate the initial stack. .section .bootstrap_stack, "aw", @nobits