fix for FAT reading

git-svn-id: svn://kolibrios.org@5840 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2015-10-11 12:52:31 +00:00
parent ed1aad3b68
commit 5c1387132a

View File

@ -1843,6 +1843,9 @@ fat_Read:
shr edi, 9 shr edi, 9
add eax, edi add eax, edi
and edx, 511 and edx, 511
cmp ecx, 512
jc .sectorPiece
test edx, edx
jz .alignedSector jz .alignedSector
.sectorPiece: .sectorPiece:
push eax ebx push eax ebx
@ -1870,8 +1873,6 @@ fat_Read:
test ecx, ecx test ecx, ecx
jz .done jz .done
.alignedSector: .alignedSector:
cmp ecx, 512
jc .sectorPiece
shl edi, 9 shl edi, 9
add ecx, edi add ecx, edi
mov edi, [ebp+FAT.SECTORS_PER_CLUSTER] mov edi, [ebp+FAT.SECTORS_PER_CLUSTER]
@ -1899,15 +1900,19 @@ fat_Read:
dec eax dec eax
imul eax, [ebp+FAT.SECTORS_PER_CLUSTER] imul eax, [ebp+FAT.SECTORS_PER_CLUSTER]
add eax, [ebp+FAT.DATA_START] add eax, [ebp+FAT.DATA_START]
sub eax, edx
.readFragment:
push ecx push ecx
mov ecx, eax mov ecx, eax
mov eax, esi
dec eax
dec eax
imul eax, [ebp+FAT.SECTORS_PER_CLUSTER]
add eax, [ebp+FAT.DATA_START]
push eax
.readFragment:
sub ecx, edx
mov eax, edx mov eax, edx
xor edx, edx xor edx, edx
push eax
call fs_read64_app call fs_read64_app
add [esp], ecx
shl ecx, 9 shl ecx, 9
add ebx, ecx add ebx, ecx
test eax, eax test eax, eax
@ -1916,13 +1921,6 @@ fat_Read:
pop ecx pop ecx
xor edx, edx xor edx, edx
jcxz .done jcxz .done
cmp ecx, 512
jc .sectorPiece
mov eax, esi
dec eax
dec eax
imul eax, [ebp+FAT.SECTORS_PER_CLUSTER]
add eax, [ebp+FAT.DATA_START]
jmp .alignedCluster jmp .alignedCluster
.readEnd: .readEnd:
add ecx, edi add ecx, edi
@ -1933,8 +1931,10 @@ fat_Read:
dec eax dec eax
imul eax, [ebp+FAT.SECTORS_PER_CLUSTER] imul eax, [ebp+FAT.SECTORS_PER_CLUSTER]
add eax, [ebp+FAT.DATA_START] add eax, [ebp+FAT.DATA_START]
sub eax, edx
add eax, edi add eax, edi
push ecx
push eax
mov ecx, eax
jmp .readFragment jmp .readFragment
.noaccess3: .noaccess3:
pop eax pop eax