VirtualBox

儲存庫 vbox 的更動 12239


忽略:
時間撮記:
2008-9-8 下午05:02:19 (16 年 以前)
作者:
vboxsync
訊息:

BIOS: Disabled the above 4GB memory change. This depends on PGM (and possibly MM) and therefore won't work yet. We'll get back to this later.

位置:
trunk/src/VBox/Devices/PC
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r12233 r12239  
    45594559    write_word(ES, DI, start);
    45604560    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? */
    45624562    write_word(ES, DI+4, extra_start);
    45634563    write_word(ES, DI+6, 0x00);
     
    45714571        write_word(ES, DI+12, 0x0001);
    45724572    else
    4573         // XXX: nike - is it really correct? see QEMU BIOS patch
     4573        /** @todo XXX: nike - is it really correct? see QEMU BIOS patch */
    45744574        write_word(ES, DI+12, extra_end);
    45754575#else /* !VBOX */
     
    45884588{
    45894589  Bit32u  extended_memory_size=0; // 64bits long
     4590#if 0  /* bird: later */
    45904591  Bit32u  extra_lowbits_memory_size=0;
     4592#endif
    45914593  Bit16u  CX,DX;
     4594#if 0  /* bird: later */
    45924595  Bit8u   extra_highbits_memory_size=0;
     4596#endif
    45934597
    45944598BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.r16.ax);
     
    46644668                }
    46654669
     4670#if 0 /* bird: later (btw. this ain't making sense complixity wise, unless its a AMI/AWARD/PHOENIX interface) */
    46664671                extra_lowbits_memory_size = inb_cmos(0x61);
    46674672                extra_lowbits_memory_size <<= 8;
     
    46704675                extra_lowbits_memory_size *= 1024;
    46714676                extra_highbits_memory_size = inb_cmos(0x63);
     4677#endif
    46724678
    46734679                switch(regs.u.r16.bx)
     
    47164722                        set_e820_range(ES, regs.u.r16.di,
    47174723                                       0x00100000L,
    4718                                        extended_memory_size - ACPI_DATA_SIZE ,0, 0, 1);
     4724                                       extended_memory_size - ACPI_DATA_SIZE, 0, 0, 1);
    47194725                        regs.u.r32.ebx = 4;
    47204726                        regs.u.r32.eax = 0x534D4150;
     
    47374743                        set_e820_range(ES, regs.u.r16.di,
    47384744                                       0xfffc0000L, 0x00000000L, 0, 0, 2);
     4745#if 0 /* bird: later */
    47394746                        if (extra_highbits_memory_size || extra_lowbits_memory_size)
    47404747                            regs.u.r32.ebx = 6;
    47414748                        else
     4749#endif
    47424750                            regs.u.r32.ebx = 0;
    47434751                        regs.u.r32.eax = 0x534D4150;
     
    47454753                        CLEAR_CF();
    47464754                        return;
     4755#if 0 /* bird: later */
    47474756                    case 6:
    4748                         /* Maping 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,
    47514760                                       1, extra_highbits_memory_size + 1, 1);
    47524761                        regs.u.r32.ebx = 0;
     
    47554764                        CLEAR_CF();
    47564765                        return;
     4766#endif
    47574767                    default:  /* AX=E820, DX=534D4150, BX unrecognized */
    47584768                        goto int15_unimplemented;
     
    83228332  // signature. In general, it is impossible to tell a valid bootsector
    83238333  // 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
    83268336  // rest of the boot sector. We do a quick check by comparing the first
    83278337  // two words of boot sector; if identical, the boot sector is
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r12236 r12239  
    4545 * The BIOS uses a CMOS to store configuration data.
    4646 * It is currently used as follows:
     47 *
     48 * @todo Mark which bits are compatible with which BIOSes and
     49 *       which are our own definitions.
    4750 *
    4851 *     Base memory:
     
    9194 *     RAM above 4G (in 64M units):
    9295 *          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.
    93101 */
    94102
     
    155163    uint8_t        u8PXEDebug;
    156164    /** Number of logical CPUs in guest */
    157     uint16_t       u16numCPUs;
     165    uint16_t       cCpus;
    158166} DEVPCBIOS, *PDEVPCBIOS;
    159167
     
    502510     * Memory sizes.
    503511     */
    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);
    510521    }
    511522    else
    512523    {
    513         above4GInK = 0;
    514         below4GInK = ramInK;
    515     }
    516 
     524        cKBAbove4GB = 0;
     525        cKBBelow4GB = cKBRam;
     526    }
    517527
    518528    /* base memory. */
    519     u32 = below4GInK > 640 ? 640 : (uint32_t)below4GInK;
     529    u32 = cKBBelow4GB > 640 ? 640 : cKBBelow4GB;
    520530    pcbiosCmosWrite(pDevIns, 0x15, u32 & 0xff);                                 /* 15h - Base Memory in K, Low Byte */
    521531    pcbiosCmosWrite(pDevIns, 0x16, u32 >> 8);                                   /* 16h - Base Memory in K, High Byte */
    522532
    523533    /* Extended memory, up to 65MB */
    524     u32 = below4GInK >= 65 * _1K ? 0xffff : ((uint32_t)below4GInK - _1K);
     534    u32 = cKBBelow4GB >= 65 * _1K ? 0xffff : (cKBBelow4GB - _1K);
    525535    pcbiosCmosWrite(pDevIns, 0x17, u32 & 0xff);                                 /* 17h - Extended Memory in K, Low Byte */
    526536    pcbiosCmosWrite(pDevIns, 0x18, u32 >> 8);                                   /* 18h - Extended Memory in K, High Byte */
     
    529539
    530540    /* 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 );
    534544        u32 = RT_MIN(u32, 0xffff);
    535545    }
     
    539549    pcbiosCmosWrite(pDevIns, 0x35, u32 >> 8);
    540550
    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 */
    545580
    546581    /*
    547582     * Number of CPUs.
    548583     */
    549     pcbiosCmosWrite(pDevIns, 0x60, pThis->u16numCPUs & 0xff);
     584    pcbiosCmosWrite(pDevIns, 0x60, pThis->cCpus & 0xff);
    550585
    551586    /*
     
    13081343                              "UUID\0"
    13091344                              "IOAPIC\0"
     1345                              "NumCPUs\0"
    13101346                              "DmiBIOSVendor\0"
    13111347                              "DmiBIOSVersion\0"
     
    13321368                                N_("Configuration error: Querying \"RamSize\" as integer failed"));
    13331369
    1334 #if 0
    1335     rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &pThis->u16numCPUs, 1);
     1370    rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &pThis->cCpus, 1);
    13361371    if (RT_FAILURE(rc))
    13371372        return PDMDEV_SET_ERROR(pDevIns, rc,
    13381373                                N_("Configuration error: Querying \"NumCPUs\" as integer failed"));
    1339 #else
    1340     pThis->u16numCPUs = 1;
    1341 #endif
    13421374
    13431375    rc = CFGMR3QueryU8Def(pCfgHandle, "IOAPIC", &pThis->u8IOAPIC, 1);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette