Changeset 3835 in vbox for trunk/src/VBox
- Timestamp:
- Jul 25, 2007 2:16:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r3717 r3835 5498 5498 } 5499 5499 } 5500 /* If there is no geometry, use standard physical disk geometry.5501 * This uses LCHS to LBA translation in the BIOS (which selects5502 * the logical sector count 63 and the logical head count to be5503 * the smallest of 16,32,64,128,255 which makes the logical5504 * cylinder count smaller than 1024 - if that's not possible, it5505 * uses 255 heads, so up to about 8 GByte maximum with the5506 * standard int13 interface, which supports 1024 cylinders). */5507 5500 if (!pIf->cCHSCylinders) 5508 5501 { 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). */ 5509 5509 uint64_t cCHSCylinders = pIf->cTotalSectors / (16 * 63); 5510 5510 pIf->cCHSCylinders = (uint32_t)RT_MAX(cCHSCylinders, 1); … … 5513 5513 /* Set the disk geometry information. */ 5514 5514 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. */ 5515 5525 } 5516 5526 }
Note:
See TracChangeset
for help on using the changeset viewer.