From d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 11 Mar 2024 21:30:31 -0400 Subject: usermode capable kernel with logging syscall --- link/x86_64-jove.ld | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 link/x86_64-jove.ld (limited to 'link/x86_64-jove.ld') diff --git a/link/x86_64-jove.ld b/link/x86_64-jove.ld new file mode 100644 index 0000000..0686617 --- /dev/null +++ b/link/x86_64-jove.ld @@ -0,0 +1,52 @@ +OUTPUT_FORMAT(elf64-x86-64) +OUTPUT_ARCH(i386:x86-64) + +ENTRY(_start) + +PAGESIZE = CONSTANT(MAXPAGESIZE); + +PHDRS +{ + text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* RO EX*/ + rodata PT_LOAD FLAGS((1 << 2)) ; /* RO*/ + data PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/ + bss PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/ +} + +SECTIONS +{ + . = 0xFFFFFFFF80000000; + _kernel_start = .; + + .text BLOCK(PAGESIZE) : ALIGN(PAGESIZE) { + *(.init) + *(.text .text.*) + + . = ALIGN(8); + _kernel_ctors_start = .; + *(.ctors) + _kernel_ctors_end = .; + + *(.fini) + } :text + + .rodata BLOCK(PAGESIZE) : ALIGN(PAGESIZE) { + *(.rodata .rodata.*) + } :rodata + + .data BLOCK(PAGESIZE) : ALIGN(PAGESIZE) { + *(.data .data.*) + } :data + + .bss BLOCK(PAGESIZE) : ALIGN(PAGESIZE) { + *(COMMON) + *(.bss .bss.*) + } :bss + + /DISCARD/ : { + *(.note .note.*) + } + + _kernel_end = .; +} + -- cgit v1.2.1