From 9f1d527a7c9e6e40b85faf42b59aee026b396469 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Mon, 18 Apr 2022 20:27:48 -0500 Subject: [PATCH] Change kernel link type Kernel is now compiled and linked into a raw binary instead of intel hex. This raw binary can be loaded into the correct address by the bootloader. I wanted this to be an o65 file, but ld65 kept complaining about it. Honestly though having this be a straight binary makes it easier to load, but we can't relocate it. --- sw/kernel/Makefile | 6 +++--- sw/kernel/link.ld | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/kernel/Makefile b/sw/kernel/Makefile index a84801d..d733175 100644 --- a/sw/kernel/Makefile +++ b/sw/kernel/Makefile @@ -1,11 +1,11 @@ CC=cl65 -CFLAGS=-T -t none -I. --cpu "65C02" +CFLAGS=-T -t super6502 -I. --cpu "65C02" test: CFLAGS=-T -t sim65c02 -I. LDFLAGS=-C link.ld -m $(NAME).map SIM=sim65 SIMARGS=-v -c -x 1000000 -NAME=bootrom +NAME=kernel TEST_BIN=test.bin BIN=$(NAME).bin @@ -24,7 +24,7 @@ TEST_OBJS+=$(patsubst %.s,%.o,$(filter %s,$(TEST_SRCS))) TEST_OBJS+=$(patsubst %.c,%.o,$(filter %c,$(TEST_SRCS))) TEST_OBJS+=$(filter-out boot.o,$(filter-out main.o,$(filter-out vectors.o,$(OBJS)))) -all: $(HEX) +all: $(BIN) test: $(TEST_BIN) $(SIM) $(SIMARGS) $(TEST_BIN) diff --git a/sw/kernel/link.ld b/sw/kernel/link.ld index 172f0a5..1fd8d3f 100644 --- a/sw/kernel/link.ld +++ b/sw/kernel/link.ld @@ -2,7 +2,7 @@ MEMORY { ZP: start = $0, size = $100, type = rw, define = yes; SDRAM: start = $200, size = $7cf0, type = rw, define = yes; - ROM: start = $8000, size = $8000, fill = yes, fillval = $ff, file = %O; + ROM: start = $D000, size = $3000, file = %O; } SEGMENTS {