From: Alan Cox Date: Thu, 3 Nov 2016 22:51:19 +0000 (+0000) Subject: coco2: do a bit more work on this X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=08993785a18a1522b5c42b750bf1a868b9e611ae;p=FUZIX.git coco2: do a bit more work on this Mostly realign it and add dw_transaction. --- diff --git a/Kernel/platform-coco2/Makefile b/Kernel/platform-coco2/Makefile index f1c6ee73..2a0e5e98 100644 --- a/Kernel/platform-coco2/Makefile +++ b/Kernel/platform-coco2/Makefile @@ -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 diff --git a/Kernel/platform-coco2/config.h b/Kernel/platform-coco2/config.h index 91b79bc4..d2843b1e 100644 --- a/Kernel/platform-coco2/config.h +++ b/Kernel/platform-coco2/config.h @@ -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 diff --git a/Kernel/platform-coco2/drivewire.s b/Kernel/platform-coco2/drivewire.s index 7e58f9b7..85962feb 100644 --- a/Kernel/platform-coco2/drivewire.s +++ b/Kernel/platform-coco2/drivewire.s @@ -9,6 +9,7 @@ ; exported .globl _dw_operation .globl _dw_reset + .globl _dw_transaction .globl _dw_lpr .globl _dw_lpr_close @@ -21,6 +22,29 @@ .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? diff --git a/Kernel/platform-coco2/fuzix.link b/Kernel/platform-coco2/fuzix.link index 8988da61..46404c17 100644 --- a/Kernel/platform-coco2/fuzix.link +++ b/Kernel/platform-coco2/fuzix.link @@ -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