/[qemu]/qemu/hw/pc.c
ViewVC logotype

Diff of /qemu/hw/pc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by bellard, Tue Nov 9 23:08:30 2004 UTC revision 1.33 by bellard, Tue Nov 16 01:45:27 2004 UTC
# Line 217  static void cmos_init(int ram_size, int Line 217  static void cmos_init(int ram_size, int
217      val = 0;      val = 0;
218      for (i = 0; i < 4; i++) {      for (i = 0; i < 4; i++) {
219          if (hd_table[i]) {          if (hd_table[i]) {
220              int cylinders, heads, sectors;              int cylinders, heads, sectors, translation;
221              uint8_t translation;              /* NOTE: bdrv_get_geometry_hint() returns the physical
222              /* NOTE: bdrv_get_geometry_hint() returns the geometry                  geometry.  It is always such that: 1 <= sects <= 63, 1
223                 that the hard disk returns. It is always such that: 1 <=                  <= heads <= 16, 1 <= cylinders <= 16383. The BIOS
224                 sects <= 63, 1 <= heads <= 16, 1 <= cylinders <=                  geometry can be different if a translation is done. */
225                 16383. The BIOS geometry can be different. */              translation = bdrv_get_translation_hint(hd_table[i]);
226              bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, &sectors);              if (translation == BIOS_ATA_TRANSLATION_AUTO) {
227              if (cylinders <= 1024 && heads <= 16 && sectors <= 63) {                  bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, &sectors);
228                  /* No translation. */                  if (cylinders <= 1024 && heads <= 16 && sectors <= 63) {
229                  translation = 0;                      /* No translation. */
230                        translation = 0;
231                    } else {
232                        /* LBA translation. */
233                        translation = 1;
234                    }
235              } else {              } else {
236                  /* LBA translation. */                  translation--;
                 translation = 1;  
237              }              }
238              val |= translation << (i * 2);              val |= translation << (i * 2);
239          }          }

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26