Switch away from legacy exec model (for SDC driver). Not yet
authorNeal Andrew Crook <neal@pippaluk.org.uk>
Sat, 16 Jul 2016 14:31:28 +0000 (15:31 +0100)
committerNeal Andrew Crook <neal@pippaluk.org.uk>
Sat, 16 Jul 2016 14:31:28 +0000 (15:31 +0100)
working.

Kernel/platform-multicomp09/config.h
Kernel/platform-multicomp09/sdc.s

index 11dbcf0..5af78f9 100644 (file)
@@ -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 */
 #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 */
index c451840..87a29c5 100644 (file)
@@ -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)