[syslinux:master] ldlinux: fix FAT EOF detection
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Mon Jan 25 09:45:17 PST 2010
Commit-ID: dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69
Gitweb: http://syslinux.zytor.com/commit/dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 25 Jan 2010 09:34:08 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 25 Jan 2010 09:34:08 -0800
ldlinux: fix FAT EOF detection
We had the wrong highest possible cluster for the FAT; adjust it so
that it matches the definition.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
core/ldlinux.asm | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index ba7e804..70f9c71 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -1242,7 +1242,8 @@ nextcluster_fat12:
shr cx,4
.even: and cx,0FFFh
movzx edi,cx
- cmp di,0FF0h
+ lea ax,[di-2]
+ cmp ax,0FF5h
pop si
pop cx
pop bx
@@ -1264,7 +1265,8 @@ nextcluster_fat16:
add bx,bx
and bx,1FEh
movzx edi,word [gs:si+bx]
- cmp di,0FFF0h
+ lea ax,[di-2]
+ cmp ax,0FFF5h
pop bx
pop si
pop eax
@@ -1285,7 +1287,8 @@ nextcluster_fat28:
and bx,1FCh
mov edi,dword [gs:si+bx]
and edi,0FFFFFFFh ; 28 bits only
- cmp edi,0FFFFFF0h
+ lea eax,[edi-2]
+ cmp eax,0FFFFFF5h
pop bx
pop si
pop eax
More information about the Syslinux-commits
mailing list