You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.8 KiB
Plaintext
83 lines
1.8 KiB
Plaintext
/* See the end of this file for copyright and license terms. */
|
|
|
|
OUTPUT_FORMAT("elf64-x86-64")
|
|
|
|
/* not strictly needed because we produce a binary image but can't hurt */
|
|
ENTRY(_start)
|
|
|
|
KERNBASE = 0xffffffff80000000;
|
|
PAGE_SIZE = 4K;
|
|
|
|
SECTIONS {
|
|
. = CFG_KERN_ORIGIN;
|
|
|
|
_image_start = . + KERNBASE;
|
|
_image_start_phys = .;
|
|
_kernel_start = . + KERNBASE;
|
|
_kernel_start_phys = .;
|
|
|
|
.multiboot.data : {
|
|
. = ALIGN(8);
|
|
KEEP(*(.multiboot.data))
|
|
}
|
|
|
|
.multiboot.text : {
|
|
. = ALIGN(8);
|
|
KEEP(*(.multiboot.text))
|
|
}
|
|
|
|
. += KERNBASE;
|
|
|
|
/*
|
|
* All sections from here on are page aligned so we can
|
|
* set different access permissions for each of them
|
|
*/
|
|
|
|
.text ALIGN(PAGE_SIZE) : AT(ADDR(.text) - KERNBASE) {
|
|
_text_start = .;
|
|
*(.text .text.* .gnu.linkonce.t.*)
|
|
_text_end = .;
|
|
}
|
|
|
|
.rodata ALIGN(PAGE_SIZE) : AT(ADDR(.rodata) - KERNBASE) {
|
|
_rodata_start = .;
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
|
_rodata_end = .;
|
|
}
|
|
|
|
.data ALIGN(PAGE_SIZE) : AT(ADDR(.data) - KERNBASE) {
|
|
_data_start = .;
|
|
*(.data .data.*)
|
|
_data_end = .;
|
|
}
|
|
|
|
_kernel_end = .;
|
|
_kernel_end_phys = . - KERNBASE;
|
|
|
|
.bss ALIGN(PAGE_SIZE) : AT(ADDR(.bss) - KERNBASE) {
|
|
_bss_start = .;
|
|
*(COMMON)
|
|
*(.bss)
|
|
_bss_end = .;
|
|
. = ALIGN(8);
|
|
*(.bootstrap_stack)
|
|
}
|
|
|
|
_image_end = .;
|
|
_image_end_phys = . - KERNBASE;
|
|
}
|
|
|
|
/*
|
|
* This file is part of GayBSD.
|
|
* Copyright (c) 2021 fef <owo@fef.moe>.
|
|
*
|
|
* GayBSD is nonviolent software: you may only use, redistribute, and/or
|
|
* modify it under the terms of the Cooperative Nonviolent Public License
|
|
* (CNPL) as found in the LICENSE file in the source code root directory
|
|
* or at <https://git.pixie.town/thufie/npl-builder>; either version 7
|
|
* of the license, or (at your option) any later version.
|
|
*
|
|
* GayBSD comes with ABSOLUTELY NO WARRANTY, to the extent
|
|
* permitted by applicable law. See the CNPL for details.
|
|
*/
|