From 5ad7268c5f2e22f015826e1b9264377c99c765b0 Mon Sep 17 00:00:00 2001 From: Kyle Cardoza Date: Thu, 28 Mar 2024 03:32:27 -0400 Subject: [PATCH] cleanup --- config/memory.scm | 52 ++++++++++++++++++++++++++++-------------- config/sdk-config.mk | 22 ++++++++---------- config/sdk-targets.mk | 11 ++++----- include/.DS_Store | Bin 6148 -> 6148 bytes src/.DS_Store | Bin 6148 -> 6148 bytes src/cstartup.s | 6 ++--- 6 files changed, 52 insertions(+), 39 deletions(-) diff --git a/config/memory.scm b/config/memory.scm index 3a5ef6e..1cd5784 100644 --- a/config/memory.scm +++ b/config/memory.scm @@ -1,15 +1,35 @@ (define memories '( - (memory LowCode - (address (#x008000 . #x00FFFF)) - (section code) - (section cdata) - (section idata) - (section inear) - (section switch) + (memory HighRAM + (address (#x010000 . #x017FFF)) + (section farcode) + (section fardata) + (section far) + (section cfar) + (section chuge) (section data_init_table) + (section switch) + (section itiny) + (section inear) + (section ifar) + (section ihuge) + (type ram) + ) + + (memory HighBSS + (address (#x018000 . #x01FFFF)) + (section heap) + (section huge) + (section zhuge) + (section zfar) + (type ram) + ) + + (memory MidRAM + (address (#x00E000 . #x00FFFF)) + (section code) + (section cnear) (section reset) - (section (boot #x008000)) - (type rom) + (type ram) ) (memory IOSpace @@ -17,13 +37,11 @@ (section (VERAIOPort #x00DF00)) ) - (memory LowData - (address (#x001000 . #x007FFF)) - (section near) - (section data) - (section znear) - (section zdata) - (section heap) + (memory LowRAM + (address (#x001000 . #x00DEFF)) + (section znear) + (section near) + (type ram) ) (memory stack @@ -48,5 +66,5 @@ (base-address _DirectPageStart DirectPage 0) - (base-address _NearBaseAddress LowData 0) + (base-address _NearBaseAddress LowRAM 0) )) diff --git a/config/sdk-config.mk b/config/sdk-config.mk index 5d5def4..1a269ce 100644 --- a/config/sdk-config.mk +++ b/config/sdk-config.mk @@ -11,15 +11,15 @@ MEMORY_MAP := config/memory.scm CFLAGS := --include-system=include/libc \ -I include \ - --code-model=small \ - --data-model=small \ + --code-model=large \ + --data-model=huge \ --64bit-doubles \ --strong-inline \ --force-switch jump-table ASFLAGS := -I include \ - --code-model=small \ - --data-model=small + --code-model=large \ + --data-model=huge ifeq ($(RELEASE), "true") CFLAGS += -DNDEBUG \ @@ -40,14 +40,6 @@ CFLAGS += --debug \ ASFLAGS += --debug endif -LDFLAGS := $(MEMORY_MAP) \ - --list-file build.lst \ - --rom-code \ - --output-format raw \ - --raw-multiple-memories \ - --verbose \ - --cstartup=sentinel65x - ifeq ($(ENABLE_RELEASE_BUILD), "true") CFLAGS += -DRELEASE_BUILD CFLAGS += -DNDEBUG @@ -57,6 +49,12 @@ endif LIBS := build/libc.a +LDFLAGS := $(MEMORY_MAP) \ + --rtattr cstartup=sentinel65x \ + --list-file build.lst \ + --verbose \ + --output-format pgz + KERNEL_SRC_C := $(wildcard src/*.c) \ $(wildcard src/*/*.c) \ $(wildcard src/*/*/*.c) \ diff --git a/config/sdk-targets.mk b/config/sdk-targets.mk index 35d649b..21c1ebb 100644 --- a/config/sdk-targets.mk +++ b/config/sdk-targets.mk @@ -1,5 +1,5 @@ .PHONY: all -all: build/sentinel-kernel.bin +all: build/kernel.pgz .PHONY: clean clean: @@ -7,6 +7,7 @@ clean: -name '*.pgz' -o \ -name '*.bin' -o \ -name '*.elf' -o \ + -name '*.raw' -o \ -name '*.a' \ \) -delete @find src -type f \( \ @@ -29,10 +30,8 @@ clean: @printf '%s' "$(dir $@)" > $@ @$(CC) $(CFLAGS) --dependencies $< >> $@ -build/sentinel-kernel.bin: $(KERNEL_OBJ) +build/kernel.pgz: $(KERNEL_OBJ) @echo "Linking $@..." -# @$(AR) $@ $^ - $(LD) $(LDFLAGS) -o $@ $^ - @rm -f $@ - @mv build/sentinel-kernel.raw $@ + @$(LD) $(LDFLAGS) -o $@ $^ + -include $(KERNEL_DEP) diff --git a/include/.DS_Store b/include/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..256d3efbd90cfe2304cc1ed93017f97acfd80c4c 100644 GIT binary patch delta 225 zcmZoMXfc=|#>B`mF;Q%yo}wrV0|Nsi1A_nqLn=cNLvc>JVQ_N(#Kh(GAPIJc6rf-x zLm9GUZUImR2&8<01e%K6d>5Cboctu949CRDd_S6Q9d*Q}DutjbL5AXj43Jx3)){O} p%wd~sAi}bln}eGJ=z)!i-AjHu~2NHo+1YW5HK<@2y9-+n8vnw1EUw?W_AvK4xj>{$am(+{342+ UKzW7)kiy9(Jj$D6L{=~Z04H+~3jhEB diff --git a/src/.DS_Store b/src/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..21bd2cc45fd22efeea2245780b412da32b4ac4db 100644 GIT binary patch delta 225 zcmZoMXfc=|#>B`mF;Q%yo}wrV0|Nsi1A_nqLn=cNLvc>JVQ_N(#Kh(GAPIJc6rf-x zLm9GUZUImR2n^DI1e%K6d>5Cboctu942S-%L-F%(9d*Q}DutjbL5AXj43Jx3)+KCA p%wd~sAi}bln}eGJ=z)!i-AjHu~2NHo+1YW5HK<@2y9-+n8vnw1EUw?W_AvK4xj>{$am(+{342+ UKzW7)kiy9(Jj$D6L{=~Z04H+~3jhEB diff --git a/src/cstartup.s b/src/cstartup.s index 49a98cc..de9d6c0 100644 --- a/src/cstartup.s +++ b/src/cstartup.s @@ -43,12 +43,10 @@ __program_root_section: ;;; *************************************************************************** #ifdef __CALYPSI_CODE_MODEL_COMPACT__ - .section boot + .section code #else - .section boot, noreorder + .section code, noreorder #endif - - .asciz "WDC" .pubweak __program_start __program_start: clc