coco2: do a bit more work on this
authorAlan Cox <alan@linux.intel.com>
Thu, 3 Nov 2016 22:51:19 +0000 (22:51 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 3 Nov 2016 22:51:19 +0000 (22:51 +0000)
Mostly realign it and add dw_transaction.

Kernel/platform-coco2/Makefile
Kernel/platform-coco2/config.h
Kernel/platform-coco2/drivewire.s
Kernel/platform-coco2/fuzix.link

index f1c6ee7..2a0e5e9 100644 (file)
@@ -1,8 +1,7 @@
 
-CSRCS = devtty.c
-CSRCS += devices.c main.c mini_ide.c
+CSRCS = devices.c main.c mini_ide.c
 
-C3SRCS = libc.c
+C3SRCS = libc.c devtty.c
 
 CDSRCS = discard.c mini_ide_discard.c
 
@@ -57,8 +56,8 @@ image: bootfuz.bin
        ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \
        devtty.o libc.o ../vt.o ../syscall_fs3.o
        ../tools/decb-image <../fuzix.bin fuzix.img
-       # Repack the high 4K where the loader wants it
-       dd if=fuzix.img of=fuzix.tmp bs=1024 skip=60
+       # Repack the high 5K where the loader wants it
+       dd if=fuzix.img of=fuzix.tmp bs=1024 skip=59
        dd if=fuzix.tmp of=fuzix.img bs=1024 seek=32 conv=notrunc
 
 bootfuz.bin: bootloader.s
index 91b79bc..d2843b1 100644 (file)
@@ -11,6 +11,7 @@
 /* Pure swap */
 #define CONFIG_SWAP_ONLY
 #define CONFIG_SPLIT_UDATA
+#define UDATA_BLKS 1
 #define CONFIG_USERMEM_DIRECT
 
 #define CONFIG_BANKS   1
index 7e58f9b..85962fe 100644 (file)
@@ -9,6 +9,7 @@
        ; exported
        .globl _dw_operation
        .globl _dw_reset
+       .globl _dw_transaction
 
        .globl _dw_lpr
        .globl _dw_lpr_close
 
        .area .common
 
+_dw_transaction:
+       pshs    cc,y            ; save caller
+       orcc    #0x50           ; stop interrupts
+       tstb                    ; rawflag?
+       beq     skip@           ; nope - then skip switching to process map
+       jsr     map_process_always
+skip@  ldy     5,s             ; Y = number of bytes to send
+       beq     ok@             ; no bytes to write - leave
+       jsr     DWWrite         ; send to DW
+       ldx     7,s             ; X is receive buffer
+       ldy     9,s             ; Y = number of bytes to receive
+       beq     ok@             ; no bytes to send - leave
+       jsr     DWRead          ; read in that many bytes
+       bcs     frame@          ; C set on framing error
+       bne     part@           ; Z zet on all bytes received
+ok@    ldx     #0              ; no error
+out@   jsr     map_kernel
+       puls    cc,y,pc         ; return
+frame@ ldx     #-1             ; frame error
+       bra     out@
+part@  ldx     #-2             ; not all bytes received!
+       bra     out@
+
 _dw_reset:
        ; maybe reinitalise PIA here?
        ; and send DW_INIT request to server?
index 8988da6..46404c1 100644 (file)
@@ -6,11 +6,11 @@ section .start load 0x0400
 section .text
 section .text2
 section .bss
-section .video load 0xF000
+section .video load 0xEC00
 section .data
 section .videodata
 section .common
 section .text3
-section .discard load 0x9000
+section .discard load 0xA000
 section .udata load 0xFD00
 entry start