Stivale Bare Bones: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
m Reverted edits by Stivalisti0italiani (talk) to last revision by Xenos1
Misc updates to bring up to par with Limine Bare Bones
Line 187:
PHDRS
{
null PT_NULL FLAGS(0) ; /* Null segment */
text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */
rodata PT_LOAD FLAGS((1 << 2)) ; /* Read only */
Line 245 ⟶ 244:
# Change as needed.
override KERNEL := myos.elf
 
# Convenience macro to reliably declare overridable command variables.
define DEFAULT_VAR =
ifeq ($(origin CC$1), default)
override $(1) := $(2)
endif
ifeq ($(origin LD$1), defaultundefined)
override $(1) := $(2)
endif
endef
 
# It is highly recommended to use a custom built cross toolchain to build a kernel.
# We are only using "cc" as a placeholder here. It may work by using
# the host system's toolchain, but this is not guaranteed.
$(eval $(call DEFAULT_VAR,CC,cc))
ifeq ($(origin CC), default)
CC := cc
endif
 
# Likewise, "ld" here is just a placeholder and your mileage may vary if using the
# host's "ld".
ifeq ($(origin LD), default)
LD := ld
endif
 
# User controllable CFLAGS.
Line 266 ⟶ 267:
 
# Internal C flags that should not be changed by the user.
override INTERNALCFLAGS := \
-I. \
-std=gnu11 \
-ffreestanding \
-fno-stack-protector \
-fno-pic -fno-stack-check \
-mabi=sysvfno-pie \
-mnofno-80387pic \
-mno-mmxmabi=sysv \
-mno-3dnow80387 \
-mno-ssemmx \
-mno-sse23dnow \
-mno-red-zonesse \
-mcmodel=kernelmno-sse2 \
-mno-red-zone \
-MMD
-mcmodel=kernel \
-MMD
 
# Internal linker flags that should not be changed by the user.
override INTERNALLDFLAGS := \
-Tlinker.ldnostdlib \
-nostdlibstatic \
-Wl,Tlinker.ld \
-Wl,zmax-page-size=0x1000 \
-static
 
# Use find to glob all *.c files in the directory and extract the object names.
Line 300 ⟶ 303:
# Link rules for the final kernel executable.
$(KERNEL): $(OBJ)
$(LDCC) $(OBJ) $(LDFLAGS) $(INTERNALLDFLAGS) -o $@
 
# Compilation rules for *.c files.
Line 392 ⟶ 395:
 
# Download the latest Limine binary release.
git clone https://github.com/limine-bootloader/limine.git --branch=v2v3.0-branch-binary --depth=1
 
# Build limine-install.