- Timestamp:
- Oct 17, 2007 5:11:26 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r4787 r5361 772 772 { 773 773 case 0x0101: 774 if (vendor_id == 0x8086 && device_id == 0x7010) { 775 /* PIIX3 IDE */ 774 if (vendor_id == 0x8086 && 775 (device_id == 0x7010 || device_id == 0x7111)) { 776 /* PIIX3 or PIIX4 IDE */ 776 777 pci_config_writew(d, 0x40, 0x8000); /* enable IDE0 */ 777 778 pci_config_writew(d, 0x42, 0x8000); /* enable IDE1 */ -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r4787 r5361 69 69 * The SSM saved state version. 70 70 */ 71 #define ATA_SAVED_STATE_VERSION 1 571 #define ATA_SAVED_STATE_VERSION 16 72 72 73 73 /** The maximum number of release log entries per device. */ … … 378 378 /** Flag whether R0 is enabled. */ 379 379 bool fR0Enabled; 380 /** Flag indicating whether PIIX4 or PIIX3 is being emulated. */ 381 bool fPIIX4; 380 382 bool Alignment0[HC_ARCH_BITS == 64 ? 6 : 2]; /**< Align the struct size. */ 381 383 } PCIATAState; … … 5761 5763 } 5762 5764 } 5765 SSMR3PutBool(pSSMHandle, pData->fPIIX4); 5763 5766 5764 5767 return SSMR3PutU32(pSSMHandle, ~0); /* sanity/terminator */ … … 5880 5883 } 5881 5884 } 5885 SSMR3GetBool(pSSMHandle, &pData->fPIIX4); 5882 5886 5883 5887 rc = SSMR3GetU32(pSSMHandle, &u32); … … 5922 5926 * Validate and read configuration. 5923 5927 */ 5924 if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0IRQDelay\0R0Enabled\0 "))5928 if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0IRQDelay\0R0Enabled\0PIIX4\0")) 5925 5929 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 5926 5930 N_("PIIX3 configuration error: unknown option specified.")); … … 5951 5955 Assert(DelayIRQMillies < 50); 5952 5956 5957 rc = CFGMR3QueryBool(pCfgHandle, "PIIX4", &pData->fPIIX4); 5958 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 5959 pData->fPIIX4 = false; 5960 else if (VBOX_FAILURE(rc)) 5961 return PDMDEV_SET_ERROR(pDevIns, rc, 5962 N_("PIIX3 configuration error: failed to read PIIX4 as boolean.")); 5963 Log(("%s: fPIIX4=%d\n", __FUNCTION__, pData->fPIIX4)); 5964 5953 5965 /* 5954 5966 * Initialize data (most of it anyway). … … 5961 5973 pData->dev.config[0x00] = 0x86; /* Vendor: Intel */ 5962 5974 pData->dev.config[0x01] = 0x80; 5963 pData->dev.config[0x02] = 0x10; /* Device: PIIX3 IDE */ 5964 pData->dev.config[0x03] = 0x70; 5975 if (pData->fPIIX4) 5976 { 5977 pData->dev.config[0x02] = 0x11; /* Device: PIIX4 IDE */ 5978 pData->dev.config[0x03] = 0x71; 5979 pData->dev.config[0x08] = 0x01; /* Revision: PIIX4E */ 5980 pData->dev.config[0x48] = 0x00; /* UDMACTL */ 5981 pData->dev.config[0x4A] = 0x00; /* UDMATIM */ 5982 pData->dev.config[0x4B] = 0x00; 5983 } 5984 else 5985 { 5986 pData->dev.config[0x02] = 0x10; /* Device: PIIX3 IDE */ 5987 pData->dev.config[0x03] = 0x70; 5988 } 5965 5989 pData->dev.config[0x04] = PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS | PCI_COMMAND_BUSMASTER; 5966 5990 pData->dev.config[0x09] = 0x8a; /* programming interface = PCI_IDE bus master is supported */ -
trunk/src/VBox/Main/BIOSSettingsImpl.cpp
r5171 r5361 405 405 } 406 406 407 STDMETHODIMP BIOSSettings::COMGETTER(IDEControllerType)(IDEControllerType_T *aControllerType) 408 { 409 if (!aControllerType) 410 return E_POINTER; 411 412 AutoCaller autoCaller (this); 413 CheckComRCReturnRC (autoCaller.rc()); 414 415 AutoReaderLock alock (this); 416 417 *aControllerType = mData->mIDEControllerType; 418 419 return S_OK; 420 } 421 422 STDMETHODIMP BIOSSettings::COMSETTER(IDEControllerType)(IDEControllerType_T aControllerType) 423 { 424 AutoCaller autoCaller (this); 425 CheckComRCReturnRC (autoCaller.rc()); 426 427 /* the machine needs to be mutable */ 428 Machine::AutoMutableStateDependency adep (mParent); 429 CheckComRCReturnRC (adep.rc()); 430 431 AutoLock alock (this); 432 433 /* make sure the value is allowed */ 434 switch (aControllerType) 435 { 436 case IDEControllerType_IDEControllerPIIX3: 437 case IDEControllerType_IDEControllerPIIX4: 438 break; 439 default: 440 return setError (E_FAIL, 441 tr("Invalid IDE controller type '%d'"), 442 aControllerType); 443 } 444 445 mData.backup(); 446 447 mData->mIDEControllerType = aControllerType; 448 449 return S_OK; 450 } 451 407 452 STDMETHODIMP BIOSSettings::COMGETTER(TimeOffset)(LONG64 *offset) 408 453 { -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r5332 r5361 174 174 175 175 /* 176 * Virtual IDE controller type. 177 */ 178 IDEControllerType_T controllerType; 179 BOOL fPIIX4; 180 hrc = biosSettings->COMGETTER(IDEControllerType)(&controllerType); H(); 181 switch (controllerType) 182 { 183 case IDEControllerType_IDEControllerPIIX3: 184 fPIIX4 = FALSE; 185 break; 186 case IDEControllerType_IDEControllerPIIX4: 187 fPIIX4 = TRUE; 188 break; 189 default: 190 AssertMsgFailed(("Invalid IDE controller type '%d'", controllerType)); 191 return VERR_INVALID_PARAMETER; 192 } 193 194 /* 176 195 * PDM config. 177 196 * Load drivers in VBoxC.[so|dll] … … 553 572 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 1); RC_CHECK(); 554 573 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 574 rc = CFGMR3InsertInteger(pCfg, "PIIX4", fPIIX4); /* boolean */ RC_CHECK(); 555 575 556 576 /* Attach the status driver */ -
trunk/src/VBox/Main/MachineImpl.cpp
r5292 r5361 4412 4412 } 4413 4413 } 4414 4415 /* IDE controller type (optional, defaults to PIIX3) */ 4416 { 4417 CFGNODE ideControllerNode = 0; 4418 IDEControllerType_T controllerType = IDEControllerType_IDEControllerPIIX3; 4419 CFGLDRGetChildNode (biosNode, "IDEController", 0, &ideControllerNode); 4420 if (ideControllerNode) 4421 { 4422 Bstr IDEControllerType; 4423 4424 CFGLDRQueryBSTR (ideControllerNode, "type", IDEControllerType.asOutParam()); 4425 ComAssertBreak (IDEControllerType, rc = E_FAIL); 4426 4427 if (IDEControllerType.compare(Bstr("PIIX3")) == 0) 4428 controllerType = IDEControllerType_IDEControllerPIIX3; 4429 else if (IDEControllerType.compare(Bstr("PIIX4")) == 0) 4430 controllerType = IDEControllerType_IDEControllerPIIX4; 4431 else 4432 ComAssertBreak (0, rc = E_FAIL); 4433 4434 CFGLDRReleaseNode (ideControllerNode); 4435 } 4436 mBIOSSettings->COMSETTER(IDEControllerType)(controllerType); 4437 } 4438 4414 4439 } 4415 4440 while (0); … … 6334 6359 CFGLDRSetBool (pxedebugNode, "enabled", !!fSet); 6335 6360 CFGLDRReleaseNode (pxedebugNode); 6361 6362 /* IDE controller type */ 6363 CFGNODE ideControllerNode = 0; 6364 IDEControllerType_T controllerType; 6365 CFGLDRCreateChildNode (biosNode, "IDEController", &ideControllerNode); 6366 mBIOSSettings->COMGETTER(IDEControllerType)(&controllerType); 6367 switch (controllerType) 6368 { 6369 case IDEControllerType_IDEControllerPIIX3: 6370 CFGLDRSetString (ideControllerNode, "type", "PIIX3"); 6371 break; 6372 case IDEControllerType_IDEControllerPIIX4: 6373 CFGLDRSetString (ideControllerNode, "type", "PIIX4"); 6374 break; 6375 default: 6376 ComAssertMsgFailedBreak (("Invalid IDE Controller type: %d\n", 6377 controllerType), rc = E_FAIL); 6378 } 6379 CFGLDRReleaseNode (ideControllerNode); 6336 6380 6337 6381 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r5292 r5361 2042 2042 </enum> 2043 2043 2044 <enum 2045 name="IDEControllerType" 2046 uuid="445330e3-202a-4dab-854f-ce22e6cb9715" 2047 > 2048 <const name="InvalidIDEControllerType" value="0"/> 2049 <const name="IDEControllerPIIX3" value="1"/> 2050 <const name="IDEControllerPIIX4" value="2"/> 2051 </enum> 2052 2044 2053 <interface 2045 2054 name="IBIOSSettings" extends="$unknown" … … 2092 2101 PXE debug logging flag. If set, VirtualBox will write extensive 2093 2102 PXE trace information to the release log. 2103 </desc> 2104 </attribute> 2105 2106 <attribute name="IDEControllerType" type="IDEControllerType"> 2107 <desc> 2108 Type of the virtual IDE controller. Depending on this value, 2109 VirtualBox will provide different virtual IDE hardware 2110 devices to the guest. 2094 2111 </desc> 2095 2112 </attribute> -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r5171 r5361 43 43 mPXEDebugEnabled = false; 44 44 mTimeOffset = 0; 45 mIDEControllerType = IDEControllerType_IDEControllerPIIX4; 45 46 } 46 47 … … 59 60 } 60 61 61 BOOL mLogoFadeIn; 62 BOOL mLogoFadeOut; 63 ULONG mLogoDisplayTime; 64 Bstr mLogoImagePath; 65 BIOSBootMenuMode_T mBootMenuMode; 66 BOOL mACPIEnabled; 67 BOOL mIOAPICEnabled; 68 BOOL mPXEDebugEnabled; 69 LONG64 mTimeOffset; 62 BOOL mLogoFadeIn; 63 BOOL mLogoFadeOut; 64 ULONG mLogoDisplayTime; 65 Bstr mLogoImagePath; 66 BIOSBootMenuMode_T mBootMenuMode; 67 BOOL mACPIEnabled; 68 BOOL mIOAPICEnabled; 69 BOOL mPXEDebugEnabled; 70 LONG64 mTimeOffset; 71 IDEControllerType_T mIDEControllerType; 70 72 }; 71 73 … … 106 108 STDMETHOD(COMGETTER(PXEDebugEnabled))(BOOL *enabled); 107 109 STDMETHOD(COMSETTER(PXEDebugEnabled))(BOOL enable); 110 STDMETHOD(COMGETTER(IDEControllerType))(IDEControllerType_T *controllerType); 111 STDMETHOD(COMSETTER(IDEControllerType))(IDEControllerType_T controllerType); 108 112 STDMETHOD(COMGETTER)(TimeOffset)(LONG64 *offset); 109 113 STDMETHOD(COMSETTER)(TimeOffset)(LONG64 offset); -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r5171 r5361 189 189 <xsd:enumeration value="messageandmenu"/> 190 190 </xsd:restriction> 191 </xsd:simpleType> 192 193 <xsd:simpleType name="TIDEControllerType"> 194 <xsd:restriction base="xsd:string"> 195 <xsd:enumeration value="PIIX3"/> 196 <xsd:enumeration value="PIIX4"/> 197 </xsd:restriction> 191 198 </xsd:simpleType> 192 199 … … 470 477 </xsd:complexType> 471 478 </xsd:element> 479 <xsd:element name="IDEController" minOccurs="0"> 480 <xsd:complexType> 481 <xsd:attribute name="type" use="required" type="TIDEControllerType"/> 482 </xsd:complexType> 483 </xsd:element> 472 484 </xsd:all> 473 485 </xsd:complexType>
Note:
See TracChangeset
for help on using the changeset viewer.