- Timestamp:
- Jan 8, 2025 9:17:26 AM (11 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r106061 r107483 638 638 cLCHSHeads = iEndHead + 1; 639 639 cLCHSSectors = iEndSector; 640 cLCHSCylinders = RT_MIN(1024, pMedia->pfnGetSize(pMedia) / (512 * cLCHSHeads * cLCHSSectors)); 640 641 uint64_t const cbMedia = pMedia->pfnGetSize(pMedia); 642 cLCHSCylinders = RT_MIN(1024, cbMedia / (512 * cLCHSHeads * cLCHSSectors)); 641 643 if (cLCHSCylinders >= 1) 642 644 { … … 1082 1084 AssertRC(rc2); 1083 1085 1084 if (i < 4) 1086 Assert(i < 4); 1087 /* Award BIOS extended drive types for first to fourth disk. 1088 * Used by the BIOS for setting the logical geometry. */ 1089 int offType, offInfo; 1090 switch (i) 1085 1091 { 1086 /* Award BIOS extended drive types for first to fourth disk. 1087 * Used by the BIOS for setting the logical geometry. */ 1088 int offType, offInfo; 1089 switch (i) 1090 { 1091 case 0: 1092 offType = 0x19; 1093 offInfo = 0x1e; 1094 break; 1095 case 1: 1096 offType = 0x1a; 1097 offInfo = 0x26; 1098 break; 1099 case 2: 1100 offType = 0x00; 1101 offInfo = 0x67; 1102 break; 1103 case 3: 1104 default: 1105 offType = 0x00; 1106 offInfo = 0x70; 1107 break; 1108 } 1109 pcbiosCmosInitHardDisk(pDevIns, offType, offInfo, &LCHSGeometry); 1110 if (i < 2) 1111 pcbiosCmosTryPCATHardDisk(pDevIns, i, &LCHSGeometry); 1092 case 0: 1093 offType = 0x19; 1094 offInfo = 0x1e; 1095 break; 1096 case 1: 1097 offType = 0x1a; 1098 offInfo = 0x26; 1099 break; 1100 case 2: 1101 offType = 0x00; 1102 offInfo = 0x67; 1103 break; 1104 case 3: 1105 default: 1106 offType = 0x00; 1107 offInfo = 0x70; 1108 break; 1112 1109 } 1110 pcbiosCmosInitHardDisk(pDevIns, offType, offInfo, &LCHSGeometry); 1111 if (i < 2) 1112 pcbiosCmosTryPCATHardDisk(pDevIns, i, &LCHSGeometry); 1113 1113 1114 LogRel(("PcBios: ATA LUN#%d LCHS=%u/%u/%u\n", i, LCHSGeometry.cCylinders, LCHSGeometry.cHeads, LCHSGeometry.cSectors)); 1114 1115 } … … 1140 1141 AssertRC(rc); 1141 1142 1142 if (i < 4) 1143 Assert(i < 4); 1144 /* Award BIOS extended drive types for first to fourth disk. 1145 * Used by the BIOS for setting the logical geometry. */ 1146 int offInfo; 1147 switch (i) 1143 1148 { 1144 /* Award BIOS extended drive types for first to fourth disk. 1145 * Used by the BIOS for setting the logical geometry. */ 1146 int offInfo; 1147 switch (i) 1148 { 1149 case 0: 1150 offInfo = 0x40; 1151 break; 1152 case 1: 1153 offInfo = 0x48; 1154 break; 1155 case 2: 1156 offInfo = 0x50; 1157 break; 1158 case 3: 1159 default: 1160 offInfo = 0x58; 1161 break; 1162 } 1163 pcbiosCmosInitHardDisk(pDevIns, 0x00, offInfo, 1164 &LCHSGeometry); 1149 case 0: 1150 offInfo = 0x40; 1151 break; 1152 case 1: 1153 offInfo = 0x48; 1154 break; 1155 case 2: 1156 offInfo = 0x50; 1157 break; 1158 case 3: 1159 default: 1160 offInfo = 0x58; 1161 break; 1165 1162 } 1163 pcbiosCmosInitHardDisk(pDevIns, 0x00, offInfo, 1164 &LCHSGeometry); 1165 1166 1166 LogRel(("PcBios: SATA LUN#%d LCHS=%u/%u/%u\n", i, LCHSGeometry.cCylinders, LCHSGeometry.cHeads, LCHSGeometry.cSectors)); 1167 1167 } … … 1193 1193 rc = getLogicalDiskGeometry(apHDs[i], &LCHSGeometry); 1194 1194 1195 if ( i < 4 &&RT_SUCCESS(rc))1195 if (RT_SUCCESS(rc)) 1196 1196 { 1197 Assert(i < 4); 1198 1197 1199 /* Extended drive information (for SCSI disks). 1198 1200 * Used by the BIOS for setting the logical geometry, but … … 1577 1579 NULL, pcbiosSaveExec, NULL, 1578 1580 pcbiosLoadPrep, pcbiosLoadExec, pcbiosLoadDone); 1581 AssertRCReturn(rc, rc); 1579 1582 1580 1583 /* Clear the net boot device list. All bits set invokes old behavior,
Note:
See TracChangeset
for help on using the changeset viewer.