Update Mass Storage bootloader for Linux compatibility, and to reduce the compiled bootloader size. Linux appears to replace files with a cluster offset on the disk rather than re-using the same disk clusters (unlike Windows) so the file offset needs to be tracked and compensated for.

This commit is contained in:
Dean Camera 2013-03-29 10:23:09 +00:00
parent 148b434228
commit 83d5c4729e
3 changed files with 133 additions and 94 deletions

View file

@ -255,10 +255,15 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
}
/* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */
if (IsDataRead == DATA_READ)
VirtualFAT_ReadBlocks(BlockAddress, TotalBlocks);
else
VirtualFAT_WriteBlocks(BlockAddress, TotalBlocks);
while (TotalBlocks--)
{
if (IsDataRead == DATA_READ)
VirtualFAT_ReadBlock(BlockAddress);
else
VirtualFAT_WriteBlock(BlockAddress);
BlockAddress++;
}
/* Update the bytes transferred counter and succeed the command */
MSInterfaceInfo->State.CommandBlock.DataTransferLength -= ((uint32_t)TotalBlocks * SECTOR_SIZE_BYTES);