wip: use multiboot2

This commit is contained in:
Starnakin 2024-11-29 13:15:05 +01:00
parent 1352201800
commit f626edd0f0

View File

@ -1,16 +1,27 @@
# Declare constants for the multiboot header. # Declare constants for the multiboot header.
.set ALIGN, 1<<0 # align loaded modules on page boundaries .set ALIGN, 1<<0 # align loaded modules on page boundaries
.set MEMINFO, 1<<1 # provide memory map .set MEMINFO, 1<<1 # provide memory map
.set FLAGS, ALIGN | MEMINFO # this is the Multiboot 'flag' field .set MAGIC, 0xE85250D6 # 'magic number' lets bootloader find the header
.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header .set ARCHITECTURE, 0
.set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot
# Declare a multiboot header that marks the program as a kernel. # Declare a multiboot header that marks the program as a kernel.
.section .multiboot.data, "aw" .section .multiboot.data, "aw"
.align 4 header_start:
.long MAGIC # HEADER
.long FLAGS .long MAGIC
.long CHECKSUM .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. # Allocate the initial stack.
.section .bootstrap_stack, "aw", @nobits .section .bootstrap_stack, "aw", @nobits