diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-05-29 01:18:02 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:17:10 +0200 |
| commit | 959a93e653684b1ed8db4bd21eaca9831e372fb0 (patch) | |
| tree | 152426d2f9eb39ff26941204aaa149840e59578a /defs | |
| parent | 590d29c3e44fc06bc79c2624fc94273434505b9d (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.ld | 8 |
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) |
