Hi!

     I send to Matija testing kernel, but, while I not receive results, let
me discuss possible reason to errors.

______________O\_/_________________________________\_/O______________
STATIC COUNT Genblockio(ddt * pddt, UWORD mode, WORD head, WORD track,
                 WORD sector, WORD count, VOID FAR * buffer)
  return LBA_Transfer(pddt, mode, buffer,
                      ((ULONG) track * pddt->ddt_bpb.bpb_nheads + head) *
                      pddt->ddt_bpb.bpb_nsecs + pddt->ddt_offset + sector,
                      count, &transferred);

STATIC WORD Genblkdev(rqptr rp, ddt * pddt)
    case 0x42:                 /* format/verify track */
              int ret = Genblockio(pddt, LBA_FORMAT, head, cyl, 0,
                                   pddt->ddt_bpb.bpb_nsecs, DiskTransferBuffer);

STATIC int LBA_to_CHS(ULONG LBA_address, struct CHS *chs, const ddt * pddt)
  const bpb *pbpb = hd(pddt->ddt_descflags) ? &pddt->ddt_defbpb : &pddt->ddt_bpb;
  unsigned hs = pbpb->bpb_nsecs * pbpb->bpb_nheads;
  unsigned hsrem = (unsigned)(LBA_address % hs);
  LBA_address /= hs;
  if (LBA_address > 1023ul)
  {
    put_string("LBA-Transfer error : cylinder > 1023\n");
    return 1;
  }

STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
                 ULONG LBA_address, unsigned totaltodo,
        if (LBA_to_CHS(LBA_address, &chs, pddt))
          return failure(E_CMD); /*dskerr(1)*/
_____________________________________________________________________
              O/~\                                 /~\O

As you may see, there called Genblkdev()->Genblockio()->LBA_Transfer() and,
at last, LBA_to_CHS(), which makes error. As I understand, trouble is that
LBA_to_CHS() computes different values, than used in Genblockio(). Why?
There are two differences: LBA_to_CHS() for HD uses .ddt_defbpb instead
.ddt_bpb (but error happen on floppy diskette), and Genblockio() uses
ddt_offset. So, I may suggest, trouble is that ddt_offset contains some
wrong (nonzero) value.




-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to