- Changed the calculation of the current sector count to read or write from both sides of a floppy in one step. - Set the EOT sector always to the last sector of a floppy. Modified: trunk/reactos/drivers/storage/floppy/readwrite.c _____
Modified: trunk/reactos/drivers/storage/floppy/readwrite.c --- trunk/reactos/drivers/storage/floppy/readwrite.c 2005-04-05 17:07:56 UTC (rev 14505) +++ trunk/reactos/drivers/storage/floppy/readwrite.c 2005-04-05 17:12:52 UTC (rev 14506) @@ -654,10 +654,10 @@
KdPrint(("floppy: ReadWritePassive(): computing number of sectors to transfer (StartSector 0x%x): ", StartSector));
/* 1-based sector number */ - if( ((DriveInfo->DiskGeometry.SectorsPerTrack - StartSector) + 1) < + if( (((DriveInfo->DiskGeometry.TracksPerCylinder - Head) * DriveInfo->DiskGeometry.SectorsPerTrack - StartSector) + 1 ) < (Length - TransferByteOffset) / DriveInfo->DiskGeometry.BytesPerSector) { - CurrentTransferSectors = (UCHAR)(DriveInfo->DiskGeometry.SectorsPerTrack - StartSector) + 1; + CurrentTransferSectors = (UCHAR)((DriveInfo->DiskGeometry.TracksPerCylinder - Head) * DriveInfo->DiskGeometry.SectorsPerTrack - StartSector) + 1; } else { @@ -703,7 +703,7 @@
/* Issue the read/write command to the controller. Note that it expects the opposite of WriteToDevice. */ if(HwReadWriteData(DriveInfo->ControllerInfo, !WriteToDevice, DriveInfo->UnitNumber, Cylinder, Head, StartSector, - DriveInfo->BytesPerSectorCode, StartSector + CurrentTransferSectors, 0, 0xff) != STATUS_SUCCESS) + DriveInfo->BytesPerSectorCode, DriveInfo->DiskGeometry.SectorsPerTrack, 0, 0xff) != STATUS_SUCCESS) { KdPrint(("floppy: ReadWritePassive(): HwReadWriteData returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n"));
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);