trs80: enable floppy disk write support
authorAlan Cox <alan@linux.intel.com>
Sun, 21 Dec 2014 15:32:33 +0000 (15:32 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 21 Dec 2014 15:32:33 +0000 (15:32 +0000)
Kernel/platform-trs80/README
Kernel/platform-trs80/devfd.c
Kernel/platform-trs80/floppy.s

index ca8c5cd..f9bc554 100644 (file)
@@ -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
index 019a03f..9b08ebc 100644 (file)
@@ -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);
 }
index b26dac5..9c61c03 100644 (file)
@@ -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)