aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-12 21:50:05 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-12 21:50:05 +0000
commit40b6ecc6bcfcf38f1d488d58c8407cce0b82b6d1 (patch)
tree29feaf199bae3796f0581f4c2d8e2cb1cf890c44 /hw/pc.c
parentf3ff649d3bf7c206460faa130d10406d1284bae0 (diff)
downloadqemu-40b6ecc6bcfcf38f1d488d58c8407cce0b82b6d1.zip
qemu-40b6ecc6bcfcf38f1d488d58c8407cce0b82b6d1.tar.gz
qemu-40b6ecc6bcfcf38f1d488d58c8407cce0b82b6d1.tar.bz2
no need to use LARGE translation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1120 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 74b3b8d..cddd136 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -215,25 +215,25 @@ static void cmos_init(int ram_size, int boot_device, BlockDriverState **hd_table
cmos_init_hd(0x1a, 0x24, hd_table[1]);
val = 0;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++) {
if (hd_table[i]) {
int cylinders, heads, sectors;
uint8_t translation;
-
+ /* NOTE: bdrv_get_geometry_hint() returns the geometry
+ that the hard disk returns. It is always such that: 1 <=
+ sects <= 63, 1 <= heads <= 16, 1 <= cylinders <=
+ 16383. The BIOS geometry can be different. */
bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, &sectors);
if (cylinders <= 1024 && heads <= 16 && sectors <= 63) {
/* No translation. */
translation = 0;
- } else if (cylinders * heads > 131072) {
+ } else {
/* LBA translation. */
translation = 1;
- } else {
- /* LARGE translation. */
- translation = 2;
}
-
val |= translation << (i * 2);
}
+ }
rtc_set_memory(s, 0x39, val);
/* Disable check of 0x55AA signature on the last two bytes of