Changeset 65859 in vbox for trunk/src/VBox/Devices/PC/DevPcBios.cpp
- Timestamp:
- Feb 23, 2017 12:35:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r65850 r65859 627 627 /* base memory. */ 628 628 u32 = cbRamSize > 640 ? 640 : (uint32_t)cbRamSize / _1K; /* <-- this test is wrong, but it doesn't matter since we never assign less than 1MB */ 629 pcbiosCmosWrite(pDevIns, 0x15, u32 & 0xff);/* 15h - Base Memory in K, Low Byte */630 pcbiosCmosWrite(pDevIns, 0x16, u32 >> 8);/* 16h - Base Memory in K, High Byte */629 pcbiosCmosWrite(pDevIns, 0x15, RT_BYTE1(u32)); /* 15h - Base Memory in K, Low Byte */ 630 pcbiosCmosWrite(pDevIns, 0x16, RT_BYTE2(u32)); /* 16h - Base Memory in K, High Byte */ 631 631 632 632 /* Extended memory, up to 65MB */ 633 633 u32 = cbRamSize >= 65 * _1M ? 0xffff : ((uint32_t)cbRamSize - _1M) / _1K; 634 pcbiosCmosWrite(pDevIns, 0x17, u32 & 0xff);/* 17h - Extended Memory in K, Low Byte */635 pcbiosCmosWrite(pDevIns, 0x18, u32 >> 8);/* 18h - Extended Memory in K, High Byte */636 pcbiosCmosWrite(pDevIns, 0x30, u32 & 0xff);/* 30h - Extended Memory in K, Low Byte */637 pcbiosCmosWrite(pDevIns, 0x31, u32 >> 8);/* 31h - Extended Memory in K, High Byte */634 pcbiosCmosWrite(pDevIns, 0x17, RT_BYTE1(u32)); /* 17h - Extended Memory in K, Low Byte */ 635 pcbiosCmosWrite(pDevIns, 0x18, RT_BYTE2(u32)); /* 18h - Extended Memory in K, High Byte */ 636 pcbiosCmosWrite(pDevIns, 0x30, RT_BYTE1(u32)); /* 30h - Extended Memory in K, Low Byte */ 637 pcbiosCmosWrite(pDevIns, 0x31, RT_BYTE2(u32)); /* 31h - Extended Memory in K, High Byte */ 638 638 639 639 /* Bochs BIOS specific? Anyway, it's the amount of memory above 16MB … … 646 646 else 647 647 u32 = 0; 648 pcbiosCmosWrite(pDevIns, 0x34, u32 & 0xff);649 pcbiosCmosWrite(pDevIns, 0x35, u32 >> 8);648 pcbiosCmosWrite(pDevIns, 0x34, RT_BYTE1(u32)); 649 pcbiosCmosWrite(pDevIns, 0x35, RT_BYTE2(u32)); 650 650 651 651 /* Bochs/VBox BIOS specific way of specifying memory above 4GB in 64KB units. … … 655 655 /* Make sure it doesn't hit the limits of the current BIOS code (RAM limit of ~255TB). */ 656 656 AssertLogRelMsgReturn((c64KBAbove4GB >> (3 * 8)) < 255, ("%#RX64\n", c64KBAbove4GB), VERR_OUT_OF_RANGE); 657 pcbiosCmosWrite(pDevIns, 0x61, c64KBAbove4GB & 0xff);658 pcbiosCmosWrite(pDevIns, 0x62, (c64KBAbove4GB >> 8) & 0xff);659 pcbiosCmosWrite(pDevIns, 0x63, (c64KBAbove4GB >> 16) & 0xff);660 pcbiosCmosWrite(pDevIns, 0x64, (c64KBAbove4GB >> 24) & 0xff);661 pcbiosCmosWrite(pDevIns, 0x65, (c64KBAbove4GB >> 32) & 0xff);657 pcbiosCmosWrite(pDevIns, 0x61, RT_BYTE1(c64KBAbove4GB)); 658 pcbiosCmosWrite(pDevIns, 0x62, RT_BYTE2(c64KBAbove4GB)); 659 pcbiosCmosWrite(pDevIns, 0x63, RT_BYTE3(c64KBAbove4GB)); 660 pcbiosCmosWrite(pDevIns, 0x64, RT_BYTE4(c64KBAbove4GB)); 661 pcbiosCmosWrite(pDevIns, 0x65, RT_BYTE5(c64KBAbove4GB)); 662 662 663 663 /* … … 695 695 for (i = 0; i < NET_BOOT_DEVS; ++i) 696 696 { 697 pcbiosCmosWrite(pDevIns, 0x82 + i * 2, pThis->au16NetBootDev[i] & 0xff);698 pcbiosCmosWrite(pDevIns, 0x83 + i * 2, pThis->au16NetBootDev[i] >> 8);697 pcbiosCmosWrite(pDevIns, 0x82 + i * 2, RT_BYTE1(pThis->au16NetBootDev[i])); 698 pcbiosCmosWrite(pDevIns, 0x83 + i * 2, RT_BYTE2(pThis->au16NetBootDev[i])); 699 699 } 700 700 … … 912 912 for (i = 0x10; i < 0x2e; ++i) 913 913 cksum += pcbiosCmosRead(pDevIns, i); 914 pcbiosCmosWrite(pDevIns, 0x2e, cksum >> 8);915 pcbiosCmosWrite(pDevIns, 0x2f, cksum & 0xff);914 pcbiosCmosWrite(pDevIns, 0x2e, RT_BYTE1(cksum)); 915 pcbiosCmosWrite(pDevIns, 0x2f, RT_BYTE2(cksum)); 916 916 917 917 LogFlow(("%s: returns VINF_SUCCESS\n", __FUNCTION__));
Note:
See TracChangeset
for help on using the changeset viewer.