aboutsummaryrefslogtreecommitdiff
path: root/defs
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-05-29 01:18:02 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:17:10 +0200
commit959a93e653684b1ed8db4bd21eaca9831e372fb0 (patch)
tree152426d2f9eb39ff26941204aaa149840e59578a /defs
parent590d29c3e44fc06bc79c2624fc94273434505b9d (diff)
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 <shrik3@mailbox.org>
Diffstat (limited to 'defs')
-rw-r--r--defs/x86_64-linker.ld8
1 files changed, 7 insertions, 1 deletions
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)