Commit 40b6ecc6bcfcf38f1d488d58c8407cce0b82b6d1
1 parent
f3ff649d
no need to use LARGE translation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1120 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
7 deletions
hw/pc.c
... | ... | @@ -215,25 +215,25 @@ static void cmos_init(int ram_size, int boot_device, BlockDriverState **hd_table |
215 | 215 | cmos_init_hd(0x1a, 0x24, hd_table[1]); |
216 | 216 | |
217 | 217 | val = 0; |
218 | - for (i = 0; i < 4; i++) | |
218 | + for (i = 0; i < 4; i++) { | |
219 | 219 | if (hd_table[i]) { |
220 | 220 | int cylinders, heads, sectors; |
221 | 221 | uint8_t translation; |
222 | - | |
222 | + /* NOTE: bdrv_get_geometry_hint() returns the geometry | |
223 | + that the hard disk returns. It is always such that: 1 <= | |
224 | + sects <= 63, 1 <= heads <= 16, 1 <= cylinders <= | |
225 | + 16383. The BIOS geometry can be different. */ | |
223 | 226 | bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, §ors); |
224 | 227 | if (cylinders <= 1024 && heads <= 16 && sectors <= 63) { |
225 | 228 | /* No translation. */ |
226 | 229 | translation = 0; |
227 | - } else if (cylinders * heads > 131072) { | |
230 | + } else { | |
228 | 231 | /* LBA translation. */ |
229 | 232 | translation = 1; |
230 | - } else { | |
231 | - /* LARGE translation. */ | |
232 | - translation = 2; | |
233 | 233 | } |
234 | - | |
235 | 234 | val |= translation << (i * 2); |
236 | 235 | } |
236 | + } | |
237 | 237 | rtc_set_memory(s, 0x39, val); |
238 | 238 | |
239 | 239 | /* Disable check of 0x55AA signature on the last two bytes of | ... | ... |