From e3c9c7b6421d8106c7c4b20ff7d3969d8c431015 Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Sun, 21 Dec 2025 14:40:15 -0500 Subject: [PATCH] linker: ensured .bss comes after .data, and added map file output --- .gitignore | 2 +- Makefile | 7 ++++--- boot.asm | 4 ++++ linker.cmd | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 940421a..35c765e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,6 @@ *.srec *.s19 *.elf - +*.map AGENTS.md .pre-commit-config.yaml \ No newline at end of file diff --git a/Makefile b/Makefile index 37e0284..9fe9a35 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,10 @@ # SPDX-FileCopyrightText: (c) 2025 A.M. Rowsell ASM=vasm_z80_std LINK=vlink +MAP=zone.map ASMFLAGS=-Fvobj -LINKFLAGS=-b ihex -T linker.cmd +LINKFLAGS=-b ihex -T linker.cmd -M all: zone.hex @@ -21,9 +22,9 @@ boot.o: boot.asm $(ASM) $(ASMFLAGS) -o $@ $< zone.hex: float.o vectorTable.o zone.o boot.o linker.cmd - $(LINK) $(LINKFLAGS) -o $@ float.o vectorTable.o zone.o boot.o + $(LINK) $(LINKFLAGS) -o $@ float.o vectorTable.o zone.o boot.o > $(MAP) clean: - rm -f float.o vectorTable.o zone.o boot.o zone.hex + rm -f float.o vectorTable.o zone.o boot.o zone.hex $(MAP) .PHONY: all clean diff --git a/boot.asm b/boot.asm index 92c0e4a..2ebcd44 100644 --- a/boot.asm +++ b/boot.asm @@ -5,6 +5,10 @@ .global os_warm_boot .extern os_main_loop +; ================================== +; This is the cold boot entry point! +; It is linked to land at 0xC3C3 +; ================================== zone_setup: ld sp, 0x6FFF jp os_main_loop diff --git a/linker.cmd b/linker.cmd index 9d2be01..67b30a6 100644 --- a/linker.cmd +++ b/linker.cmd @@ -6,5 +6,6 @@ SECTIONS .boot 0xC3C3 : { *(.boot) *(boot) } .vectors 0xF000 : { *(.vectors) } .data 0x7000 : { *(.data) } - .bss : { *(.bss) } + __data_end = .; + .bss __data_end : { *(.bss) } }