Use our own toolchain instead of the one in the image

Now that we are adding our own target we can compile our own toolchain
instead of using the stock one. This does mean that there isn't really a
purpose to using the alpine cc65 image though
This commit is contained in:
Byron Lathi
2022-04-20 12:39:40 -05:00
parent 686630e79f
commit aa717685e3
9 changed files with 38 additions and 13 deletions

View File

@@ -1,11 +1,14 @@
.PHONY: all install bootloader kernel clean
all: bootloader kernel
all: toolchain bootloader kernel
install: all
sh script/format_disk.sh
sh script/copy_files.sh
toolchain:
@$(MAKE) -j4 -C cc65
bootloader:
@$(MAKE) -C bootloader
@@ -15,4 +18,5 @@ kernel:
clean:
@$(MAKE) -C bootloader --no-print-directory $@
@$(MAKE) -C kernel --no-print-directory $@
@$(MAKE) -C kernel --no-print-directory $@
@$(MAKE) -C cc65 --no-print-directory $@

View File

@@ -1,4 +1,4 @@
CC=cl65
CC=../cc65/bin/cl65
CFLAGS=-T -t none -I. --cpu "65C02"
test: CFLAGS=-T -t sim65c02 -I.
LDFLAGS=-C link.ld -m $(NAME).map

1
sw/cc65 Submodule

Submodule sw/cc65 added at 23a984f0dd

View File

@@ -1,5 +1,5 @@
CC=cl65
CFLAGS=-T -t none -I. --cpu "65C02"
CC=../cc65/bin/cl65
CFLAGS=-T -t super6502 -I. --cpu "65C02"
test: CFLAGS=-T -t sim65c02 -I.
LDFLAGS=-C link.ld -m $(NAME).map
SIM=sim65

View File

@@ -29,9 +29,10 @@ _init: LDX #$FF ; Initialize stack pointer to $01FF
; ---------------------------------------------------------------------------
; Set cc65 argument stack pointer
LDA #<(__SDRAM_START__ + __SDRAM_SIZE__)
;LDA #<(__SDRAM_START__ + __SDRAM_SIZE__)
lda #<($200 + $7cf0)
STA sp
LDA #>(__SDRAM_START__ + __SDRAM_SIZE__)
LDA #>($200 + $7cf0)
STA sp+1
; ---------------------------------------------------------------------------

View File

@@ -52,7 +52,7 @@ void exec(char* filename) {
ret = 0;
ret = (*exec)();
//ret = (*exec)();
cprintf("ret: %x\n", ret);

View File

@@ -2,12 +2,16 @@ MEMORY
{
ZP: start = $0, size = $100, type = rw, define = yes;
SDRAM: start = $200, size = $7cf0, type = rw, define = yes;
ROM: start = $D000, size = $3000, file = %O;
ROM: start = $C000, size = $4000, type = rw, define = yes;
}
FILES {
%O: format = o65;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
DATA: load = ROM, type = rw, define = yes, run = SDRAM;
DATA: load = SDRAM, type = rw, define = yes;
BSS: load = SDRAM, type = bss, define = yes;
HEAP: load = SDRAM, type = bss, optional = yes;
STARTUP: load = ROM, type = ro;