aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-25 17:58:25 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-25 17:58:25 +0000
commit1b8eb456ebd74aefeca5eb5204e85582b59f581e (patch)
treed89a947694672ca22f9431a6ec338d708954ba1b
parentd720b93d0bcfe1beb729245b9ed1e5f071a24bd5 (diff)
avoid error if too many sectors in non LBA mode
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@746 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/ide.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ide.c b/hw/ide.c
index f5efa8eb1e..0bef2888e3 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -517,7 +517,7 @@ static void ide_set_sector(IDEState *s, int64_t sector_num)
r = sector_num % (s->heads * s->sectors);
s->hcyl = cyl >> 8;
s->lcyl = cyl;
- s->select = (s->select & 0xf0) | (r / s->sectors);
+ s->select = (s->select & 0xf0) | ((r / s->sectors) & 0x0f);
s->sector = (r % s->sectors) + 1;
}
}