- Timestamp:
- Sep 27, 2013 6:21:23 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r48721 r48744 3021 3021 if (pAhciPort->cbSector != 512) 3022 3022 { 3023 uint32_t cSectorSizeInWords = pAhciPort->cbSector / sizeof(uint16_t); 3023 3024 /* Enable reporting of logical sector size. */ 3024 p[106] |= RT_H2LE_U16(RT_BIT(12) );3025 p[117] = RT_H2LE_U16( pAhciPort->cbSector);3026 p[118] = RT_H2LE_U16( pAhciPort->cbSector>> 16);3025 p[106] |= RT_H2LE_U16(RT_BIT(12) | RT_BIT(14)); 3026 p[117] = RT_H2LE_U16(cSectorSizeInWords); 3027 p[118] = RT_H2LE_U16(cSectorSizeInWords >> 16); 3027 3028 } 3028 3029 -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r48721 r48744 1211 1211 p[3] = RT_H2LE_U16(s->PCHSGeometry.cHeads); 1212 1212 /* Block size; obsolete, but required for the BIOS. */ 1213 p[5] = RT_H2LE_U16( 512);1213 p[5] = RT_H2LE_U16(s->cbSector); 1214 1214 p[6] = RT_H2LE_U16(s->PCHSGeometry.cSectors); 1215 1215 ataPadString((uint8_t *)(p + 10), s->szSerialNumber, ATA_SERIAL_NUMBER_LENGTH); /* serial number */ … … 1292 1292 if (s->cbSector != 512) 1293 1293 { 1294 uint32_t cSectorSizeInWords = s->cbSector / sizeof(uint16_t); 1294 1295 /* Enable reporting of logical sector size. */ 1295 p[106] |= RT_H2LE_U16(RT_BIT(12) );1296 p[117] = RT_H2LE_U16( s->cbSector);1297 p[118] = RT_H2LE_U16( s->cbSector>> 16);1296 p[106] |= RT_H2LE_U16(RT_BIT(12) | RT_BIT(14)); 1297 p[117] = RT_H2LE_U16(cSectorSizeInWords); 1298 p[118] = RT_H2LE_U16(cSectorSizeInWords >> 16); 1298 1299 } 1299 1300 … … 1633 1634 bool fRedo; 1634 1635 1635 cSectors = s->cbElementaryTransfer / 512;1636 cSectors = s->cbElementaryTransfer / s->cbSector; 1636 1637 Assert(cSectors); 1637 1638 iLBA = ataGetSector(s); … … 1671 1672 bool fRedo; 1672 1673 1673 cSectors = s->cbElementaryTransfer / 512;1674 cSectors = s->cbElementaryTransfer / s->cbSector; 1674 1675 Assert(cSectors); 1675 1676 iLBA = ataGetSector(s); … … 3799 3800 pIf->cTotalSectors = pIf->pDrvBlock->pfnGetSize(pIf->pDrvBlock) / 2048; 3800 3801 else 3801 pIf->cTotalSectors = pIf->pDrvBlock->pfnGetSize(pIf->pDrvBlock) / 512;3802 pIf->cTotalSectors = pIf->pDrvBlock->pfnGetSize(pIf->pDrvBlock) / pIf->cbSector; 3802 3803 3803 3804 LogRel(("PIIX3 ATA: LUN#%d: CD/DVD, total number of sectors %Ld, passthrough unchanged\n", pIf->iLUN, pIf->cTotalSectors)); … … 4213 4214 goto abort_cmd; 4214 4215 s->fDMA = true; 4215 ataStartTransfer(s, (s->uATARegNSectorHOB << 8 | s->uATARegNSector) * 512, PDMBLOCKTXDIR_TO_DEVICE, ATAFN_BT_NULL, ATAFN_SS_TRIM, false);4216 ataStartTransfer(s, (s->uATARegNSectorHOB << 8 | s->uATARegNSector) * s->cbSector, PDMBLOCKTXDIR_TO_DEVICE, ATAFN_BT_NULL, ATAFN_SS_TRIM, false); 4216 4217 break; 4217 4218 default: -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r47829 r48744 1621 1621 LogFlowFunc(("\n")); 1622 1622 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface); 1623 uint32_t cb = 512;1623 uint32_t cb = VDGetSectorSize(pThis->pDisk, VD_LAST_IMAGE); 1624 1624 LogFlowFunc(("returns %u\n", cb)); 1625 1625 return cb;
Note:
See TracChangeset
for help on using the changeset viewer.