mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-27 07:46:33 +00:00
Compare commits
2 commits
bc16968387
...
fdb4b0313b
Author | SHA1 | Date | |
---|---|---|---|
|
fdb4b0313b | ||
|
5bd76304ec |
2 changed files with 23 additions and 9 deletions
|
@ -27,6 +27,15 @@ $(call USER_VARIABLE,KNASMFLAGS,-F dwarf -g)
|
||||||
# User controllable linker flags. We set none by default.
|
# User controllable linker flags. We set none by default.
|
||||||
$(call USER_VARIABLE,KLDFLAGS,)
|
$(call USER_VARIABLE,KLDFLAGS,)
|
||||||
|
|
||||||
|
# Check if KCC is Clang.
|
||||||
|
override KCC_IS_CLANG := $(shell ! $(KCC) --version 2>/dev/null | grep 'clang' >/dev/null 2>&1; echo $$?)
|
||||||
|
|
||||||
|
# If the C compiler is Clang, set the target as needed.
|
||||||
|
ifeq ($(KCC_IS_CLANG),1)
|
||||||
|
override KCC += \
|
||||||
|
-target x86_64-unknown-none
|
||||||
|
endif
|
||||||
|
|
||||||
# Internal C flags that should not be changed by the user.
|
# Internal C flags that should not be changed by the user.
|
||||||
override KCFLAGS += \
|
override KCFLAGS += \
|
||||||
-Wall \
|
-Wall \
|
||||||
|
|
|
@ -9,9 +9,10 @@ ENTRY(kmain)
|
||||||
/* process. */
|
/* process. */
|
||||||
PHDRS
|
PHDRS
|
||||||
{
|
{
|
||||||
text PT_LOAD;
|
requests PT_LOAD;
|
||||||
rodata PT_LOAD;
|
text PT_LOAD;
|
||||||
data PT_LOAD;
|
rodata PT_LOAD;
|
||||||
|
data PT_LOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@ -22,6 +23,16 @@ SECTIONS
|
||||||
/* that is the beginning of the region. */
|
/* that is the beginning of the region. */
|
||||||
. = 0xffffffff80000000;
|
. = 0xffffffff80000000;
|
||||||
|
|
||||||
|
/* Define a section to contain the Limine requests and assign it to its own PHDR */
|
||||||
|
.requests : {
|
||||||
|
KEEP(*(.requests_start_marker))
|
||||||
|
KEEP(*(.requests))
|
||||||
|
KEEP(*(.requests_end_marker))
|
||||||
|
} :requests
|
||||||
|
|
||||||
|
/* Move to the next memory page for .text */
|
||||||
|
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.text .text.*)
|
*(.text .text.*)
|
||||||
} :text
|
} :text
|
||||||
|
@ -38,12 +49,6 @@ SECTIONS
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
*(.data .data.*)
|
*(.data .data.*)
|
||||||
|
|
||||||
/* Place the sections that contain the Limine requests as part of the .data */
|
|
||||||
/* output section. */
|
|
||||||
KEEP(*(.requests_start_marker))
|
|
||||||
KEEP(*(.requests))
|
|
||||||
KEEP(*(.requests_end_marker))
|
|
||||||
} :data
|
} :data
|
||||||
|
|
||||||
/* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */
|
/* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */
|
||||||
|
|
Loading…
Reference in a new issue