儲存庫 vbox 的更動 12239
- 時間撮記:
- 2008-9-8 下午05:02:19 (16 年 以前)
- 位置:
- trunk/src/VBox/Devices/PC
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/PC/BIOS/rombios.c
r12233 r12239 4559 4559 write_word(ES, DI, start); 4560 4560 write_word(ES, DI+2, start >> 16); 4561 write_word(ES, DI+4, 0x00); 4561 write_word(ES, DI+4, 0x00); /** @todo r=bird: why write it twice? */ 4562 4562 write_word(ES, DI+4, extra_start); 4563 4563 write_word(ES, DI+6, 0x00); … … 4571 4571 write_word(ES, DI+12, 0x0001); 4572 4572 else 4573 / / XXX: nike - is it really correct? see QEMU BIOS patch4573 /** @todo XXX: nike - is it really correct? see QEMU BIOS patch */ 4574 4574 write_word(ES, DI+12, extra_end); 4575 4575 #else /* !VBOX */ … … 4588 4588 { 4589 4589 Bit32u extended_memory_size=0; // 64bits long 4590 #if 0 /* bird: later */ 4590 4591 Bit32u extra_lowbits_memory_size=0; 4592 #endif 4591 4593 Bit16u CX,DX; 4594 #if 0 /* bird: later */ 4592 4595 Bit8u extra_highbits_memory_size=0; 4596 #endif 4593 4597 4594 4598 BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.r16.ax); … … 4664 4668 } 4665 4669 4670 #if 0 /* bird: later (btw. this ain't making sense complixity wise, unless its a AMI/AWARD/PHOENIX interface) */ 4666 4671 extra_lowbits_memory_size = inb_cmos(0x61); 4667 4672 extra_lowbits_memory_size <<= 8; … … 4670 4675 extra_lowbits_memory_size *= 1024; 4671 4676 extra_highbits_memory_size = inb_cmos(0x63); 4677 #endif 4672 4678 4673 4679 switch(regs.u.r16.bx) … … 4716 4722 set_e820_range(ES, regs.u.r16.di, 4717 4723 0x00100000L, 4718 extended_memory_size - ACPI_DATA_SIZE ,0, 0, 1);4724 extended_memory_size - ACPI_DATA_SIZE, 0, 0, 1); 4719 4725 regs.u.r32.ebx = 4; 4720 4726 regs.u.r32.eax = 0x534D4150; … … 4737 4743 set_e820_range(ES, regs.u.r16.di, 4738 4744 0xfffc0000L, 0x00000000L, 0, 0, 2); 4745 #if 0 /* bird: later */ 4739 4746 if (extra_highbits_memory_size || extra_lowbits_memory_size) 4740 4747 regs.u.r32.ebx = 6; 4741 4748 else 4749 #endif 4742 4750 regs.u.r32.ebx = 0; 4743 4751 regs.u.r32.eax = 0x534D4150; … … 4745 4753 CLEAR_CF(); 4746 4754 return; 4755 #if 0 /* bird: later */ 4747 4756 case 6: 4748 /* Map ing of memory above 4 GB */4749 set_e820_range(ES, regs.u.r16.di, 4750 0x00000000L, extra_lowbits_memory_size, 4757 /* Mapping of memory above 4 GB */ 4758 set_e820_range(ES, regs.u.r16.di, 4759 0x00000000L, extra_lowbits_memory_size, 4751 4760 1, extra_highbits_memory_size + 1, 1); 4752 4761 regs.u.r32.ebx = 0; … … 4755 4764 CLEAR_CF(); 4756 4765 return; 4766 #endif 4757 4767 default: /* AX=E820, DX=534D4150, BX unrecognized */ 4758 4768 goto int15_unimplemented; … … 8322 8332 // signature. In general, it is impossible to tell a valid bootsector 8323 8333 // from an invalid one. 8324 // NB: It is somewhat common for failed OS installs to have the 8325 // 0x55AA signature and a valid partition table but zeros in the 8334 // NB: It is somewhat common for failed OS installs to have the 8335 // 0x55AA signature and a valid partition table but zeros in the 8326 8336 // rest of the boot sector. We do a quick check by comparing the first 8327 8337 // two words of boot sector; if identical, the boot sector is -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r12236 r12239 45 45 * The BIOS uses a CMOS to store configuration data. 46 46 * It is currently used as follows: 47 * 48 * @todo Mark which bits are compatible with which BIOSes and 49 * which are our own definitions. 47 50 * 48 51 * Base memory: … … 91 94 * RAM above 4G (in 64M units): 92 95 * 0x61 - 0x63 96 * 97 * @todo r=bird: Is the 0x61 - 0x63 range defined by AMI, 98 * PHOENIX or AWARD? If not I'd say 64MB units is a bit 99 * too big, besides it forces unnecessary math stuff onto 100 * the BIOS. 93 101 */ 94 102 … … 155 163 uint8_t u8PXEDebug; 156 164 /** Number of logical CPUs in guest */ 157 uint16_t u16numCPUs;165 uint16_t cCpus; 158 166 } DEVPCBIOS, *PDEVPCBIOS; 159 167 … … 502 510 * Memory sizes. 503 511 */ 504 uint64_t ramInK = pThis->cbRam / _1K; 505 uint64_t above4GInK, below4GInK; 506 if (ramInK > 0xe0000000) 507 { 508 above4GInK = ramInK - 0xe0000000; 509 below4GInK = 0xe0000000; 512 #if 0 513 uint64_t cKBRam = pThis->cbRam / _1K; 514 uint64_t cKBAbove4GB = 0; 515 uint32_t cKBBelow4GB = cKBRam; 516 AssertRelease(cKBBelow4GB == cKBRam); 517 if (cKBRam > UINT32_C(0xe0000000)) /** @todo this limit must be picked up from CFGM and coordinated with MM/PGM! */ 518 { 519 cKBAbove4GB = cKBRam - UINT32_C(0xe0000000); 520 cKBBelow4GB = UINT32_C(0xe0000000); 510 521 } 511 522 else 512 523 { 513 above4GInK = 0; 514 below4GInK = ramInK; 515 } 516 524 cKBAbove4GB = 0; 525 cKBBelow4GB = cKBRam; 526 } 517 527 518 528 /* base memory. */ 519 u32 = below4GInK > 640 ? 640 : (uint32_t)below4GInK;529 u32 = cKBBelow4GB > 640 ? 640 : cKBBelow4GB; 520 530 pcbiosCmosWrite(pDevIns, 0x15, u32 & 0xff); /* 15h - Base Memory in K, Low Byte */ 521 531 pcbiosCmosWrite(pDevIns, 0x16, u32 >> 8); /* 16h - Base Memory in K, High Byte */ 522 532 523 533 /* Extended memory, up to 65MB */ 524 u32 = below4GInK >= 65 * _1K ? 0xffff : ((uint32_t)below4GInK- _1K);534 u32 = cKBBelow4GB >= 65 * _1K ? 0xffff : (cKBBelow4GB - _1K); 525 535 pcbiosCmosWrite(pDevIns, 0x17, u32 & 0xff); /* 17h - Extended Memory in K, Low Byte */ 526 536 pcbiosCmosWrite(pDevIns, 0x18, u32 >> 8); /* 18h - Extended Memory in K, High Byte */ … … 529 539 530 540 /* Bochs BIOS specific? Anyway, it's the amount of memory above 16MB */ 531 if ( below4GInK> 16 * _1K)532 { 533 u32 = (uint32_t)( ( below4GInK- 16 * _1K) / 64 );541 if (cKBBelow4GB > 16 * _1K) 542 { 543 u32 = (uint32_t)( (cKBBelow4GB - 16 * _1K) / 64 ); 534 544 u32 = RT_MIN(u32, 0xffff); 535 545 } … … 539 549 pcbiosCmosWrite(pDevIns, 0x35, u32 >> 8); 540 550 541 /* RAM above 4G */ 542 pcbiosCmosWrite(pDevIns, 0x61, above4GInK >> 16); 543 pcbiosCmosWrite(pDevIns, 0x62, above4GInK >> 24); 544 pcbiosCmosWrite(pDevIns, 0x63, above4GInK >> 32); 551 /* RAM above 4G, in 64MB units (needs discussing, see comments and @todos elsewhere). */ 552 pcbiosCmosWrite(pDevIns, 0x61, cKBAbove4GB >> 16); 553 pcbiosCmosWrite(pDevIns, 0x62, cKBAbove4GB >> 24); 554 pcbiosCmosWrite(pDevIns, 0x63, cKBAbove4GB >> 32); 555 556 #else /* old code. */ 557 /* base memory. */ 558 u32 = pThis->cbRam > 640 ? 640 : (uint32_t)pThis->cbRam / _1K; /* <-- this test is wrong, but it doesn't matter since we never assign less than 1MB */ 559 pcbiosCmosWrite(pDevIns, 0x15, u32 & 0xff); /* 15h - Base Memory in K, Low Byte */ 560 pcbiosCmosWrite(pDevIns, 0x16, u32 >> 8); /* 16h - Base Memory in K, High Byte */ 561 562 /* Extended memory, up to 65MB */ 563 u32 = pThis->cbRam >= 65 * _1M ? 0xffff : ((uint32_t)pThis->cbRam - _1M) / _1K; 564 pcbiosCmosWrite(pDevIns, 0x17, u32 & 0xff); /* 17h - Extended Memory in K, Low Byte */ 565 pcbiosCmosWrite(pDevIns, 0x18, u32 >> 8); /* 18h - Extended Memory in K, High Byte */ 566 pcbiosCmosWrite(pDevIns, 0x30, u32 & 0xff); /* 30h - Extended Memory in K, Low Byte */ 567 pcbiosCmosWrite(pDevIns, 0x31, u32 >> 8); /* 31h - Extended Memory in K, High Byte */ 568 569 /* Bochs BIOS specific? Anyway, it's the amount of memory above 16MB */ 570 if (pThis->cbRam > 16 * _1M) 571 { 572 u32 = (uint32_t)( (pThis->cbRam - 16 * _1M) / _64K ); 573 u32 = RT_MIN(u32, 0xffff); 574 } 575 else 576 u32 = 0; 577 pcbiosCmosWrite(pDevIns, 0x34, u32 & 0xff); 578 pcbiosCmosWrite(pDevIns, 0x35, u32 >> 8); 579 #endif /* old code */ 545 580 546 581 /* 547 582 * Number of CPUs. 548 583 */ 549 pcbiosCmosWrite(pDevIns, 0x60, pThis-> u16numCPUs & 0xff);584 pcbiosCmosWrite(pDevIns, 0x60, pThis->cCpus & 0xff); 550 585 551 586 /* … … 1308 1343 "UUID\0" 1309 1344 "IOAPIC\0" 1345 "NumCPUs\0" 1310 1346 "DmiBIOSVendor\0" 1311 1347 "DmiBIOSVersion\0" … … 1332 1368 N_("Configuration error: Querying \"RamSize\" as integer failed")); 1333 1369 1334 #if 0 1335 rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &pThis->u16numCPUs, 1); 1370 rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &pThis->cCpus, 1); 1336 1371 if (RT_FAILURE(rc)) 1337 1372 return PDMDEV_SET_ERROR(pDevIns, rc, 1338 1373 N_("Configuration error: Querying \"NumCPUs\" as integer failed")); 1339 #else1340 pThis->u16numCPUs = 1;1341 #endif1342 1374 1343 1375 rc = CFGMR3QueryU8Def(pCfgHandle, "IOAPIC", &pThis->u8IOAPIC, 1);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器