dragon-nx-32: first floppy fixes
authorAlan Cox <alan@linux.intel.com>
Tue, 2 Jun 2015 22:56:45 +0000 (23:56 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 2 Jun 2015 22:56:45 +0000 (23:56 +0100)
Track 0 now behaves. Seeking to other tracks breaks.

Kernel/platform-dragon-nx32/devfd.c
Kernel/platform-dragon-nx32/floppy.s

index 5bd2219..56e4823 100644 (file)
@@ -14,7 +14,7 @@
 
 static uint8_t motorct;
 static uint8_t fd_selected = 0xFF;
-extern uint8_t *fd_tab;
+extern uint8_t fd_tab[];
 
 static void fd_motor_busy(void)
 {
@@ -89,14 +89,18 @@ static int fd_transfer(uint8_t minor, bool is_read, uint8_t rawflag)
         
     while (nblock) {
         for (tries = 0; tries < 4 ; tries++) {
+            kprintf("fd sector %d track %d\n", cmd[3], cmd[2]);
             err = fd_operation(cmd, driveptr);
             if (err == 0)
                 break;
-            if (tries > 1)
+            kprintf("fd error %d\n", err);
+            if (tries > 1) {
+                kputs("fd reset\n");
                 fd_reset(driveptr);
+            }
         }
         /* FIXME: should we try the other half and then bale out ? */
-        if (tries == 3)
+        if (tries == 4)
             goto bad;
         cmd[5]++;      /* Move on 256 bytes in the buffer */
         cmd[3]++;      /* Next sector for next block */
index 7c98015..6382024 100644 (file)
@@ -320,7 +320,7 @@ _fd_operation:
        orcc    #0x40           ; Make sure FIR is off
        jsr     piasave
        ldy     6,s             ; Drive struct
-       tst     ,y+             ; User or kernel ?
+       tst     ,x+             ; User or kernel ?
        beq     fd_op_k
        jsr     map_process_always
 fd_op_k: