- Timestamp:
- Mar 8, 2009 8:52:07 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r17540 r17542 23 23 #include <VBox/pdmdev.h> 24 24 #include <VBox/log.h> 25 #include <VBox/param.h> 25 26 #include <iprt/assert.h> 26 27 #include <iprt/asm.h> … … 567 568 568 569 /* Simple acpiChecksum: all the bytes must add up to 0. */ 569 static uint8_t acpiChecksum (const uint8_t * const data, uint32_t len)570 static uint8_t acpiChecksum (const uint8_t * const data, size_t len) 570 571 { 571 572 uint8_t sum = 0; … … 706 707 return PDMDEV_SET_ERROR(s->pDevIns, VERR_NO_TMP_MEMORY, N_("Cannot allocate RSDT")); 707 708 708 acpiPrepareHeader (&rsdt->header, "RSDT", size, 1);709 acpiPrepareHeader (&rsdt->header, "RSDT", (uint32_t)size, 1); 709 710 for (unsigned int i = 0; i < nb_entries; ++i) 710 711 { … … 728 729 return VERR_NO_TMP_MEMORY; 729 730 730 acpiPrepareHeader (&xsdt->header, "XSDT", size, 1 /* according to ACPI 3.0 specs */);731 acpiPrepareHeader (&xsdt->header, "XSDT", (uint32_t)size, 1 /* according to ACPI 3.0 specs */); 731 732 for (unsigned int i = 0; i < nb_entries; ++i) 732 733 { … … 1723 1724 "\"RamSize\" as integer failed")); 1724 1725 1725 #if 1 /** @todo 4GB: This needs fixing! (disable to test lots of memory) */ 1726 uint32_t cbRamHole; 1727 rc = CFGMR3QueryU32Def (s->pDevIns->pCfgHandle, "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT); 1728 if (RT_FAILURE (rc)) 1729 return PDMDEV_SET_ERROR (s->pDevIns, rc, 1730 N_ ("Configuration error: Querying \"RamHoleSize\" as integer failed")); 1731 const uint64_t offRamHole = _4G - cbRamHole; 1732 1733 #if 0 /** @todo 4GB: This needs adjusting fixing! I've disabled it to test big mem configs. */ 1726 1734 if (s->u64RamSize > (0xffffffff - 0x10000)) 1727 1735 return PDMDEV_SET_ERROR(s->pDevIns, VERR_OUT_OF_RANGE, … … 1758 1766 1759 1767 Log(("RSDP 0x%08X\n", find_rsdp_space())); 1768 #if 1 /** @todo 4GB: Quick hack, may need revising. */ 1769 addend = (uint32_t) RT_MIN (s->u64RamSize, offRamHole) - 0x10000; 1770 #else 1760 1771 addend = (uint32_t) s->u64RamSize - 0x10000; 1772 #endif 1761 1773 Log(("RSDT 0x%08X XSDT 0x%08X\n", rsdt_addr + addend, xsdt_addr + addend)); 1762 1774 Log(("FACS 0x%08X FADT 0x%08X\n", facs_addr + addend, fadt_addr + addend)); … … 1805 1817 if (!CFGMR3AreValuesValid (pCfgHandle, 1806 1818 "RamSize\0" 1819 "RamHoleSize\0" 1807 1820 "IOAPIC\0" 1808 1821 "NumCPUs\0" -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r15366 r17542 137 137 /** Boot devices (ordered). */ 138 138 DEVPCBIOSBOOT aenmBootDevice[4]; 139 /** R am Size (in bytes). */139 /** RAM size (in bytes). */ 140 140 uint64_t cbRam; 141 /** RAM hole size (in bytes). */ 142 uint32_t cbRamHole; 141 143 /** Bochs shutdown index. */ 142 144 uint32_t iShutdown; … … 581 583 pcbiosCmosWrite(pDevIns, 0x31, u32 >> 8); /* 31h - Extended Memory in K, High Byte */ 582 584 583 /* Bochs BIOS specific? Anyway, it's the amount of memory above 16MB */ 585 /* Bochs BIOS specific? Anyway, it's the amount of memory above 16MB 586 and below 4GB (as it can only hold 4GB+16M). */ 587 uint64_t const offRamHole = _4G - pThis->cbRamHole; 584 588 if (pThis->cbRam > 16 * _1M) 585 589 { 586 u32 = (uint32_t)( ( pThis->cbRam- 16 * _1M) / _64K );590 u32 = (uint32_t)( (RT_MIN(pThis->cbRam, offRamHole) - 16 * _1M) / _64K ); 587 591 u32 = RT_MIN(u32, 0xffff); 588 592 } … … 591 595 pcbiosCmosWrite(pDevIns, 0x34, u32 & 0xff); 592 596 pcbiosCmosWrite(pDevIns, 0x35, u32 >> 8); 597 598 # if 0 /** @todo Report the amount above 4GB and make sure the BIOS is only using 34/35 for the bits below 4GB. */ 599 /* Suggestion: MBs above 4GB, reserve 4 CMOS entries (need 3 now), means a 600 total around 2**52 bytes or 4EB if you like. The max of what 601 AMD64 is currently specified for IIRC. */ 602 if (pThis->cbRam <= offRamHole) 603 u32 = 0; 604 else 605 { 606 u32 = (pThis->cbRam - offRamHole) / _1M; 607 AssertMsg((uint64_t)u32 * _1M + offRamHole == pThis->cbRam, ("%RX64 %RX64\n", pThis->cbRam, offRamHole)); 608 } 609 pcbiosCmosWrite(pDevIns, 0xY0, u32 & 0xff); 610 pcbiosCmosWrite(pDevIns, 0xY1, (u32 >> 8) & 0xff); 611 pcbiosCmosWrite(pDevIns, 0xY2, (u32 >> 16) & 0xff); 612 pcbiosCmosWrite(pDevIns, 0xY3, u32 >> 24); 613 # endif 593 614 #endif /* old code */ 594 615 … … 1360 1381 "BootDevice3\0" 1361 1382 "RamSize\0" 1383 "RamHoleSize\0" 1362 1384 "HardDiskDevice\0" 1363 1385 "SataHardDiskDevice\0" … … 1398 1420 N_("Configuration error: Querying \"RamSize\" as integer failed")); 1399 1421 1422 rc = CFGMR3QueryU32Def(pCfgHandle, "RamHoleSize", &pThis->cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT); 1423 if (RT_FAILURE(rc)) 1424 return PDMDEV_SET_ERROR(pDevIns, rc, 1425 N_("Configuration error: Querying \"RamHoleSize\" as integer failed")); 1426 1400 1427 rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &pThis->cCpus, 1); 1401 1428 if (RT_FAILURE(rc)) … … 1404 1431 1405 1432 #ifdef VBOX_WITH_SMP_GUESTS 1406 LogRel(("[SMP] BIOS with % dCPUs\n", pThis->cCpus));1433 LogRel(("[SMP] BIOS with %u CPUs\n", pThis->cCpus)); 1407 1434 #else 1408 /* @todo: move this check up in configuration chain */1435 /** @todo: move this check up in configuration chain */ 1409 1436 if (pThis->cCpus != 1) 1410 1437 { -
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r16646 r17542 1386 1386 rc = CFGMR3InsertString(pRoot, "Name", "Default VM"); UPDATE_RC(); 1387 1387 rc = CFGMR3InsertInteger(pRoot, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1388 rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", 512U * _1M); UPDATE_RC(); 1388 1389 if (g_fPreAllocRam) 1389 1390 { … … 1437 1438 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1438 1439 rc = CFGMR3InsertInteger(pCfg, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1440 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", 512U * _1M); UPDATE_RC(); 1439 1441 rc = CFGMR3InsertString(pCfg, "BootDevice0", g_pszBootDevice); UPDATE_RC(); 1440 1442 rc = CFGMR3InsertString(pCfg, "BootDevice1", "NONE"); UPDATE_RC(); … … 1458 1460 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1459 1461 rc = CFGMR3InsertInteger(pCfg, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1462 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", 512U * _1M); UPDATE_RC(); 1460 1463 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); UPDATE_RC(); 1461 1464 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); UPDATE_RC(); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r17539 r17542 80 80 #endif 81 81 82 #include <VBox/param.h> 83 84 82 85 /** 83 86 * Translate IDEControllerType_T to string representation. 84 87 */ 85 const char *controllerString(IDEControllerType_T enmType)88 const char *controllerString(IDEControllerType_T enmType) 86 89 { 87 90 switch (enmType) … … 97 100 } 98 101 } 102 99 103 /* 100 104 * VC++ 8 / amd64 has some serious trouble with this function. … … 184 188 #endif 185 189 uint64_t const cbRam = cRamMBs * (uint64_t)_1M; 190 uint32_t const cbRamHole = MM_RAM_HOLE_SIZE_DEFAULT; 186 191 187 192 ULONG cCpus = 1; … … 206 211 rc = CFGMR3InsertBytes(pRoot, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK(); 207 212 rc = CFGMR3InsertInteger(pRoot, "RamSize", cbRam); RC_CHECK(); 213 rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", cbRamHole); RC_CHECK(); 208 214 rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK(); 209 215 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK(); … … 367 373 rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK(); 368 374 rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cbRam); RC_CHECK(); 375 rc = CFGMR3InsertInteger(pBiosCfg, "RamHoleSize", cbRamHole); RC_CHECK(); 369 376 rc = CFGMR3InsertInteger(pBiosCfg, "NumCPUs", cCpus); RC_CHECK(); 370 377 rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK(); … … 631 638 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 632 639 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK(); 640 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK(); 633 641 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK(); 634 642
Note:
See TracChangeset
for help on using the changeset viewer.