My posts here mysteriously vanish, but I'll try once again, and if failed again, will e-mail Bart. Here's the patch that fixes the CHKDSK I: "Invalid drive specification" bug (I: is my RAM disk and it's the last drive installed). The problem was NOT in the get_cds() function itself, but in that it was given a drive number directly from the FCB whereas it should be a DOS logical drive number. Needless to say that all my patches are at http://linux.tu-varna.acad.bg/~lig/freedos/CVSPATCH.TXT

Lucho

diff -ruN cvs/kernel/kernel/task.c src/kernel/kernel/task.c
--- cvs/kernel/kernel/task.c    2003-09-18 21:54:20.000000000 +0200
+++ src/kernel/kernel/task.c    2004-02-06 09:15:16.000000000 +0200
@@ -225,6 +225,15 @@
   p->ps_cmd.ctBuffer[0] = 0xd; /* command tail            */
 }

+STATIC UBYTE chkdrv(UBYTE drive) /* from FCB: 0 = default, 1 = A:, ... */
+{
+  if (drive)
+    drive--; /* 0 = A:, 1 = B:, ... */
+  else
+    drive = default_drive;
+  return get_cds(drive) ? 0 : 0xff; /* return 0 if drive is valid, else 0xff */
+}
+
 STATIC UWORD patchPSP(UWORD pspseg, UWORD envseg, exec_blk FAR * exb,
                       BYTE FAR * fnam)
 {
@@ -278,8 +287,8 @@
     pspmcb->m_name[i] = '\0';

   /* return value: AX value to be passed based on FCB values */
-  return (get_cds(psp->ps_fcb1.fcb_drive) ? 0 : 0xff) |
-         (get_cds(psp->ps_fcb2.fcb_drive) ? 0 : 0xff00);
+  return chkdrv(psp->ps_fcb1.fcb_drive) |
+        (chkdrv(psp->ps_fcb2.fcb_drive) << 8);
 }

int load_transfer(UWORD ds, exec_blk *exp, UWORD fcbcode, COUNT mode)


------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to