VirtualBox

Changeset 3835 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 25, 2007 2:16:54 PM (18 years ago)
Author:
vboxsync
Message:

Attempt to fix VMDK geometry problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r3717 r3835  
    54985498                }
    54995499            }
    5500             /* If there is no geometry, use standard physical disk geometry.
    5501              * This uses LCHS to LBA translation in the BIOS (which selects
    5502              * the logical sector count 63 and the logical head count to be
    5503              * the smallest of 16,32,64,128,255 which makes the logical
    5504              * cylinder count smaller than 1024 - if that's not possible, it
    5505              * uses 255 heads, so up to about 8 GByte maximum with the
    5506              * standard int13 interface, which supports 1024 cylinders). */
    55075500            if (!pIf->cCHSCylinders)
    55085501            {
     5502                /* If there is no geometry, use standard physical disk geometry.
     5503                 * This uses LCHS to LBA translation in the BIOS (which selects
     5504                 * the logical sector count 63 and the logical head count to be
     5505                 * the smallest of 16,32,64,128,255 which makes the logical
     5506                 * cylinder count smaller than 1024 - if that's not possible, it
     5507                 * uses 255 heads, so up to about 8 GByte maximum with the
     5508                 * standard int13 interface, which supports 1024 cylinders). */
    55095509                uint64_t cCHSCylinders = pIf->cTotalSectors / (16 * 63);
    55105510                pIf->cCHSCylinders = (uint32_t)RT_MAX(cCHSCylinders, 1);
     
    55135513                /* Set the disk geometry information. */
    55145514                rc = pIf->pDrvBlockBios->pfnSetGeometry(pIf->pDrvBlockBios, pIf->cCHSCylinders, pIf->cCHSHeads, pIf->cCHSSectors);
     5515            }
     5516            else if (enmTranslation == PDMBIOSTRANSLATION_LBA)
     5517            {
     5518                /* Use the official LBA physical CHS geometry. */
     5519                uint64_t cCHSCylinders = pIf->cTotalSectors / (16 * 63);
     5520                pIf->cCHSCylinders = RT_MAX((uint32_t)RT_MIN(cCHSCylinders, 16383), 1);
     5521                pIf->cCHSHeads = 16;
     5522                pIf->cCHSSectors = 63;
     5523                /* DO NOT write back the disk geometry information. This
     5524                 * intentionally sets the ATA geometry only. */
    55155525            }
    55165526        }
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