From: Alan Cox Date: Sun, 21 Dec 2014 15:32:33 +0000 (+0000) Subject: trs80: enable floppy disk write support X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6873a9c62868a35c9b64e8aa0ad47c0a76692911;p=FUZIX.git trs80: enable floppy disk write support --- diff --git a/Kernel/platform-trs80/README b/Kernel/platform-trs80/README index ca8c5cd3..f9bc5545 100644 --- a/Kernel/platform-trs80/README +++ b/Kernel/platform-trs80/README @@ -16,6 +16,8 @@ Requirements: 128K RAM fitted Hard disk drive (will be used for swap), or a suitable memory expander board could be used with a bit of tweaking (or both!) + *** NOTE: the current code will simply swap blindly all over the first + hard disk *** Memory Map: Base memory 0-FFFF (with a fair bit of slack) is used for the kernel @@ -36,9 +38,10 @@ Memory Map: Drivers: 80 column display is done - Keyboard is not started - Floppy and Hard disk are fleshed out but not yet tested (need kbd - first) + Keyboard is done + Floppy and Hard disk are done and minimally tested + Floppy drivers do not yet deal with double sided disks or sd/dd + media detection Hard disk needs to read block 0, and handle partitions of some form including finding where 'swap' lives @@ -72,4 +75,4 @@ Setting It Up # sdltrs -emtsafe -disk0 mydisk.jv3 -model 4p # - + # and remember to mark the fd volume as writeable diff --git a/Kernel/platform-trs80/devfd.c b/Kernel/platform-trs80/devfd.c index 019a03f0..9b08ebc3 100644 --- a/Kernel/platform-trs80/devfd.c +++ b/Kernel/platform-trs80/devfd.c @@ -98,6 +98,7 @@ int fd_read(uint8_t minor, uint8_t rawflag, uint8_t flag) int fd_write(uint8_t minor, uint8_t rawflag, uint8_t flag) { - flag; + flag;rawflag;minor; +// return 0; return fd_transfer(minor, false, rawflag); } diff --git a/Kernel/platform-trs80/floppy.s b/Kernel/platform-trs80/floppy.s index b26dac54..9c61c030 100644 --- a/Kernel/platform-trs80/floppy.s +++ b/Kernel/platform-trs80/floppy.s @@ -10,7 +10,6 @@ ; - track dependant for double density based on trsdos dir pos ; ; - .globl _fd_reset .globl _fd_operation .globl _fd_motor_on @@ -175,7 +174,6 @@ rwiowt: djnz rwiowt ; to meet timing ld a, #1 ld (fdc_active), a ; NMI pop and jump -; set 6,d ; halt mode bit jr z, fdio_in jr nc, fdio_out ; @@ -216,7 +214,8 @@ fdio_inbyte: ; Read from the disk - HL points to the target buffer ; fdio_out: - ld bc, #FDCDATA + 0xFF00 ; 256 bytes/sector, c is our port + set 6,d ; halt mode bit + ld c, #FDCDATA ; C is our port ld e, #0x76 fdio_outl: in a, (FDCREG) ; Wait for DRQ (or error)