From 959a93e653684b1ed8db4bd21eaca9831e372fb0 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 29 May 2024 01:18:02 +0200 Subject: multiboot: basic support for multiboot info well, it's not trivial to use bios function because thanks to grub + multiboot, we are already in protected mode when the startup code takes control. Also the MB info is easier to play with than BIOS (or ACPI) Signed-off-by: Tianhao Wang --- defs/x86_64-linker.ld | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'defs') diff --git a/defs/x86_64-linker.ld b/defs/x86_64-linker.ld index caecb48..39d8876 100644 --- a/defs/x86_64-linker.ld +++ b/defs/x86_64-linker.ld @@ -1,5 +1,10 @@ /* defs for Multiboot headers */ +/* https://www.gnu.org/software/grub/manual/multiboot/multiboot.txt */ MB_MAGIC = 0x1badb002; +/* bit 0 + * all boot modules loaded along with the operating system must be + * aligned on page (4KB) bit 1 must include mem_* structures + */ MB_FLAGS = 0x3; MB_CHKSUM = 0x100000000 - (MB_MAGIC + MB_FLAGS); @@ -9,7 +14,8 @@ SECTIONS .boot : { - header_start = .; LONG(MB_MAGIC) + header_start = .; + LONG(MB_MAGIC) LONG(MB_FLAGS) LONG(MB_CHKSUM) LONG(0) -- cgit v1.2.3-70-g09d2