Currently limine based, cribbing from osdev wiki a bit, and from dreamportdev
58 lines
876 B
Plaintext
58 lines
876 B
Plaintext
OUTPUT_FORMAT(elf64-x86-64)
|
|
|
|
ENTRY(kmain)
|
|
|
|
/* program headers to get MMU perms */
|
|
PHDRS {
|
|
limine_requests PT_LOAD;
|
|
text PT_LOAD;
|
|
rodata PT_LOAD;
|
|
data PT_LOAD;
|
|
}
|
|
|
|
SECTIONS {
|
|
/* we want topmost 2GiB of addr space */
|
|
. = 0xffffffff80000000;
|
|
|
|
.limine_requests : {
|
|
KEEP(*(.limine_requests_start))
|
|
KEEP(*(.limine_requests))
|
|
KEEP(*(.limine_requests_end))
|
|
} :limine_requests
|
|
|
|
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
|
|
|
.text : {
|
|
*(.text .text.*)
|
|
} :text
|
|
|
|
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
|
|
|
.rodata : {
|
|
*(.rodata .rodata.*)
|
|
} :rodata
|
|
|
|
|
|
.note.gnu.build-id : {
|
|
*(.note.gnu.build-id)
|
|
} :rodata
|
|
|
|
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
|
|
|
.data : {
|
|
*(.data .data.*)
|
|
} :data
|
|
|
|
/* .bss need sto be the last thing mapped */
|
|
.bss : {
|
|
*(.bss .bss.*)
|
|
*(COMMON)
|
|
} :data
|
|
|
|
/DISCARD/ : {
|
|
*(.eh_frame*)
|
|
*(.note .note.*)
|
|
}
|
|
}
|
|
|