VirtualBox

Changeset 1737 in vbox


Ignore:
Timestamp:
Mar 27, 2007 4:15:38 PM (18 years ago)
Author:
vboxsync
Message:

Fixed a couple off-by-one errors in the CHS handling part
(double-checked with Ralf Brown's interrupt list).

File:
1 edited

Legend:

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

    r1694 r1737  
    52945294      count = read_byte(ebda_seg, &EbdaData->ata.hdcount);
    52955295
     5296#ifndef VBOX
    52965297      nlc = nlc - 2; /* 0 based , last sector not used */
     5298#else /* VBOX */
     5299      /* Maximum cylinder number is just one less than the number of cylinders. */
     5300      nlc = nlc - 1; /* 0 based , last sector not used */
     5301#endif /* VBOX */
    52975302      SET_AL(0);
    52985303      SET_CH(nlc & 0xff);
     
    53285333
    53295334      // Compute sector count seen by int13
     5335#ifndef VBOX
    53305336      lba = (Bit32u)(npc - 1) * (Bit32u)nph * (Bit32u)npspt;
     5337#else /* VBOX */
     5338      /* Is it so hard to multiply a couple of counts (without introducing
     5339       * arbitrary off by one errors)? */
     5340      lba = (Bit32u)npc * (Bit32u)nph * (Bit32u)npspt;
     5341#endif /* VBOX */
    53315342      CX = lba >> 16;
    53325343      DX = lba & 0xffff;
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