diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-04-18 04:27:36 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:16:34 +0200 |
| commit | 18c798222a9a28f704a191e5e16b93c873a21ab2 (patch) | |
| tree | b736887eb11e5c915518b5360ab6d9ef9ecb1177 /defs/x86_64-linker.ld | |
| parent | 0de4e7d36430ea52b21e7b12d69605569bc986e7 (diff) | |
startup: define multiboot headers in linker script
Diffstat (limited to 'defs/x86_64-linker.ld')
| -rw-r--r-- | defs/x86_64-linker.ld | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/defs/x86_64-linker.ld b/defs/x86_64-linker.ld index 3d54187..1f53bf8 100644 --- a/defs/x86_64-linker.ld +++ b/defs/x86_64-linker.ld @@ -1,8 +1,30 @@ +/* defs for Multiboot headers */ +MB_MAGIC = 0x1badb002; +MB_FLAGS = 0x3; +MB_CHKSUM = 0x100000000 - (MB_MAGIC + MB_FLAGS); + SECTIONS { - PROVIDE (___KERNEL_START__ = .); . = 0x100000; /* system's start address */ + .boot : + { + header_start = .; LONG(MB_MAGIC) + LONG(MB_FLAGS) + LONG(MB_CHKSUM) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + LONG(0) + header_end = .; + } + + PROVIDE (___KERNEL_START__ = .); .text : { *(".text") |
