From 15ae0d7407c26a22e3ee84edd7797c69ba310ae0 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 3 Dec 2024 20:25:54 +0000 Subject: [PATCH] rcbus-z8: baby steps --- Kernel/platform/platform-rcbus-z8/Makefile | 2 +- Kernel/platform/platform-rcbus-z8/config.h | 7 +++-- Kernel/platform/platform-rcbus-z8/crt0.S | 30 ++++++++-------------- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Kernel/platform/platform-rcbus-z8/Makefile b/Kernel/platform/platform-rcbus-z8/Makefile index a105cbfdc..f1e030f80 100644 --- a/Kernel/platform/platform-rcbus-z8/Makefile +++ b/Kernel/platform/platform-rcbus-z8/Makefile @@ -48,7 +48,7 @@ clean: rm -f $(OBJS) $(JUNK) core *~ bootblock.bin bootblock fuzix.bin loader.tmp image: - $(CROSS_LD) -i -b -Z 48 -C 0x0100 -D 0x0000 -S 0xF000 -f CXSDLBbs -o fuzix.bin crt0.o devices.o main.o \ + $(CROSS_LD) -b -Z 48 -C 0x0100 -S 0xF000 -f CLDBbXSs -o fuzix.bin crt0.o devices.o main.o \ discard.o commonmem.o tricks.o rcbus-z8.o devtty.o \ ../../start.o ../../version.o ../../cpu-z8/lowlevel-z8.o \ ../../mm/bankfixed.o ../../timer.o ../../kdata.o ../../mm/memalloc_none.o \ diff --git a/Kernel/platform/platform-rcbus-z8/config.h b/Kernel/platform/platform-rcbus-z8/config.h index 00042d024..4470e7711 100644 --- a/Kernel/platform/platform-rcbus-z8/config.h +++ b/Kernel/platform/platform-rcbus-z8/config.h @@ -58,10 +58,13 @@ #if 0 #define SWAPDEV (256 + 1) /* Device for swapping. (FIXME) */ #endif -#define NBUFS 8 /* Number of block buffers */ -#define NMOUNTS 4 /* Number of mounts at a time */ +/* TODO make dynamic */ +#define NBUFS 5 /* Number of block buffers */ +#define NMOUNTS 3 /* Number of mounts at a time */ #define plt_discard() #define plt_copyright() #define BOOTDEVICENAMES "hd#" + +#define CONFIG_SMALL diff --git a/Kernel/platform/platform-rcbus-z8/crt0.S b/Kernel/platform/platform-rcbus-z8/crt0.S index 5c9caaed8..b7aab41cc 100644 --- a/Kernel/platform/platform-rcbus-z8/crt0.S +++ b/Kernel/platform/platform-rcbus-z8/crt0.S @@ -1,10 +1,15 @@ #include "../../cpu-z8/kernel-z8.def" + +; +; Loaded at 0x0100 +; Execution begins at 0x0102 +; Loaded as a direct image map +; .code .export init .word 0x5A38 ; magic - ; Next 5 words and this get trampled by IRQ vectors init: di @@ -12,27 +17,12 @@ init: ld 254,#>kstack_top ld 255,#__common - ld r15,#<__common - ld r10,#>__common_size - ld r11,#<__common_size -copy_common: - lde r9,@rr12 - ldc @rr14,r9 ; From data to code map - incw rr12 - incw rr14 - decw rr10 - jr nz, copy_common + call init_early -copy_commondata: - ; Currently no commondata - add if needed + ; Wipe the BSS ld r12,#>__bss ld r13,#<__bss