summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2025-10-15 19:47:38 -0500
committerDanny Holman <dholman@gymli.org>2025-10-15 19:47:38 -0500
commitb3c8f16a7d83c792d87044d0650ddc73910cec7d (patch)
tree0f98bb64ad3001157de4cea47c7e6237f72ba712
parentbootstrap: update build configs (diff)
downloadbox-b3c8f16a7d83c792d87044d0650ddc73910cec7d.tar.gz
box-b3c8f16a7d83c792d87044d0650ddc73910cec7d.tar.zst
box-b3c8f16a7d83c792d87044d0650ddc73910cec7d.zip
bootstrap: stage1: update build configuration
Update the build configuration in the first stage of the bootloader. The new build files should take advantage of the modular makefile configs in the project root or override them. Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r--bootstrap/stage1/Makefile13
-rw-r--r--bootstrap/stage1/arch/x86_64/make.conf4
-rw-r--r--bootstrap/stage1/firmware/efi/make.conf11
3 files changed, 13 insertions, 15 deletions
diff --git a/bootstrap/stage1/Makefile b/bootstrap/stage1/Makefile
index 7c3bf81..b80a16b 100644
--- a/bootstrap/stage1/Makefile
+++ b/bootstrap/stage1/Makefile
@@ -17,7 +17,12 @@
include $(ROOTDIR)/common.mk
-INCLUDE+=-I$(ARCHDIR)/include -Iinclude -I$(ROOTDIR)kernel/include -I$(ROOTDIR)kernel/arch/$(ARCH)/include
+ifeq ($(BS_DEBUG),YES)
+ AFLAGS+=-g
+ CFLAGS+=-g
+endif
+
+INCLUDE+=-I$(ARCHDIR)/include -Iinclude
CFLAGS+=-ffreestanding -fno-stack-protector $(BS_OPLVL)
BINARY=bootstrap-stage1
@@ -28,9 +33,6 @@ include $(FIRMWARE_DIR)/make.conf
COMMON_DIR=firmware/common
COMMON_OBJS=$(COMMON_DIR)/bprintf.o \
- $(COMMON_DIR)/elf_load.o \
- $(COMMON_DIR)/exception.o \
- $(COMMON_DIR)/rescue.o \
$(COMMON_DIR)/string.o \
OBJS=$(ARCH_OBJS) \
@@ -49,9 +51,10 @@ $(BINARY): $(OBJS)
@echo [CC] $@
%.o: %.s
+ @$(info $(AFLAGS))
@$(CC) -c $< -o $@ $(AFLAGS) $(INCLUDE)
clean:
- $(RM) $(BINARY) $(OBJS) $(OBJS:.o=.d)
+ $(RM) $(BINARY) $(OBJS) $(OBJS:.o=.d) $(OBJS:.o=.dwo) $(BINARY:=.dwp)
-include $(OBJS:.o=.d)
diff --git a/bootstrap/stage1/arch/x86_64/make.conf b/bootstrap/stage1/arch/x86_64/make.conf
index ec364c7..7c84b5c 100644
--- a/bootstrap/stage1/arch/x86_64/make.conf
+++ b/bootstrap/stage1/arch/x86_64/make.conf
@@ -15,13 +15,9 @@
# You should have received a copy of the GNU General Public License along with
# BoxOS; if not, see <https://www.gnu.org/licenses/>.
-INCLUDE+=-I$(ARCHDIR)/include
AFLAGS+=-target $(ARCH)-pc-win32-coff
CFLAGS+=-mno-red-zone -mno-mmx -mno-sse -mno-sse2 -target $(ARCH)-pc-win32-coff
LDFLAGS+=-entry:_start
ARCH_OBJS=$(ARCHDIR)/asm/entry.o \
$(ARCHDIR)/asm/__chkstk.o \
- $(ARCHDIR)/asm/paging.o \
- $(ARCHDIR)/paging.o \
- $(ARCHDIR)/serial.o \
diff --git a/bootstrap/stage1/firmware/efi/make.conf b/bootstrap/stage1/firmware/efi/make.conf
index 3b1615e..cee6fcd 100644
--- a/bootstrap/stage1/firmware/efi/make.conf
+++ b/bootstrap/stage1/firmware/efi/make.conf
@@ -1,14 +1,13 @@
LD:=lld-link
-ifeq (BS_DEBUG,YES)
- AFLAGS+=-gcodeview
- CFLAGS+=-gcodeview
+ifeq ($(BS_DEBUG),YES)
+ AFLAGS+=-gcodeview -gsplit-dwarf -gdwarf-4
+ CFLAGS+=-gcodeview -gsplit-dwarf -gdwarf-4
endif
CFLAGS+=-fshort-wchar
LDFLAGS+=-subsystem:efi_application -out:$(BINARY)
-FIRMWARE_OBJS=$(FIRMWARE_DIR)/efi.o \
- $(FIRMWARE_DIR)/bs_alloc.o \
+FIRMWARE_OBJS=$(FIRMWARE_DIR)/alloc.o \
+ $(FIRMWARE_DIR)/efi.o \
$(FIRMWARE_DIR)/tty.o \
- $(FIRMWARE_DIR)/util.o \