m6809test: Switch t using lwlink directly and fix some oddments
authorAlan Cox <alan@etchedpixels.co.uk>
Tue, 11 Nov 2014 21:42:10 +0000 (21:42 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Tue, 11 Nov 2014 21:42:10 +0000 (21:42 +0000)
This allows us to actually control memory the way we need

Kernel/Makefile
Kernel/platform-6809test/Makefile
Kernel/platform-6809test/commonmem.s
Kernel/platform-6809test/config.h
Kernel/platform-6809test/crt0.s

index 9689a4a..b9b091c 100644 (file)
@@ -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
index 8a2495b..f714464 100644 (file)
@@ -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
index 83ffb65..67e7f26 100644 (file)
@@ -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:
index 570fabc..c14154f 100644 (file)
@@ -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
index 8125100..df550ec 100644 (file)
                .globl kstack_top
 
                ; startup code @0
-               .area .text
+               .area .start
+               jmp start
+
+               .area .text
 
 start:         orcc #0x10              ; interrupts definitely off
                lds #kstack_top