VirtualBox

Changeset 6294 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Jan 9, 2008 12:59:12 PM (17 years ago)
Author:
vboxsync
Message:

Fixed last-minute BIOS bug caused by changing the CMOS CHS geometry format from AMI to Award.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r6291 r6294  
    24552455          lspt = 0;
    24562456      }
     2457      BX_INFO("ata%d-%d: PCHS=%u/%d/%d LCHS=%u/%u/%u\n", channel, slave, cylinders, heads, spt, lcylinders, lheads, lspt);
    24572458#endif /* VBOX */
    24582459
     
    24692470      write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.cylinders, lcylinders);
    24702471      write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.spt, lspt);
     2472      if (device < 2)
     2473      {
     2474          Bit8u sum, i;
     2475          unsigned char *fdpt;
     2476          if (device == 0)
     2477              fdpt = &EbdaData->fdpt0;
     2478          else
     2479              fdpt = &EbdaData->fdpt1;
     2480
     2481          /* Update the DPT for drive 0/1 pointed to by Int41/46. This used
     2482           * to be done at POST time with lots of ugly assembler code, which
     2483           * isn't worth the effort of converting from AMI to Award CMOS
     2484           * format. Just do it here. */
     2485          write_word(ebda_seg, fdpt + 0x00, lcylinders);
     2486          write_byte(ebda_seg, fdpt + 0x02, lheads);
     2487          write_byte(ebda_seg, fdpt + 0x0e, lspt);
     2488          write_word(ebda_seg, fdpt + 0x09, cylinders);
     2489          write_byte(ebda_seg, fdpt + 0x0b, heads);
     2490          write_byte(ebda_seg, fdpt + 0x04, spt);
     2491          write_byte(ebda_seg, fdpt + 0x03, 0xa0);
     2492          sum = 0;
     2493          for (i = 0; i < 0xf; i++)
     2494              sum += read_byte(ebda_seg, fdpt + i);
     2495          sum = 1 - sum;
     2496          write_byte(ebda_seg, fdpt + 0x0f, sum);
     2497      }
    24712498#else /* !VBOX */
    24722499      BX_INFO("ata%d-%d: PCHS=%u/%d/%d translation=", channel, slave,cylinders, heads, spt);
     
    89779004  SET_INT_VECTOR(0x46, #EBDA_SEG, #0x004D)
    89789005
     9006#ifndef VBOX /* This is done later (and the CMOS format is now different). */
    89799007  ;; move disk geometry data from CMOS to EBDA disk parameter table(s)
    89809008  mov  al, #0x12
     
    92589286  mov   [si], al
    92599287;;; Done filling EBDA table for hard disk 1.
     9288#endif /* !VBOX */
    92609289
    92619290  ret
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette