From: Alan Cox Date: Tue, 11 Nov 2014 21:42:10 +0000 (+0000) Subject: m6809test: Switch t using lwlink directly and fix some oddments X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=55e4a915a79b01de6ebf5d02ba91568ffdb243a8;p=FUZIX.git m6809test: Switch t using lwlink directly and fix some oddments This allows us to actually control memory the way we need --- diff --git a/Kernel/Makefile b/Kernel/Makefile index 9689a4a1..b9b091c6 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -1,9 +1,9 @@ TARGET_LIST = platform-nc100 platform-micropack platform-pcw8256 platform-socz80 platform-zx128 platform-trs80 platform-z80pack platform-z80pack-lite -export TARGET= msx1 -export CPU = z80 -#export TARGET = 6809test -#export CPU = 6809 +#export TARGET= msx1 +#export CPU = z80 +export TARGET = dragon +export CPU = 6809 #export TARGET = 6502test #export CPU = 6502 export VERSION = "0.1" @@ -42,10 +42,13 @@ export CROSS_CCOPTS=-c -Or -t c128 -I$(ROOT_DIR)/cpu-6502 -I$(ROOT_DIR)/platform export BINEXT = .o else export CROSS_AS=m6809-unknown-as -export CROSS_LD=m6809-unknown-ld +export CROSS_LD=lwlink export CROSS_CC = m6809-unknown-gcc #export CROSS_CCOPTS=-Wall -O2 -I$(ROOT_DIR)/cpu-6809 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include -export CROSS_CCOPTS=-c -Wall -O2 -I$(ROOT_DIR)/cpu-6809 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include +export CROSS_CCOPTS=-c -Wall -O2 -msoft-reg-count=4 -I$(ROOT_DIR)/cpu-6809 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include +export CROSS_CC_SEG2=-mcode-section=.text2 +export CROSS_CC_SEGDISC=-mcode-section=.discard +export CROSS_CC_VIDEO=-mcode-section=.video -mdata-section=.video export ASOPTS= export BINEXT = .o endif diff --git a/Kernel/platform-6809test/Makefile b/Kernel/platform-6809test/Makefile index 8a2495b1..f7144644 100644 --- a/Kernel/platform-6809test/Makefile +++ b/Kernel/platform-6809test/Makefile @@ -23,10 +23,11 @@ clean: rm -f $(OBJS) $(JUNK) core *~ image: - $(CROSS_LD) -o ../fuzix.bin --map ../uzi.map -nostdlib crt0.o commonmem.o \ + $(CROSS_LD) --raw -o ../fuzix.bin --map=../fuzix.map --script=fuzix.link \ + crt0.o commonmem.o \ p6809.o ../start.o ../version.o ../lowlevel-6809.o \ tricks.o main.o ../timer.o ../kdata.o devrd.o devices.o \ ../devio.o ../filesys.o ../process.o ../inode.o ../syscall_fs.o \ ../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o ../bank16k.o \ - ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o \ + ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec.o \ ../usermem_std-6809.o devlpr.o devtty.o libc.o diff --git a/Kernel/platform-6809test/commonmem.s b/Kernel/platform-6809test/commonmem.s index 83ffb65a..67e7f269 100644 --- a/Kernel/platform-6809test/commonmem.s +++ b/Kernel/platform-6809test/commonmem.s @@ -12,7 +12,7 @@ .globl istack_top .globl istack_switched_sp - .area _COMMONMEM + .area .udata _ub: ; first 512 bytes: starts with struct u_block, with the kernel stack working down from above _udata: diff --git a/Kernel/platform-6809test/config.h b/Kernel/platform-6809test/config.h index 570fabce..c14154ff 100644 --- a/Kernel/platform-6809test/config.h +++ b/Kernel/platform-6809test/config.h @@ -21,7 +21,7 @@ #define SWAP_SIZE 0x80 /* 64K blocks */ /* FIXME */ #define SWAPBASE 0x0000 /* We swap the lot in one, include the */ -#define SWAPTOP 0xF000 /* vectors so its a round number of sectors */ +#define SWAPTOP 0x8000 /* uarea so its a round number of sectors */ #define UDATA_BLOCKS 0 /* We swap the uarea in the data */ #define UDATA_SWAPSIZE 0 #define MAX_SWAPS 32 diff --git a/Kernel/platform-6809test/crt0.s b/Kernel/platform-6809test/crt0.s index 81251007..df550ecf 100644 --- a/Kernel/platform-6809test/crt0.s +++ b/Kernel/platform-6809test/crt0.s @@ -10,7 +10,10 @@ .globl kstack_top ; startup code @0 - .area .text + .area .start + jmp start + + .area .text start: orcc #0x10 ; interrupts definitely off lds #kstack_top