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 5008ddf..256d3ef 100644 Binary files a/include/.DS_Store and b/include/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store index 5008ddf..21bd2cc 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ 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