Mostly realign it and add dw_transaction.
-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
../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
/* Pure swap */
#define CONFIG_SWAP_ONLY
#define CONFIG_SPLIT_UDATA
+#define UDATA_BLKS 1
#define CONFIG_USERMEM_DIRECT
#define CONFIG_BANKS 1
; 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?
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