aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-10-12 22:31:09 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-10-12 22:31:09 -0700
commit904fea3db31bda2360a9d3b6fe1cd0ce17c9c0ee (patch)
tree09434b23aa653f4f56365e20b7077a5243f140f6
parentf2330884f94b131481042a5742711f518eac84cf (diff)
downloadsyslinux-904fea3db31bda2360a9d3b6fe1cd0ce17c9c0ee.tar.gz
syslinux-904fea3db31bda2360a9d3b6fe1cd0ce17c9c0ee.tar.xz
syslinux-904fea3db31bda2360a9d3b6fe1cd0ce17c9c0ee.zip
chain.c32: fix conversion from LBA to CHS
Bits [9:8] of the cylinder goes into the top bits of the sector register, not the bottom (and the math for that was wrong, anyway.) Reported-by: Michal Soltys <soltys@ziu.info> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/modules/chain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 6a5b1151..13878c70 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -282,7 +282,7 @@ static void *read_sectors(uint64_t lba, uint8_t count)
inreg.eax.b[0] = count;
inreg.eax.b[1] = 0x02; /* Read */
inreg.ecx.b[1] = c & 0xff;
- inreg.ecx.b[0] = s + (c >> 6);
+ inreg.ecx.b[0] = ((c >> 2) & 0xc0) + s;
inreg.edx.b[1] = h;
inreg.edx.b[0] = disk_info.disk;
inreg.ebx.w[0] = OFFS(buf);