From 38c6b167cd682b5f4476de2f4a6da099e57ef70b Mon Sep 17 00:00:00 2001 From: Neal Andrew Crook Date: Sat, 16 Jul 2016 15:31:28 +0100 Subject: [PATCH] Switch away from legacy exec model (for SDC driver). Not yet working. --- Kernel/platform-multicomp09/config.h | 8 ++++---- Kernel/platform-multicomp09/sdc.s | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Kernel/platform-multicomp09/config.h b/Kernel/platform-multicomp09/config.h index 11dbcf02..5af78f97 100644 --- a/Kernel/platform-multicomp09/config.h +++ b/Kernel/platform-multicomp09/config.h @@ -17,6 +17,9 @@ /* We use flexible 16K banks so use the helper */ #define CONFIG_BANK16 #define CONFIG_BANKS 4 +/* 512Kbyte RAM in 16K chunks is 32. 3 reserved? + Since we *could* have 1MByte this should be larger.. 64-3 +*/ #define MAX_MAPS 32-3 #define MAPBASE 0x0000 /* And swapping */ @@ -30,10 +33,7 @@ #define MAX_SWAPS 32 #define swap_map(x) ((uint8_t *)(x & 0x3fff )) -/* The Drivewire block dev rawmode=1 doesn't work just now - with the bank16k.c memory layout (yet), so we have to - use legacy binary loading... */ -#define CONFIG_LEGACY_EXEC +#undef CONFIG_LEGACY_EXEC #define TICKSPERSEC 50 /* Ticks per second */ diff --git a/Kernel/platform-multicomp09/sdc.s b/Kernel/platform-multicomp09/sdc.s index c4518408..87a29c59 100644 --- a/Kernel/platform-multicomp09/sdc.s +++ b/Kernel/platform-multicomp09/sdc.s @@ -23,6 +23,9 @@ _devsd_write pshs y ldy #512 ; 512 bytes + tst _blk_op+2 ; test user/kernel xfer + beq WrBiz ; if zero then stay in kernel space + jsr map_process_always ; else flip to user space WrBiz lda SDCTL cmpa #$a0 bne WrBiz ; space not available @@ -30,7 +33,8 @@ WrBiz lda SDCTL sta SDDATA ; store to SD leay -1,y bne WrBiz ; next - puls y,pc + puls y + jmp map_kernel ; reset to kernel space (tail optimise) ;;; Read 512 bytes from SDC @@ -43,6 +47,9 @@ WrBiz lda SDCTL _devsd_read pshs y ldy #512 ; 512 bytes + tst _blk_op+2 ; test user/kernel xfer + beq RdBiz ; if zero then stay in kernel space + jsr map_process_always ; else flip to user space RdBiz lda SDCTL cmpa #$e0 bne RdBiz ; byte not available @@ -50,4 +57,5 @@ RdBiz lda SDCTL sta ,x+ ; store byte in sector buffer leay -1,y bne RdBiz ; next - puls y,pc + puls y + jmp map_kernel ; reset to kernel space (tail optimise) -- 2.34.1